Skip to contentSkip to conversation

arm/km: drop unneeded define

PATCH New Holger Brunck 3 participants 16 messages Jan 27, 2014 – Feb 13, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/8 arm/km: drop unneeded define

CONFIG_BOOTCOUNT_LIMIT is used on all boards from this board series. So remove this unneeded define.

---
 board/keymile/km_arm/km_arm.c | 4 ----
 1 file changed, 4 deletions(-)
board/keymile/km_arm/km_arm.c +0 -4
index 5620737..946cbed 100644
@@ -164,7 +164,6 @@ static int initialize_unit_leds(void)
 	return 0;
 }
 
-#if defined(CONFIG_BOOTCOUNT_LIMIT)
 static void set_bootcount_addr(void)
 {
 	uchar buf[32];
@@ -173,7 +172,6 @@ static void set_bootcount_addr(void)
 	sprintf((char *)buf, "0x%x", bootcountaddr);
 	setenv("bootcountaddr", (char *)buf);
 }
-#endif
 
 int misc_init_r(void)
 {
@@ -210,9 +208,7 @@ int misc_init_r(void)
 
 	initialize_unit_leds();
 	set_km_env();
-#if defined(CONFIG_BOOTCOUNT_LIMIT)
 	set_bootcount_addr();
-#endif
 	return 0;
 }
 
Signature · 1 line
1.8.0.1
#1 lore raw

PATCH 2/8 arm/km: make local function startup_allowed static

---
 board/keymile/km_arm/km_arm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/keymile/km_arm/km_arm.c +1 -1
index 946cbed..c104896 100644
@@ -102,7 +102,7 @@ static const u32 kwmpp_config[] = {
 /*
  * Wait for startup OK from mgcoge3ne
  */
-int startup_allowed(void)
+static int startup_allowed(void)
 {
 	unsigned char buf;
 
Signature · 1 line
1.8.0.1
#2 lore raw

PATCH 3/8 arm/km/suv31: switch to 256MB RAM

In reply to Holger Brunck

We now use 256MB RAM instead of 128MB. We can use the same config file as kmnusa.

---
 include/configs/km_kirkwood.h | 3 +++
 1 file changed, 3 insertions(+)
include/configs/km_kirkwood.h +3 -0
index 74c7232..2bd89b1 100644
@@ -97,6 +97,9 @@
 #define CONFIG_KM_IVM_BUS		1	/* I2C2 (Mux-Port 1)*/
 #define CONFIG_IDENT_STRING		"\nKeymile SUV31"
 #define CONFIG_HOSTNAME			kmsuv31
+#undef CONFIG_SYS_KWD_CONFIG
+#define CONFIG_SYS_KWD_CONFIG \
+		$(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage_128M16_1.cfg
 #define CONFIG_KM_ENV_IS_IN_SPI_NOR
 #define CONFIG_KM_FPGA_CONFIG
 
Signature · 1 line
1.8.0.1
#3 lore raw

PATCH 4/8 arm/km: add CONFIG_KM_BOARD_EXTRA_ENV to default environment

In reply to Holger Brunck

This is needed for board specific additional environment variables. E.g. the mgcoge3un has this additional "waitforne" variable.

---
 include/configs/km/km_arm.h | 5 +++++
 1 file changed, 5 insertions(+)
include/configs/km/km_arm.h +5 -0
index e74f85f..6278e76 100644
@@ -289,10 +289,15 @@ int get_scl(void);
 		" ${addr} " __stringify(CONFIG_ENV_OFFSET_REDUND) " 4\0"
 #endif
 
+#ifndef CONFIG_KM_BOARD_EXTRA_ENV
+#define CONFIG_KM_BOARD_EXTRA_ENV       ""
+#endif
+
 /*
  * Default environment variables
  */
 #define CONFIG_EXTRA_ENV_SETTINGS					\
+	CONFIG_KM_BOARD_EXTRA_ENV					\
 	CONFIG_KM_DEF_ENV						\
 	CONFIG_KM_NEW_ENV						\
 	"arch=arm\0"							\
Signature · 1 line
1.8.0.1
#4 lore raw

PATCH 5/8 arm/km: fix wrong error handling

In reply to Holger Brunck

miiphy_read and miiphy_write are returning 0 on success.

---
 board/keymile/km_arm/km_arm.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
board/keymile/km_arm/km_arm.c +5 -5
index c104896..5f32e70 100644
@@ -318,15 +318,15 @@ void reset_phy(void)
 		return;
 
 	/* RGMII clk transition on data stable */
-	if (!miiphy_read(name, CONFIG_PHY_BASE_ADR, PHY_SPEC_CTRL_REG, &reg))
+	if (miiphy_read(name, CONFIG_PHY_BASE_ADR, PHY_SPEC_CTRL_REG, &reg))
 		printf("Error reading PHY spec ctrl reg\n");
-	if (!miiphy_write(name, CONFIG_PHY_BASE_ADR, PHY_SPEC_CTRL_REG,
-		reg | PHY_RGMII_CLK_STABLE | PHY_CLSA))
+	if (miiphy_write(name, CONFIG_PHY_BASE_ADR, PHY_SPEC_CTRL_REG,
+			 reg | PHY_RGMII_CLK_STABLE | PHY_CLSA))
 		printf("Error writing PHY spec ctrl reg\n");
 
 	/* leds setup */
-	if (!miiphy_write(name, CONFIG_PHY_BASE_ADR, PHY_LED_SEL_REG,
-		PHY_LED0_LINK | PHY_LED1_ACT | PHY_LED2_INT))
+	if (miiphy_write(name, CONFIG_PHY_BASE_ADR, PHY_LED_SEL_REG,
+			 PHY_LED0_LINK | PHY_LED1_ACT | PHY_LED2_INT))
 		printf("Error writing PHY LED reg\n");
 
 	/* reset the phy */
Signature · 1 line
1.8.0.1
#5 lore raw

PATCH 6/8 arm/km: enable FDT for km_kirwkood

In reply to Holger Brunck

From: Gerlando Falauto <[email protected]>

This consists of:
a) Defining the addresses, enabling fdtsupport [arm]
b) Defining "cramfsloadfdt" [arm,powerpc => common]
c) Adding the FDT address to bootm [arm,powerpc => common]
d) Defining "tftpfdt" in ramfs-,develop- [arm,powerpc >= common]

