]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
powerpc: keymile boards updates
authorHeiko Schocher <hs@denx.de>
Thu, 7 Jan 2010 07:55:50 +0000 (08:55 +0100)
committerWolfgang Denk <wd@denx.de>
Sun, 17 Jan 2010 23:43:54 +0000 (00:43 +0100)
- malloc size 4 MB for all keymile boards
- use generic FDT code for fixing up the DTS
- enable unit-led at startup for keymile boards
- remove some dts updates for keymile boards
- ppc_83xx, kmeter1: take FE/GbE PHYs out of reset
- ppc_83xx, kmeter1: change from Intel Strata to Spansion 64MB flash
  changed from Intel Strata to Spansion 64MB flash and changed flash layout.
+---------+----------+-----------------------+-----------------------------+
| name    | size     | range                 | description                 |
+---------+----------+-----------------------+-----------------------------+
| u-boot  |   768 KB | 0xf0000000-0xf00bffff | for u-boot                  |
| env     |   128 KB | 0xf00c0000-0xf00dffff | for environment             |
| envred  |   128 KB | 0xf00e0000-0xf00fffff | for environment (redundant) |
| ubi0    | 64512 KB | 0xf0100000-0xf3ffffff | ubi0 for ubi volumes        |
+---------+----------+-----------------------+-----------------------------+

Signed-off-by: Heiko Schocher <hs@denx.de>
board/keymile/km8xx/km8xx.c
board/keymile/kmeter1/kmeter1.c
board/keymile/mgcoge/mgcoge.c
include/configs/keymile-common.h
include/configs/kmeter1.h

index ec883a40447f9b55e2c25fce6c495ee087401ab0..6de2f220674c0dd75a191c4a546bf354168e389b 100644 (file)
@@ -147,7 +147,9 @@ phys_size_t initdram (int board_type)
 int board_early_init_r(void)
 {
        /* setup the UPIOx */
-       out_8((u8 *)(CONFIG_SYS_PIGGY_BASE + 0x02), 0xc0);
+       /* General Unit Reset disabled, Flash Bank enabled, UnitLed on */
+       out_8((u8 *)(CONFIG_SYS_PIGGY_BASE + 0x02), 0xc2);
+       /* SCC4 enable, halfduplex, FCC1 powerdown, ANDI enable*/
        out_8((u8 *)(CONFIG_SYS_PIGGY_BASE + 0x03), 0x35);
        return 0;
 }
@@ -160,51 +162,12 @@ int hush_init_var (void)
 
 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
 /*
- * update "memory" property in the blob
+ * update "brg" property in the blob
  */
 void ft_blob_update (void *blob, bd_t *bd)
 {
        ulong brg_data[1] = {0};
-       ulong memory_data[2] = {0};
-       ulong *flash_data = NULL;
-       ulong flash_reg[3] = {0};
-       flash_info_t    *info;
-       int     len;
-       int     i = 0;
-
-       memory_data[0] = cpu_to_be32 (bd->bi_memstart);
-       memory_data[1] = cpu_to_be32 (bd->bi_memsize);
-       fdt_set_node_and_value (blob, "/memory", "reg", memory_data,
-                               sizeof (memory_data));
-
-       len = fdt_get_node_and_value (blob, "/localbus", "ranges",
-                                       (void *)&flash_data);
-
-       if (flash_data == NULL) {
-               printf ("%s: error /localbus/ranges entry\n", __FUNCTION__);
-               return;
-       }
-
-       /* update Flash addr, size */
-       while ( i < (len / 4)) {
-               switch (flash_data[i]) {
-               case 0:
-                       info = flash_get_info(CONFIG_SYS_FLASH_BASE);
-                       flash_data[i + 1] = 0;
-                       flash_data[i + 2] = cpu_to_be32 (CONFIG_SYS_FLASH_BASE);
-                       flash_data[i + 3] = cpu_to_be32 (info->size);
-                       break;
-               default:
-                       break;
-               }
-               i += 4;
-       }
-       fdt_set_node_and_value (blob, "/localbus", "ranges", flash_data,
-                               len);
-
-       flash_reg[2] = cpu_to_be32 (bd->bi_flashsize);
-       fdt_set_node_and_value (blob, "/localbus/flash@0,0", "reg", flash_reg,
-                               sizeof (flash_reg));
+
        /* BRG */
        brg_data[0] = cpu_to_be32 (bd->bi_busfreq);
        fdt_set_node_and_value (blob, "/soc/cpm", "brg-frequency", brg_data,
index fa2f1cf431dffe664c4597f7acf7df4f1c533247..bbcaf5d3d30f1161c2fb98992872fb536b52fc20 100644 (file)
@@ -99,6 +99,10 @@ int board_early_init_r (void)
        }
        /* enable the PHY on the PIGGY */
        setbits (8, (void *)(CONFIG_SYS_PIGGY_BASE + 0x10003), 0x01);
+       /* enable the Unit LED (green) */
+       setbits (8, (void *)(CONFIG_SYS_PIGGY_BASE + 0x00002), 0x01);
+       /* take FE/GbE PHYs out of reset */
+       setbits (8, (void *)(CONFIG_SYS_PIGGY_BASE + 0x0000f), 0x1c);
 
        return 0;
 }
@@ -188,53 +192,11 @@ int checkboard (void)
 
 #if defined(CONFIG_OF_BOARD_SETUP)
 /*
- * update "/localbus/ranges" property in the blob
+ * update property in the blob
  */
 void ft_blob_update (void *blob, bd_t *bd)
 {
-       ulong   *flash_data = NULL;
-       flash_info_t    *info;
-       ulong   flash_reg[6] = {0};
-       int     len;
-       int     size = 0;
-       int     i = 0;
-
-       len = fdt_get_node_and_value (blob, "/localbus", "ranges",
-                                       (void *)&flash_data);
-
-       if (flash_data == NULL) {
-               printf ("%s: error /localbus/ranges entry\n", __FUNCTION__);
-               return;
-       }
-
-       /* update Flash addr, size */
-       while ( i < (len / 4)) {
-               switch (flash_data[i]) {
-               case 0:
-                       info = flash_get_info(CONFIG_SYS_FLASH_BASE);
-                       size = info->size;
-                       info = flash_get_info(CONFIG_SYS_FLASH_BASE_1);
-                       size += info->size;
-                       flash_data[i + 1] = 0;
-                       flash_data[i + 2] = cpu_to_be32 (CONFIG_SYS_FLASH_BASE);
-                       flash_data[i + 3] = cpu_to_be32 (size);
-                       break;
-               default:
-                       break;
-               }
-               i += 4;
-       }
-       fdt_set_node_and_value (blob, "/localbus", "ranges", flash_data,
-                               len);
-
-       info = flash_get_info(CONFIG_SYS_FLASH_BASE);
-       size = info->size;
-       flash_reg[2] = cpu_to_be32 (size);
-       flash_reg[4] = flash_reg[2];
-       info = flash_get_info(CONFIG_SYS_FLASH_BASE_1);
-       flash_reg[5] = cpu_to_be32 (info->size);
-       fdt_set_node_and_value (blob, "/localbus/flash@f0000000,0", "reg", flash_reg,
-                               sizeof (flash_reg));
+  /* no board specific update */
 }
 
 
index 932a80547f183b7145f2a075df3269db2c339004..5c9496c3ceef727739835f997cc78cf17e537f76 100644 (file)
@@ -299,7 +299,9 @@ int checkboard(void)
 int board_early_init_r (void)
 {
        /* setup the UPIOx */
-       out_8((u8 *)(CONFIG_SYS_PIGGY_BASE + 0x02), 0xc0);
+       /* General Unit Reset disabled, Flash Bank enabled, UnitLed on */
+       out_8((u8 *)(CONFIG_SYS_PIGGY_BASE + 0x02), 0xc2);
+       /* SCC4 enable, halfduplex, FCC1 powerdown */
        out_8((u8 *)(CONFIG_SYS_PIGGY_BASE + 0x03), 0x15);
        return 0;
 }
@@ -311,66 +313,8 @@ int hush_init_var (void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
-/*
- * update "flash" property in the blob
- */
-void ft_blob_update (void *blob, bd_t *bd)
-{
-       ulong *flash_data = NULL;
-       ulong   flash_reg[6] = {0};
-       flash_info_t    *info;
-       int     len;
-       int     size;
-       int     i = 0;
-
-       len = fdt_get_node_and_value (blob, "/localbus", "ranges",
-                                       (void *)&flash_data);
-
-       if (flash_data == NULL) {
-               printf ("%s: error /localbus/ranges entry\n", __FUNCTION__);
-               return;
-       }
-
-       /* update Flash addr, size */
-       while ( i < (len / 4)) {
-               switch (flash_data[i]) {
-               case 0:
-                       info = flash_get_info(CONFIG_SYS_FLASH_BASE);
-                       flash_data[i + 1] = 0;
-                       flash_data[i + 2] = cpu_to_be32 (CONFIG_SYS_FLASH_BASE);
-                       flash_data[i + 3] = cpu_to_be32 (info->size);
-                       break;
-               case 5:
-                       info = flash_get_info(CONFIG_SYS_FLASH_BASE_1);
-                       size = info->size;
-                       info = flash_get_info(CONFIG_SYS_FLASH_BASE_2);
-                       size += info->size;
-                       flash_data[i + 1] = 0;
-                       flash_data[i + 2] = cpu_to_be32 (CONFIG_SYS_FLASH_BASE_1);
-                       flash_data[i + 3] = cpu_to_be32 (size);
-                       break;
-               default:
-                       break;
-               }
-               i += 4;
-       }
-       fdt_set_node_and_value (blob, "/localbus", "ranges", flash_data,
-                               len);
-
-       info = flash_get_info(CONFIG_SYS_FLASH_BASE_1);
-       flash_reg[0] = cpu_to_be32 (5);
-       flash_reg[2] = cpu_to_be32 (info->size);
-       flash_reg[3] = flash_reg[0];
-       flash_reg[4] = flash_reg[2];
-       info = flash_get_info(CONFIG_SYS_FLASH_BASE_2);
-       flash_reg[5] = cpu_to_be32 (info->size);
-       fdt_set_node_and_value (blob, "/localbus/flash@5,0", "reg", flash_reg,
-                               sizeof (flash_reg));
-}
-
 void ft_board_setup (void *blob, bd_t *bd)
 {
        ft_cpu_setup (blob, bd);
-       ft_blob_update (blob, bd);
 }
 #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
index 2ef6a35b1cdcb53f537dbf79a30c156a0d08d7e9..729d1c07aa15b2872e214aecd7062787667da774 100644 (file)
 
 #define CONFIG_ENV_SIZE                0x04000 /* Size of Environment */
 
-#define CONFIG_SYS_MALLOC_LEN  (1024 * 1024)   /* Reserved for malloc */
+#define CONFIG_SYS_MALLOC_LEN  (4 * 1024 * 1024)
 
 /* UBI Support for all Keymile boards */
 #define CONFIG_CMD_UBI
index b0233265058a72c41b826cb996a56d7d11914885..71658d8b23ce44796d40ae17968b3bc7370a9a5b 100644 (file)
 /* include common defines/options for all Keymile boards */
 #include "keymile-common.h"
 
+#define MTDIDS_DEFAULT         "nor0=boot"
+#define MTDPARTS_DEFAULT       \
+       "mtdparts=boot:768k(u-boot),128k(env),128k(envred),"    \
+       "-(" CONFIG_KM_UBI_PARTITION_NAME ")"
+
 #define CONFIG_MISC_INIT_R     1
 /*
  * System Clock Setup
  */
 #define CONFIG_SYS_MONITOR_BASE        TEXT_BASE /* start of monitor */
 #define CONFIG_SYS_FLASH_BASE          0xF0000000
-#define CONFIG_SYS_FLASH_BASE_1                0xF2000000
 #define CONFIG_SYS_PIGGY_BASE          0xE8000000
 #define        CONFIG_SYS_PIGGY_SIZE           128
 #define CONFIG_SYS_PAXE_BASE           0xA0000000
                                OR_GPCM_SCY_5 | \
                                OR_GPCM_TRLX | OR_GPCM_EAD)
 
-#define CONFIG_SYS_MAX_FLASH_BANKS     2       /* max num of flash banks       */
+#define CONFIG_SYS_MAX_FLASH_BANKS     1       /* max num of flash banks       */
 #define CONFIG_SYS_MAX_FLASH_SECT      512     /* max num of sects on one chip */
-#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE_1 }
+#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE }
 
 #undef CONFIG_SYS_FLASH_CHECKSUM