[PATCH 04/35] common: board_r: Remove unused NEEDS_MANUAL_RELOC code bits

Marek Vasut marek.vasut+renesas at mailbox.org
Wed Sep 6 23:29:44 CEST 2023


The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
---
 common/board_r.c   | 22 ----------------------
 include/relocate.h | 12 +-----------
 lib/initcall.c     | 10 ----------
 3 files changed, 1 insertion(+), 43 deletions(-)

diff --git a/common/board_r.c b/common/board_r.c
index 697d4a5bd3d..630c104a985 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -151,13 +151,6 @@ static int initr_reloc_global_data(void)
 	 */
 	gd->env_addr += gd->reloc_off;
 #endif
-	/*
-	 * The fdt_blob needs to be moved to new relocation address
-	 * incase of FDT blob is embedded with in image
-	 */
-	if (IS_ENABLED(CONFIG_OF_EMBED) && IS_ENABLED(CONFIG_NEEDS_MANUAL_RELOC))
-		gd->fdt_blob += gd->reloc_off;
-
 #ifdef CONFIG_EFI_LOADER
 	/*
 	 * On the ARM architecture gd is mapped to a fixed register (r9 or x18).
@@ -295,15 +288,6 @@ static int initr_announce(void)
 	return 0;
 }
 
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
-static int initr_manual_reloc_cmdtable(void)
-{
-	fixup_cmdtable(ll_entry_start(struct cmd_tbl, cmd),
-		       ll_entry_count(struct cmd_tbl, cmd));
-	return 0;
-}
-#endif
-
 static int initr_binman(void)
 {
 	int ret;
@@ -657,9 +641,6 @@ static init_fnc_t init_sequence_r[] = {
 	initr_watchdog,
 #endif
 	INIT_FUNC_WATCHDOG_RESET
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
-	initr_manual_reloc_cmdtable,
-#endif
 	arch_initr_trap,
 #if defined(CONFIG_BOARD_EARLY_INIT_R)
 	board_early_init_r,
@@ -803,9 +784,6 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)
 #endif
 	gd->flags &= ~GD_FLG_LOG_READY;
 
-	if (IS_ENABLED(CONFIG_NEEDS_MANUAL_RELOC))
-		initcall_manual_reloc(init_sequence_r);
-
 	if (initcall_run_list(init_sequence_r))
 		hang();
 
diff --git a/include/relocate.h b/include/relocate.h
index 2dbfd901e4f..5ae1a2ed555 100644
--- a/include/relocate.h
+++ b/include/relocate.h
@@ -50,17 +50,7 @@ int do_elf_reloc_fixups(void);
  */
 static inline void *manual_reloc(void *ptr)
 {
-#ifndef USE_HOSTCC
-	if (IS_ENABLED(CONFIG_NEEDS_MANUAL_RELOC))
-		return ptr + gd->reloc_off;
-#endif
-		return ptr;
+	return ptr;
 }
 
-#if !defined(USE_HOSTCC) && defined(CONFIG_NEEDS_MANUAL_RELOC)
-#define MANUAL_RELOC(ptr)	(ptr) = manual_reloc(ptr)
-#else
-#define MANUAL_RELOC(ptr)	(void)(ptr)
-#endif
-
 #endif	/* _RELOCATE_H_ */
diff --git a/lib/initcall.c b/lib/initcall.c
index 480490ea239..33b7d761dc7 100644
--- a/lib/initcall.c
+++ b/lib/initcall.c
@@ -97,13 +97,3 @@ int initcall_run_list(const init_fnc_t init_sequence[])
 
 	return 0;
 }
-
-void initcall_manual_reloc(init_fnc_t init_sequence[])
-{
-	init_fnc_t *ptr;
-
-	for (ptr = init_sequence; *ptr; ptr++) {
-		if (!initcall_is_event(*ptr))
-			MANUAL_RELOC(*ptr);
-	}
-}
-- 
2.40.1



More information about the U-Boot mailing list