public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] usb: cdns3: gadget.c: Set fast access bit
@ 2023-05-05 12:13 Ravi Gunasekaran
  2023-05-05 12:32 ` Roger Quadros
  2023-05-11 12:10 ` Roger Quadros
  0 siblings, 2 replies; 8+ messages in thread
From: Ravi Gunasekaran @ 2023-05-05 12:13 UTC (permalink / raw)
  To: marex, rogerq; +Cc: u-boot, r-gunasekaran

From: Aswath Govindraju <a-govindraju@ti.com>

When the device port is in a low power state [U3/L2/Not Connected],
accesses to usb device registers may take a long time. This could lead to
potential core hang when the controller registers are accessed after the
port is disabled by setting DEVDS field. Setting the fast register access
bit ensures that the PHY clock is keeping up in active state.

Therefore, set fast access bit to ensure the accesses to device registers
are quick even in low power states.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
---
 drivers/usb/cdns3/gadget.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c
index fcaeab9cc1..fddc8c931a 100644
--- a/drivers/usb/cdns3/gadget.c
+++ b/drivers/usb/cdns3/gadget.c
@@ -2321,6 +2321,9 @@ static void cdns3_gadget_config(struct cdns3_device *priv_dev)
 	writel(USB_IEN_INIT, &regs->usb_ien);
 	writel(USB_CONF_CLK2OFFDS | USB_CONF_L1DS, &regs->usb_conf);
 
+	/* Set the Fast access bit */
+	writel(PUSB_PWR_FST_REG_ACCESS, &priv_dev->regs->usb_pwr);
+
 	cdns3_configure_dmult(priv_dev, NULL);
 
 	cdns3_gadget_pullup(&priv_dev->gadget, 1);
@@ -2378,6 +2381,7 @@ static int cdns3_gadget_udc_stop(struct usb_gadget *gadget)
 
 	/* disable interrupt for device */
 	writel(0, &priv_dev->regs->usb_ien);
+	writel(0, &priv_dev->regs->usb_pwr);
 	writel(USB_CONF_DEVDS, &priv_dev->regs->usb_conf);
 
 	return ret;

base-commit: a25dcda452bf6a6de72764a8d990d72e5def643d
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-05-12 12:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-05 12:13 [PATCH] usb: cdns3: gadget.c: Set fast access bit Ravi Gunasekaran
2023-05-05 12:32 ` Roger Quadros
2023-05-09  5:58   ` [EXTERNAL] " Ravi Gunasekaran
2023-05-10  9:10     ` Roger Quadros
2023-05-11  5:30       ` Pawel Laszczak
2023-05-11  9:33         ` Ravi Gunasekaran
2023-05-12  4:42           ` Pawel Laszczak
2023-05-11 12:10 ` Roger Quadros

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox