Skip to contentSkip to conversation

arm: add support for the suen3_p1a board from keymile

PATCH Superseded Heiko Schocher 3 participants 11 messages Feb 12, 2010 – Feb 22, 2010 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH v4 3/4 arm: add support for the suen3_p1a board from keymile

This patch adds support for the Keymile suen3_p1a board which is based on the Marvell Kirkwood (88F6281) SoC. As this is a variant of the mgcoge2_arm_p1a board, this board also uses common code stored in board/keymile/km_arm/km_arm.c

---
- changes since v1:
added comments from Wolfgang Denk:
get rid of flash_info_t define in board config (to get this working patch 1/2 is introduced/needed)

- changes since v2:
added comments from Wolfgang Denk
- rearranged if/else in do_spi_toggle()
- added I/O accessor functions for bootcounter

- changes since v3:
added comment Scott Wood
- removed nand_init in do_spi_toggle()

added comments from Prafulla Wadagaskar
- km-arm.h renamed to km_arm.h
- reworked eeprom_write_enable() (deleted it) (when reviewing this function, it cropped up, that this pin is connected through a gpio pin, not as in previous version, through the boco (a FPGA))
- moved set_sda(), set_scl(), get_sda(), get_scl() to km_arm.c
- split patch in 4 patches (for each board an extra patch)
- renamed sdramregs.txt in kwbimage.cfg, also license info added.

 MAINTAINERS                 |    1 +
 MAKEALL                     |    1 +
 Makefile                    |    3 +-
 include/configs/suen3_p1a.h |   82 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 86 insertions(+), 1 deletions(-)
 create mode 100644 include/configs/suen3_p1a.h
MAINTAINERS +1 -0
index ab27afc..1deff9d 100644
@@ -412,6 +412,7 @@ Heiko Schocher <[email protected]>
 	municse		MPC5200
 	sc3		PPC405GP
 	suen3		ARM926EJS (Kirkwood SoC)
+	suen3_p1a	ARM926EJS (Kirkwood SoC)
 	uc101		MPC5200
 
 
MAKEALL +1 -0
index 7577ea5..945a9a7 100755
@@ -581,6 +581,7 @@ LIST_ARM9="			\
 	spear320		\
 	spear600		\
 	suen3			\
+	suen3_p1a		\
 	trab			\
 	VCMA9			\
 	versatile		\
Makefile +2 -1
index 3ea2b53..1bc33ee 100644
@@ -3050,7 +3050,8 @@ spear320_config :	unconfig
 spear600_config :	unconfig
 	@$(MKCONFIG) -n $@ -t $(@:_config=) spear6xx arm arm926ejs $(@:_config=) spear spear
 
-suen3_config:	unconfig
+suen3_config \
+suen3_p1a_config:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm926ejs km_arm keymile kirkwood
 
 SX1_stdout_serial_config \
include/configs/suen3_p1a.h new file +82 -0

82 lines not on this page · raw message

Signature · 5 lines
1.6.2.5

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

PATCH v4 3/4 arm: add support for the suen3_p1a board from keymile

Quoted 10 lines

-----Original Message-----
From: Heiko Schocher [mailto:hs at denx.de]
Sent: Friday, February 12, 2010 1:36 PM
To: U-Boot user list
Cc: Wolfgang Denk; Prafulla Wadaskar; Scott Wood; Stefan Roese
Subject: [PATCH 3/4 v4] arm: add support for the suen3_p1a board from keymile

Quoted 4 lines

This patch adds support for the Keymile suen3_p1a board which is based on the Marvell Kirkwood (88F6281) SoC. As this is a variant of the mgcoge2_arm_p1a board, this board also uses common code stored in board/keymile/km_arm/km_arm.c

I hope each board that you are supporting have registered MACHIN_ID, if not pls do it and code it in C file. I could not find relevant definition usage in c file for the same
Secondly CONFIG_MACH_<boardname> should be defined in header

Regards..
Prafulla . .

#2 lore raw

PATCH v4 3/4 arm: add support for the suen3_p1a board from keymile

Hello Prafulla,

Quoted 8 lines · Prafulla Wadaskar
Quoted 8 lines

-----Original Message-----
From: Heiko Schocher [mailto:hs at denx.de]
Sent: Friday, February 12, 2010 1:36 PM
To: U-Boot user list
Cc: Wolfgang Denk; Prafulla Wadaskar; Scott Wood; Stefan Roese
Subject: [PATCH 3/4 v4] arm: add support for the suen3_p1a board from keymile

Quoted 6 lines
Quoted 4 lines

This patch adds support for the Keymile suen3_p1a board which is based on the Marvell Kirkwood (88F6281) SoC. As this is a variant of the mgcoge2_arm_p1a board, this board also uses common code stored in board/keymile/km_arm/km_arm.c

