aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini2023-09-14 16:23:49 -0400
committerTom Rini2023-09-14 16:23:49 -0400
commit2fe4b54556ea6271237b35de68dc458bfceab94c (patch)
treee98df3cab8a288829e16bab3999af50550163942
parent3cba5a115ff8b5aeca62e5ae7dfad6bacb32e9fd (diff)
parent4babaa0c28becc2b80db13daa6f30d8f4d35e94e (diff)
Merge branch '2023-09-14-remove-NEEDS_MANUAL_RELOC' into next
To quote the author: 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. This is a follow up on way over decade old commit 2e5167ccad93 ("Replace CONFIG_RELOC_FIXUP_WORKS by CONFIG_NEEDS_MANUAL_RELOC") " By now, the majority of architectures have working relocation support, so the few remaining architectures have become exceptions. To make this more obvious, we make working relocation now the default case, and flag the remaining cases with CONFIG_NEEDS_MANUAL_RELOC. " It took a bit longer than expected, but now we can really sunset CONFIG_NEEDS_MANUAL_RELOC. Make it so.
-rw-r--r--boot/bootm_os.c14
-rw-r--r--boot/image-sig.c28
-rw-r--r--boot/image.c10
-rw-r--r--cmd/blkcache.c13
-rw-r--r--cmd/bootm.c14
-rw-r--r--cmd/date.c8
-rw-r--r--cmd/i2c.c14
-rw-r--r--cmd/nvedit.c11
-rw-r--r--cmd/onenand.c6
-rw-r--r--cmd/pxe.c14
-rw-r--r--common/bmp.c7
-rw-r--r--common/board_r.c28
-rw-r--r--common/cli_hush.c16
-rw-r--r--common/dlmalloc.c14
-rw-r--r--common/event.c14
-rw-r--r--common/hash.c29
-rw-r--r--common/stdio.c12
-rw-r--r--doc/README.POST5
-rw-r--r--drivers/block/blkcache.c16
-rw-r--r--drivers/core/root.c81
-rw-r--r--drivers/cpu/cpu-uclass.c27
-rw-r--r--drivers/crypto/rsa_mod_exp/mod_exp_uclass.c13
-rw-r--r--drivers/gpio/gpio-uclass.c30
-rw-r--r--drivers/hwspinlock/hwspinlock-uclass.c21
-rw-r--r--drivers/mtd/spi/sf-uclass.c16
-rw-r--r--drivers/net/phy/miiphybb.c20
-rw-r--r--drivers/net/phy/phy.c31
-rw-r--r--drivers/serial/serial-uclass.c22
-rw-r--r--drivers/serial/serial.c17
-rw-r--r--drivers/spi/spi-uclass.c32
-rw-r--r--drivers/sysreset/sysreset-uclass.c16
-rw-r--r--drivers/timer/timer-uclass.c13
-rw-r--r--drivers/watchdog/wdt-uclass.c23
-rw-r--r--env/callback.c12
-rw-r--r--env/common.c5
-rw-r--r--env/env.c23
-rw-r--r--fs/fs.c16
-rw-r--r--fs/ubifs/ubifs.c6
-rw-r--r--include/blk.h6
-rw-r--r--include/command.h21
-rw-r--r--include/env.h13
-rw-r--r--include/event.h10
-rw-r--r--include/initcall.h7
-rw-r--r--include/phy.h8
-rw-r--r--include/post.h3
-rw-r--r--include/relocate.h24
-rw-r--r--lib/initcall.c10
-rw-r--r--net/eth-uclass.c26
-rw-r--r--net/eth_common.c4
-rw-r--r--post/post.c48
50 files changed, 8 insertions, 869 deletions
diff --git a/boot/bootm_os.c b/boot/bootm_os.c
index 99ff0e6c02d..9c035b5be88 100644
--- a/boot/bootm_os.c
+++ b/boot/bootm_os.c
@@ -609,19 +609,5 @@ int boot_selected_os(int argc, char *const argv[], int state,
boot_os_fn *bootm_os_get_boot_func(int os)
{
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
- static bool relocated;
-
- if (!relocated) {
- int i;
-
- /* relocate boot function table */
- for (i = 0; i < ARRAY_SIZE(boot_os); i++)
- if (boot_os[i] != NULL)
- boot_os[i] += gd->reloc_off;
-
- relocated = true;
- }
-#endif
return boot_os[os];
}
diff --git a/boot/image-sig.c b/boot/image-sig.c
index 1aa0b586450..b5692d58b24 100644
--- a/boot/image-sig.c
+++ b/boot/image-sig.c
@@ -57,20 +57,6 @@ struct checksum_algo *image_get_checksum_algo(const char *full_name)
int i;
const char *name;
- if (IS_ENABLED(CONFIG_NEEDS_MANUAL_RELOC)) {
- static bool done;
-
- if (!done) {
- done = true;
- for (i = 0; i < ARRAY_SIZE(checksum_algos); i++) {
- struct checksum_algo *algo = &checksum_algos[i];
-
- MANUAL_RELOC(algo->name);
- MANUAL_RELOC(algo->calculate);
- }
- }
- }
-
for (i = 0; i < ARRAY_SIZE(checksum_algos); i++) {
name = checksum_algos[i].name;
/* Make sure names match and next char is a comma */
@@ -87,20 +73,6 @@ struct crypto_algo *image_get_crypto_algo(const char *full_name)
struct crypto_algo *crypto, *end;
const char *name;
- if (IS_ENABLED(CONFIG_NEEDS_MANUAL_RELOC)) {
- static bool done;
-
- if (!done) {
- done = true;
- crypto = ll_entry_start(struct crypto_algo, cryptos);
- end = ll_entry_end(struct crypto_algo, cryptos);
- for (; crypto < end; crypto++) {
- MANUAL_RELOC(crypto->name);
- MANUAL_RELOC(crypto->verify);
- }
- }
- }
-
/* Move name to after the comma */
name = strchr(full_name, ',');
if (!name)
diff --git a/boot/image.c b/boot/image.c
index 5c4f9b807d6..26f68d4c407 100644
--- a/boot/image.c
+++ b/boot/image.c
@@ -571,7 +571,7 @@ const char *genimg_get_cat_name(enum ih_category category, uint id)
entry = get_table_entry(table_info[category].table, id);
if (!entry)
return unknown_msg(category);
- return manual_reloc(entry->lname);
+ return entry->lname;
}
/**
@@ -591,7 +591,7 @@ const char *genimg_get_cat_short_name(enum ih_category category, uint id)
entry = get_table_entry(table_info[category].table, id);
if (!entry)
return unknown_msg(category);
- return manual_reloc(entry->sname);
+ return entry->sname;
}
int genimg_get_cat_count(enum ih_category category)
@@ -641,7 +641,7 @@ char *get_table_entry_name(const table_entry_t *table, char *msg, int id)
table = get_table_entry(table, id);
if (!table)
return msg;
- return manual_reloc(table->lname);
+ return table->lname;
}
const char *genimg_get_os_name(uint8_t os)
@@ -676,7 +676,7 @@ static const char *genimg_get_short_name(const table_entry_t *table, int val)
table = get_table_entry(table, val);
if (!table)
return "unknown";
- return manual_reloc(table->sname);
+ return table->sname;
}
const char *genimg_get_type_short_name(uint8_t type)
@@ -719,7 +719,7 @@ int get_table_entry_id(const table_entry_t *table,
const table_entry_t *t;
for (t = table; t->id >= 0; ++t) {
- if (t->sname && !strcasecmp(manual_reloc(t->sname), name))
+ if (t->sname && !strcasecmp(t->sname, name))
return t->id;
}
debug("Invalid %s Type: %s\n", table_name, name);
diff --git a/cmd/blkcache.c b/cmd/blkcache.c
index 47ea1ec0b93..1456654df6f 100644
--- a/cmd/blkcache.c
+++ b/cmd/blkcache.c
@@ -46,24 +46,11 @@ static struct cmd_tbl cmd_blkc_sub[] = {
U_BOOT_CMD_MKENT(configure, 3, 0, blkc_configure, "", ""),
};
-static __maybe_unused void blkc_reloc(void)
-{
- static int relocated;
-
- if (!relocated) {
- fixup_cmdtable(cmd_blkc_sub, ARRAY_SIZE(cmd_blkc_sub));
- relocated = 1;
- };
-}
-
static int do_blkcache(struct cmd_tbl *cmdtp, int flag,
int argc, char *const argv[])
{
struct cmd_tbl *c;
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
- blkc_reloc();
-#endif
if (argc < 2)
return CMD_RET_USAGE;
diff --git a/cmd/bootm.c b/cmd/bootm.c
index 37c2af96e08..7968415b6d1 100644
--- a/cmd/bootm.c
+++ b/cmd/bootm.c
@@ -123,20 +123,6 @@ int do_bootm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
int states;
int ret;
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
- static int relocated = 0;
-
- if (!relocated) {
- int i;
-
- /* relocate names of sub-command table */
- for (i = 0; i < ARRAY_SIZE(cmd_bootm_sub); i++)
- cmd_bootm_sub[i].name += gd->reloc_off;
-
- relocated = 1;
- }
-#endif
-
/* determine if we have a sub command */
argc--; argv++;
if (argc > 0) {
diff --git a/cmd/date.c b/cmd/date.c
index fe9c8c6534e..4f98b470ca2 100644
--- a/cmd/date.c
+++ b/cmd/date.c
@@ -20,12 +20,6 @@ static const char * const weekdays[] = {
"Sun", "Mon", "Tues", "Wednes", "Thurs", "Fri", "Satur",
};
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
-#define RELOC(a) ((typeof(a))((unsigned long)(a) + gd->reloc_off))
-#else
-#define RELOC(a) a
-#endif
-
int mk_date (const char *, struct rtc_time *);
static struct rtc_time default_tm = { 0, 0, 0, 1, 1, 2000, 6, 0, 0 };
@@ -113,7 +107,7 @@ static int do_date(struct cmd_tbl *cmdtp, int flag, int argc,
printf ("Date: %4d-%02d-%02d (%sday) Time: %2d:%02d:%02d\n",
tm.tm_year, tm.tm_mon, tm.tm_mday,
(tm.tm_wday<0 || tm.tm_wday>6) ?
- "unknown " : RELOC(weekdays[tm.tm_wday]),
+ "unknown " : weekdays[tm.tm_wday],
tm.tm_hour, tm.tm_min, tm.tm_sec);
break;
diff --git a/cmd/i2c.c b/cmd/i2c.c
index dd803ee2271..f0a5fa2e741 100644
--- a/cmd/i2c.c
+++ b/cmd/i2c.c
@@ -1939,16 +1939,6 @@ static struct cmd_tbl cmd_i2c_sub[] = {
U_BOOT_CMD_MKENT(speed, 1, 1, do_i2c_bus_speed, "", ""),
};
-static __maybe_unused void i2c_reloc(void)
-{
- static int relocated;
-
- if (!relocated) {
- fixup_cmdtable(cmd_i2c_sub, ARRAY_SIZE(cmd_i2c_sub));
- relocated = 1;
- };
-}
-
/**
* do_i2c() - Handle the "i2c" command-line command
* @cmdtp: Command data struct pointer
@@ -1963,10 +1953,6 @@ static int do_i2c(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
struct cmd_tbl *c;
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
- i2c_reloc();
-#endif
-
if (argc < 2)
return CMD_RET_USAGE;
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 9e4ee4b0177..fe99157fd17 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -407,11 +407,7 @@ static int print_active_callback(struct env_entry *entry)
for (i = 0, clbkp = ll_entry_start(struct env_clbk_tbl, env_clbk);
i < num_callbacks;
i++, clbkp++) {
-#if defined(CONFIG_NEEDS_MANUAL_RELOC)
- if (entry->callback == clbkp->callback + gd->reloc_off)
-#else
if (entry->callback == clbkp->callback)
-#endif
break;
}
@@ -1222,13 +1218,6 @@ static struct cmd_tbl cmd_env_sub[] = {
#endif
};
-#if defined(CONFIG_NEEDS_MANUAL_RELOC)
-void env_reloc(void)
-{
- fixup_cmdtable(cmd_env_sub, ARRAY_SIZE(cmd_env_sub));
-}
-#endif
-
static int do_env(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
struct cmd_tbl *cp;
diff --git a/cmd/onenand.c b/cmd/onenand.c
index d633f19d3bb..3ec11246f6f 100644
--- a/cmd/onenand.c
+++ b/cmd/onenand.c
@@ -560,12 +560,6 @@ static struct cmd_tbl cmd_onenand_sub[] = {
U_BOOT_CMD_MKENT(markbad, CONFIG_SYS_MAXARGS, 0, do_onenand_markbad, "", ""),
};
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
-void onenand_reloc(void) {
- fixup_cmdtable(cmd_onenand_sub, ARRAY_SIZE(cmd_onenand_sub));
-}
-#endif
-
static int do_onenand(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
diff --git a/cmd/pxe.c b/cmd/pxe.c
index 7bfb1b9b280..704589702f2 100644
--- a/cmd/pxe.c
+++ b/cmd/pxe.c
@@ -299,24 +299,10 @@ static struct cmd_tbl cmd_pxe_sub[] = {
U_BOOT_CMD_MKENT(boot, 3, 1, do_pxe_boot, "", "")
};
-static void __maybe_unused pxe_reloc(void)
-{
- static int relocated_pxe;
-
- if (!relocated_pxe) {
- fixup_cmdtable(cmd_pxe_sub, ARRAY_SIZE(cmd_pxe_sub));
- relocated_pxe = 1;
- }
-}
-
static int do_pxe(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
struct cmd_tbl *cp;
-#if defined(CONFIG_NEEDS_MANUAL_RELOC)
- pxe_reloc();
-#endif
-
if (argc < 2)
return CMD_RET_USAGE;
diff --git a/common/bmp.c b/common/bmp.c
index 57764f3653e..bab6fa7265a 100644
--- a/common/bmp.c
+++ b/common/bmp.c
@@ -81,13 +81,6 @@ struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp,
return bmp;
}
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
-void bmp_reloc(void)
-{
- fixup_cmdtable(cmd_bmp_sub, ARRAY_SIZE(cmd_bmp_sub));
-}
-#endif
-
int bmp_info(ulong addr)
{
struct bmp_image *bmp = (struct bmp_image *)map_sysmem(addr, 0);
diff --git a/common/board_r.c b/common/board_r.c
index ad9a3cf6336..e30963339cf 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;
@@ -606,9 +590,6 @@ static init_fnc_t init_sequence_r[] = {
*/
#endif
initr_reloc_global_data,
-#if IS_ENABLED(CONFIG_NEEDS_MANUAL_RELOC) && CONFIG_IS_ENABLED(EVENT)
- event_manual_reloc,
-#endif
#if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500)
initr_unlock_ram_in_cache,
#endif
@@ -657,12 +638,6 @@ static init_fnc_t init_sequence_r[] = {
initr_watchdog,
#endif
INIT_FUNC_WATCHDOG_RESET
-#if defined(CONFIG_NEEDS_MANUAL_RELOC) && defined(CONFIG_BLOCK_CACHE)
- blkcache_init,
-#endif
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
- initr_manual_reloc_cmdtable,
-#endif
arch_initr_trap,
#if defined(CONFIG_BOARD_EARLY_INIT_R)
board_early_init_r,
@@ -806,9 +781,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/common/cli_hush.c b/common/cli_hush.c
index cee87249bc2..9cda97f30e3 100644
--- a/common/cli_hush.c
+++ b/common/cli_hush.c
@@ -3305,19 +3305,6 @@ int parse_file_outer(void)
}
#ifdef __U_BOOT__
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
-static void u_boot_hush_reloc(void)
-{
- unsigned long addr;
- struct reserved_combo *r;
-
- for (r=reserved_list; r<reserved_list+NRES; r++) {
- addr = (ulong) (r->literal) + gd->reloc_off;
- r->literal = (char *)addr;
- }
-}
-#endif
-
int u_boot_hush_start(void)
{
if (top_vars == NULL) {
@@ -3327,9 +3314,6 @@ int u_boot_hush_start(void)
top_vars->next = NULL;
top_vars->flg_export = 0;
top_vars->flg_read_only = 1;
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
- u_boot_hush_reloc();
-#endif
}
return 0;
}
diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index 0f9b7262d51..ebf0f27e165 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -575,19 +575,6 @@ static mbinptr av_[NAV * 2 + 2] = {
IAV(120), IAV(121), IAV(122), IAV(123), IAV(124), IAV(125), IAV(126), IAV(127)
};
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
-static void malloc_bin_reloc(void)
-{
- mbinptr *p = &av_[2];
- size_t i;
-
- for (i = 2; i < ARRAY_SIZE(av_); ++i, ++p)
- *p = (mbinptr)((ulong)*p + gd->reloc_off);
-}
-#else
-static inline void malloc_bin_reloc(void) {}
-#endif
-
#ifdef CONFIG_SYS_MALLOC_DEFAULT_TO_INIT
static void malloc_init(void);
#endif
@@ -634,7 +621,6 @@ void mem_malloc_init(ulong start, ulong size)
#ifdef CONFIG_SYS_MALLOC_CLEAR_ON_INIT
memset((void *)mem_malloc_start, 0x0, size);
#endif
- malloc_bin_reloc();
}
/* field-extraction macros */
diff --git a/common/event.c b/common/event.c
index d11b37a1d80..3080d9ed754 100644
--- a/common/event.c
+++ b/common/event.c
@@ -168,20 +168,6 @@ void event_show_spy_list(void)
}
}
-#if IS_ENABLED(CONFIG_NEEDS_MANUAL_RELOC)
-int event_manual_reloc(void)
-{
- struct evspy_info *spy, *end;
-
- spy = ll_entry_start(struct evspy_info, evspy_info);
- end = ll_entry_end(struct evspy_info, evspy_info);
- for (; spy < end; spy++)
- MANUAL_RELOC(spy->func);
-
- return 0;
-}
-#endif
-
#if CONFIG_IS_ENABLED(EVENT_DYNAMIC)
static void spy_free(struct event_spy *spy)
{
diff --git a/common/hash.c b/common/hash.c
index 159179e7f21..e837c56d443 100644
--- a/common/hash.c
+++ b/common/hash.c
@@ -36,12 +36,6 @@
#include <u-boot/sha512.h>
#include <u-boot/md5.h>
-#if !defined(USE_HOSTCC) && defined(CONFIG_NEEDS_MANUAL_RELOC)
-DECLARE_GLOBAL_DATA_PTR;
-#endif
-
-static void reloc_update(void);
-
static int __maybe_unused hash_init_sha1(struct hash_algo *algo, void **ctxp)
{
sha1_context *ctx = malloc(sizeof(sha1_context));
@@ -333,31 +327,10 @@ static struct hash_algo hash_algo[] = {
#define multi_hash() 0
#endif
-static void reloc_update(void)
-{
-#if !defined(USE_HOSTCC) && defined(CONFIG_NEEDS_MANUAL_RELOC)
- int i;
- static bool done;
-
- if (!done) {
- done = true;
- for (i = 0; i < ARRAY_SIZE(hash_algo); i++) {
- hash_algo[i].name += gd->reloc_off;
- hash_algo[i].hash_func_ws += gd->reloc_off;
- hash_algo[i].hash_init += gd->reloc_off;
- hash_algo[i].hash_update += gd->reloc_off;
- hash_algo[i].hash_finish += gd->reloc_off;
- }
- }
-#endif
-}
-
int hash_lookup_algo(const char *algo_name, struct hash_algo **algop)
{
int i;
- reloc_update();
-
for (i = 0; i < ARRAY_SIZE(hash_algo); i++) {
if (!strcmp(algo_name, hash_algo[i].name)) {
*algop = &hash_algo[i];
@@ -374,8 +347,6 @@ int hash_progressive_lookup_algo(const char *algo_name,
{
int i;
- reloc_update();
-
for (i = 0; i < ARRAY_SIZE(hash_algo); i++) {
if (!strcmp(algo_name, hash_algo[i].name)) {
if (hash_algo[i].hash_init) {
diff --git a/common/stdio.c b/common/stdio.c
index 894cbd3fb44..010bf576af0 100644
--- a/common/stdio.c
+++ b/common/stdio.c
@@ -293,18 +293,6 @@ int stdio_deregister_dev(struct stdio_dev *dev, int force)
int stdio_init_tables(void)
{
-#if defined(CONFIG_NEEDS_MANUAL_RELOC)
- /* already relocated for current ARM implementation */
- ulong relocation_offset = gd->reloc_off;
- int i;
-
- /* relocate device name pointers */
- for (i = 0; i < (sizeof (stdio_names) / sizeof (char *)); ++i) {
- stdio_names[i] = (char *) (((ulong) stdio_names[i]) +
- relocation_offset);
- }
-#endif /* CONFIG_NEEDS_MANUAL_RELOC */
-
/* Initialize the list */
INIT_LIST_HEAD(&devs.list);
diff --git a/doc/README.POST b/doc/README.POST
index 1366f95c662..c614ea44a28 100644
--- a/doc/README.POST
+++ b/doc/README.POST
@@ -138,11 +138,6 @@ The POST layer will export the following interface routines:
mode the test is executed in (power-on, normal, power-fail,
manual).
- o) void post_reloc(ulong offset);
-
- This routine will be called from board_init_r() and will
- relocate the POST test table.
-
o) int post_info(char *name);
This routine will print the list of all POST tests that can be
diff --git a/drivers/block/blkcache.c b/drivers/block/blkcache.c
index f99465aa479..26bcbea4353 100644
--- a/drivers/block/blkcache.c
+++ b/drivers/block/blkcache.c
@@ -13,10 +13,6 @@
#include <linux/ctype.h>
#include <linux/list.h>
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
-DECLARE_GLOBAL_DATA_PTR;
-#endif
-
struct block_cache_node {
struct list_head lh;
int iftype;
@@ -34,18 +30,6 @@ static struct block_cache_stats _stats = {
.max_entries = 32
};
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
-int blkcache_init(void)
-{
- struct list_head *head = &block_cache;
-
- head->next = (uintptr_t)head->next + gd->reloc_off;
- head->prev = (uintptr_t)head->prev + gd->reloc_off;
-
- return 0;
-}
-#endif
-
static struct block_cache_node *cache_find(int iftype, int devnum,
lbaint_t start, lbaint_t blkcnt,
unsigned long blksz)
diff --git a/drivers/core/root.c b/drivers/core/root.c
index 79d871ab291..47b1320a441 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -55,81 +55,6 @@ void dm_fixup_for_gd_move(struct global_data *new_gd)
}
}
-void fix_drivers(void)
-{
- struct driver *drv =
- ll_entry_start(struct driver, driver);
- const int n_ents = ll_entry_count(struct driver, driver);
- struct driver *entry;
-
- for (entry = drv; entry != drv + n_ents; entry++) {
- if (entry->of_match)
- entry->of_match = (const struct udevice_id *)
- ((ulong)entry->of_match + gd->reloc_off);
- if (entry->bind)
- entry->bind += gd->reloc_off;
- if (entry->probe)
- entry->probe += gd->reloc_off;
- if (entry->remove)
- entry->remove += gd->reloc_off;
- if (entry->unbind)
- entry->unbind += gd->reloc_off;
- if (entry->of_to_plat)
- entry->of_to_plat += gd->reloc_off;
- if (entry->child_post_bind)
- entry->child_post_bind += gd->reloc_off;
- if (entry->child_pre_probe)
- entry->child_pre_probe += gd->reloc_off;
- if (entry->child_post_remove)
- entry->child_post_remove += gd->reloc_off;
- /* OPS are fixed in every uclass post_probe function */
- if (entry->ops)
- entry->ops += gd->reloc_off;
- }
-}
-
-void fix_uclass(void)
-{
- struct uclass_driver *uclass =
- ll_entry_start(struct uclass_driver, uclass_driver);
- const int n_ents = ll_entry_count(struct uclass_driver, uclass_driver);
- struct uclass_driver *entry;
-
- for (entry = uclass; entry != uclass + n_ents; entry++) {
- if (entry->post_bind)
- entry->post_bind += gd->reloc_off;
- if (entry->pre_unbind)
- entry->pre_unbind += gd->reloc_off;
- if (entry->pre_probe)
- entry->pre_probe += gd->reloc_off;
- if (entry->post_probe)
- entry->post_probe += gd->reloc_off;
- if (entry->pre_remove)
- entry->pre_remove += gd->reloc_off;
- if (entry->child_post_bind)
- entry->child_post_bind += gd->reloc_off;
- if (entry->child_pre_probe)
- entry->child_pre_probe += gd->reloc_off;
- if (entry->init)
- entry->init += gd->reloc_off;
- if (entry->destroy)
- entry->destroy += gd->reloc_off;
- }
-}
-
-void fix_devices(void)
-{
- struct driver_info *dev =
- ll_entry_start(struct driver_info, driver_info);
- const int n_ents = ll_entry_count(struct driver_info, driver_info);
- struct driver_info *entry;
-
- for (entry = dev; entry != dev + n_ents; entry++) {
- if (entry->plat)
- entry->plat += gd->reloc_off;
- }
-}
-
static int dm_setup_inst(void)
{
DM_ROOT_NON_CONST = DM_DEVICE_GET(root);
@@ -181,12 +106,6 @@ int dm_init(bool of_live)
INIT_LIST_HEAD(DM_UCLASS_ROOT_NON_CONST);
}
- if (IS_ENABLED(CONFIG_NEEDS_MANUAL_RELOC)) {
- fix_drivers();
- fix_uclass();
- fix_devices();
- }
-
if (CONFIG_IS_ENABLED(OF_PLATDATA_INST)) {
ret = dm_setup_inst();
if (ret) {
diff --git a/drivers/cpu/cpu-uclass.c b/drivers/cpu/cpu-uclass.c
index a7548325265..9772578968b 100644
--- a/drivers/cpu/cpu-uclass.c
+++ b/drivers/cpu/cpu-uclass.c
@@ -127,36 +127,9 @@ static int uclass_cpu_init(struct uclass *uc)
return ret;
}
-static int uclass_cpu_post_bind(struct udevice *dev)
-{
- if (IS_ENABLED(CONFIG_NEEDS_MANUAL_RELOC) &&
- (gd->flags & GD_FLG_RELOC)) {
- struct cpu_ops *ops = cpu_get_ops(dev);
- static int reloc_done;
-
- if (!reloc_done) {
- if (ops->get_desc)
- MANUAL_RELOC(ops->get_desc);
- if (ops->get_info)
- MANUAL_RELOC(ops->get_info);
- if (ops->get_count)
- MANUAL_RELOC(ops->get_count);
- if (ops->get_vendor)
- MANUAL_RELOC(ops->get_vendor);
- if (ops->is_current)
- MANUAL_RELOC(ops->is_current);
-
- reloc_done++;
- }
- }
-
- return 0;
-}
-
UCLASS_DRIVER(cpu) = {
.id = UCLASS_CPU,
.name = "cpu",
.flags = DM_UC_FLAG_SEQ_ALIAS,
.init = uclass_cpu_init,
- .post_bind = uclass_cpu_post_bind,
};
diff --git a/drivers/crypto/rsa_mod_exp/mod_exp_uclass.c b/drivers/crypto/rsa_mod_exp/mod_exp_uclass.c
index 6a4d235d57b..057cc74b10b 100644
--- a/drivers/crypto/rsa_mod_exp/mod_exp_uclass.c
+++ b/drivers/crypto/rsa_mod_exp/mod_exp_uclass.c
@@ -16,24 +16,11 @@
#include <asm/io.h>
#include <linux/list.h>
-#if !defined(USE_HOSTCC) && defined(CONFIG_NEEDS_MANUAL_RELOC)
-DECLARE_GLOBAL_DATA_PTR;
-#endif
-
int rsa_mod_exp(struct udevice *dev, const uint8_t *sig, uint32_t sig_len,
struct key_prop *node, uint8_t *out)
{
struct mod_exp_ops *ops = (struct mod_exp_ops *)device_get_ops(dev);
-#if !defined(USE_HOSTCC) && defined(CONFIG_NEEDS_MANUAL_RELOC)
- static bool done;
-
- if (!done) {
- done = true;
- ops->mod_exp += gd->reloc_off;
- }
-#endif
-
if (!ops->mod_exp)
return -ENOSYS;
diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c
index fc395c97a28..7aece85a70a 100644
--- a/drivers/gpio/gpio-uclass.c
+++ b/drivers/gpio/gpio-uclass.c
@@ -1498,36 +1498,6 @@ void devm_gpiod_put(struct udevice *dev, struct gpio_desc *desc)
static int gpio_post_bind(struct udevice *dev)
{
-#if defined(CONFIG_NEEDS_MANUAL_RELOC)
- struct dm_gpio_ops *ops = (struct dm_gpio_ops *)device_get_ops(dev);
- static int reloc_done;
-
- if (!reloc_done) {
- if (ops->request)
- ops->request += gd->reloc_off;
- if (ops->rfree)
- ops->rfree += gd->reloc_off;
- if (ops->direction_input)
- ops->direction_input += gd->reloc_off;
- if (ops->direction_output)
- ops->direction_output += gd->reloc_off;
- if (ops->get_value)
- ops->get_value += gd->reloc_off;
- if (ops->set_value)
- ops->set_value += gd->reloc_off;
- if (ops->get_function)
- ops->get_function += gd->reloc_off;
- if (ops->xlate)
- ops->xlate += gd->reloc_off;
- if (ops->set_flags)
- ops->set_flags += gd->reloc_off;
- if (ops->get_flags)
- ops->get_flags += gd->reloc_off;
-
- reloc_done++;
- }
-#endif
-
if (CONFIG_IS_ENABLED(GPIO_HOG) && dev_has_ofnode(dev)) {
struct udevice *child;
ofnode node;
diff --git a/drivers/hwspinlock/hwspinlock-uclass.c b/drivers/hwspinlock/hwspinlock-uclass.c
index e012d5a4c93..e9a4d7f9fbb 100644
--- a/drivers/hwspinlock/hwspinlock-uclass.c
+++ b/drivers/hwspinlock/hwspinlock-uclass.c
@@ -123,28 +123,7 @@ int hwspinlock_unlock(struct hwspinlock *hws)
return ops->unlock(hws->dev, hws->id);
}
-static int hwspinlock_post_bind(struct udevice *dev)
-{
-#if defined(CONFIG_NEEDS_MANUAL_RELOC)
- struct hwspinlock_ops *ops = device_get_ops(dev);
- static int reloc_done;
-
- if (!reloc_done) {
- if (ops->lock)
- ops->lock += gd->reloc_off;
- if (ops->unlock)
- ops->unlock += gd->reloc_off;
- if (ops->relax)
- ops->relax += gd->reloc_off;
-
- reloc_done++;
- }
-#endif
- return 0;
-}
-
UCLASS_DRIVER(hwspinlock) = {
.id = UCLASS_HWSPINLOCK,
.name = "hwspinlock",
- .post_bind = hwspinlock_post_bind,
};
diff --git a/drivers/mtd/spi/sf-uclass.c b/drivers/mtd/spi/sf-uclass.c
index df1f75390c4..2da0cf0dcf9 100644
--- a/drivers/mtd/spi/sf-uclass.c
+++ b/drivers/mtd/spi/sf-uclass.c
@@ -96,22 +96,6 @@ static int spi_flash_post_bind(struct udevice *dev)
return log_msg_ret("bd", ret);
}
-#if defined(CONFIG_NEEDS_MANUAL_RELOC)
- struct dm_spi_flash_ops *ops = sf_get_ops(dev);
- static int reloc_done;
-
- if (!reloc_done) {
- if (ops->read)
- ops->read += gd->reloc_off;
- if (ops->write)
- ops->write += gd->reloc_off;
- if (ops->erase)
- ops->erase += gd->reloc_off;
-
- reloc_done++;
- }
-#endif
-
return 0;
}
diff --git a/drivers/net/phy/miiphybb.c b/drivers/net/phy/miiphybb.c
index 24d617553e7..cf71f7d4e7e 100644
--- a/drivers/net/phy/miiphybb.c
+++ b/drivers/net/phy/miiphybb.c
@@ -18,10 +18,6 @@
#include <miiphy.h>
#include <asm/global_data.h>
-#define BB_MII_RELOCATE(v,off) (v += (v?off:0))
-
-DECLARE_GLOBAL_DATA_PTR;
-
#ifndef CONFIG_BITBANGMII_MULTI
/*
@@ -110,21 +106,9 @@ int bb_miiphy_init(void)
{
int i;
- for (i = 0; i < bb_miiphy_buses_num; i++) {
-#if defined(CONFIG_NEEDS_MANUAL_RELOC)
- /* Relocate the hook pointers*/
- BB_MII_RELOCATE(bb_miiphy_buses[i].init, gd->reloc_off);
- BB_MII_RELOCATE(bb_miiphy_buses[i].mdio_active, gd->reloc_off);
- BB_MII_RELOCATE(bb_miiphy_buses[i].mdio_tristate, gd->reloc_off);
- BB_MII_RELOCATE(bb_miiphy_buses[i].set_mdio, gd->reloc_off);
- BB_MII_RELOCATE(bb_miiphy_buses[i].get_mdio, gd->reloc_off);
- BB_MII_RELOCATE(bb_miiphy_buses[i].set_mdc, gd->reloc_off);
- BB_MII_RELOCATE(bb_miiphy_buses[i].delay, gd->reloc_off);
-#endif
- if (bb_miiphy_buses[i].init != NULL) {
+ for (i = 0; i < bb_miiphy_buses_num; i++)
+ if (bb_miiphy_buses[i].init != NULL)
bb_miiphy_buses[i].init(&bb_miiphy_buses[i]);
- }
- }
return 0;
}
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index ae21acb059b..d50fd505e51 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -463,37 +463,6 @@ U_BOOT_PHY_DRIVER(genphy) = {
.shutdown = genphy_shutdown,
};
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
-int phy_init(void)
-{
- const int ll_n_ents = ll_entry_count(struct phy_driver, phy_driver);
- struct phy_driver *drv, *ll_entry;
-
- /* Perform manual relocation on linker list based PHY drivers */
- ll_entry = ll_entry_start(struct phy_driver, phy_driver);
- for (drv = ll_entry; drv != ll_entry + ll_n_ents; drv++) {
- if (drv->probe)
- drv->probe += gd->reloc_off;
- if (drv->config)
- drv->config += gd->reloc_off;
- if (drv->startup)
- drv->startup += gd->reloc_off;
- if (drv->shutdown)
- drv->shutdown += gd->reloc_off;
- if (drv->readext)
- drv->readext += gd->reloc_off;
- if (drv->writeext)
- drv->writeext += gd->reloc_off;
- if (drv->read_mmd)
- drv->read_mmd += gd->reloc_off;
- if (drv->write_mmd)
- drv->write_mmd += gd->reloc_off;
- }
-
- return 0;
-}
-#endif
-
int phy_set_supported(struct phy_device *phydev, u32 max_speed)
{
/* The default values for phydev->supported are provided by the PHY
diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
index e954f0189bb..5e2e7dfbcb3 100644
--- a/drivers/serial/serial-uclass.c
+++ b/drivers/serial/serial-uclass.c
@@ -508,28 +508,6 @@ static int serial_post_probe(struct udevice *dev)
#endif
int ret;
-#if defined(CONFIG_NEEDS_MANUAL_RELOC)
- if (ops->setbrg)
- ops->setbrg += gd->reloc_off;
- if (ops->getc)
- ops->getc += gd->reloc_off;
- if (ops->putc)
- ops->putc += gd->reloc_off;
- if (ops->pending)
- ops->pending += gd->reloc_off;
- if (ops->clear)
- ops->clear += gd->reloc_off;
- if (ops->getconfig)
- ops->getconfig += gd->reloc_off;
- if (ops->setconfig)
- ops->setconfig += gd->reloc_off;
-#if CFG_POST & CFG_SYS_POST_UART
- if (ops->loop)
- ops->loop += gd->reloc_off;
-#endif
- if (ops->getinfo)
- ops->getinfo += gd->reloc_off;
-#endif
/* Set the baud rate */
if (ops->setbrg) {
ret = ops->setbrg(dev, gd->baudrate);
diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c
index 9a380d7c5e7..787edd53602 100644
--- a/drivers/serial/serial.c
+++ b/drivers/serial/serial.c
@@ -142,23 +142,6 @@ serial_initfunc(mtk_serial_initialize);
*/
void serial_register(struct serial_device *dev)
{
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
- if (dev->start)
- dev->start += gd->reloc_off;
- if (dev->stop)
- dev->stop += gd->reloc_off;
- if (dev->setbrg)
- dev->setbrg += gd->reloc_off;
- if (dev->getc)
- dev->getc += gd->reloc_off;
- if (dev->tstc)
- dev->tstc += gd->reloc_off;
- if (dev->putc)
- dev->putc += gd->reloc_off;
- if (dev->puts)
- dev->puts += gd->reloc_off;
-#endif
-
dev->next = serial_devices;
serial_devices = dev;
}
diff --git a/drivers/spi/spi-uclass.c b/drivers/spi/spi-uclass.c
index c929e7c1d0e..f4795e68672 100644
--- a/drivers/spi/spi-uclass.c
+++ b/drivers/spi/spi-uclass.c
@@ -196,38 +196,6 @@ static int spi_post_probe(struct udevice *bus)
spi->max_hz = dev_read_u32_default(bus, "spi-max-frequency", 0);
}
-#if defined(CONFIG_NEEDS_MANUAL_RELOC)
- struct dm_spi_ops *ops = spi_get_ops(bus);
- static int reloc_done;
-
- if (!reloc_done) {
- if (ops->claim_bus)
- ops->claim_bus += gd->reloc_off;
- if (ops->release_bus)
- ops->release_bus += gd->reloc_off;
- if (ops->set_wordlen)
- ops->set_wordlen += gd->reloc_off;
- if (ops->xfer)
- ops->xfer += gd->reloc_off;
- if (ops->set_speed)
- ops->set_speed += gd->reloc_off;
- if (ops->set_mode)
- ops->set_mode += gd->reloc_off;
- if (ops->cs_info)
- ops->cs_info += gd->reloc_off;
- if (ops->mem_ops) {
- struct spi_controller_mem_ops *mem_ops =
- (struct spi_controller_mem_ops *)ops->mem_ops;
- if (mem_ops->adjust_op_size)
- mem_ops->adjust_op_size += gd->reloc_off;
- if (mem_ops->supports_op)
- mem_ops->supports_op += gd->reloc_off;
- if (mem_ops->exec_op)
- mem_ops->exec_op += gd->reloc_off;
- }
- reloc_done++;
- }
-#endif
return 0;
}
diff --git a/drivers/sysreset/sysreset-uclass.c b/drivers/sysreset/sysreset-uclass.c
index 279b087d16d..6151b5fe03e 100644
--- a/drivers/sysreset/sysreset-uclass.c
+++ b/drivers/sysreset/sysreset-uclass.c
@@ -158,23 +158,7 @@ int do_poweroff(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
}
#endif
-static int sysreset_post_bind(struct udevice *dev)
-{
-#if defined(CONFIG_NEEDS_MANUAL_RELOC)
- struct sysreset_ops *ops = sysreset_get_ops(dev);
- static int reloc_done;
-
- if (!reloc_done) {
- if (ops->request)
- ops->request += gd->reloc_off;
- reloc_done++;
- }
-#endif
- return 0;
-}
-
UCLASS_DRIVER(sysreset) = {
.id = UCLASS_SYSRESET,
.name = "sysreset",
- .post_bind = sysreset_post_bind,
};
diff --git a/drivers/timer/timer-uclass.c b/drivers/timer/timer-uclass.c
index f4b871ac23a..0c2018bfe3b 100644
--- a/drivers/timer/timer-uclass.c
+++ b/drivers/timer/timer-uclass.c
@@ -51,19 +51,6 @@ unsigned long notrace timer_get_rate(struct udevice *dev)
static int timer_pre_probe(struct udevice *dev)
{
- if (IS_ENABLED(CONFIG_NEEDS_MANUAL_RELOC) &&
- (gd->flags & GD_FLG_RELOC)) {
- struct timer_ops *ops = timer_get_ops(dev);
- static int reloc_done;
-
- if (!reloc_done) {
- if (ops->get_count)
- MANUAL_RELOC(ops->get_count);
-
- reloc_done++;
- }
- }
-
if (CONFIG_IS_ENABLED(OF_REAL)) {
struct timer_dev_priv *uc_priv = dev_get_uclass_priv(dev);
struct clk timer_clk;
diff --git a/drivers/watchdog/wdt-uclass.c b/drivers/watchdog/wdt-uclass.c
index 509896a1b80..ed329284dec 100644
--- a/drivers/watchdog/wdt-uclass.c
+++ b/drivers/watchdog/wdt-uclass.c
@@ -236,28 +236,6 @@ void watchdog_reset(void)
}
#endif
-static int wdt_post_bind(struct udevice *dev)
-{
-#if defined(CONFIG_NEEDS_MANUAL_RELOC)
- struct wdt_ops *ops = (struct wdt_ops *)device_get_ops(dev);
- static int reloc_done;
-
- if (!reloc_done) {
- if (ops->start)
- ops->start += gd->reloc_off;
- if (ops->stop)
- ops->stop += gd->reloc_off;
- if (ops->reset)
- ops->reset += gd->reloc_off;
- if (ops->expire_now)
- ops->expire_now += gd->reloc_off;
-
- reloc_done++;
- }
-#endif
- return 0;
-}
-
static int wdt_pre_probe(struct udevice *dev)
{
u32 timeout = WATCHDOG_TIMEOUT_SECS;
@@ -295,7 +273,6 @@ UCLASS_DRIVER(wdt) = {
.id = UCLASS_WDT,
.name = "watchdog",
.flags = DM_UC_FLAG_SEQ_ALIAS,
- .post_bind = wdt_post_bind,
.pre_probe = wdt_pre_probe,
.per_device_auto = sizeof(struct wdt_priv),
};
diff --git a/env/callback.c b/env/callback.c
index 638a02b28f7..98ddba035ea 100644
--- a/env/callback.c
+++ b/env/callback.c
@@ -9,10 +9,6 @@
#include <env_internal.h>
#include <asm/global_data.h>
-#if defined(CONFIG_NEEDS_MANUAL_RELOC)
-DECLARE_GLOBAL_DATA_PTR;
-#endif
-
/*
* Look up a callback function pointer by name
*/
@@ -71,11 +67,7 @@ void env_callback_init(struct env_entry *var_entry)
if (!ret && strlen(callback_name)) {
clbkp = find_env_callback(callback_name);
if (clbkp != NULL)
-#if defined(CONFIG_NEEDS_MANUAL_RELOC)
- var_entry->callback = clbkp->callback + gd->reloc_off;
-#else
var_entry->callback = clbkp->callback;
-#endif
}
}
@@ -112,11 +104,7 @@ static int set_callback(const char *name, const char *value, void *priv)
/* assign the requested callback */
clbkp = find_env_callback(value);
if (clbkp != NULL)
-#if defined(CONFIG_NEEDS_MANUAL_RELOC)
- ep->callback = clbkp->callback + gd->reloc_off;
-#else
ep->callback = clbkp->callback;
-#endif
}
}
diff --git a/env/common.c b/env/common.c
index 0ecdb248a08..21045a7eb33 100644
--- a/env/common.c
+++ b/env/common.c
@@ -428,11 +428,6 @@ int env_export(env_t *env_out)
void env_relocate(void)
{
-#if defined(CONFIG_NEEDS_MANUAL_RELOC)
- env_reloc();
- env_fix_drivers();
- env_htab.change_ok += gd->reloc_off;
-#endif
if (gd->env_valid == ENV_INVALID) {
#if defined(CONFIG_ENV_IS_NOWHERE) || defined(CONFIG_SPL_BUILD)
/* Environment not changable */
diff --git a/env/env.c b/env/env.c
index 2aa52c98f8f..bae3f6482ae 100644
--- a/env/env.c
+++ b/env/env.c
@@ -14,29 +14,6 @@
DECLARE_GLOBAL_DATA_PTR;
-#if defined(CONFIG_NEEDS_MANUAL_RELOC)
-void env_fix_drivers(void)
-{
- struct env_driver *drv;
- const int n_ents = ll_entry_count(struct env_driver, env_driver);
- struct env_driver *entry;
-
- drv = ll_entry_start(struct env_driver, env_driver);
- for (entry = drv; entry != drv + n_ents; entry++) {
- if (entry->name)
- entry->name += gd->reloc_off;
- if (entry->load)
- entry->load += gd->reloc_off;
- if (entry->save)
- entry->save += gd->reloc_off;
- if (entry->erase)
- entry->erase += gd->reloc_off;
- if (entry->init)
- entry->init += gd->reloc_off;
- }
-}
-#endif
-
static struct env_driver *_env_driver_lookup(enum env_location loc)
{
struct env_driver *drv;
diff --git a/fs/fs.c b/fs/fs.c
index 2b815b1db0f..cfc781bbb8d 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -422,22 +422,6 @@ int fs_set_blk_dev(const char *ifname, const char *dev_part_str, int fstype)
{
struct fstype_info *info;
int part, i;
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
- static int relocated;
-
- if (!relocated) {
- for (i = 0, info = fstypes; i < ARRAY_SIZE(fstypes);
- i++, info++) {
- info->name += gd->reloc_off;
- info->probe += gd->reloc_off;
- info->close += gd->reloc_off;
- info->ls += gd->reloc_off;
- info->read += gd->reloc_off;
- info->write += gd->reloc_off;
- }
- relocated = 1;
- }
-#endif
part = part_get_info_by_dev_and_name_or_num(ifname, dev_part_str, &fs_dev_desc,
&fs_partition, 1);
diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
index 609bdbf6037..a509584e5d7 100644
--- a/fs/ubifs/ubifs.c
+++ b/fs/ubifs/ubifs.c
@@ -201,12 +201,6 @@ static int __init compr_init(struct ubifs_compressor *compr)
{
ubifs_compressors[compr->compr_type] = compr;
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
- ubifs_compressors[compr->compr_type]->name += gd->reloc_off;
- ubifs_compressors[compr->compr_type]->capi_name += gd->reloc_off;
- ubifs_compressors[compr->compr_type]->decompress += gd->reloc_off;
-#endif
-
if (compr->capi_name) {
compr->cc = crypto_alloc_comp(compr->capi_name, 0, 0);
if (IS_ERR(compr->cc)) {
diff --git a/include/blk.h b/include/blk.h
index b819f97c2f1..95e86e2d5d1 100644
--- a/include/blk.h
+++ b/include/blk.h
@@ -105,12 +105,6 @@ struct blk_desc {
(PAD_SIZE(size, blk_desc->blksz))
#if CONFIG_IS_ENABLED(BLOCK_CACHE)
-
-/**
- * blkcache_init() - initialize the block cache list pointers
- */
-int blkcache_init(void);
-
/**
* blkcache_read() - attempt to read a set of blocks from cache
*
diff --git a/include/command.h b/include/command.h
index c4e3170967d..ae7bb4a30b0 100644
--- a/include/command.h
+++ b/include/command.h
@@ -318,24 +318,6 @@ int cmd_source_script(ulong addr, const char *fit_uname, const char *confname);
# define _CMD_HELP(x)
#endif
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
-#define U_BOOT_SUBCMDS_RELOC(_cmdname) \
- static void _cmdname##_subcmds_reloc(void) \
- { \
- static int relocated; \
- \
- if (relocated) \
- return; \
- \
- fixup_cmdtable(_cmdname##_subcmds, \
- ARRAY_SIZE(_cmdname##_subcmds)); \
- relocated = 1; \
- }
-#else
-#define U_BOOT_SUBCMDS_RELOC(_cmdname) \
- static void _cmdname##_subcmds_reloc(void) { }
-#endif
-
#define U_BOOT_SUBCMDS_DO_CMD(_cmdname) \
static int do_##_cmdname(struct cmd_tbl *cmdtp, int flag, \
int argc, char *const argv[], \
@@ -343,8 +325,6 @@ int cmd_source_script(ulong addr, const char *fit_uname, const char *confname);
{ \
struct cmd_tbl *subcmd; \
\
- _cmdname##_subcmds_reloc(); \
- \
/* We need at least the cmd and subcmd names. */ \
if (argc < 2 || argc > CONFIG_SYS_MAXARGS) \
return CMD_RET_USAGE; \
@@ -379,7 +359,6 @@ int cmd_source_script(ulong addr, const char *fit_uname, const char *confname);
#define U_BOOT_SUBCMDS(_cmdname, ...) \
static struct cmd_tbl _cmdname##_subcmds[] = { __VA_ARGS__ }; \
- U_BOOT_SUBCMDS_RELOC(_cmdname) \
U_BOOT_SUBCMDS_DO_CMD(_cmdname) \
U_BOOT_SUBCMDS_COMPLETE(_cmdname)
diff --git a/include/env.h b/include/env.h
index 1480efa59e3..430c4fa94a4 100644
--- a/include/env.h
+++ b/include/env.h
@@ -240,11 +240,6 @@ int eth_env_get_enetaddr(const char *name, uint8_t *enetaddr);
int eth_env_set_enetaddr(const char *name, const uint8_t *enetaddr);
/**
- * env_fix_drivers() - Updates envdriver as per relocation
- */
-void env_fix_drivers(void);
-
-/**
* env_set_default_vars() - reset variables to their default value
*
* This resets individual variables to their value in the default environment
@@ -357,14 +352,6 @@ char *env_get_default(const char *name);
void env_set_default(const char *s, int flags);
/**
- * env_reloc() - Relocate the 'env' sub-commands
- *
- * This is used for those unfortunate archs with crappy toolchains
- */
-void env_reloc(void);
-
-
-/**
* env_import_fdt() - Import environment values from device tree blob
*
* This uses the value of the environment variable "env_fdt_path" as a
diff --git a/include/event.h b/include/event.h
index 311df878c4a..be4cefd6ae8 100644
--- a/include/event.h
+++ b/include/event.h
@@ -329,16 +329,6 @@ int event_register(const char *id, enum event_t type, event_handler_t func,
void event_show_spy_list(void);
/**
- * event_manual_reloc() - Relocate event handler pointers
- *
- * Relocate event handler pointers for all static event spies. It is called
- * during the generic board init sequence, after relocation.
- *
- * Return: 0 if OK
- */
-int event_manual_reloc(void);
-
-/**
* event_type_name() - Get the name of an event type
*
* @type: Type to check
diff --git a/include/initcall.h b/include/initcall.h
index 208effd8d13..62d3bb67f08 100644
--- a/include/initcall.h
+++ b/include/initcall.h
@@ -35,11 +35,4 @@ typedef int (*init_fnc_t)(void);
*/
int initcall_run_list(const init_fnc_t init_sequence[]);
-/**
- * initcall_manual_reloc() - Do manual relocation on an initcall sequence
- *
- * @init_sequence: NULL-terminated init sequence to relocate
- */
-void initcall_manual_reloc(init_fnc_t init_sequence[]);
-
#endif
diff --git a/include/phy.h b/include/phy.h
index f023a3c2685..27effdb5763 100644
--- a/include/phy.h
+++ b/include/phy.h
@@ -172,14 +172,6 @@ struct fixed_link {
};
/**
- * phy_init() - Initializes the PHY drivers
- * This function registers all available PHY drivers
- *
- * @return: 0 if OK, -ve on error
- */
-int phy_init(void);
-
-/**
* phy_reset() - Resets the specified PHY
* Issues a reset of the PHY and waits for it to complete
*
diff --git a/include/post.h b/include/post.h
index 41120695064..6e88d550722 100644
--- a/include/post.h
+++ b/include/post.h
@@ -105,9 +105,6 @@ void post_bootmode_clear (void);
int post_run (char *name, int flags);
int post_info (char *name);
int post_log (char *format, ...);
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
-void post_reloc (void);
-#endif
unsigned long post_time_ms (unsigned long base);
/**
diff --git a/include/relocate.h b/include/relocate.h
index 2dbfd901e4f..8ca25e1105e 100644
--- a/include/relocate.h
+++ b/include/relocate.h
@@ -39,28 +39,4 @@ int clear_bss(void);
*/
int do_elf_reloc_fixups(void);
-/**
- * manual_reloc() - Manually relocate a pointer if needed
- *
- * This is a nop in almost all cases, except for the systems with a broken gcc
- * which need to manually relocate some things.
- *
- * @ptr: Pointer to relocate
- * Return: new pointer value
- */
-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;
-}
-
-#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);
- }
-}
diff --git a/net/eth-uclass.c b/net/eth-uclass.c
index c393600fabc..4311f3fe6e8 100644
--- a/net/eth-uclass.c
+++ b/net/eth-uclass.c
@@ -556,32 +556,6 @@ static int eth_post_probe(struct udevice *dev)
unsigned char env_enetaddr[ARP_HLEN];
char *source = "DT";
-#if defined(CONFIG_NEEDS_MANUAL_RELOC)
- struct eth_ops *ops = eth_get_ops(dev);
- static int reloc_done;
-
- if (!reloc_done) {
- if (ops->start)
- ops->start += gd->reloc_off;
- if (ops->send)
- ops->send += gd->reloc_off;
- if (ops->recv)
- ops->recv += gd->reloc_off;
- if (ops->free_pkt)
- ops->free_pkt += gd->reloc_off;
- if (ops->stop)
- ops->stop += gd->reloc_off;
- if (ops->mcast)
- ops->mcast += gd->reloc_off;
- if (ops->write_hwaddr)
- ops->write_hwaddr += gd->reloc_off;
- if (ops->read_rom_hwaddr)
- ops->read_rom_hwaddr += gd->reloc_off;
-
- reloc_done++;
- }
-#endif
-
priv->state = ETH_STATE_INIT;
priv->running = false;
diff --git a/net/eth_common.c b/net/eth_common.c
index c94a7ba6ae7..14d4c07b695 100644
--- a/net/eth_common.c
+++ b/net/eth_common.c
@@ -36,10 +36,6 @@ void eth_common_init(void)
#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) || defined(CONFIG_PHYLIB)
miiphy_init();
#endif
-
-#if defined(CONFIG_NEEDS_MANUAL_RELOC) && defined(CONFIG_PHYLIB)
- phy_init();
-#endif
#endif
}
diff --git a/post/post.c b/post/post.c
index 4db862c0dbb..946d9094d45 100644
--- a/post/post.c
+++ b/post/post.c
@@ -416,54 +416,6 @@ int post_log(char *format, ...)
return 0;
}
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
-void post_reloc(void)
-{
- unsigned int i;
-
- /*
- * We have to relocate the test table manually
- */
- for (i = 0; i < post_list_size; i++) {
- ulong addr;
- struct post_test *test = post_list + i;
-
- if (test->name) {
- addr = (ulong)(test->name) + gd->reloc_off;
- test->name = (char *)addr;
- }
-
- if (test->cmd) {
- addr = (ulong)(test->cmd) + gd->reloc_off;
- test->cmd = (char *)addr;
- }
-
- if (test->desc) {
- addr = (ulong)(test->desc) + gd->reloc_off;
- test->desc = (char *)addr;
- }
-
- if (test->test) {
- addr = (ulong)(test->test) + gd->reloc_off;
- test->test = (int (*)(int flags)) addr;
- }
-
- if (test->init_f) {
- addr = (ulong)(test->init_f) + gd->reloc_off;
- test->init_f = (int (*)(void)) addr;
- }
-
- if (test->reloc) {
- addr = (ulong)(test->reloc) + gd->reloc_off;
- test->reloc = (void (*)(void)) addr;
-
- test->reloc();
- }
- }
-}
-#endif
-
-
/*
* Some tests (e.g. SYSMON) need the time when post_init_f started,
* but we cannot use get_timer() at this point.