mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-20 20:04:46 +00:00
board: advantech: dms-ba16: add the PMIC configuration support
Change the PMIC bulk configuration from auto mode to sync mode to avoid the voltage shutdown issue Signed-off-by: Ken Lin <yungching0725@gmail.com> Acked-by: Akshay Bhat <akshay.bhat@timesys.com>
This commit is contained in:
parent
f6f7e73d45
commit
fc9ade56e3
1 changed files with 51 additions and 0 deletions
|
@ -534,6 +534,54 @@ static const struct boot_mode board_boot_modes[] = {
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void pmic_init(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
#define DA9063_ADDR 0x58
|
||||||
|
#define BCORE2_CONF 0x9D
|
||||||
|
#define BCORE1_CONF 0x9E
|
||||||
|
#define BPRO_CONF 0x9F
|
||||||
|
#define BIO_CONF 0xA0
|
||||||
|
#define BMEM_CONF 0xA1
|
||||||
|
#define BPERI_CONF 0xA2
|
||||||
|
#define MODE_BIT_H 7
|
||||||
|
#define MODE_BIT_L 6
|
||||||
|
|
||||||
|
uchar val;
|
||||||
|
i2c_set_bus_num(2);
|
||||||
|
|
||||||
|
i2c_read(DA9063_ADDR, BCORE2_CONF, 1, &val, 1);
|
||||||
|
val |= (1 << MODE_BIT_H);
|
||||||
|
val &= ~(1 << MODE_BIT_L);
|
||||||
|
i2c_write(DA9063_ADDR, BCORE2_CONF , 1, &val, 1);
|
||||||
|
|
||||||
|
i2c_read(DA9063_ADDR, BCORE1_CONF, 1, &val, 1);
|
||||||
|
val |= (1 << MODE_BIT_H);
|
||||||
|
val &= ~(1 << MODE_BIT_L);
|
||||||
|
i2c_write(DA9063_ADDR, BCORE1_CONF , 1, &val, 1);
|
||||||
|
|
||||||
|
i2c_read(DA9063_ADDR, BPRO_CONF, 1, &val, 1);
|
||||||
|
val |= (1 << MODE_BIT_H);
|
||||||
|
val &= ~(1 << MODE_BIT_L);
|
||||||
|
i2c_write(DA9063_ADDR, BPRO_CONF , 1, &val, 1);
|
||||||
|
|
||||||
|
i2c_read(DA9063_ADDR, BIO_CONF, 1, &val, 1);
|
||||||
|
val |= (1 << MODE_BIT_H);
|
||||||
|
val &= ~(1 << MODE_BIT_L);
|
||||||
|
i2c_write(DA9063_ADDR, BIO_CONF , 1, &val, 1);
|
||||||
|
|
||||||
|
i2c_read(DA9063_ADDR, BMEM_CONF, 1, &val, 1);
|
||||||
|
val |= (1 << MODE_BIT_H);
|
||||||
|
val &= ~(1 << MODE_BIT_L);
|
||||||
|
i2c_write(DA9063_ADDR, BMEM_CONF , 1, &val, 1);
|
||||||
|
|
||||||
|
i2c_read(DA9063_ADDR, BPERI_CONF, 1, &val, 1);
|
||||||
|
val |= (1 << MODE_BIT_H);
|
||||||
|
val &= ~(1 << MODE_BIT_L);
|
||||||
|
i2c_write(DA9063_ADDR, BPERI_CONF , 1, &val, 1);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
int board_late_init(void)
|
int board_late_init(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_CMD_BMODE
|
#ifdef CONFIG_CMD_BMODE
|
||||||
|
@ -563,6 +611,9 @@ int board_late_init(void)
|
||||||
setup_ba16_sata();
|
setup_ba16_sata();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* board specific pmic init */
|
||||||
|
pmic_init();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue