Lines Matching +full:rcar +full:- +full:gen2 +full:- +full:usb +full:- +full:phy

1 // SPDX-License-Identifier: GPL-2.0
3 * xHCI host controller driver for R-Car SoCs
13 #include <linux/usb/phy.h>
16 #include "xhci-plat.h"
17 #include "xhci-rzv2m.h"
23 * - The V3 firmware is for all R-Car Gen3
24 * - The V2 firmware is possible to use on R-Car Gen2. However, the V2 causes
25 * performance degradation. So, this driver continues to use the V1 if R-Car
26 * Gen2.
27 * - The V1 firmware is impossible to use on R-Car Gen3.
79 writel(RCAR_USB3_LCLK_ENA_VAL, hcd->regs + RCAR_USB3_LCLK); in xhci_rcar_start_gen2()
81 writel(RCAR_USB3_CONF1_VAL, hcd->regs + RCAR_USB3_CONF1); in xhci_rcar_start_gen2()
82 writel(RCAR_USB3_CONF2_VAL, hcd->regs + RCAR_USB3_CONF2); in xhci_rcar_start_gen2()
83 writel(RCAR_USB3_CONF3_VAL, hcd->regs + RCAR_USB3_CONF3); in xhci_rcar_start_gen2()
85 writel(RCAR_USB3_RX_POL_VAL, hcd->regs + RCAR_USB3_RX_POL); in xhci_rcar_start_gen2()
86 writel(RCAR_USB3_TX_POL_VAL, hcd->regs + RCAR_USB3_TX_POL); in xhci_rcar_start_gen2()
91 struct device_node *node = dev->of_node; in xhci_rcar_is_gen2()
93 return of_device_is_compatible(node, "renesas,xhci-r8a7790") || in xhci_rcar_is_gen2()
94 of_device_is_compatible(node, "renesas,xhci-r8a7791") || in xhci_rcar_is_gen2()
95 of_device_is_compatible(node, "renesas,xhci-r8a7793") || in xhci_rcar_is_gen2()
96 of_device_is_compatible(node, "renesas,rcar-gen2-xhci"); in xhci_rcar_is_gen2()
103 if (hcd->regs != NULL) { in xhci_rcar_start()
105 temp = readl(hcd->regs + RCAR_USB3_INT_ENA); in xhci_rcar_start()
107 writel(temp, hcd->regs + RCAR_USB3_INT_ENA); in xhci_rcar_start()
108 if (xhci_rcar_is_gen2(hcd->self.controller)) in xhci_rcar_start()
115 struct device *dev = hcd->self.controller; in xhci_rcar_download_firmware()
116 void __iomem *regs = hcd->regs; in xhci_rcar_download_firmware()
129 /* request R-Car USB3.0 firmware */ in xhci_rcar_download_firmware()
130 retval = request_firmware(&fw, priv->firmware_name, dev); in xhci_rcar_download_firmware()
134 /* download R-Car USB3.0 firmware */ in xhci_rcar_download_firmware()
139 for (index = 0; index < fw->size; index += 4) { in xhci_rcar_download_firmware()
141 for (data = 0, j = 3; j >= 0; j--) { in xhci_rcar_download_firmware()
142 if ((j + index) < fw->size) in xhci_rcar_download_firmware()
143 data |= fw->data[index + j] << (8 * j); in xhci_rcar_download_firmware()
174 retval = readl_poll_timeout_atomic(hcd->regs + RCAR_USB3_AXH_STA, in xhci_rcar_wait_for_pll_active()
179 /* This function needs to initialize a "phy" of usb before */
182 /* If hcd->regs is NULL, we don't just call the following function */ in xhci_rcar_init_quirk()
183 if (!hcd->regs) in xhci_rcar_init_quirk()
187 return -ETIMEDOUT; in xhci_rcar_init_quirk()
204 * On R-Car Gen2 and Gen3, the AC64 bit (bit 0) of HCCPARAMS1 is set
205 * to 1. However, these SoCs don't support 64-bit address memory
206 * pointers. So, this driver clears the AC64 bit of xhci->hcc_params
238 .compatible = "renesas,xhci-r8a7790",
241 .compatible = "renesas,xhci-r8a7791",
244 .compatible = "renesas,xhci-r8a7793",
247 .compatible = "renesas,xhci-r8a7795",
250 .compatible = "renesas,xhci-r8a7796",
253 .compatible = "renesas,rcar-gen2-xhci",
256 .compatible = "renesas,rcar-gen3-xhci",
259 .compatible = "renesas,rzv2m-xhci",
270 priv_match = of_device_get_match_data(&pdev->dev); in xhci_renesas_probe()
280 .name = "xhci-renesas-hcd",
287 MODULE_DESCRIPTION("xHCI Platform Host Controller Driver for Renesas R-Car and RZ");