diff options
Diffstat (limited to 'board/isee/igep0046/igep0046.c')
-rw-r--r-- | board/isee/igep0046/igep0046.c | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/board/isee/igep0046/igep0046.c b/board/isee/igep0046/igep0046.c index f02c541..ce11717 100644 --- a/board/isee/igep0046/igep0046.c +++ b/board/isee/igep0046/igep0046.c @@ -64,9 +64,8 @@ DECLARE_GLOBAL_DATA_PTR; PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS) #ifdef CONFIG_SYS_I2C -#define I2C_PAD_CTRL (PAD_CTL_PUS_100K_UP | \ - PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS | \ - PAD_CTL_ODE | PAD_CTL_SRE_FAST) +#define I2C_PAD_CTRL ( PAD_CTL_ODE | PAD_CTL_SPEED_MED | \ + PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST | PAD_CTL_HYS) #define I2C_PMIC 1 #define I2C_PAD MUX_PAD_CTRL(I2C_PAD_CTRL) #endif @@ -166,11 +165,14 @@ static iomux_v3_cfg_t const init_pads[] = MX6_PAD_DI0_PIN4__GPIO4_IO20 | MUX_PAD_CTRL(GPIO_LED_PAD_CTRL), MX6_PAD_DI0_PIN15__GPIO4_IO17 | MUX_PAD_CTRL(GPIO_LED_PAD_CTRL), #ifdef CONFIG_BASE0040 - /* GPIO USB BASE0040 MUX */ - MX6_PAD_CSI0_DAT4__GPIO5_IO22 | MUX_PAD_CTRL(NO_PAD_CTRL), // USB_HUB_RESET - MX6_PAD_CSI0_DAT5__GPIO5_IO23 | MUX_PAD_CTRL(NO_PAD_CTRL), // USB_PWR1 - MX6_PAD_CSI0_DAT6__GPIO5_IO24 | MUX_PAD_CTRL(NO_PAD_CTRL), // USB_PWR2 - MX6_PAD_CSI0_DAT7__GPIO5_IO25 | MUX_PAD_CTRL(NO_PAD_CTRL), // USB_PWR3 + /* TLV320AIC3106 Audio codec Reset*/ + MX6_PAD_KEY_COL2__GPIO4_IO10 | MUX_PAD_CTRL(NO_PAD_CTRL), + /* USB2514 HUB Reset */ + MX6_PAD_CSI0_DAT4__GPIO5_IO22 | MUX_PAD_CTRL(NO_PAD_CTRL), + /* USB Power Lines */ + MX6_PAD_CSI0_DAT5__GPIO5_IO23 | MUX_PAD_CTRL(NO_PAD_CTRL), + MX6_PAD_CSI0_DAT6__GPIO5_IO24 | MUX_PAD_CTRL(NO_PAD_CTRL), + MX6_PAD_CSI0_DAT7__GPIO5_IO25 | MUX_PAD_CTRL(NO_PAD_CTRL), #endif }; @@ -228,6 +230,13 @@ static iomux_v3_cfg_t const usb_otg_pads[] = }; #ifdef CONFIG_BASE0040 +static void reset_audio(void) +{ + /* Audio Reset */ + gpio_direction_output(IMX_GPIO_NR(4, 10), 0); + mdelay(5); +} + static void reset_usb_hub(void) { /* Activate USB_PWRx */ @@ -394,8 +403,6 @@ int board_early_init_f(void) gpio_direction_output(IMX_GPIO_NR(4, 19), 1); gpio_direction_output(IMX_GPIO_NR(4, 20), 0); gpio_direction_output(IMX_GPIO_NR(4, 17), 1); - - return 0; } @@ -404,28 +411,33 @@ int board_init(void) u32 crc_value = 0; u32 crc_save_value = 0; +#ifdef CONFIG_BASE0040 + reset_audio(); +#endif + #ifdef CONFIG_SYS_I2C setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1); setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2); + mdelay(1); #endif -if(check_eeprom() != 0){ + if(check_eeprom() != 0){ printf("EEPROM: not found\n"); -}else{ - /* Read configuration from eeprom */ - if(eeprom46_read_setup(0, (char*) &igep0046_eeprom_config, sizeof(struct igep_mf_setup))) + }else{ + /* Read configuration from eeprom */ + if(eeprom46_read_setup(0, (char*) &igep0046_eeprom_config, sizeof(struct igep_mf_setup))) printf("EEPROM: read fail\n"); - /* Verify crc32 */ + /* Verify crc32 */ crc_save_value = igep0046_eeprom_config.crc32; igep0046_eeprom_config.crc32 = 0; crc_value = crc32(0, (const unsigned char*) &igep0046_eeprom_config, sizeof(struct igep_mf_setup)); - if(crc_save_value != crc_value){ + if(crc_save_value != crc_value){ printf("EEPROM: CRC32 failed. Loading default MAC\n"); - }else{ + }else{ printf("EEPROM: CRC32 OK! Loading MAC from eeprom\n"); igep_eeprom_valid = 1; + } } -} #ifdef CONFIG_BASE0040 reset_usb_hub(); |