summaryrefslogtreecommitdiff
path: root/board/keymile
diff options
context:
space:
mode:
authorThomas Herzmann <thomas.herzmann@keymile.com>2012-07-05 05:05:10 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2012-07-07 14:07:37 +0200
commitb8cf7cc8860d30b85b08377183688bf9564896bf (patch)
tree517542249a8d81efeba24b60365992aecb4846fb /board/keymile
parentdbdee4ca591a3bf19446d8ab89285835e210b378 (diff)
downloadu-boot-imx-b8cf7cc8860d30b85b08377183688bf9564896bf.zip
u-boot-imx-b8cf7cc8860d30b85b08377183688bf9564896bf.tar.gz
u-boot-imx-b8cf7cc8860d30b85b08377183688bf9564896bf.tar.bz2
arm/km: add implementation for read_dip_switch
Add a function to read the dip_switch on kmcoge5un. If the switch is set the actual_bank is set to 0 and this SW is booted. Signed-off-by: Thomas Herzmann <thomas.herzmann@keymile.com> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Diffstat (limited to 'board/keymile')
-rw-r--r--board/keymile/km_arm/km_arm.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c
index ed2454f..ea5d0db 100644
--- a/board/keymile/km_arm/km_arm.c
+++ b/board/keymile/km_arm/km_arm.c
@@ -285,12 +285,24 @@ int board_init(void)
int board_late_init(void)
{
+#if defined(CONFIG_KMCOGE5UN)
+/* I/O pin to erase flash RGPP09 = MPP43 */
+#define KM_FLASH_ERASE_ENABLE 43
+ u8 dip_switch = kw_gpio_get_value(KM_FLASH_ERASE_ENABLE);
+
+ /* if pin 1 do full erase */
+ if (dip_switch != 0) {
+ /* start bootloader */
+ puts("DIP: Enabled\n");
+ setenv("actual_bank", "0");
+ }
+#endif
+
#if defined(CONFIG_KM_FPGA_CONFIG)
wait_for_fpga_config();
fpga_reset();
toggle_eeprom_spi_bus();
#endif
-
return 0;
}