Skip to contentSkip to conversation

8xx: add support for new keymile kmsupx4 board.

PATCH New Heiko Schocher 2 participants 3 messages Mar 11, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/3 8xx: add support for new keymile kmsupx4 board.

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

---
 MAINTAINERS                   |    1 +
 MAKEALL                       |    1 +
 Makefile                      |    3 ++
 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            |    8 +++---
 include/configs/km8xx.h       |   46 ++++++++++++++++++++++++++++++++---------
 include/configs/kmsupx4.h     |   38 +++++++++++++++++++++++++++++++++
 include/configs/mgsuvd.h      |    1 +
 lib_ppc/board.c               |    3 +-
 13 files changed, 104 insertions(+), 18 deletions(-)
 create mode 100644 include/configs/kmsupx4.h
MAINTAINERS +1 -0
index c3157d9..ce25c1b 100644
@@ -380,6 +380,7 @@ Heiko Schocher <[email protected]>
 	ids8247		MPC8247
 	jupiter		MPC5200
 	kmeter1		MPC8360
+	kmsupx4		MPC852T
 	mgcoge		MPC8247
 	mgsuvd		MPC852
 	mucmc52		MPC5200
MAKEALL +1 -0
index f8c912b..ed9e5ed 100755
@@ -117,6 +117,7 @@ LIST_8xx="		\
 	KUP4X		\
 	LANTEC		\
 	lwmon		\
+	kmsupx4		\
 	MBX		\
 	MBX860T		\
 	mgsuvd		\
Makefile +3 -0
index 8cc8dd5..74bde8a 100644
@@ -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
 
board/keymile/common/common.c +5 -1
index 48ce613..b2bd7fd 100644
@@ -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)
@@ -390,7 +394,7 @@ static void setports (int gpio)
 #endif
 #endif
 
-#if defined(CONFIG_MGSUVD)
+#if defined(CONFIG_KM8XX)
 static void set_sda (int state)
 {
 	I2C_SDA(state);
board/keymile/km8xx/km8xx.c +6 -1
index e7bfa31..845d3f2 100644
@@ -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");
cpu/mpc8xx/cpu_init.c +2 -0
index eb0091b..050008e 100644
@@ -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
cpu/mpc8xx/start.S +2 -1
index 45c902e..352af16 100644
@@ -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
 					 */
drivers/i2c/soft_i2c.c +3 -0
index da6cec1..f273c67 100644
@@ -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	*/
include/commproc.h +4 -4
index 12decfe..9d28abc 100644
@@ -1122,11 +1122,11 @@ typedef struct scc_enet {
 #define SICR_ENET_CLKRT	((uint)0x0000003d)
 #endif	/* CONFIG_MBX */
 
-/***  MGSUVD  *********************************************************/
+/***  KM8XX  *********************************************************/
 
-/* The MGSUVD Service Module uses SCC3 for Ethernet */
+/* The KM8XX Service Module uses SCC3 for Ethernet */
 
-#ifdef CONFIG_MGSUVD
+#ifdef CONFIG_KM8XX
 #define PROFF_ENET	PROFF_SCC3		/* Ethernet on SCC3 */
 #define CPM_CR_ENET	CPM_CR_CH_SCC3
 #define SCC_ENET	2
@@ -1145,7 +1145,7 @@ typedef struct scc_enet {
  */
 #define SICR_ENET_MASK	((uint)0x00FF0000)
 #define SICR_ENET_CLKRT	((uint)0x00250000)
-#endif	/* CONFIG_MGSUVD */
+#endif	/* CONFIG_KM8XX */
 
 
 /***  MHPC  ********************************************************/
include/configs/km8xx.h +36 -10

108 lines not on this page · raw message

include/configs/kmsupx4.h new file +38 -0
new file mode 100644
index 0000000..f8f5c58
@@ -0,0 +1,38 @@
+/*
+ * (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"
+
+#endif	/* __CONFIG_H */
include/configs/mgsuvd.h +1 -0
index 960d6c7..1618f7d 100644
@@ -28,6 +28,7 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#define CONFIG_MPC866		1	/* This is a MPC866 CPU		*/
 #define CONFIG_MGSUVD		1	/* ...on a mgsuvd board	*/
 #define CONFIG_HOSTNAME		mgsuvd
 
lib_ppc/board.c +2 -1
index 6d29303..da54c92 100644
@@ -737,7 +737,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
 
Signature · 5 lines
1.6.0.6

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#1 lore raw

PATCH 3/3 8xx: add support for new keymile kmsupx4 board.

Dear Heiko,

Quoted 2 lines · In message <[email protected]> you wrote:

This patch adds support for the kmsupx4 board from Keymile, based on a Freescale MPC852T CPU

...

cpu/mpc8xx/start.S boot_warm: · line 149

Quoted 12 lines
cpu/mpc8xx/start.S +2 -1
@@ -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
 					 */

Why exactly is this necessary?

I would like to avoid new #ifdef's in common code in general, but here this should most likely be not needed either (IP860 and PCU E had very special hardware issues; I don't know about FLAGADM) - are you absolutely sure you need that?

drivers/i2c/soft_i2c.c line 48

Quoted 11 lines
drivers/i2c/soft_i2c.c +3 -0
index da6cec1..f273c67 100644
@@ -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

Please change into

	#if defined(CONFIG_MPC852T) || defined(CONFIG_MPC866)

Thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Bus error -- please leave by the rear door.
#2 lore raw

PATCH 3/3 8xx: add support for new keymile kmsupx4 board.

Hello Wolfgang,

Quoted 19 lines · Wolfgang Denk
Quoted 2 lines · In message <[email protected]> you wrote:

This patch adds support for the kmsupx4 board from Keymile, based on a Freescale MPC852T CPU

...

cpu/mpc8xx/start.S boot_warm: · line 149

Quoted 12 lines
cpu/mpc8xx/start.S +2 -1
@@ -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
 					 */

Why exactly is this necessary?

Quoted 4 lines

I would like to avoid new #ifdef's in common code in general, but here this should most likely be not needed either (IP860 and PCU E had very special hardware issues; I don't know about FLAGADM) - are you absolutely sure you need that?

Hmm.. when I enable the IC here the CPU is dead ... but you are right, there should be no such special thing for this port ... I try to find out more.

Quoted 14 lines

drivers/i2c/soft_i2c.c line 48

Quoted 11 lines
drivers/i2c/soft_i2c.c +3 -0
index da6cec1..f273c67 100644
@@ -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

Please change into

Quoted 1 line
	#if defined(CONFIG_MPC852T) || defined(CONFIG_MPC866)

OK

thanks
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany