2 * (C) Copyright 2000-2011
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * SPDX-License-Identifier: GPL-2.0+
12 #include <stdio_dev.h>
22 #if defined(CONFIG_CMD_IDE)
25 #if defined(CONFIG_CMD_SCSI)
28 #if defined(CONFIG_CMD_KGDB)
31 #ifdef CONFIG_STATUS_LED
32 #include <status_led.h>
35 #ifdef CONFIG_GENERIC_MMC
39 #ifdef CONFIG_SYS_ALLOC_DPRAM
40 #if !defined(CONFIG_CPM2)
45 #if defined(CONFIG_BAB7xx)
49 #if defined(CONFIG_POST)
52 #if defined(CONFIG_LOGBUFFER)
55 #if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500)
56 #include <asm/cache.h>
62 #ifdef CONFIG_ADDR_MAP
70 #ifdef CONFIG_BITBANGMII
74 #ifdef CONFIG_SYS_UPDATE_FLASH_SIZE
75 extern int update_flash_size(int flash_size);
78 #if defined(CONFIG_CMD_DOC)
81 #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
87 static char *failed = "*** failed ***\n";
89 #if defined(CONFIG_OXC) || defined(CONFIG_RMU)
90 extern flash_info_t flash_info[];
93 #if defined(CONFIG_START_IDE)
94 extern int board_start_ide(void);
96 #include <environment.h>
98 DECLARE_GLOBAL_DATA_PTR;
100 #if !defined(CONFIG_SYS_MEM_TOP_HIDE)
101 #define CONFIG_SYS_MEM_TOP_HIDE 0
104 extern ulong __init_end;
105 extern ulong __bss_end;
106 ulong monitor_flash_len;
108 #if defined(CONFIG_CMD_BEDBUG)
109 #include <bedbug/type.h>
117 * All attempts to come up with a "common" initialization sequence
118 * that works for all boards and architectures failed: some of the
119 * requirements are just _too_ different. To get rid of the resulting
120 * mess of board dependend #ifdef'ed code we now make the whole
121 * initialization sequence configurable to the user.
123 * The requirements for any new initalization function is simple: it
124 * receives a pointer to the "global data" structure as it's only
125 * argument, and returns an integer return code, where 0 means
126 * "continue" and != 0 means "fatal error, hang the system".
128 typedef int (init_fnc_t)(void);
133 * Some of this code should be moved into the core functions,
134 * but let's get it working (again) first...
137 static int init_baudrate(void)
139 gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE);
143 /***********************************************************************/
145 static void __board_add_ram_info(int use_default)
147 /* please define platform specific board_add_ram_info() */
150 void board_add_ram_info(int)
151 __attribute__ ((weak, alias("__board_add_ram_info")));
153 static int __board_flash_wp_on(void)
156 * Most flashes can't be detected when write protection is enabled,
157 * so provide a way to let U-Boot gracefully ignore write protected
163 int board_flash_wp_on(void)
164 __attribute__ ((weak, alias("__board_flash_wp_on")));
166 static void __cpu_secondary_init_r(void)
170 void cpu_secondary_init_r(void)
171 __attribute__ ((weak, alias("__cpu_secondary_init_r")));
173 static int init_func_ram(void)
175 #ifdef CONFIG_BOARD_TYPES
176 int board_type = gd->board_type;
178 int board_type = 0; /* use dummy arg */
182 gd->ram_size = initdram(board_type);
184 if (gd->ram_size > 0) {
185 print_size(gd->ram_size, "");
186 board_add_ram_info(0);
194 /***********************************************************************/
196 #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
197 static int init_func_i2c(void)
200 #ifdef CONFIG_SYS_I2C
203 i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
210 #if defined(CONFIG_HARD_SPI)
211 static int init_func_spi(void)
220 /***********************************************************************/
222 #if defined(CONFIG_WATCHDOG)
223 int init_func_watchdog_init(void)
225 #if defined(CONFIG_MPC85xx)
226 init_85xx_watchdog();
228 puts(" Watchdog enabled\n");
233 int init_func_watchdog_reset(void)
238 #endif /* CONFIG_WATCHDOG */
241 * Initialization sequence
244 static init_fnc_t *init_sequence[] = {
245 #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
248 #if defined(CONFIG_BOARD_EARLY_INIT_F)
251 #if !defined(CONFIG_8xx_CPUCLK_DEFAULT)
252 get_clocks, /* get CPU and bus clocks (etc.) */
253 #if defined(CONFIG_TQM8xxL) && !defined(CONFIG_TQM866M) \
254 && !defined(CONFIG_TQM885D)
255 adjust_sdram_tbs_8xx,
259 #ifdef CONFIG_SYS_ALLOC_DPRAM
260 #if !defined(CONFIG_CPM2)
264 #if defined(CONFIG_BOARD_POSTCLK_INIT)
268 #if defined(CONFIG_8xx_CPUCLK_DEFAULT)
269 /* get CPU and bus clocks according to the environment variable */
271 /* adjust sdram refresh rate according to the new clock */
279 #if defined(CONFIG_MPC8260)
282 #endif /* CONFIG_MPC8260 */
283 #if defined(CONFIG_MPC83xx)
287 #if defined(CONFIG_MPC5xxx)
289 #endif /* CONFIG_MPC5xxx */
291 INIT_FUNC_WATCHDOG_INIT
292 #if defined(CONFIG_MISC_INIT_F)
295 INIT_FUNC_WATCHDOG_RESET
296 #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
299 #if defined(CONFIG_HARD_SPI)
305 INIT_FUNC_WATCHDOG_RESET
307 #if defined(CONFIG_SYS_DRAM_TEST)
309 #endif /* CONFIG_SYS_DRAM_TEST */
310 INIT_FUNC_WATCHDOG_RESET
311 NULL, /* Terminate this list */
314 static int __fixup_cpu(void)
319 int fixup_cpu(void) __attribute__((weak, alias("__fixup_cpu")));
322 * This is the first part of the initialization sequence that is
323 * implemented in C, but still running from ROM.
325 * The main purpose is to provide a (serial) console interface as
326 * soon as possible (so we can see any error messages), and to
327 * initialize the RAM so that we can relocate the monitor code to
330 * Be aware of the restrictions: global data is read-only, BSS is not
331 * initialized, and stack space is limited to a few kB.
334 void board_init_f(ulong bootflag)
337 ulong len, addr, addr_sp;
340 init_fnc_t **init_fnc_ptr;
346 /* Pointer is writable since we allocated a register for it */
347 gd = (gd_t *) (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
348 /* compiler optimization barrier needed for GCC >= 3.4 */
349 __asm__ __volatile__("":::"memory");
351 #if !defined(CONFIG_CPM2) && !defined(CONFIG_MPC512X) && \
352 !defined(CONFIG_MPC83xx) && !defined(CONFIG_MPC85xx) && \
353 !defined(CONFIG_MPC86xx)
354 /* Clear initial global data */
355 memset((void *) gd, 0, sizeof(gd_t));
358 gd->flags = bootflag;
360 for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr)
361 if ((*init_fnc_ptr) () != 0)
365 post_bootmode_init();
366 post_run(NULL, POST_ROM | post_bootmode_get(NULL));
372 * Now that we have DRAM mapped and working, we can
373 * relocate the code and continue running from DRAM.
375 * Reserve memory at end of RAM for (top down in that order):
376 * - area that won't get touched by U-Boot and Linux (optional)
377 * - kernel log buffer
381 * - board info struct
383 len = (ulong)&__bss_end - CONFIG_SYS_MONITOR_BASE;
386 * Subtract specified amount of memory to hide so that it won't
387 * get "touched" at all by U-Boot. By fixing up gd->ram_size
388 * the Linux kernel should now get passed the now "corrected"
389 * memory size and won't touch it either. This should work
390 * for arch/ppc and arch/powerpc. Only Linux board ports in
391 * arch/powerpc with bootwrapper support, that recalculate the
392 * memory size from the SDRAM controller setup will have to
395 gd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE;
397 addr = CONFIG_SYS_SDRAM_BASE + get_effective_memsize();
399 #if defined(CONFIG_MP) && (defined(CONFIG_MPC86xx) || defined(CONFIG_E500))
401 * We need to make sure the location we intend to put secondary core
402 * boot code is reserved and not used by any part of u-boot
404 if (addr > determine_mp_bootpg(NULL)) {
405 addr = determine_mp_bootpg(NULL);
406 debug("Reserving MP boot page to %08lx\n", addr);
410 #ifdef CONFIG_LOGBUFFER
411 #ifndef CONFIG_ALT_LB_ADDR
412 /* reserve kernel log buffer */
413 addr -= (LOGBUFF_RESERVE);
414 debug("Reserving %dk for kernel logbuffer at %08lx\n", LOGBUFF_LEN,
421 * reserve protected RAM
423 reg = getenv_ulong("pram", 10, CONFIG_PRAM);
424 addr -= (reg << 10); /* size is in kB */
425 debug("Reserving %ldk for protected RAM at %08lx\n", reg, addr);
426 #endif /* CONFIG_PRAM */
428 /* round down to next 4 kB limit */
430 debug("Top of RAM usable for U-Boot at: %08lx\n", addr);
433 #ifdef CONFIG_FB_ADDR
434 gd->fb_base = CONFIG_FB_ADDR;
436 /* reserve memory for LCD display (always full pages) */
437 addr = lcd_setmem(addr);
439 #endif /* CONFIG_FB_ADDR */
440 #endif /* CONFIG_LCD */
442 #if defined(CONFIG_VIDEO) && defined(CONFIG_8xx)
443 /* reserve memory for video display (always full pages) */
444 addr = video_setmem(addr);
446 #endif /* CONFIG_VIDEO */
449 * reserve memory for U-Boot code, data & bss
450 * round down to next 4 kB limit
455 /* round down to next 64 kB limit so that IVPR stays aligned */
456 addr &= ~(65536 - 1);
459 debug("Reserving %ldk for U-Boot at: %08lx\n", len >> 10, addr);
462 * reserve memory for malloc() arena
464 addr_sp = addr - TOTAL_MALLOC_LEN;
465 debug("Reserving %dk for malloc() at: %08lx\n",
466 TOTAL_MALLOC_LEN >> 10, addr_sp);
469 * (permanently) allocate a Board Info struct
470 * and a permanent copy of the "global" data
472 addr_sp -= sizeof(bd_t);
473 bd = (bd_t *) addr_sp;
474 memset(bd, 0, sizeof(bd_t));
476 debug("Reserving %zu Bytes for Board Info at: %08lx\n",
477 sizeof(bd_t), addr_sp);
478 addr_sp -= sizeof(gd_t);
479 id = (gd_t *) addr_sp;
480 debug("Reserving %zu Bytes for Global Data at: %08lx\n",
481 sizeof(gd_t), addr_sp);
484 * Finally, we set up a new (bigger) stack.
486 * Leave some safety gap for SP, force alignment on 16 byte boundary
487 * Clear initial stack frame
491 s = (ulong *) addr_sp;
492 *s = 0; /* Terminate back chain */
493 *++s = 0; /* NULL return address */
494 debug("Stack Pointer at: %08lx\n", addr_sp);
497 * Save local variables to board info struct
500 bd->bi_memstart = CONFIG_SYS_SDRAM_BASE; /* start of memory */
501 bd->bi_memsize = gd->ram_size; /* size in bytes */
503 #ifdef CONFIG_SYS_SRAM_BASE
504 bd->bi_sramstart = CONFIG_SYS_SRAM_BASE; /* start of SRAM */
505 bd->bi_sramsize = CONFIG_SYS_SRAM_SIZE; /* size of SRAM */
508 #if defined(CONFIG_8xx) || defined(CONFIG_MPC8260) || defined(CONFIG_5xx) || \
509 defined(CONFIG_E500) || defined(CONFIG_MPC86xx)
510 bd->bi_immr_base = CONFIG_SYS_IMMR; /* base of IMMR register */
512 #if defined(CONFIG_MPC5xxx)
513 bd->bi_mbar_base = CONFIG_SYS_MBAR; /* base of internal registers */
515 #if defined(CONFIG_MPC83xx)
516 bd->bi_immrbar = CONFIG_SYS_IMMR;
520 bd->bi_intfreq = gd->cpu_clk; /* Internal Freq, in Hz */
521 bd->bi_busfreq = gd->bus_clk; /* Bus Freq, in Hz */
522 #if defined(CONFIG_CPM2)
523 bd->bi_cpmfreq = gd->arch.cpm_clk;
524 bd->bi_brgfreq = gd->arch.brg_clk;
525 bd->bi_sccfreq = gd->arch.scc_clk;
526 bd->bi_vco = gd->arch.vco_out;
527 #endif /* CONFIG_CPM2 */
528 #if defined(CONFIG_MPC512X)
529 bd->bi_ipsfreq = gd->arch.ips_clk;
530 #endif /* CONFIG_MPC512X */
531 #if defined(CONFIG_MPC5xxx)
532 bd->bi_ipbfreq = gd->arch.ipb_clk;
533 bd->bi_pcifreq = gd->pci_clk;
534 #endif /* CONFIG_MPC5xxx */
536 #ifdef CONFIG_SYS_EXTBDINFO
537 strncpy((char *) bd->bi_s_version, "1.2", sizeof(bd->bi_s_version));
538 strncpy((char *) bd->bi_r_version, U_BOOT_VERSION,
539 sizeof(bd->bi_r_version));
541 bd->bi_procfreq = gd->cpu_clk; /* Processor Speed, In Hz */
542 bd->bi_plb_busfreq = gd->bus_clk;
543 #if defined(CONFIG_405GP) || defined(CONFIG_405EP) || \
544 defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
545 defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
546 bd->bi_pci_busfreq = get_PCI_freq();
547 bd->bi_opbfreq = get_OPB_freq();
548 #elif defined(CONFIG_XILINX_405)
549 bd->bi_pci_busfreq = get_PCI_freq();
553 debug("New Stack Pointer is: %08lx\n", addr_sp);
557 gd->relocaddr = addr; /* Store relocation addr, useful for debug */
559 memcpy(id, (void *) gd, sizeof(gd_t));
561 relocate_code(addr_sp, id, addr);
563 /* NOTREACHED - relocate_code() does not return */
567 * This is the next part if the initialization sequence: we are now
568 * running from RAM and have a "normal" C environment, i. e. global
569 * data can be written, BSS has been cleared, the stack size in not
570 * that critical any more, etc.
572 void board_init_r(gd_t *id, ulong dest_addr)
577 #ifndef CONFIG_SYS_NO_FLASH
581 gd = id; /* initialize RAM version of global data */
584 gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */
586 /* The Malloc area is immediately below the monitor copy in DRAM */
587 malloc_start = dest_addr - TOTAL_MALLOC_LEN;
589 #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
591 * The gd->arch.cpu pointer is set to an address in flash before
592 * relocation. We need to update it to point to the same CPU entry
595 gd->arch.cpu += dest_addr - CONFIG_SYS_MONITOR_BASE;
598 * If we didn't know the cpu mask & # cores, we can save them of
599 * now rather than 'computing' them constantly
604 #ifdef CONFIG_SYS_EXTRA_ENV_RELOC
606 * Some systems need to relocate the env_addr pointer early because the
607 * location it points to will get invalidated before env_relocate is
608 * called. One example is on systems that might use a L2 or L3 cache
609 * in SRAM mode and initialize that cache from SRAM mode back to being
610 * a cache in cpu_init_r.
612 gd->env_addr += dest_addr - CONFIG_SYS_MONITOR_BASE;
617 debug("Now running in RAM - U-Boot at: %08lx\n", dest_addr);
622 * Setup trap handlers
624 trap_init(dest_addr);
626 #ifdef CONFIG_ADDR_MAP
630 #if defined(CONFIG_BOARD_EARLY_INIT_R)
631 board_early_init_r();
634 monitor_flash_len = (ulong)&__init_end - dest_addr;
638 #ifdef CONFIG_LOGBUFFER
642 post_output_backlog();
647 #if defined(CONFIG_SYS_DELAYED_ICACHE)
648 icache_enable(); /* it's time to enable the instruction cache */
651 #if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500)
652 unlock_ram_in_cache(); /* it's time to unlock D-cache in e500 */
655 #if defined(CONFIG_PCI) && defined(CONFIG_SYS_EARLY_PCI_INIT)
657 * Do early PCI configuration _before_ the flash gets initialised,
658 * because PCU ressources are crucial for flash access on some boards.
662 #if defined(CONFIG_WINBOND_83C553)
664 * Initialise the ISA bridge
666 initialise_w83c553f();
671 mem_malloc_init(malloc_start, TOTAL_MALLOC_LEN);
673 #if !defined(CONFIG_SYS_NO_FLASH)
676 if (board_flash_wp_on()) {
677 printf("Uninitialized - Write Protect On\n");
678 /* Since WP is on, we can't find real size. Set to 0 */
680 } else if ((flash_size = flash_init()) > 0) {
681 #ifdef CONFIG_SYS_FLASH_CHECKSUM
682 print_size(flash_size, "");
684 * Compute and print flash CRC if flashchecksum is set to 'y'
686 * NOTE: Maybe we should add some WATCHDOG_RESET()? XXX
688 if (getenv_yesno("flashchecksum") == 1) {
691 (const unsigned char *)
692 CONFIG_SYS_FLASH_BASE, flash_size)
696 #else /* !CONFIG_SYS_FLASH_CHECKSUM */
697 print_size(flash_size, "\n");
698 #endif /* CONFIG_SYS_FLASH_CHECKSUM */
704 /* update start of FLASH memory */
705 bd->bi_flashstart = CONFIG_SYS_FLASH_BASE;
706 /* size of FLASH memory (final value) */
707 bd->bi_flashsize = flash_size;
709 #if defined(CONFIG_SYS_UPDATE_FLASH_SIZE)
710 /* Make a update of the Memctrl. */
711 update_flash_size(flash_size);
715 #if defined(CONFIG_OXC) || defined(CONFIG_RMU)
716 /* flash mapped at end of memory map */
717 bd->bi_flashoffset = CONFIG_SYS_TEXT_BASE + flash_size;
718 #elif CONFIG_SYS_MONITOR_BASE == CONFIG_SYS_FLASH_BASE
719 bd->bi_flashoffset = monitor_flash_len; /* reserved area for monitor */
721 #endif /* !CONFIG_SYS_NO_FLASH */
725 /* initialize higher level parts of CPU like time base and timers */
731 #if !defined(CONFIG_ENV_IS_IN_EEPROM)
737 #if defined(CONFIG_CMD_NAND)
740 nand_init(); /* go init the NAND */
743 #ifdef CONFIG_GENERIC_MMC
745 * MMC initialization is called before relocating env.
746 * Thus It is required that operations like pin multiplexer
747 * be put in board_init.
754 /* relocate environment function pointers etc. */
758 * after non-volatile devices & environment is setup and cpu code have
759 * another round to deal with any initialization that might require
760 * full access to the environment or loading of some image (firmware)
761 * from a non-volatile device
763 cpu_secondary_init_r();
766 * Fill in missing fields of bd_info.
767 * We do this here, where we have "normal" access to the
768 * environment; we used to do this still running from ROM,
769 * where had to use getenv_f(), which can be pretty slow when
770 * the environment is in EEPROM.
773 #if defined(CONFIG_SYS_EXTBDINFO)
774 #if defined(CONFIG_405GP) || defined(CONFIG_405EP)
775 #if defined(CONFIG_I2CFAST)
777 * set bi_iic_fast for linux taking environment variable
778 * "i2cfast" into account
781 if (getenv_yesno("i2cfast") == 1) {
782 bd->bi_iic_fast[0] = 1;
783 bd->bi_iic_fast[1] = 1;
786 #endif /* CONFIG_I2CFAST */
787 #endif /* CONFIG_405GP, CONFIG_405EP */
788 #endif /* CONFIG_SYS_EXTBDINFO */
790 #if defined(CONFIG_ID_EEPROM) || defined(CONFIG_SYS_I2C_MAC_OFFSET)
791 mac_read_from_eeprom();
794 #ifdef CONFIG_CMD_NET
795 /* kept around for legacy kernels only ... ignore the next section */
796 eth_getenv_enetaddr("ethaddr", bd->bi_enetaddr);
797 #ifdef CONFIG_HAS_ETH1
798 eth_getenv_enetaddr("eth1addr", bd->bi_enet1addr);
800 #ifdef CONFIG_HAS_ETH2
801 eth_getenv_enetaddr("eth2addr", bd->bi_enet2addr);
803 #ifdef CONFIG_HAS_ETH3
804 eth_getenv_enetaddr("eth3addr", bd->bi_enet3addr);
806 #ifdef CONFIG_HAS_ETH4
807 eth_getenv_enetaddr("eth4addr", bd->bi_enet4addr);
809 #ifdef CONFIG_HAS_ETH5
810 eth_getenv_enetaddr("eth5addr", bd->bi_enet5addr);
812 #endif /* CONFIG_CMD_NET */
816 #if defined(CONFIG_PCI) && !defined(CONFIG_SYS_EARLY_PCI_INIT)
818 * Do pci configuration
823 /** leave this here (after malloc(), environment and PCI are working) **/
824 /* Initialize stdio devices */
827 /* Initialize the jump table for applications */
830 #if defined(CONFIG_API)
835 /* Initialize the console (after the relocation and devices init) */
838 #if defined(CONFIG_MISC_INIT_R)
839 /* miscellaneous platform dependent initialisations */
843 #if defined(CONFIG_CMD_KGDB)
849 debug("U-Boot relocated to %08lx\n", dest_addr);
856 #if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
857 status_led_set(STATUS_LED_BOOT, STATUS_LED_BLINKING);
862 /* Initialize from environment */
863 load_addr = getenv_ulong("loadaddr", 16, load_addr);
867 #if defined(CONFIG_CMD_SCSI)
873 #if defined(CONFIG_CMD_DOC)
879 #ifdef CONFIG_BITBANGMII
882 #if defined(CONFIG_CMD_NET)
888 #if defined(CONFIG_CMD_NET) && defined(CONFIG_RESET_PHY_R)
890 debug("Reset Ethernet PHY\n");
895 post_run(NULL, POST_RAM | post_bootmode_get(0));
898 #if defined(CONFIG_CMD_PCMCIA) \
899 && !defined(CONFIG_CMD_IDE)
905 #if defined(CONFIG_CMD_IDE)
907 #ifdef CONFIG_IDE_8xx_PCCARD
912 #if defined(CONFIG_START_IDE)
913 if (board_start_ide())
920 #ifdef CONFIG_LAST_STAGE_INIT
923 * Some parts can be only initialized if all others (like
924 * Interrupts) are up and running (i.e. the PC-style ISA
930 #if defined(CONFIG_CMD_BEDBUG)
935 #if defined(CONFIG_PRAM) || defined(CONFIG_LOGBUFFER)
937 * Export available size of memory for Linux,
938 * taking into account the protected RAM at top of memory
945 pram = getenv_ulong("pram", 10, CONFIG_PRAM);
947 #ifdef CONFIG_LOGBUFFER
948 #ifndef CONFIG_ALT_LB_ADDR
949 /* Also take the logbuffer into account (pram is in kB) */
950 pram += (LOGBUFF_LEN + LOGBUFF_OVERHEAD) / 1024;
953 sprintf(memsz, "%ldk", (ulong) (bd->bi_memsize / 1024) - pram);
954 setenv("mem", memsz);
963 /* Initialization complete - start the monitor */
965 /* main_loop() can return to retry autoboot, if so just run it again. */
971 /* NOTREACHED - no way out of command loop except booting */
974 #if 0 /* We could use plain global data, but the resulting code is bigger */
976 * Pointer to initial global data area
978 * Here we initialize it.
980 #undef XTRN_DECLARE_GLOBAL_DATA_PTR
981 #define XTRN_DECLARE_GLOBAL_DATA_PTR /* empty = allocate here */
982 DECLARE_GLOBAL_DATA_PTR =
983 (gd_t *) (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
986 /************************************************************************/