From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Mon, 16 Nov 2015 11:58:14 +0100 Subject: [U-Boot] [PATCH 04/17] powerpc/82xx/km: add testpin detection for mgcoge3ne In-Reply-To: <1447426768-23226-5-git-send-email-valentin.longchamp@keymile.com> References: <1447426768-23226-1-git-send-email-valentin.longchamp@keymile.com> <1447426768-23226-5-git-send-email-valentin.longchamp@keymile.com> Message-ID: <5649B6C6.4020700@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Valentin, Am 13.11.2015 um 15:59 schrieb Valentin Longchamp: > From: Holger Brunck > > On mgcoge3ne we also want to start the test application if the testpin > is asserted. But we don't have a full POST test support yet. So simply > add a function to read the testpin value. > > Signed-off-by: Holger Brunck > Signed-off-by: Valentin Longchamp > --- > > board/keymile/common/common.c | 5 ++++- > board/keymile/common/common.h | 2 ++ > board/keymile/km82xx/km82xx.c | 9 +++++++++ > 3 files changed, 15 insertions(+), 1 deletion(-) same here ... gpio support would be great. Reviewed-by: Heiko Schocher bye, Heiko > > diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c > index b9aff1a..8de129d 100644 > --- a/board/keymile/common/common.c > +++ b/board/keymile/common/common.c > @@ -354,8 +354,11 @@ static int do_checktestboot(cmd_tbl_t *cmdtp, int flag, int argc, > > #if defined(CONFIG_POST) > testpin = post_hotkeys_pressed(); > - s = getenv("test_bank"); > #endif > +#if defined(CONFIG_MGCOGE3NE) > + testpin = get_testpin(); > +#endif > + s = getenv("test_bank"); > /* when test_bank is not set, act as if testpin is not asserted */ > testboot = (testpin != 0) && (s); > if (verbose) { > diff --git a/board/keymile/common/common.h b/board/keymile/common/common.h > index dcfefc4..c74f569 100644 > --- a/board/keymile/common/common.h > +++ b/board/keymile/common/common.h > @@ -134,6 +134,8 @@ int wait_for_fpga_config(void); > int fpga_reset(void); > int toggle_eeprom_spi_bus(void); > > +int get_testpin(void); > + > int set_km_env(void); > int fdt_set_node_and_value(void *blob, > char *nodename, > diff --git a/board/keymile/km82xx/km82xx.c b/board/keymile/km82xx/km82xx.c > index 03cd10c..cc9a7c9 100644 > --- a/board/keymile/km82xx/km82xx.c > +++ b/board/keymile/km82xx/km82xx.c > @@ -473,3 +473,12 @@ int ft_board_setup(void *blob, bd_t *bd) > return 0; > } > #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */ > + > +#if defined(CONFIG_MGCOGE3NE) > +int get_testpin(void) > +{ > + /* Testpin is Port C pin 29 - enable = low */ > + int testpin = !get_pin(0x00000004, 2); > + return testpin; > +} > +#endif > -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany