Message ID | 1456597155-10711-17-git-send-email-contact@paulk.fr |
---|---|
State | Accepted |
Commit | 6313c6500484ed85892f425e3ca93f706fd9a2ea |
Delegated to: | Tom Rini |
Headers | show |
On Sat, Feb 27, 2016 at 07:19:04PM +0100, Paul Kocialkowski wrote: > When booting from USB, the bootrom sets the VUSB_IN_PMID bit of the MISC2 > register of the TWL6030. However, U-Boot sets the VUSB_IN_VSYS bit to enable > VBUS input. As both bits are contradictory, enabling both disables the input, > according to the TWL6030 TRM. > > Thus, we need to clear the VUSB_IN_PMID bit in case of an USB boot (which could > just as well be a memory boot after USB timed out). > > Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Applied to u-boot/master, thanks!
diff --git a/drivers/power/twl6030.c b/drivers/power/twl6030.c index df43cca..c6d06f1 100644 --- a/drivers/power/twl6030.c +++ b/drivers/power/twl6030.c @@ -259,6 +259,7 @@ void twl6030_usb_device_settings() /* Select the input supply for VUSB regulator */ twl6030_i2c_read_u8(TWL6030_CHIP_PM, TWL6030_MISC2, &value); value |= TWL6030_MISC2_VUSB_IN_VSYS; + value &= ~TWL6030_MISC2_VUSB_IN_PMID; twl6030_i2c_write_u8(TWL6030_CHIP_PM, TWL6030_MISC2, value); } #endif diff --git a/include/twl6030.h b/include/twl6030.h index e68393c..9a1c645 100644 --- a/include/twl6030.h +++ b/include/twl6030.h @@ -48,6 +48,7 @@ #define BB_MEAS (1 << 0) #define TWL6030_MISC2 0xE5 +#define TWL6030_MISC2_VUSB_IN_PMID (1 << 3) #define TWL6030_MISC2_VUSB_IN_VSYS (1 << 4) /* Slave Address 0x49 */
When booting from USB, the bootrom sets the VUSB_IN_PMID bit of the MISC2 register of the TWL6030. However, U-Boot sets the VUSB_IN_VSYS bit to enable VBUS input. As both bits are contradictory, enabling both disables the input, according to the TWL6030 TRM. Thus, we need to clear the VUSB_IN_PMID bit in case of an USB boot (which could just as well be a memory boot after USB timed out). Signed-off-by: Paul Kocialkowski <contact@paulk.fr> --- drivers/power/twl6030.c | 1 + include/twl6030.h | 1 + 2 files changed, 2 insertions(+)