]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm, keymile: updates for the arm based boards from keymile
authorHeiko Schocher <hs@denx.de>
Tue, 8 Mar 2011 09:53:51 +0000 (10:53 +0100)
committerWolfgang Denk <wd@denx.de>
Fri, 29 Apr 2011 22:45:15 +0000 (00:45 +0200)
define KM_IVM_BUS and KM_ENV_BUS macros
 KM_IVM_BUS is used to define the EEprom_ivm environment variable.
 These macros allow the reuse of these I2C addresses in other code
 locations.

remove unneeded code
  On first HW versions the BOCO FPGA was behind a MUX device. These
  HW versions are not supported anymore. And therefore this code can
  be removed.

added LED initialization for SUEN3
  The bootstat LED required to be initialized so to have a green
  colour after start-up.

define CONFIG_SYS_TEXT_BASE
  This is needed by the relocation code and is not the same for
  our ARM BEC and thus needs to be defined.

remove memsize variable
  An environment variable for memsize is not needed.
  this can be get via the board info struct.

remove unneeded double access to bi_dram[i].size field

Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Luca Haab <luca.haab@keymile.com>
Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Prafulla Wadaskar <prafulla@marvell.com>

board/keymile/km_arm/km_arm.c
include/configs/km_arm.h
include/configs/mgcoge2un.h
include/configs/suen3.h
include/configs/suen8.h

index 0f1a6d1d7ac779ea433608e57390f4e2b98f30b5..cb999b23faef6bd79c0011cbe6f6a63a17cb8342 100644 (file)
@@ -117,6 +117,34 @@ int ethernet_present(void)
        return ret;
 }
 
+int initialize_unit_leds(void)
+{
+       /*
+        * init the unit LEDs
+        * per default they all are
+        * ok apart from bootstat
+        * LED connected through BOCO
+        * BOCO lies at the address  0x10
+        * LEDs are in the block CTRL_H (addr 0x02)
+        * BOOTSTAT LED is the first 0x01
+        */
+       #define BOCO        0x10
+       #define CTRL_H      0x02
+       #define APPLEDMASK  0x01
+       uchar buf;
+
+       if (i2c_read(BOCO, CTRL_H, 1, &buf, 1) != 0) {
+               printf("%s: Error reading Boco\n", __func__);
+               return -1;
+       }
+       buf |= APPLEDMASK;
+       if (i2c_write(BOCO, CTRL_H, 1, &buf, 1) != 0) {
+               printf("%s: Error writing Boco\n", __func__);
+               return -1;
+       }
+       return 0;
+}
+
 int misc_init_r(void)
 {
        char *str;
@@ -133,6 +161,9 @@ int misc_init_r(void)
                printf("Overwriting MACH_TYPE with %d!!!\n", mach_type);
                gd->bd->bi_arch_number = mach_type;
        }
+
+       initialize_unit_leds();
+
        return 0;
 }
 
@@ -239,7 +270,6 @@ void dram_init_banksize(void)
 
        for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
                gd->bd->bi_dram[i].start = kw_sdram_bar(i);
-               gd->bd->bi_dram[i].size = kw_sdram_bs(i);
                gd->bd->bi_dram[i].size = get_ram_size((long *)kw_sdram_bar(i),
                                                       kw_sdram_bs(i));
        }
index 5fa0153e3b08e81f7c338c35671737067cc4759d..8cb0fe834db41d238b9a49475e4ba5b056d543b9 100644 (file)
@@ -49,6 +49,7 @@
 /* include common defines/options for all Keymile boards */
 #include "keymile-common.h"
 
+#define CONFIG_SYS_TEXT_BASE   0x04000000      /* code address after reloc */
 #define CONFIG_ENV_SIZE                (128 << 10)     /* NAND chip block size */
 #define CONFIG_SYS_MEMTEST_START 0x00400000    /* 4M */
 #define CONFIG_SYS_MEMTEST_END 0x007fffff      /*(_8M -1) */
index 9f5464b13806b19d06a1d42e0be2c8ea1fc7448f..d3c7bdcddf783bca0e746f3d54550b2fbb690b06 100644 (file)
 
 #define CONFIG_HOSTNAME                        mgcoge2un
 
+#define KM_IVM_BUS     "pca9547:70:9" /* I2C2 (Mux-Port 1)*/
+#define KM_ENV_BUS     "pca9547:70:d" /* I2C2 (Mux-Port 5)*/
+
 /*
  * Default environment variables
  */
 #define CONFIG_EXTRA_ENV_SETTINGS                                      \
        CONFIG_KM_DEF_ENV                                               \
-       "memsize=0x8000000\0"                                           \
        "newenv=setenv addr 0x100000 && "                               \
                "i2c dev 1; mw.b ${addr} 0 4 && "                       \
                "eeprom write " xstr(CONFIG_SYS_DEF_EEPROM_ADDR)        \
@@ -57,7 +59,7 @@
                "eeprom write " xstr(CONFIG_SYS_DEF_EEPROM_ADDR)        \
                " ${addr} " xstr(CONFIG_ENV_OFFSET_REDUND) " 4\0"       \
        "rootpath=/opt/eldk/arm\0"                                      \
-       "EEprom_ivm=pca9547:70:9\0"                                     \
+       "EEprom_ivm=" KM_IVM_BUS "\0"                                   \
        ""
 
 #endif /* _CONFIG_MGCOGE2UN_H */
index 87f524a1b8aa6988a585ab76642784c6f2b6c41f..2b6f19ee0c9d22d894629908254c5a6a82dc4c1c 100644 (file)
 
 #define CONFIG_HOSTNAME                        suen3
 
+#define KM_IVM_BUS     "pca9544a:70:9" /* I2C2 (Mux-Port 1)*/
+#define KM_ENV_BUS     "pca9544a:70:d" /* I2C2 (Mux-Port 5)*/
+
 /*
  * Default environment variables
  */
 #define CONFIG_EXTRA_ENV_SETTINGS                                      \
        CONFIG_KM_DEF_ENV                                               \
-       "memsize=0x8000000\0"                                           \
        "newenv=setenv addr 0x100000 && "                               \
                "i2c dev 1; mw.b ${addr} 0 4 && "                       \
                "eeprom write " xstr(CONFIG_SYS_DEF_EEPROM_ADDR)        \
@@ -56,7 +58,7 @@
                "eeprom write " xstr(CONFIG_SYS_DEF_EEPROM_ADDR)        \
                " ${addr} " xstr(CONFIG_ENV_OFFSET_REDUND) " 4\0"       \
        "rootpath=/opt/eldk/arm\0"                                      \
-       "EEprom_ivm=pca9544a:70:9\0"                                    \
+       "EEprom_ivm=" KM_IVM_BUS "\0"                                   \
        ""
 
 #endif /* _CONFIG_SUEN3_H */
index cdda4af13bec0b656eea1c86822c706ab180d0fd..3f60bc33f0e5fed73c686c51b744991d33be7311 100644 (file)
 
 #define CONFIG_HOSTNAME                        suen8
 
+#define KM_IVM_BUS     "pca9544a:70:9" /* I2C2 (Mux-Port 1)*/
+#define KM_ENV_BUS     "pca9544a:70:d" /* I2C2 (Mux-Port 5)*/
+
 /*
  * Default environment variables
  */
 #define CONFIG_EXTRA_ENV_SETTINGS                                      \
        CONFIG_KM_DEF_ENV                                               \
-       "memsize=0x8000000\0"                                           \
        "newenv=setenv addr 0x100000 && "                               \
                "i2c dev 1; mw.b ${addr} 0 4 && "                       \
                "eeprom write " xstr(CONFIG_SYS_DEF_EEPROM_ADDR)        \
@@ -57,7 +59,7 @@
                "eeprom write " xstr(CONFIG_SYS_DEF_EEPROM_ADDR)        \
                " ${addr} " xstr(CONFIG_ENV_OFFSET_REDUND) " 4\0"       \
        "rootpath=/opt/eldk/arm\0"                                      \
-       "EEprom_ivm=pca9544a:70:9\0"                                    \
+       "EEprom_ivm=" KM_IVM_BUS "\0"                                   \
        ""
 
 #endif /* _CONFIG_SUEN8_H */