3 * Graeme Russ, <graeme.russ@gmail.com>
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25 #include <stdio_dev.h>
31 #include <status_led.h>
32 #include <asm/processor.h>
33 #include <asm/u-boot-x86.h>
35 #include <asm/init_helpers.h>
37 DECLARE_GLOBAL_DATA_PTR;
39 /************************************************************************
41 ************************************************************************
42 * Some of this code should be moved into the core functions,
43 * or dropped completely,
44 * but let's get it working (again) first...
47 int display_banner(void)
49 printf("\n\n%s\n\n", version_string);
54 int display_dram_config(void)
58 puts("DRAM Configuration:\n");
60 for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
61 printf("Bank #%d: %08lx ", i, gd->bd->bi_dram[i].start);
62 print_size(gd->bd->bi_dram[i].size, "\n");
68 int init_baudrate_f(void)
70 gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE);
74 int calculate_relocation_address(void)
76 ulong text_start = (ulong)&__text_start;
77 ulong bss_end = (ulong)&__bss_end;
81 * NOTE: All destination address are rounded down to 16-byte
82 * boundary to satisfy various worst-case alignment
86 /* Stack is at top of available memory */
87 dest_addr = gd->ram_size;
88 gd->start_addr_sp = dest_addr;
90 /* U-Boot is below the stack */
91 dest_addr -= CONFIG_SYS_STACK_SIZE;
92 dest_addr -= (bss_end - text_start);
94 gd->relocaddr = dest_addr;
95 gd->reloc_off = (dest_addr - text_start);
100 int init_cache_f_r(void)
102 /* Initialise the CPU cache(s) */
106 int set_reloc_flag_r(void)
108 gd->flags = GD_FLG_RELOC;
113 int mem_malloc_init_r(void)
115 mem_malloc_init(((gd->relocaddr - CONFIG_SYS_MALLOC_LEN)+3)&~3,
116 CONFIG_SYS_MALLOC_LEN);
123 int init_bd_struct_r(void)
126 memset(gd->bd, 0, sizeof(bd_t));
131 #ifndef CONFIG_SYS_NO_FLASH
132 int flash_init_r(void)
138 /* configure available FLASH banks */
141 print_size(size, "\n");
147 #ifdef CONFIG_STATUS_LED
148 int status_led_set_r(void)
150 status_led_set(STATUS_LED_BOOT, STATUS_LED_BLINKING);
156 int set_load_addr_r(void)
158 /* Initialize from environment */
159 load_addr = getenv_ulong("loadaddr", 16, load_addr);