hancock: enable GNSS supply at startup

This commit is contained in:
Rene Straub 2018-06-19 08:39:06 +02:00 committed by Patrick Zysset
parent 628115260b
commit a3d404c7d9
2 changed files with 20 additions and 9 deletions

View File

@ -147,12 +147,12 @@ static BD_Context bdctx[3]; /* The descriptor contexts */
/* SPI1 */ /* SPI1 */
static struct module_pin_mux spi1_pin_mux[] = { static struct module_pin_mux spi1_pin_mux[] = {
{OFFSET(ecap0_in_pwm0_out), (MODE(4) | PULLUDEN | PULLDOWN_EN | RXACTIVE)}, /* (C18) spi1_clk */ {OFFSET(ecap0_in_pwm0_out), (MODE(4) | PULLUDEN | PULLDOWN_EN | RXACTIVE)}, /* (C18) spi1_clk */
{OFFSET(uart0_rtsn), (MODE(4) | PULLUDEN | PULLUP_EN)}, /* (E17) spi1_mosi */ {OFFSET(uart0_rtsn), (MODE(4) | PULLUDEN | PULLUP_EN)}, /* (E17) spi1_mosi */
{OFFSET(uart0_ctsn), (MODE(4) | PULLUDEN | PULLUP_EN | RXACTIVE)}, /* (E18) spi1_miso */ {OFFSET(uart0_ctsn), (MODE(4) | PULLUDEN | PULLUP_EN | RXACTIVE)}, /* (E18) spi1_miso */
{OFFSET(uart0_txd), (MODE(1) | PULLUDEN | PULLUP_EN)}, /* (E16) spi1_cs1 */ {OFFSET(uart0_txd), (MODE(1) | PULLUDEN | PULLUP_EN)}, /* (E16) spi1_cs1 */
{-1} {-1}
#if 0 #if 0
{OFFSET(uart0_rxd), (MODE(1) | PULLUDEN | PULLUP_EN)}, /* (E15) spi1_cs0 */ {OFFSET(uart0_rxd), (MODE(1) | PULLUDEN | PULLUP_EN)}, /* (E15) spi1_cs0 */
#endif #endif
}; };
@ -378,8 +378,13 @@ void am33xx_spl_board_init(void)
* CORE1 = 2.0A (0.25A, seems too low) * CORE1 = 2.0A (0.25A, seems too low)
*/ */
da9063_init(CONFIG_PMIC_I2C_BUS); da9063_init(CONFIG_PMIC_I2C_BUS);
/* Enable +3V3_SENSOR (LDO3) */
(void)da9063_set_reg(PMIC_REG_LDO3_CONT, PMIC_LDOx_EN_MASK); (void)da9063_set_reg(PMIC_REG_LDO3_CONT, PMIC_LDOx_EN_MASK);
/* Enable +3V3_GNSS (LDO6) */
(void)da9063_set_reg(PMIC_REG_LDO6_CONT, PMIC_LDOx_EN_MASK);
init_leds(); init_leds();
set_status_led(1, 1); /* Orange */ /* TODO: -> Broken #2 use indicator led instead */ set_status_led(1, 1); /* Orange */ /* TODO: -> Broken #2 use indicator led instead */
set_indicator_led(1, 1); /* Orange */ set_indicator_led(1, 1); /* Orange */
@ -537,24 +542,29 @@ static void init_ethernet_switch(void)
/* TODO: Remove debug printout later on */ /* TODO: Remove debug printout later on */
val = sja1105_read_reg(spi, 0x000000); val = sja1105_read_reg(spi, 0x000000);
printf("Device ID: %08x\n", val); /* printf("Device ID: %08x\n", val); */
val = sja1105_read_reg(spi, 0x000001); val = sja1105_read_reg(spi, 0x000001);
printf("Status Reg: %08x\n", val); /* printf("Status Reg: %08x\n", val); */
sja1105_static_init(spi, 0 /*dummy*/); sja1105_static_init(spi, 0 /*dummy*/);
/* Check that config was properly loaded */
val = sja1105_read_reg(spi, 0x000001); val = sja1105_read_reg(spi, 0x000001);
printf("Status Reg: %08x\n", val); /* printf("Status Reg: %08x\n", val); */
/* TODO: Check valid config bit */ if ((val & 0x80000000) != 0x80000000) {
printf("ERROR: Switch configuration load failed\n");
}
/* Configure clocks */ /* Configure clocks */
sja1105_dynamic_init(spi); sja1105_dynamic_init(spi);
/*
val = sja1105_read_reg(spi, 0x000001); val = sja1105_read_reg(spi, 0x000001);
printf("Status Reg: %08x\n", val); printf("Status Reg: %08x\n", val);
*/
/* Enable pull down on RX_ER etc. */ /* Enable pull down on CPU Port RX_ER etc. */
sja1105_write_reg(spi, 0x100809, 0x03020313); sja1105_write_reg(spi, 0x100809, 0x03020313);
#if 0 #if 0
val = sja1105_read_reg(spi, 0x100809); val = sja1105_read_reg(spi, 0x100809);

View File

@ -20,6 +20,7 @@
#define PMIC_REG_GPIO_MODE8_15 0x1E /* Control register for GPIOs 8..15 */ #define PMIC_REG_GPIO_MODE8_15 0x1E /* Control register for GPIOs 8..15 */
#define PMIC_REG_LDO3_CONT 0x28 /* Control register of LDO3 */ #define PMIC_REG_LDO3_CONT 0x28 /* Control register of LDO3 */
#define PMIC_REG_LDO6_CONT 0x2B /* Control register of LDO6 */
#define PMIC_REG_LDO7_CONT 0x2C /* Control register of LDO7 */ #define PMIC_REG_LDO7_CONT 0x2C /* Control register of LDO7 */
#define PMIC_LDOx_EN_MASK 0x01 #define PMIC_LDOx_EN_MASK 0x01