Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fel: h616: support alternative die variant #199

Merged
merged 1 commit into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions fel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,14 @@ void aw_rmr_request(feldev_handle *dev, uint32_t entry_point, bool aarch64)
dev->soc_name);
return;
}
/* The H616 has two die variants with different RVBAR locations. */
uint32_t rvbar_reg = soc_info->rvbar_reg;
if (soc_info->rvbar_reg_alt) {
uint32_t ver_reg = fel_readl(dev, soc_info->ver_reg);

if (ver_reg & 0xff)
rvbar_reg = soc_info->rvbar_reg_alt;
}

uint32_t rmr_mode = (1 << 1) | (aarch64 ? 1 : 0); /* RR, AA64 flag */
uint32_t arm_code[] = {
Expand All @@ -1119,7 +1127,7 @@ void aw_rmr_request(feldev_handle *dev, uint32_t entry_point, bool aarch64)
htole32(0xe320f003), /* loop: wfi */
htole32(0xeafffffd), /* b <loop> */

htole32(soc_info->rvbar_reg),
htole32(rvbar_reg),
htole32(entry_point),
htole32(rmr_mode)
};
Expand All @@ -1128,7 +1136,7 @@ void aw_rmr_request(feldev_handle *dev, uint32_t entry_point, bool aarch64)
/* execute the thunk code (triggering a warm reset on the SoC) */
pr_info("Store entry point 0x%08X to RVBAR 0x%08X, "
"and request warm reset with RMR mode %u...",
entry_point, soc_info->rvbar_reg, rmr_mode);
entry_point, rvbar_reg, rmr_mode);
aw_fel_execute(dev, soc_info->scratch_addr);
pr_info(" done.\n");
}
Expand Down
2 changes: 2 additions & 0 deletions soc_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,8 @@ soc_info_t soc_info_table[] = {
.sid_offset = 0x200,
.sid_sections = generic_2k_sid_maps,
.rvbar_reg = 0x09010040,
.rvbar_reg_alt= 0x08100040,
.ver_reg = 0x03000024,
.watchdog = &wd_h6_compat,
},{
.soc_id = 0x1851, /* Allwinner R329 */
Expand Down
2 changes: 2 additions & 0 deletions soc_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ typedef struct {
uint32_t sid_offset; /* offset for SID_KEY[0-3], "root key" */
const sid_section *sid_sections; /* sid memory maps */
uint32_t rvbar_reg; /* MMIO address of RVBARADDR0_L register */
uint32_t rvbar_reg_alt;/* alternative MMIO address of RVBARADDR0_L register */
uint32_t ver_reg; /* MMIO address of "Version Register" */
const watchdog_info *watchdog; /* Used for reset */
bool sid_fix; /* Use SID workaround (read via register) */
/* Use I$ workaround (disable I$ before first write to prevent stale thunk */
Expand Down
Loading