Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: cdns3: Add quirk flag to enable suspend residency

Some platforms (e.g. ti,j721e-usb, ti,am64-usb) require
this bit to be set to workaround a lockup issue with PHY
short suspend intervals [1]. Add a platform quirk flag
to indicate if Suspend Residency should be enabled.

[1] - https://www.ti.com/lit/er/sprz457h/sprz457h.pdf
i2409 - USB: USB2 PHY locks up due to short suspend

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Signed-off-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Acked-by: Peter Chen <peter.chen@kernel.org>
Link: https://lore.kernel.org/r/20240516044537.16801-2-r-gunasekaran@ti.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Roger Quadros and committed by
Greg Kroah-Hartman
0aca19e4 8b6b386f

+13 -1
+1
drivers/usb/cdns3/core.h
··· 44 44 bool suspend, bool wakeup); 45 45 unsigned long quirks; 46 46 #define CDNS3_DEFAULT_PM_RUNTIME_ALLOW BIT(0) 47 + #define CDNS3_DRD_SUSPEND_RESIDENCY_ENABLE BIT(1) 47 48 }; 48 49 49 50 /**
+9 -1
drivers/usb/cdns3/drd.c
··· 389 389 int cdns_drd_init(struct cdns *cdns) 390 390 { 391 391 void __iomem *regs; 392 - u32 state; 392 + u32 state, reg; 393 393 int ret; 394 394 395 395 regs = devm_ioremap_resource(cdns->dev, &cdns->otg_res); ··· 433 433 cdns->otg_irq_regs = (struct cdns_otg_irq_regs __iomem *) 434 434 &cdns->otg_v1_regs->ien; 435 435 writel(1, &cdns->otg_v1_regs->simulate); 436 + 437 + if (cdns->pdata && 438 + (cdns->pdata->quirks & CDNS3_DRD_SUSPEND_RESIDENCY_ENABLE)) { 439 + reg = readl(&cdns->otg_v1_regs->susp_ctrl); 440 + reg |= SUSP_CTRL_SUSPEND_RESIDENCY_ENABLE; 441 + writel(reg, &cdns->otg_v1_regs->susp_ctrl); 442 + } 443 + 436 444 cdns->version = CDNS3_CONTROLLER_V1; 437 445 } else { 438 446 dev_err(cdns->dev, "not supported DID=0x%08x\n", state);
+3
drivers/usb/cdns3/drd.h
··· 193 193 /* OTGREFCLK - bitmasks */ 194 194 #define OTGREFCLK_STB_CLK_SWITCH_EN BIT(31) 195 195 196 + /* SUPS_CTRL - bitmasks */ 197 + #define SUSP_CTRL_SUSPEND_RESIDENCY_ENABLE BIT(17) 198 + 196 199 /* OVERRIDE - bitmasks */ 197 200 #define OVERRIDE_IDPULLUP BIT(0) 198 201 /* Only for CDNS3_CONTROLLER_V0 version */