public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 00/15] updates for km83xx boards
@ 2013-01-17 12:47 Holger Brunck
  2013-01-17 12:47 ` [U-Boot] [PATCH 01/15] km/common: remove unneeded ifdefs for I2C Holger Brunck
                   ` (15 more replies)
  0 siblings, 16 replies; 26+ messages in thread
From: Holger Brunck @ 2013-01-17 12:47 UTC (permalink / raw)
  To: u-boot

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(-)

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 01/15] km/common: remove unneeded ifdefs for I2C
  2013-01-17 12:47 [U-Boot] [PATCH 00/15] updates for km83xx boards Holger Brunck
@ 2013-01-17 12:47 ` Holger Brunck
  2013-01-17 12:47 ` [U-Boot] [PATCH 02/15] km/common/ivm: remove obsolete code Holger Brunck
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 26+ messages in thread
From: Holger Brunck @ 2013-01-17 12:47 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
---
 board/keymile/common/common.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 6f407b7..468c755 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -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);
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 02/15] km/common/ivm: remove obsolete code
  2013-01-17 12:47 [U-Boot] [PATCH 00/15] updates for km83xx boards Holger Brunck
  2013-01-17 12:47 ` [U-Boot] [PATCH 01/15] km/common: remove unneeded ifdefs for I2C Holger Brunck
@ 2013-01-17 12:47 ` Holger Brunck
  2013-01-17 12:47 ` [U-Boot] [PATCH 03/15] km/common/ivm: remove CONFIG_SYS_I2C_IVM_BUS related code Holger Brunck
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 26+ messages in thread
From: Holger Brunck @ 2013-01-17 12:47 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
---
 board/keymile/common/ivm.c |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/board/keymile/common/ivm.c b/board/keymile/common/ivm.c
index eaa924f..7fe3b0f 100644
--- a/board/keymile/common/ivm.c
+++ b/board/keymile/common/ivm.c
@@ -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();
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 03/15] km/common/ivm: remove CONFIG_SYS_I2C_IVM_BUS related code
  2013-01-17 12:47 [U-Boot] [PATCH 00/15] updates for km83xx boards Holger Brunck
  2013-01-17 12:47 ` [U-Boot] [PATCH 01/15] km/common: remove unneeded ifdefs for I2C Holger Brunck
  2013-01-17 12:47 ` [U-Boot] [PATCH 02/15] km/common/ivm: remove obsolete code Holger Brunck
@ 2013-01-17 12:47 ` Holger Brunck
  2013-01-17 12:47 ` [U-Boot] [PATCH 04/15] km82xx, km83xx: move ethernet_present() from common to cpu specific Holger Brunck
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 26+ messages in thread
From: Holger Brunck @ 2013-01-17 12:47 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
---
 board/keymile/common/ivm.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/board/keymile/common/ivm.c b/board/keymile/common/ivm.c
index 7fe3b0f..607daa6 100644
--- a/board/keymile/common/ivm.c
+++ b/board/keymile/common/ivm.c
@@ -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;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 04/15] km82xx, km83xx: move ethernet_present() from common to cpu specific
  2013-01-17 12:47 [U-Boot] [PATCH 00/15] updates for km83xx boards Holger Brunck
                   ` (2 preceding siblings ...)
  2013-01-17 12:47 ` [U-Boot] [PATCH 03/15] km/common/ivm: remove CONFIG_SYS_I2C_IVM_BUS related code Holger Brunck
@ 2013-01-17 12:47 ` Holger Brunck
  2013-01-18  0:23   ` Kim Phillips
  2013-01-17 12:47 ` [U-Boot] [PATCH 05/15] powerpc/83xx/km: add MV88E6122 switch support for kmvect1 Holger Brunck
                   ` (11 subsequent siblings)
  15 siblings, 1 reply; 26+ messages in thread
From: Holger Brunck @ 2013-01-17 12:47 UTC (permalink / raw)
  To: u-boot

From: Karlheinz Jerg <karlheinz.jerg@keymile.com>

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.

Signed-off-by: Karlheinz Jerg <karlheinz.jerg@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
---
 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(-)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 468c755..ef93ed3 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -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())
diff --git a/board/keymile/km82xx/km82xx.c b/board/keymile/km82xx/km82xx.c
index 67b69f6..defc885 100644
--- a/board/keymile/km82xx/km82xx.c
+++ b/board/keymile/km82xx/km82xx.c
@@ -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.
  */
diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c
index 83a8753..26e682b 100644
--- a/board/keymile/km83xx/km83xx.c
+++ b/board/keymile/km83xx/km83xx.c
@@ -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;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 05/15] powerpc/83xx/km: add MV88E6122 switch support for kmvect1
  2013-01-17 12:47 [U-Boot] [PATCH 00/15] updates for km83xx boards Holger Brunck
                   ` (3 preceding siblings ...)
  2013-01-17 12:47 ` [U-Boot] [PATCH 04/15] km82xx, km83xx: move ethernet_present() from common to cpu specific Holger Brunck
@ 2013-01-17 12:47 ` Holger Brunck
  2013-01-18  0:44   ` Kim Phillips
  2013-01-17 12:47 ` [U-Boot] [PATCH 06/15] powerpc/83xx: use ppc_6xx as arch variable " Holger Brunck
                   ` (10 subsequent siblings)
  15 siblings, 1 reply; 26+ messages in thread
From: Holger Brunck @ 2013-01-17 12:47 UTC (permalink / raw)
  To: u-boot

From: Karlheinz Jerg <karlheinz.jerg@keymile.com>

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.

Signed-off-by: Karlheinz Jerg <karlheinz.jerg@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
---
 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(-)

diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c
index 26e682b..0907195 100644
--- a/board/keymile/km83xx/km83xx.c
+++ b/board/keymile/km83xx/km83xx.c
@@ -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;
diff --git a/include/configs/km/km83xx-common.h b/include/configs/km/km83xx-common.h
index a9823d6..1e596c8 100644
--- a/include/configs/km/km83xx-common.h
+++ b/include/configs/km/km83xx-common.h
@@ -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
diff --git a/include/configs/suvd3.h b/include/configs/suvd3.h
index c50832c..bbf9da5 100644
--- a/include/configs/suvd3.h
+++ b/include/configs/suvd3.h
@@ -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 */
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 06/15] powerpc/83xx: use ppc_6xx as arch variable for kmvect1
  2013-01-17 12:47 [U-Boot] [PATCH 00/15] updates for km83xx boards Holger Brunck
                   ` (4 preceding siblings ...)
  2013-01-17 12:47 ` [U-Boot] [PATCH 05/15] powerpc/83xx/km: add MV88E6122 switch support for kmvect1 Holger Brunck
@ 2013-01-17 12:47 ` Holger Brunck
  2013-01-17 12:47 ` [U-Boot] [PATCH 07/15] km/common: introduce $uimage variable Holger Brunck
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 26+ messages in thread
From: Holger Brunck @ 2013-01-17 12:47 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
---
 include/configs/km/km8309-common.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/configs/km/km8309-common.h b/include/configs/km/km8309-common.h
index b36e892..7bd1e92 100644
--- a/include/configs/km/km8309-common.h
+++ b/include/configs/km/km8309-common.h
@@ -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 */
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 07/15] km/common: introduce $uimage variable
  2013-01-17 12:47 [U-Boot] [PATCH 00/15] updates for km83xx boards Holger Brunck
                   ` (5 preceding siblings ...)
  2013-01-17 12:47 ` [U-Boot] [PATCH 06/15] powerpc/83xx: use ppc_6xx as arch variable " Holger Brunck
@ 2013-01-17 12:47 ` Holger Brunck
  2013-01-17 12:47 ` [U-Boot] [PATCH 08/15] km/scripts: replace hardcoded uImage Holger Brunck
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 26+ messages in thread
From: Holger Brunck @ 2013-01-17 12:47 UTC (permalink / raw)
  To: u-boot

From: Andreas Huber <andreas.huber@keymile.com>

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).

Signed-off-by: Andreas Huber <andreas.huber@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
---
 include/configs/km/keymile-common.h |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/include/configs/km/keymile-common.h b/include/configs/km/keymile-common.h
index f64748e..ae88759 100644
--- a/include/configs/km/keymile-common.h
+++ b/include/configs/km/keymile-common.h
@@ -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
 
 /*
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 08/15] km/scripts: replace hardcoded uImage
  2013-01-17 12:47 [U-Boot] [PATCH 00/15] updates for km83xx boards Holger Brunck
                   ` (6 preceding siblings ...)
  2013-01-17 12:47 ` [U-Boot] [PATCH 07/15] km/common: introduce $uimage variable Holger Brunck
@ 2013-01-17 12:47 ` Holger Brunck
  2013-01-17 12:47 ` [U-Boot] [PATCH 09/15] kmeter1_nand: allow usage of NAND_ECC_SOFT_BCH Holger Brunck
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 26+ messages in thread
From: Holger Brunck @ 2013-01-17 12:47 UTC (permalink / raw)
  To: u-boot

From: Andreas Huber <andreas.huber@keymile.com>

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

Signed-off-by: Andreas Huber <andreas.huber@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
---
 board/keymile/scripts/develop-common.txt |    5 +++--
 board/keymile/scripts/ramfs-common.txt   |    5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/board/keymile/scripts/develop-common.txt b/board/keymile/scripts/develop-common.txt
index aa3d659..a6bb1b1 100644
--- a/board/keymile/scripts/develop-common.txt
+++ b/board/keymile/scripts/develop-common.txt
@@ -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
diff --git a/board/keymile/scripts/ramfs-common.txt b/board/keymile/scripts/ramfs-common.txt
index c1b45ab..8a8d287 100644
--- a/board/keymile/scripts/ramfs-common.txt
+++ b/board/keymile/scripts/ramfs-common.txt
@@ -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
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 09/15] kmeter1_nand: allow usage of NAND_ECC_SOFT_BCH
  2013-01-17 12:47 [U-Boot] [PATCH 00/15] updates for km83xx boards Holger Brunck
                   ` (7 preceding siblings ...)
  2013-01-17 12:47 ` [U-Boot] [PATCH 08/15] km/scripts: replace hardcoded uImage Holger Brunck
@ 2013-01-17 12:47 ` Holger Brunck
  2013-01-17 16:00   ` Scott Wood
  2013-01-17 12:47 ` [U-Boot] [PATCH 10/15] powerpc/83xx: use NAND_ECC_BCH for kmcoge5ne Holger Brunck
                   ` (6 subsequent siblings)
  15 siblings, 1 reply; 26+ messages in thread
From: Holger Brunck @ 2013-01-17 12:47 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
cc: Scott Wood <scottwood@freescale.com>

---
 drivers/mtd/nand/kmeter1_nand.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/kmeter1_nand.c b/drivers/mtd/nand/kmeter1_nand.c
index e8e5b7b..f044597 100644
--- a/drivers/mtd/nand/kmeter1_nand.c
+++ b/drivers/mtd/nand/kmeter1_nand.c
@@ -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;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 10/15] powerpc/83xx: use NAND_ECC_BCH for kmcoge5ne
  2013-01-17 12:47 [U-Boot] [PATCH 00/15] updates for km83xx boards Holger Brunck
                   ` (8 preceding siblings ...)
  2013-01-17 12:47 ` [U-Boot] [PATCH 09/15] kmeter1_nand: allow usage of NAND_ECC_SOFT_BCH Holger Brunck
@ 2013-01-17 12:47 ` Holger Brunck
  2013-01-17 12:47 ` [U-Boot] [PATCH 11/15] km/common: add eccmode to kernel commandline Holger Brunck
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 26+ messages in thread
From: Holger Brunck @ 2013-01-17 12:47 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
---
 include/configs/km8360.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/configs/km8360.h b/include/configs/km8360.h
index 7631ab6..5b191bc 100644
--- a/include/configs/km8360.h
+++ b/include/configs/km8360.h
@@ -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
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 11/15] km/common: add eccmode to kernel commandline
  2013-01-17 12:47 [U-Boot] [PATCH 00/15] updates for km83xx boards Holger Brunck
                   ` (9 preceding siblings ...)
  2013-01-17 12:47 ` [U-Boot] [PATCH 10/15] powerpc/83xx: use NAND_ECC_BCH for kmcoge5ne Holger Brunck
@ 2013-01-17 12:47 ` Holger Brunck
  2013-01-17 12:47 ` [U-Boot] [PATCH 12/15] powerpc/83xx/km: cleanup tuxx1 support Holger Brunck
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 26+ messages in thread
From: Holger Brunck @ 2013-01-17 12:47 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
---
 include/configs/km/keymile-common.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/configs/km/keymile-common.h b/include/configs/km/keymile-common.h
index ae88759..796f330 100644
--- a/include/configs/km/keymile-common.h
+++ b/include/configs/km/keymile-common.h
@@ -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				\
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 12/15] powerpc/83xx/km: cleanup tuxx1 support
  2013-01-17 12:47 [U-Boot] [PATCH 00/15] updates for km83xx boards Holger Brunck
                   ` (10 preceding siblings ...)
  2013-01-17 12:47 ` [U-Boot] [PATCH 11/15] km/common: add eccmode to kernel commandline Holger Brunck
@ 2013-01-17 12:47 ` Holger Brunck
  2013-01-17 12:47 ` [U-Boot] [PATCH 13/15] powerpc/83xx/km: add support for kmopti2 board Holger Brunck
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 26+ messages in thread
From: Holger Brunck @ 2013-01-17 12:47 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
---
 boards.cfg              |    6 +++---
 include/configs/tuxx1.h |   17 +++++++++--------
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/boards.cfg b/boards.cfg
index e4b0d44..1c78991 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -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
diff --git a/include/configs/tuxx1.h b/include/configs/tuxx1.h
index 90d2e61..3997717 100644
--- a/include/configs/tuxx1.h
+++ b/include/configs/tuxx1.h
@@ -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
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 13/15] powerpc/83xx/km: add support for kmopti2 board
  2013-01-17 12:47 [U-Boot] [PATCH 00/15] updates for km83xx boards Holger Brunck
                   ` (11 preceding siblings ...)
  2013-01-17 12:47 ` [U-Boot] [PATCH 12/15] powerpc/83xx/km: cleanup tuxx1 support Holger Brunck
@ 2013-01-17 12:47 ` Holger Brunck
  2013-01-17 12:48 ` [U-Boot] [PATCH 14/15] poweprc/83xx/km: remove uneeded CONFIG_MISC_INIT_R Holger Brunck
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 26+ messages in thread
From: Holger Brunck @ 2013-01-17 12:47 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
---
 boards.cfg              |    1 +
 include/configs/tuxx1.h |   31 +++++++++++++++++++++++++------
 2 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/boards.cfg b/boards.cfg
index 1c78991..01acf19 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -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
diff --git a/include/configs/tuxx1.h b/include/configs/tuxx1.h
index 3997717..6caf23a 100644
--- a/include/configs/tuxx1.h
+++ b/include/configs/tuxx1.h
@@ -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
  */
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 14/15] poweprc/83xx/km: remove uneeded CONFIG_MISC_INIT_R
  2013-01-17 12:47 [U-Boot] [PATCH 00/15] updates for km83xx boards Holger Brunck
                   ` (12 preceding siblings ...)
  2013-01-17 12:47 ` [U-Boot] [PATCH 13/15] powerpc/83xx/km: add support for kmopti2 board Holger Brunck
@ 2013-01-17 12:48 ` Holger Brunck
  2013-01-17 12:48 ` [U-Boot] [PATCH 15/15] powerpc/83xx/km: drop uneeded dtt_bus environment var Holger Brunck
  2013-01-17 14:30 ` [U-Boot] [PATCH 00/15] updates for km83xx boards Prafulla Wadaskar
  15 siblings, 0 replies; 26+ messages in thread
From: Holger Brunck @ 2013-01-17 12:48 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
---
 include/configs/km/km8309-common.h |    2 --
 include/configs/km/km8321-common.h |    2 --
 2 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/include/configs/km/km8309-common.h b/include/configs/km/km8309-common.h
index 7bd1e92..7f9cffa 100644
--- a/include/configs/km/km8309-common.h
+++ b/include/configs/km/km8309-common.h
@@ -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
  */
diff --git a/include/configs/km/km8321-common.h b/include/configs/km/km8321-common.h
index 8ad6fc3..abb9081 100644
--- a/include/configs/km/km8321-common.h
+++ b/include/configs/km/km8321-common.h
@@ -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
  */
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 15/15] powerpc/83xx/km: drop uneeded dtt_bus environment var
  2013-01-17 12:47 [U-Boot] [PATCH 00/15] updates for km83xx boards Holger Brunck
                   ` (13 preceding siblings ...)
  2013-01-17 12:48 ` [U-Boot] [PATCH 14/15] poweprc/83xx/km: remove uneeded CONFIG_MISC_INIT_R Holger Brunck
@ 2013-01-17 12:48 ` Holger Brunck
  2013-01-17 14:30 ` [U-Boot] [PATCH 00/15] updates for km83xx boards Prafulla Wadaskar
  15 siblings, 0 replies; 26+ messages in thread
From: Holger Brunck @ 2013-01-17 12:48 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
---
 board/keymile/km83xx/km83xx.c      |   12 ++++--------
 include/configs/km/km83xx-common.h |    1 -
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c
index 0907195..534acc7 100644
--- a/board/keymile/km83xx/km83xx.c
+++ b/board/keymile/km83xx/km83xx.c
@@ -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;
 }
 
diff --git a/include/configs/km/km83xx-common.h b/include/configs/km/km83xx-common.h
index 1e596c8..eb0e5b6 100644
--- a/include/configs/km/km83xx-common.h
+++ b/include/configs/km/km83xx-common.h
@@ -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 && "			\
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 00/15] updates for km83xx boards
  2013-01-17 12:47 [U-Boot] [PATCH 00/15] updates for km83xx boards Holger Brunck
                   ` (14 preceding siblings ...)
  2013-01-17 12:48 ` [U-Boot] [PATCH 15/15] powerpc/83xx/km: drop uneeded dtt_bus environment var Holger Brunck
@ 2013-01-17 14:30 ` Prafulla Wadaskar
  2013-01-17 14:35   ` Holger Brunck
  15 siblings, 1 reply; 26+ messages in thread
From: Prafulla Wadaskar @ 2013-01-17 14:30 UTC (permalink / raw)
  To: u-boot



> -----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
> 
> 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 . . .

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 00/15] updates for km83xx boards
  2013-01-17 14:30 ` [U-Boot] [PATCH 00/15] updates for km83xx boards Prafulla Wadaskar
@ 2013-01-17 14:35   ` Holger Brunck
  0 siblings, 0 replies; 26+ messages in thread
From: Holger Brunck @ 2013-01-17 14:35 UTC (permalink / raw)
  To: u-boot

Hi,

On 01/17/2013 03:30 PM, Prafulla Wadaskar wrote:
>> -----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
>>
>> 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?
> 

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

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 09/15] kmeter1_nand: allow usage of NAND_ECC_SOFT_BCH
  2013-01-17 12:47 ` [U-Boot] [PATCH 09/15] kmeter1_nand: allow usage of NAND_ECC_SOFT_BCH Holger Brunck
@ 2013-01-17 16:00   ` Scott Wood
  0 siblings, 0 replies; 26+ messages in thread
From: Scott Wood @ 2013-01-17 16:00 UTC (permalink / raw)
  To: u-boot

On 01/17/2013 06:47:55 AM, Holger Brunck wrote:
> 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.
> 
> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
> cc: Scott Wood <scottwood@freescale.com>
> 
> ---
>  drivers/mtd/nand/kmeter1_nand.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mtd/nand/kmeter1_nand.c  
> b/drivers/mtd/nand/kmeter1_nand.c
> index e8e5b7b..f044597 100644
> --- a/drivers/mtd/nand/kmeter1_nand.c
> +++ b/drivers/mtd/nand/kmeter1_nand.c
> @@ -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;

Acked-by: Scott Wood <scottwood@freescale.com>

-Scott

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 04/15] km82xx, km83xx: move ethernet_present() from common to cpu specific
  2013-01-17 12:47 ` [U-Boot] [PATCH 04/15] km82xx, km83xx: move ethernet_present() from common to cpu specific Holger Brunck
@ 2013-01-18  0:23   ` Kim Phillips
  2013-01-18  8:07     ` Holger Brunck
  0 siblings, 1 reply; 26+ messages in thread
From: Kim Phillips @ 2013-01-18  0:23 UTC (permalink / raw)
  To: u-boot

On Thu, 17 Jan 2013 13:47:50 +0100
Holger Brunck <holger.brunck@keymile.com> wrote:

> +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

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 05/15] powerpc/83xx/km: add MV88E6122 switch support for kmvect1
  2013-01-17 12:47 ` [U-Boot] [PATCH 05/15] powerpc/83xx/km: add MV88E6122 switch support for kmvect1 Holger Brunck
@ 2013-01-18  0:44   ` Kim Phillips
  2013-01-18  9:14     ` Holger Brunck
  0 siblings, 1 reply; 26+ messages in thread
From: Kim Phillips @ 2013-01-18  0:44 UTC (permalink / raw)
  To: u-boot

On Thu, 17 Jan 2013 13:47:51 +0100
Holger Brunck <holger.brunck@keymile.com> wrote:

