[U-Boot] [PATCH 28/31] 8xx: add support for new keymile kmsupx4 board.
Heiko Schocher
hs at denx.de
Wed Jan 28 10:40:50 CET 2009
This patch adds support for the kmsupx4 board from Keymile,
based on a Freescale MPC852T CPU
- serial console on SMC1
- 32 MB SDRAM
- 32 MB NOR Flash
- Ethernet over SCC3
- I2C Bitbang
Signed-off-by: Heiko Schocher <hs at denx.de>
---
Makefile | 9 +++++-
board/keymile/common/common.c | 6 +++-
board/keymile/km8xx/km8xx.c | 7 ++++-
cpu/mpc8xx/cpu_init.c | 2 +
cpu/mpc8xx/start.S | 3 +-
drivers/i2c/soft_i2c.c | 3 ++
include/commproc.h | 2 +-
include/configs/keymile-common.h | 2 +-
include/configs/km8xx.h | 54 ++++++++++++++++++++++++++++++-------
lib_ppc/board.c | 3 +-
10 files changed, 73 insertions(+), 18 deletions(-)
diff --git a/Makefile b/Makefile
index 70d60b5..9aaaf7a 100644
--- a/Makefile
+++ b/Makefile
@@ -921,6 +921,13 @@ IVMS8_config: unconfig
}
@$(MKCONFIG) -a IVMS8 ppc mpc8xx ivm
+kmsupx4_config: unconfig
+ @mkdir -p $(obj)include
+ @{ echo "#define CONFIG_KMSUPX4" >>$(obj)include/config.h ; \
+ $(XECHO) "kmsupx board configuration" ; \
+ }
+ @$(MKCONFIG) -a km8xx ppc mpc8xx km8xx keymile
+
KUP4K_config : unconfig
@$(MKCONFIG) $(@:_config=) ppc mpc8xx kup4k kup
@@ -940,7 +947,7 @@ MBX860T_config: unconfig
mgsuvd_config: unconfig
@mkdir -p $(obj)include
@{ echo "#define CONFIG_MGSUVD" >>$(obj)include/config.h ; \
- $(XECHO) "mgsuvd configuration" ; \
+ $(XECHO) "mgsuvd board configuration" ; \
}
@$(MKCONFIG) -a km8xx ppc mpc8xx km8xx keymile
diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 1904482..3cf22a5 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -297,11 +297,14 @@ int ivm_analyze_eeprom (unsigned char *buf, int len)
int ivm_read_eeprom (void)
{
+#if defined(CONFIG_I2C_MUX)
I2C_MUX_DEVICE *dev = NULL;
+#endif
uchar i2c_buffer[CONFIG_SYS_IVM_EEPROM_MAX_LEN];
uchar *buf;
unsigned dev_addr = CONFIG_SYS_IVM_EEPROM_ADR;
+#if defined(CONFIG_I2C_MUX)
/* First init the Bus, select the Bus */
#if defined(CONFIG_SYS_I2C_IVM_BUS)
dev = i2c_mux_ident_muxstring ((uchar *)CONFIG_SYS_I2C_IVM_BUS);
@@ -315,6 +318,7 @@ int ivm_read_eeprom (void)
return -1;
}
i2c_set_bus_num (dev->busid);
+#endif
buf = (unsigned char *) getenv ("EEprom_ivm_addr");
if (buf != NULL)
@@ -393,7 +397,7 @@ static void setports (int gpio)
#endif
#endif
-#if defined(CONFIG_MGSUVD)
+#if defined(CONFIG_MGSUVD) || defined(CONFIG_KMSUPX4)
static void set_sda (int state)
{
I2C_SDA(state);
diff --git a/board/keymile/km8xx/km8xx.c b/board/keymile/km8xx/km8xx.c
index 02baf62..3f0e65f 100644
--- a/board/keymile/km8xx/km8xx.c
+++ b/board/keymile/km8xx/km8xx.c
@@ -61,7 +61,12 @@ const uint sdram_table[] =
int checkboard (void)
{
- puts ("Board: Keymile mgsuvd");
+ puts ("Board: Keymile ");
+#if defined(CONFIG_KMSUPX4)
+ puts ("kmsupx4");
+#else
+ puts ("mgsuvd");
+#endif
if (ethernet_present ())
puts (" with PIGGY.");
puts ("\n");
diff --git a/cpu/mpc8xx/cpu_init.c b/cpu/mpc8xx/cpu_init.c
index eb0091b..050008e 100644
--- a/cpu/mpc8xx/cpu_init.c
+++ b/cpu/mpc8xx/cpu_init.c
@@ -119,11 +119,13 @@ void cpu_init_f (volatile immap_t * immr)
* Memory Controller:
*/
+#if !defined(CONFIG_KMSUPX4)
/* perform BR0 reset that MPC850 Rev. A can't guarantee */
reg = memctl->memc_br0;
reg &= BR_PS_MSK; /* Clear everything except Port Size bits */
reg |= BR_V; /* then add just the "Bank Valid" bit */
memctl->memc_br0 = reg;
+#endif
/* Map banks 0 (and maybe 1) to the FLASH banks 0 (and 1) at
* preliminary addresses - these have to be modified later
diff --git a/cpu/mpc8xx/start.S b/cpu/mpc8xx/start.S
index 45c902e..7074f5d 100644
--- a/cpu/mpc8xx/start.S
+++ b/cpu/mpc8xx/start.S
@@ -142,7 +142,8 @@ boot_warm:
lis r3, IDC_DISABLE at h /* Disable data cache */
mtspr DC_CST, r3
-#if !(defined(CONFIG_IP860) || defined(CONFIG_PCU_E) || defined (CONFIG_FLAGADM))
+#if !(defined(CONFIG_IP860) || defined(CONFIG_PCU_E) || \
+ defined (CONFIG_FLAGADM) || defined(CONFIG_KMSUPX4))
/* On IP860 and PCU E,
* we cannot enable IC yet
*/
diff --git a/drivers/i2c/soft_i2c.c b/drivers/i2c/soft_i2c.c
index a27de5a..06d2da2 100644
--- a/drivers/i2c/soft_i2c.c
+++ b/drivers/i2c/soft_i2c.c
@@ -43,6 +43,9 @@
#ifdef CONFIG_MPC866 /* only valid for MPC866 */
#include <asm/io.h>
#endif
+#ifdef CONFIG_MPC852T /* only valid for MPC852T */
+#include <asm/io.h>
+#endif
#include <i2c.h>
/* #define DEBUG_I2C */
diff --git a/include/commproc.h b/include/commproc.h
index 12decfe..745642d 100644
--- a/include/commproc.h
+++ b/include/commproc.h
@@ -1126,7 +1126,7 @@ typedef struct scc_enet {
/* The MGSUVD Service Module uses SCC3 for Ethernet */
-#ifdef CONFIG_MGSUVD
+#if defined(CONFIG_MGSUVD) || defined(CONFIG_KMSUPX4)
#define PROFF_ENET PROFF_SCC3 /* Ethernet on SCC3 */
#define CPM_CR_ENET CPM_CR_CH_SCC3
#define SCC_ENET 2
diff --git a/include/configs/keymile-common.h b/include/configs/keymile-common.h
index 80f9446..20f7bab 100644
--- a/include/configs/keymile-common.h
+++ b/include/configs/keymile-common.h
@@ -105,7 +105,7 @@
#define CONFIG_I2C_MUX 1
/* EEprom support */
-#if defined(CONFIG_MGCOGE) || defined(CONFIG_MGSUVD)
+#if defined(CONFIG_MGCOGE) || defined(CONFIG_MGSUVD) || defined(CONFIG_KMSUPX4)
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
#else
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
diff --git a/include/configs/km8xx.h b/include/configs/km8xx.h
index 9088d6a..0ab75b4 100644
--- a/include/configs/km8xx.h
+++ b/include/configs/km8xx.h
@@ -32,13 +32,21 @@
* High Level Configuration Options
* (easy to change)
*/
-
+#if defined(CONFIG_MGSUVD)
#define CONFIG_MPC866 1 /* This is a MPC866 CPU */
#define CONFIG_HOSTNAME mgsuvd
-
+#else
+#define CONFIG_MPC852T 1 /* This is a MPC852 CPU */
+#define CONFIG_HOSTNAME kmsupx4
+#endif
+
/* include common defines/options for all Keymile boards */
#include "keymile-common.h"
+#if defined(CONFIG_KMSUPX4)
+#undef CONFIG_I2C_MUX /* No I2C MUX on this board */
+#endif
+
#define CONFIG_8xx_GCLK_FREQ 66000000
#define CONFIG_SYS_SMC_UCODE_PATCH 1 /* Relocate SMC1 */
@@ -46,8 +54,10 @@
#define CONFIG_8xx_CONS_SMC1 1 /* Console is on SMC1 */
#define CONFIG_SYS_SMC_RXBUFLEN 128
+#if defined(CONFIG_MGSUVD)
#define CONFIG_SYS_CPM_BOOTCOUNT_ADDR 0x1eb0 /* In case of SMC relocation, the
* default value is not working */
+#endif
#define CONFIG_PREBOOT "echo;" \
"echo Type \\\"run flash_nfs\\\" to mount root filesystem over NFS;" \
@@ -57,6 +67,11 @@
#define CONFIG_PRAM 512 /* protected RAM [KBytes] */
+#if defined(CONFIG_MGSUVD)
+#define CONFIG_ENV_IVM "EEprom_ivm=pca9544a:70:4 \0"
+#else
+#define CONFIG_ENV_IVM ""
+#endif
#define CONFIG_EXTRA_ENV_SETTINGS \
CONFIG_KM_DEF_ENV \
"rootpath=/opt/eldk/ppc_8xx\0" \
@@ -68,7 +83,7 @@
"2432k(rootfs1),640k(var),768k(cfg)\0" \
"partition=nor0,9 \0" \
"new_env=prot off F0060000 F009FFFF; era F0060000 F009FFFF \0" \
- "EEprom_ivm=pca9544a:70:4 \0" \
+ CONFIG_ENV_IVM \
""
#undef CONFIG_RTC_MPC8xx /* MPC866 does not support RTC */
@@ -121,14 +136,10 @@
#define CONFIG_FLASH_CFI_DRIVER
#define CONFIG_SYS_MAX_FLASH_SECT 256 /* max num of sects on one chip */
-
-#define CONFIG_SYS_FLASH_ERASE_TOUT 120000 /* Timeout for Flash Erase (in ms) */
-#define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */
-
-#define CONFIG_ENV_IS_IN_FLASH 1
-#define CONFIG_ENV_OFFSET CONFIG_SYS_MONITOR_LEN
-#define CONFIG_ENV_SIZE 0x20000 /* Total Size of Environment */
-#define CONFIG_ENV_SECT_SIZE 0x20000 /* Total Size of Environment Sector */
+#define CONFIG_ENV_IS_IN_FLASH 1
+#define CONFIG_ENV_OFFSET CONFIG_SYS_MONITOR_LEN
+#define CONFIG_ENV_SIZE 0x20000 /* Total Size of Environment */
+#define CONFIG_ENV_SECT_SIZE 0x20000 /* Total Size of Environment Sector */
/* Address and size of Redundant Environment Sector */
#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET+CONFIG_ENV_SECT_SIZE)
@@ -155,7 +166,11 @@
* SIUMCR - SIU Module Configuration 11-6
*-----------------------------------------------------------------------
*/
+#if defined(CONFIG_MGSUVD)
#define CONFIG_SYS_SIUMCR 0x00610480
+#else
+#define CONFIG_SYS_SIUMCR 0x00610400
+#endif
/*-----------------------------------------------------------------------
* TBSCR - Time Base Status and Control 11-26
@@ -177,7 +192,11 @@
* Set clock output, timebase and RTC source and divider,
* power management and some other internal clocks
*/
+#if defined(CONFIG_MGSUVD)
#define SCCR_MASK 0x01800000
+#else
+#define SCCR_MASK 0x00000000
+#endif
#define CONFIG_SYS_SCCR 0x01800000
#define CONFIG_SYS_DER 0
@@ -219,7 +238,11 @@
#define CONFIG_SYS_MPTPR 0x0200
/* PTB=16, AMB=001, FIXME 1 RAS precharge cycles, 1 READ loop cycle (not used),
1 Write loop Cycle (not used), 1 Timer Loop Cycle */
+#if defined(CONFIG_MGSUVD)
#define CONFIG_SYS_MBMR 0x10964111
+#else
+#define CONFIG_SYS_MBMR 0x20964111
+#endif
#define CONFIG_SYS_MAR 0x00000088
/*
@@ -234,8 +257,13 @@
/* GPIO/PIGGY on CS3 initialization values
*/
#define CONFIG_SYS_PIGGY_BASE (0x30000000)
+#if defined(CONFIG_MGSUVD)
#define CONFIG_SYS_OR3_PRELIM (0xfe000d24)
#define CONFIG_SYS_BR3_PRELIM (0x30000401)
+#else
+#define CONFIG_SYS_OR3_PRELIM (0xf8000d26)
+#define CONFIG_SYS_BR3_PRELIM (0x30000401)
+#endif
/*
* Internal Definitions
@@ -292,7 +320,11 @@
/* I2C SYSMON (LM75, AD7414 is almost compatible) */
#define CONFIG_DTT_LM75 1 /* ON Semi's LM75 */
+#if defined(CONFIG_MGSUVD)
#define CONFIG_DTT_SENSORS {0, 2, 4, 6} /* Sensor addresses */
+#else
+#define CONFIG_DTT_SENSORS {0} /* Sensor addresses */
+#endif
#define CONFIG_SYS_DTT_MAX_TEMP 70
#define CONFIG_SYS_DTT_LOW_TEMP -30
#define CONFIG_SYS_DTT_HYSTERESIS 3
diff --git a/lib_ppc/board.c b/lib_ppc/board.c
index 61c29b5..4ad0234 100644
--- a/lib_ppc/board.c
+++ b/lib_ppc/board.c
@@ -753,7 +753,8 @@ void board_init_r (gd_t *id, ulong dest_addr)
WATCHDOG_RESET();
#if defined(CONFIG_IP860) || defined(CONFIG_PCU_E) || \
- defined (CONFIG_FLAGADM) || defined(CONFIG_MPC83XX)
+ defined (CONFIG_FLAGADM) || defined(CONFIG_MPC83XX) || \
+ defined(CONFIG_KMSUPX4)
icache_enable (); /* it's time to enable the instruction cache */
#endif
--
1.6.0.6
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
More information about the U-Boot
mailing list