Skip to content

Commit

Permalink
[ownership] Compute correct flash INFO page addresses
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Frantz <[email protected]>
(cherry picked from commit 53e28be)
  • Loading branch information
cfrantz committed Nov 22, 2024
1 parent eef6aeb commit f793a4e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions sw/device/silicon_creator/lib/ownership/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ cc_library(
hdrs = ["owner_block.h"],
deps = [
":datatypes",
"//hw/top_earlgrey/sw/autogen:top_earlgrey",
"//sw/device/lib/base:bitfield",
"//sw/device/lib/base:hardened",
"//sw/device/lib/base:hardened_memory",
Expand Down
5 changes: 4 additions & 1 deletion sw/device/silicon_creator/lib/ownership/owner_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "sw/device/silicon_creator/lib/error.h"

#include "flash_ctrl_regs.h"
#include "hw/top_earlgrey/sw/autogen/top_earlgrey.h"

// RAM copy of the owner INFO pages from flash.
owner_block_t owner_page[2];
Expand Down Expand Up @@ -272,10 +273,12 @@ rom_error_t owner_block_info_apply(const owner_flash_info_config_t *info) {
.base_addr = config->bank * FLASH_CTRL_PARAM_BYTES_PER_BANK +
config->page * FLASH_CTRL_PARAM_BYTES_PER_PAGE,
.cfg_wen_addr =
TOP_EARLGREY_FLASH_CTRL_CORE_BASE_ADDR +
config->page * sizeof(uint32_t) +
(config->bank == 0 ? FLASH_CTRL_BANK0_INFO0_REGWEN_0_REG_OFFSET
: FLASH_CTRL_BANK1_INFO0_REGWEN_0_REG_OFFSET),
.cfg_addr = config->page * sizeof(uint32_t) +
.cfg_addr = TOP_EARLGREY_FLASH_CTRL_CORE_BASE_ADDR +
config->page * sizeof(uint32_t) +
(config->bank == 0
? FLASH_CTRL_BANK0_INFO0_PAGE_CFG_0_REG_OFFSET
: FLASH_CTRL_BANK1_INFO0_PAGE_CFG_0_REG_OFFSET),
Expand Down

0 comments on commit f793a4e

Please sign in to comment.