Skip to content

Commit

Permalink
EB test_rom WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Amaury Pouly <[email protected]>
  • Loading branch information
pamaury committed Sep 20, 2024
1 parent e1e6345 commit 7943ac2
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 8 deletions.
16 changes: 14 additions & 2 deletions sw/device/lib/dif/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ cc_test(
":test_base",
"@googletest//:gtest_main",
],
# This test is not compatible with english_breakfast
target_compatible_with = select({
"//sw/device:is_english_breakfast": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
)

cc_library(
Expand Down Expand Up @@ -820,7 +825,10 @@ cc_library(
name = "rstmgr_intf",
srcs = ["autogen/dif_rstmgr_autogen.h"],
hdrs = ["dif_rstmgr.h"],
deps = [":base"],
deps = [
":base",
"//hw/top:rstmgr_dt",
],
)

cc_library(
Expand All @@ -833,7 +841,6 @@ cc_library(
":base",
":rstmgr_intf",
"//hw/top:rstmgr_c_regs",
"//hw/top:rstmgr_dt",
"//sw/device/lib/base:bitfield",
"//sw/device/lib/base:macros",
"//sw/device/lib/base:memory",
Expand Down Expand Up @@ -953,6 +960,11 @@ cc_test(
":test_base",
"@googletest//:gtest_main",
],
# This test is not compatible with english_breakfast
target_compatible_with = select({
"//sw/device:is_english_breakfast": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
)

cc_library(
Expand Down
8 changes: 4 additions & 4 deletions sw/device/lib/testing/test_rom/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ cc_library(
"//hw/ip/gpio/data:gpio_c_regs",
"//hw/ip/otp_ctrl/data:otp_ctrl_c_regs",
"//hw/ip/spi_device/data:spi_device_c_regs",
"//hw/top_englishbreakfast:flash_ctrl_c_regs",
"//hw/top_englishbreakfast:top_lib",
"//hw/top_englishbreakfast/ip_autogen/flash_ctrl:flash_ctrl_c_regs",
"//hw/top_englishbreakfast/sw/autogen:top_englishbreakfast",
"//sw/device/lib/base:abs_mmio",
"//sw/device/lib/base:multibits",
"//sw/device/lib/dif:rstmgr_intf",
Expand Down Expand Up @@ -123,8 +123,8 @@ cc_library(
deps = [
"//hw/ip/otp_ctrl/data:otp_ctrl_c_regs",
"//hw/ip/spi_device/data:spi_device_c_regs",
"//hw/top_englishbreakfast:flash_ctrl_c_regs",
"//hw/top_englishbreakfast:top_lib",
"//hw/top_englishbreakfast/ip_autogen/flash_ctrl:flash_ctrl_c_regs",
"//hw/top_englishbreakfast/sw/autogen:top_englishbreakfast",
"//sw/device/lib/base:abs_mmio",
"//sw/device/lib/base:macros",
"//sw/device/lib/base:multibits",
Expand Down
11 changes: 10 additions & 1 deletion sw/device/silicon_creator/lib/drivers/flash_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@
#include "sw/device/silicon_creator/lib/error.h"

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

#ifdef OT_IS_ENGLISH_BREAKFAST
#include "hw/top_englishbreakfast/sw/autogen/top_englishbreakfast.h"
#else
#include "hw/top_earlgrey/sw/autogen/top_earlgrey.h"
#endif

// Values of `flash_ctrl_partition_t` constants must be distinct from each
// other, and `kFlashCtrlRegionInfo* >> 1` should give the correct
// CONTROL.INFO_SEL value.
Expand All @@ -36,7 +41,11 @@ enum {
/**
* Base address of the flash_ctrl registers.
*/
#ifdef OT_IS_ENGLISH_BREAKFAST
kBase = TOP_ENGLISHBREAKFAST_FLASH_CTRL_CORE_BASE_ADDR,
#else
kBase = TOP_EARLGREY_FLASH_CTRL_CORE_BASE_ADDR,
#endif
};

/**
Expand Down
9 changes: 9 additions & 0 deletions sw/device/silicon_creator/lib/drivers/flash_ctrl_info_pages.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,22 @@
#include "sw/device/silicon_creator/lib/drivers/flash_ctrl.h"

#include "flash_ctrl_regs.h"

#ifdef OT_IS_ENGLISH_BREAKFAST
#include "hw/top_englishbreakfast/sw/autogen/top_englishbreakfast.h"
#else
#include "hw/top_earlgrey/sw/autogen/top_earlgrey.h"
#endif

enum {
/**
* Base address of the flash_ctrl registers.
*/
#ifdef OT_IS_ENGLISH_BREAKFAST
kBase = TOP_ENGLISHBREAKFAST_FLASH_CTRL_CORE_BASE_ADDR,
#else
kBase = TOP_EARLGREY_FLASH_CTRL_CORE_BASE_ADDR,
#endif
};

#define INFO_PAGE_STRUCT_(name_, bank_, page_) \
Expand Down
11 changes: 10 additions & 1 deletion sw/device/silicon_creator/lib/drivers/spi_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,23 @@
#include "sw/device/silicon_creator/lib/error.h"

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

#ifdef OT_IS_ENGLISH_BREAKFAST
#include "hw/top_englishbreakfast/sw/autogen/top_englishbreakfast.h"
#else
#include "hw/top_earlgrey/sw/autogen/top_earlgrey.h"
#endif

enum {
/**
* Base address of the spi_device registers.
*/
#ifdef OT_IS_ENGLISH_BREAKFAST
kBase = TOP_ENGLISHBREAKFAST_SPI_DEVICE_BASE_ADDR,
#else
kBase = TOP_EARLGREY_SPI_DEVICE_BASE_ADDR,
#endif
/**
* Start address of the SFDP space in spi_device buffer.
*/
Expand Down

0 comments on commit 7943ac2

Please sign in to comment.