powerpc/82xx/km: add testpin detection for mgcoge3ne
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 <holger.brunck@keymile.com> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
This commit is contained in:
parent
74edc607d6
commit
d3f1d6f434
|
@ -354,8 +354,11 @@ static int do_checktestboot(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||||
|
|
||||||
#if defined(CONFIG_POST)
|
#if defined(CONFIG_POST)
|
||||||
testpin = post_hotkeys_pressed();
|
testpin = post_hotkeys_pressed();
|
||||||
s = getenv("test_bank");
|
|
||||||
#endif
|
#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 */
|
/* when test_bank is not set, act as if testpin is not asserted */
|
||||||
testboot = (testpin != 0) && (s);
|
testboot = (testpin != 0) && (s);
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
|
|
|
@ -134,6 +134,8 @@ int wait_for_fpga_config(void);
|
||||||
int fpga_reset(void);
|
int fpga_reset(void);
|
||||||
int toggle_eeprom_spi_bus(void);
|
int toggle_eeprom_spi_bus(void);
|
||||||
|
|
||||||
|
int get_testpin(void);
|
||||||
|
|
||||||
int set_km_env(void);
|
int set_km_env(void);
|
||||||
int fdt_set_node_and_value(void *blob,
|
int fdt_set_node_and_value(void *blob,
|
||||||
char *nodename,
|
char *nodename,
|
||||||
|
|
|
@ -473,3 +473,12 @@ int ft_board_setup(void *blob, bd_t *bd)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
|
#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
|
||||||
|
|
Loading…
Reference in New Issue