> +#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

this chunk introduces a new sparse warning:

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

>  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
> +

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.

> +#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

how are these changes related?

Kim

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 04/15] km82xx, km83xx: move ethernet_present() from common to cpu specific
  2013-01-18  0:23   ` Kim Phillips
@ 2013-01-18  8:07     ` Holger Brunck
  2013-01-18 21:09       ` Kim Phillips
  0 siblings, 1 reply; 26+ messages in thread
From: Holger Brunck @ 2013-01-18  8:07 UTC (permalink / raw)
  To: u-boot

On 01/18/2013 01:23 AM, Kim Phillips wrote:
> On Thu, 17 Jan 2013 13:47:50 +0100
> Holger Brunck <holger.brunck@keymile.com> wrote:
> 
>> +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'.
> 

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

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 05/15] powerpc/83xx/km: add MV88E6122 switch support for kmvect1
  2013-01-18  0:44   ` Kim Phillips
@ 2013-01-18  9:14     ` Holger Brunck
  2013-01-18 21:12       ` Kim Phillips
  0 siblings, 1 reply; 26+ messages in thread
From: Holger Brunck @ 2013-01-18  9:14 UTC (permalink / raw)
  To: u-boot

On 01/18/2013 01:44 AM, Kim Phillips wrote:
> On Thu, 17 Jan 2013 13:47:51 +0100
> Holger Brunck <holger.brunck@keymile.com> wrote:
> 
>> +#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
> 
> this chunk introduces a new sparse warning:
> 
> km83xx.c:217:21: warning: symbol 'extsw_conf' was not declared. Should it be static?
> 

Ok. I'll fix this in v2.

>>  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
>> +
> 
> 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?

>> +#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
> 
> 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

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 04/15] km82xx, km83xx: move ethernet_present() from common to cpu specific
  2013-01-18  8:07     ` Holger Brunck
@ 2013-01-18 21:09       ` Kim Phillips
  0 siblings, 0 replies; 26+ messages in thread
From: Kim Phillips @ 2013-01-18 21:09 UTC (permalink / raw)
  To: u-boot

On Fri, 18 Jan 2013 09:07:32 +0100
Holger Brunck <holger.brunck@keymile.com> wrote:

> On 01/18/2013 01:23 AM, Kim Phillips wrote:
> > On Thu, 17 Jan 2013 13:47:50 +0100
> > Holger Brunck <holger.brunck@keymile.com> wrote:
> > 
> >> +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'.
> > 
> 
> 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

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 05/15] powerpc/83xx/km: add MV88E6122 switch support for kmvect1
  2013-01-18  9:14     ` Holger Brunck
@ 2013-01-18 21:12       ` Kim Phillips
  2013-01-21  9:45         ` Holger Brunck
  0 siblings, 1 reply; 26+ messages in thread
From: Kim Phillips @ 2013-01-18 21:12 UTC (permalink / raw)
  To: u-boot

On Fri, 18 Jan 2013 10:14:39 +0100
Holger Brunck <holger.brunck@keymile.com> wrote:

> On 01/18/2013 01:44 AM, Kim Phillips wrote:
> > On Thu, 17 Jan 2013 13:47:51 +0100
> > Holger Brunck <holger.brunck@keymile.com> wrote:
> > 
> >> +	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
> >> +
> > 
> > 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.

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

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

yes, indeed

> even if the calculation would be the same?

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

Kim

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [U-Boot] [PATCH 05/15] powerpc/83xx/km: add MV88E6122 switch support for kmvect1
  2013-01-18 21:12       ` Kim Phillips
@ 2013-01-21  9:45         ` Holger Brunck
  0 siblings, 0 replies; 26+ messages in thread
From: Holger Brunck @ 2013-01-21  9:45 UTC (permalink / raw)
  To: u-boot

On 01/18/2013 10:12 PM, Kim Phillips wrote:
> On Fri, 18 Jan 2013 10:14:39 +0100
> Holger Brunck <holger.brunck@keymile.com> wrote:
> 
>> On 01/18/2013 01:44 AM, Kim Phillips wrote:
>>> On Thu, 17 Jan 2013 13:47:51 +0100
>>> Holger Brunck <holger.brunck@keymile.com> wrote:
>>>
>>>> +	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
>>>> +
>>>
>>> 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.
> 
> it can happen if if setting ethaddr from eeprom somehow fails, and/or
> the user manually modifies ethaddr in the environment.
> 
>> 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

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2013-01-21  9:45 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-17 12:47 [U-Boot] [PATCH 00/15] updates for km83xx boards Holger Brunck
2013-01-17 12:47 ` [U-Boot] [PATCH 01/15] km/common: remove unneeded ifdefs for I2C Holger Brunck
2013-01-17 12:47 ` [U-Boot] [PATCH 02/15] km/common/ivm: remove obsolete code Holger Brunck
2013-01-17 12:47 ` [U-Boot] [PATCH 03/15] km/common/ivm: remove CONFIG_SYS_I2C_IVM_BUS related code Holger Brunck
2013-01-17 12:47 ` [U-Boot] [PATCH 04/15] km82xx, km83xx: move ethernet_present() from common to cpu specific Holger Brunck
2013-01-18  0:23   ` Kim Phillips
2013-01-18  8:07     ` Holger Brunck
2013-01-18 21:09       ` Kim Phillips
2013-01-17 12:47 ` [U-Boot] [PATCH 05/15] powerpc/83xx/km: add MV88E6122 switch support for kmvect1 Holger Brunck
2013-01-18  0:44   ` Kim Phillips
2013-01-18  9:14     ` Holger Brunck
2013-01-18 21:12       ` Kim Phillips
2013-01-21  9:45         ` Holger Brunck
2013-01-17 12:47 ` [U-Boot] [PATCH 06/15] powerpc/83xx: use ppc_6xx as arch variable " Holger Brunck
2013-01-17 12:47 ` [U-Boot] [PATCH 07/15] km/common: introduce $uimage variable Holger Brunck
2013-01-17 12:47 ` [U-Boot] [PATCH 08/15] km/scripts: replace hardcoded uImage Holger Brunck
2013-01-17 12:47 ` [U-Boot] [PATCH 09/15] kmeter1_nand: allow usage of NAND_ECC_SOFT_BCH Holger Brunck
2013-01-17 16:00   ` Scott Wood
2013-01-17 12:47 ` [U-Boot] [PATCH 10/15] powerpc/83xx: use NAND_ECC_BCH for kmcoge5ne Holger Brunck
2013-01-17 12:47 ` [U-Boot] [PATCH 11/15] km/common: add eccmode to kernel commandline Holger Brunck
2013-01-17 12:47 ` [U-Boot] [PATCH 12/15] powerpc/83xx/km: cleanup tuxx1 support Holger Brunck
2013-01-17 12:47 ` [U-Boot] [PATCH 13/15] powerpc/83xx/km: add support for kmopti2 board Holger Brunck
2013-01-17 12:48 ` [U-Boot] [PATCH 14/15] poweprc/83xx/km: remove uneeded CONFIG_MISC_INIT_R Holger Brunck
2013-01-17 12:48 ` [U-Boot] [PATCH 15/15] powerpc/83xx/km: drop uneeded dtt_bus environment var Holger Brunck
2013-01-17 14:30 ` [U-Boot] [PATCH 00/15] updates for km83xx boards Prafulla Wadaskar
2013-01-17 14:35   ` Holger Brunck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox