]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - lib_blackfin/board.c
s5pc1xx: update the README file
[karo-tx-uboot.git] / lib_blackfin / board.c
index 17681f6f8ead52e9263082f40b2617de616b215d..21fff334a07aac69883aab5a7d9aff84b37afd6b 100644 (file)
@@ -14,6 +14,7 @@
 #include <stdio_dev.h>
 #include <environment.h>
 #include <malloc.h>
+#include <mmc.h>
 #include <net.h>
 #include <timestamp.h>
 #include <status_led.h>
 
 #include <asm/cplb.h>
 #include <asm/mach-common/bits/mpu.h>
+#include <kgdb.h>
 
 #ifdef CONFIG_CMD_NAND
 #include <nand.h>      /* cannot even include nand.h if it isnt configured */
 #endif
 
+#ifdef CONFIG_BITBANGMII
+#include <miiphy.h>
+#endif
+
 #if defined(CONFIG_POST)
 #include <post.h>
 int post_flag;
@@ -44,15 +50,6 @@ static inline void serial_early_puts(const char *s)
 #endif
 }
 
-static void mem_malloc_init(ulong start, ulong size)
-{
-       mem_malloc_start = start;
-       mem_malloc_end = start + size;
-       mem_malloc_brk = start;
-
-       memset((void*)mem_malloc_start, 0, size);
-}
-
 static int display_banner(void)
 {
        printf("\n\n%s\n\n", version_string);
@@ -135,17 +132,26 @@ void init_cplbtables(void)
        dcplb_add(0xFF800000, L1_DMEMORY);
        ++i;
 
-       icplb_add(CONFIG_SYS_MONITOR_BASE & CPLB_PAGE_MASK, SDRAM_IKERNEL);
-       dcplb_add(CONFIG_SYS_MONITOR_BASE & CPLB_PAGE_MASK, SDRAM_DKERNEL);
-       ++i;
+       if (CONFIG_MEM_SIZE) {
+               uint32_t mbase = CONFIG_SYS_MONITOR_BASE;
+               uint32_t mend  = mbase + CONFIG_SYS_MONITOR_LEN;
+               mbase &= CPLB_PAGE_MASK;
+               mend &= CPLB_PAGE_MASK;
 
-       /* If the monitor crosses a 4 meg boundary, we'll need
-        * to lock two entries for it.
-        */
-       if ((CONFIG_SYS_MONITOR_BASE & CPLB_PAGE_MASK) != ((CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) & CPLB_PAGE_MASK)) {
-               icplb_add((CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) & CPLB_PAGE_MASK, SDRAM_IKERNEL);
-               dcplb_add((CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) & CPLB_PAGE_MASK, SDRAM_DKERNEL);
+               icplb_add(mbase, SDRAM_IKERNEL);
+               dcplb_add(mbase, SDRAM_DKERNEL);
                ++i;
+
+               /*
+                * If the monitor crosses a 4 meg boundary, we'll need
+                * to lock two entries for it.  We assume it doesn't
+                * cross two 4 meg boundaries ...
+                */
+               if (mbase != mend) {
+                       icplb_add(mend, SDRAM_IKERNEL);
+                       dcplb_add(mend, SDRAM_DKERNEL);
+                       ++i;
+               }
        }
 
        icplb_add(0x20000000, SDRAM_INON_CHBL);
@@ -244,6 +250,8 @@ void board_init_f(ulong bootflag)
        bd->bi_vco = get_vco();
        bd->bi_cclk = get_cclk();
        bd->bi_sclk = get_sclk();
+       bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
+       bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
 
        /* Initialize */
        serial_early_puts("IRQ init\n");
@@ -267,7 +275,7 @@ void board_init_f(ulong bootflag)
        printf("System: %s MHz\n", strmhz(buf, get_sclk()));
 
        printf("RAM:   ");
-       print_size(initdram(0), "\n");
+       print_size(bd->bi_memsize, "\n");
 #if defined(CONFIG_POST)
        post_init_f();
        post_bootmode_init();
@@ -279,8 +287,10 @@ void board_init_f(ulong bootflag)
 
 static void board_net_init_r(bd_t *bd)
 {
+#ifdef CONFIG_BITBANGMII
+       bb_miiphy_init();
+#endif
 #ifdef CONFIG_CMD_NET
-       uchar enetaddr[6];
        char *s;
 
        if ((s = getenv("bootfile")) != NULL)
@@ -290,15 +300,11 @@ static void board_net_init_r(bd_t *bd)
 
        printf("Net:   ");
        eth_initialize(gd->bd);
-
-       eth_getenv_enetaddr("ethaddr", enetaddr);
-       printf("MAC:   %pM\n", enetaddr);
 #endif
 }
 
 void board_init_r(gd_t * id, ulong dest_addr)
 {
-       extern void malloc_bin_reloc(void);
        char *s;
        bd_t *bd;
        gd = id;
@@ -312,7 +318,6 @@ void board_init_r(gd_t * id, ulong dest_addr)
 
        /* initialize malloc() area */
        mem_malloc_init(CONFIG_SYS_MALLOC_BASE, CONFIG_SYS_MALLOC_LEN);
-       malloc_bin_reloc();
 
 #if    !defined(CONFIG_SYS_NO_FLASH)
        /* Initialize the flash and protect u-boot by default */
@@ -337,6 +342,11 @@ void board_init_r(gd_t * id, ulong dest_addr)
        nand_init();            /* go init the NAND */
 #endif
 
+#ifdef CONFIG_GENERIC_MMC
+       puts("MMC:  ");
+       mmc_initialize(bd);
+#endif
+
        /* relocate environment function pointers etc. */
        env_relocate();
 
@@ -347,6 +357,11 @@ void board_init_r(gd_t * id, ulong dest_addr)
        /* Initialize the console (after the relocation and devices init) */
        console_init_r();
 
+#ifdef CONFIG_CMD_KGDB
+       puts("KGDB:  ");
+       kgdb_init();
+#endif
+
 #ifdef CONFIG_STATUS_LED
        status_led_set(STATUS_LED_BOOT, STATUS_LED_BLINKING);
        status_led_set(STATUS_LED_CRASH, STATUS_LED_OFF);