[U-Boot] [PATCH 0/6] further updates for keymile powerpc 83xx boards

This patchserie provides further updates for km ppc 83xx boards. One serie is already posted but until now not committed. This patch serie therefore is made on top of the first serie: http://lists.denx.de/pipermail/u-boot/2012-March/120694.html
Beside some enhancements for kmcoge5ne, there are two common features for keymile boards changed. This is the change in the bootlimit and the addition of the check of the SW in a test_bank.
Only km code is changed, there is no change in common u-boot code.
Holger Brunck (1): km/common: increase bootlimit to 3
Stefan Bigler (1): powerpc/83xx/km: added missing enable of application buffer
Thomas Herzmann (4): km/common: fixed error in ethaddr (1-byte-shift) powerpc/83xx: configure CONFIG_POST for kmcoge5ne powerpc/83xx/km: readout dip_switch on kmcoge5ne km/common: check test_bank and testpin for testboot
board/keymile/common/common.c | 36 +++++++++++++++++++++++++ board/keymile/common/common.h | 8 +++++- board/keymile/common/ivm.c | 2 +- board/keymile/km83xx/km83xx.c | 50 +++++++++++++++++++++++++++++++++++ include/configs/km/keymile-common.h | 6 +++- include/configs/km8360.h | 8 +++++ 6 files changed, 106 insertions(+), 4 deletions(-)

From: Thomas Herzmann thomas.herzmann@keymile.com
The MAC address begins at offset 1.
Signed-off-by: Thomas Herzmann thomas.herzmann@keymile.com Signed-off-by: Holger Brunck holger.brunck@keymile.com --- board/keymile/common/ivm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/board/keymile/common/ivm.c b/board/keymile/common/ivm.c index 70d7845..9bc3c21 100644 --- a/board/keymile/common/ivm.c +++ b/board/keymile/common/ivm.c @@ -218,7 +218,7 @@ static int ivm_analyze_block2(unsigned char *buf, int len) buf[4] = (val >> 16) & 0xff; buf[5] = (val >> 8) & 0xff; buf[6] = val & 0xff; - sprintf((char *)valbuf, "%pM", buf); + sprintf((char *)valbuf, "%pM", buf + 1); } #endif #ifdef MACH_TYPE_KM_KIRKWOOD

Increase bootlimit to 3 to be more tolerant during the boot process before switching to the backup application.
Signed-off-by: Holger Brunck holger.brunck@keymile.com --- include/configs/km/keymile-common.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/configs/km/keymile-common.h b/include/configs/km/keymile-common.h index 4f606a0..04f39c1 100644 --- a/include/configs/km/keymile-common.h +++ b/include/configs/km/keymile-common.h @@ -250,7 +250,7 @@ "setenv altbootcmd 'setenv boot_bank ${backup_bank}; " \ "run ${subbootcmds}; reset' && " \ "saveenv && saveenv && boot\0" \ - "bootlimit=2\0" \ + "bootlimit=3\0" \ "init=/sbin/init-overlay.sh\0" \ "load_addr_r="xstr(CONFIG_KM_KERNEL_ADDR) "\0" \ "load=tftpboot ${load_addr_r} ${u-boot}\0" \

From: Stefan Bigler stefan.bigler@keymile.com
Enabled application buffers in uboot to allow application chipselect access in uboot.
Signed-off-by: Stefan Bigler stefan.bigler@keymile.com --- board/keymile/common/common.h | 2 ++ board/keymile/km83xx/km83xx.c | 2 ++ 2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/board/keymile/common/common.h b/board/keymile/common/common.h index 6c1f640..db117c7 100644 --- a/board/keymile/common/common.h +++ b/board/keymile/common/common.h @@ -16,6 +16,8 @@ #define WRG_LED 0x02 #define WRL_BOOT 0x01
+#define OPRTL_XBUFENA 0x20 + #define H_OPORTS_SCC4_ENA 0x10 #define H_OPORTS_SCC4_FD_ENA 0x04 #define H_OPORTS_FCC1_PW_DWN 0x01 diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c index 1043ccd..a889750 100644 --- a/board/keymile/km83xx/km83xx.c +++ b/board/keymile/km83xx/km83xx.c @@ -173,6 +173,8 @@ int board_early_init_r(void) setbits_8(&base->pgy_eth, 0x01); /* enable the Unit LED (green) */ setbits_8(&base->oprth, WRL_BOOT); + /* enable Application Buffer */ + setbits_8(&base->oprtl, OPRTL_XBUFENA);
#if defined(CONFIG_SUVD3) /* configure UPMA for APP1 */

From: Thomas Herzmann thomas.herzmann@keymile.com
kmcoge5ne starts the post tests if the testpin on the board was enabled. Currently it does simply a memory test.
Signed-off-by: Thomas Herzmann thomas.herzmann@keymile.com Signed-off-by: Holger Brunck holger.brunck@keymile.com --- board/keymile/common/common.h | 6 +++++- board/keymile/km83xx/km83xx.c | 37 +++++++++++++++++++++++++++++++++++++ include/configs/km8360.h | 8 ++++++++ 3 files changed, 50 insertions(+), 1 deletions(-)
diff --git a/board/keymile/common/common.h b/board/keymile/common/common.h index db117c7..f457aa3 100644 --- a/board/keymile/common/common.h +++ b/board/keymile/common/common.h @@ -32,7 +32,11 @@ struct km_bec_fpga { unsigned char res1[3]; unsigned char bprth; unsigned char bprtl; - unsigned char res2[6]; + unsigned char gprt3; + unsigned char gprt2; + unsigned char gprt1; + unsigned char gprt0; + unsigned char res2[2]; unsigned char prst; unsigned char res3[0xfff0]; unsigned char pgy_id; diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c index a889750..f05cdfd 100644 --- a/board/keymile/km83xx/km83xx.c +++ b/board/keymile/km83xx/km83xx.c @@ -27,6 +27,7 @@ #include <asm/processor.h> #include <pci.h> #include <libfdt.h> +#include <post.h>
#include "../common/common.h"
@@ -288,3 +289,39 @@ int hush_init_var(void) return 0; } #endif + +#if defined(CONFIG_POST) +int post_hotkeys_pressed(void) +{ + int testpin = 0; + struct km_bec_fpga *base = + (struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE; + int testpin_reg = in_8(&base->CONFIG_TESTPIN_REG); + testpin = (testpin_reg & CONFIG_TESTPIN_MASK) != 0; + debug("post_hotkeys_pressed: %d\n", !testpin); + return testpin; +} + +ulong post_word_load(void) +{ + void* addr = (ulong *) (CPM_POST_WORD_ADDR); + debug("post_word_load 0x%08lX: 0x%08X\n", (ulong)addr, in_le32(addr)); + return in_le32(addr); + +} +void post_word_store(ulong value) +{ + void* addr = (ulong *) (CPM_POST_WORD_ADDR); + debug("post_word_store 0x%08lX: 0x%08lX\n", (ulong)addr, value); + out_le32(addr, value); +} + +int arch_memory_test_prepare(u32 *vstart, u32 *size, phys_addr_t *phys_offset) +{ + *vstart = CONFIG_SYS_MEMTEST_START; + *size = CONFIG_SYS_MEMTEST_END - CONFIG_SYS_MEMTEST_START; + debug("arch_memory_test_prepare 0x%08X 0x%08X\n", *vstart, *size); + + return 0; +} +#endif diff --git a/include/configs/km8360.h b/include/configs/km8360.h index 230b054..7631ab6 100644 --- a/include/configs/km8360.h +++ b/include/configs/km8360.h @@ -266,6 +266,14 @@ BATU_BL_256M |\ BATU_VS |\ BATU_VP) +/* enable POST tests */ +#define CONFIG_POST (CONFIG_SYS_POST_MEMORY|CONFIG_SYS_POST_MEM_REGIONS) +#define CONFIG_POST_EXTERNAL_WORD_FUNCS /* use own functions, not generic */ +#define CPM_POST_WORD_ADDR CONFIG_SYS_MEMTEST_END +#define CONFIG_TESTPIN_REG gprt3 /* for kmcoge5ne */ +#define CONFIG_TESTPIN_MASK 0x20 /* for kmcoge5ne */ +#define CONFIG_CMD_DIAG /* so that testpin is inquired for POST test */ + #else #define CONFIG_SYS_IBAT6L (0) #define CONFIG_SYS_IBAT6U (0)

