]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/blackfin/lib/board.c
Update from 2013.01 to 2013.07
[karo-tx-uboot.git] / arch / blackfin / lib / board.c
index 9fbbea0d9b092cee0f6d4019418a701d5577be8d..17d1f468dd3a53b0394d4beebbe52f000f41a811 100644 (file)
 int post_flag;
 #endif
 
+#if defined(CONFIG_SYS_I2C)
+#include <i2c.h>
+#endif
+
 DECLARE_GLOBAL_DATA_PTR;
 
 __attribute__((always_inline))
@@ -63,6 +67,7 @@ static int display_banner(void)
 static int init_baudrate(void)
 {
        gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE);
+       gd->bd->bi_baudrate = gd->baudrate;
        return 0;
 }
 
@@ -77,7 +82,7 @@ static void display_global_data(void)
        bd = gd->bd;
        printf(" gd: %p\n", gd);
        printf(" |-flags: %lx\n", gd->flags);
-       printf(" |-board_type: %lx\n", gd->board_type);
+       printf(" |-board_type: %lx\n", gd->arch.board_type);
        printf(" |-baudrate: %u\n", gd->baudrate);
        printf(" |-have_console: %lx\n", gd->have_console);
        printf(" |-ram_size: %lx\n", gd->ram_size);
@@ -96,6 +101,13 @@ static void display_global_data(void)
 
 #define CPLB_PAGE_SIZE (4 * 1024 * 1024)
 #define CPLB_PAGE_MASK (~(CPLB_PAGE_SIZE - 1))
+#if defined(__ADSPBF60x__)
+#define CPLB_EX_PAGE_SIZE (16 * 1024 * 1024)
+#define CPLB_EX_PAGE_MASK (~(CPLB_EX_PAGE_SIZE - 1))
+#else
+#define CPLB_EX_PAGE_SIZE CPLB_PAGE_SIZE
+#define CPLB_EX_PAGE_MASK CPLB_PAGE_MASK
+#endif
 void init_cplbtables(void)
 {
        volatile uint32_t *ICPLB_ADDR, *ICPLB_DATA;
@@ -127,6 +139,11 @@ void init_cplbtables(void)
        icplb_add(0xFFA00000, L1_IMEMORY);
        dcplb_add(0xFF800000, L1_DMEMORY);
        ++i;
+#if defined(__ADSPBF60x__)
+       icplb_add(0x0, 0x0);
+       dcplb_add(CONFIG_SYS_FLASH_BASE, SDRAM_EBIU);
+       ++i;
+#endif
 
        if (CONFIG_MEM_SIZE) {
                uint32_t mbase = CONFIG_SYS_MONITOR_BASE;
@@ -150,9 +167,11 @@ void init_cplbtables(void)
                }
        }
 
+#ifndef __ADSPBF60x__
        icplb_add(0x20000000, SDRAM_INON_CHBL);
        dcplb_add(0x20000000, SDRAM_EBIU);
        ++i;
+#endif
 
        /* Add entries for the rest of external RAM up to the bootrom */
        extern_memory = 0;
@@ -167,10 +186,11 @@ void init_cplbtables(void)
        ++i;
 #endif
 
-       while (i < 16 && extern_memory < (CONFIG_SYS_MONITOR_BASE & CPLB_PAGE_MASK)) {
+       while (i < 16 && extern_memory <
+               (CONFIG_SYS_MONITOR_BASE & CPLB_EX_PAGE_MASK)) {
                icplb_add(extern_memory, SDRAM_IGENERIC);
                dcplb_add(extern_memory, SDRAM_DGENERIC);
-               extern_memory += CPLB_PAGE_SIZE;
+               extern_memory += CPLB_EX_PAGE_SIZE;
                ++i;
        }
        while (i < 16) {
@@ -262,9 +282,9 @@ void board_init_f(ulong bootflag)
        dcache_enable();
 #endif
 
-#ifdef CONFIG_WATCHDOG
+#ifdef CONFIG_HW_WATCHDOG
        serial_early_puts("Setting up external watchdog\n");
-       watchdog_init();
+       hw_watchdog_init();
 #endif
 
 #ifdef DEBUG
@@ -295,7 +315,13 @@ void board_init_f(ulong bootflag)
 
        printf("Clock: VCO: %s MHz, ", strmhz(buf, get_vco()));
        printf("Core: %s MHz, ", strmhz(buf, get_cclk()));
+#if defined(__ADSPBF60x__)
+       printf("System0: %s MHz, ", strmhz(buf, get_sclk0()));
+       printf("System1: %s MHz, ", strmhz(buf, get_sclk1()));
+       printf("Dclk: %s MHz\n", strmhz(buf, get_dclk()));
+#else
        printf("System: %s MHz\n", strmhz(buf, get_sclk()));
+#endif
 
        if (CONFIG_MEM_SIZE) {
                printf("RAM:   ");
@@ -364,6 +390,9 @@ void board_init_r(gd_t * id, ulong dest_addr)
        mmc_initialize(bd);
 #endif
 
+#if defined(CONFIG_SYS_I2C)
+       i2c_reloc_fixup();
+#endif
        /* relocate environment function pointers etc. */
        env_relocate();
 
@@ -411,17 +440,3 @@ void board_init_r(gd_t * id, ulong dest_addr)
        for (;;)
                main_loop();
 }
-
-void hang(void)
-{
-#ifdef CONFIG_STATUS_LED
-       status_led_set(STATUS_LED_BOOT, STATUS_LED_OFF);
-       status_led_set(STATUS_LED_CRASH, STATUS_LED_BLINKING);
-#endif
-       puts("### ERROR ### Please RESET the board ###\n");
-       while (1)
-               /* If a JTAG emulator is hooked up, we'll automatically trigger
-                * a breakpoint in it.  If one isn't, this is just a NOP.
-                */
-               asm("emuexcpt;");
-}