From 92dfb050d81635519a7fd80e4aac0624a1c08204 Mon Sep 17 00:00:00 2001 From: Hanjun Guo Date: Wed, 1 Sep 2021 11:38:20 +0800 Subject: [PATCH] arm64: phytium: using MIDR_PHYTIUM_FT2000PLUS instead of ARM_CPU_IMP_PHYTIUM hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I41AUQ CVE: NA ------------------------------------- Update the code to using MIDR_PHYTIUM_FT2000PLUS, instead of ARM_CPU_IMP_PHYTIUM, which will distinguish FTC662 and FTC663. Signed-off-by: Hanjun Guo Cc: Guo Hui Cc: Cheng Jian Cc: Zhen Lei Cc: Xiuqi Xie Reviewed-by: Xie XiuQi Signed-off-by: Cheng Jian --- arch/arm64/kernel/topology.c | 6 +++--- drivers/usb/host/xhci-pci.c | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c index 4c22fe0cd3c6..02d3e688d657 100644 --- a/arch/arm64/kernel/topology.c +++ b/arch/arm64/kernel/topology.c @@ -290,10 +290,10 @@ void store_cpu_topology(unsigned int cpuid) cpuid_topo->core_id = cpuid; cpuid_topo->package_id = cpu_to_node(cpuid); - if (!(mpidr & MPIDR_MT_BITMASK) && - read_cpuid_implementor() == ARM_CPU_IMP_PHYTIUM) { + /* Some PHYTIUM FT2000PLUS platform firmware has no PPTT table */ + if ((read_cpuid_id() & MIDR_CPU_MODEL_MASK) == MIDR_PHYTIUM_FT2000PLUS + && cpu_to_node(cpuid) == NUMA_NO_NODE) { cpuid_topo->thread_id = 0; - cpuid_topo->core_id = cpuid; cpuid_topo->package_id = 0; } diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index 164f4d6350fe..886cd6fc4b64 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c @@ -310,8 +310,10 @@ static int xhci_pci_setup(struct usb_hcd *hcd) #include static void phytium_xhci_pci_workaround(struct pci_dev *dev) { + u32 midr = read_cpuid_id(); + /* Firmware bug, DMA mask is not reported by the firmware */ - if (read_cpuid_implementor() == ARM_CPU_IMP_PHYTIUM) + if ((midr & MIDR_CPU_MODEL_MASK) == MIDR_PHYTIUM_FT2000PLUS) dma_set_mask(&dev->dev, DMA_BIT_MASK(64)); } #else -- GitLab