Compare commits

...

3 Commits

Author SHA1 Message Date
Rene Straub cd55d2932a hw21/26: optimize extension module powerup
fixes 69e9c386dd
2024-02-20 17:06:38 +01:00
Rene Straub f47237771c hw21/26: remove pulldown from timepulse input
TIMEPULSE is internally connected with SAFEBOOT_N
in the GNSS modem. The pulldown pulls the signal so
low, that in some cases the modem starts in bootloader
mode.
Also remove pull ups from UART to avoid cross currents
at powerup.
2024-02-20 15:50:48 +01:00
Rene Straub 69e9c386dd hw21/26: power up extension module early
The extension module is connected to the system I2C bus. Before the
module is powered, it can pull the lines low, preventing I2C access to
the board descriptor.

- enable extension module power already in SPL

id: 417848
2023-10-25 21:41:40 +02:00
2 changed files with 34 additions and 21 deletions

View File

@ -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)
{
/* Set CPU speed to 600 MHz (fix) */
@ -805,6 +828,9 @@ void am33xx_spl_board_init(void)
/* Configure both I2C buses used */
init_i2c();
/* Power on Extension/User module, so it doesn't block I2C bus */
power_um();
/* Get board descriptor */
init_bd_spl();
@ -1045,30 +1071,14 @@ static void init_usb_hub(void)
static void init_user_module(void)
{
int bus;
bus = da9063_claim_i2c_bus();
puts("UM: ");
REQUEST_AND_CLEAR_GPIO(GPIO_RST_UM_N); /* Assert reset (active low) */
REQUEST_AND_CLEAR_GPIO(GPIO_CTRL_WDIS_N) /* TODO: CHECK */
/* 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);
REQUEST_AND_CLEAR_GPIO(GPIO_CTRL_WDIS_N);
gpio_direction_input(GPIO_RST_UM_N); /* Release reset (open drain) */
mdelay(10);
da9063_release_i2c_bus(bus);
mdelay(200); /* Give module some time to boot */
um_init(CONFIG_UM_I2C_BUS); /* Try to detect user module */

View File

@ -38,7 +38,7 @@ static struct module_pin_mux gpio_pin_mux[] = {
* (T16) GPIO1_26: WLAN_EN
* (V17) GPIO1_27: WLAN_IRQ
*
* (U3) GPIO2_16: TIMEPULSE (HW26)
* (U3) GPIO2_16: TIMEPULSE (HW26), see note [1]
* (R6) GPIO2_25: RST_ETH~
*
* (J17) GPIO3_4: GNSS_EXTINT
@ -46,6 +46,9 @@ static struct module_pin_mux gpio_pin_mux[] = {
* (L18) GPIO3_10: CTRL.RST
* (C12) GPIO3_17: UI_RST~
* (A14) GPIO3_21: RST_HUB~ (USB)
*
* [1] No PU/PD allowed as TIMEPULSE is internally connected with SAFEBOOT_N.
* SAFEBOOT_N must be left open/floating.
*/
/* Bank 0 */
@ -65,7 +68,7 @@ static struct module_pin_mux gpio_pin_mux[] = {
{OFFSET(gpmc_a11), (MODE(7) | PULLUDDIS | RXACTIVE)}, /* (V17) gpio1_27: WLAN_IRQ */
/* Bank 2 */
{OFFSET(lcd_data10), (MODE(7) | PULLUDEN | PULLDOWN_EN | RXACTIVE)}, /* (U3) GPIO2_16: TIMEPULSE input */
{OFFSET(lcd_data10), (MODE(7) | PULLUDDIS | RXACTIVE)}, /* (U3) GPIO2_16: TIMEPULSE */
{OFFSET(lcd_ac_bias_en), (MODE(7) | PULLUDDIS)}, /* (R6) GPIO2_25: RST_ETH~ */
/* Bank 3 */
@ -215,8 +218,8 @@ static struct module_pin_mux uart2_pin_mux[] = {
/* UART3: GNSS */
static struct module_pin_mux uart3_pin_mux[] = {
{OFFSET(mii1_rxd3), (MODE(1) | PULLUDEN | PULLUP_EN | RXACTIVE)}, /* (L17) UART3_RXD */
{OFFSET(mii1_rxd2), (MODE(1) | PULLUDEN | PULLUP_EN | SLEWCTRL)}, /* (L16) UART3_TXD */
{OFFSET(mii1_rxd3), (MODE(1) | PULLUDDIS | RXACTIVE)}, /* (L17) UART3_RXD */
{OFFSET(mii1_rxd2), (MODE(1) | PULLUDDIS | SLEWCTRL)}, /* (L16) UART3_TXD */
{-1}
};