Skip to content
Snippets Groups Projects
Commit e23fde7d authored by Holger Brunck's avatar Holger Brunck Committed by Tom Rini
Browse files

arm/mgcoge3un: check dip_switch at startup


Similar to kmcoge5un we need to check the dip switch at startup
connected to the kirkwood at MPP43. If it's set we need to set the
actual_bank to zero to boot from SW bank zero. Additional to kmcoge5un
we need to check also the pin in misc_init to decide wether we wait for
the ne to start or not. If the dip_switch is set we don't wait and
continue immediately.

Signed-off-by: default avatarHolger Brunck <holger.brunck@keymile.com>
Signed-off-by: default avatarValentin Longchamp <valentin.longchamp@keymile.com>
parent 9ff739e4
No related branches found
No related tags found
No related merge requests found
...@@ -55,6 +55,9 @@ DECLARE_GLOBAL_DATA_PTR; ...@@ -55,6 +55,9 @@ DECLARE_GLOBAL_DATA_PTR;
#define PHY_MARVELL_88E1118R_LED_CTRL_LED1_ACT (0x3<<4) #define PHY_MARVELL_88E1118R_LED_CTRL_LED1_ACT (0x3<<4)
#define PHY_MARVELL_88E1118R_LED_CTRL_LED2_LINK (0x0<<8) #define PHY_MARVELL_88E1118R_LED_CTRL_LED2_LINK (0x0<<8)
/* I/O pin to erase flash RGPP09 = MPP43 */
#define KM_FLASH_ERASE_ENABLE 43
/* Multi-Purpose Pins Functionality configuration */ /* Multi-Purpose Pins Functionality configuration */
static const u32 kwmpp_config[] = { static const u32 kwmpp_config[] = {
MPP0_NF_IO2, MPP0_NF_IO2,
...@@ -201,8 +204,10 @@ int misc_init_r(void) ...@@ -201,8 +204,10 @@ int misc_init_r(void)
{ {
#if defined(CONFIG_KM_MGCOGE3UN) #if defined(CONFIG_KM_MGCOGE3UN)
char *wait_for_ne; char *wait_for_ne;
u8 dip_switch = kw_gpio_get_value(KM_FLASH_ERASE_ENABLE);
wait_for_ne = getenv("waitforne"); wait_for_ne = getenv("waitforne");
if (wait_for_ne != NULL) {
if ((wait_for_ne != NULL) && (dip_switch == 0)) {
if (strcmp(wait_for_ne, "true") == 0) { if (strcmp(wait_for_ne, "true") == 0) {
int cnt = 0; int cnt = 0;
int abort = 0; int abort = 0;
...@@ -291,9 +296,7 @@ int board_init(void) ...@@ -291,9 +296,7 @@ int board_init(void)
int board_late_init(void) int board_late_init(void)
{ {
#if defined(CONFIG_KMCOGE5UN) #if (defined(CONFIG_KMCOGE5UN) | defined(CONFIG_KM_MGCOGE3UN))
/* 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); u8 dip_switch = kw_gpio_get_value(KM_FLASH_ERASE_ENABLE);
/* if pin 1 do full erase */ /* if pin 1 do full erase */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment