summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/keymile/mgcoge/mgcoge.c18
-rw-r--r--include/configs/mgcoge.h5
2 files changed, 23 insertions, 0 deletions
diff --git a/board/keymile/mgcoge/mgcoge.c b/board/keymile/mgcoge/mgcoge.c
index 5c9496c..5dcdf37 100644
--- a/board/keymile/mgcoge/mgcoge.c
+++ b/board/keymile/mgcoge/mgcoge.c
@@ -293,6 +293,24 @@ int checkboard(void)
return 0;
}
+#define DIPSWITCH_OFFSET 0x89
+#define DIPSWITCH_MASK 0x0f
+
+int last_stage_init(void)
+{
+ u8 dip_switch;
+ /* Dip switch */
+ dip_switch = readb(CONFIG_SYS_BFTICU_BASE + DIPSWITCH_OFFSET);
+ dip_switch &= DIPSWITCH_MASK;
+ /* dip switch 'full reset' or 'db erase' */
+ if (dip_switch & 0x1 || dip_switch & 0x2) {
+ /* start bootloader */
+ puts("DIP: Enabled\n");
+ setenv("actual_bank", "0");
+ }
+ return 0;
+}
+
/*
* Early board initalization.
*/
diff --git a/include/configs/mgcoge.h b/include/configs/mgcoge.h
index 6dec0ee..f1bd32a 100644
--- a/include/configs/mgcoge.h
+++ b/include/configs/mgcoge.h
@@ -348,4 +348,9 @@
#define OF_TBCLK (bd->bi_busfreq / 4)
#define OF_STDOUT_PATH "/soc/cpm/serial@11a90"
+/* enable last_stage_init */
+#define CONFIG_LAST_STAGE_INIT 1
+/* bfticu address */
+#define CONFIG_SYS_BFTICU_BASE 0x40000000
+
#endif /* __CONFIG_H */