mirror of https://github.com/acidanthera/audk.git
Omap35xxPkg: Turn on the power for the USB Hub
This fix should make the USB Hub power up correctly (tested on BeagleBoard-xM). git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12134 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
e0932788c3
commit
6b73be803b
|
@ -50,4 +50,11 @@
|
||||||
#define LEDAPWM BIT4
|
#define LEDAPWM BIT4
|
||||||
#define LEDBPWM BIT5
|
#define LEDBPWM BIT5
|
||||||
|
|
||||||
|
// USB PHY power
|
||||||
|
#define VAUX2_DEDICATED 0x79
|
||||||
|
#define VAUX2_DEV_GRP 0x76
|
||||||
|
|
||||||
|
#define VAUX_DEV_GRP_P1 0x20
|
||||||
|
#define VAUX_DEDICATED_18V 0x05
|
||||||
|
|
||||||
#endif //__TPS65950_H__
|
#endif //__TPS65950_H__
|
||||||
|
|
|
@ -77,22 +77,32 @@ ConfigureUSBHost (
|
||||||
| UHH_HOSTCONFIG_P1_ULPI_BYPASS_ULPI_MODE);
|
| UHH_HOSTCONFIG_P1_ULPI_BYPASS_ULPI_MODE);
|
||||||
|
|
||||||
// USB reset (GPIO 147 - Port 5 pin 19) output high
|
// USB reset (GPIO 147 - Port 5 pin 19) output high
|
||||||
MmioAnd32(GPIO5_BASE + GPIO_OE, ~BIT19);
|
MmioAnd32 (GPIO5_BASE + GPIO_OE, ~BIT19);
|
||||||
MmioWrite32 (GPIO5_BASE + GPIO_SETDATAOUT, BIT19);
|
MmioWrite32 (GPIO5_BASE + GPIO_SETDATAOUT, BIT19);
|
||||||
|
|
||||||
// Get the Power IC protocol.
|
// Get the Power IC protocol
|
||||||
Status = gBS->LocateProtocol(&gEmbeddedExternalDeviceProtocolGuid, NULL, (VOID **)&gTPS65950);
|
Status = gBS->LocateProtocol (&gEmbeddedExternalDeviceProtocolGuid, NULL, (VOID **)&gTPS65950);
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
|
// Power the USB PHY
|
||||||
|
Data = VAUX_DEV_GRP_P1;
|
||||||
|
Status = gTPS65950->Write (gTPS65950, EXTERNAL_DEVICE_REGISTER(I2C_ADDR_GRP_ID4, VAUX2_DEV_GRP), 1, &Data);
|
||||||
ASSERT_EFI_ERROR(Status);
|
ASSERT_EFI_ERROR(Status);
|
||||||
|
|
||||||
//Enable power to the USB host.
|
Data = VAUX_DEDICATED_18V;
|
||||||
Status = gTPS65950->Read(gTPS65950, EXTERNAL_DEVICE_REGISTER(I2C_ADDR_GRP_ID3, LEDEN), 1, &Data);
|
Status = gTPS65950->Write (gTPS65950, EXTERNAL_DEVICE_REGISTER(I2C_ADDR_GRP_ID4, VAUX2_DEDICATED), 1, &Data);
|
||||||
ASSERT_EFI_ERROR(Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
//LEDAON & LEDAPWM control the power to the USB host so enable those bits.
|
// Enable power to the USB hub
|
||||||
Data |= (LEDAON | LEDAPWM);
|
Status = gTPS65950->Read (gTPS65950, EXTERNAL_DEVICE_REGISTER(I2C_ADDR_GRP_ID3, LEDEN), 1, &Data);
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
Status = gTPS65950->Write(gTPS65950, EXTERNAL_DEVICE_REGISTER(I2C_ADDR_GRP_ID3, LEDEN), 1, &Data);
|
// LEDAON controls the power to the USB host, PWM is disabled
|
||||||
ASSERT_EFI_ERROR(Status);
|
Data &= ~LEDAPWM;
|
||||||
|
Data |= LEDAON;
|
||||||
|
|
||||||
|
Status = gTPS65950->Write (gTPS65950, EXTERNAL_DEVICE_REGISTER(I2C_ADDR_GRP_ID3, LEDEN), 1, &Data);
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue