Skip to content

Commit

Permalink
[ottf/test_rom] Include the correct top linker script in multitop
Browse files Browse the repository at this point in the history
The OPENTITAN_TOP_MEMORY_LD define is set in each top's linker
library target.

Signed-off-by: Amaury Pouly <[email protected]>
  • Loading branch information
pamaury committed Jan 17, 2025
1 parent 18941c0 commit 6fa9fc1
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 14 deletions.
12 changes: 6 additions & 6 deletions sw/device/lib/testing/test_framework/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ ld_library(
script = "ottf_silicon_creator_a.ld",
deps = [
":ottf_ld_common",
"//hw/top_earlgrey/sw/autogen:top_earlgrey_memory",
"//hw/top:top_ld",
],
)

Expand All @@ -104,7 +104,7 @@ ld_library(
script = "ottf_silicon_creator_b.ld",
deps = [
":ottf_ld_common",
"//hw/top_earlgrey/sw/autogen:top_earlgrey_memory",
"//hw/top:top_ld",
],
)

Expand All @@ -113,7 +113,7 @@ ld_library(
script = "ottf_silicon_creator_virtual.ld",
deps = [
":ottf_ld_common",
"//hw/top_earlgrey/sw/autogen:top_earlgrey_memory",
"//hw/top:top_ld",
],
)

Expand All @@ -122,7 +122,7 @@ ld_library(
script = "ottf_silicon_owner_a.ld",
deps = [
":ottf_ld_common",
"//hw/top_earlgrey/sw/autogen:top_earlgrey_memory",
"//hw/top:top_ld",
],
)

Expand All @@ -131,7 +131,7 @@ ld_library(
script = "ottf_silicon_owner_b.ld",
deps = [
":ottf_ld_common",
"//hw/top_earlgrey/sw/autogen:top_earlgrey_memory",
"//hw/top:top_ld",
],
)

Expand All @@ -140,7 +140,7 @@ ld_library(
script = "ottf_silicon_owner_virtual.ld",
deps = [
":ottf_ld_common",
"//hw/top_earlgrey/sw/autogen:top_earlgrey_memory",
"//hw/top:top_ld",
],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
* This linker script generates a binary to run rom.
*/

INCLUDE hw/top_earlgrey/sw/autogen/top_earlgrey_memory.ld
/* This linker script is preprocessed, OPENTITAN_TOP_MEMORY_LD is a define
* set by Bazel to point to the top's linker file. */
INCLUDE OPENTITAN_TOP_MEMORY_LD

/**
* Symbols to be used in the setup of the address translation for the OTTF run
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
* This linker script generates a binary to run rom.
*/

INCLUDE hw/top_earlgrey/sw/autogen/top_earlgrey_memory.ld
/* This linker script is preprocessed, OPENTITAN_TOP_MEMORY_LD is a define
* set by Bazel to point to the top's linker file. */
INCLUDE OPENTITAN_TOP_MEMORY_LD

/**
* Symbols to be used in the setup of the address translation for the OTTF run
Expand Down
4 changes: 3 additions & 1 deletion sw/device/lib/testing/test_framework/ottf_silicon_owner_a.ld
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
* This linker script generates a binary to run BL0 tests.
*/

INCLUDE hw/top_earlgrey/sw/autogen/top_earlgrey_memory.ld
/* This linker script is preprocessed, OPENTITAN_TOP_MEMORY_LD is a define
* set by Bazel to point to the top's linker file. */
INCLUDE OPENTITAN_TOP_MEMORY_LD

/**
* Symbols to be used in the setup of the address translation for the OTTF run
Expand Down
6 changes: 4 additions & 2 deletions sw/device/lib/testing/test_framework/ottf_silicon_owner_b.ld
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
* This linker script generates a binary to run BL0 tests.
*/

INCLUDE hw/top_earlgrey/sw/autogen/top_earlgrey_memory.ld
/* This linker script is preprocessed, OPENTITAN_TOP_MEMORY_LD is a define
* set by Bazel to point to the top's linker file. */
INCLUDE OPENTITAN_TOP_MEMORY_LD

/**
* Symbols to be used in the setup of the address translation for the OTTF run
Expand All @@ -22,4 +24,4 @@ _ottf_start_address = ORIGIN(eflash) + (LENGTH(eflash) / 2) + 0x10000;

REGION_ALIAS("ottf_flash", eflash);

INCLUDE sw/device/lib/testing/test_framework/ottf_common.ld
INCLUDE ottf_common.ld
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
* This linker script generates a binary to run BL0 tests.
*/

INCLUDE hw/top_earlgrey/sw/autogen/top_earlgrey_memory.ld
/* This linker script is preprocessed, OPENTITAN_TOP_MEMORY_LD is a define
* set by Bazel to point to the top's linker file. */
INCLUDE OPENTITAN_TOP_MEMORY_LD

/**
* Symbols to be used in the setup of the address translation for ROM_EXT.
Expand Down
2 changes: 1 addition & 1 deletion sw/device/lib/testing/test_rom/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ld_library(
name = "linker_script",
script = "test_rom.ld",
deps = [
"//hw/top_earlgrey/sw/autogen:top_earlgrey_memory",
"//hw/top:top_ld",
"//sw/device:info_sections",
"//sw/device/silicon_creator/lib/base:static_critical_sections",
],
Expand Down
2 changes: 1 addition & 1 deletion sw/device/lib/testing/test_rom/test_rom.ld
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ OUTPUT_ARCH(riscv)
*/
__DYNAMIC = 0;

INCLUDE hw/top_earlgrey/sw/autogen/top_earlgrey_memory.ld
INCLUDE OPENTITAN_TOP_MEMORY_LD

/**
* The boot address, which indicates the location of the initial interrupt
Expand Down

0 comments on commit 6fa9fc1

Please sign in to comment.