Some Zhaoxin xHCI controllers follow usb3.1 spec,
but only support gen1 speed 5G. While in Linux kernel,
if xHCI suspport usb3.1,root hub speed will show on 10G.
To fix this issue, read usb speed ID supported by xHCI
to determine root hub speed.
The patch is scheduled to be submitted to the kernel mainline in 2021.
Signed-off-by: LeoLiu-oc <LeoLiu-oc(a)zhaoxin.com>
---
drivers/usb/host/xhci.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 65cc362717fc..6b67b58ef304 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -5035,6 +5035,8 @@ int xhci_gen_setup(struct usb_hcd *hcd,
xhci_get_quirks_t get_quirks)
*/
struct device *dev = hcd->self.sysdev;
unsigned int minor_rev;
+ struct pci_dev *pdev = to_pci_dev(dev);
+ u8 ssp_support = 1, i;
int retval;
/* Accept arbitrarily long scatter-gather lists */
@@ -5089,9 +5091,25 @@ int xhci_gen_setup(struct usb_hcd *hcd,
xhci_get_quirks_t get_quirks)
hcd->self.root_hub->speed = USB_SPEED_SUPER_PLUS;
break;
}
+
+ /* usb3.1 has gen1 and gen2, Some zx's xHCI controller that follow
usb3.1 spec
+ * but only support gen1
+ */
+ if (pdev->vendor == PCI_VENDOR_ID_ZHAOXIN) {
+ ssp_support = 0;
+ for (i = 0; i < xhci->usb3_rhub.psi_count; i++) {
+ if (XHCI_EXT_PORT_PSIV(xhci->usb3_rhub.psi[i]) >= 5)
+ ssp_support = 1;
+ }
+ if (ssp_support != 1) {
+ hcd->speed = HCD_USB3;
+ hcd->self.root_hub->speed = USB_SPEED_SUPER;
+ }
+ }
+
xhci_info(xhci, "Host supports USB 3.%x %sSuperSpeed\n",
minor_rev,
- minor_rev ? "Enhanced " : "");
+ ssp_support ? "Enhanced " : "");
xhci->usb3_rhub.hcd = hcd;
/* xHCI private pointer was set in xhci_pci_probe for the second
--
2.20.1
Over Current condition is not standardized in the UHCI spec.
Zhaoxin UHCI controllers report Over Current active off.
Intel controllers report it active on, so we'll adjust the bit value.
The patch is scheduled to be submitted to the kernel mainline in 2021.
Signed-off-by: LeoLiu-oc <LeoLiu-oc(a)zhaoxin.com>
---
drivers/usb/host/uhci-pci.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/usb/host/uhci-pci.c b/drivers/usb/host/uhci-pci.c
index 0dd944277c99..3c0d4c43b640 100644
--- a/drivers/usb/host/uhci-pci.c
+++ b/drivers/usb/host/uhci-pci.c
@@ -134,6 +134,9 @@ static int uhci_pci_init(struct usb_hcd *hcd)
if (to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_INTEL)
device_set_wakeup_capable(uhci_dev(uhci), true);
+ if (to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_ZHAOXIN)
+ uhci->oc_low = 1;
+
/* Set up pointers to PCI-specific functions */
uhci->reset_hc = uhci_pci_reset_hc;
uhci->check_and_reset_hc = uhci_pci_check_and_reset_hc;
--
2.20.1
This patch is provide by vendor phytium to enable ft25000 support
Now these patches are only temporarily integrated, and there are a lot
of detection warnings, we hope that PHYTIUM engineers can gradually
fix these bugs later, follow the uniform format of the kernel, before
send a patch, we can use the ./scripts/checkpatch.pl xxx.patch to check
that everything is ok, please.
Xin Hao (7):
PHYTIUM: ACPI: APD: Add clock frequency for for phytium i2c control
PHYTIUM: rtc: Add Phytium rtc device support
PHYTIUM: ACPI: add support for phytium profiling in GICC
PHYTIUM: irqchip:phytium-gic: add phytium new gic control support
config:arm64: Enable STAGING default
config:arm64: Add PHYTIUM ft2500 chip HW support
config: arm64: Change NODES_SHIFT value as 4
arch/arm64/Kconfig.platforms | 6 +
configs/config-4.19.y-aarch64 | 51 +-
configs/config-4.19.y-aarch64-debug | 51 +-
drivers/acpi/acpi_apd.c | 7 +
drivers/i2c/busses/i2c-designware-platdrv.c | 1 +
drivers/irqchip/irq-gic-common.h | 2 +
drivers/rtc/Kconfig | 10 +
drivers/rtc/Makefile | 1 +
drivers/rtc/rtc-phytium.c | 317 ++
drivers/staging/Kconfig | 2 +
drivers/staging/Makefile | 1 +
drivers/staging/gic_phytium_2500/Kconfig | 9 +
drivers/staging/gic_phytium_2500/Makefile | 1 +
.../irq-gic-phytium-2500-its.c | 3863 +++++++++++++++++
.../gic_phytium_2500/irq-gic-phytium-2500.c | 1865 ++++++++
include/acpi/actbl2.h | 3 +-
include/linux/irqchip/arm-gic-phytium-2500.h | 619 +++
17 files changed, 6804 insertions(+), 5 deletions(-)
create mode 100644 drivers/rtc/rtc-phytium.c
create mode 100644 drivers/staging/gic_phytium_2500/Kconfig
create mode 100644 drivers/staging/gic_phytium_2500/Makefile
create mode 100644 drivers/staging/gic_phytium_2500/irq-gic-phytium-2500-its.c
create mode 100644 drivers/staging/gic_phytium_2500/irq-gic-phytium-2500.c
create mode 100644 include/linux/irqchip/arm-gic-phytium-2500.h
--
2.31.0