global: Move remaining CONFIG_SYS_* to CFG_SYS_*
[platform/kernel/u-boot.git] / common / board_r.c
index ed29069..347bb7f 100644 (file)
 #include <api.h>
 #include <bootstage.h>
 #include <cpu_func.h>
+#include <cyclic.h>
+#include <display_options.h>
 #include <exports.h>
+#ifdef CONFIG_MTD_NOR_FLASH
 #include <flash.h>
+#endif
 #include <hang.h>
 #include <image.h>
 #include <irq_func.h>
@@ -147,13 +151,13 @@ static int initr_reloc_global_data(void)
         */
        gd->env_addr += gd->reloc_off;
 #endif
-#ifdef CONFIG_OF_EMBED
        /*
         * The fdt_blob needs to be moved to new relocation address
         * incase of FDT blob is embedded with in image
         */
-       gd->fdt_blob += gd->reloc_off;
-#endif
+       if (CONFIG_IS_ENABLED(OF_EMBED) && CONFIG_IS_ENABLED(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).
@@ -230,6 +234,8 @@ static int initr_dm(void)
 {
        int ret;
 
+       oftree_reset();
+
        /* Save the pre-reloc driver model and start a new one */
        gd->dm_root_f = gd->dm_root;
        gd->dm_root = NULL;
@@ -337,10 +343,10 @@ static int initr_flash(void)
        /*
         * Compute and print flash CRC if flashchecksum is set to 'y'
         *
-        * NOTE: Maybe we should add some WATCHDOG_RESET()? XXX
+        * NOTE: Maybe we should add some schedule()? XXX
         */
        if (env_get_yesno("flashchecksum") == 1) {
-               const uchar *flash_base = (const uchar *)CONFIG_SYS_FLASH_BASE;
+               const uchar *flash_base = (const uchar *)CFG_SYS_FLASH_BASE;
 
                printf("  CRC: %08X", crc32(0,
                                            flash_base,
@@ -350,8 +356,8 @@ static int initr_flash(void)
        putc('\n');
 
        /* update start of FLASH memory    */
-#ifdef CONFIG_SYS_FLASH_BASE
-       bd->bi_flashstart = CONFIG_SYS_FLASH_BASE;
+#ifdef CFG_SYS_FLASH_BASE
+       bd->bi_flashstart = CFG_SYS_FLASH_BASE;
 #endif
        /* size of FLASH memory (final value) */
        bd->bi_flashsize = flash_size;
@@ -363,8 +369,8 @@ static int initr_flash(void)
 
 #if defined(CONFIG_OXC) || defined(CONFIG_RMU)
        /* flash mapped at end of memory map */
-       bd->bi_flashoffset = CONFIG_SYS_TEXT_BASE + flash_size;
-#elif CONFIG_SYS_MONITOR_BASE == CONFIG_SYS_FLASH_BASE
+       bd->bi_flashoffset = CONFIG_TEXT_BASE + flash_size;
+#elif CONFIG_SYS_MONITOR_BASE == CFG_SYS_FLASH_BASE
        bd->bi_flashoffset = monitor_flash_len; /* reserved area for monitor */
 #endif
        return 0;
@@ -573,6 +579,9 @@ static int run_main_loop(void)
 #ifdef CONFIG_SANDBOX
        sandbox_main_loop_init();
 #endif
+
+       event_notify_null(EVT_MAIN_LOOP);
+
        /* main_loop() can return to retry autoboot, if so just run it again */
        for (;;)
                main_loop();
@@ -685,7 +694,7 @@ static init_fnc_t init_sequence_r[] = {
        /* initialize higher level parts of CPU like time base and timers */
        cpu_init_r,
 #endif
-#ifdef CONFIG_EFI_SETUP_EARLY
+#ifdef CONFIG_EFI_LOADER
        efi_init_early,
 #endif
 #ifdef CONFIG_CMD_NAND