]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
powerpc/82xx/km: add testpin detection for mgcoge3ne
authorHolger Brunck <holger.brunck@keymile.com>
Tue, 17 Nov 2015 09:53:26 +0000 (10:53 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 18 Nov 2015 20:28:53 +0000 (15:28 -0500)
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>
board/keymile/common/common.c
board/keymile/common/common.h
board/keymile/km82xx/km82xx.c

index b9aff1a84dcb4bf0c7f82184c7f948d5269af70e..8de129dc83f2a342f51abbbeec92c599c3f3c870 100644 (file)
@@ -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) {
index dcfefc46b3448ee3a4bb9b8ae09a1b659f2beaca..c74f569a61ab71d18f1e857f755f07f653b64c3b 100644 (file)
@@ -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,
index 03cd10c58b62a14672d06ad51913e2ff767c2e96..cc9a7c9a8eb3a0cbb6d21b1962a93f644043edcf 100644 (file)
@@ -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