firmware: remove FW_TEXT_START

Now opensbi can run at any address via dynamic relocation. We can
remove FW_TEXT_START.

Signed-off-by: Xiang W <wxjstz@126.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Tested-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Xiang W
2024-04-08 23:27:42 +08:00
committed by Anup Patel
parent 73344d4724
commit d4d2582eef
15 changed files with 15 additions and 39 deletions

View File

@@ -53,9 +53,7 @@ _try_lottery:
bnez a6, _wait_for_boot_hart
/* relocate the global table content */
li t0, FW_TEXT_START /* link start */
lla t1, _fw_start /* load start */
sub t2, t1, t0 /* load offset */
lla t2, _fw_start
lla t0, __rel_dyn_start
lla t1, __rel_dyn_end
beq t0, t1, _relocate_done

View File

@@ -7,8 +7,7 @@
* Anup Patel <anup.patel@wdc.com>
*/
. = FW_TEXT_START;
/* Don't add any section between FW_TEXT_START and _fw_start */
/* Don't add any section before _fw_start */
PROVIDE(_fw_start = .);
. = ALIGN(0x1000); /* Need this to create proper sections */

View File

@@ -15,7 +15,7 @@ SECTIONS
#include "fw_base.ldS"
#ifdef FW_PAYLOAD_OFFSET
. = FW_TEXT_START + FW_PAYLOAD_OFFSET;
. = FW_PAYLOAD_OFFSET;
#else
. = ALIGN(FW_PAYLOAD_ALIGN);
#endif

View File

@@ -13,10 +13,6 @@ firmware-cflags-y +=
firmware-asflags-y +=
firmware-ldflags-y +=
ifdef FW_TEXT_START
firmware-genflags-y += -DFW_TEXT_START=$(FW_TEXT_START)
endif
ifdef FW_FDT_PATH
firmware-genflags-y += -DFW_FDT_PATH=\"$(FW_FDT_PATH)\"
ifdef FW_FDT_PADDING

View File

@@ -13,7 +13,7 @@ ENTRY(_start)
SECTIONS
{
#ifdef FW_PAYLOAD_OFFSET
. = FW_TEXT_START + FW_PAYLOAD_OFFSET;
. = FW_PAYLOAD_OFFSET;
#else
. = ALIGN(FW_PAYLOAD_ALIGN);
#endif