This should work with 3.10 kernels, whether loaded through TFTP (with rootfs either through NFS or TFTP-ramfs) or from the NAND.

The machid was left unchanged, this should keep compatibility with both older and newer kernels.

---
 board/keymile/scripts/develop-arm.txt      | 1 -
 board/keymile/scripts/develop-common.txt   | 1 +
 board/keymile/scripts/develop-ppc_82xx.txt | 1 -
 board/keymile/scripts/develop-ppc_8xx.txt  | 1 -
 board/keymile/scripts/ramfs-arm.txt        | 1 -
 board/keymile/scripts/ramfs-common.txt     | 1 +
 board/keymile/scripts/ramfs-ppc_82xx.txt   | 1 -
 board/keymile/scripts/ramfs-ppc_8xx.txt    | 1 -
 include/configs/km/keymile-common.h        | 5 +++++
 include/configs/km/km-powerpc.h            | 5 -----
 include/configs/km/km_arm.h                | 8 +++++---
 11 files changed, 12 insertions(+), 14 deletions(-)
board/keymile/scripts/develop-arm.txt +0 -1
index 922afea..d3c974f 100644
@@ -1,2 +1 @@
 setup_debug_env=tftpboot 0x200000 scripts/develop-common.txt && env import -t 0x200000 ${filesize} && run configure
-tftpfdt=true
board/keymile/scripts/develop-common.txt +1 -0
index a6bb1b1..f49b26a 100644
@@ -3,6 +3,7 @@ bootcmd=run ${subbootcmds}
 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}
+tftpfdt=tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb
 tftpkernel=tftpboot ${load_addr_r} ${hostname}/${uimage}
 toolchain=/opt/eldk
 rootfssize=0
board/keymile/scripts/develop-ppc_82xx.txt +0 -1
index 909f6a3..d3c974f 100644
@@ -1,2 +1 @@
 setup_debug_env=tftpboot 0x200000 scripts/develop-common.txt && env import -t 0x200000 ${filesize} && run configure
-tftpfdt=tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb
board/keymile/scripts/develop-ppc_8xx.txt +0 -1
index 909f6a3..d3c974f 100644
@@ -1,2 +1 @@
 setup_debug_env=tftpboot 0x200000 scripts/develop-common.txt && env import -t 0x200000 ${filesize} && run configure
-tftpfdt=tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb
board/keymile/scripts/ramfs-arm.txt +0 -1
index 79974f1..87e984e 100644
@@ -1,2 +1 @@
 setup_debug_env=tftpboot 0x200000 scripts/ramfs-common.txt && env import -t 0x200000 ${filesize} && run configure
-tftpfdt=true
board/keymile/scripts/ramfs-common.txt +1 -0
index 502c863..0cfb36f 100644
@@ -7,6 +7,7 @@ nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath}
 configure=run set_uimage; km_setboardid && saveenv && reset
 rootfsfile=${hostname}/rootfsImage
 setrootfsaddr=setexpr value ${pnvramaddr} - ${rootfssize} && setenv rootfsaddr 0x${value}
+tftpfdt=tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb
 tftpkernel=tftpboot ${load_addr_r} ${hostname}/${uimage}
 tftpramfs=tftpboot ${rootfsaddr} ${hostname}/rootfsImage
 set_uimage=printenv uimage || setenv uimage uImage
board/keymile/scripts/ramfs-ppc_82xx.txt +0 -1
index 970927a..87e984e 100644
@@ -1,2 +1 @@
 setup_debug_env=tftpboot 0x200000 scripts/ramfs-common.txt && env import -t 0x200000 ${filesize} && run configure
-tftpfdt=tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb
board/keymile/scripts/ramfs-ppc_8xx.txt +0 -1
index 970927a..87e984e 100644
@@ -1,2 +1 @@
 setup_debug_env=tftpboot 0x200000 scripts/ramfs-common.txt && env import -t 0x200000 ${filesize} && run configure
-tftpfdt=tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb
include/configs/km/keymile-common.h +5 -0
index 2a15ad4..cb53dbd 100644
@@ -220,6 +220,7 @@
 	CONFIG_KM_DEF_ENV_FLASH_BOOT					\
 	CONFIG_KM_DEF_ENV_CONSTANTS					\
 	"altbootcmd=run bootcmd\0"					\
+	"boot=bootm ${load_addr_r} - ${fdt_addr_r}\0"			\
 	"bootcmd=km_checkbidhwk &&  "					\
 		"setenv bootcmd \'if km_checktestboot; then; "          \
 				"setenv boot_bank ${test_bank}; else; " \
@@ -229,6 +230,10 @@
 			"run ${subbootcmds}; reset\' && "		\
 		"saveenv && saveenv && boot\0"				\
 	"bootlimit=3\0"							\
+	"cramfsloadfdt="						\
+		"cramfsload ${fdt_addr_r} "				\
+		"fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb\0"		\
+	"fdt_addr_r="__stringify(CONFIG_KM_FDT_ADDR) "\0"		\
 	"init=/sbin/init-overlay.sh\0"					\
 	"load_addr_r="__stringify(CONFIG_KM_KERNEL_ADDR) "\0"		\
 	"load=tftpboot ${load_addr_r} ${u-boot}\0"			\
include/configs/km/km-powerpc.h +0 -5
index 2cebb2b..b03fdd9 100644
@@ -70,11 +70,6 @@
 #define CONFIG_KM_DEF_BOOT_ARGS_CPU		""
 
 #define CONFIG_KM_DEF_ENV_CPU						\
-	"boot=bootm ${load_addr_r} - ${fdt_addr_r}\0"			\
-	"cramfsloadfdt="						\
-		"cramfsload ${fdt_addr_r} "				\
-		"fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb\0"		\
-	"fdt_addr_r=" __stringify(CONFIG_KM_FDT_ADDR) "\0"		\
 	"u-boot="__stringify(CONFIG_HOSTNAME) "/u-boot.bin\0"		\
 	"update="							\
 		"protect off " __stringify(BOOTFLASH_START) " +${filesize} && "\
include/configs/km/km_arm.h +5 -3
index 6278e76..a5cc1c5 100644
@@ -70,7 +70,8 @@
 #define CONFIG_KM_PHRAM		0x17F000
 
 #define CONFIG_KM_CRAMFS_ADDR	0x2400000
-#define CONFIG_KM_KERNEL_ADDR	0x2000000	/* 4096KBytes */
+#define CONFIG_KM_KERNEL_ADDR	0x2000000	/* 3098KBytes */
+#define CONFIG_KM_FDT_ADDR	0x23E0000	/*  128KBytes */
 
 /* architecture specific default bootargs */
 #define CONFIG_KM_DEF_BOOT_ARGS_CPU					\
@@ -78,8 +79,6 @@
 		" boardid=0x${IVM_BoardId} hwkey=0x${IVM_HWKey}"
 
 #define CONFIG_KM_DEF_ENV_CPU						\
-	"boot=bootm ${load_addr_r} - -\0"				\
-	"cramfsloadfdt=true\0"						\
 	"u-boot="__stringify(CONFIG_HOSTNAME) "/u-boot.kwb\0"		\
 	CONFIG_KM_UPDATE_UBOOT						\
 	""
@@ -87,6 +86,9 @@
 #define CONFIG_SKIP_LOWLEVEL_INIT	/* disable board lowlevel_init */
 #define CONFIG_MISC_INIT_R
 
+/* Pass open firmware flat tree */
+#define CONFIG_OF_LIBFDT
+
 /*
  * NS16550 Configuration
  */
Signature · 1 line
1.8.0.1
#6 lore raw

PATCH 7/8 arm/km: define fdt_high env variable and allow backwards compatibility

In reply to Holger Brunck

From: Gerlando Falauto <[email protected]>

Add set_fdthigh subcommand to "subbootcmds" (release) so to set "fdt_high" This is necessary on Kirkwood so that the FDT does not get relocated above the memory limit that the kernel cannot access
(that is the memory part reserved for the switch).
This was tested on NUSA1, where it is necessary, and on ETER1, where it doesn't seem to hurt.

We want the scripts to also work with older versions of u-boot, where:
a) set_fdthigh is not defined (will be default env for newer u-boots)
b) the fdt will not be available

For this reason, we use "set_fdthigh" to tell whether we are running a newer (FDT-aware) u-boot or not.
So if "set_fdthigh" runs successfully or arch != arm we try loading the fdt; otherwise we proceed normally.

Notice how, contrary to release mode, set_fdthigh will _not_ be part of subbootcmds for develop and ramfs, but will be executed as part of "tftpfdt".

Since this is only needed for kirkwood cards, and it prevents the kernel from booting on QorIQ (though it seemed to work on ETER1), we change its definition in the default env for powerpc so that the value is only set on ARM.

---
 board/keymile/scripts/develop-common.txt | 2 +-
 board/keymile/scripts/ramfs-common.txt   | 2 +-
 include/configs/km/keymile-common.h      | 4 ++--
 include/configs/km/km-powerpc.h          | 1 +
 include/configs/km/km_arm.h              | 1 +
 include/configs/km/kmp204x-common.h      | 1 +
 6 files changed, 7 insertions(+), 4 deletions(-)
board/keymile/scripts/develop-common.txt +1 -1
index f49b26a..a80812a 100644
@@ -3,7 +3,7 @@ bootcmd=run ${subbootcmds}
 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}
-tftpfdt=tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb
+tftpfdt=if run set_fdthigh || test ${arch} != arm; then tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb; else true; fi
 tftpkernel=tftpboot ${load_addr_r} ${hostname}/${uimage}
 toolchain=/opt/eldk
 rootfssize=0
board/keymile/scripts/ramfs-common.txt +1 -1
index 0cfb36f..d79ad2e 100644
@@ -7,7 +7,7 @@ nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath}
 configure=run set_uimage; km_setboardid && saveenv && reset
 rootfsfile=${hostname}/rootfsImage
 setrootfsaddr=setexpr value ${pnvramaddr} - ${rootfssize} && setenv rootfsaddr 0x${value}
-tftpfdt=tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb
+tftpfdt=if run set_fdthigh || test ${arch} != arm; then tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb; else true; fi
 tftpkernel=tftpboot ${load_addr_r} ${hostname}/${uimage}
 tftpramfs=tftpboot ${rootfsaddr} ${hostname}/rootfsImage
 set_uimage=printenv uimage || setenv uimage uImage
include/configs/km/keymile-common.h +2 -2
index cb53dbd..7361072 100644
@@ -135,8 +135,8 @@
  * - 'release': for a standalone system		kernel/rootfs from flash
  */
 #define CONFIG_KM_DEF_ENV_BOOTTARGETS					\
-	"subbootcmds=ubiattach ubicopy cramfsloadfdt cramfsloadkernel "	\
-		"flashargs add_default addpanic boot\0"			\
+	"subbootcmds=ubiattach ubicopy cramfsloadfdt set_fdthigh "	\
+		"cramfsloadkernel flashargs add_default addpanic boot\0"\
 	"develop="							\
 		"tftp 200000 scripts/develop-${arch}.txt && "		\
 		"env import -t 200000 ${filesize} && "			\
include/configs/km/km-powerpc.h +1 -0
index b03fdd9..763c5ba 100644
@@ -77,6 +77,7 @@
 		"cp.b ${load_addr_r} " __stringify(BOOTFLASH_START)	\
 		"  ${filesize} && "					\
 		"protect on " __stringify(BOOTFLASH_START) "  +${filesize}\0"\
+	"set_fdthigh=true\0"						\
 	""
 
 #endif /* __CONFIG_KEYMILE_POWERPC_H */
include/configs/km/km_arm.h +1 -0
index a5cc1c5..6d77680 100644
@@ -81,6 +81,7 @@
 #define CONFIG_KM_DEF_ENV_CPU						\
 	"u-boot="__stringify(CONFIG_HOSTNAME) "/u-boot.kwb\0"		\
 	CONFIG_KM_UPDATE_UBOOT						\
+	"set_fdthigh=setenv fdt_high ${kernelmem}\0"			\
 	""
 
 #define CONFIG_SKIP_LOWLEVEL_INIT	/* disable board lowlevel_init */
include/configs/km/kmp204x-common.h +1 -0
index 50330cc..70ea9e9 100644
@@ -421,6 +421,7 @@ unsigned long get_board_sys_clk(unsigned long dummy);
 	"update="							\
 		"sf probe 0;sf erase 0 +${filesize};"			\
 		"sf write ${load_addr_r} 0 ${filesize};\0"		\
+	"set_fdthigh=true\0"						\
 	""
 
 #define CONFIG_HW_ENV_SETTINGS						\
Signature · 1 line
1.8.0.1
#7 lore raw

PATCH 8/8 arm/km: introduce kmsugp1 target

In reply to Holger Brunck

From: Gerlando Falauto <[email protected]>

KMSUGP1 is from a u-boot perspective (almost) identical to KMNUSA. The only difference is that the PCIe reset is connected to Kirkwood pin MPP7_PEX_RST_OUTn, we use a dedicated config flag KM_PCIE_RESET_MPP7. Such pin should theoretically be handled by the PCIe subsystem automatically, but this turned out not to be the case.
So simply configure this PIN as a GPIO and issue a pulse manually.

Cc Karlheinz Jerg <[email protected]>
Cc Valentin Longchamp <[email protected]>
Cc Holger Brunck <[email protected]>
---
 board/keymile/km_arm/fpga_config.c | 26 ++++++++++++++++++++++++++
 board/keymile/km_arm/km_arm.c      |  4 ++++
 boards.cfg                         |  1 +
 include/configs/km_kirkwood.h      | 12 ++++++++++--
 4 files changed, 41 insertions(+), 2 deletions(-)
board/keymile/km_arm/fpga_config.c +26 -0
index cbfc7d2..51a3cfe 100644
@@ -189,6 +189,31 @@ int wait_for_fpga_config(void)
 	return 0;
 }
 
+#if defined(KM_PCIE_RESET_MPP7)
+
+#define KM_PEX_RST_GPIO_PIN	7
+int fpga_reset(void)
+{
+	if (!check_boco2()) {
+		/* we do not have BOCO2, this is not really used */
+		return 0;
+	}
+
+	printf("PCIe reset through GPIO7: ");
+	/* apply PCIe reset via GPIO */
+	kw_gpio_set_valid(KM_PEX_RST_GPIO_PIN, 1);
+	kw_gpio_direction_output(KM_PEX_RST_GPIO_PIN, 1);
+	kw_gpio_set_value(KM_PEX_RST_GPIO_PIN, 0);
+	udelay(1000*10);
+	kw_gpio_set_value(KM_PEX_RST_GPIO_PIN, 1);
+
+	printf(" done\n");
+
+	return 0;
+}
+
+#else
+
 #define PRST1		0x4
 #define PCIE_RST	0x10
 #define TRAFFIC_RST	0x04
@@ -219,6 +244,7 @@ int fpga_reset(void)
 
 	return 0;
 }
+#endif
 
 /* the FPGA was configured, we configure the BOCO2 so that the EEPROM
  * is available from the Bobcat SPI bus */
