hw21/26: optimize extension module powerup
Enable extension module power in first state loader. Reasoning: Unpowered module can block I2C bus.
This commit is contained in:
parent
250b26288e
commit
3a82e018ea
|
|
@ -794,6 +794,29 @@ static void init_bd_spl(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void power_um(void)
|
||||||
|
{
|
||||||
|
int bus;
|
||||||
|
|
||||||
|
da9063_init(CONFIG_PMIC_I2C_BUS);
|
||||||
|
|
||||||
|
bus = da9063_claim_i2c_bus();
|
||||||
|
|
||||||
|
REQUEST_AND_CLEAR_GPIO(GPIO_RST_UM_N); /* Assert reset (active low) */
|
||||||
|
REQUEST_AND_CLEAR_GPIO(GPIO_CTRL_WDIS_N);
|
||||||
|
|
||||||
|
da9063_set_gpio(PMIC_UM_SUPPLY_EN_IO, 0); /* Switch Supply off */
|
||||||
|
mdelay(30); /* Give time to discharge output */
|
||||||
|
|
||||||
|
da9063_set_gpio(PMIC_UM_SUPPLY_VSEL_IO, 0); /* Set voltage to 3.3V */
|
||||||
|
mdelay(1);
|
||||||
|
|
||||||
|
da9063_set_gpio(PMIC_UM_SUPPLY_EN_IO, 1); /* Enable Supply */
|
||||||
|
mdelay(10);
|
||||||
|
|
||||||
|
da9063_release_i2c_bus(bus);
|
||||||
|
}
|
||||||
|
|
||||||
void am33xx_spl_board_init(void)
|
void am33xx_spl_board_init(void)
|
||||||
{
|
{
|
||||||
/* Set CPU speed to 600 MHz (fix) */
|
/* Set CPU speed to 600 MHz (fix) */
|
||||||
|
|
@ -805,6 +828,9 @@ void am33xx_spl_board_init(void)
|
||||||
/* Configure both I2C buses used */
|
/* Configure both I2C buses used */
|
||||||
init_i2c();
|
init_i2c();
|
||||||
|
|
||||||
|
/* Power on Extension/User module, so it doesn't block I2C bus */
|
||||||
|
power_um();
|
||||||
|
|
||||||
/* Get board descriptor */
|
/* Get board descriptor */
|
||||||
init_bd_spl();
|
init_bd_spl();
|
||||||
|
|
||||||
|
|
@ -1052,17 +1078,7 @@ static void init_user_module(void)
|
||||||
puts("UM: ");
|
puts("UM: ");
|
||||||
|
|
||||||
REQUEST_AND_CLEAR_GPIO(GPIO_RST_UM_N); /* Assert reset (active low) */
|
REQUEST_AND_CLEAR_GPIO(GPIO_RST_UM_N); /* Assert reset (active low) */
|
||||||
REQUEST_AND_CLEAR_GPIO(GPIO_CTRL_WDIS_N) /* TODO: CHECK */
|
REQUEST_AND_CLEAR_GPIO(GPIO_CTRL_WDIS_N);
|
||||||
|
|
||||||
/* TODO: Should this be done at first power up as well? */
|
|
||||||
da9063_set_gpio(PMIC_UM_SUPPLY_EN_IO, 0); /* Switch Supply off */
|
|
||||||
mdelay(30); /* Give time to discharge output */
|
|
||||||
|
|
||||||
da9063_set_gpio(PMIC_UM_SUPPLY_VSEL_IO, 0); /* Set voltage to 3.3V */
|
|
||||||
mdelay(1);
|
|
||||||
|
|
||||||
da9063_set_gpio(PMIC_UM_SUPPLY_EN_IO, 1); /* Enable Supply */
|
|
||||||
mdelay(10);
|
|
||||||
|
|
||||||
gpio_direction_input(GPIO_RST_UM_N); /* Release reset (open drain) */
|
gpio_direction_input(GPIO_RST_UM_N); /* Release reset (open drain) */
|
||||||
mdelay(10);
|
mdelay(10);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue