diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2022-08-18 07:04:47 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-08-22 10:52:19 +0200 |
commit | 7deef2fa981b81426443281f84b142080f46cf74 (patch) | |
tree | 748b283bfdee8525b9c78b4e207ba9f035c3ae6d | |
parent | 867681db2efe997d3f5c3b1ba1bebb366a336110 (diff) | |
download | barebox-7deef2fa981b81426443281f84b142080f46cf74.tar.gz barebox-7deef2fa981b81426443281f84b142080f46cf74.tar.xz |
pbl: replace __piggydata_end with __image_end
__piggydata_end and __image_end used to be synonyms before the addition
of external firmware. Now that external firmware is located after
__piggydata_end, code using it needs to be revisited.
There's no reason to have code reference __piggydata_end. Either they
want all the rest of the image, so they should use __image_end instead
or they want just the piggy data, in which case they can read the data
size embedded into the piggydata itself.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220818050447.2072932-4-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | arch/arm/cpu/setupc_64.S | 2 | ||||
-rw-r--r-- | arch/arm/lib/pbl.lds.S | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/romapi.c | 2 | ||||
-rw-r--r-- | arch/mips/lib/pbl.lds.S | 3 | ||||
-rw-r--r-- | arch/riscv/lib/pbl.lds.S | 2 | ||||
-rw-r--r-- | include/asm-generic/sections.h | 1 |
6 files changed, 4 insertions, 7 deletions
diff --git a/arch/arm/cpu/setupc_64.S b/arch/arm/cpu/setupc_64.S index b5f4a643fa..d64281c148 100644 --- a/arch/arm/cpu/setupc_64.S +++ b/arch/arm/cpu/setupc_64.S @@ -29,7 +29,7 @@ ENDPROC(setup_c) /* x0: target address */ #ifdef __PBL__ ENTRY(relocate_to_adr_full) - ldr x2, =__piggydata_end + ldr x2, =__image_end b 1f #endif diff --git a/arch/arm/lib/pbl.lds.S b/arch/arm/lib/pbl.lds.S index 44ad5b3353..d48f27bc43 100644 --- a/arch/arm/lib/pbl.lds.S +++ b/arch/arm/lib/pbl.lds.S @@ -99,7 +99,6 @@ SECTIONS .piggydata : { *(.piggydata) } - __piggydata_end = .; . = ALIGN(4); __pblext_start = .; diff --git a/arch/arm/mach-imx/romapi.c b/arch/arm/mach-imx/romapi.c index f7d421d737..5d00d71154 100644 --- a/arch/arm/mach-imx/romapi.c +++ b/arch/arm/mach-imx/romapi.c @@ -28,7 +28,7 @@ static int imx8m_bootrom_load_image(struct rom_api *rom_api) { return imx8m_bootrom_load(rom_api, (void *)MX8M_ATF_BL33_BASE_ADDR + barebox_pbl_size, - __piggydata_end - __piggydata_start); + __image_end - __piggydata_start); } int imx8mp_bootrom_load_image(void) diff --git a/arch/mips/lib/pbl.lds.S b/arch/mips/lib/pbl.lds.S index 75069b0c50..413f24b9ab 100644 --- a/arch/mips/lib/pbl.lds.S +++ b/arch/mips/lib/pbl.lds.S @@ -48,7 +48,8 @@ SECTIONS .piggydata : { *(.piggydata) } - __piggydata_end = . - BASE; + + .image_end : { KEEP(*(.__image_end)) } pbl_image_size = .; diff --git a/arch/riscv/lib/pbl.lds.S b/arch/riscv/lib/pbl.lds.S index e238b2bfd3..ccf64fc6d3 100644 --- a/arch/riscv/lib/pbl.lds.S +++ b/arch/riscv/lib/pbl.lds.S @@ -74,8 +74,6 @@ SECTIONS .piggydata : { *(.piggydata) } - __piggydata_end = .; - .image_end : { KEEP(*(.__image_end)) } pbl_image_size = .; diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h index e54123de0e..0b2ed5615b 100644 --- a/include/asm-generic/sections.h +++ b/include/asm-generic/sections.h @@ -11,7 +11,6 @@ extern char _end[]; extern char __image_start[]; extern char __image_end[]; extern char __piggydata_start[]; -extern char __piggydata_end[]; extern void *_barebox_image_size; extern void *_barebox_bare_init_size; extern void *_barebox_pbl_size; |