Lines Matching +full:xhci +full:- +full:r8a7795

1 // SPDX-License-Identifier: GPL-2.0
3 * xHCI host controller driver for R-Car SoCs
16 #include "xhci.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.
82 .soc_id = "r8a7795", .revision = "ES1.*",
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()
139 quirks = (uintptr_t)attr->data; in xhci_rcar_download_firmware()
146 firmware_name = priv->firmware_name; in xhci_rcar_download_firmware()
148 /* request R-Car USB3.0 firmware */ in xhci_rcar_download_firmware()
153 /* download R-Car USB3.0 firmware */ in xhci_rcar_download_firmware()
158 for (index = 0; index < fw->size; index += 4) { in xhci_rcar_download_firmware()
160 for (data = 0, j = 3; j >= 0; j--) { in xhci_rcar_download_firmware()
161 if ((j + index) < fw->size) in xhci_rcar_download_firmware()
162 data |= fw->data[index + j] << (8 * j); in xhci_rcar_download_firmware()
193 retval = readl_poll_timeout_atomic(hcd->regs + RCAR_USB3_AXH_STA, in xhci_rcar_wait_for_pll_active()
201 /* If hcd->regs is NULL, we don't just call the following function */ in xhci_rcar_init_quirk()
202 if (!hcd->regs) in xhci_rcar_init_quirk()
206 return -ETIMEDOUT; in xhci_rcar_init_quirk()