board/keymile/km_arm/km_arm.c +4 -0
index 5f32e70..35402c8 100644
@@ -46,7 +46,11 @@ static const u32 kwmpp_config[] = {
 	MPP4_NF_IO6,
 	MPP5_NF_IO7,
 	MPP6_SYSRST_OUTn,
+#if defined(KM_PCIE_RESET_MPP7)
+	MPP7_GPO,
+#else
 	MPP7_PEX_RST_OUTn,
+#endif
 #if defined(CONFIG_SYS_I2C_SOFT)
 	MPP8_GPIO,		/* SDA */
 	MPP9_GPIO,		/* SCL */
boards.cfg +1 -0
index a8336cc..5300423 100644
@@ -172,6 +172,7 @@ Active  arm         arm926ejs      kirkwood    keymile         km_arm
 Active  arm         arm926ejs      kirkwood    keymile         km_arm              km_kirkwood_128m16                   km_kirkwood:KM_KIRKWOOD_128M16                                                                                                    Valentin Longchamp <[email protected]>
 Active  arm         arm926ejs      kirkwood    keymile         km_arm              kmcoge5un                            km_kirkwood:KM_COGE5UN                                                                                                            Valentin Longchamp <[email protected]>
 Active  arm         arm926ejs      kirkwood    keymile         km_arm              kmnusa                               km_kirkwood:KM_NUSA                                                                                                               Valentin Longchamp <[email protected]>
+Active  arm         arm926ejs      kirkwood    keymile         km_arm              kmsugp1                              km_kirkwood:KM_SUGP1                                                                                                              Valentin Longchamp <[email protected]>
 Active  arm         arm926ejs      kirkwood    keymile         km_arm              kmsuv31                              km_kirkwood:KM_SUV31                                                                                                              Valentin Longchamp <[email protected]>
 Active  arm         arm926ejs      kirkwood    keymile         km_arm              mgcoge3un                            km_kirkwood:KM_MGCOGE3UN                                                                                                          Valentin Longchamp <[email protected]>
 Active  arm         arm926ejs      kirkwood    keymile         km_arm              portl2                               km_kirkwood:KM_PORTL2                                                                                                             Valentin Longchamp <[email protected]>
include/configs/km_kirkwood.h +10 -2
index 2bd89b1..2cde177 100644
@@ -45,11 +45,19 @@
 #define CONFIG_KM_DISABLE_PCIE
 #define CONFIG_KM_IVM_BUS		1	/* I2C2 (Mux-Port 1)*/
 
-/* KM_NUSA */
-#elif defined(CONFIG_KM_NUSA)
+/* KM_NUSA / KM_SUGP1 */
+#elif defined(CONFIG_KM_NUSA) || defined(CONFIG_KM_SUGP1)
 #define CONFIG_KM_IVM_BUS		1	/* I2C2 (Mux-Port 1)*/
+
+# if defined(CONFIG_KM_NUSA)
 #define CONFIG_IDENT_STRING		"\nKeymile NUSA"
 #define CONFIG_HOSTNAME			kmnusa
+# elif defined(CONFIG_KM_SUGP1)
+#define CONFIG_IDENT_STRING		"\nKeymile SUGP1"
+#define CONFIG_HOSTNAME			kmsugp1
+#define KM_PCIE_RESET_MPP7
+#endif
+
 #undef CONFIG_SYS_KWD_CONFIG
 #define CONFIG_SYS_KWD_CONFIG \
 		$(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage_128M16_1.cfg
Signature · 1 line
1.8.0.1
#8 lore raw

PATCH 8/8 arm/km: introduce kmsugp1 target

Hi Holger,

Quoted 9 lines · Holger Brunck

From: Gerlando Falauto <[email protected]>

KMSUGP1 is from a u-boot perspective (almost) identical to KMNUSA. The only difference is that the PCIe reset is connected to Kirkwood pin MPP7_PEX_RST_OUTn, we use a dedicated config flag KM_PCIE_RESET_MPP7. Such pin should theoretically be handled by the PCIe subsystem automatically, but this turned out not to be the case.
So simply configure this PIN as a GPIO and issue a pulse manually.

Quoted 5 lines
Cc Karlheinz Jerg <[email protected]>
Cc Valentin Longchamp <[email protected]>
Cc Holger Brunck <[email protected]>

---

This one does not apply properly on u-boot-arm/master. Can you look into this and post a V2 (of just 8/8) ?

Amicalement,

Signature · 1 line
Albert.
#9 lore raw

PATCH v2 8/8 arm/km: introduce kmsugp1 target

In reply to Holger Brunck

From: Gerlando Falauto <[email protected]>

KMSUGP1 is from a u-boot perspective (almost) identical to KMNUSA. The only difference is that the PCIe reset is connected to Kirkwood pin MPP7_PEX_RST_OUTn, we use a dedicated config flag KM_PCIE_RESET_MPP7. Such pin should theoretically be handled by the PCIe subsystem automatically, but this turned out not to be the case.
So simply configure this PIN as a GPIO and issue a pulse manually.

Cc Karlheinz Jerg <[email protected]>
Cc Valentin Longchamp <[email protected]>
Cc Holger Brunck <[email protected]>

---
Changes for v2:
- solve merge conflict for latest arm/master branch

 board/keymile/km_arm/fpga_config.c | 26 ++++++++++++++++++++++++++
 board/keymile/km_arm/km_arm.c      |  4 ++++
 boards.cfg                         |  1 +
 include/configs/km_kirkwood.h      | 12 ++++++++++--
 4 files changed, 41 insertions(+), 2 deletions(-)
board/keymile/km_arm/fpga_config.c +26 -0
index cbfc7d2..51a3cfe 100644
@@ -189,6 +189,31 @@ int wait_for_fpga_config(void)
 	return 0;
 }
 
+#if defined(KM_PCIE_RESET_MPP7)
+
+#define KM_PEX_RST_GPIO_PIN	7
+int fpga_reset(void)
+{
+	if (!check_boco2()) {
+		/* we do not have BOCO2, this is not really used */
+		return 0;
+	}
+
+	printf("PCIe reset through GPIO7: ");
+	/* apply PCIe reset via GPIO */
+	kw_gpio_set_valid(KM_PEX_RST_GPIO_PIN, 1);
+	kw_gpio_direction_output(KM_PEX_RST_GPIO_PIN, 1);
+	kw_gpio_set_value(KM_PEX_RST_GPIO_PIN, 0);
+	udelay(1000*10);
+	kw_gpio_set_value(KM_PEX_RST_GPIO_PIN, 1);
+
+	printf(" done\n");
+
+	return 0;
+}
+
+#else
+
 #define PRST1		0x4
 #define PCIE_RST	0x10
 #define TRAFFIC_RST	0x04
@@ -219,6 +244,7 @@ int fpga_reset(void)
 
 	return 0;
 }
+#endif
 
 /* the FPGA was configured, we configure the BOCO2 so that the EEPROM
  * is available from the Bobcat SPI bus */
board/keymile/km_arm/km_arm.c +4 -0
index 5f32e70..35402c8 100644
@@ -46,7 +46,11 @@ static const u32 kwmpp_config[] = {
 	MPP4_NF_IO6,
 	MPP5_NF_IO7,
 	MPP6_SYSRST_OUTn,
+#if defined(KM_PCIE_RESET_MPP7)
+	MPP7_GPO,
+#else
 	MPP7_PEX_RST_OUTn,
+#endif
 #if defined(CONFIG_SYS_I2C_SOFT)
 	MPP8_GPIO,		/* SDA */
 	MPP9_GPIO,		/* SCL */
boards.cfg +1 -0
index a5165c8..f6a7488 100644
@@ -173,6 +173,7 @@ Active  arm         arm926ejs      kirkwood    keymile         km_arm
 Active  arm         arm926ejs      kirkwood    keymile         km_arm              km_kirkwood_pci                      km_kirkwood:KM_KIRKWOOD_PCI                                                                                                       Valentin Longchamp <[email protected]>
 Active  arm         arm926ejs      kirkwood    keymile         km_arm              kmcoge5un                            km_kirkwood:KM_COGE5UN                                                                                                            Valentin Longchamp <[email protected]>
 Active  arm         arm926ejs      kirkwood    keymile         km_arm              kmnusa                               km_kirkwood:KM_NUSA                                                                                                               Valentin Longchamp <[email protected]>
+Active  arm         arm926ejs      kirkwood    keymile         km_arm              kmsugp1                              km_kirkwood:KM_SUGP1                                                                                                              Valentin Longchamp <[email protected]>
 Active  arm         arm926ejs      kirkwood    keymile         km_arm              kmsuv31                              km_kirkwood:KM_SUV31                                                                                                              Valentin Longchamp <[email protected]>
 Active  arm         arm926ejs      kirkwood    keymile         km_arm              mgcoge3un                            km_kirkwood:KM_MGCOGE3UN                                                                                                          Valentin Longchamp <[email protected]>
 Active  arm         arm926ejs      kirkwood    keymile         km_arm              portl2                               km_kirkwood:KM_PORTL2                                                                                                             Valentin Longchamp <[email protected]>
include/configs/km_kirkwood.h +10 -2
index 2bd89b1..2cde177 100644
@@ -45,11 +45,19 @@
 #define CONFIG_KM_DISABLE_PCIE
 #define CONFIG_KM_IVM_BUS		1	/* I2C2 (Mux-Port 1)*/
 
-/* KM_NUSA */
-#elif defined(CONFIG_KM_NUSA)
+/* KM_NUSA / KM_SUGP1 */
+#elif defined(CONFIG_KM_NUSA) || defined(CONFIG_KM_SUGP1)
 #define CONFIG_KM_IVM_BUS		1	/* I2C2 (Mux-Port 1)*/
+
+# if defined(CONFIG_KM_NUSA)
 #define CONFIG_IDENT_STRING		"\nKeymile NUSA"
 #define CONFIG_HOSTNAME			kmnusa
+# elif defined(CONFIG_KM_SUGP1)
+#define CONFIG_IDENT_STRING		"\nKeymile SUGP1"
+#define CONFIG_HOSTNAME			kmsugp1
+#define KM_PCIE_RESET_MPP7
+#endif
+
 #undef CONFIG_SYS_KWD_CONFIG
 #define CONFIG_SYS_KWD_CONFIG \
 		$(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage_128M16_1.cfg
Signature · 1 line
1.8.0.1
#10 lore raw

PATCH v2 8/8 arm/km: introduce kmsugp1 target

Hi Holger,

Quoted 9 lines · Holger Brunck

From: Gerlando Falauto <[email protected]>

KMSUGP1 is from a u-boot perspective (almost) identical to KMNUSA. The only difference is that the PCIe reset is connected to Kirkwood pin MPP7_PEX_RST_OUTn, we use a dedicated config flag KM_PCIE_RESET_MPP7. Such pin should theoretically be handled by the PCIe subsystem automatically, but this turned out not to be the case.
So simply configure this PIN as a GPIO and issue a pulse manually.

Quoted 7 lines
Cc Karlheinz Jerg <[email protected]>
Cc Valentin Longchamp <[email protected]>
Cc Holger Brunck <[email protected]>

---
Changes for v2:
- solve merge conflict for latest arm/master branch

The whole series applied to u-boot-arm/master, thanks!

Amicalement,

Signature · 1 line
Albert.
#11 lore raw

PATCH 1/8 arm/km: drop unneeded define

In reply to Holger Brunck

Hi Holger,

For the whole series: shouldn't the keymile boards maintainer be CC:ed?

Quoted 2 lines · Holger Brunck

CONFIG_BOOTCOUNT_LIMIT is used on all boards from this board series. So remove this unneeded define.

What if a new board/config does not want to use a bootcount limit?

Quoted 26 lines
---
 board/keymile/km_arm/km_arm.c | 4 ----
 1 file changed, 4 deletions(-)
board/keymile/km_arm/km_arm.c +0 -2
index 5620737..946cbed 100644
@@ -164,7 +164,6 @@ static int initialize_unit_leds(void)
 	return 0;
 }
 
-#if defined(CONFIG_BOOTCOUNT_LIMIT)
 static void set_bootcount_addr(void)
 {
 	uchar buf[32];
@@ -173,7 +172,6 @@ static void set_bootcount_addr(void)
 	sprintf((char *)buf, "0x%x", bootcountaddr);
 	setenv("bootcountaddr", (char *)buf);
 }
-#endif
 
 int misc_init_r(void)
 {

board/keymile/km_arm/km_arm.c int misc_init_r(void) · line 214

Quoted 9 lines
board/keymile/km_arm/km_arm.c +0 -2
@@ -210,9 +208,7 @@ int misc_init_r(void)
 
 	initialize_unit_leds();
 	set_km_env();
-#if defined(CONFIG_BOOTCOUNT_LIMIT)
 	set_bootcount_addr();
-#endif
 	return 0;
 }
 

Amicalement,

Signature · 1 line
Albert.
#12 lore raw

PATCH 1/8 arm/km: drop unneeded define

Hi Albert,

Quoted 10 lines · Albert ARIBAUD

For the whole series: shouldn't the keymile boards maintainer be CC:ed?

Quoted 2 lines · Holger Brunck

CONFIG_BOOTCOUNT_LIMIT is used on all boards from this board series. So remove this unneeded define.

What if a new board/config does not want to use a bootcount limit?

all keymile boards use this and I don't see a usecase now and in the future that a board don't need it, thats why I decided to remove this here. IMHO it makes the code more readable to make only configurable what really needs to be configurable.

Best regards
Holger

#13 lore raw

PATCH 1/8 arm/km: drop unneeded define

Hi Holger,

Quoted 11 lines · Holger Brunck

Hi Albert,

Quoted 8 lines · Albert ARIBAUD

For the whole series: shouldn't the keymile boards maintainer be CC:ed?

Quoted 2 lines · Holger Brunck

CONFIG_BOOTCOUNT_LIMIT is used on all boards from this board series. So remove this unneeded define.

Quoted 7 lines
Quoted 2 lines

What if a new board/config does not want to use a bootcount limit?

all keymile boards use this and I don't see a usecase now and in the future that a board don't need it, thats why I decided to remove this here. IMHO it makes the code more readable to make only configurable what really needs to be configurable.

Alright. And what about the keymile boards maintainer?

Quoted 2 lines

Best regards
Holger

Amicalement,

Signature · 1 line
Albert.
#14 lore raw

PATCH 1/8 arm/km: drop unneeded define

Hi Albert,

Quoted 5 lines · Albert ARIBAUD

On Thu, 13 Feb 2014 13:10:51 +0100, Holger Brunck

Quoted 4 lines
Quoted 3 lines

What if a new board/config does not want to use a bootcount limit?

Quoted 7 lines
Quoted 4 lines

all keymile boards use this and I don't see a usecase now and in the future that a board don't need it, thats why I decided to remove this here. IMHO it makes the code more readable to make only configurable what really needs to be configurable.

Alright. And what about the keymile boards maintainer?

ah I see I missed to set Valentin on CC for this patch serie. Ok I add him for this discussion.

@Valentin: Could you Ack this Patch serie or say if something is missing

Regards
Holger

#15 lore raw

PATCH 1/8 arm/km: drop unneeded define

Quoted 13 lines · Holger Brunck

Hi Albert,

Quoted 10 lines · Albert ARIBAUD

On Thu, 13 Feb 2014 13:10:51 +0100, Holger Brunck

Quoted 8 lines
Quoted 3 lines

What if a new board/config does not want to use a bootcount limit?

all keymile boards use this and I don't see a usecase now and in the future that a board don't need it, thats why I decided to remove this here. IMHO it makes the code more readable to make only configurable what really needs to be configurable.

Quoted 8 lines
Quoted 2 lines

Alright. And what about the keymile boards maintainer?

ah I see I missed to set Valentin on CC for this patch serie. Ok I add him for this discussion.

@Valentin: Could you Ack this Patch serie or say if something is missing

I have actually reviewed this series when it was applied in our interanl branch and tested them on most of our kirkwood boards.

So for the whole series: