diff options
author | Wolfgang Denk <wd@denx.de> | 2012-06-19 22:14:57 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2012-06-19 22:14:57 +0200 |
commit | df736bd695dd477c2aba99a01345782c597dab05 (patch) | |
tree | 0073f8dbabef4885cd8aac29f616f9fb197c26ed /board/keymile/common | |
parent | 8d75c8964baa76d097edb4aa4b0474600f2998ba (diff) | |
parent | c1b3d84168ad423b3932f671c0863327fb005599 (diff) | |
download | u-boot-imx-df736bd695dd477c2aba99a01345782c597dab05.zip u-boot-imx-df736bd695dd477c2aba99a01345782c597dab05.tar.gz u-boot-imx-df736bd695dd477c2aba99a01345782c597dab05.tar.bz2 |
Merge branch 'master' of git://git.denx.de/u-boot-mpc83xx
* 'master' of git://git.denx.de/u-boot-mpc83xx:
km/common: check test_bank and testpin for testboot
powerpc/83xx/km: readout dip_switch on kmcoge5ne
powerpc/83xx: configure CONFIG_POST for kmcoge5ne
powerpc/83xx/km: added missing enable of application buffer
km/common: increase bootlimit to 3
km/common: fixed error in ethaddr (1-byte-shift)
MAINTAINERS: cleanup for keymile boards
powerpc/83xx: add kmcoge5ne board support
km/common: add support for second flash
powerpc83xx/km: remove unneeded CONFIG_PCI for kmeter1
powerpc83xx/km: lock the window size to 2GiB befor fixing sdram size
powerpc/83xx/km: use tuxx1.h for kmsupx5 target
powerpc/83xx: increment malloc heap size for the MPC832x MDS boards
Signed-off-by: Wolfgang Denk <wd@denx.de>
Diffstat (limited to 'board/keymile/common')
-rw-r--r-- | board/keymile/common/common.c | 36 | ||||
-rw-r--r-- | board/keymile/common/common.h | 8 | ||||
-rw-r--r-- | board/keymile/common/ivm.c | 2 |
3 files changed, 44 insertions, 2 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/board/keymile/common/common.h b/board/keymile/common/common.h index 6c1f640..f457aa3 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 @@ -30,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/common/ivm.c b/board/keymile/common/ivm.c index 70d78457f..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 |