]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/arm/lib/board.c
net: Remove the bd* parameter from net stack functions
[karo-tx-uboot.git] / arch / arm / lib / board.c
index b770e25d87bafa78a533fe851aaec993ff973c43..9372bc97d192f4ec966187967e70d311acbf347d 100644 (file)
@@ -33,6 +33,8 @@
 #include <nand.h>
 #include <onenand_uboot.h>
 #include <mmc.h>
+#include <scsi.h>
+#include <status_led.h>
 #include <libfdt.h>
 #include <fdtdec.h>
 #include <post.h>
@@ -62,25 +64,15 @@ extern void dataflash_print_info(void);
  ************************************************************************
  * May be supplied by boards if desired
  */
-inline void __coloured_LED_init(void) {}
-void coloured_LED_init(void)
-       __attribute__((weak, alias("__coloured_LED_init")));
-inline void __red_led_on(void) {}
-void red_led_on(void) __attribute__((weak, alias("__red_led_on")));
-inline void __red_led_off(void) {}
-void red_led_off(void) __attribute__((weak, alias("__red_led_off")));
-inline void __green_led_on(void) {}
-void green_led_on(void) __attribute__((weak, alias("__green_led_on")));
-inline void __green_led_off(void) {}
-void green_led_off(void) __attribute__((weak, alias("__green_led_off")));
-inline void __yellow_led_on(void) {}
-void yellow_led_on(void) __attribute__((weak, alias("__yellow_led_on")));
-inline void __yellow_led_off(void) {}
-void yellow_led_off(void) __attribute__((weak, alias("__yellow_led_off")));
-inline void __blue_led_on(void) {}
-void blue_led_on(void) __attribute__((weak, alias("__blue_led_on")));
-inline void __blue_led_off(void) {}
-void blue_led_off(void) __attribute__((weak, alias("__blue_led_off")));
+__weak void coloured_LED_init(void) {}
+__weak void red_led_on(void) {}
+__weak void red_led_off(void) {}
+__weak void green_led_on(void) {}
+__weak void green_led_off(void) {}
+__weak void yellow_led_on(void) {}
+__weak void yellow_led_off(void) {}
+__weak void blue_led_on(void) {}
+__weak void blue_led_off(void) {}
 
 /*
  ************************************************************************
@@ -105,8 +97,8 @@ static int display_banner(void)
 {
        printf("\n\n%s\n\n", version_string);
        debug("U-Boot code: %08lX -> %08lX  BSS: -> %08lX\n",
-              _TEXT_BASE,
-              _bss_start_ofs + _TEXT_BASE, _bss_end_ofs + _TEXT_BASE);
+              (ulong)&_start,
+              (ulong)&__bss_start, (ulong)&__bss_end);
 #ifdef CONFIG_MODEM_SUPPORT
        debug("Modem Support enabled\n");
 #endif
@@ -197,29 +189,21 @@ static int arm_pci_init(void)
  */
 typedef int (init_fnc_t) (void);
 
-int print_cpuinfo(void);
-
-void __dram_init_banksize(void)
+__weak void dram_init_banksize(void)
 {
        gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
        gd->bd->bi_dram[0].size =  gd->ram_size;
 }
-void dram_init_banksize(void)
-       __attribute__((weak, alias("__dram_init_banksize")));
 
-int __arch_cpu_init(void)
+__weak int arch_cpu_init(void)
 {
        return 0;
 }
-int arch_cpu_init(void)
-       __attribute__((weak, alias("__arch_cpu_init")));
 
-int __power_init_board(void)
+__weak int power_init_board(void)
 {
        return 0;
 }
-int power_init_board(void)
-       __attribute__((weak, alias("__power_init_board")));
 
        /* Record the board_init_f() bootstage (after arch_cpu_init()) */
 static int mark_bootstage(void)
@@ -250,9 +234,7 @@ init_fnc_t *init_sequence[] = {
        serial_init,            /* serial communications setup */
        console_init_f,         /* stage 1 init of console */
        display_banner,         /* say that we are here */
-#if defined(CONFIG_DISPLAY_CPUINFO)
        print_cpuinfo,          /* display cpu info (and speed) */
-#endif
 #if defined(CONFIG_DISPLAY_BOARDINFO)
        checkboard,             /* display board info */
 #endif
@@ -277,13 +259,13 @@ void board_init_f(ulong bootflag)
 
        memset((void *)gd, 0, sizeof(gd_t));
 
-       gd->mon_len = _bss_end_ofs;
+       gd->mon_len = (ulong)&__bss_end - (ulong)_start;
 #ifdef CONFIG_OF_EMBED
        /* Get a pointer to the FDT */
-       gd->fdt_blob = _binary_dt_dtb_start;
+       gd->fdt_blob = __dtb_dt_begin;
 #elif defined CONFIG_OF_SEPARATE
        /* FDT is at end of image */
-       gd->fdt_blob = (void *)(_end_ofs + _TEXT_BASE);
+       gd->fdt_blob = &_end;
 #endif
        /* Allow the early environment to override the fdt address */
        gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16,
@@ -322,7 +304,7 @@ void board_init_f(ulong bootflag)
        gd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE;
 #endif
 
-       addr = CONFIG_SYS_SDRAM_BASE + gd->ram_size;
+       addr = CONFIG_SYS_SDRAM_BASE + get_effective_memsize();
 
 #ifdef CONFIG_LOGBUFFER
 #ifndef CONFIG_ALT_LB_ADDR
@@ -448,14 +430,13 @@ void board_init_f(ulong bootflag)
        post_run(NULL, POST_ROM | post_bootmode_get(0));
 #endif
 
-       gd->bd->bi_baudrate = gd->baudrate;
        /* Ram ist board specific, so move it to board code ... */
        dram_init_banksize();
        display_dram_config();  /* and display it */
 
        gd->relocaddr = addr;
        gd->start_addr_sp = addr_sp;
-       gd->reloc_off = addr - _TEXT_BASE;
+       gd->reloc_off = addr - (ulong)&_start;
        debug("relocation Offset is: %08lx\n", gd->reloc_off);
        if (new_fdt) {
                memcpy(new_fdt, gd->fdt_blob, fdt_size);
@@ -520,7 +501,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
        gd->flags |= GD_FLG_RELOC;      /* tell others: relocation done */
        bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_R, "board_init_r");
 
-       monitor_flash_len = _end_ofs;
+       monitor_flash_len = (ulong)&__rel_dyn_end - (ulong)_start;
 
        /* Enable caches */
        enable_caches();
@@ -528,7 +509,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
        debug("monitor flash len: %08lX\n", monitor_flash_len);
        board_init();   /* Setup chipselects */
        /*
-        * TODO: printing of the clock inforamtion of the board is now
+        * TODO: printing of the clock information of the board is now
         * implemented as part of bdinfo command. Currently only support for
         * davinci SOC's is added. Remove this check once all the board
         * implement this.
@@ -597,6 +578,11 @@ void board_init_r(gd_t *id, ulong dest_addr)
        mmc_initialize(gd->bd);
 #endif
 
+#ifdef CONFIG_CMD_SCSI
+       puts("SCSI:  ");
+       scsi_init();
+#endif
+
 #ifdef CONFIG_HAS_DATAFLASH
        AT91F_DataflashInit();
        dataflash_print_info();
@@ -658,7 +644,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
 #endif
 #if defined(CONFIG_CMD_NET)
        puts("Net:   ");
-       eth_initialize(gd->bd);
+       eth_initialize();
 #if defined(CONFIG_RESET_PHY_R)
        debug("Reset Ethernet PHY\n");
        reset_phy();