I hope each board that you are supporting have registered MACHIN_ID, if not pls do it and code it in C file.

No, this 4 boards are all the same, just different hardwarerevisions ...

bye,
heiko

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

PATCH v4 3/4 arm: add support for the suen3_p1a board from keymile

Quoted 26 lines

-----Original Message-----
From: Heiko Schocher [mailto:hs at denx.de]
Sent: Monday, February 15, 2010 1:40 PM
To: Prafulla Wadaskar
Cc: U-Boot user list; Wolfgang Denk; Scott Wood; Stefan Roese
Subject: Re: [PATCH 3/4 v4] arm: add support for the suen3_p1a board from keymile

Hello Prafulla,

Quoted 13 lines · Prafulla Wadaskar
Quoted 12 lines

-----Original Message-----
From: Heiko Schocher [mailto:hs at denx.de]
Sent: Friday, February 12, 2010 1:36 PM
To: U-Boot user list
Cc: Wolfgang Denk; Prafulla Wadaskar; Scott Wood; Stefan Roese
Subject: [PATCH 3/4 v4] arm: add support for the suen3_p1a board from keymile

This patch adds support for the Keymile suen3_p1a board which is based on the Marvell Kirkwood (88F6281) SoC. As this is a variant of the mgcoge2_arm_p1a board, this board also uses common code stored in board/keymile/km_arm/km_arm.c

Quoted 5 lines
Quoted 1 line

I hope each board that you are supporting have registered

MACHIN_ID, if not pls do it and code it in C file.

No, this 4 boards are all the same, just different hardwarerevisions ...

Hi Heiko

If these boards are all same, why don't you add single board support? That will resolve all issues and even MACHINE_ID issue.

To me, any hardware revision is new board entity.
If the hardware changes are very minimal those can be addressed by passing additional build arguments like "BOARDREV=V1" or handle them by reading h/w version from hardware itself, as I said earlier using EEPROM.

At least you can have first board patch clean and complete.

Regards..
Prafulla . .

Quoted 7 lines

bye,
heiko

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

PATCH v5 1/1 arm: add support for the suen3 board from keymile

In reply to Heiko Schocher

Add support for the ARM part of the mgcoge2, named suen3. This board is based on the Marvell Kirkwood (88F6281) SoC. As there come more board variants, common code is stored in board/keymile/km_arm/km_arm.c

---
- changes since v1:
added comments from Wolfgang Denk:
get rid of flash_info_t define in board config (to get this working patch 1/2 is introduced/needed)

- changes since v2:
added comments from Wolfgang Denk
- rearranged if/else in do_spi_toggle()
- added I/O accessor functions for bootcounter

- changes since v3:
added comment Scott Wood
- removed nand_init in do_spi_toggle()

added comments from Prafulla Wadaskar
- km-arm.h renamed to km_arm.h
- reworked eeprom_write_enable() (deleted it) (when reviewing this function, it cropped up, that this pin is connected through a gpio pin, not as in previous version, through the boco (a FPGA))
- moved set_sda(), set_scl(), get_sda(), get_scl() to km_arm.c
- split patch in 4 patches (for each board an extra patch)
- renamed sdramregs.txt in kwbimage.cfg, also license info added.

- changes since v4
added comments from Prafulla Wadaskar
- add comments in board/keymile/km_arm/kwbimage.cfg
- cleanup define CONFIG_KIRKWOOD_GPIO
- corect wrong name at end of config file
- add only support for the suen3 target, others follow later

---
 MAINTAINERS                       |    2 +-
 MAKEALL                           |    1 +
 Makefile                          |    6 +
 board/keymile/common/common.c     |    6 +-
 board/keymile/km_arm/Makefile     |   51 ++++++
 board/keymile/km_arm/config.mk    |   28 ++++
 board/keymile/km_arm/km_arm.c     |  323 +++++++++++++++++++++++++++++++++++++
 board/keymile/km_arm/kwbimage.cfg |  176 ++++++++++++++++++++
 include/configs/km_arm.h          |  191 ++++++++++++++++++++++
 include/configs/suen3.h           |  103 ++++++++++++
 10 files changed, 884 insertions(+), 3 deletions(-)
 create mode 100644 board/keymile/km_arm/Makefile
 create mode 100644 board/keymile/km_arm/config.mk
 create mode 100644 board/keymile/km_arm/km_arm.c
 create mode 100644 board/keymile/km_arm/kwbimage.cfg
 create mode 100644 include/configs/km_arm.h
 create mode 100644 include/configs/suen3.h
MAINTAINERS +1 -1
index fe63a9f..fe9494c 100644
@@ -409,9 +409,9 @@ Heiko Schocher <[email protected]>
 	muas3001	MPC8270
 	municse		MPC5200
 	sc3		PPC405GP
+	suen3		ARM926EJS (Kirkwood SoC)
 	uc101		MPC5200
 
-
 Peter De Schrijver <[email protected]>
 
 	ML2		PPC4xx
MAKEALL +1 -0
index 684db67..dfac5e4 100755
@@ -579,6 +579,7 @@ LIST_ARM9="			\
 	spear310		\
 	spear320		\
 	spear600		\
+	suen3			\
 	trab			\
 	VCMA9			\
 	versatile		\
Makefile +3 -0
index e4431f7..3ea2b53 100644
@@ -3047,6 +3050,9 @@ spear320_config :	unconfig
 spear600_config :	unconfig
 	@$(MKCONFIG) -n $@ -t $(@:_config=) spear6xx arm arm926ejs $(@:_config=) spear spear
 
+suen3_config:	unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm926ejs km_arm keymile kirkwood
+
 SX1_stdout_serial_config \
 SX1_config:		unconfig
 	@mkdir -p $(obj)include
board/keymile/common/common.c +4 -2
index ec27bda..7b4eefd 100644
@@ -35,6 +35,7 @@
 #include <libfdt.h>
 #endif
 
+#include "../common/common.h"
 #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
 #include <i2c.h>
 
@@ -421,7 +422,6 @@ static int get_scl (void)
 
 	return ((val & SCL_BIT) == SCL_BIT);
 }
-
 #endif
 
 #if !defined(CONFIG_KMETER1)
@@ -500,7 +500,7 @@ void i2c_init_board(void)
 	out_8 (&dev->cr, (I2C_CR_MEN));
 
 #else
-#if defined(CONFIG_HARD_I2C)
+#if defined(CONFIG_HARD_I2C) && !defined(CONFIG_MACH_SUEN3)
 	volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR ;
 	volatile i2c8260_t *i2c	= (i2c8260_t *)&immap->im_i2c;
 
@@ -578,10 +578,12 @@ int fdt_get_node_and_value (void *blob,
 }
 #endif
 
+#if !defined(CONFIG_MACH_SUEN3)
 int ethernet_present (void)
 {
 	return (in_8((u8 *)CONFIG_SYS_PIGGY_BASE + CONFIG_SYS_SLOT_ID_OFF) & 0x80);
 }
+#endif
 
 int board_eth_init (bd_t *bis)
 {
board/keymile/km_arm/Makefile new file +51 -0

51 lines not on this page · raw message

board/keymile/km_arm/config.mk new file +28 -0
new file mode 100644
index 0000000..b9e81b2
@@ -0,0 +1,28 @@
+#
+# (C) Copyright 2009
+# Marvell Semiconductor <www.marvell.com>
+# Prafulla Wadaskar <[email protected]>
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+
+TEXT_BASE = 0x004000000
+
+# Kirkwood Boot Image configuration file
+KWD_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/kwbimage.cfg
board/keymile/km_arm/km_arm.c new file +323 -0

323 lines not on this page · raw message

board/keymile/km_arm/kwbimage.cfg new file +176 -0

176 lines not on this page · raw message

include/configs/km_arm.h new file +191 -0

191 lines not on this page · raw message

include/configs/suen3.h new file +103 -0

103 lines not on this page · raw message

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

PATCH v5 1/1 arm: add support for the suen3 board from keymile

Quoted 71 lines

-----Original Message-----
From: Heiko Schocher [mailto:hs at denx.de]
Sent: Thursday, February 18, 2010 1:54 PM
To: U-Boot user list
Cc: Prafulla Wadaskar; Wolfgang Denk; Scott Wood; Stefan Roese
Subject: [PATCH 1/1 v5] arm: add support for the suen3 board from keymile

Add support for the ARM part of the mgcoge2, named suen3. This board is based on the Marvell Kirkwood (88F6281) SoC. As there come more board variants, common code is stored in board/keymile/km_arm/km_arm.c

---
- changes since v1:
added comments from Wolfgang Denk:
get rid of flash_info_t define in board config (to get this working patch 1/2 is introduced/needed)

- changes since v2:
added comments from Wolfgang Denk
- rearranged if/else in do_spi_toggle()
- added I/O accessor functions for bootcounter

- changes since v3:
added comment Scott Wood
- removed nand_init in do_spi_toggle()

added comments from Prafulla Wadaskar
- km-arm.h renamed to km_arm.h
- reworked eeprom_write_enable() (deleted it) (when reviewing this function, it cropped up, that this pin is connected through a gpio pin, not as in previous version, through the boco (a FPGA))
- moved set_sda(), set_scl(), get_sda(), get_scl() to km_arm.c
- split patch in 4 patches (for each board an extra patch)
- renamed sdramregs.txt in kwbimage.cfg, also license info added.

- changes since v4
added comments from Prafulla Wadaskar
- add comments in board/keymile/km_arm/kwbimage.cfg
- cleanup define CONFIG_KIRKWOOD_GPIO
- corect wrong name at end of config file
- add only support for the suen3 target, others follow later

---
 MAINTAINERS                       |    2 +-
 MAKEALL                           |    1 +
 Makefile                          |    6 +
 board/keymile/common/common.c     |    6 +-
 board/keymile/km_arm/Makefile     |   51 ++++++
 board/keymile/km_arm/config.mk    |   28 ++++
 board/keymile/km_arm/km_arm.c     |  323 
+++++++++++++++++++++++++++++++++++++
 board/keymile/km_arm/kwbimage.cfg |  176 ++++++++++++++++++++
 include/configs/km_arm.h          |  191 ++++++++++++++++++++++
 include/configs/suen3.h           |  103 ++++++++++++
 10 files changed, 884 insertions(+), 3 deletions(-)
 create mode 100644 board/keymile/km_arm/Makefile
 create mode 100644 board/keymile/km_arm/config.mk
 create mode 100644 board/keymile/km_arm/km_arm.c
 create mode 100644 board/keymile/km_arm/kwbimage.cfg
Quoted 2 lines
 create mode 100644 include/configs/km_arm.h
 create mode 100644 include/configs/suen3.h

It would be good if you can merge these two files since single board board support
For additional board that you are planning, you can even add separate file or think of splitting it. For better readability and to avoid complexity, I recommend to have one single file per board in include/config

...snip...

Quoted 57 lines
board/keymile/km_arm/km_arm.c new file +50 -0
new file mode 100644
index 0000000..31610be
@@ -0,0 +1,323 @@
+/*
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ * Prafulla Wadaskar <[email protected]>
+ *
+ * (C) Copyright 2009
+ * Stefan Roese, DENX Software Engineering, sr at denx.de.
+ *
+ * (C) Copyright 2010
+ * Heiko Schocher, DENX Software Engineering, hs at denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#include <common.h>
+#include <i2c.h>
+#include <nand.h>
+#include <netdev.h>
+#include <miiphy.h>
+#include <asm/io.h>
+#include <asm/arch/kirkwood.h>
+#include <asm/arch/mpp.h>
+
+#include "../common/common.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static int	io_dev;
+extern I2C_MUX_DEVICE *i2c_mux_ident_muxstring (uchar *buf);
+
+/* Multi-Purpose Pins Functionality configuration */
+u32 kwmpp_config[] = {
+	MPP0_NF_IO2,
+	MPP1_NF_IO3,

board/keymile/km_arm/km_arm.c line 60

Quoted 10 lines
board/keymile/km_arm/km_arm.c new file +10 -0
+	MPP2_NF_IO4,
+	MPP3_NF_IO5,
+	MPP4_NF_IO6,
+	MPP5_NF_IO7,
+	MPP6_SYSRST_OUTn,
+	MPP7_PEX_RST_OUTn,
+#if defined(CONFIG_SOFT_I2C)
+	MPP8_GPIO,		/* SDA */
+	MPP9_GPIO,		/* SCL */
+#else

you can remove else part and ifdef with CONFIG_HARD_I2C

Quoted 3 lines
board/keymile/km_arm/km_arm.c new file +3 -0
+	MPP8_TW_SDA,
+	MPP9_TW_SCK,
+#endif

...snip...

Quoted 4 lines
board/keymile/km_arm/km_arm.c new file +4 -0
+int misc_init_r(void)
+{
+	I2C_MUX_DEVICE	*i2cdev;
+	char *str;

board/keymile/km_arm/km_arm.c line 135

Quoted 10 lines
board/keymile/km_arm/km_arm.c new file +10 -0
+	int mach_type;
+
+	/* add I2C Bus for I/O Expander */
+	i2cdev = i2c_mux_ident_muxstring((uchar *)"pca9554a:70:a");
+	io_dev = i2cdev->busid;
+	puts("Piggy:");
+	if (ethernet_present() == 0)
+		puts (" not");
+	puts(" present\n");
+

Please remove below stuff, this is risky and not needed

board/keymile/km_arm/km_arm.c line 143

Quoted 8 lines
board/keymile/km_arm/km_arm.c new file +8 -0
+	str = getenv("mach_type");
+	if (str != NULL) {
+		mach_type = simple_strtoul(str, NULL, 10);
+		printf("Overwriting MACH_TYPE with %d!!!\n", mach_type);
+		gd->bd->bi_arch_number = mach_type;
+	}
+	return 0;
+}

Rest code looks good to me

Regards..
Prafulla . .

#6 lore raw

PATCH v5 1/1 arm: add support for the suen3 board from keymile

Hello Prafulla,

Quoted 17 lines · Prafulla Wadaskar
Quoted 17 lines

-----Original Message-----
From: Heiko Schocher [mailto:hs at denx.de]
Sent: Thursday, February 18, 2010 1:54 PM
To: U-Boot user list
Cc: Prafulla Wadaskar; Wolfgang Denk; Scott Wood; Stefan Roese
Subject: [PATCH 1/1 v5] arm: add support for the suen3 board from keymile

Add support for the ARM part of the mgcoge2, named suen3. This board is based on the Marvell Kirkwood (88F6281) SoC. As there come more board variants, common code is stored in board/keymile/km_arm/km_arm.c

---

[...]

Quoted 17 lines
Quoted 16 lines
 MAINTAINERS                       |    2 +-
 MAKEALL                           |    1 +
 Makefile                          |    6 +
 board/keymile/common/common.c     |    6 +-
 board/keymile/km_arm/Makefile     |   51 ++++++
 board/keymile/km_arm/config.mk    |   28 ++++
 board/keymile/km_arm/km_arm.c     |  323 
+++++++++++++++++++++++++++++++++++++
 board/keymile/km_arm/kwbimage.cfg |  176 ++++++++++++++++++++
 include/configs/km_arm.h          |  191 ++++++++++++++++++++++
 include/configs/suen3.h           |  103 ++++++++++++
 10 files changed, 884 insertions(+), 3 deletions(-)
 create mode 100644 board/keymile/km_arm/Makefile
 create mode 100644 board/keymile/km_arm/config.mk
 create mode 100644 board/keymile/km_arm/km_arm.c
 create mode 100644 board/keymile/km_arm/kwbimage.cfg
Quoted 6 lines
Quoted 2 lines
 create mode 100644 include/configs/km_arm.h
 create mode 100644 include/configs/suen3.h

It would be good if you can merge these two files since single board board support
For additional board that you are planning, you can even add separate file or think of splitting it. For better readability and to avoid complexity, I recommend to have one single file per board in include/config

Hmm.. I think we tend to collect common config options in one file, so board config files are not so big. Ok, actual it is only one arm board from keymile here, but there come more, and so it is sensible to collect common options for this group of boards immediately ...

Quoted 62 lines

...snip...

Quoted 61 lines
board/keymile/km_arm/km_arm.c new file +54 -0
new file mode 100644
index 0000000..31610be
@@ -0,0 +1,323 @@
+/*
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ * Prafulla Wadaskar <[email protected]>
+ *
+ * (C) Copyright 2009
+ * Stefan Roese, DENX Software Engineering, sr at denx.de.
+ *
+ * (C) Copyright 2010
+ * Heiko Schocher, DENX Software Engineering, hs at denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#include <common.h>
+#include <i2c.h>
+#include <nand.h>
+#include <netdev.h>
+#include <miiphy.h>
+#include <asm/io.h>
+#include <asm/arch/kirkwood.h>
+#include <asm/arch/mpp.h>
+
+#include "../common/common.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static int	io_dev;
+extern I2C_MUX_DEVICE *i2c_mux_ident_muxstring (uchar *buf);
+
+/* Multi-Purpose Pins Functionality configuration */
+u32 kwmpp_config[] = {
+	MPP0_NF_IO2,
+	MPP1_NF_IO3,
+	MPP2_NF_IO4,
+	MPP3_NF_IO5,
+	MPP4_NF_IO6,
+	MPP5_NF_IO7,
Quoted 8 lines

board/keymile/km_arm/km_arm.c line 60

Quoted 6 lines
board/keymile/km_arm/km_arm.c new file +6 -0
+	MPP6_SYSRST_OUTn,
+	MPP7_PEX_RST_OUTn,
+#if defined(CONFIG_SOFT_I2C)
+	MPP8_GPIO,		/* SDA */
+	MPP9_GPIO,		/* SCL */
+#else

you can remove else part and ifdef with CONFIG_HARD_I2C

But if this is in code, the user can fast switch to HARD_I2C, if he wants it ... Ok, I delete it.

Quoted 5 lines
Quoted 3 lines
board/keymile/km_arm/km_arm.c new file +3 -0
+	MPP8_TW_SDA,
+	MPP9_TW_SCK,
+#endif

...snip...

Quoted 16 lines
Quoted 4 lines
board/keymile/km_arm/km_arm.c new file +4 -0
+int misc_init_r(void)
+{
+	I2C_MUX_DEVICE	*i2cdev;
+	char *str;

board/keymile/km_arm/km_arm.c line 135

Quoted 10 lines
board/keymile/km_arm/km_arm.c new file +10 -0
+	int mach_type;
+
+	/* add I2C Bus for I/O Expander */
+	i2cdev = i2c_mux_ident_muxstring((uchar *)"pca9554a:70:a");
+	io_dev = i2cdev->busid;
+	puts("Piggy:");
+	if (ethernet_present() == 0)
+		puts (" not");
+	puts(" present\n");
+

Please remove below stuff, this is risky and not needed

see comment for this from Stefan:

http://lists.denx.de/pipermail/u-boot/2010-February/067410.html

I got no comment from you, so I lthought it is Ok!

What should I do?

Quoted 10 lines

board/keymile/km_arm/km_arm.c line 143

Quoted 8 lines
board/keymile/km_arm/km_arm.c new file +8 -0
+	str = getenv("mach_type");
+	if (str != NULL) {
+		mach_type = simple_strtoul(str, NULL, 10);
+		printf("Overwriting MACH_TYPE with %d!!!\n", mach_type);
+		gd->bd->bi_arch_number = mach_type;
+	}
+	return 0;
+}

Rest code looks good to me

puhh... ;-)

Thanks for your comments!

bye,
Heiko

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

PATCH v5 1/1 arm: add support for the suen3 board from keymile

Dear Heiko Schocher,

In message <[email protected]> you wrote:
...

Quoted 7 lines
Quoted 6 lines
Quoted 2 lines
 create mode 100644 include/configs/km_arm.h
 create mode 100644 include/configs/suen3.h

It would be good if you can merge these two files since single board board support
For additional board that you are planning, you can even add separate file or think of splitting it. For better readability and to avoid complexity, I recommend to have one single file per board in include/config

Quoted 5 lines

Hmm.. I think we tend to collect common config options in one file, so board config files are not so big. Ok, actual it is only one arm board from keymile here, but there come more, and so it is sensible to collect common options for this group of boards immediately ...

ACK. I agree to do this split right from the beginning if it is clear that more such boards will be added soon.

Quoted 16 lines
Quoted 7 lines
Quoted 7 lines
board/keymile/km_arm/km_arm.c new file +7 -0
+u32 kwmpp_config[] = {
+	MPP0_NF_IO2,
+	MPP1_NF_IO3,
+	MPP2_NF_IO4,
+	MPP3_NF_IO5,
+	MPP4_NF_IO6,
+	MPP5_NF_IO7,
Quoted 8 lines

board/keymile/km_arm/km_arm.c line 60

Quoted 6 lines
board/keymile/km_arm/km_arm.c new file +6 -0
+	MPP6_SYSRST_OUTn,
+	MPP7_PEX_RST_OUTn,
+#if defined(CONFIG_SOFT_I2C)
+	MPP8_GPIO,		/* SDA */
+	MPP9_GPIO,		/* SCL */
+#else

you can remove else part and ifdef with CONFIG_HARD_I2C

Quoted 2 lines

But if this is in code, the user can fast switch to HARD_I2C, if he wants it ... Ok, I delete it.

I understood that Prafulla NOT suggested delete the code, but to change the

	#else
into
	#endif
	#ifdef CONFIG_HARD_I2C

...

Quoted 9 lines
Quoted 1 line

Please remove below stuff, this is risky and not needed

see comment for this from Stefan:

http://lists.denx.de/pipermail/u-boot/2010-February/067410.html

I got no comment from you, so I lthought it is Ok!

What should I do?

Keep it. It really doen't hurt. This whole MACH_TYPE stuff is broken by design anyway. So adding such workarounds are just collateral damages and can be ignored for now. Eventually we can get rid of this when we switch to using device trees.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A list is only as strong as its weakest link.            -- Don Knuth
#8 lore raw

PATCH v5 1/1 arm: add support for the suen3 board from keymile

Quoted 13 lines

-----Original Message-----
From: Wolfgang Denk [mailto:wd at denx.de]
Sent: Thursday, February 18, 2010 6:12 PM
To: hs at denx.de
Cc: Prafulla Wadaskar; U-Boot user list; Scott Wood; Stefan Roese
Subject: Re: [PATCH 1/1 v5] arm: add support for the suen3 board from keymile

Dear Heiko Schocher,

In message <[email protected]> you wrote:

...snip...

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

board/keymile/km_arm/km_arm.c line 60

Quoted 5 lines
board/keymile/km_arm/km_arm.c new file +5 -0
+	MPP7_PEX_RST_OUTn,
+#if defined(CONFIG_SOFT_I2C)
+	MPP8_GPIO,		/* SDA */
+	MPP9_GPIO,		/* SCL */
+#else

you can remove else part and ifdef with CONFIG_HARD_I2C

Quoted 5 lines
Quoted 2 lines

But if this is in code, the user can fast switch to HARD_I2C, if he wants it ... Ok, I delete it.

I understood that Prafulla NOT suggested delete the code, but to change the

Ack

Quoted 6 lines
	#else
into
	#endif
	#ifdef CONFIG_HARD_I2C

Regards..
Prafulla . .

#9 lore raw

PATCH v6 1/1 arm: add support for the suen3 board from keymile

Add support for the ARM part of the mgcoge2, named suen3. This board is based on the Marvell Kirkwood (88F6281) SoC. As there come more board variants, common config options are collected in include/configs/km_arm.h. Also, this board use common code for all keymile boards, which is stored in board/keymile/common/common.c

---
- changes since v1:
added comments from Wolfgang Denk:
get rid of flash_info_t define in board config (to get this working patch 1/2 is introduced/needed)

- changes since v2:
added comments from Wolfgang Denk
- rearranged if/else in do_spi_toggle()
- added I/O accessor functions for bootcounter

- changes since v3:
added comment Scott Wood
- removed nand_init in do_spi_toggle()

added comments from Prafulla Wadaskar
- km-arm.h renamed to km_arm.h
- reworked eeprom_write_enable() (deleted it) (when reviewing this function, it cropped up, that this pin is connected through a gpio pin, not as in previous version, through the boco (a FPGA))
- moved set_sda(), set_scl(), get_sda(), get_scl() to km_arm.c
- split patch in 4 patches (for each board an extra patch)
- renamed sdramregs.txt in kwbimage.cfg, also license info added.

- changes since v4
added comments from Prafulla Wadaskar
- add comments in board/keymile/km_arm/kwbimage.cfg
- cleanup define CONFIG_KIRKWOOD_GPIO
- corect wrong name at end of config file
- add only support for the suen3 target, others follow later

- changes since v5
"#ifdef CONFIG_HARD_I2C" instead of "#else"

 MAINTAINERS                       |    2 +-
 MAKEALL                           |    1 +
 Makefile                          |    3 +
 board/keymile/common/common.c     |    6 +-
 board/keymile/km_arm/Makefile     |   51 ++++++
 board/keymile/km_arm/config.mk    |   28 ++++
 board/keymile/km_arm/km_arm.c     |  324 +++++++++++++++++++++++++++++++++++++
 board/keymile/km_arm/kwbimage.cfg |  176 ++++++++++++++++++++
 include/configs/km_arm.h          |  191 ++++++++++++++++++++++
 include/configs/suen3.h           |  103 ++++++++++++
 10 files changed, 882 insertions(+), 3 deletions(-)
 create mode 100644 board/keymile/km_arm/Makefile
 create mode 100644 board/keymile/km_arm/config.mk
 create mode 100644 board/keymile/km_arm/km_arm.c
 create mode 100644 board/keymile/km_arm/kwbimage.cfg
 create mode 100644 include/configs/km_arm.h
 create mode 100644 include/configs/suen3.h
MAINTAINERS +1 -1
index fe63a9f..fe9494c 100644
@@ -409,9 +409,9 @@ Heiko Schocher <[email protected]>
 	muas3001	MPC8270
 	municse		MPC5200
 	sc3		PPC405GP
+	suen3		ARM926EJS (Kirkwood SoC)
 	uc101		MPC5200
 
-
 Peter De Schrijver <[email protected]>
 
 	ML2		PPC4xx
MAKEALL +1 -0
index 684db67..dfac5e4 100755
@@ -579,6 +579,7 @@ LIST_ARM9="			\
 	spear310		\
 	spear320		\
 	spear600		\
+	suen3			\
 	trab			\
 	VCMA9			\
 	versatile		\
Makefile +3 -0
index e4431f7..dc609c0 100644
@@ -3047,6 +3047,9 @@ spear320_config :	unconfig
 spear600_config :	unconfig
 	@$(MKCONFIG) -n $@ -t $(@:_config=) spear6xx arm arm926ejs $(@:_config=) spear spear
 
+suen3_config:	unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm926ejs km_arm keymile kirkwood
+
 SX1_stdout_serial_config \
 SX1_config:		unconfig
 	@mkdir -p $(obj)include
board/keymile/common/common.c +4 -2
index ec27bda..7b4eefd 100644
@@ -35,6 +35,7 @@
 #include <libfdt.h>
 #endif
 
+#include "../common/common.h"
 #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
 #include <i2c.h>
 
@@ -421,7 +422,6 @@ static int get_scl (void)
 
 	return ((val & SCL_BIT) == SCL_BIT);
 }
-
 #endif
 
 #if !defined(CONFIG_KMETER1)
@@ -500,7 +500,7 @@ void i2c_init_board(void)
 	out_8 (&dev->cr, (I2C_CR_MEN));
 
 #else
-#if defined(CONFIG_HARD_I2C)
+#if defined(CONFIG_HARD_I2C) && !defined(CONFIG_MACH_SUEN3)
 	volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR ;
 	volatile i2c8260_t *i2c	= (i2c8260_t *)&immap->im_i2c;
 
@@ -578,10 +578,12 @@ int fdt_get_node_and_value (void *blob,
 }
 #endif
 
+#if !defined(CONFIG_MACH_SUEN3)
 int ethernet_present (void)
 {
 	return (in_8((u8 *)CONFIG_SYS_PIGGY_BASE + CONFIG_SYS_SLOT_ID_OFF) & 0x80);
 }
+#endif
 
 int board_eth_init (bd_t *bis)
 {
board/keymile/km_arm/Makefile new file +51 -0

51 lines not on this page · raw message

board/keymile/km_arm/config.mk new file +28 -0
new file mode 100644
index 0000000..b9e81b2
@@ -0,0 +1,28 @@
+#
+# (C) Copyright 2009
+# Marvell Semiconductor <www.marvell.com>
+# Prafulla Wadaskar <[email protected]>
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+
+TEXT_BASE = 0x004000000
+
+# Kirkwood Boot Image configuration file
+KWD_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/kwbimage.cfg
board/keymile/km_arm/km_arm.c new file +324 -0

324 lines not on this page · raw message

board/keymile/km_arm/kwbimage.cfg new file +176 -0

176 lines not on this page · raw message

include/configs/km_arm.h new file +191 -0

191 lines not on this page · raw message

include/configs/suen3.h new file +103 -0

103 lines not on this page · raw message

Signature · 4 lines
1.6.2.5
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#10 lore raw

PATCH v6 1/1 arm: add support for the suen3 board from keymile

Quoted 68 lines

-----Original Message-----
From: Heiko Schocher [mailto:hs at denx.de]
Sent: Thursday, February 18, 2010 6:53 PM
To: U-Boot user list
Cc: Prafulla Wadaskar; Wolfgang Denk; Scott Wood; Stefan Roese
Subject: [PATCH v6] arm: add support for the suen3 board from keymile

Add support for the ARM part of the mgcoge2, named suen3. This board is based on the Marvell Kirkwood (88F6281) SoC. As there come more board variants, common config options are collected in include/configs/km_arm.h. Also, this board use common code for all keymile boards, which is stored in board/keymile/common/common.c

---
- changes since v1:
added comments from Wolfgang Denk:
get rid of flash_info_t define in board config (to get this working patch 1/2 is introduced/needed)

- changes since v2:
added comments from Wolfgang Denk
- rearranged if/else in do_spi_toggle()
- added I/O accessor functions for bootcounter

- changes since v3:
added comment Scott Wood
- removed nand_init in do_spi_toggle()

added comments from Prafulla Wadaskar
- km-arm.h renamed to km_arm.h
- reworked eeprom_write_enable() (deleted it) (when reviewing this function, it cropped up, that this pin is connected through a gpio pin, not as in previous version, through the boco (a FPGA))
- moved set_sda(), set_scl(), get_sda(), get_scl() to km_arm.c
- split patch in 4 patches (for each board an extra patch)
- renamed sdramregs.txt in kwbimage.cfg, also license info added.

- changes since v4
added comments from Prafulla Wadaskar
- add comments in board/keymile/km_arm/kwbimage.cfg
- cleanup define CONFIG_KIRKWOOD_GPIO
- corect wrong name at end of config file
- add only support for the suen3 target, others follow later

- changes since v5
"#ifdef CONFIG_HARD_I2C" instead of "#else"

 MAINTAINERS                       |    2 +-
 MAKEALL                           |    1 +
 Makefile                          |    3 +
 board/keymile/common/common.c     |    6 +-
 board/keymile/km_arm/Makefile     |   51 ++++++
 board/keymile/km_arm/config.mk    |   28 ++++
 board/keymile/km_arm/km_arm.c     |  324 
+++++++++++++++++++++++++++++++++++++
 board/keymile/km_arm/kwbimage.cfg |  176 ++++++++++++++++++++
 include/configs/km_arm.h          |  191 ++++++++++++++++++++++
Quoted 9 lines
 include/configs/suen3.h           |  103 ++++++++++++
 10 files changed, 882 insertions(+), 3 deletions(-)
 create mode 100644 board/keymile/km_arm/Makefile
 create mode 100644 board/keymile/km_arm/config.mk
 create mode 100644 board/keymile/km_arm/km_arm.c
 create mode 100644 board/keymile/km_arm/kwbimage.cfg
 create mode 100644 include/configs/km_arm.h
 create mode 100644 include/configs/suen3.h

Applied to u-boot-marvell.git master branch

Regards..
Prafulla . .