Commit 526a240f authored by Yoshihiro Shimoda's avatar Yoshihiro Shimoda Committed by Greg Kroah-Hartman

usb: host: xhci-plat: add support for the R-Car H3 xHCI controllers

The R-Car H3 has two xHCI controllers. This SoC is compatible with
R-Car Gen2 SoCs, however this SoC doesn't need some specific registers
setting, and need a new firmware.
Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 82487b71
...@@ -3,8 +3,8 @@ USB xHCI controllers ...@@ -3,8 +3,8 @@ USB xHCI controllers
Required properties: Required properties:
- compatible: should be one of "generic-xhci", - compatible: should be one of "generic-xhci",
"marvell,armada-375-xhci", "marvell,armada-380-xhci", "marvell,armada-375-xhci", "marvell,armada-380-xhci",
"renesas,xhci-r8a7790", "renesas,xhci-r8a7791", "renesas,xhci-r8a7793" "renesas,xhci-r8a7790", "renesas,xhci-r8a7791", "renesas,xhci-r8a7793",
(deprecated: "xhci-platform"). "renesas,xhci-r8a7795" (deprecated: "xhci-platform").
- reg: should contain address and length of the standard XHCI - reg: should contain address and length of the standard XHCI
register set for the device. register set for the device.
- interrupts: one XHCI interrupt should be described here. - interrupts: one XHCI interrupt should be described here.
......
...@@ -52,7 +52,8 @@ static int xhci_plat_setup(struct usb_hcd *hcd) ...@@ -52,7 +52,8 @@ static int xhci_plat_setup(struct usb_hcd *hcd)
{ {
int ret; int ret;
if (xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2)) { if (xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2) ||
xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN3)) {
ret = xhci_rcar_init_quirk(hcd); ret = xhci_rcar_init_quirk(hcd);
if (ret) if (ret)
return ret; return ret;
...@@ -63,7 +64,8 @@ static int xhci_plat_setup(struct usb_hcd *hcd) ...@@ -63,7 +64,8 @@ static int xhci_plat_setup(struct usb_hcd *hcd)
static int xhci_plat_start(struct usb_hcd *hcd) static int xhci_plat_start(struct usb_hcd *hcd)
{ {
if (xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2)) if (xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2) ||
xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN3))
xhci_rcar_start(hcd); xhci_rcar_start(hcd);
return xhci_run(hcd); return xhci_run(hcd);
...@@ -79,6 +81,11 @@ static const struct xhci_plat_priv xhci_plat_renesas_rcar_gen2 = { ...@@ -79,6 +81,11 @@ static const struct xhci_plat_priv xhci_plat_renesas_rcar_gen2 = {
.firmware_name = XHCI_RCAR_FIRMWARE_NAME_V1, .firmware_name = XHCI_RCAR_FIRMWARE_NAME_V1,
}; };
static const struct xhci_plat_priv xhci_plat_renesas_rcar_gen3 = {
.type = XHCI_PLAT_TYPE_RENESAS_RCAR_GEN3,
.firmware_name = XHCI_RCAR_FIRMWARE_NAME_V2,
};
static const struct of_device_id usb_xhci_of_match[] = { static const struct of_device_id usb_xhci_of_match[] = {
{ {
.compatible = "generic-xhci", .compatible = "generic-xhci",
...@@ -99,6 +106,9 @@ static const struct of_device_id usb_xhci_of_match[] = { ...@@ -99,6 +106,9 @@ static const struct of_device_id usb_xhci_of_match[] = {
}, { }, {
.compatible = "renesas,xhci-r8a7793", .compatible = "renesas,xhci-r8a7793",
.data = &xhci_plat_renesas_rcar_gen2, .data = &xhci_plat_renesas_rcar_gen2,
}, {
.compatible = "renesas,xhci-r8a7795",
.data = &xhci_plat_renesas_rcar_gen3,
}, { }, {
}, },
}; };
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
enum xhci_plat_type { enum xhci_plat_type {
XHCI_PLAT_TYPE_MARVELL_ARMADA, XHCI_PLAT_TYPE_MARVELL_ARMADA,
XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2,
XHCI_PLAT_TYPE_RENESAS_RCAR_GEN3,
}; };
struct xhci_plat_priv { struct xhci_plat_priv {
......
...@@ -17,7 +17,14 @@ ...@@ -17,7 +17,14 @@
#include "xhci-plat.h" #include "xhci-plat.h"
#include "xhci-rcar.h" #include "xhci-rcar.h"
/*
* - The V2 firmware is possible to use on R-Car Gen2. However, the V2 causes
* performance degradation. So, this driver continues to use the V1 if R-Car
* Gen2.
* - The V1 firmware is impossible to use on R-Car Gen3.
*/
MODULE_FIRMWARE(XHCI_RCAR_FIRMWARE_NAME_V1); MODULE_FIRMWARE(XHCI_RCAR_FIRMWARE_NAME_V1);
MODULE_FIRMWARE(XHCI_RCAR_FIRMWARE_NAME_V2);
/*** Register Offset ***/ /*** Register Offset ***/
#define RCAR_USB3_INT_ENA 0x224 /* Interrupt Enable */ #define RCAR_USB3_INT_ENA 0x224 /* Interrupt Enable */
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#define _XHCI_RCAR_H #define _XHCI_RCAR_H
#define XHCI_RCAR_FIRMWARE_NAME_V1 "r8a779x_usb3_v1.dlmem" #define XHCI_RCAR_FIRMWARE_NAME_V1 "r8a779x_usb3_v1.dlmem"
#define XHCI_RCAR_FIRMWARE_NAME_V2 "r8a779x_usb3_v2.dlmem"
#if IS_ENABLED(CONFIG_USB_XHCI_RCAR) #if IS_ENABLED(CONFIG_USB_XHCI_RCAR)
void xhci_rcar_start(struct usb_hcd *hcd); void xhci_rcar_start(struct usb_hcd *hcd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment