Skip to contentSkip to conversation

updates for km83xx boards

PATCH Superseded Holger Brunck 4 participants 26 messages Jan 17, 2013 – Jan 21, 2013

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover updates for km83xx boards

Hi Kim,
here are some updates for our km83xx board support and some patches for our common code. In generic u-boot code there is only one small change in the driver for kmeter1_nand which is currently only used from our boards. If I should seperate this one from this serie then let me know.

Regards
Holger

Andreas Huber (2):
km/common: introduce $uimage variable
km/scripts: replace hardcoded uImage

Holger Brunck (11):
km/common: remove unneeded ifdefs for I2C km/common/ivm: remove obsolete code km/common/ivm: remove CONFIG_SYS_I2C_IVM_BUS related code powerpc/83xx: use ppc_6xx as arch variable for kmvect1
kmeter1_nand: allow usage of NAND_ECC_SOFT_BCH powerpc/83xx: use NAND_ECC_BCH for kmcoge5ne km/common: add eccmode to kernel commandline powerpc/83xx/km: cleanup tuxx1 support powerpc/83xx/km: add support for kmopti2 board poweprc/83xx/km: remove uneeded CONFIG_MISC_INIT_R powerpc/83xx/km: drop uneeded dtt_bus environment var

Karlheinz Jerg (2):
km82xx,km83xx: move ethernet_present() from common to cpu specific powerpc/83xx/km: add MV88E6122 switch support for kmvect1

 board/keymile/common/common.c            |   13 ----
 board/keymile/common/ivm.c               |   12 ---
 board/keymile/km82xx/km82xx.c            |    8 ++
 board/keymile/km83xx/km83xx.c            |  114 +++++++++++++++++++++++++++---
 board/keymile/scripts/develop-common.txt |    5 +-
 board/keymile/scripts/ramfs-common.txt   |    5 +-
 boards.cfg                               |    7 +-
 drivers/mtd/nand/kmeter1_nand.c          |    4 +
 include/configs/km/keymile-common.h      |   12 +++-
 include/configs/km/km8309-common.h       |    4 +-
 include/configs/km/km8321-common.h       |    2 -
 include/configs/km/km83xx-common.h       |    9 +--
 include/configs/km8360.h                 |    2 +
 include/configs/suvd3.h                  |   37 ++++++++++
 include/configs/tuxx1.h                  |   46 +++++++++----
 15 files changed, 213 insertions(+), 67 deletions(-)
#1 lore raw

PATCH 1/15 km/common: remove unneeded ifdefs for I2C

All boards form this serie use i2c. There is no need to #ifdef the header.

---
 board/keymile/common/common.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
board/keymile/common/common.c +0 -2
index 6f407b7..468c755 100644
@@ -38,9 +38,7 @@
 #include "post.h"
 #endif
 #include "common.h"
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
 #include <i2c.h>
-#endif
 
 #if !defined(CONFIG_MPC83xx)
 static void i2c_write_start_seq(void);
Signature · 1 line
1.7.1
#2 lore raw

PATCH 2/15 km/common/ivm: remove obsolete code

In reply to Holger Brunck

EEprom_ivm_addr isn't set in our environment, so remove the usage of this.

---
 board/keymile/common/ivm.c |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)
board/keymile/common/ivm.c +0 -8
index eaa924f..7fe3b0f 100644
@@ -325,14 +325,6 @@ int ivm_read_eeprom(void)
 	}
 	i2c_set_bus_num(dev->busid);
 #endif
-
-	buf = (unsigned char *) getenv("EEprom_ivm_addr");
-	if (buf != NULL) {
-		ret = strict_strtoul((char *)buf, 16, &dev_addr);
-		if (ret != 0)
-			return -3;
-	}
-
 	/* add deblocking here */
 	i2c_make_abort();
 
Signature · 1 line
1.7.1
#3 lore raw

PATCH 3/15 km/common/ivm: remove CONFIG_SYS_I2C_IVM_BUS related code

In reply to Holger Brunck

This define isn't set within our setup files. So we can safely remove the affected code.

---
 board/keymile/common/ivm.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
board/keymile/common/ivm.c +0 -4
index 7fe3b0f..607daa6 100644
@@ -312,13 +312,9 @@ int ivm_read_eeprom(void)
 
 #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);
-#else
 	buf = (unsigned char *) getenv("EEprom_ivm");
 	if (buf != NULL)
 		dev = i2c_mux_ident_muxstring(buf);
-#endif
 	if (dev == NULL) {
 		printf("Error couldnt add Bus for IVM\n");
 		return -1;
Signature · 1 line
1.7.1
#4 lore raw

PATCH 4/15 km82xx, km83xx: move ethernet_present() from common to cpu specific

In reply to Holger Brunck

From: Karlheinz Jerg <[email protected]>

For kmvect1 we need a special solution and for km_arm boards we already have. So move the common code to the architectur specific file.

---
 board/keymile/common/common.c |   11 -----------
 board/keymile/km82xx/km82xx.c |    8 ++++++++
 board/keymile/km83xx/km83xx.c |   24 +++++++++++++++++++++++-
 3 files changed, 31 insertions(+), 12 deletions(-)
board/keymile/common/common.c +0 -11
index 468c755..ef93ed3 100644
@@ -183,17 +183,6 @@ void i2c_init_board(void)
 }
 #endif
 
-
-#if !defined(MACH_TYPE_KM_KIRKWOOD)
-int ethernet_present(void)
-{
-	struct km_bec_fpga *base =
-		(struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE;
-
-	return in_8(&base->bprth) & PIGGY_PRESENT;
-}
-#endif
-
 int board_eth_init(bd_t *bis)
 {
 	if (ethernet_present())
board/keymile/km82xx/km82xx.c +8 -0
index 67b69f6..defc885 100644
@@ -385,6 +385,14 @@ void handle_mgcoge3un_reset(void)
 }
 #endif
 
+int ethernet_present(void)
+{
+	struct km_bec_fpga *base =
+		(struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE;
+
+	return in_8(&base->bprth) & PIGGY_PRESENT;
+}
+
 /*
  * Early board initalization.
  */
board/keymile/km83xx/km83xx.c +23 -1
index 83a8753..26e682b 100644
@@ -133,6 +133,28 @@ const uint upma_table[] = {
 };
 #endif
 
+int piggy_present(void)
+{
+	struct km_bec_fpga *base =
+		(struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE;
+
+	return in_8(&base->bprth) & PIGGY_PRESENT;
+}
+
+#if defined(CONFIG_KMVECT1)
+int ethernet_present(void)
+{
+	/* ethernet port connected to simple switch without piggy */
+	return 1;
+}
+#else
+int ethernet_present(void)
+{
+	return piggy_present();
+}
+#endif
+
+
 int board_early_init_r(void)
 {
 	struct km_bec_fpga *base =
@@ -280,7 +302,7 @@ int checkboard(void)
 {
 	puts("Board: Keymile " CONFIG_KM_BOARD_NAME);
 
-	if (ethernet_present())
+	if (piggy_present())
 		puts(" with PIGGY.");
 	puts("\n");
 	return 0;
Signature · 1 line
1.7.1
#5 lore raw

PATCH 4/15 km82xx, km83xx: move ethernet_present() from common to cpu specific

board/keymile/km83xx/km83xx.c const uint upma_table[] = { · line 142

Quoted 7 lines · On Thu, 17 Jan 2013 13:47:50 +0100 Holger Brunck <[email protected]>…
board/keymile/km83xx/km83xx.c +7 -0
+int piggy_present(void)
+{
+	struct km_bec_fpga *base =
+		(struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE;
+
+	return in_8(&base->bprth) & PIGGY_PRESENT;
+}

this change produces two new sparse warnings:

km83xx.c:137:22: warning: incorrect type in argument 1 (different address spaces)
km83xx.c:137:22: expected unsigned char const volatile [noderef] <asn:2>*addr
km83xx.c:137:22: got unsigned char *<noident>
km83xx.c:132:5: warning: symbol 'piggy_present' was not declared. Should it be static?

so make the function static, and add __iomem annotation to the assignment of 'base'.

Kim

#6 lore raw

PATCH 4/15 km82xx, km83xx: move ethernet_present() from common to cpu specific

Quoted 13 lines · Kim Phillips

board/keymile/km83xx/km83xx.c const uint upma_table[] = { · line 142

Quoted 7 lines · On Thu, 17 Jan 2013 13:47:50 +0100 Holger Brunck <[email protected]>…
board/keymile/km83xx/km83xx.c +7 -0
+int piggy_present(void)
+{
+	struct km_bec_fpga *base =
+		(struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE;
+
+	return in_8(&base->bprth) & PIGGY_PRESENT;
+}

this change produces two new sparse warnings:

Quoted 8 lines

km83xx.c:137:22: warning: incorrect type in argument 1 (different address spaces)
km83xx.c:137:22: expected unsigned char const volatile [noderef] <asn:2>*addr
km83xx.c:137:22: got unsigned char *<noident>
km83xx.c:132:5: warning: symbol 'piggy_present' was not declared. Should it be static?

so make the function static, and add __iomem annotation to the assignment of 'base'.

ok will do. Just out of curiosity which compiler throws these warnings? I use powerpc-gcc (GCC) 4.7.2 and don't see them.

Anyway I send a v2 for this patch.

Regards
Holger

#7 lore raw

PATCH 4/15 km82xx, km83xx: move ethernet_present() from common to cpu specific

Quoted 19 lines · On Fri, 18 Jan 2013 09:07:32 +0100 Holger Brunck <[email protected]>…
Quoted 18 lines · Kim Phillips

board/keymile/km83xx/km83xx.c const uint upma_table[] = { · line 142

Quoted 7 lines · On Thu, 17 Jan 2013 13:47:50 +0100 Holger Brunck <[email protected]>…
board/keymile/km83xx/km83xx.c +7 -0
+int piggy_present(void)
+{
+	struct km_bec_fpga *base =
+		(struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE;
+
+	return in_8(&base->bprth) & PIGGY_PRESENT;
+}

this change produces two new sparse warnings:

km83xx.c:137:22: warning: incorrect type in argument 1 (different address spaces)
km83xx.c:137:22: expected unsigned char const volatile [noderef] <asn:2>*addr
km83xx.c:137:22: got unsigned char *<noident>
km83xx.c:132:5: warning: symbol 'piggy_present' was not declared. Should it be static?

Quoted 6 lines
Quoted 3 lines

so make the function static, and add __iomem annotation to the assignment of 'base'.

ok will do. Just out of curiosity which compiler throws these warnings? I use powerpc-gcc (GCC) 4.7.2 and don't see them.

it's not a compiler, it's sparse - Linus' kernel sanity checking tool. Get it from here:

http://git.kernel.org/?p=devel/sparse/sparse.git;a=summary

build it, add it to your path, and in u-boot, use make C=1 or ./MAKEALL -C/--check.

Kim

#8 lore raw

PATCH 5/15 powerpc/83xx/km: add MV88E6122 switch support for kmvect1

In reply to Holger Brunck

From: Karlheinz Jerg <[email protected]>

kmvect1 has a UEC2 connection to the piggy board and a UEC0 connection to the switch MV88E6122. This switch has a connection to a frontport ethernet interface. The ethernet port used for network booting is automatically selected by u-boot. If a Piggy is plugged, the Piggy port is selected (UEC2, eth1). If the Piggy isn't present, the Frontport is selected (UEC0, eth0).

The switch reset is connected to a GPIO on the PRIO3 board FPGA (GPIO28) and released at startup.

---
 board/keymile/km83xx/km83xx.c      |   78 ++++++++++++++++++++++++++++++++++++
 include/configs/km/km83xx-common.h |    8 +---
 include/configs/suvd3.h            |   37 +++++++++++++++++
 3 files changed, 117 insertions(+), 6 deletions(-)
board/keymile/km83xx/km83xx.c +78 -0
index 26e682b..0907195 100644
@@ -215,8 +215,86 @@ int misc_init_r(void)
 	return 0;
 }
 
+#if defined(CONFIG_KMVECT1)
+#include <mv88e6352.h>
+/* Marvell MV88E6122 switch configuration */
+struct mv88e_sw_reg extsw_conf[] = {
+	/* port 1, FRONT_MDI, autoneg */
+	{ PORT(1), PORT_PHY, NO_SPEED_FOR },
+	{ PORT(1), PORT_CTRL, FORWARDING | EGRS_FLD_ALL },
+	{ PHY(1), PHY_1000_CTRL, NO_ADV },
+	{ PHY(1), PHY_SPEC_CTRL, AUTO_MDIX_EN },
+	{ PHY(1), PHY_CTRL, PHY_100_MBPS | AUTONEG_EN | AUTONEG_RST |
+		FULL_DUPLEX },
+	/* port 2, unused */
+	{ PORT(2), PORT_CTRL, PORT_DIS },
+	{ PHY(2), PHY_CTRL, PHY_PWR_DOWN },
+	{ PHY(2), PHY_SPEC_CTRL, SPEC_PWR_DOWN },
+	/* port 3, BP_MII (CPU), PHY mode, 100BASE */
+	{ PORT(3), PORT_CTRL, FORWARDING | EGRS_FLD_ALL },
+	/* port 4, ESTAR to slot 11, SerDes, 1000BASE-X */
+	{ PORT(4), PORT_STATUS, NO_PHY_DETECT },
+	{ PORT(4), PORT_PHY, SPEED_1000_FOR },
+	{ PORT(4), PORT_CTRL, FORWARDING | EGRS_FLD_ALL },
+	/* port 5, ESTAR to slot 13, SerDes, 1000BASE-X */
+	{ PORT(5), PORT_STATUS, NO_PHY_DETECT },
+	{ PORT(5), PORT_PHY, SPEED_1000_FOR },
+	{ PORT(5), PORT_CTRL, FORWARDING | EGRS_FLD_ALL },
+	/*
+	 * Errata Fix: 1.9V Output from Internal 1.8V Regulator,
+	 * acc . MV-S300889-00D.pdf , clause 4.5
+	 */
+	{ PORT(5), 0x1A, 0xADB1 },
+	/* port 6, unused, this port has no phy */
+	{ PORT(6), PORT_CTRL, PORT_DIS },
+};
+#endif
+
 int last_stage_init(void)
 {
+#if defined(CONFIG_KMVECT1)
+	struct km_bec_fpga *base =
+		(struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE;
+	u8 tmp_reg;
+
+	/* Release mv88e6122 from reset */
+	tmp_reg = in_8(&base->res1[0]) | 0x10; /* DIRECT3 register */
+	out_8(&base->res1[0], tmp_reg);	       /* GP28 as output */
+	tmp_reg = in_8(&base->gprt3) | 0x10;   /* GP28 to high */
+	out_8(&base->gprt3, tmp_reg);
+
+	/* configure MV88E6122 switch */
+	char *name = "UEC2";
+
+	if (miiphy_set_current_dev(name))
+		return 0;
+
+	mv88e_sw_program(name, CONFIG_KM_MVEXTSW_ADDR, extsw_conf,
+		ARRAY_SIZE(extsw_conf));
+
+	mv88e_sw_reset(name, CONFIG_KM_MVEXTSW_ADDR);
+
+	if (piggy_present()) {
+		uchar enetaddr[6];
+		if (eth_getenv_enetaddr("ethaddr", enetaddr)) {
+			/* increment last 3 bytes */
+			u32 val = (enetaddr[3] << 16) + (enetaddr[4] << 8)
+				+ enetaddr[5];
+			val++;
+			enetaddr[3] = (val >> 16) & 0xFF;
+			enetaddr[4] = (val >>  8) & 0xFF;
+			enetaddr[5] = (val >>  0) & 0xFF;
+			if (!eth_setenv_enetaddr("eth1addr", enetaddr)) {
+				setenv("ethact", "UEC2");
+				setenv("netdev", "eth1");
+				puts("using PIGGY for network boot\n");
+			} else
+				puts("using frontport for network boot\n");
+		}
+	} else
+		puts("using frontport for network boot\n");
+#endif
+
 #if defined(CONFIG_KMCOGE5NE)
 	struct bfticu_iomap *base =
 		(struct bfticu_iomap *)CONFIG_SYS_BFTIC3_BASE;
include/configs/km/km83xx-common.h +2 -6
index a9823d6..1e596c8 100644
@@ -165,19 +165,15 @@
 #define CONFIG_UEC_ETH
 #define CONFIG_ETHPRIME		"UEC0"
 
+#if !defined(CONFIG_MPC8309)
 #define CONFIG_UEC_ETH1		/* GETH1 */
 #define UEC_VERBOSE_DEBUG	1
+#endif
 
 #ifdef CONFIG_UEC_ETH1
-#if defined(CONFIG_MPC8309)
-#define CONFIG_SYS_UEC1_UCC_NUM	2	/* UCC3 */
-#define CONFIG_SYS_UEC1_RX_CLK		QE_CLK_NONE /* not used in RMII Mode */
-#define CONFIG_SYS_UEC1_TX_CLK		QE_CLK12
-#else
 #define CONFIG_SYS_UEC1_UCC_NUM	3	/* UCC4 */
 #define CONFIG_SYS_UEC1_RX_CLK		QE_CLK_NONE /* not used in RMII Mode */
 #define CONFIG_SYS_UEC1_TX_CLK		QE_CLK17
-#endif
 #define CONFIG_SYS_UEC1_ETH_TYPE	FAST_ETH
 #define CONFIG_SYS_UEC1_PHY_ADDR	0
 #define CONFIG_SYS_UEC1_INTERFACE_TYPE	PHY_INTERFACE_MODE_RMII
include/configs/suvd3.h +37 -0
index c50832c..bbf9da5 100644
@@ -110,4 +110,41 @@
 				 BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
 #define CONFIG_SYS_DBAT6U	CONFIG_SYS_IBAT6U
 
+/*
+ * QE UEC ethernet configuration
+ */
+#if defined(CONFIG_KMVECT1)
+#define CONFIG_MV88E6352_SWITCH
+#define CONFIG_KM_MVEXTSW_ADDR		0x10
+
+/* ethernet port connected to simple switch 88e6122 (UEC0) */
+#define CONFIG_UEC_ETH1
+#define CONFIG_SYS_UEC1_UCC_NUM		0	/* UCC1 */
+#define CONFIG_SYS_UEC1_RX_CLK		QE_CLK9
+#define CONFIG_SYS_UEC1_TX_CLK		QE_CLK10
+
+#define CONFIG_FIXED_PHY		0xFFFFFFFF
+#define CONFIG_SYS_FIXED_PHY_ADDR	0x1E	/* unused address */
+#define CONFIG_SYS_FIXED_PHY_PORT(devnum, speed, duplex) \
+		{devnum, speed, duplex}
+#define CONFIG_SYS_FIXED_PHY_PORTS \
+		CONFIG_SYS_FIXED_PHY_PORT("UEC0", SPEED_100, DUPLEX_FULL)
+
+#define CONFIG_SYS_UEC1_ETH_TYPE	FAST_ETH
+#define CONFIG_SYS_UEC1_PHY_ADDR	CONFIG_SYS_FIXED_PHY_ADDR
+#define CONFIG_SYS_UEC1_INTERFACE_TYPE	PHY_INTERFACE_MODE_MII
+#define CONFIG_SYS_UEC1_INTERFACE_SPEED	100
+
+/* ethernet port connected to piggy (UEC2) */
+#define CONFIG_HAS_ETH1
+#define CONFIG_UEC_ETH2
+#define CONFIG_SYS_UEC2_UCC_NUM		2       /* UCC3 */
+#define CONFIG_SYS_UEC2_RX_CLK		QE_CLK_NONE /* not used in RMII Mode */
+#define CONFIG_SYS_UEC2_TX_CLK		QE_CLK12
+#define CONFIG_SYS_UEC2_ETH_TYPE	FAST_ETH
+#define CONFIG_SYS_UEC2_PHY_ADDR	0
+#define CONFIG_SYS_UEC2_INTERFACE_TYPE	PHY_INTERFACE_MODE_RMII
+#define CONFIG_SYS_UEC2_INTERFACE_SPEED	100
+#endif /* CONFIG_KMVECT1 */
+
 #endif /* __CONFIG_H */
Signature · 1 line
1.7.1
#9 lore raw

PATCH 5/15 powerpc/83xx/km: add MV88E6122 switch support for kmvect1

Quoted 24 lines · On Thu, 17 Jan 2013 13:47:51 +0100 Holger Brunck <[email protected]>…
board/keymile/km83xx/km83xx.c +24 -0
+#if defined(CONFIG_KMVECT1)
+#include <mv88e6352.h>
+/* Marvell MV88E6122 switch configuration */
+struct mv88e_sw_reg extsw_conf[] = {
+	/* port 1, FRONT_MDI, autoneg */
+	{ PORT(1), PORT_PHY, NO_SPEED_FOR },
+	{ PORT(1), PORT_CTRL, FORWARDING | EGRS_FLD_ALL },
+	{ PHY(1), PHY_1000_CTRL, NO_ADV },
+	{ PHY(1), PHY_SPEC_CTRL, AUTO_MDIX_EN },
+	{ PHY(1), PHY_CTRL, PHY_100_MBPS | AUTONEG_EN | AUTONEG_RST |
+		FULL_DUPLEX },
+	/* port 2, unused */
+	{ PORT(2), PORT_CTRL, PORT_DIS },
+	{ PHY(2), PHY_CTRL, PHY_PWR_DOWN },
+	{ PHY(2), PHY_SPEC_CTRL, SPEC_PWR_DOWN },
+	/* port 3, BP_MII (CPU), PHY mode, 100BASE */
+	{ PORT(3), PORT_CTRL, FORWARDING | EGRS_FLD_ALL },
+	/* port 4, ESTAR to slot 11, SerDes, 1000BASE-X */
+	{ PORT(4), PORT_STATUS, NO_PHY_DETECT },
+	{ PORT(4), PORT_PHY, SPEED_1000_FOR },
+	{ PORT(4), PORT_CTRL, FORWARDING | EGRS_FLD_ALL },
+	/* port 5, ESTAR to slot 13, SerDes, 1000BASE-X */
+	{ PORT(5), PORT_STATUS, NO_PHY_DETECT },
+	{ PORT(5), PORT_PHY, SPEED_1000_FOR },

board/keymile/km83xx/km83xx.c int misc_init_r(void) · line 251

Quoted 10 lines
board/keymile/km83xx/km83xx.c +10 -0
+	{ PORT(5), PORT_CTRL, FORWARDING | EGRS_FLD_ALL },
+	/*
+	 * Errata Fix: 1.9V Output from Internal 1.8V Regulator,
+	 * acc . MV-S300889-00D.pdf , clause 4.5
+	 */
+	{ PORT(5), 0x1A, 0xADB1 },
+	/* port 6, unused, this port has no phy */
+	{ PORT(6), PORT_CTRL, PORT_DIS },
+};
+#endif

this chunk introduces a new sparse warning:

km83xx.c:217:21: warning: symbol 'extsw_conf' was not declared. Should it be static?

Quoted 35 lines

int last_stage_init(void)
{

board/keymile/km83xx/km83xx.c +33 -0
+#if defined(CONFIG_KMVECT1)
+	struct km_bec_fpga *base =
+		(struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE;
+	u8 tmp_reg;
+
+	/* Release mv88e6122 from reset */
+	tmp_reg = in_8(&base->res1[0]) | 0x10; /* DIRECT3 register */
+	out_8(&base->res1[0], tmp_reg);	       /* GP28 as output */
+	tmp_reg = in_8(&base->gprt3) | 0x10;   /* GP28 to high */
+	out_8(&base->gprt3, tmp_reg);
+
+	/* configure MV88E6122 switch */
+	char *name = "UEC2";
+
+	if (miiphy_set_current_dev(name))
+		return 0;
+
+	mv88e_sw_program(name, CONFIG_KM_MVEXTSW_ADDR, extsw_conf,
+		ARRAY_SIZE(extsw_conf));
+
+	mv88e_sw_reset(name, CONFIG_KM_MVEXTSW_ADDR);
+
+	if (piggy_present()) {
+		uchar enetaddr[6];
+		if (eth_getenv_enetaddr("ethaddr", enetaddr)) {
+			/* increment last 3 bytes */
+			u32 val = (enetaddr[3] << 16) + (enetaddr[4] << 8)
+				+ enetaddr[5];
+			val++;
+			enetaddr[3] = (val >> 16) & 0xFF;
+			enetaddr[4] = (val >>  8) & 0xFF;
+			enetaddr[5] = (val >>  0) & 0xFF;
+			if (!eth_setenv_enetaddr("eth1addr", enetaddr)) {

board/keymile/km83xx/km83xx.c int misc_init_r(void) · line 297

Quoted 10 lines
board/keymile/km83xx/km83xx.c +10 -0
+				setenv("ethact", "UEC2");
+				setenv("netdev", "eth1");
+				puts("using PIGGY for network boot\n");
+			} else
+				puts("using frontport for network boot\n");
+		}
+	} else
+		puts("using frontport for network boot\n");
+#endif
+

AFAIK, assigning the switch MAC address to the front port's MAC address plus one isn't acceptable practice for u-boot board code. Get eth1addr in the same manner ethaddr is obtained/assigned.

Quoted 8 lines
include/configs/km/km83xx-common.h +2 -2
+#if !defined(CONFIG_MPC8309)
 #define CONFIG_UEC_ETH1		/* GETH1 */
 #define UEC_VERBOSE_DEBUG	1
+#endif
 
 #ifdef CONFIG_UEC_ETH1
-#if defined(CONFIG_MPC8309)
-#define CONFIG_SYS_UEC1_UCC_NUM	2	/* UCC3 */

include/configs/km/km83xx-common.h line 179

Quoted 10 lines
include/configs/km/km83xx-common.h +0 -4
-#define CONFIG_SYS_UEC1_RX_CLK		QE_CLK_NONE /* not used in RMII Mode */
-#define CONFIG_SYS_UEC1_TX_CLK		QE_CLK12
-#else
 #define CONFIG_SYS_UEC1_UCC_NUM	3	/* UCC4 */
 #define CONFIG_SYS_UEC1_RX_CLK		QE_CLK_NONE /* not used in RMII Mode */
 #define CONFIG_SYS_UEC1_TX_CLK		QE_CLK17
-#endif
 #define CONFIG_SYS_UEC1_ETH_TYPE	FAST_ETH
 #define CONFIG_SYS_UEC1_PHY_ADDR	0
 #define CONFIG_SYS_UEC1_INTERFACE_TYPE	PHY_INTERFACE_MODE_RMII

how are these changes related?

Kim

#10 lore raw

PATCH 5/15 powerpc/83xx/km: add MV88E6122 switch support for kmvect1

Quoted 40 lines · Kim Phillips
Quoted 24 lines · On Thu, 17 Jan 2013 13:47:51 +0100 Holger Brunck <[email protected]>…
board/keymile/km83xx/km83xx.c +24 -0
+#if defined(CONFIG_KMVECT1)
+#include <mv88e6352.h>
+/* Marvell MV88E6122 switch configuration */
+struct mv88e_sw_reg extsw_conf[] = {
+	/* port 1, FRONT_MDI, autoneg */
+	{ PORT(1), PORT_PHY, NO_SPEED_FOR },
+	{ PORT(1), PORT_CTRL, FORWARDING | EGRS_FLD_ALL },
+	{ PHY(1), PHY_1000_CTRL, NO_ADV },
+	{ PHY(1), PHY_SPEC_CTRL, AUTO_MDIX_EN },
+	{ PHY(1), PHY_CTRL, PHY_100_MBPS | AUTONEG_EN | AUTONEG_RST |
+		FULL_DUPLEX },
+	/* port 2, unused */
+	{ PORT(2), PORT_CTRL, PORT_DIS },
+	{ PHY(2), PHY_CTRL, PHY_PWR_DOWN },
+	{ PHY(2), PHY_SPEC_CTRL, SPEC_PWR_DOWN },
+	/* port 3, BP_MII (CPU), PHY mode, 100BASE */
+	{ PORT(3), PORT_CTRL, FORWARDING | EGRS_FLD_ALL },
+	/* port 4, ESTAR to slot 11, SerDes, 1000BASE-X */
+	{ PORT(4), PORT_STATUS, NO_PHY_DETECT },
+	{ PORT(4), PORT_PHY, SPEED_1000_FOR },
+	{ PORT(4), PORT_CTRL, FORWARDING | EGRS_FLD_ALL },
+	/* port 5, ESTAR to slot 13, SerDes, 1000BASE-X */
+	{ PORT(5), PORT_STATUS, NO_PHY_DETECT },
+	{ PORT(5), PORT_PHY, SPEED_1000_FOR },

board/keymile/km83xx/km83xx.c int misc_init_r(void) · line 251

Quoted 10 lines
board/keymile/km83xx/km83xx.c +10 -0
+	{ PORT(5), PORT_CTRL, FORWARDING | EGRS_FLD_ALL },
+	/*
+	 * Errata Fix: 1.9V Output from Internal 1.8V Regulator,
+	 * acc . MV-S300889-00D.pdf , clause 4.5
+	 */
+	{ PORT(5), 0x1A, 0xADB1 },
+	/* port 6, unused, this port has no phy */
+	{ PORT(6), PORT_CTRL, PORT_DIS },
+};
+#endif

this chunk introduces a new sparse warning:

Quoted 2 lines

km83xx.c:217:21: warning: symbol 'extsw_conf' was not declared. Should it be static?

Ok. I'll fix this in v2.

Quoted 41 lines
Quoted 41 lines

int last_stage_init(void)
{

board/keymile/km83xx/km83xx.c +39 -0
+#if defined(CONFIG_KMVECT1)
+	struct km_bec_fpga *base =
+		(struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE;
+	u8 tmp_reg;
+
+	/* Release mv88e6122 from reset */
+	tmp_reg = in_8(&base->res1[0]) | 0x10; /* DIRECT3 register */
+	out_8(&base->res1[0], tmp_reg);	       /* GP28 as output */
+	tmp_reg = in_8(&base->gprt3) | 0x10;   /* GP28 to high */
+	out_8(&base->gprt3, tmp_reg);
+
+	/* configure MV88E6122 switch */
+	char *name = "UEC2";
+
+	if (miiphy_set_current_dev(name))
+		return 0;
+
+	mv88e_sw_program(name, CONFIG_KM_MVEXTSW_ADDR, extsw_conf,
+		ARRAY_SIZE(extsw_conf));
+
+	mv88e_sw_reset(name, CONFIG_KM_MVEXTSW_ADDR);
+
+	if (piggy_present()) {
+		uchar enetaddr[6];
+		if (eth_getenv_enetaddr("ethaddr", enetaddr)) {
+			/* increment last 3 bytes */
+			u32 val = (enetaddr[3] << 16) + (enetaddr[4] << 8)
+				+ enetaddr[5];
+			val++;
+			enetaddr[3] = (val >> 16) & 0xFF;
+			enetaddr[4] = (val >>  8) & 0xFF;
+			enetaddr[5] = (val >>  0) & 0xFF;
+			if (!eth_setenv_enetaddr("eth1addr", enetaddr)) {
+				setenv("ethact", "UEC2");
+				setenv("netdev", "eth1");
+				puts("using PIGGY for network boot\n");
+			} else
+				puts("using frontport for network boot\n");
+		}
Quoted 9 lines

board/keymile/km83xx/km83xx.c int misc_init_r(void) · line 297

Quoted 4 lines
board/keymile/km83xx/km83xx.c +4 -0
+	} else
+		puts("using frontport for network boot\n");
+#endif
+

AFAIK, assigning the switch MAC address to the front port's MAC address plus one isn't acceptable practice for u-boot board code. Get eth1addr in the same manner ethaddr is obtained/assigned.

Because you may get a MAC adress which is already given to someone else? In our case this can't happen. We reserve for one instance of this board exactly two MAC adresses. The first one is read out at startup from the inventory in keymile/common/ivm.c. The second one is calculated like above. But it is a unique MAC adress, because exactly this MAC adress is reserved for this board. But maybe we should move the code to the location where we set ethaddr, even if the calculation would be the same?

Quoted 5 lines
Quoted 5 lines
include/configs/km/km83xx-common.h +2 -0
+#if !defined(CONFIG_MPC8309)
 #define CONFIG_UEC_ETH1		/* GETH1 */
 #define UEC_VERBOSE_DEBUG	1
+#endif
Quoted 16 lines

include/configs/km/km83xx-common.h line 179

Quoted 13 lines

#ifdef CONFIG_UEC_ETH1

include/configs/km/km83xx-common.h +0 -6
-#if defined(CONFIG_MPC8309)
-#define CONFIG_SYS_UEC1_UCC_NUM	2	/* UCC3 */
-#define CONFIG_SYS_UEC1_RX_CLK		QE_CLK_NONE /* not used in RMII Mode */
-#define CONFIG_SYS_UEC1_TX_CLK		QE_CLK12
-#else
 #define CONFIG_SYS_UEC1_UCC_NUM	3	/* UCC4 */
 #define CONFIG_SYS_UEC1_RX_CLK		QE_CLK_NONE /* not used in RMII Mode */
 #define CONFIG_SYS_UEC1_TX_CLK		QE_CLK17
-#endif
 #define CONFIG_SYS_UEC1_ETH_TYPE	FAST_ETH
 #define CONFIG_SYS_UEC1_PHY_ADDR	0
 #define CONFIG_SYS_UEC1_INTERFACE_TYPE	PHY_INTERFACE_MODE_RMII

how are these changes related?

kmvect1 is a MPC8309 board and the only board in our board serie with this processor. Without the switch we used more or less the config options from km83xx-common.h. But because of the new functionality we need an completely own configuration. So we moved the remaining stuff in the board specific part for kmvect1.

Regards
Holger

#11 lore raw

PATCH 5/15 powerpc/83xx/km: add MV88E6122 switch support for kmvect1

Quoted 30 lines · On Fri, 18 Jan 2013 10:14:39 +0100 Holger Brunck <[email protected]>…
Quoted 20 lines · Kim Phillips
Quoted 17 lines · On Thu, 17 Jan 2013 13:47:51 +0100 Holger Brunck <[email protected]>…
board/keymile/km83xx/km83xx.c +17 -0
+	if (piggy_present()) {
+		uchar enetaddr[6];
+		if (eth_getenv_enetaddr("ethaddr", enetaddr)) {
+			/* increment last 3 bytes */
+			u32 val = (enetaddr[3] << 16) + (enetaddr[4] << 8)
+				+ enetaddr[5];
+			val++;
+			enetaddr[3] = (val >> 16) & 0xFF;
+			enetaddr[4] = (val >>  8) & 0xFF;
+			enetaddr[5] = (val >>  0) & 0xFF;
+			if (!eth_setenv_enetaddr("eth1addr", enetaddr)) {
+				setenv("ethact", "UEC2");
+				setenv("netdev", "eth1");
+				puts("using PIGGY for network boot\n");
+			} else
+				puts("using frontport for network boot\n");
+		}
Quoted 8 lines

board/keymile/km83xx/km83xx.c int misc_init_r(void) · line 297

Quoted 4 lines
board/keymile/km83xx/km83xx.c +4 -0
+	} else
+		puts("using frontport for network boot\n");
+#endif
+

AFAIK, assigning the switch MAC address to the front port's MAC address plus one isn't acceptable practice for u-boot board code. Get eth1addr in the same manner ethaddr is obtained/assigned.

Quoted 5 lines

Because you may get a MAC adress which is already given to someone else? In our case this can't happen. We reserve for one instance of this board exactly two MAC adresses. The first one is read out at startup from the inventory in keymile/common/ivm.c. The second one is calculated like above. But it is a unique MAC adress, because exactly this MAC adress is reserved for this board.

it can happen if if setting ethaddr from eeprom somehow fails, and/or the user manually modifies ethaddr in the environment.

Quoted 1 line

But maybe we should move the code to the location where we set ethaddr,

yes, indeed

Quoted 1 line

even if the calculation would be the same?

ideally ethaddr and eth1addr would be stored as separate entities in the eeprom.

Kim

#12 lore raw

PATCH 5/15 powerpc/83xx/km: add MV88E6122 switch support for kmvect1

Quoted 39 lines · Kim Phillips
Quoted 30 lines · On Fri, 18 Jan 2013 10:14:39 +0100 Holger Brunck <[email protected]>…
Quoted 20 lines · Kim Phillips
Quoted 17 lines · On Thu, 17 Jan 2013 13:47:51 +0100 Holger Brunck <[email protected]>…
board/keymile/km83xx/km83xx.c +17 -0
+	if (piggy_present()) {
+		uchar enetaddr[6];
+		if (eth_getenv_enetaddr("ethaddr", enetaddr)) {
+			/* increment last 3 bytes */
+			u32 val = (enetaddr[3] << 16) + (enetaddr[4] << 8)
+				+ enetaddr[5];
+			val++;
+			enetaddr[3] = (val >> 16) & 0xFF;
+			enetaddr[4] = (val >>  8) & 0xFF;
+			enetaddr[5] = (val >>  0) & 0xFF;
+			if (!eth_setenv_enetaddr("eth1addr", enetaddr)) {
+				setenv("ethact", "UEC2");
+				setenv("netdev", "eth1");
+				puts("using PIGGY for network boot\n");
+			} else
+				puts("using frontport for network boot\n");
+		}
Quoted 8 lines

board/keymile/km83xx/km83xx.c int misc_init_r(void) · line 297

Quoted 4 lines
board/keymile/km83xx/km83xx.c +4 -0
+	} else
+		puts("using frontport for network boot\n");
+#endif
+

AFAIK, assigning the switch MAC address to the front port's MAC address plus one isn't acceptable practice for u-boot board code. Get eth1addr in the same manner ethaddr is obtained/assigned.

Quoted 5 lines

Because you may get a MAC adress which is already given to someone else? In our case this can't happen. We reserve for one instance of this board exactly two MAC adresses. The first one is read out at startup from the inventory in keymile/common/ivm.c. The second one is calculated like above. But it is a unique MAC adress, because exactly this MAC adress is reserved for this board.

Quoted 7 lines

it can happen if if setting ethaddr from eeprom somehow fails, and/or the user manually modifies ethaddr in the environment.

Quoted 1 line

But maybe we should move the code to the location where we set ethaddr,

yes, indeed

ok I'll move it to this location. Then it's definetely based on the value read from ivm. And it's then easy to check for errors if e.g. the IVM is not readable.

Regards
Holger

#13 lore raw

PATCH 6/15 powerpc/83xx: use ppc_6xx as arch variable for kmvect1

In reply to Holger Brunck

On this board we are using hard floating point, so select the correct toolchain.

---
 include/configs/km/km8309-common.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/configs/km/km8309-common.h +1 -1
index b36e892..7bd1e92 100644
@@ -22,7 +22,7 @@
 #define CONFIG_MPC830x		1	/* MPC830x family */
 #define CONFIG_MPC8309		1	/* MPC8309 CPU specific */
 
-#define CONFIG_KM_DEF_ARCH	"arch=ppc_8xx\0"
+#define CONFIG_KM_DEF_ARCH	"arch=ppc_82xx\0"
 #define CONFIG_CMD_DIAG		1
 
 /* include common defines/options for all 83xx Keymile boards */
Signature · 1 line
1.7.1
#14 lore raw

PATCH 7/15 km/common: introduce $uimage variable

In reply to Holger Brunck

From: Andreas Huber <[email protected]>

Replace the hardcoded string with a variable. If CONFIG_NAND_ECC_BCH is set we use a specific name for the uImage (ecc_bch_uImage).

---
 include/configs/km/keymile-common.h |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
include/configs/km/keymile-common.h +8 -1
index f64748e..ae88759 100644
@@ -148,6 +148,12 @@
 	"ubi part " CONFIG_KM_UBI_PARTITION_NAME_APP "; fi\0"
 #endif /* CONFIG_KM_UBI_PARTITION_NAME_APP */
 
+#ifdef CONFIG_NAND_ECC_BCH
+#define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
+#else
+#define CONFIG_KM_UIMAGE_NAME "uImage\0"
+#endif
+
 /*
  * boottargets
  * - set 'subbootcmds'
@@ -210,9 +216,10 @@
  */
 #define CONFIG_KM_DEF_ENV_FLASH_BOOT					\
 	"cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0"		\
-	"cramfsloadkernel=cramfsload ${load_addr_r} uImage\0"		\
+	"cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0"	\
 	"ubicopy=ubi read "__stringify(CONFIG_KM_CRAMFS_ADDR)		\
 			" bootfs${boot_bank}\0"				\
+	"uimage=" CONFIG_KM_UIMAGE_NAME					\
 	CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
 
 /*
Signature · 1 line
1.7.1
#15 lore raw

PATCH 8/15 km/scripts: replace hardcoded uImage

In reply to Holger Brunck

From: Andreas Huber <[email protected]>

Replace uImage with ${uimage}.
If uimage is not set, default it to uImage.

---
 board/keymile/scripts/develop-common.txt |    5 +++--
 board/keymile/scripts/ramfs-common.txt   |    5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)
board/keymile/scripts/develop-common.txt +3 -2
index aa3d659..a6bb1b1 100644
@@ -1,8 +1,9 @@
 altbootcmd=run ${subbootcmds}
 bootcmd=run ${subbootcmds}
-configure=km_setboardid && saveenv && reset
+configure=run set_uimage; km_setboardid && saveenv && reset
 subbootcmds=tftpfdt tftpkernel nfsargs add_default boot
 nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${toolchain}/${arch}
-tftpkernel=tftpboot ${load_addr_r} ${hostname}/uImage
+tftpkernel=tftpboot ${load_addr_r} ${hostname}/${uimage}
 toolchain=/opt/eldk
 rootfssize=0
+set_uimage=printenv uimage || setenv uimage uImage
board/keymile/scripts/ramfs-common.txt +3 -2
index c1b45ab..8a8d287 100644
@@ -4,8 +4,9 @@ altbootcmd=run ${subbootcmds}
 bootcmd=run ${subbootcmds}
 subbootcmds=tftpfdt tftpkernel setrootfsaddr tftpramfs flashargs add_default addpanic addramfs boot
 nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath}
-configure=km_setboardid && saveenv && reset
+configure=run set_uimage; km_setboardid && saveenv && reset
 rootfsfile=${hostname}/rootfsImage
 setrootfsaddr=setexpr value ${pnvramaddr} - ${rootfssize} && setenv rootfsaddr 0x${value}
-tftpkernel=tftpboot ${load_addr_r} ${hostname}/uImage
+tftpkernel=tftpboot ${load_addr_r} ${hostname}/${uimage}
 tftpramfs=tftpboot ${rootfsaddr} ${hostname}/rootfsImage
+set_uimage=printenv uimage || setenv uimage uImage
Signature · 1 line
1.7.1
#16 lore raw

PATCH 9/15 kmeter1_nand: allow usage of NAND_ECC_SOFT_BCH

In reply to Holger Brunck

If CONFIG_NAND_ECC_BCH is set we use 4-bit error corretion code instead of the 1-bit error correction code on the NAND device within this driver.

---
 drivers/mtd/nand/kmeter1_nand.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/mtd/nand/kmeter1_nand.c +4 -0
index e8e5b7b..f044597 100644
@@ -119,7 +119,11 @@ static int kpn_nand_dev_ready(struct mtd_info *mtd)
 
 int board_nand_init(struct nand_chip *nand)
 {
+#if defined(CONFIG_NAND_ECC_BCH)
+	nand->ecc.mode = NAND_ECC_SOFT_BCH;
+#else
 	nand->ecc.mode = NAND_ECC_SOFT;
+#endif
 
 	/* Reference hardware control function */
 	nand->cmd_ctrl  = kpn_nand_hwcontrol;
Signature · 1 line
1.7.1
#17 lore raw

PATCH 9/15 kmeter1_nand: allow usage of NAND_ECC_SOFT_BCH

Quoted 28 lines · Holger Brunck

If CONFIG_NAND_ECC_BCH is set we use 4-bit error corretion code instead of the 1-bit error correction code on the NAND device within this driver.

---
 drivers/mtd/nand/kmeter1_nand.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/mtd/nand/kmeter1_nand.c +4 -0
index e8e5b7b..f044597 100644
@@ -119,7 +119,11 @@ static int kpn_nand_dev_ready(struct mtd_info  
 *mtd)
 
 int board_nand_init(struct nand_chip *nand)
 {
+#if defined(CONFIG_NAND_ECC_BCH)
+	nand->ecc.mode = NAND_ECC_SOFT_BCH;
+#else
 	nand->ecc.mode = NAND_ECC_SOFT;
+#endif
 
 	/* Reference hardware control function */
Quoted 1 line

nand->cmd_ctrl = kpn_nand_hwcontrol;

-Scott

#18 lore raw

PATCH 10/15 powerpc/83xx: use NAND_ECC_BCH for kmcoge5ne

In reply to Holger Brunck

Switch from 1-bit ecc to 4-bit ecc.

---
 include/configs/km8360.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
include/configs/km8360.h +2 -0
index 7631ab6..5b191bc 100644
@@ -25,6 +25,8 @@
 #define CONFIG_KM_BOARD_NAME	"kmcoge5ne"
 #define CONFIG_KM_DEF_NETDEV	"netdev=eth1\0"
 #define CONFIG_CMD_NAND
+#define CONFIG_NAND_ECC_BCH
+#define CONFIG_BCH
 #define CONFIG_NAND_KMETER1
 #define CONFIG_SYS_MAX_NAND_DEVICE		1
 #define NAND_MAX_CHIPS				1
Signature · 1 line
1.7.1
#19 lore raw

PATCH 11/15 km/common: add eccmode to kernel commandline

In reply to Holger Brunck

If CONFIG_NAND_ECC_BCH is chosen from in the board configuration we add an ecc mode to the kernel commandline.

---
 include/configs/km/keymile-common.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
include/configs/km/keymile-common.h +3 -0
index ae88759..796f330 100644
@@ -150,8 +150,10 @@
 
 #ifdef CONFIG_NAND_ECC_BCH
 #define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
+#define CONFIG_KM_ECC_MODE    " eccmode=bch"
 #else
 #define CONFIG_KM_UIMAGE_NAME "uImage\0"
+#define CONFIG_KM_ECC_MODE
 #endif
 
 /*
@@ -190,6 +192,7 @@
 		":${hostname}:${netdev}:off3"				\
 		" console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}"	\
 		" mem=${kernelmem} init=${init}"			\
+		CONFIG_KM_ECC_MODE					\
 		" phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\
 		" " CONFIG_KM_UBI_LINUX_MTD " "				\
 		CONFIG_KM_DEF_BOOT_ARGS_CPU				\
Signature · 1 line
1.7.1
#20 lore raw

PATCH 12/15 powerpc/83xx/km: cleanup tuxx1 support

In reply to Holger Brunck

This is a preparation for the upcoming kmopti2 board. This board has also a second fpga on board which is different to the tuxx1 target. But we want to use the same header file. So remove the config option KM_DISABLE_APP2 and simply use the board names to distinguish the features.

---
 boards.cfg              |    6 +++---
 include/configs/tuxx1.h |   17 +++++++++--------
 2 files changed, 12 insertions(+), 11 deletions(-)
boards.cfg +3 -3
index e4b0d44..1c78991 100644
@@ -700,9 +700,9 @@ SIMPC8313_SP                 powerpc     mpc83xx     simpc8313           sheldon
 TQM834x                      powerpc     mpc83xx     tqm834x             tqc
 suvd3                        powerpc     mpc83xx     km83xx              keymile        -           suvd3:SUVD3
 kmvect1                      powerpc     mpc83xx     km83xx              keymile        -           suvd3:KMVECT1
-tuge1                        powerpc     mpc83xx     km83xx              keymile        -           tuxx1:KM_DISABLE_APP2,TUGE1
-tuxx1                        powerpc     mpc83xx     km83xx              keymile
-kmsupx5                      powerpc     mpc83xx     km83xx              keymile        -           tuxx1:KM_DISABLE_APP2,KMSUPX5
+tuge1                        powerpc     mpc83xx     km83xx              keymile        -           tuxx1:TUGE1
+tuxx1                        powerpc     mpc83xx     km83xx              keymile        -           tuxx1:TUXX1
+kmsupx5                      powerpc     mpc83xx     km83xx              keymile        -           tuxx1:KMSUPX5
 sbc8548                      powerpc     mpc85xx     sbc8548             -              -           sbc8548
 sbc8548_PCI_33               powerpc     mpc85xx     sbc8548             -              -           sbc8548:PCI,33
 sbc8548_PCI_33_PCIE          powerpc     mpc85xx     sbc8548             -              -           sbc8548:PCI,33,PCIE
include/configs/tuxx1.h +9 -8
index 90d2e61..3997717 100644
@@ -11,7 +11,7 @@
  * (C) Copyright 2008
  * Heiko Schocher, DENX Software Engineering, hs at denx.de.
  *
- * (C) Copyright 2010-2012
+ * (C) Copyright 2010-2013
  * Lukas Roggli, KEYMILE Ltd, lukas.roggli at keymile.com
  * Holger Brunck,  Keymile GmbH, holger.bruncl at keymile.com
  *
@@ -27,16 +27,17 @@
 /*
  * High Level Configuration Options
  */
-#ifdef CONFIG_KMSUPX5
+#if defined(CONFIG_KMSUPX5)
 #define CONFIG_KM_BOARD_NAME	"kmsupx5"
 #define CONFIG_HOSTNAME		kmsupx5
-#elif defined CONFIG_TUGE1
+#elif defined(CONFIG_TUGE1)
 #define CONFIG_KM_BOARD_NAME	"tuge1"
 #define CONFIG_HOSTNAME		tuge1
-#else
-#define CONFIG_TUXXX		/* TUXX1 board (tuxa1/tuda1) specific */
+#elif defined(CONFIG_TUXX1)	/* TUXX1 board (tuxa1/tuda1) specific */
 #define CONFIG_KM_BOARD_NAME	"tuxx1"
 #define CONFIG_HOSTNAME		tuxx1
+#else
+#error ("Board not supported")
 #endif
 
 #define	CONFIG_SYS_TEXT_BASE	0xF0000000
@@ -46,7 +47,7 @@
 
 #define CONFIG_SYS_APP1_BASE	0xA0000000    /* PAXG */
 #define	CONFIG_SYS_APP1_SIZE	256 /* Megabytes */
-#ifndef CONFIG_KM_DISABLE_APP2
+#if defined(CONFIG_TUXX1)
 #define CONFIG_SYS_APP2_BASE	0xB0000000    /* PINC3 */
 #define	CONFIG_SYS_APP2_SIZE	256 /* Megabytes */
 #endif
@@ -81,7 +82,7 @@
 				 OR_GPCM_TRLX_SET | \
 				 OR_GPCM_EHTR_CLEAR | \
 				 OR_GPCM_EAD)
-#ifndef CONFIG_KM_DISABLE_APP2
+#if defined(CONFIG_TUXX1)
 /*
  * Configuration for C3 on the local bus
  */
@@ -125,7 +126,7 @@
 				 BATL_GUARDEDSTORAGE)
 #define CONFIG_SYS_DBAT5U	CONFIG_SYS_IBAT5U
 
-#ifdef CONFIG_KM_DISABLE_APP2
+#if defined(CONFIG_TUGE1) || defined(CONFIG_KMSUPX5)
 #define CONFIG_SYS_IBAT6L	(0)
 #define CONFIG_SYS_IBAT6U	(0)
 #define CONFIG_SYS_DBAT6L	CONFIG_SYS_IBAT6L
Signature · 1 line
1.7.1
#21 lore raw

PATCH 13/15 powerpc/83xx/km: add support for kmopti2 board

In reply to Holger Brunck

This board is similar to TUXX1 but it has a different sized second FPGA. Therefore the configuration for the third chipselect is different.

---
 boards.cfg              |    1 +
 include/configs/tuxx1.h |   31 +++++++++++++++++++++++++------
 2 files changed, 26 insertions(+), 6 deletions(-)
boards.cfg +1 -0
index 1c78991..01acf19 100644
@@ -702,6 +702,7 @@ suvd3                        powerpc     mpc83xx     km83xx              keymile
 kmvect1                      powerpc     mpc83xx     km83xx              keymile        -           suvd3:KMVECT1
 tuge1                        powerpc     mpc83xx     km83xx              keymile        -           tuxx1:TUGE1
 tuxx1                        powerpc     mpc83xx     km83xx              keymile        -           tuxx1:TUXX1
+kmopti2                      powerpc     mpc83xx     km83xx              keymile        -           tuxx1:KMOPTI2
 kmsupx5                      powerpc     mpc83xx     km83xx              keymile        -           tuxx1:KMSUPX5
 sbc8548                      powerpc     mpc85xx     sbc8548             -              -           sbc8548
 sbc8548_PCI_33               powerpc     mpc85xx     sbc8548             -              -           sbc8548:PCI,33
include/configs/tuxx1.h +25 -6
index 3997717..6caf23a 100644
@@ -36,6 +36,9 @@
 #elif defined(CONFIG_TUXX1)	/* TUXX1 board (tuxa1/tuda1) specific */
 #define CONFIG_KM_BOARD_NAME	"tuxx1"
 #define CONFIG_HOSTNAME		tuxx1
+#elif defined(CONFIG_KMOPTI2)
+#define CONFIG_KM_BOARD_NAME	"kmopti2"
+#define CONFIG_HOSTNAME		kmopti2
 #else
 #error ("Board not supported")
 #endif
@@ -47,18 +50,18 @@
 
 #define CONFIG_SYS_APP1_BASE	0xA0000000    /* PAXG */
 #define	CONFIG_SYS_APP1_SIZE	256 /* Megabytes */
-#if defined(CONFIG_TUXX1)
+#if defined(CONFIG_TUXX1) || defined(CONFIG_KMOPTI2)
 #define CONFIG_SYS_APP2_BASE	0xB0000000    /* PINC3 */
 #define	CONFIG_SYS_APP2_SIZE	256 /* Megabytes */
 #endif
 
 /*
  * Init Local Bus Memory Controller:
- *
- * Bank Bus     Machine PortSz  Size  Device on TUDA1  TUXA1  TUGE1   KMSUPX4
- * ---- ---     ------- ------  -----  ---------------------------------------
- *  2   Local   GPCM    8 bit  256MB	         PAXG  LPXF   PAXI     LPXF
- *  3   Local   GPCM    8 bit  256MB	         PINC3 PINC2  unused   unused
+ *				      Device on
+ * Bank Bus     Machine PortSz  Size  TUDA1  TUXA1  TUGE1  KMSUPX4 KMOPTI2
+ * ---- ---     ------- ------  ----- ---------------------------------------
+ *  2   Local   GPCM    8 bit  256MB  PAXG  LPXF   PAXI     LPXF   PAXE
+ *  3   Local   GPCM    8 bit  256MB  PINC3 PINC2  unused  unused  OPI2(16 bit)
  *
  */
 
@@ -108,6 +111,22 @@
 				 MxMR_WLFx_2X)
 #endif
 
+#if defined(CONFIG_KMOPTI2)
+/*
+ * Configuration for C3 on the local bus
+ */
+#define CONFIG_SYS_LBLAWBAR3_PRELIM	CONFIG_SYS_APP2_BASE
+#define CONFIG_SYS_LBLAWAR3_PRELIM	(LBLAWAR_EN | LBLAWAR_256MB)
+#define CONFIG_SYS_BR3_PRELIM	(CONFIG_SYS_APP2_BASE | \
+				 BR_PS_16 |		\
+				 BR_MS_GPCM |		\
+				 BR_V)
+#define CONFIG_SYS_OR3_PRELIM	(MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
+				 OR_GPCM_SCY_4 | \
+				 OR_GPCM_TRLX_CLEAR | \
+				 OR_GPCM_EHTR_CLEAR)
+#endif
+
 /*
  * MMU Setup
  */
Signature · 1 line
1.7.1
#22 lore raw

PATCH 14/15 poweprc/83xx/km: remove uneeded CONFIG_MISC_INIT_R

In reply to Holger Brunck

Remove it from the processor specific headers. This is already defined in the common header km83xx.h.

---
 include/configs/km/km8309-common.h |    2 --
 include/configs/km/km8321-common.h |    2 --
 2 files changed, 0 insertions(+), 4 deletions(-)
include/configs/km/km8309-common.h +0 -2
index 7bd1e92..7f9cffa 100644
@@ -33,8 +33,6 @@
 /* at end of uboot partition, before env */
 #define CONFIG_SYS_QE_FMAN_FW_ADDR   0xF00B0000
 
-#define CONFIG_MISC_INIT_R
-
 /*
  * System IO Config
  */
include/configs/km/km8321-common.h +0 -2
index 8ad6fc3..abb9081 100644
@@ -38,8 +38,6 @@
 /* include common defines/options for all 83xx Keymile boards */
 #include "km83xx-common.h"
 
-#define CONFIG_MISC_INIT_R
-
 /*
  * System IO Config
  */
Signature · 1 line
1.7.1
#23 lore raw

PATCH 15/15 powerpc/83xx/km: drop uneeded dtt_bus environment var

In reply to Holger Brunck

Do this with a define. There is no need for this as a environment variable.

---
 board/keymile/km83xx/km83xx.c      |   12 ++++--------
 include/configs/km/km83xx-common.h |    1 -
 2 files changed, 4 insertions(+), 9 deletions(-)
board/keymile/km83xx/km83xx.c +4 -8
index 0907195..534acc7 100644
@@ -98,17 +98,13 @@ const qe_iop_conf_t qe_iop_conf_tab[] = {
 static int board_init_i2c_busses(void)
 {
 	I2C_MUX_DEVICE *dev = NULL;
-	uchar	*buf;
+	uchar *dtt_bus = (uchar *)"pca9547:70:a";
 
 	/* Set up the Bus for the DTTs */
-	buf = (unsigned char *) getenv("dtt_bus");
-	if (buf != NULL)
-		dev = i2c_mux_ident_muxstring(buf);
-	if (dev == NULL) {
+	dev = i2c_mux_ident_muxstring(dtt_bus);
+	if (dev == NULL)
 		printf("Error couldn't add Bus for DTT\n");
-		printf("please setup dtt_bus to where your\n");
-		printf("DTT is found.\n");
-	}
+
 	return 0;
 }
 
include/configs/km/km83xx-common.h +0 -1
index 1e596c8..eb0e5b6 100644
@@ -312,7 +312,6 @@
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	CONFIG_KM_DEF_ENV						\
 	CONFIG_KM_DEF_ARCH						\
-	"dtt_bus=pca9547:70:a\0"					\
 	"EEprom_ivm=pca9547:70:9\0"					\
 	"newenv="							\
 		"prot off 0xF00C0000 +0x40000 && "			\
Signature · 1 line
1.7.1
#24 lore raw

cover updates for km83xx boards

In reply to Holger Brunck
Quoted 10 lines

-----Original Message-----
From: u-boot-bounces at lists.denx.de [mailto:u-boot- bounces at lists.denx.de] On Behalf Of Holger Brunck
Sent: 17 January 2013 18:18
To: u-boot at lists.denx.de
Cc: Kim Phillips; Holger Brunck
Subject: [U-Boot] [PATCH 00/15] updates for km83xx boards

Quoted 8 lines

Hi Kim,
here are some updates for our km83xx board support and some patches for our
common code. In generic u-boot code there is only one small change in the driver
for kmeter1_nand which is currently only used from our boards. If I should
seperate this one from this serie then let me know.

Dear Holger

If those patched are not for mainlining purpose then should be labelled as RFC or some similar?

Regards...
Prafulla . . .

#25 lore raw

cover updates for km83xx boards

Hi,

Quoted 17 lines · Prafulla Wadaskar
Quoted 8 lines

-----Original Message-----
From: u-boot-bounces at lists.denx.de [mailto:u-boot- bounces at lists.denx.de] On Behalf Of Holger Brunck
Sent: 17 January 2013 18:18
To: u-boot at lists.denx.de
Cc: Kim Phillips; Holger Brunck
Subject: [U-Boot] [PATCH 00/15] updates for km83xx boards

Quoted 8 lines

Hi Kim,
here are some updates for our km83xx board support and some patches for our
common code. In generic u-boot code there is only one small change in the driver
for kmeter1_nand which is currently only used from our boards. If I should
seperate this one from this serie then let me know.

Quoted 4 lines

Dear Holger

If those patched are not for mainlining purpose then should be labelled as RFC or some similar?

why do you think that they are not meant to be send for mainline inclusion? Of course they are send to get into mainline.

Regards
Holger