diff options
Diffstat (limited to 'board')
-rw-r--r-- | board/keymile/common/common.c | 6 | ||||
-rw-r--r-- | board/keymile/common/common.h | 1 | ||||
-rw-r--r-- | board/keymile/km82xx/km82xx.c | 27 |
3 files changed, 30 insertions, 4 deletions
diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c index dc96489..25a3850 100644 --- a/board/keymile/common/common.c +++ b/board/keymile/common/common.c @@ -22,7 +22,7 @@ */ #include <common.h> -#if defined(CONFIG_MGCOGE) || defined(CONFIG_MGCOGE2NE) +#if defined(CONFIG_KM82XX) #include <mpc8260.h> #endif #include <ioports.h> @@ -398,10 +398,10 @@ int ivm_read_eeprom(void) #define DELAY_ABORT_SEQ 62 /* @200kHz 9 clocks = 44us, 62us is ok */ #define DELAY_HALF_PERIOD (500 / (CONFIG_SYS_I2C_SPEED / 1000)) -#if defined(CONFIG_MGCOGE) || defined(CONFIG_MGCOGE2NE) +#if defined(CONFIG_KM_82XX) #define SDA_MASK 0x00010000 #define SCL_MASK 0x00020000 -static void set_pin(int state, unsigned long mask) +void set_pin(int state, unsigned long mask) { ioport_t *iop = ioport_addr((immap_t *)CONFIG_SYS_IMMR, 3); diff --git a/board/keymile/common/common.h b/board/keymile/common/common.h index 6ce992a..cee24d4 100644 --- a/board/keymile/common/common.h +++ b/board/keymile/common/common.h @@ -124,6 +124,7 @@ struct bfticu_iomap { int ethernet_present(void); int ivm_read_eeprom(void); +void set_pin(int state, unsigned long mask); int set_km_env(void); int fdt_set_node_and_value(void *blob, diff --git a/board/keymile/km82xx/km82xx.c b/board/keymile/km82xx/km82xx.c index 01c0bfd..d453d25 100644 --- a/board/keymile/km82xx/km82xx.c +++ b/board/keymile/km82xx/km82xx.c @@ -288,7 +288,7 @@ int checkboard(void) #if defined(CONFIG_MGCOGE) puts("Board: Keymile mgcoge"); #else - puts("Board: Keymile mgcoge2ne"); + puts("Board: Keymile mgcoge3ne"); #endif if (ethernet_present()) puts(" with PIGGY."); @@ -314,6 +314,28 @@ int last_stage_init(void) return 0; } +#ifdef CONFIG_MGCOGE3NE +/* + * For mgcoge3ne boards, the mgcoge3un control is controlled from + * a GPIO line on the PPC CPU. If bobcatreset is set the line + * will toggle once what forces the mgocge3un part to restart + * immediately. + */ +void handle_mgcoge3un_reset(void) +{ + char *bobcatreset = getenv("bobcatreset"); + if (bobcatreset) { + if (strcmp(bobcatreset, "true") == 0) { + puts("Forcing bobcat reset\n"); + set_pin(0, 0x00000004); /* clear PD29 to reset arm */ + udelay(1000); + set_pin(1, 0x00000004); + } else + set_pin(1, 0x00000004); /* set PD29 to not reset arm */ + } +} +#endif + /* * Early board initalization. */ @@ -329,6 +351,9 @@ int board_early_init_r(void) out_8(&base->oprtl, (H_OPORTS_SCC4_ENA | H_OPORTS_SCC4_FD_ENA | H_OPORTS_FCC1_PW_DWN)); +#ifdef CONFIG_MGCOGE3NE + handle_mgcoge3un_reset(); +#endif return 0; } |