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
commit 0f378d73d429d5f73fe2f00be4c9a15dbe9779ee upstream.
When a system suspends, the local APIC is disabled in the suspend sequence,
but the IOAPIC is left in the current state. This means unmasked interrupt
lines stay unmasked. This is usually the case for IOAPIC pin 9 to which the
ACPI interrupt is connected.
That means that in suspended state the IOAPIC can respond to an external
interrupt, e.g. the wakeup via keyboard/RTC/ACPI, but the interrupt message
cannot be handled by the disabled local APIC. As a consequence the Remote
IRR bit is set, but the local APIC does not send an EOI to acknowledge
it. This causes the affected interrupt line to become stale and the stale
Remote IRR bit will cause a hang when __synchronize_hardirq() is invoked
for that interrupt line.
To prevent this, mask all IOAPIC entries before disabling the local
APIC. The resume code already has the unmask operation inside.
[ tglx: Massaged changelog ]
Signed-off-by: Tony W Wang-oc <TonyWWang-oc(a)zhaoxin.com>
Signed-off-by: Thomas Gleixner <tglx(a)linutronix.de>
Link:
https://lore.kernel.org/r/1579076539-7267-1-git-send-email-TonyWWang-oc@zha…
Signed-off-by: LeoLiu-oc <LeoLiu-oc(a)zhaoxin.com>
---
arch/x86/kernel/apic/apic.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index fe19098fc35d..236399ad53df 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -2577,6 +2577,13 @@ static int lapic_suspend(void)
#endif
local_irq_save(flags);
+
+ /*
+ * Mask IOAPIC before disabling the local APIC to prevent stale IRR
+ * entries on some implementations.
+ */
+ mask_ioapic_entries();
+
disable_local_APIC();
irq_remapping_disable();
--
2.20.1
On some Zhaoxin platforms, xHCI will prefetch TRB for performance
improvement. However this TRB prefetch mechanism may cross page boundary,
which may access memory not belong to xHCI. In order to fix this issue,
using two pages for TRB allocate and only the first page will be used.
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-mem.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 82ce6d8b708d..9f4e1ee82898 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -2364,6 +2364,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
{
dma_addr_t dma;
struct device *dev = xhci_to_hcd(xhci)->self.sysdev;
+ struct pci_dev *pdev = to_pci_dev(dev);
unsigned int val, val2;
u64 val_64;
u32 page_size, temp;
@@ -2429,8 +2430,13 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
* and our use of dma addresses in the trb_address_map radix tree needs
* TRB_SEGMENT_SIZE alignment, so we pick the greater alignment need.
*/
- xhci->segment_pool = dma_pool_create("xHCI ring segments", dev,
- TRB_SEGMENT_SIZE, TRB_SEGMENT_SIZE, xhci->page_size);
+ /*With xHCI TRB prefetch patch:To fix cross page boundry access issue
in IOV environment*/
+ if ((pdev->vendor == PCI_VENDOR_ID_ZHAOXIN) && (pdev->device == 0x9202
|| pdev->device == 0x9203)) {
+ xhci->segment_pool = dma_pool_create("xHCI ring segments", dev,
+ TRB_SEGMENT_SIZE*2, TRB_SEGMENT_SIZE*2, xhci->page_size*2);
+ } else
+ xhci->segment_pool = dma_pool_create("xHCI ring segments", dev,
+ TRB_SEGMENT_SIZE, TRB_SEGMENT_SIZE, xhci->page_size);
/* See Table 46 and Note on Figure 55 */
xhci->device_pool = dma_pool_create("xHCI input/output contexts", dev,
--
2.20.1