phy: usb: Add support for wake and USB low power mode for 7211 S2/S5
Add support for 7211 USB wake. Disable all possible 7211 USB logic for S2/S5 if USB wake is not enabled. On the 7211, the XHCI wake signal was not connected properly and only goes to the USB1_USB1_CTRL_TP_DIAG1 diagonstic register. The workaround is to have VPU code running that polls for the proper bit in the DIAG register and to wake the system when the bit is asserted. Signed-off-by: Al Cooper <alcooperx@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
This commit is contained in:

committed by
Kishon Vijay Abraham I

parent
5dfe1cec58
commit
b0c0b66c0b
@@ -783,12 +783,24 @@ static void usb_init_ipp(struct brcm_usb_init_params *params)
|
||||
msleep(50);
|
||||
}
|
||||
|
||||
static void usb_wake_enable(struct brcm_usb_init_params *params,
|
||||
bool enable)
|
||||
{
|
||||
void __iomem *ctrl = params->regs[BRCM_REGS_CTRL];
|
||||
|
||||
if (enable)
|
||||
USB_CTRL_SET(ctrl, USB_PM, RMTWKUP_EN);
|
||||
else
|
||||
USB_CTRL_UNSET(ctrl, USB_PM, RMTWKUP_EN);
|
||||
}
|
||||
|
||||
static void usb_init_common(struct brcm_usb_init_params *params)
|
||||
{
|
||||
u32 reg;
|
||||
void __iomem *ctrl = params->regs[BRCM_REGS_CTRL];
|
||||
|
||||
/* Clear any pending wake conditions */
|
||||
usb_wake_enable(params, false);
|
||||
reg = brcm_usb_readl(USB_CTRL_REG(ctrl, USB_PM_STATUS));
|
||||
brcm_usb_writel(reg, USB_CTRL_REG(ctrl, USB_PM_STATUS));
|
||||
|
||||
@@ -935,6 +947,8 @@ static void usb_uninit_common(struct brcm_usb_init_params *params)
|
||||
|
||||
if (USB_CTRL_MASK_FAMILY(params, PLL_CTL, PLL_IDDQ_PWRDN))
|
||||
USB_CTRL_SET_FAMILY(params, PLL_CTL, PLL_IDDQ_PWRDN);
|
||||
if (params->wake_enabled)
|
||||
usb_wake_enable(params, true);
|
||||
}
|
||||
|
||||
static void usb_uninit_eohci(struct brcm_usb_init_params *params)
|
||||
@@ -978,17 +992,6 @@ static void usb_set_dual_select(struct brcm_usb_init_params *params, int mode)
|
||||
}
|
||||
}
|
||||
|
||||
static void usb_wake_enable(struct brcm_usb_init_params *params,
|
||||
int enable)
|
||||
{
|
||||
void __iomem *ctrl = params->regs[BRCM_REGS_CTRL];
|
||||
|
||||
if (enable)
|
||||
USB_CTRL_SET(ctrl, USB_PM, RMTWKUP_EN);
|
||||
else
|
||||
USB_CTRL_UNSET(ctrl, USB_PM, RMTWKUP_EN);
|
||||
}
|
||||
|
||||
static const struct brcm_usb_init_ops bcm7445_ops = {
|
||||
.init_ipp = usb_init_ipp,
|
||||
.init_common = usb_init_common,
|
||||
@@ -999,7 +1002,6 @@ static const struct brcm_usb_init_ops bcm7445_ops = {
|
||||
.uninit_xhci = usb_uninit_xhci,
|
||||
.get_dual_select = usb_get_dual_select,
|
||||
.set_dual_select = usb_set_dual_select,
|
||||
.wake_enable = usb_wake_enable,
|
||||
};
|
||||
|
||||
void brcm_usb_dvr_init_7445(struct brcm_usb_init_params *params)
|
||||
|
Reference in New Issue
Block a user