[U-Boot] [PATCH 6/6 v2] 8xx: add support for new keymile kmsupx4 board.

Heiko Schocher hs at denx.de
Thu Mar 12 07:37:34 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>
---
 MAINTAINERS                   |    1 +
 MAKEALL                       |    1 +
 Makefile                      |    3 ++
 board/keymile/common/common.c |    4 +++
 board/keymile/km8xx/km8xx.c   |    7 +++++-
 drivers/i2c/soft_i2c.c        |    2 +-
 include/configs/km8xx.h       |   46 ++++++++++++++++++++++++++++++++---------
 include/configs/kmsupx4.h     |   41 ++++++++++++++++++++++++++++++++++++
 8 files changed, 93 insertions(+), 12 deletions(-)
 create mode 100644 include/configs/kmsupx4.h

diff --git a/MAINTAINERS b/MAINTAINERS
index c3157d9..ce25c1b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -380,6 +380,7 @@ Heiko Schocher <hs at denx.de>
 	ids8247		MPC8247
 	jupiter		MPC5200
 	kmeter1		MPC8360
+	kmsupx4		MPC852T
 	mgcoge		MPC8247
 	mgsuvd		MPC852
 	mucmc52		MPC5200
diff --git a/MAKEALL b/MAKEALL
index f8c912b..ed9e5ed 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -117,6 +117,7 @@ LIST_8xx="		\
 	KUP4X		\
 	LANTEC		\
 	lwmon		\
+	kmsupx4		\
 	MBX		\
 	MBX860T		\
 	mgsuvd		\
diff --git a/Makefile b/Makefile
index 8cc8dd5..74bde8a 100644
--- a/Makefile
+++ b/Makefile
@@ -921,6 +921,9 @@ IVMS8_config:	unconfig
 		 }
 	@$(MKCONFIG) -a IVMS8 ppc mpc8xx ivm

+kmsupx4_config:		unconfig
+	@$(MKCONFIG) $(@:_config=) ppc mpc8xx km8xx keymile
+
 KUP4K_config	:	unconfig
 	@$(MKCONFIG) $(@:_config=) ppc mpc8xx kup4k kup

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index c3fa844..b2bd7fd 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -295,11 +295,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);
@@ -313,6 +316,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)
diff --git a/board/keymile/km8xx/km8xx.c b/board/keymile/km8xx/km8xx.c
index e7bfa31..845d3f2 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/drivers/i2c/soft_i2c.c b/drivers/i2c/soft_i2c.c
index da6cec1..ed5f5b2 100644
--- a/drivers/i2c/soft_i2c.c
+++ b/drivers/i2c/soft_i2c.c
@@ -40,7 +40,7 @@
 #ifdef CONFIG_LPC2292
 #include <asm/arch/hardware.h>
 #endif
-#ifdef	CONFIG_MPC866			/* only valid for MPC866 */
+#if defined(CONFIG_MPC852T) || defined(CONFIG_MPC866)
 #include <asm/io.h>
 #endif
 #include <i2c.h>
diff --git a/include/configs/km8xx.h b/include/configs/km8xx.h
index a29771f..c305b89 100644
--- a/include/configs/km8xx.h
+++ b/include/configs/km8xx.h
@@ -38,6 +38,10 @@
 /* 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 */
@@ -61,7 +65,17 @@
 #define BOOTFLASH_START	F0000000
 #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 MTDIDS_DEFAULT		"nor0=app"
+#define MTDPARTS_DEFAULT \
+	"mtdparts=app:384k(u-boot),128k(env),128k(envred),128k(free),"	\
+	"1536k(esw0),8704k(rootfs0),1536k(esw1),2432k(rootfs1),640k(var)," \
+	"768k(cfg)"

 #define CONFIG_EXTRA_ENV_SETTINGS					\
 	CONFIG_KM_DEF_ENV						\
@@ -69,9 +83,7 @@
 	"addcon=setenv bootargs ${bootargs} "				\
 		"console=ttyCPM0,${baudrate}\0"				\
 	"mtdids=nor0=app \0"						\
-	"mtdparts=mtdparts=app:384k(u-boot),128k(env),128k(envred),"	\
-		"128k(free),1536k(esw0),8704k(rootfs0),1536k(esw1),"	\
-		"2432k(rootfs1),640k(var),768k(cfg)\0"			\
+	"mtdparts=" MK_STR(MTDPARTS_DEFAULT) "\0"			\
 	"partition=nor0,9 \0"						\
 	"new_env=prot off F0060000 F009FFFF; era F0060000 F009FFFF \0" 	\
 	CONFIG_ENV_IVM							\
@@ -162,7 +174,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
@@ -184,7 +200,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
@@ -226,7 +246,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

 /*
@@ -241,8 +265,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
@@ -302,16 +331,13 @@

 /* 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
 #define CONFIG_SYS_DTT_BUS_NUM		(CONFIG_SYS_MAX_I2C_BUS)
-
-#define MTDIDS_DEFAULT		"nor0=app"
-#define MTDPARTS_DEFAULT ( \
-	"mtdparts=app:384k(u-boot),128k(env),128k(envred),128k(free),"	\
-	"1536k(esw0),8704k(rootfs0),1536k(esw1),2432k(rootfs1),640k(var)," \
-	"768k(cfg)")
-
 #endif	/* __CONFIG_KM8XX_H */
diff --git a/include/configs/kmsupx4.h b/include/configs/kmsupx4.h
new file mode 100644
index 0000000..8f1e602
--- /dev/null
+++ b/include/configs/kmsupx4.h
@@ -0,0 +1,41 @@
+/*
+ * (C) Copyright 2009
+ * Heiko Schocher, DENX Software Engineering, hs at denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+/*
+ * board/config.h - configuration options, board specific
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#define CONFIG_MPC852T		1	/* This is a MPC852T CPU	*/
+#define CONFIG_KMSUPX4		1	/* ...on a kmsupx4 board	*/
+#define CONFIG_HOSTNAME		kmsupx4
+
+/* include common defines/options for all Keymile 8xx boards */
+#include "km8xx.h"
+
+#define CONFIG_SYS_DELAYED_ICACHE	1	/* enable ICache not before
+						 * running in RAM.
+						 */
+#endif	/* __CONFIG_H */
-- 
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