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>
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 @@
 	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