From: Thomas Herzmann thomas.herzmann@keymile.com
On kmcoge5ne we have a dip switch present. If this switch was switched on the actual_bank is set to 0 and this SW will be booted.
Signed-off-by: Thomas Herzmann thomas.herzmann@keymile.com Signed-off-by: Holger Brunck holger.brunck@keymile.com --- board/keymile/km83xx/km83xx.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c index f05cdfd..e01a633 100644 --- a/board/keymile/km83xx/km83xx.c +++ b/board/keymile/km83xx/km83xx.c @@ -195,6 +195,17 @@ int misc_init_r(void)
int last_stage_init(void) { +#if defined(CONFIG_KMCOGE5NE) + struct bfticu_iomap *base = + (struct bfticu_iomap *)CONFIG_SYS_BFTIC3_BASE; + u8 dip_switch = in_8((u8 *)&(base->mswitch)) & BFTICU_DIPSWITCH_MASK; + + if (dip_switch != 0) { + /* start bootloader */ + puts("DIP: Enabled\n"); + setenv("actual_bank", "0"); + } +#endif set_km_env(); return 0; }

From: Thomas Herzmann thomas.herzmann@keymile.com
If the testpin is asserted, first check if a test_bank variable is defined before trying to boot this test_bank.
Signed-off-by: Thomas Herzmann thomas.herzmann@keymile.com Signed-off-by: Holger Brunck holger.brunck@keymile.com --- board/keymile/common/common.c | 36 +++++++++++++++++++++++++++++++++++ include/configs/km/keymile-common.h | 4 ++- 2 files changed, 39 insertions(+), 1 deletions(-)
diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c index f262306..1013f42 100644 --- a/board/keymile/common/common.c +++ b/board/keymile/common/common.c @@ -34,6 +34,9 @@ #include <asm/io.h> #include <linux/ctype.h>
+#if defined(CONFIG_POST) +#include "post.h" +#endif #include "common.h" #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) #include <i2c.h> @@ -390,3 +393,36 @@ U_BOOT_CMD(km_checkbidhwk, 2, 0, do_checkboardidhwk, ""boardIdListHex" against stored boardid and hwkey "\ "from the IVM\n v: verbose output" ); + +/* + * command km_checktestboot + * if the testpin of the board is asserted, return 1 + * * else return 0 + */ +int do_checktestboot(cmd_tbl_t *cmdtp, int flag, int argc, + char *const argv[]) +{ + int testpin = 0; + char *s = NULL; + int testboot = 0; + int verbose = argc > 1 && *argv[1] == 'v'; + +#if defined(CONFIG_POST) + testpin = post_hotkeys_pressed(); + s = getenv("test_bank"); +#endif + /* when test_bank is not set, act as if testpin is not asserted */ + testboot = (testpin != 0) && (s); + if (verbose) { + printf("testpin = %d\n", testpin); + printf("test_bank = %s\n", s ? s : "not set"); + printf("boot test app : %s\n", (testboot) ? "yes" : "no"); + } + /* return 0 means: testboot, therefore we need the inversion */ + return !testboot; +} + +U_BOOT_CMD(km_checktestboot, 2, 0, do_checktestboot, + "check if testpin is asserted", + "[v]\n v - verbose output" +); diff --git a/include/configs/km/keymile-common.h b/include/configs/km/keymile-common.h index 04f39c1..b650539 100644 --- a/include/configs/km/keymile-common.h +++ b/include/configs/km/keymile-common.h @@ -245,7 +245,9 @@ CONFIG_KM_DEF_ENV_CONSTANTS \ "altbootcmd=run bootcmd\0" \ "bootcmd=km_checkbidhwk && " \ - " setenv bootcmd 'setenv boot_bank ${actual_bank}; " \ + "setenv bootcmd 'if km_checktestboot; then; " \ + "setenv boot_bank ${test_bank}; else; " \ + "setenv boot_bank ${actual_bank}; fi;" \ "run ${subbootcmds}; reset' && " \ "setenv altbootcmd 'setenv boot_bank ${backup_bank}; " \ "run ${subbootcmds}; reset' && " \

On Fri, 4 May 2012 10:55:52 +0200 Holger Brunck holger.brunck@keymile.com wrote:
This patchserie provides further updates for km ppc 83xx boards. One serie is already posted but until now not committed. This patch serie therefore is made on top of the first serie: http://lists.denx.de/pipermail/u-boot/2012-March/120694.html
Beside some enhancements for kmcoge5ne, there are two common features for keymile boards changed. This is the change in the bootlimit and the addition of the check of the SW in a test_bank.
Only km code is changed, there is no change in common u-boot code.
Holger Brunck (1): km/common: increase bootlimit to 3
Stefan Bigler (1): powerpc/83xx/km: added missing enable of application buffer
Thomas Herzmann (4): km/common: fixed error in ethaddr (1-byte-shift) powerpc/83xx: configure CONFIG_POST for kmcoge5ne powerpc/83xx/km: readout dip_switch on kmcoge5ne km/common: check test_bank and testpin for testboot
board/keymile/common/common.c | 36 +++++++++++++++++++++++++ board/keymile/common/common.h | 8 +++++- board/keymile/common/ivm.c | 2 +- board/keymile/km83xx/km83xx.c | 50 +++++++++++++++++++++++++++++++++++ include/configs/km/keymile-common.h | 6 +++- include/configs/km8360.h | 8 +++++ 6 files changed, 106 insertions(+), 4 deletions(-)
patches 1-6 out of 6 applied.
Thanks,
Kim

Hello Wolfgang Denk,
Please pull:
The following changes since commit fedab338f3459315cb69627fcf46032ec8df1753:
Merge branch 'master' of git://git.denx.de/u-boot-video (2012-06-07 23:42:17 +0200)
are available in the git repository at:
git://git.denx.de/u-boot-mpc83xx.git master
for you to fetch changes up to c1b3d84168ad423b3932f671c0863327fb005599:
km/common: check test_bank and testpin for testboot (2012-06-15 17:12:52 -0500)
---------------------------------------------------------------- Andreas Huber (1): km/common: add support for second flash
Christian Herzig (1): powerpc83xx/km: lock the window size to 2GiB befor fixing sdram size
Holger Brunck (5): powerpc/83xx/km: use tuxx1.h for kmsupx5 target powerpc83xx/km: remove unneeded CONFIG_PCI for kmeter1 powerpc/83xx: add kmcoge5ne board support MAINTAINERS: cleanup for keymile boards km/common: increase bootlimit to 3
Stefan Bigler (1): powerpc/83xx/km: added missing enable of application buffer
Thomas Herzmann (4): km/common: fixed error in ethaddr (1-byte-shift) powerpc/83xx: configure CONFIG_POST for kmcoge5ne powerpc/83xx/km: readout dip_switch on kmcoge5ne km/common: check test_bank and testpin for testboot
Timur Tabi (1): powerpc/83xx: increment malloc heap size for the MPC832x MDS boards
MAINTAINERS | 12 +- board/keymile/common/common.c | 36 +++++ board/keymile/common/common.h | 8 +- board/keymile/common/ivm.c | 2 +- board/keymile/km83xx/km83xx.c | 54 ++++++- boards.cfg | 11 +- include/configs/MPC832XEMDS.h | 2 +- include/configs/km/keymile-common.h | 40 +++-- include/configs/km/km82xx-common.h | 2 +- include/configs/km/km83xx-common.h | 13 +- include/configs/km/km_arm.h | 15 +- include/configs/km8360.h | 289 +++++++++++++++++++++++++++++++++++ include/configs/kmeter1.h | 187 ----------------------- include/configs/kmsupx5.h | 91 ----------- include/configs/tuxx1.h | 22 +-- 15 files changed, 461 insertions(+), 323 deletions(-) create mode 100644 include/configs/km8360.h delete mode 100644 include/configs/kmeter1.h
Thanks,
Kim

Dear Kim Phillips,
In message 20120615173255.46192b1c3862d931ed7dbda9@freescale.com you wrote:
Hello Wolfgang Denk,
Please pull:
The following changes since commit fedab338f3459315cb69627fcf46032ec8df1753:
Merge branch 'master' of git://git.denx.de/u-boot-video (2012-06-07 23:42:17 +0200)
are available in the git repository at:
git://git.denx.de/u-boot-mpc83xx.git master
for you to fetch changes up to c1b3d84168ad423b3932f671c0863327fb005599:
km/common: check test_bank and testpin for testboot (2012-06-15 17:12:52 -0500)
Andreas Huber (1): km/common: add support for second flash
Christian Herzig (1): powerpc83xx/km: lock the window size to 2GiB befor fixing sdram size
Holger Brunck (5): powerpc/83xx/km: use tuxx1.h for kmsupx5 target powerpc83xx/km: remove unneeded CONFIG_PCI for kmeter1 powerpc/83xx: add kmcoge5ne board support MAINTAINERS: cleanup for keymile boards km/common: increase bootlimit to 3
Stefan Bigler (1): powerpc/83xx/km: added missing enable of application buffer
Thomas Herzmann (4): km/common: fixed error in ethaddr (1-byte-shift) powerpc/83xx: configure CONFIG_POST for kmcoge5ne powerpc/83xx/km: readout dip_switch on kmcoge5ne km/common: check test_bank and testpin for testboot
Timur Tabi (1): powerpc/83xx: increment malloc heap size for the MPC832x MDS boards
MAINTAINERS | 12 +- board/keymile/common/common.c | 36 +++++ board/keymile/common/common.h | 8 +- board/keymile/common/ivm.c | 2 +- board/keymile/km83xx/km83xx.c | 54 ++++++- boards.cfg | 11 +- include/configs/MPC832XEMDS.h | 2 +- include/configs/km/keymile-common.h | 40 +++-- include/configs/km/km82xx-common.h | 2 +- include/configs/km/km83xx-common.h | 13 +- include/configs/km/km_arm.h | 15 +- include/configs/km8360.h | 289 +++++++++++++++++++++++++++++++++++ include/configs/kmeter1.h | 187 ----------------------- include/configs/kmsupx5.h | 91 ----------- include/configs/tuxx1.h | 22 +-- 15 files changed, 461 insertions(+), 323 deletions(-) create mode 100644 include/configs/km8360.h delete mode 100644 include/configs/kmeter1.h
Applied, thanks.
Best regards,
Wolfgang Denk
participants (3)
-
Holger Brunck
-
Kim Phillips
-
Wolfgang Denk