...
 
Commits (5)
......@@ -162,6 +162,24 @@ void early_system_init(void)
asm volatile("ldr r0,=preloader_console_init; blx r0"
::: "r0", "r1", "r2", "r3", "lr", "memory");
#endif
{
static char const *const reset_causes[] = {
"cold", "sw warm", "unknown type 2", "watchdog",
"unknown type 4", "external", "volt mpu", "volt mm",
"volt core", "icepick", "c2c", "tshut mpu",
"tshut mm", "tshut core",
};
// check device PRM
u32 rstst = readl(0x4ae07c04);
u32 rsttime = readl(0x4ae07c08);
int i;
for(i = 0; i < sizeof(reset_causes)/sizeof(char*); i++) {
if( rstst & 1 << i )
printf( "%s reset\n", reset_causes[i] );
}
if( (rsttime & 0x3ff) == 6 )
printf( "rsttime1 has not yet been configured\n" );
}
do_board_detect();
vcores_init();
prcm_init();
......
......@@ -81,12 +81,13 @@ void omap_die_id_get_board_serial(struct tag_serialnr *serialnr)
void omap_die_id_usbethaddr(void)
{
unsigned int die_id[4] = { 0 };
unsigned char mac[6] = { 0 };
#if defined(CONFIG_CMD_NET)
if (!getenv("usbethaddr")) {
unsigned int die_id[4] = { 0 };
unsigned char mac[6] = { 0 };
omap_die_id((unsigned int *)&die_id);
omap_die_id((unsigned int *)&die_id);
if (!getenv("usbethaddr")) {
/*
* Create a fake MAC address from the processor ID code.
* First byte is 0x02 to signify locally administered.
......@@ -100,6 +101,7 @@ void omap_die_id_usbethaddr(void)
eth_setenv_enetaddr("usbethaddr", mac);
}
#endif
}
void omap_die_id_display(void)
......
......@@ -19,9 +19,6 @@ CONFIG_CMD_USB=y
CONFIG_CMD_DFU=y
CONFIG_CMD_GPIO=y
# CONFIG_CMD_SETEXPR is not set
CONFIG_CMD_DHCP=y
CONFIG_CMD_MII=y
CONFIG_CMD_PING=y
CONFIG_CMD_EXT2=y
CONFIG_CMD_EXT4=y
CONFIG_CMD_EXT4_WRITE=y
......
......@@ -20,9 +20,6 @@ CONFIG_CMD_USB=y
CONFIG_CMD_DFU=y
CONFIG_CMD_GPIO=y
# CONFIG_CMD_SETEXPR is not set
CONFIG_CMD_DHCP=y
CONFIG_CMD_MII=y
CONFIG_CMD_PING=y
CONFIG_CMD_EXT2=y
CONFIG_CMD_EXT4=y
CONFIG_CMD_EXT4_WRITE=y
......
......@@ -178,5 +178,6 @@ int twl603x_enable_bb_charge(u8 bb_fields)
*/
int twl603x_poweroff(bool restart)
{
printf( "### %s ###\n", restart ? "HARDRESET" : "POWEROFF" );
return palmas_i2c_write_u8(TWL603X_CHIP_P1, 0xa0, restart?0x03:0x00);
}
......@@ -90,6 +90,7 @@ static struct dm_pmic_ops palmas_ops = {
};
static const struct udevice_id palmas_ids[] = {
{ .compatible = "ti,palmas", .data = PALMAS }, // twl6035/37
{ .compatible = "ti,tps659038", .data = TPS659038 },
{ .compatible = "ti,tps65917" , .data = TPS65917 },
{ }
......
......@@ -104,18 +104,33 @@
#define BB_VSEL_VBAT (3 << 1)
#define BB_CHRG_EN (1 << 0)
#ifndef CONFIG_SYS_I2C_PALMAS_BUS_NUM
#define CONFIG_SYS_I2C_PALMAS_BUS_NUM (0)
#endif
/*
* Functions to read and write from TPS659038/TWL6035/TWL6037
* or other Palmas family of TI PMICs
*/
static inline int palmas_i2c_write_u8(u8 chip_no, u8 reg, u8 val)
{
return i2c_write(chip_no, reg, 1, &val, 1);
int saved_bus = i2c_get_bus_num();
int ret = i2c_set_bus_num(CONFIG_SYS_I2C_PALMAS_BUS_NUM);
if (!ret)
ret = i2c_write(chip_no, reg, 1, &val, 1);
i2c_set_bus_num(saved_bus);
return ret;
}
static inline int palmas_i2c_read_u8(u8 chip_no, u8 reg, u8 *val)
{
return i2c_read(chip_no, reg, 1, val, 1);
int saved_bus = i2c_get_bus_num();
int ret = i2c_set_bus_num(CONFIG_SYS_I2C_PALMAS_BUS_NUM);
if (!ret)
ret = i2c_read(chip_no, reg, 1, val, 1);
i2c_set_bus_num(saved_bus);
return ret;
}
void palmas_init_settings(void);
......