From 2eb720d8b488f9a266f2d19ae259549cebbedaee Mon Sep 17 00:00:00 2001
From: Amaury Pouly <amaury.pouly@lowrisc.org>
Date: Tue, 24 Sep 2024 12:52:46 +0000
Subject: [PATCH] EB

Signed-off-by: Amaury Pouly <amaury.pouly@lowrisc.org>
---
 sw/device/lib/testing/test_rom/BUILD               | 10 +++++-----
 sw/device/silicon_creator/lib/drivers/flash_ctrl.c |  4 +++-
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/sw/device/lib/testing/test_rom/BUILD b/sw/device/lib/testing/test_rom/BUILD
index 58625d647618b4..c63cb3e084bb2a 100644
--- a/sw/device/lib/testing/test_rom/BUILD
+++ b/sw/device/lib/testing/test_rom/BUILD
@@ -162,11 +162,11 @@ cc_library(
         "//hw/ip/entropy_src/data:entropy_src_c_regs",
         "//hw/ip/otp_ctrl/data:otp_ctrl_c_regs",
         "//hw/ip/sram_ctrl/data:sram_ctrl_c_regs",
-        "//hw/top_earlgrey/ip/ast/data:ast_c_regs",
-        "//hw/top_earlgrey/ip/sensor_ctrl/data:sensor_ctrl_c_regs",
-        "//hw/top_earlgrey/ip_autogen/clkmgr:clkmgr_c_regs",
-        "//hw/top_earlgrey/ip_autogen/flash_ctrl:flash_ctrl_c_regs",
-        "//hw/top_earlgrey/sw/autogen:top_earlgrey",
+        "//hw/top:ast_c_regs",
+        "//hw/top:sensor_ctrl_c_regs",
+        "//hw/top:clkmgr_c_regs",
+        "//hw/top:flash_ctrl_c_regs",
+        "//hw/top:top_lib",
         "//sw/device/lib/arch:device",
         "//sw/device/lib/base:abs_mmio",
         "//sw/device/lib/base:bitfield",
diff --git a/sw/device/silicon_creator/lib/drivers/flash_ctrl.c b/sw/device/silicon_creator/lib/drivers/flash_ctrl.c
index 6e7ab33442d528..d027a1aa31cfc1 100644
--- a/sw/device/silicon_creator/lib/drivers/flash_ctrl.c
+++ b/sw/device/silicon_creator/lib/drivers/flash_ctrl.c
@@ -43,8 +43,10 @@ enum {
    */
 #ifdef OT_IS_ENGLISH_BREAKFAST
   kBase = TOP_ENGLISHBREAKFAST_FLASH_CTRL_CORE_BASE_ADDR,
+  kBaseMem = TOP_ENGLISHBREAKFAST_FLASH_CTRL_MEM_BASE_ADDR
 #else
   kBase = TOP_EARLGREY_FLASH_CTRL_CORE_BASE_ADDR,
+  kBaseMem = TOP_EARLGREY_FLASH_CTRL_MEM_BASE_ADDR
 #endif
 };
 
@@ -425,7 +427,7 @@ rom_error_t flash_ctrl_data_erase_verify(uint32_t addr,
   for (; launder32(i) < byte_count && launder32(r) < byte_count;
        i += sizeof(uint32_t), r -= sizeof(uint32_t)) {
     uint32_t word =
-        abs_mmio_read32(TOP_EARLGREY_FLASH_CTRL_MEM_BASE_ADDR + addr + i);
+        abs_mmio_read32(kBaseMem + addr + i);
     mask &= word;
     error &= word;
   }