summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/keymile/common/common.c11
-rw-r--r--board/keymile/km82xx/km82xx.c8
-rw-r--r--board/keymile/km83xx/km83xx.c24
3 files changed, 31 insertions, 12 deletions
diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 468c755d67c..ef93ed3f66e 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -183,17 +183,6 @@ void i2c_init_board(void)
}
#endif
-
-#if !defined(MACH_TYPE_KM_KIRKWOOD)
-int ethernet_present(void)
-{
- struct km_bec_fpga *base =
- (struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE;
-
- return in_8(&base->bprth) & PIGGY_PRESENT;
-}
-#endif
-
int board_eth_init(bd_t *bis)
{
if (ethernet_present())
diff --git a/board/keymile/km82xx/km82xx.c b/board/keymile/km82xx/km82xx.c
index 67b69f6cb34..defc885db70 100644
--- a/board/keymile/km82xx/km82xx.c
+++ b/board/keymile/km82xx/km82xx.c
@@ -385,6 +385,14 @@ void handle_mgcoge3un_reset(void)
}
#endif
+int ethernet_present(void)
+{
+ struct km_bec_fpga *base =
+ (struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE;
+
+ return in_8(&base->bprth) & PIGGY_PRESENT;
+}
+
/*
* Early board initalization.
*/
diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c
index 83a8753e5a0..b027173725e 100644
--- a/board/keymile/km83xx/km83xx.c
+++ b/board/keymile/km83xx/km83xx.c
@@ -133,6 +133,28 @@ const uint upma_table[] = {
};
#endif
+static int piggy_present(void)
+{
+ struct km_bec_fpga __iomem *base =
+ (struct km_bec_fpga __iomem *)CONFIG_SYS_KMBEC_FPGA_BASE;
+
+ return in_8(&base->bprth) & PIGGY_PRESENT;
+}
+
+#if defined(CONFIG_KMVECT1)
+int ethernet_present(void)
+{
+ /* ethernet port connected to simple switch without piggy */
+ return 1;
+}
+#else
+int ethernet_present(void)
+{
+ return piggy_present();
+}
+#endif
+
+
int board_early_init_r(void)
{
struct km_bec_fpga *base =
@@ -280,7 +302,7 @@ int checkboard(void)
{
puts("Board: Keymile " CONFIG_KM_BOARD_NAME);
- if (ethernet_present())
+ if (piggy_present())
puts(" with PIGGY.");
puts("\n");
return 0;