]> git.sur5r.net Git - u-boot/blobdiff - lib_ppc/board.c
MPC8610HPCD: Report board id, board version and fpga version.
[u-boot] / lib_ppc / board.c
index 7ebf74abfe113e363a3ccf438345cd362e759511..c42e08862fc87321c86261fcf8fb14f5d7f86b1b 100644 (file)
@@ -93,9 +93,7 @@ void doc_init (void);
 #if defined(CONFIG_HARD_SPI)
 #include <spi.h>
 #endif
-#if defined(CONFIG_CMD_NAND)
-void nand_init (void);
-#endif
+#include <nand.h>
 
 static char *failed = "*** failed ***\n";
 
@@ -120,7 +118,10 @@ DECLARE_GLOBAL_DATA_PTR;
 #define        TOTAL_MALLOC_LEN        CFG_MALLOC_LEN
 #endif
 
-extern ulong _start;
+#if !defined(CFG_MEM_TOP_HIDE)
+#define CFG_MEM_TOP_HIDE       0
+#endif
+
 extern ulong __init_end;
 extern ulong _end;
 ulong monitor_flash_len;
@@ -395,6 +396,13 @@ ulong get_effective_memsize(void)
  ************************************************************************
  */
 
+#ifdef CONFIG_LOGBUFFER
+unsigned long logbuffer_base(void)
+{
+       return CFG_SDRAM_BASE + get_effective_memsize() - LOGBUFF_LEN;
+}
+#endif
+
 void board_init_f (ulong bootflag)
 {
        bd_t *bd;
@@ -413,7 +421,8 @@ void board_init_f (ulong bootflag)
        /* compiler optimization barrier needed for GCC >= 3.4 */
        __asm__ __volatile__("": : :"memory");
 
-#if !defined(CONFIG_CPM2) && !defined(CONFIG_MPC83XX)
+#if !defined(CONFIG_CPM2) && !defined(CONFIG_MPC83XX) && \
+    !defined(CONFIG_MPC85xx) && !defined(CONFIG_MPC86xx)
        /* Clear initial global data */
        memset ((void *) gd, 0, sizeof (gd_t));
 #endif
@@ -429,26 +438,28 @@ void board_init_f (ulong bootflag)
         * relocate the code and continue running from DRAM.
         *
         * Reserve memory at end of RAM for (top down in that order):
+        *  - area that won't get touched by U-Boot and Linux (optional)
         *  - kernel log buffer
         *  - protected RAM
         *  - LCD framebuffer
         *  - monitor code
         *  - board info struct
         */
-       len = (ulong)&_end - (ulong)&_start + EXC_OFF_SYS_RESET;
+       len = (ulong)&_end - CFG_MONITOR_BASE;
 
-#ifndef CONFIG_MAX_MEM_MAPPED
-#define CONFIG_MAX_MEM_MAPPED (256 << 20)
-#endif
+       /*
+        * Subtract specified amount of memory to hide so that it won't
+        * get "touched" at all by U-Boot. By fixing up gd->ram_size
+        * the Linux kernel should now get passed the now "corrected"
+        * memory size and won't touch it either. This should work
+        * for arch/ppc and arch/powerpc. Only Linux board ports in
+        * arch/powerpc with bootwrapper support, that recalculate the
+        * memory size from the SDRAM controller setup will have to
+        * get fixed.
+        */
+       gd->ram_size -= CFG_MEM_TOP_HIDE;
 
-#ifndef        CONFIG_VERY_BIG_RAM
        addr = CFG_SDRAM_BASE + get_effective_memsize();
-#else
-       /* only allow stack below 256M */
-       addr = CFG_SDRAM_BASE +
-               (gd->ram_size > CONFIG_MAX_MEM_MAPPED) ?
-               CONFIG_MAX_MEM_MAPPED : get_effective_memsize();
-#endif
 
 #ifdef CONFIG_LOGBUFFER
 #ifndef CONFIG_ALT_LB_ADDR