Replace CONFIG_RELOC_FIXUP_WORKS by CONFIG_NEEDS_MANUAL_RELOC
authorWolfgang Denk <wd@denx.de>
Thu, 28 Oct 2010 18:00:11 +0000 (20:00 +0200)
committerWolfgang Denk <wd@denx.de>
Fri, 29 Oct 2010 19:32:07 +0000 (21:32 +0200)
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.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Tested-by: Heiko Schocher <hs@denx.de>
Tested-by: Reinhard Meyer <u-boot@emk-elektronik.de>
37 files changed:
arch/arm/include/asm/config.h
arch/arm/lib/board.c
arch/avr32/include/asm/config.h
arch/avr32/lib/board.c
arch/blackfin/include/asm/config.h
arch/i386/include/asm/config.h
arch/m68k/include/asm/config.h
arch/m68k/lib/board.c
arch/microblaze/include/asm/config.h
arch/mips/include/asm/config.h
arch/mips/lib/board.c
arch/nios2/include/asm/config.h
arch/powerpc/include/asm/config.h
arch/sh/include/asm/config.h
arch/sparc/include/asm/config.h
arch/sparc/lib/board.c
common/cmd_bmp.c
common/cmd_bootm.c
common/cmd_date.c
common/cmd_i2c.c
common/cmd_nvedit.c
common/cmd_onenand.c
common/command.c
common/dlmalloc.c
common/env_common.c
common/hush.c
common/image.c
common/serial.c
common/stdio.c
disk/part.c
doc/README.arm-relocation
drivers/mtd/nand/nand.c
drivers/net/phy/miiphybb.c
fs/ubifs/ubifs.c
include/command.h
include/post.h
post/post.c

index 4124f0a..c60dba2 100644 (file)
@@ -21,9 +21,6 @@
 #ifndef _ASM_CONFIG_H_
 #define _ASM_CONFIG_H_
 
-/* Relocation to SDRAM works on all ARM boards */
-#define CONFIG_RELOC_FIXUP_WORKS
-
 #define CONFIG_LMB
 #define CONFIG_SYS_BOOT_RAMDISK_HIGH
 #endif
index af9a414..33b3694 100644 (file)
@@ -678,15 +678,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
        ulong malloc_start;
 #if !defined(CONFIG_SYS_NO_FLASH)
        ulong flash_size;
-#endif
-#if !defined(CONFIG_RELOC_FIXUP_WORKS)
-       extern void malloc_bin_reloc (void);
-#if defined(CONFIG_CMD_BMP)
-       extern void bmp_reloc(void);
-#endif
-#if defined(CONFIG_CMD_I2C)
-       extern void i2c_reloc(void);
-#endif
 #endif
 
        gd = id;
@@ -704,39 +695,16 @@ void board_init_r (gd_t *id, ulong dest_addr)
 
        debug ("Now running in RAM - U-Boot at: %08lx\n", dest_addr);
 
-#if !defined(CONFIG_RELOC_FIXUP_WORKS)
-       /*
-        * We have to relocate the command table manually
-        */
-       fixup_cmdtable(&__u_boot_cmd_start,
-               (ulong)(&__u_boot_cmd_end - &__u_boot_cmd_start));
-#if defined(CONFIG_CMD_BMP)
-       bmp_reloc();
-#endif
-#if defined(CONFIG_CMD_I2C)
-       i2c_reloc();
-#endif
-#if defined(CONFIG_CMD_ONENAND)
-       onenand_reloc();
-#endif
-#endif /* !defined(CONFIG_RELOC_FIXUP_WORKS) */
-
 #ifdef CONFIG_LOGBUFFER
        logbuff_init_ptrs ();
 #endif
 #ifdef CONFIG_POST
        post_output_backlog ();
-#ifndef CONFIG_RELOC_FIXUP_WORKS
-       post_reloc ();
-#endif
 #endif
 
        /* The Malloc area is immediately below the monitor copy in DRAM */
        malloc_start = dest_addr - TOTAL_MALLOC_LEN;
        mem_malloc_init (malloc_start, TOTAL_MALLOC_LEN);
-#if !defined(CONFIG_RELOC_FIXUP_WORKS)
-       malloc_bin_reloc ();
-#endif
 
 #if !defined(CONFIG_SYS_NO_FLASH)
        puts ("FLASH: ");
index 049c44e..02fbfb3 100644 (file)
@@ -21,4 +21,6 @@
 #ifndef _ASM_CONFIG_H_
 #define _ASM_CONFIG_H_
 
+#define CONFIG_NEEDS_MANUAL_RELOC
+
 #endif
index 96ccc7f..8b56237 100644 (file)
@@ -272,13 +272,13 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)
 
        monitor_flash_len = _edata - _text;
 
-#if !defined(CONFIG_RELOC_FIXUP_WORKS)
+#if defined(CONFIG_NEEDS_MANUAL_RELOC)
        /*
         * We have to relocate the command table manually
         */
        fixup_cmdtable(&__u_boot_cmd_start,
                (ulong)(&__u_boot_cmd_end - &__u_boot_cmd_start));
-#endif /* !defined(CONFIG_RELOC_FIXUP_WORKS) */
+#endif /* defined(CONFIG_NEEDS_MANUAL_RELOC) */
 
        /* there are some other pointer constants we must deal with */
 #ifndef CONFIG_ENV_IS_NOWHERE
index 34ca68c..388434f 100644 (file)
@@ -13,9 +13,6 @@
 # define CONFIG_BFIN_SCRATCH_REG retn
 #endif
 
-/* Relocation to SDRAM works on all Blackfin boards */
-#define CONFIG_RELOC_FIXUP_WORKS
-
 /* Make sure the structure is properly aligned */
 #if ((CONFIG_SYS_GBL_DATA_ADDR & -4) != CONFIG_SYS_GBL_DATA_ADDR)
 # error CONFIG_SYS_GBL_DATA_ADDR: must be 4 byte aligned
index 1952de7..049c44e 100644 (file)
@@ -21,6 +21,4 @@
 #ifndef _ASM_CONFIG_H_
 #define _ASM_CONFIG_H_
 
-#define CONFIG_RELOC_FIXUP_WORKS
-
 #endif
index ec2cc16..51050a3 100644 (file)
@@ -21,6 +21,8 @@
 #ifndef _ASM_CONFIG_H_
 #define _ASM_CONFIG_H_
 
+#define CONFIG_NEEDS_MANUAL_RELOC
+
 #define CONFIG_LMB
 #define CONFIG_SYS_BOOT_RAMDISK_HIGH
 #define CONFIG_SYS_BOOT_GET_CMDLINE
index 976d5bf..9a51908 100644 (file)
@@ -420,13 +420,13 @@ void board_init_r (gd_t *id, ulong dest_addr)
 
        monitor_flash_len = (ulong)&__init_end - dest_addr;
 
-#if !defined(CONFIG_RELOC_FIXUP_WORKS)
+#if defined(CONFIG_NEEDS_MANUAL_RELOC)
        /*
         * We have to relocate the command table manually
         */
        fixup_cmdtable(&__u_boot_cmd_start,
                (ulong)(&__u_boot_cmd_end - &__u_boot_cmd_start));
-#endif /* !defined(CONFIG_RELOC_FIXUP_WORKS) */
+#endif /* defined(CONFIG_NEEDS_MANUAL_RELOC) */
 
        /* there are some other pointer constants we must deal with */
 #ifndef CONFIG_ENV_IS_NOWHERE
index 8a9064b..049c44e 100644 (file)
@@ -21,7 +21,4 @@
 #ifndef _ASM_CONFIG_H_
 #define _ASM_CONFIG_H_
 
-/* Relocation to SDRAM works on all Microblaze boards */
-#define CONFIG_RELOC_FIXUP_WORKS
-
 #endif
index 049c44e..02fbfb3 100644 (file)
@@ -21,4 +21,6 @@
 #ifndef _ASM_CONFIG_H_
 #define _ASM_CONFIG_H_
 
+#define CONFIG_NEEDS_MANUAL_RELOC
+
 #endif
index 4a22f7b..f317124 100644 (file)
@@ -295,13 +295,13 @@ void board_init_r (gd_t *id, ulong dest_addr)
 
        monitor_flash_len = (ulong)&uboot_end_data - dest_addr;
 
-#if !defined(CONFIG_RELOC_FIXUP_WORKS)
+#if defined(CONFIG_NEEDS_MANUAL_RELOC)
        /*
         * We have to relocate the command table manually
         */
        fixup_cmdtable(&__u_boot_cmd_start,
                (ulong)(&__u_boot_cmd_end - &__u_boot_cmd_start));
-#endif /* !defined(CONFIG_RELOC_FIXUP_WORKS) */
+#endif /* defined(CONFIG_NEEDS_MANUAL_RELOC) */
 
        /* there are some other pointer constants we must deal with */
 #ifndef CONFIG_ENV_IS_NOWHERE
index 011d603..049c44e 100644 (file)
@@ -21,7 +21,4 @@
 #ifndef _ASM_CONFIG_H_
 #define _ASM_CONFIG_H_
 
-/* Relocation to SDRAM works on all NIOS2 boards */
-#define CONFIG_RELOC_FIXUP_WORKS
-
 #endif
index a1942ca..76dedeb 100644 (file)
@@ -89,9 +89,6 @@
 #define CONFIG_SYS_NUM_TLBCAMS 16
 #endif
 
-/* Relocation to SDRAM works on all PPC boards */
-#define CONFIG_RELOC_FIXUP_WORKS
-
 /* Since so many PPC SOCs have a semi-common LBC, define this here */
 #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) || \
        defined(CONFIG_MPC83xx)
index 978cc92..049c44e 100644 (file)
@@ -21,7 +21,4 @@
 #ifndef _ASM_CONFIG_H_
 #define _ASM_CONFIG_H_
 
-/* Relocation to SDRAM works on all sh boards */
-#define CONFIG_RELOC_FIXUP_WORKS
-
 #endif
index 6ddc349..7b6f30b 100644 (file)
@@ -21,6 +21,8 @@
 #ifndef _ASM_CONFIG_H_
 #define _ASM_CONFIG_H_
 
+#define CONFIG_NEEDS_MANUAL_RELOC
+
 #define CONFIG_LMB
 #define CONFIG_SYS_BOOT_RAMDISK_HIGH
 
index 4a6041f..ab31cfb 100644 (file)
@@ -252,13 +252,13 @@ void board_init_f(ulong bootflag)
        post_run(NULL, POST_ROM | post_bootmode_get(0));
 #endif
 
-#if !defined(CONFIG_RELOC_FIXUP_WORKS)
+#if defined(CONFIG_NEEDS_MANUAL_RELOC)
        /*
         * We have to relocate the command table manually
         */
        fixup_cmdtable(&__u_boot_cmd_start,
                (ulong)(&__u_boot_cmd_end - &__u_boot_cmd_start));
-#endif /* !defined(CONFIG_RELOC_FIXUP_WORKS) */
+#endif /* defined(CONFIG_NEEDS_MANUAL_RELOC) */
 
 #if defined(CONFIG_CMD_AMBAPP) && defined(CONFIG_SYS_AMBAPP_PRINT_ON_STARTUP)
        puts("AMBA:\n");
index 6fa8a15..f2a48f7 100644 (file)
@@ -137,7 +137,7 @@ static cmd_tbl_t cmd_bmp_sub[] = {
        U_BOOT_CMD_MKENT(display, 5, 0, do_bmp_display, "", ""),
 };
 
-#ifndef CONFIG_RELOC_FIXUP_WORKS
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
 void bmp_reloc(void) {
        fixup_cmdtable(cmd_bmp_sub, ARRAY_SIZE(cmd_bmp_sub));
 }
index ce3c77c..1a024f1 100644 (file)
@@ -590,7 +590,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        ulong           load_end = 0;
        int             ret;
        boot_os_fn      *boot_fn;
-#ifndef CONFIG_RELOC_FIXUP_WORKS
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
        static int relocated = 0;
 
        /* relocate boot function table */
index 50b4240..8dbf16d 100644 (file)
@@ -35,10 +35,10 @@ const char *weekdays[] = {
        "Sun", "Mon", "Tues", "Wednes", "Thurs", "Fri", "Satur",
 };
 
-#ifdef CONFIG_RELOC_FIXUP_WORKS
-#define RELOC(a)       a
-#else
+#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 (char *, struct rtc_time *);
index 0a0cfce..c272b0d 100644 (file)
@@ -1284,7 +1284,7 @@ static cmd_tbl_t cmd_i2c_sub[] = {
        U_BOOT_CMD_MKENT(speed, 1, 1, do_i2c_bus_speed, "", ""),
 };
 
-#ifndef CONFIG_RELOC_FIXUP_WORKS
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
 void i2c_reloc(void) {
        fixup_cmdtable(cmd_i2c_sub, ARRAY_SIZE(cmd_i2c_sub));
 }
index 3d30c32..3fd8abc 100644 (file)
@@ -837,7 +837,7 @@ static cmd_tbl_t cmd_env_sub[] = {
        U_BOOT_CMD_MKENT(set, CONFIG_SYS_MAXARGS, 0, do_env_set, "", ""),
 };
 
-#if !defined(CONFIG_RELOC_FIXUP_WORKS)
+#if defined(CONFIG_NEEDS_MANUAL_RELOC)
 void env_reloc(void)
 {
        fixup_cmdtable(cmd_env_sub, ARRAY_SIZE(cmd_env_sub));
index 5550b40..33108f1 100644 (file)
@@ -525,7 +525,7 @@ static cmd_tbl_t cmd_onenand_sub[] = {
        U_BOOT_CMD_MKENT(markbad, CONFIG_SYS_MAXARGS, 0, do_onenand_markbad, "", ""),
 };
 
-#ifndef CONFIG_RELOC_FIXUP_WORKS
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
 void onenand_reloc(void) {
        fixup_cmdtable(cmd_onenand_sub, ARRAY_SIZE(cmd_onenand_sub));
 }
index d47d719..0020eac 100644 (file)
@@ -466,7 +466,7 @@ int cmd_get_data_size(char* arg, int default_size)
 }
 #endif
 
-#if !defined(CONFIG_RELOC_FIXUP_WORKS)
+#if defined(CONFIG_NEEDS_MANUAL_RELOC)
 DECLARE_GLOBAL_DATA_PTR;
 
 void fixup_cmdtable(cmd_tbl_t *cmdtp, int size)
index fce7a76..4871f4b 100644 (file)
@@ -1491,7 +1491,7 @@ static mbinptr av_[NAV * 2 + 2] = {
  IAV(120), IAV(121), IAV(122), IAV(123), IAV(124), IAV(125), IAV(126), IAV(127)
 };
 
-#ifndef CONFIG_RELOC_FIXUP_WORKS
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
 void malloc_bin_reloc (void)
 {
        unsigned long *p = (unsigned long *)(&av_[2]);
index 5acda4d..a276efc 100644 (file)
@@ -227,7 +227,7 @@ int env_import(const char *buf, int check)
 
 void env_relocate (void)
 {
-#if !defined(CONFIG_RELOC_FIXUP_WORKS)
+#if defined(CONFIG_NEEDS_MANUAL_RELOC)
        extern void env_reloc(void);
 
        env_reloc();
index 4dd9513..2188fd4 100644 (file)
@@ -3268,7 +3268,7 @@ int parse_file_outer(void)
 }
 
 #ifdef __U_BOOT__
-#ifndef CONFIG_RELOC_FIXUP_WORKS
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
 static void u_boot_hush_reloc(void)
 {
        unsigned long addr;
@@ -3290,7 +3290,7 @@ int u_boot_hush_start(void)
                top_vars->next = 0;
                top_vars->flg_export = 0;
                top_vars->flg_read_only = 1;
-#ifndef CONFIG_RELOC_FIXUP_WORKS
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
                u_boot_hush_reloc();
 #endif
        }
index 89c10b8..42f5b79 100644 (file)
@@ -520,7 +520,7 @@ char *get_table_entry_name (table_entry_t *table, char *msg, int id)
 {
        for (; table->id >= 0; ++table) {
                if (table->id == id)
-#if defined(USE_HOSTCC) || defined(CONFIG_RELOC_FIXUP_WORKS)
+#if defined(USE_HOSTCC) || !defined(CONFIG_NEEDS_MANUAL_RELOC)
                        return table->lname;
 #else
                        return table->lname + gd->reloc_off;
@@ -585,10 +585,10 @@ int get_table_entry_id (table_entry_t *table,
        fprintf (stderr, "\n");
 #else
        for (t = table; t->id >= 0; ++t) {
-#ifdef CONFIG_RELOC_FIXUP_WORKS
-               if (t->sname && strcmp(t->sname, name) == 0)
-#else
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
                if (t->sname && strcmp(t->sname + gd->reloc_off, name) == 0)
+#else
+               if (t->sname && strcmp(t->sname, name) == 0)
 #endif
                        return (t->id);
        }
index c3323ea..051ae4e 100644 (file)
@@ -99,7 +99,7 @@ struct serial_device *default_serial_console(void) __attribute__((weak, alias("_
 
 int serial_register (struct serial_device *dev)
 {
-#ifndef CONFIG_RELOC_FIXUP_WORKS
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
        dev->init += gd->reloc_off;
        dev->setbrg += gd->reloc_off;
        dev->getc += gd->reloc_off;
index 2501369..ab7c5ab 100644 (file)
@@ -193,7 +193,7 @@ int stdio_deregister(char *devname)
 
 int stdio_init (void)
 {
-#if !defined(CONFIG_RELOC_FIXUP_WORKS)
+#if defined(CONFIG_NEEDS_MANUAL_RELOC)
        /* already relocated for current ARM implementation */
        ulong relocation_offset = gd->reloc_off;
        int i;
@@ -203,7 +203,7 @@ int stdio_init (void)
                stdio_names[i] = (char *) (((ulong) stdio_names[i]) +
                                                relocation_offset);
        }
-#endif /* !CONFIG_RELOC_FIXUP_WORKS */
+#endif /* CONFIG_NEEDS_MANUAL_RELOC */
 
        /* Initialize the list */
        INIT_LIST_HEAD(&(devs.list));
index 2b63db6..13723f2 100644 (file)
@@ -81,13 +81,13 @@ block_dev_desc_t *get_dev(char* ifname, int dev)
        char *name;
 
        name = drvr->name;
-#ifndef CONFIG_RELOC_FIXUP_WORKS
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
        name += gd->reloc_off;
 #endif
        while (name) {
                name = drvr->name;
                reloc_get_dev = drvr->get_dev;
-#ifndef CONFIG_RELOC_FIXUP_WORKS
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
                name += gd->reloc_off;
                reloc_get_dev += gd->reloc_off;
 #endif
index dc7be7e..2f91d0a 100644 (file)
@@ -36,15 +36,14 @@ At lib level:
 
 At config level:
 
-       Define CONFIG_RELOC_FIXUP_WORKS.
        Undefine CONFIG_SYS_ARM_WITHOUT_RELOC
 
 * WARNING ** WARNING ** WARNING ** WARNING ** WARNING ** WARNING ** WARNING *
 
 Boards which are not fixed to support relocation will be REMOVED!
 
-Eventually, CONFIG_SYS_ARM_WITHOUT_RELOC and CONFIG_RELOC_FIXUP_WORKS will
-disappear and boards which have to migrated to relocation will disappear too.
+Eventually, CONFIG_SYS_ARM_WITHOUT_RELOC will disappear and boards
+which have to migrated to relocation will disappear too.
 
 -----------------------------------------------------------------------------
 
index 47d6872..c0e068a 100644 (file)
@@ -54,7 +54,7 @@ static void nand_init_chip(struct mtd_info *mtd, struct nand_chip *nand,
                if (nand_scan(mtd, maxchips) == 0) {
                        if (!mtd->name)
                                mtd->name = (char *)default_nand_name;
-#ifndef CONFIG_RELOC_FIXUP_WORKS
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
                        else
                                mtd->name += gd->reloc_off;
 #endif
index 1045cf1..49a1f5f 100644 (file)
@@ -127,7 +127,7 @@ void bb_miiphy_init(void)
        int i;
 
        for (i = 0; i < bb_miiphy_buses_num; i++) {
-#if !defined(CONFIG_RELOC_FIXUP_WORKS)
+#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);
index 3fc7990..1cc31a9 100644 (file)
@@ -121,7 +121,7 @@ static int __init compr_init(struct ubifs_compressor *compr)
 {
        ubifs_compressors[compr->compr_type] = compr;
 
-#ifndef CONFIG_RELOC_FIXUP_WORKS
+#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;
index 5c14616..46a9ec4 100644 (file)
@@ -125,7 +125,7 @@ cmd_tbl_t __u_boot_cmd_##name Struct_Section = {#name, maxargs, rep, cmd, usage}
 
 #endif /* CONFIG_SYS_LONGHELP */
 
-#if !defined(CONFIG_RELOC_FIXUP_WORKS)
+#if defined(CONFIG_NEEDS_MANUAL_RELOC)
 void fixup_cmdtable(cmd_tbl_t *cmdtp, int size);
 #endif
 #endif /* __COMMAND_H */
index abe47da..957ce3b 100644 (file)
@@ -137,7 +137,7 @@ void post_output_backlog ( void );
 int post_run (char *name, int flags);
 int post_info (char *name);
 int post_log (char *format, ...);
-#ifndef CONFIG_RELOC_FIXUP_WORKS
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
 void post_reloc (void);
 #endif
 unsigned long post_time_ms (unsigned long base);
index 8a9fd0d..1b7f2aa 100644 (file)
@@ -422,7 +422,7 @@ int post_log (char *format, ...)
        return 0;
 }
 
-#ifndef CONFIG_RELOC_FIXUP_WORKS
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
 void post_reloc (void)
 {
        unsigned int i;