KB9202: Correctly define RAM, FLASH, ENV, and CFG_MALLOC variables

This patch is a forward port of the one submitted by Christian from
Kwikbyte in 06/2007
(http://lists.denx.de/pipermail/u-boot/2007-June/021950.html)

Signed-off-by: Matthias Kaehlcke <matth...@kaehlcke.net>

--

--- u-boot-2009.03.org/board/kb9202/kb9202.c    2009-03-21 22:04:41.000000000 
+0100
+++ u-boot-2009.03/board/kb9202/kb9202.c        2009-05-15 22:30:31.000000000 
+0200
@@ -31,6 +31,8 @@
 #include <at91rm9200_net.h>
 #include <lxt971a.h>
 
+extern int eth_init (bd_t * bd);
+
 DECLARE_GLOBAL_DATA_PTR;
 
 /*
@@ -64,6 +66,19 @@
        return 0;
 }
 
+int board_late_init (void)
+{
+       /* make sure MAC is set */
+#ifdef CONFIG_DRIVER_ETHER
+#ifdef CONFIG_CMD_NET
+       if (getenv ("ethaddr")) {
+               return (eth_init(gd->bd));
+       }
+#endif
+#endif
+       return 0;
+}
+
 #ifdef CONFIG_DRIVER_ETHER
 #if defined(CONFIG_CMD_NET)
 
--- u-boot-2009.03.org/include/configs/kb9202.h 2009-03-21 22:04:41.000000000 
+0100
+++ u-boot-2009.03/include/configs/kb9202.h     2009-05-15 22:30:31.000000000 
+0200
@@ -38,9 +38,10 @@
 #define CONFIG_ARM920T         1       /* This is an ARM920T Core      */
 #define CONFIG_AT91RM9200      1       /* It's an Atmel AT91RM9200 SoC */
 /* Only define one of the following, based on board type               */
-/* #define     CONFIG_KB9200           1        KwikByte KB9202 board  */
-/* #define     CONFIG_KB9201           1        KwikByte KB9202 board  */
-#define        CONFIG_KB9202           1       /* KwikByte KB9202 board        
*/
+/* #define     CONFIG_KB9200           1        KwikByte KB9200 board  */
+/* #define     CONFIG_KB9201           1        KwikByte KB9201 board  */
+/* #define     CONFIG_KB9202           1        KwikByte KB9202 board  */
+#define CONFIG_KB9202B         1       /* KwikByte KB9202B board       */
 
 #define        CONFIG_KB920x           1       /* Any KB920x board             
*/
 #undef  CONFIG_USE_IRQ                 /* we don't need IRQ/FIQ stuff  */
@@ -56,13 +57,21 @@
 
 #define        CONFIG_SYS_LONGHELP
 
+#define        BOARD_LATE_INIT
+
+#ifdef CONFIG_KB9202B
+#define        CONFIG_BOOTARGS "console=ttyS0,115200 noinitrd 
root=/dev/mtdblock0 rootfstype=jffs2 mem=64M"
+#define        CONFIG_BOOTCOMMAND      "bootm 0x10000000"
+#endif
+
+
 #ifndef roundup
 #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
 #endif
 /*
  * Size of malloc() pool
  */
-#define CONFIG_SYS_MALLOC_LEN  (roundup(CONFIG_ENV_SIZE,4096) + 128*1024)
+#define CONFIG_SYS_MALLOC_LEN  (128*1024)
 #define CONFIG_SYS_GBL_DATA_SIZE       128     /* size in bytes reserved for 
initial data */
 
 #define CONFIG_BAUDRATE 115200
@@ -80,7 +89,7 @@
 
 #undef CONFIG_MODEM_SUPPORT            /* disable modem initialization stuff */
 
-#define CONFIG_BOOTDELAY       3
+#define CONFIG_BOOTDELAY       1
 #define CONFIG_ENV_OVERWRITE   1
 
 
@@ -99,8 +108,10 @@
 #include <config_cmd_default.h>
 
 #define CONFIG_CMD_I2C
+#define CONFIG_CMD_EEPROM
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_DHCP
+#define CONFIG_CMD_JFFS2
 
 #undef CONFIG_CMD_BDI
 #undef CONFIG_CMD_FPGA
@@ -109,17 +120,21 @@
 
 #define CONFIG_NR_DRAM_BANKS 1
 #define PHYS_SDRAM 0x20000000
+#ifdef CONFIG_KB9202B
+#define        PHYS_SDRAM_SIZE 0x4000000  /* 64 megs */
+#else
 #define PHYS_SDRAM_SIZE 0x2000000  /* 32 megs */
+#endif
 
 #define CONFIG_SYS_MEMTEST_START               PHYS_SDRAM
-#define CONFIG_SYS_MEMTEST_END                 CONFIG_SYS_MEMTEST_START + 
PHYS_SDRAM_SIZE - (512*1024)
+#define CONFIG_SYS_MEMTEST_END                 CONFIG_SYS_MEMTEST_START + 
0x1000000
 
 #define CONFIG_DRIVER_ETHER
 #define CONFIG_NET_RETRY_COUNT         20
 
 #define CONFIG_SYS_FLASH_BASE                  0x10000000
 
-#ifdef CONFIG_KB9202
+#if defined(CONFIG_KB9202) || defined(CONFIG_KB9202B)
 #define PHYS_FLASH_SIZE                        0x1000000
 #else
 #define PHYS_FLASH_SIZE                        0x200000
@@ -132,9 +147,9 @@
 
 #define        CONFIG_ENV_IS_IN_EEPROM
 
-#ifdef CONFIG_KB9202
-#define CONFIG_ENV_OFFSET                      0x3E00
-#define CONFIG_ENV_SIZE                        0x0200
+#if defined(CONFIG_KB9202) || defined(CONFIG_KB9202B)
+#define CONFIG_ENV_OFFSET                      0x2000
+#define CONFIG_ENV_SIZE                        0x2000
 #else
 #define CONFIG_ENV_OFFSET                      0x1000
 #define CONFIG_ENV_SIZE                        0x1000

-- 
Matthias Kaehlcke
Embedded Linux Engineer
Barcelona

              Comunicar bichos a <bug-coreut...@gnu.org>
                     (LANG=es_ES uname --help)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to