Lines Matching +full:usb +full:- +full:phy +full:- +full:r8a7790
1 // SPDX-License-Identifier: GPL-2.0
3 * xHCI host controller driver for R-Car SoCs
13 #include <linux/usb/phy.h>
17 #include "xhci-plat.h"
18 #include "xhci-rcar.h"
21 * - The V3 firmware is for almost all R-Car Gen3 (except r8a7795 ES1.x)
22 * - The V2 firmware is for r8a7795 ES1.x.
23 * - The V2 firmware is possible to use on R-Car Gen2. However, the V2 causes
24 * performance degradation. So, this driver continues to use the V1 if R-Car
26 * - The V1 firmware is impossible to use on R-Car Gen3.
91 writel(RCAR_USB3_LCLK_ENA_VAL, hcd->regs + RCAR_USB3_LCLK); in xhci_rcar_start_gen2()
93 writel(RCAR_USB3_CONF1_VAL, hcd->regs + RCAR_USB3_CONF1); in xhci_rcar_start_gen2()
94 writel(RCAR_USB3_CONF2_VAL, hcd->regs + RCAR_USB3_CONF2); in xhci_rcar_start_gen2()
95 writel(RCAR_USB3_CONF3_VAL, hcd->regs + RCAR_USB3_CONF3); in xhci_rcar_start_gen2()
97 writel(RCAR_USB3_RX_POL_VAL, hcd->regs + RCAR_USB3_RX_POL); in xhci_rcar_start_gen2()
98 writel(RCAR_USB3_TX_POL_VAL, hcd->regs + RCAR_USB3_TX_POL); in xhci_rcar_start_gen2()
103 struct device_node *node = dev->of_node; in xhci_rcar_is_gen2()
105 return of_device_is_compatible(node, "renesas,xhci-r8a7790") || in xhci_rcar_is_gen2()
106 of_device_is_compatible(node, "renesas,xhci-r8a7791") || in xhci_rcar_is_gen2()
107 of_device_is_compatible(node, "renesas,xhci-r8a7793") || in xhci_rcar_is_gen2()
108 of_device_is_compatible(node, "renesas,rcar-gen2-xhci"); in xhci_rcar_is_gen2()
115 if (hcd->regs != NULL) { in xhci_rcar_start()
117 temp = readl(hcd->regs + RCAR_USB3_INT_ENA); in xhci_rcar_start()
119 writel(temp, hcd->regs + RCAR_USB3_INT_ENA); in xhci_rcar_start()
120 if (xhci_rcar_is_gen2(hcd->self.controller)) in xhci_rcar_start()
127 struct device *dev = hcd->self.controller; in xhci_rcar_download_firmware()
128 void __iomem *regs = hcd->regs; in xhci_rcar_download_firmware()
146 quirks = (uintptr_t)attr->data; in xhci_rcar_download_firmware()
153 firmware_name = priv->firmware_name; in xhci_rcar_download_firmware()
155 /* request R-Car USB3.0 firmware */ in xhci_rcar_download_firmware()
160 /* download R-Car USB3.0 firmware */ in xhci_rcar_download_firmware()
165 for (index = 0; index < fw->size; index += 4) { in xhci_rcar_download_firmware()
167 for (data = 0, j = 3; j >= 0; j--) { in xhci_rcar_download_firmware()
168 if ((j + index) < fw->size) in xhci_rcar_download_firmware()
169 data |= fw->data[index + j] << (8 * j); in xhci_rcar_download_firmware()
200 retval = readl_poll_timeout_atomic(hcd->regs + RCAR_USB3_AXH_STA, in xhci_rcar_wait_for_pll_active()
205 /* This function needs to initialize a "phy" of usb before */
208 /* If hcd->regs is NULL, we don't just call the following function */ in xhci_rcar_init_quirk()
209 if (!hcd->regs) in xhci_rcar_init_quirk()
213 return -ETIMEDOUT; in xhci_rcar_init_quirk()