summaryrefslogtreecommitdiff
path: root/arch/sh/lib/board.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2025-04-14 08:59:45 -0600
committerTom Rini <trini@konsulko.com>2025-04-14 08:59:45 -0600
commit8c98b57d72d5e5b94ed064fe1041e51216165334 (patch)
tree6925274aa6ebc5a369da5552bf88260f1730d2bc /arch/sh/lib/board.c
parent739ad58dbee874a3ad3bddd116e995212a254e07 (diff)
parentbbee3d41b33f5b8c88ae3707dc8af105acafdd55 (diff)
Merge patch series "Static initcalls"
Jerome Forissier <jerome.forissier@linaro.org> says: This series replaces the dynamic initcalls (with function pointers) with static calls, and gets rid of initcall_run_list(), init_sequence_f, init_sequence_f_r and init_sequence_r. This makes the code simpler and the binary slighlty smaller: -2281 bytes/-0.21 % with LTO enabled and -510 bytes/-0.05 % with LTO disabled (xilinx_zynqmp_kria_defconfig). Execution time doesn't seem to change noticeably. There is no impact on the SPL. The inline assembly fixes, although they look unrelated, are triggered on some platforms with LTO enabled. For example: kirkwood_defconfig. CI: https://source.denx.de/u-boot/custodians/u-boot-net/-/pipelines/25514 Link: https://lore.kernel.org/r/20250404135038.2134570-1-jerome.forissier@linaro.org
Diffstat (limited to 'arch/sh/lib/board.c')
-rw-r--r--arch/sh/lib/board.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c
index 53b1c147c2e..2daf54e7c33 100644
--- a/arch/sh/lib/board.c
+++ b/arch/sh/lib/board.c
@@ -19,18 +19,13 @@ int dram_init(void)
void relocate_code(ulong start_addr_sp, gd_t *new_gd, ulong relocaddr)
{
- void (*reloc_board_init_r)(gd_t *gd, ulong dest) = board_init_r;
-
- if (new_gd->reloc_off) {
+ if (new_gd->reloc_off)
memcpy((void *)new_gd->relocaddr,
(void *)(new_gd->relocaddr - new_gd->reloc_off),
new_gd->mon_len);
- reloc_board_init_r += new_gd->reloc_off;
- }
-
__asm__ __volatile__("mov.l %0, r15\n" : : "m" (new_gd->start_addr_sp));
while (1)
- reloc_board_init_r(new_gd, 0x0);
+ board_init_r(new_gd, 0x0);
}