From 9f23c66be7af392787a9f417b407a3b50f8854ab Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Mon, 31 Aug 2020 15:45:37 +0200 Subject: kernel 5.8.4 --- ...rm64-Ignore-broken-HPE-moonshot-APEI-supp.patch | 2 +- SOURCES/0001-ARM-tegra-usb-no-reset.patch | 2 +- ...tatus_to_str-and-rework-efi_status_to_err.patch | 10 +- ...-Add-option-of-13-for-FORCE_MAX_ZONEORDER.patch | 4 +- SOURCES/0001-Drop-that-for-now.patch | 4 +- ...MCFG-quirks-for-Tegra194-host-controllers.patch | 87 +- ...4-allwinner-dts-a64-add-LCD-related-devic.patch | 76 ++ ...ert-drm-panel-add-Xingbangda-XBD599-panel.patch | 418 +++++++++ ...sun4i-sun6i_mipi_dsi-fix-horizontal-timin.patch | 56 ++ ...indings-panel-add-binding-for-Xingbangda-.patch | 71 ++ ...-PCI-bar-fix-for-Broadcom-Vulcan-early-si.patch | 4 +- ...i-scan-Fix-regression-related-to-X-Gene-U.patch | 4 +- ...-Drop-the-EXPERT-setting-from-ARM64_FORCE.patch | 4 +- ...NFIG_HIGHPTE-optional-without-CONFIG_EXPE.patch | 4 +- ...nner-dts-a64-add-LCD-related-device-nodes.patch | 81 ++ ...un50i-a64-pinephone-Add-touchscreen-suppo.patch | 46 + ...un50i-a64-pinephone-Enable-LCD-support-on.patch | 112 +++ ...001-drm-panel-add-Xingbangda-XBD599-panel.patch | 423 +++++++++ ...ocktech-jh057n00900-Rename-the-driver-to-.patch | 948 +++++++++++++++++++++ ...-st7703-Add-support-for-Xingbangda-XBD599.patch | 251 ++++++ ...t7703-Assert-reset-prior-to-powering-down.patch | 29 + ...anel-st7703-Enter-sleep-after-display-off.patch | 41 + ...t7703-Move-code-specific-to-jh057n-closer.patch | 84 ++ ...t7703-Move-generic-part-of-init-sequence-.patch | 84 ++ ...t7703-Prepare-for-supporting-multiple-pan.patch | 128 +++ ...t7703-Rename-functions-from-jh057n-prefix.patch | 265 ++++++ ...un6i_mipi_dsi-fix-horizontal-timing-calcu.patch | 59 ++ ...-panel-Add-compatible-for-Xingbangda-XBD5.patch | 37 + ...-panel-Convert-rocktech-jh057n00900-to-ya.patch | 119 +++ ...-panel-add-binding-for-Xingbangda-XBD599-.patch | 74 ++ ...t-bindings-vendor-prefixes-Add-Xingbangda.patch | 8 +- ...-up-timeout-to-wait-when-ME-un-configure-.patch | 4 +- ...EFI_SECURE_BOOT-flag-to-indicate-secure-b.patch | 14 +- ...wn-the-kernel-if-booted-in-secure-boot-mo.patch | 4 +- ...iommu-arm-smmu-workaround-DMA-mode-issues.patch | 4 +- ...1-ipmi-do-not-configure-ipmi-for-HPE-m400.patch | 6 +- ...01-kdump-add-support-for-crashkernel-auto.patch | 2 +- ...6-thinkpad_acpi-lap-or-desk-mode-interfac.patch | 202 +++++ ...4-vdso32-Install-vdso32-from-vdso_install.patch | 48 ++ ...own-the-kernel-when-the-IPL-secure-flag-i.patch | 12 +- ...ckdown-expose-a-hook-to-lock-the-kernel-d.patch | 22 +- ...ow-reading-labels-before-policy-is-loaded.patch | 49 ++ ...-Re-order-PCIe-aperture-mappings-to-suppo.patch | 101 +++ SOURCES/0007-v5.7-fsync.patch | 908 -------------------- SOURCES/0007-v5.8-fsync.patch | 908 ++++++++++++++++++++ ...-valid-PWM-period-for-VDD_GPU-on-Tegra210.patch | 48 ++ SOURCES/dma-pool-fixes.patch | 419 +++++++++ SOURCES/filter-aarch64.sh | 2 +- SOURCES/filter-aarch64.sh.fedora | 2 +- SOURCES/filter-modules.sh | 2 +- SOURCES/filter-modules.sh.fedora | 2 +- SOURCES/filter-ppc64le.sh | 2 +- SOURCES/filter-ppc64le.sh.fedora | 2 +- SOURCES/kernel-aarch64-debug-fedora.config | 306 ++++++- SOURCES/kernel-aarch64-fedora.config | 285 ++++++- SOURCES/kernel-armv7hl-debug-fedora.config | 316 ++++++- SOURCES/kernel-armv7hl-fedora.config | 295 ++++++- SOURCES/kernel-armv7hl-lpae-debug-fedora.config | 317 ++++++- SOURCES/kernel-armv7hl-lpae-fedora.config | 296 ++++++- SOURCES/kernel-i686-debug-fedora.config | 327 ++++++- SOURCES/kernel-i686-fedora.config | 307 ++++++- SOURCES/kernel-ppc64le-debug-fedora.config | 307 ++++++- SOURCES/kernel-ppc64le-fedora.config | 286 ++++++- SOURCES/kernel-s390x-debug-fedora.config | 313 ++++++- SOURCES/kernel-s390x-fedora.config | 292 ++++++- SOURCES/kernel-x86_64-debug-fedora.config | 325 ++++++- SOURCES/kernel-x86_64-fedora.config | 305 ++++++- SPECS/kernel.spec | 125 ++- 68 files changed, 9239 insertions(+), 1461 deletions(-) create mode 100644 SOURCES/0001-Revert-arm64-allwinner-dts-a64-add-LCD-related-devic.patch create mode 100644 SOURCES/0001-Revert-drm-panel-add-Xingbangda-XBD599-panel.patch create mode 100644 SOURCES/0001-Revert-drm-sun4i-sun6i_mipi_dsi-fix-horizontal-timin.patch create mode 100644 SOURCES/0001-Revert-dt-bindings-panel-add-binding-for-Xingbangda-.patch create mode 100644 SOURCES/0001-arm64-allwinner-dts-a64-add-LCD-related-device-nodes.patch create mode 100644 SOURCES/0001-arm64-dts-sun50i-a64-pinephone-Add-touchscreen-suppo.patch create mode 100644 SOURCES/0001-arm64-dts-sun50i-a64-pinephone-Enable-LCD-support-on.patch create mode 100644 SOURCES/0001-drm-panel-add-Xingbangda-XBD599-panel.patch create mode 100644 SOURCES/0001-drm-panel-rocktech-jh057n00900-Rename-the-driver-to-.patch create mode 100644 SOURCES/0001-drm-panel-st7703-Add-support-for-Xingbangda-XBD599.patch create mode 100644 SOURCES/0001-drm-panel-st7703-Assert-reset-prior-to-powering-down.patch create mode 100644 SOURCES/0001-drm-panel-st7703-Enter-sleep-after-display-off.patch create mode 100644 SOURCES/0001-drm-panel-st7703-Move-code-specific-to-jh057n-closer.patch create mode 100644 SOURCES/0001-drm-panel-st7703-Move-generic-part-of-init-sequence-.patch create mode 100644 SOURCES/0001-drm-panel-st7703-Prepare-for-supporting-multiple-pan.patch create mode 100644 SOURCES/0001-drm-panel-st7703-Rename-functions-from-jh057n-prefix.patch create mode 100644 SOURCES/0001-drm-sun4i-sun6i_mipi_dsi-fix-horizontal-timing-calcu.patch create mode 100644 SOURCES/0001-dt-bindings-panel-Add-compatible-for-Xingbangda-XBD5.patch create mode 100644 SOURCES/0001-dt-bindings-panel-Convert-rocktech-jh057n00900-to-ya.patch create mode 100644 SOURCES/0001-dt-bindings-panel-add-binding-for-Xingbangda-XBD599-.patch create mode 100644 SOURCES/0001-platform-x86-thinkpad_acpi-lap-or-desk-mode-interfac.patch create mode 100644 SOURCES/0001-revert-ARM64-vdso32-Install-vdso32-from-vdso_install.patch create mode 100644 SOURCES/0001-selinux-allow-reading-labels-before-policy-is-loaded.patch create mode 100644 SOURCES/0002-arm64-tegra-Re-order-PCIe-aperture-mappings-to-suppo.patch delete mode 100644 SOURCES/0007-v5.7-fsync.patch create mode 100644 SOURCES/0007-v5.8-fsync.patch create mode 100644 SOURCES/arm64-tegra-Use-valid-PWM-period-for-VDD_GPU-on-Tegra210.patch create mode 100644 SOURCES/dma-pool-fixes.patch diff --git a/SOURCES/0001-ACPI-APEI-arm64-Ignore-broken-HPE-moonshot-APEI-supp.patch b/SOURCES/0001-ACPI-APEI-arm64-Ignore-broken-HPE-moonshot-APEI-supp.patch index ec362d9..1a5bec6 100644 --- a/SOURCES/0001-ACPI-APEI-arm64-Ignore-broken-HPE-moonshot-APEI-supp.patch +++ b/SOURCES/0001-ACPI-APEI-arm64-Ignore-broken-HPE-moonshot-APEI-supp.patch @@ -48,7 +48,7 @@ Signed-off-by: Herton R. Krzesinski 1 file changed, 8 insertions(+) diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c -index 822402480f7d..3f87d8602560 100644 +index 953a2fae8b15..7ea07f7da582 100644 --- a/drivers/acpi/apei/hest.c +++ b/drivers/acpi/apei/hest.c @@ -88,6 +88,14 @@ int apei_hest_parse(apei_hest_func_t func, void *data) diff --git a/SOURCES/0001-ARM-tegra-usb-no-reset.patch b/SOURCES/0001-ARM-tegra-usb-no-reset.patch index f91c6b8..21ebad4 100644 --- a/SOURCES/0001-ARM-tegra-usb-no-reset.patch +++ b/SOURCES/0001-ARM-tegra-usb-no-reset.patch @@ -10,7 +10,7 @@ Patch for disconnect issues with storage attached to a 1 file changed, 7 insertions(+) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c -index fc748c731832..7d35e12de70f 100644 +index b1e14beaac5f..b28779779058 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -5517,6 +5517,13 @@ static void hub_event(struct work_struct *work) diff --git a/SOURCES/0001-Add-efi_status_to_str-and-rework-efi_status_to_err.patch b/SOURCES/0001-Add-efi_status_to_str-and-rework-efi_status_to_err.patch index ee11a24..9fa2f1a 100644 --- a/SOURCES/0001-Add-efi_status_to_str-and-rework-efi_status_to_err.patch +++ b/SOURCES/0001-Add-efi_status_to_str-and-rework-efi_status_to_err.patch @@ -15,7 +15,7 @@ Signed-off-by: Peter Jones 2 files changed, 96 insertions(+), 31 deletions(-) diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c -index 4e3055238f31..36ca9e2943ce 100644 +index fdd1db025dbf..8ef7d1df09dd 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -31,6 +31,7 @@ @@ -26,7 +26,7 @@ index 4e3055238f31..36ca9e2943ce 100644 #include -@@ -828,40 +829,101 @@ int efi_mem_type(unsigned long phys_addr) +@@ -831,40 +832,101 @@ int efi_mem_type(unsigned long phys_addr) } #endif @@ -160,10 +160,10 @@ index 4e3055238f31..36ca9e2943ce 100644 static DEFINE_SPINLOCK(efi_mem_reserve_persistent_lock); diff --git a/include/linux/efi.h b/include/linux/efi.h -index 9430d01c0c3d..51503bf118ab 100644 +index 05c47f857383..2e2f9f608f68 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h -@@ -42,6 +42,8 @@ +@@ -43,6 +43,8 @@ #define EFI_ABORTED (21 | (1UL << (BITS_PER_LONG-1))) #define EFI_SECURITY_VIOLATION (26 | (1UL << (BITS_PER_LONG-1))) @@ -172,7 +172,7 @@ index 9430d01c0c3d..51503bf118ab 100644 typedef unsigned long efi_status_t; typedef u8 efi_bool_t; typedef u16 efi_char16_t; /* UNICODE character */ -@@ -825,6 +827,7 @@ static inline bool efi_rt_services_supported(unsigned int mask) +@@ -828,6 +830,7 @@ static inline bool efi_rt_services_supported(unsigned int mask) #endif extern int efi_status_to_err(efi_status_t status); diff --git a/SOURCES/0001-Add-option-of-13-for-FORCE_MAX_ZONEORDER.patch b/SOURCES/0001-Add-option-of-13-for-FORCE_MAX_ZONEORDER.patch index 970824d..64cdd41 100644 --- a/SOURCES/0001-Add-option-of-13-for-FORCE_MAX_ZONEORDER.patch +++ b/SOURCES/0001-Add-option-of-13-for-FORCE_MAX_ZONEORDER.patch @@ -16,10 +16,10 @@ Signed-off-by: Jeremy Cline 1 file changed, 1 insertion(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig -index 7f37a6d0658a..c88ee0e8ce6e 100644 +index 2e0700a451e5..77e7e749d7e5 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig -@@ -1126,6 +1126,7 @@ config XEN +@@ -1133,6 +1133,7 @@ config XEN config FORCE_MAX_ZONEORDER int default "14" if (ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE) diff --git a/SOURCES/0001-Drop-that-for-now.patch b/SOURCES/0001-Drop-that-for-now.patch index bc898b6..c26066e 100644 --- a/SOURCES/0001-Drop-that-for-now.patch +++ b/SOURCES/0001-Drop-that-for-now.patch @@ -8,10 +8,10 @@ Subject: [PATCH] Drop that for now 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile -index 3d65d1153aac..0e2fb7fe2675 100644 +index 37cfb39d77af..c65a263990ae 100644 --- a/Makefile +++ b/Makefile -@@ -479,7 +479,7 @@ KBUILD_AFLAGS := -D__ASSEMBLY__ -fno-PIE +@@ -496,7 +496,7 @@ KBUILD_AFLAGS := -D__ASSEMBLY__ -fno-PIE KBUILD_CFLAGS := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \ -Werror=implicit-function-declaration -Werror=implicit-int \ diff --git a/SOURCES/0001-PCI-Add-MCFG-quirks-for-Tegra194-host-controllers.patch b/SOURCES/0001-PCI-Add-MCFG-quirks-for-Tegra194-host-controllers.patch index 6fc81f8..bf1e480 100644 --- a/SOURCES/0001-PCI-Add-MCFG-quirks-for-Tegra194-host-controllers.patch +++ b/SOURCES/0001-PCI-Add-MCFG-quirks-for-Tegra194-host-controllers.patch @@ -1,6 +1,6 @@ -From 92c547f35f4852908f40c2861d9b9d10e0c5099b Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Sun, 28 Jun 2020 16:48:50 +0100 +From 9134295c0515492b1ab7733c0290b2afde336d6b Mon Sep 17 00:00:00 2001 +From: Vidya Sagar +Date: Sat, 11 Jan 2020 00:45:00 +0530 Subject: [PATCH] PCI: Add MCFG quirks for Tegra194 host controllers The PCIe controller in Tegra194 SoC is not completely ECAM-compliant. @@ -15,25 +15,20 @@ to generate respective configuration accesses just like the way it is done in DesignWare core sub-system. Signed-off-by: Vidya Sagar -Reported-by: kbuild test robot -Signed-off-by: Peter Robinson ---- -V3: -* Removed MCFG address hardcoding in pci_mcfg.c file -* Started using 'dbi_base' for accessing root port's own config space -* and using 'config_base' for accessing config space of downstream hierarchy - -V2: -* Fixed build issues reported by kbuild test bot +Acked-by: Thierry Reding +[ Updated by jonathanh@nvidia.com only permit building the Tegra194 + PCIe driver into the kernel and not as a module ] +Signed-off-by: Jon Hunter --- drivers/acpi/pci_mcfg.c | 7 ++ + drivers/pci/controller/dwc/Kconfig | 10 +- drivers/pci/controller/dwc/Makefile | 2 +- drivers/pci/controller/dwc/pcie-tegra194.c | 102 +++++++++++++++++++++ include/linux/pci-ecam.h | 1 + - 4 files changed, 111 insertions(+), 1 deletion(-) + 5 files changed, 117 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/pci_mcfg.c b/drivers/acpi/pci_mcfg.c -index 6b347d9920cc2..7071814081736 100644 +index 54b36b7ad47d9..6573d495d9c1f 100644 --- a/drivers/acpi/pci_mcfg.c +++ b/drivers/acpi/pci_mcfg.c @@ -116,6 +116,13 @@ static struct mcfg_fixup mcfg_quirks[] = { @@ -50,8 +45,44 @@ index 6b347d9920cc2..7071814081736 100644 #define XGENE_V1_ECAM_MCFG(rev, seg) \ {"APM ", "XGENE ", rev, seg, MCFG_BUS_ANY, \ &xgene_v1_pcie_ecam_ops } +diff --git a/drivers/pci/controller/dwc/Kconfig b/drivers/pci/controller/dwc/Kconfig +index 044a3761c44f2..e4ee4bf9ac64a 100644 +--- a/drivers/pci/controller/dwc/Kconfig ++++ b/drivers/pci/controller/dwc/Kconfig +@@ -247,25 +247,27 @@ config PCI_MESON + implement the driver. + + config PCIE_TEGRA194 +- tristate ++ bool + + config PCIE_TEGRA194_HOST +- tristate "NVIDIA Tegra194 (and later) PCIe controller - Host Mode" ++ bool "NVIDIA Tegra194 (and later) PCIe controller - Host Mode" + depends on ARCH_TEGRA_194_SOC || COMPILE_TEST + depends on PCI_MSI_IRQ_DOMAIN + select PCIE_DW_HOST + select PHY_TEGRA194_P2U + select PCIE_TEGRA194 ++ default y if ARCH_TEGRA_194_SOC + help + Enables support for the PCIe controller in the NVIDIA Tegra194 SoC to + work in host mode. There are two instances of PCIe controllers in + Tegra194. This controller can work either as EP or RC. In order to + enable host-specific features PCIE_TEGRA194_HOST must be selected and + in order to enable device-specific features PCIE_TEGRA194_EP must be +- selected. This uses the DesignWare core. ++ selected. This uses the DesignWare core. ACPI platforms with Tegra194 ++ don't need to enable this. + + config PCIE_TEGRA194_EP +- tristate "NVIDIA Tegra194 (and later) PCIe controller - Endpoint Mode" ++ bool "NVIDIA Tegra194 (and later) PCIe controller - Endpoint Mode" + depends on ARCH_TEGRA_194_SOC || COMPILE_TEST + depends on PCI_ENDPOINT + select PCIE_DW_EP diff --git a/drivers/pci/controller/dwc/Makefile b/drivers/pci/controller/dwc/Makefile -index 8a637cfcf6e99..76a6c52b8500e 100644 +index a751553fa0dbd..dbb9818765566 100644 --- a/drivers/pci/controller/dwc/Makefile +++ b/drivers/pci/controller/dwc/Makefile @@ -17,7 +17,6 @@ obj-$(CONFIG_PCIE_INTEL_GW) += pcie-intel-gw.o @@ -60,16 +91,16 @@ index 8a637cfcf6e99..76a6c52b8500e 100644 obj-$(CONFIG_PCI_MESON) += pci-meson.o -obj-$(CONFIG_PCIE_TEGRA194) += pcie-tegra194.o obj-$(CONFIG_PCIE_UNIPHIER) += pcie-uniphier.o + obj-$(CONFIG_PCIE_UNIPHIER_EP) += pcie-uniphier-ep.o - # The following drivers are for devices that use the generic ACPI -@@ -33,4 +32,5 @@ obj-$(CONFIG_PCIE_UNIPHIER) += pcie-uniphier.o +@@ -34,4 +33,5 @@ obj-$(CONFIG_PCIE_UNIPHIER_EP) += pcie-uniphier-ep.o ifdef CONFIG_PCI obj-$(CONFIG_ARM64) += pcie-al.o obj-$(CONFIG_ARM64) += pcie-hisi.o +obj-$(CONFIG_ARM64) += pcie-tegra194.o endif diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c -index ae30a2fd3716a..571b39c5cac63 100644 +index 92b77f7d83546..7b3d581795197 100644 --- a/drivers/pci/controller/dwc/pcie-tegra194.c +++ b/drivers/pci/controller/dwc/pcie-tegra194.c @@ -22,6 +22,8 @@ @@ -169,7 +200,7 @@ index ae30a2fd3716a..571b39c5cac63 100644 + return (void __iomem *)(pcie->config_base + where); +} + -+struct pci_ecam_ops tegra194_pcie_ops = { ++const struct pci_ecam_ops tegra194_pcie_ops = { + .bus_shift = 20, + .init = tegra194_acpi_init, + .pci_ops = { @@ -185,7 +216,7 @@ index ae30a2fd3716a..571b39c5cac63 100644 static inline struct tegra_pcie_dw *to_tegra_pcie(struct dw_pcie *pci) { return container_of(pci, struct tegra_pcie_dw, pci); -@@ -2406,3 +2505,6 @@ MODULE_DEVICE_TABLE(of, tegra_pcie_dw_of_match); +@@ -2405,3 +2504,6 @@ MODULE_DEVICE_TABLE(of, tegra_pcie_dw_of_match); MODULE_AUTHOR("Vidya Sagar "); MODULE_DESCRIPTION("NVIDIA PCIe host controller driver"); MODULE_LICENSE("GPL v2"); @@ -193,17 +224,17 @@ index ae30a2fd3716a..571b39c5cac63 100644 +#endif /* CONFIG_PCIE_TEGRA194 */ + diff --git a/include/linux/pci-ecam.h b/include/linux/pci-ecam.h -index a73164c85e78b..6156140dcbb65 100644 +index 1af5cb02ef7f9..3fb16ada505a0 100644 --- a/include/linux/pci-ecam.h +++ b/include/linux/pci-ecam.h -@@ -57,6 +57,7 @@ extern struct pci_ecam_ops pci_thunder_ecam_ops; /* Cavium ThunderX 1.x */ - extern struct pci_ecam_ops xgene_v1_pcie_ecam_ops; /* APM X-Gene PCIe v1 */ - extern struct pci_ecam_ops xgene_v2_pcie_ecam_ops; /* APM X-Gene PCIe v2.x */ - extern struct pci_ecam_ops al_pcie_ops; /* Amazon Annapurna Labs PCIe */ -+extern struct pci_ecam_ops tegra194_pcie_ops; /* Tegra194 PCIe */ +@@ -57,6 +57,7 @@ extern const struct pci_ecam_ops pci_thunder_ecam_ops; /* Cavium ThunderX 1.x */ + extern const struct pci_ecam_ops xgene_v1_pcie_ecam_ops; /* APM X-Gene PCIe v1 */ + extern const struct pci_ecam_ops xgene_v2_pcie_ecam_ops; /* APM X-Gene PCIe v2.x */ + extern const struct pci_ecam_ops al_pcie_ops; /* Amazon Annapurna Labs PCIe */ ++extern const struct pci_ecam_ops tegra194_pcie_ops; /* Tegra194 PCIe */ #endif - #ifdef CONFIG_PCI_HOST_COMMON + #if IS_ENABLED(CONFIG_PCI_HOST_COMMON) -- 2.26.2 diff --git a/SOURCES/0001-Revert-arm64-allwinner-dts-a64-add-LCD-related-devic.patch b/SOURCES/0001-Revert-arm64-allwinner-dts-a64-add-LCD-related-devic.patch new file mode 100644 index 0000000..0ea8f7d --- /dev/null +++ b/SOURCES/0001-Revert-arm64-allwinner-dts-a64-add-LCD-related-devic.patch @@ -0,0 +1,76 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Sun, 12 Jul 2020 13:42:14 +0100 +Subject: [PATCH] Revert "arm64: allwinner: dts: a64: add LCD-related device + nodes for PinePhone" + +This reverts commit 6b9deda8c30064a254bc66e3f6763281c96db7db. +--- + .../dts/allwinner/sun50i-a64-pinephone.dtsi | 37 ------------------- + 1 file changed, 37 deletions(-) + +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +index 96d9150423e0..cefda145c3c9 100644 +--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi ++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +@@ -16,15 +16,6 @@ aliases { + serial0 = &uart0; + }; + +- backlight: backlight { +- compatible = "pwm-backlight"; +- pwms = <&r_pwm 0 50000 PWM_POLARITY_INVERTED>; +- brightness-levels = <0 16 18 20 22 24 26 29 32 35 38 42 46 51 56 62 68 75 83 91 100>; +- default-brightness-level = <15>; +- enable-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */ +- power-supply = <®_ldo_io0>; +- }; +- + chosen { + stdout-path = "serial0:115200n8"; + }; +@@ -93,30 +84,6 @@ &dai { + status = "okay"; + }; + +-&de { +- status = "okay"; +-}; +- +-&dphy { +- status = "okay"; +-}; +- +-&dsi { +- vcc-dsi-supply = <®_dldo1>; +- #address-cells = <1>; +- #size-cells = <0>; +- status = "okay"; +- +- panel@0 { +- compatible = "xingbangda,xbd599"; +- reg = <0>; +- reset-gpios = <&pio 3 23 GPIO_ACTIVE_LOW>; /* PD23 */ +- iovcc-supply = <®_dldo2>; +- vcc-supply = <®_ldo_io0>; +- backlight = <&backlight>; +- }; +-}; +- + &ehci0 { + status = "okay"; + }; +@@ -221,10 +188,6 @@ &r_pio { + */ + }; + +-&r_pwm { +- status = "okay"; +-}; +- + &r_rsb { + status = "okay"; + +-- +2.26.2 + diff --git a/SOURCES/0001-Revert-drm-panel-add-Xingbangda-XBD599-panel.patch b/SOURCES/0001-Revert-drm-panel-add-Xingbangda-XBD599-panel.patch new file mode 100644 index 0000000..2950f8a --- /dev/null +++ b/SOURCES/0001-Revert-drm-panel-add-Xingbangda-XBD599-panel.patch @@ -0,0 +1,418 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Sun, 12 Jul 2020 13:41:56 +0100 +Subject: [PATCH] Revert "drm: panel: add Xingbangda XBD599 panel" + +This reverts commit 5d53795bb19e39f048ac8028ec36ff04765e1237. +--- + drivers/gpu/drm/panel/Kconfig | 9 - + drivers/gpu/drm/panel/Makefile | 1 - + .../gpu/drm/panel/panel-xingbangda-xbd599.c | 366 ------------------ + 3 files changed, 376 deletions(-) + delete mode 100644 drivers/gpu/drm/panel/panel-xingbangda-xbd599.c + +diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig +index 1f55a87bb657..39055c1f0e2f 100644 +--- a/drivers/gpu/drm/panel/Kconfig ++++ b/drivers/gpu/drm/panel/Kconfig +@@ -462,15 +462,6 @@ config DRM_PANEL_VISIONOX_RM69299 + Say Y here if you want to enable support for Visionox + RM69299 DSI Video Mode panel. + +-config DRM_PANEL_XINGBANGDA_XBD599 +- tristate "Xingbangda XBD599 panel" +- depends on OF +- depends on DRM_MIPI_DSI +- depends on BACKLIGHT_CLASS_DEVICE +- help +- Say Y here if you want to enable support for the Xingbangda XBD599 +- MIPI DSI Video Mode panel. +- + config DRM_PANEL_XINPENG_XPP055C272 + tristate "Xinpeng XPP055C272 panel driver" + depends on OF +diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile +index 7b6b0c0397d6..de74f282c433 100644 +--- a/drivers/gpu/drm/panel/Makefile ++++ b/drivers/gpu/drm/panel/Makefile +@@ -49,5 +49,4 @@ obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o + obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o + obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o + obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) += panel-visionox-rm69299.o +-obj-$(CONFIG_DRM_PANEL_XINGBANGDA_XBD599) += panel-xingbangda-xbd599.o + obj-$(CONFIG_DRM_PANEL_XINPENG_XPP055C272) += panel-xinpeng-xpp055c272.o +diff --git a/drivers/gpu/drm/panel/panel-xingbangda-xbd599.c b/drivers/gpu/drm/panel/panel-xingbangda-xbd599.c +deleted file mode 100644 +index b483f96ee1db..000000000000 +--- a/drivers/gpu/drm/panel/panel-xingbangda-xbd599.c ++++ /dev/null +@@ -1,366 +0,0 @@ +-// SPDX-License-Identifier: GPL-2.0 +-/* +- * Xingbangda XBD599 MIPI-DSI panel driver +- * +- * Copyright (C) 2019-2020 Icenowy Zheng +- * +- * Based on panel-rocktech-jh057n00900.c, which is: +- * Copyright (C) Purism SPC 2019 +- */ +- +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +-#include +- +-/* Manufacturer specific Commands send via DSI */ +-#define ST7703_CMD_ALL_PIXEL_OFF 0x22 +-#define ST7703_CMD_ALL_PIXEL_ON 0x23 +-#define ST7703_CMD_SETDISP 0xB2 +-#define ST7703_CMD_SETRGBIF 0xB3 +-#define ST7703_CMD_SETCYC 0xB4 +-#define ST7703_CMD_SETBGP 0xB5 +-#define ST7703_CMD_SETVCOM 0xB6 +-#define ST7703_CMD_SETOTP 0xB7 +-#define ST7703_CMD_SETPOWER_EXT 0xB8 +-#define ST7703_CMD_SETEXTC 0xB9 +-#define ST7703_CMD_SETMIPI 0xBA +-#define ST7703_CMD_SETVDC 0xBC +-#define ST7703_CMD_SETSCR 0xC0 +-#define ST7703_CMD_SETPOWER 0xC1 +-#define ST7703_CMD_UNK_C6 0xC6 +-#define ST7703_CMD_SETPANEL 0xCC +-#define ST7703_CMD_SETGAMMA 0xE0 +-#define ST7703_CMD_SETEQ 0xE3 +-#define ST7703_CMD_SETGIP1 0xE9 +-#define ST7703_CMD_SETGIP2 0xEA +- +-static const char * const regulator_names[] = { +- "iovcc", +- "vcc", +-}; +- +-struct xbd599 { +- struct device *dev; +- struct drm_panel panel; +- struct gpio_desc *reset_gpio; +- struct regulator_bulk_data supplies[ARRAY_SIZE(regulator_names)]; +- bool prepared; +-}; +- +-static inline struct xbd599 *panel_to_xbd599(struct drm_panel *panel) +-{ +- return container_of(panel, struct xbd599, panel); +-} +- +-#define dsi_dcs_write_seq(dsi, cmd, seq...) do { \ +- static const u8 d[] = { seq }; \ +- int ret; \ +- ret = mipi_dsi_dcs_write(dsi, cmd, d, ARRAY_SIZE(d)); \ +- if (ret < 0) \ +- return ret; \ +- } while (0) +- +-static int xbd599_init_sequence(struct xbd599 *ctx) +-{ +- struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); +- struct device *dev = ctx->dev; +- int ret; +- +- /* +- * Init sequence was supplied by the panel vendor. +- */ +- dsi_dcs_write_seq(dsi, ST7703_CMD_SETEXTC, +- 0xF1, 0x12, 0x83); +- dsi_dcs_write_seq(dsi, ST7703_CMD_SETMIPI, +- 0x33, 0x81, 0x05, 0xF9, 0x0E, 0x0E, 0x20, 0x00, +- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x25, +- 0x00, 0x91, 0x0a, 0x00, 0x00, 0x02, 0x4F, 0x11, +- 0x00, 0x00, 0x37); +- dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT, +- 0x25, 0x22, 0x20, 0x03); +- dsi_dcs_write_seq(dsi, ST7703_CMD_SETRGBIF, +- 0x10, 0x10, 0x05, 0x05, 0x03, 0xFF, 0x00, 0x00, +- 0x00, 0x00); +- dsi_dcs_write_seq(dsi, ST7703_CMD_SETSCR, +- 0x73, 0x73, 0x50, 0x50, 0x00, 0xC0, 0x08, 0x70, +- 0x00); +- dsi_dcs_write_seq(dsi, ST7703_CMD_SETVDC, 0x4E); +- dsi_dcs_write_seq(dsi, ST7703_CMD_SETPANEL, 0x0B); +- dsi_dcs_write_seq(dsi, ST7703_CMD_SETCYC, 0x80); +- dsi_dcs_write_seq(dsi, ST7703_CMD_SETDISP, 0xF0, 0x12, 0xF0); +- dsi_dcs_write_seq(dsi, ST7703_CMD_SETEQ, +- 0x00, 0x00, 0x0B, 0x0B, 0x10, 0x10, 0x00, 0x00, +- 0x00, 0x00, 0xFF, 0x00, 0xC0, 0x10); +- dsi_dcs_write_seq(dsi, 0xC6, 0x01, 0x00, 0xFF, 0xFF, 0x00); +- dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER, +- 0x74, 0x00, 0x32, 0x32, 0x77, 0xF1, 0xFF, 0xFF, +- 0xCC, 0xCC, 0x77, 0x77); +- dsi_dcs_write_seq(dsi, ST7703_CMD_SETBGP, 0x07, 0x07); +- dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, 0x2C, 0x2C); +- dsi_dcs_write_seq(dsi, 0xBF, 0x02, 0x11, 0x00); +- +- dsi_dcs_write_seq(dsi, ST7703_CMD_SETGIP1, +- 0x82, 0x10, 0x06, 0x05, 0xA2, 0x0A, 0xA5, 0x12, +- 0x31, 0x23, 0x37, 0x83, 0x04, 0xBC, 0x27, 0x38, +- 0x0C, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x00, +- 0x03, 0x00, 0x00, 0x00, 0x75, 0x75, 0x31, 0x88, +- 0x88, 0x88, 0x88, 0x88, 0x88, 0x13, 0x88, 0x64, +- 0x64, 0x20, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, +- 0x02, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); +- dsi_dcs_write_seq(dsi, ST7703_CMD_SETGIP2, +- 0x02, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +- 0x00, 0x00, 0x00, 0x00, 0x02, 0x46, 0x02, 0x88, +- 0x88, 0x88, 0x88, 0x88, 0x88, 0x64, 0x88, 0x13, +- 0x57, 0x13, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, +- 0x75, 0x88, 0x23, 0x14, 0x00, 0x00, 0x02, 0x00, +- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0A, +- 0xA5, 0x00, 0x00, 0x00, 0x00); +- dsi_dcs_write_seq(dsi, ST7703_CMD_SETGAMMA, +- 0x00, 0x09, 0x0D, 0x23, 0x27, 0x3C, 0x41, 0x35, +- 0x07, 0x0D, 0x0E, 0x12, 0x13, 0x10, 0x12, 0x12, +- 0x18, 0x00, 0x09, 0x0D, 0x23, 0x27, 0x3C, 0x41, +- 0x35, 0x07, 0x0D, 0x0E, 0x12, 0x13, 0x10, 0x12, +- 0x12, 0x18); +- msleep(20); +- +- ret = mipi_dsi_dcs_exit_sleep_mode(dsi); +- if (ret < 0) { +- DRM_DEV_ERROR(dev, "Failed to exit sleep mode\n"); +- return ret; +- } +- msleep(250); +- +- ret = mipi_dsi_dcs_set_display_on(dsi); +- if (ret) +- return ret; +- msleep(50); +- +- DRM_DEV_DEBUG_DRIVER(dev, "Panel init sequence done\n"); +- return 0; +-} +- +-static int xbd599_prepare(struct drm_panel *panel) +-{ +- struct xbd599 *ctx = panel_to_xbd599(panel); +- int ret; +- +- if (ctx->prepared) +- return 0; +- +- ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies); +- if (ret) +- return ret; +- +- DRM_DEV_DEBUG_DRIVER(ctx->dev, "Resetting the panel\n"); +- gpiod_set_value_cansleep(ctx->reset_gpio, 1); +- usleep_range(20, 40); +- gpiod_set_value_cansleep(ctx->reset_gpio, 0); +- msleep(20); +- +- ctx->prepared = true; +- +- return 0; +-} +- +-static int xbd599_enable(struct drm_panel *panel) +-{ +- struct xbd599 *ctx = panel_to_xbd599(panel); +- int ret; +- +- ret = xbd599_init_sequence(ctx); +- if (ret < 0) { +- DRM_DEV_ERROR(ctx->dev, "Panel init sequence failed: %d\n", +- ret); +- return ret; +- } +- +- return 0; +-} +- +-static int xbd599_disable(struct drm_panel *panel) +-{ +- struct xbd599 *ctx = panel_to_xbd599(panel); +- struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); +- +- return mipi_dsi_dcs_set_display_off(dsi); +-} +- +-static int xbd599_unprepare(struct drm_panel *panel) +-{ +- struct xbd599 *ctx = panel_to_xbd599(panel); +- +- if (!ctx->prepared) +- return 0; +- +- gpiod_set_value_cansleep(ctx->reset_gpio, 1); +- regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies); +- ctx->prepared = false; +- +- return 0; +-} +- +-static const struct drm_display_mode xbd599_default_mode = { +- .hdisplay = 720, +- .hsync_start = 720 + 40, +- .hsync_end = 720 + 40 + 40, +- .htotal = 720 + 40 + 40 + 40, +- .vdisplay = 1440, +- .vsync_start = 1440 + 18, +- .vsync_end = 1440 + 18 + 10, +- .vtotal = 1440 + 18 + 10 + 17, +- .vrefresh = 60, +- .clock = 69000, +- .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC, +- +- .width_mm = 68, +- .height_mm = 136, +- .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, +-}; +- +-static int xbd599_get_modes(struct drm_panel *panel, +- struct drm_connector *connector) +-{ +- struct xbd599 *ctx = panel_to_xbd599(panel); +- struct drm_display_mode *mode; +- +- mode = drm_mode_duplicate(connector->dev, &xbd599_default_mode); +- if (!mode) { +- DRM_DEV_ERROR(ctx->dev, "Failed to add mode\n"); +- return -ENOMEM; +- } +- +- drm_mode_set_name(mode); +- +- mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; +- connector->display_info.width_mm = mode->width_mm; +- connector->display_info.height_mm = mode->height_mm; +- drm_mode_probed_add(connector, mode); +- +- return 1; +-} +- +-static const struct drm_panel_funcs xbd599_drm_funcs = { +- .prepare = xbd599_prepare, +- .enable = xbd599_enable, +- .disable = xbd599_disable, +- .unprepare = xbd599_unprepare, +- .get_modes = xbd599_get_modes, +-}; +- +-static int xbd599_probe(struct mipi_dsi_device *dsi) +-{ +- struct device *dev = &dsi->dev; +- struct xbd599 *ctx; +- int i, ret; +- +- ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); +- if (!ctx) +- return -ENOMEM; +- +- for (i = 0; i < ARRAY_SIZE(ctx->supplies); i++) +- ctx->supplies[i].supply = regulator_names[i]; +- +- ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies), +- ctx->supplies); +- if (ret < 0) { +- DRM_DEV_ERROR(&dsi->dev, "cannot get regulators\n"); +- return ret; +- } +- +- ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); +- if (IS_ERR(ctx->reset_gpio)) { +- DRM_DEV_ERROR(dev, "cannot get reset gpio\n"); +- return PTR_ERR(ctx->reset_gpio); +- } +- +- mipi_dsi_set_drvdata(dsi, ctx); +- +- ctx->dev = dev; +- +- dsi->lanes = 4; +- dsi->format = MIPI_DSI_FMT_RGB888; +- dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE; +- +- drm_panel_init(&ctx->panel, &dsi->dev, &xbd599_drm_funcs, +- DRM_MODE_CONNECTOR_DSI); +- +- ret = drm_panel_of_backlight(&ctx->panel); +- if (ret) +- return ret; +- +- drm_panel_add(&ctx->panel); +- +- ret = mipi_dsi_attach(dsi); +- if (ret < 0) { +- DRM_DEV_ERROR(dev, "mipi_dsi_attach failed. Is host ready?\n"); +- drm_panel_remove(&ctx->panel); +- return ret; +- } +- +- DRM_DEV_INFO(dev, "%ux%u@%u %ubpp dsi %udl - ready\n", +- xbd599_default_mode.hdisplay, +- xbd599_default_mode.vdisplay, +- xbd599_default_mode.vrefresh, +- mipi_dsi_pixel_format_to_bpp(dsi->format), dsi->lanes); +- +- return 0; +-} +- +-static void xbd599_shutdown(struct mipi_dsi_device *dsi) +-{ +- struct xbd599 *ctx = mipi_dsi_get_drvdata(dsi); +- int ret; +- +- ret = drm_panel_unprepare(&ctx->panel); +- if (ret < 0) +- DRM_DEV_ERROR(&dsi->dev, "Failed to unprepare panel: %d\n", +- ret); +-} +- +-static int xbd599_remove(struct mipi_dsi_device *dsi) +-{ +- struct xbd599 *ctx = mipi_dsi_get_drvdata(dsi); +- int ret; +- +- xbd599_shutdown(dsi); +- +- ret = mipi_dsi_detach(dsi); +- if (ret < 0) +- DRM_DEV_ERROR(&dsi->dev, "Failed to detach from DSI host: %d\n", +- ret); +- +- drm_panel_remove(&ctx->panel); +- +- return 0; +-} +- +-static const struct of_device_id xbd599_of_match[] = { +- { .compatible = "xingbangda,xbd599", }, +- { /* sentinel */ } +-}; +-MODULE_DEVICE_TABLE(of, xbd599_of_match); +- +-static struct mipi_dsi_driver xbd599_driver = { +- .probe = xbd599_probe, +- .remove = xbd599_remove, +- .shutdown = xbd599_shutdown, +- .driver = { +- .name = "panel-xingbangda-xbd599", +- .of_match_table = xbd599_of_match, +- }, +-}; +-module_mipi_dsi_driver(xbd599_driver); +- +-MODULE_AUTHOR("Icenowy Zheng "); +-MODULE_DESCRIPTION("DRM driver for Xingbangda XBD599 MIPI DSI panel"); +-MODULE_LICENSE("GPL v2"); +-- +2.26.2 + diff --git a/SOURCES/0001-Revert-drm-sun4i-sun6i_mipi_dsi-fix-horizontal-timin.patch b/SOURCES/0001-Revert-drm-sun4i-sun6i_mipi_dsi-fix-horizontal-timin.patch new file mode 100644 index 0000000..c290e7a --- /dev/null +++ b/SOURCES/0001-Revert-drm-sun4i-sun6i_mipi_dsi-fix-horizontal-timin.patch @@ -0,0 +1,56 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Sun, 12 Jul 2020 13:42:04 +0100 +Subject: [PATCH] Revert "drm/sun4i: sun6i_mipi_dsi: fix horizontal timing + calculation" + +This reverts commit d20a2ac9c6ecf514e115f06b6744b584bbc7c1b8. +--- + drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +index 52e009dc632b..aa67cb037e9d 100644 +--- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c ++++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +@@ -556,7 +556,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, + */ + #define HSA_PACKET_OVERHEAD 10 + hsa = max((unsigned int)HSA_PACKET_OVERHEAD, +- (mode->hsync_end - mode->hsync_start) * Bpp) - HSA_PACKET_OVERHEAD; ++ (mode->hsync_end - mode->hsync_start) * Bpp - HSA_PACKET_OVERHEAD); + + /* + * The backporch is set using a blanking packet (4 +@@ -565,7 +565,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, + */ + #define HBP_PACKET_OVERHEAD 6 + hbp = max((unsigned int)HBP_PACKET_OVERHEAD, +- (mode->htotal - mode->hsync_end) * Bpp) - HBP_PACKET_OVERHEAD; ++ (mode->htotal - mode->hsync_end) * Bpp - HBP_PACKET_OVERHEAD); + + /* + * The frontporch is set using a sync event (4 bytes) +@@ -575,7 +575,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, + */ + #define HFP_PACKET_OVERHEAD 16 + hfp = max((unsigned int)HFP_PACKET_OVERHEAD, +- (mode->hsync_start - mode->hdisplay) * Bpp) - HFP_PACKET_OVERHEAD; ++ (mode->hsync_start - mode->hdisplay) * Bpp - HFP_PACKET_OVERHEAD); + + /* + * The blanking is set using a sync event (4 bytes) +@@ -584,8 +584,8 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, + */ + #define HBLK_PACKET_OVERHEAD 10 + hblk = max((unsigned int)HBLK_PACKET_OVERHEAD, +- (mode->htotal - (mode->hsync_end - mode->hsync_start)) * Bpp) - +- HBLK_PACKET_OVERHEAD; ++ (mode->htotal - (mode->hsync_end - mode->hsync_start)) * Bpp - ++ HBLK_PACKET_OVERHEAD); + + /* + * And I'm not entirely sure what vblk is about. The driver in +-- +2.26.2 + diff --git a/SOURCES/0001-Revert-dt-bindings-panel-add-binding-for-Xingbangda-.patch b/SOURCES/0001-Revert-dt-bindings-panel-add-binding-for-Xingbangda-.patch new file mode 100644 index 0000000..990e624 --- /dev/null +++ b/SOURCES/0001-Revert-dt-bindings-panel-add-binding-for-Xingbangda-.patch @@ -0,0 +1,71 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Sun, 12 Jul 2020 13:41:49 +0100 +Subject: [PATCH] Revert "dt-bindings: panel: add binding for Xingbangda XBD599 + panel" + +This reverts commit 8a717270db2000ff734d89e9448b32fbc038c49a. +--- + .../display/panel/xingbangda,xbd599.yaml | 50 ------------------- + 1 file changed, 50 deletions(-) + delete mode 100644 Documentation/devicetree/bindings/display/panel/xingbangda,xbd599.yaml + +diff --git a/Documentation/devicetree/bindings/display/panel/xingbangda,xbd599.yaml b/Documentation/devicetree/bindings/display/panel/xingbangda,xbd599.yaml +deleted file mode 100644 +index b27bcf11198f..000000000000 +--- a/Documentation/devicetree/bindings/display/panel/xingbangda,xbd599.yaml ++++ /dev/null +@@ -1,50 +0,0 @@ +-# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +-%YAML 1.2 +---- +-$id: http://devicetree.org/schemas/display/panel/xingbangda,xbd599.yaml# +-$schema: http://devicetree.org/meta-schemas/core.yaml# +- +-title: Xingbangda XBD599 5.99in MIPI-DSI LCD panel +- +-maintainers: +- - Icenowy Zheng +- +-allOf: +- - $ref: panel-common.yaml# +- +-properties: +- compatible: +- const: xingbangda,xbd599 +- reg: true +- backlight: true +- reset-gpios: true +- vcc-supply: +- description: regulator that supplies the VCC voltage +- iovcc-supply: +- description: regulator that supplies the IOVCC voltage +- +-required: +- - compatible +- - reg +- - backlight +- - vcc-supply +- - iovcc-supply +- +-additionalProperties: false +- +-examples: +- - | +- dsi { +- #address-cells = <1>; +- #size-cells = <0>; +- +- panel@0 { +- compatible = "xingbangda,xbd599"; +- reg = <0>; +- backlight = <&backlight>; +- iovcc-supply = <®_dldo2>; +- vcc-supply = <®_ldo_io0>; +- }; +- }; +- +-... +-- +2.26.2 + diff --git a/SOURCES/0001-Vulcan-AHCI-PCI-bar-fix-for-Broadcom-Vulcan-early-si.patch b/SOURCES/0001-Vulcan-AHCI-PCI-bar-fix-for-Broadcom-Vulcan-early-si.patch index 828ed5d..6352ff7 100644 --- a/SOURCES/0001-Vulcan-AHCI-PCI-bar-fix-for-Broadcom-Vulcan-early-si.patch +++ b/SOURCES/0001-Vulcan-AHCI-PCI-bar-fix-for-Broadcom-Vulcan-early-si.patch @@ -36,10 +36,10 @@ Signed-off-by: Herton R. Krzesinski 1 file changed, 24 insertions(+) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c -index ca9ed5774eb1..bd0cee4236b0 100644 +index 2ea61abd5830..abb314891f5b 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c -@@ -4183,6 +4183,30 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9000, +@@ -4196,6 +4196,30 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9000, DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9084, quirk_bridge_cavm_thrx2_pcie_root); diff --git a/SOURCES/0001-aarch64-acpi-scan-Fix-regression-related-to-X-Gene-U.patch b/SOURCES/0001-aarch64-acpi-scan-Fix-regression-related-to-X-Gene-U.patch index 86cbf5d..eea0dee 100644 --- a/SOURCES/0001-aarch64-acpi-scan-Fix-regression-related-to-X-Gene-U.patch +++ b/SOURCES/0001-aarch64-acpi-scan-Fix-regression-related-to-X-Gene-U.patch @@ -28,10 +28,10 @@ Signed-off-by: Herton R. Krzesinski 1 file changed, 9 insertions(+) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c -index 6d3448895382..221255007dc8 100644 +index 8777faced51a..2e60d792005f 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c -@@ -1563,6 +1563,15 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device) +@@ -1572,6 +1572,15 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device) if (!acpi_match_device_ids(device, i2c_multi_instantiate_ids)) return false; diff --git a/SOURCES/0001-arm-aarch64-Drop-the-EXPERT-setting-from-ARM64_FORCE.patch b/SOURCES/0001-arm-aarch64-Drop-the-EXPERT-setting-from-ARM64_FORCE.patch index 286c898..89eea8f 100644 --- a/SOURCES/0001-arm-aarch64-Drop-the-EXPERT-setting-from-ARM64_FORCE.patch +++ b/SOURCES/0001-arm-aarch64-Drop-the-EXPERT-setting-from-ARM64_FORCE.patch @@ -21,10 +21,10 @@ Signed-off-by: Jeremy Cline 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig -index 5d513f461957..7f37a6d0658a 100644 +index 66dc41fd49f2..2e0700a451e5 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig -@@ -858,7 +858,7 @@ endchoice +@@ -861,7 +861,7 @@ endchoice config ARM64_FORCE_52BIT bool "Force 52-bit virtual addresses for userspace" diff --git a/SOURCES/0001-arm-make-CONFIG_HIGHPTE-optional-without-CONFIG_EXPE.patch b/SOURCES/0001-arm-make-CONFIG_HIGHPTE-optional-without-CONFIG_EXPE.patch index 040f33c..498ffaf 100644 --- a/SOURCES/0001-arm-make-CONFIG_HIGHPTE-optional-without-CONFIG_EXPE.patch +++ b/SOURCES/0001-arm-make-CONFIG_HIGHPTE-optional-without-CONFIG_EXPE.patch @@ -11,10 +11,10 @@ Signed-off-by: Jon Masters 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig -index c77c93c485a0..f808c4e0727f 100644 +index 2ac74904a3ce..f0094424f76a 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -1543,9 +1543,9 @@ config HIGHMEM +@@ -1549,9 +1549,9 @@ config HIGHMEM If unsure, say n. config HIGHPTE diff --git a/SOURCES/0001-arm64-allwinner-dts-a64-add-LCD-related-device-nodes.patch b/SOURCES/0001-arm64-allwinner-dts-a64-add-LCD-related-device-nodes.patch new file mode 100644 index 0000000..e3b07c2 --- /dev/null +++ b/SOURCES/0001-arm64-allwinner-dts-a64-add-LCD-related-device-nodes.patch @@ -0,0 +1,81 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Icenowy Zheng +Date: Mon, 16 Mar 2020 21:35:03 +0800 +Subject: [PATCH] arm64: allwinner: dts: a64: add LCD-related device nodes for + PinePhone + +PinePhone uses PWM backlight and a XBD599 LCD panel over DSI for +display. + +Add its device nodes. + +Signed-off-by: Icenowy Zheng +--- + .../dts/allwinner/sun50i-a64-pinephone.dtsi | 37 +++++++++++++++++++ + 1 file changed, 37 insertions(+) + +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +index cefda145c3c9..96d9150423e0 100644 +--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi ++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +@@ -16,6 +16,15 @@ aliases { + serial0 = &uart0; + }; + ++ backlight: backlight { ++ compatible = "pwm-backlight"; ++ pwms = <&r_pwm 0 50000 PWM_POLARITY_INVERTED>; ++ brightness-levels = <0 16 18 20 22 24 26 29 32 35 38 42 46 51 56 62 68 75 83 91 100>; ++ default-brightness-level = <15>; ++ enable-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */ ++ power-supply = <®_ldo_io0>; ++ }; ++ + chosen { + stdout-path = "serial0:115200n8"; + }; +@@ -84,6 +93,30 @@ &dai { + status = "okay"; + }; + ++&de { ++ status = "okay"; ++}; ++ ++&dphy { ++ status = "okay"; ++}; ++ ++&dsi { ++ vcc-dsi-supply = <®_dldo1>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ panel@0 { ++ compatible = "xingbangda,xbd599"; ++ reg = <0>; ++ reset-gpios = <&pio 3 23 GPIO_ACTIVE_LOW>; /* PD23 */ ++ iovcc-supply = <®_dldo2>; ++ vcc-supply = <®_ldo_io0>; ++ backlight = <&backlight>; ++ }; ++}; ++ + &ehci0 { + status = "okay"; + }; +@@ -188,6 +221,10 @@ &r_pio { + */ + }; + ++&r_pwm { ++ status = "okay"; ++}; ++ + &r_rsb { + status = "okay"; + +-- +2.26.2 + diff --git a/SOURCES/0001-arm64-dts-sun50i-a64-pinephone-Add-touchscreen-suppo.patch b/SOURCES/0001-arm64-dts-sun50i-a64-pinephone-Add-touchscreen-suppo.patch new file mode 100644 index 0000000..d2511ae --- /dev/null +++ b/SOURCES/0001-arm64-dts-sun50i-a64-pinephone-Add-touchscreen-suppo.patch @@ -0,0 +1,46 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ondrej Jirman +Date: Fri, 26 Jun 2020 02:56:01 +0200 +Subject: [PATCH] arm64: dts: sun50i-a64-pinephone: Add touchscreen support + +Pinephone has a Goodix GT917S capacitive touchscreen controller on +I2C0 bus. Add support for it. + +Signed-off-by: Ondrej Jirman +--- + .../dts/allwinner/sun50i-a64-pinephone.dtsi | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +index 85a7aa5efd32..2d5694446d17 100644 +--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi ++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +@@ -123,6 +123,25 @@ &ehci1 { + status = "okay"; + }; + ++&i2c0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c0_pins>; ++ status = "okay"; ++ ++ touchscreen@5d { ++ compatible = "goodix,gt917s", "goodix,gt911"; ++ reg = <0x5d>; ++ interrupt-parent = <&pio>; ++ interrupts = <7 4 IRQ_TYPE_LEVEL_HIGH>; /* PH4 */ ++ irq-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ ++ reset-gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */ ++ AVDD28-supply = <®_ldo_io0>; ++ VDDIO-supply = <®_ldo_io0>; ++ touchscreen-size-x = <720>; ++ touchscreen-size-y = <1440>; ++ }; ++}; ++ + &i2c1 { + status = "okay"; + +-- +2.26.2 + diff --git a/SOURCES/0001-arm64-dts-sun50i-a64-pinephone-Enable-LCD-support-on.patch b/SOURCES/0001-arm64-dts-sun50i-a64-pinephone-Enable-LCD-support-on.patch new file mode 100644 index 0000000..a38cd72 --- /dev/null +++ b/SOURCES/0001-arm64-dts-sun50i-a64-pinephone-Enable-LCD-support-on.patch @@ -0,0 +1,112 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Icenowy Zheng +Date: Fri, 26 Jun 2020 02:56:00 +0200 +Subject: [PATCH] arm64: dts: sun50i-a64-pinephone: Enable LCD support on + PinePhone + +PinePhone uses PWM backlight and a XBD599 LCD panel over DSI for +display. + +Backlight levels curve was optimized by Martijn Braam using a +lux meter. + +Add its device nodes. + +Signed-off-by: Icenowy Zheng +Signed-off-by: Martijn Braam +Signed-off-by: Ondrej Jirman +--- + .../allwinner/sun50i-a64-pinephone-1.1.dts | 19 ++++++++++ + .../dts/allwinner/sun50i-a64-pinephone.dtsi | 35 +++++++++++++++++++ + 2 files changed, 54 insertions(+) + +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts +index 06a775c41664..3e99a87e9ce5 100644 +--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts +@@ -9,3 +9,22 @@ / { + model = "Pine64 PinePhone Braveheart (1.1)"; + compatible = "pine64,pinephone-1.1", "allwinner,sun50i-a64"; + }; ++ ++&backlight { ++ power-supply = <®_ldo_io0>; ++ /* ++ * PWM backlight circuit on this PinePhone revision was changed since ++ * 1.0, and the lowest PWM duty cycle that doesn't lead to backlight ++ * being off is around 20%. Duty cycle for the lowest brightness level ++ * also varries quite a bit between individual boards, so the lowest ++ * value here was chosen as a safe default. ++ */ ++ brightness-levels = < ++ 774 793 814 842 ++ 882 935 1003 1088 ++ 1192 1316 1462 1633 ++ 1830 2054 2309 2596 ++ 2916 3271 3664 4096>; ++ num-interpolated-steps = <50>; ++ default-brightness-level = <400>; ++}; +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +index cefda145c3c9..85a7aa5efd32 100644 +--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi ++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +@@ -16,6 +16,13 @@ aliases { + serial0 = &uart0; + }; + ++ backlight: backlight { ++ compatible = "pwm-backlight"; ++ pwms = <&r_pwm 0 50000 PWM_POLARITY_INVERTED>; ++ enable-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */ ++ /* Backlight configuration differs per PinePhone revision. */ ++ }; ++ + chosen { + stdout-path = "serial0:115200n8"; + }; +@@ -84,6 +91,30 @@ &dai { + status = "okay"; + }; + ++&de { ++ status = "okay"; ++}; ++ ++&dphy { ++ status = "okay"; ++}; ++ ++&dsi { ++ vcc-dsi-supply = <®_dldo1>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ panel@0 { ++ compatible = "xingbangda,xbd599"; ++ reg = <0>; ++ reset-gpios = <&pio 3 23 GPIO_ACTIVE_LOW>; /* PD23 */ ++ iovcc-supply = <®_dldo2>; ++ vcc-supply = <®_ldo_io0>; ++ backlight = <&backlight>; ++ }; ++}; ++ + &ehci0 { + status = "okay"; + }; +@@ -188,6 +219,10 @@ &r_pio { + */ + }; + ++&r_pwm { ++ status = "okay"; ++}; ++ + &r_rsb { + status = "okay"; + +-- +2.26.2 + diff --git a/SOURCES/0001-drm-panel-add-Xingbangda-XBD599-panel.patch b/SOURCES/0001-drm-panel-add-Xingbangda-XBD599-panel.patch new file mode 100644 index 0000000..6866d5f --- /dev/null +++ b/SOURCES/0001-drm-panel-add-Xingbangda-XBD599-panel.patch @@ -0,0 +1,423 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Icenowy Zheng +Date: Mon, 16 Mar 2020 21:35:01 +0800 +Subject: [PATCH] drm: panel: add Xingbangda XBD599 panel + +Xingbangda XBD599 is a 5.99" 720x1440 MIPI-DSI IPS LCD panel made by +Xingbangda, which is used on PinePhone final assembled phones. + +Add support for it. + +Signed-off-by: Icenowy Zheng +--- + drivers/gpu/drm/panel/Kconfig | 9 + + drivers/gpu/drm/panel/Makefile | 1 + + .../gpu/drm/panel/panel-xingbangda-xbd599.c | 366 ++++++++++++++++++ + 3 files changed, 376 insertions(+) + create mode 100644 drivers/gpu/drm/panel/panel-xingbangda-xbd599.c + +diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig +index 39055c1f0e2f..1f55a87bb657 100644 +--- a/drivers/gpu/drm/panel/Kconfig ++++ b/drivers/gpu/drm/panel/Kconfig +@@ -462,6 +462,15 @@ config DRM_PANEL_VISIONOX_RM69299 + Say Y here if you want to enable support for Visionox + RM69299 DSI Video Mode panel. + ++config DRM_PANEL_XINGBANGDA_XBD599 ++ tristate "Xingbangda XBD599 panel" ++ depends on OF ++ depends on DRM_MIPI_DSI ++ depends on BACKLIGHT_CLASS_DEVICE ++ help ++ Say Y here if you want to enable support for the Xingbangda XBD599 ++ MIPI DSI Video Mode panel. ++ + config DRM_PANEL_XINPENG_XPP055C272 + tristate "Xinpeng XPP055C272 panel driver" + depends on OF +diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile +index de74f282c433..7b6b0c0397d6 100644 +--- a/drivers/gpu/drm/panel/Makefile ++++ b/drivers/gpu/drm/panel/Makefile +@@ -49,4 +49,5 @@ obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o + obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o + obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o + obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) += panel-visionox-rm69299.o ++obj-$(CONFIG_DRM_PANEL_XINGBANGDA_XBD599) += panel-xingbangda-xbd599.o + obj-$(CONFIG_DRM_PANEL_XINPENG_XPP055C272) += panel-xinpeng-xpp055c272.o +diff --git a/drivers/gpu/drm/panel/panel-xingbangda-xbd599.c b/drivers/gpu/drm/panel/panel-xingbangda-xbd599.c +new file mode 100644 +index 000000000000..b483f96ee1db +--- /dev/null ++++ b/drivers/gpu/drm/panel/panel-xingbangda-xbd599.c +@@ -0,0 +1,366 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * Xingbangda XBD599 MIPI-DSI panel driver ++ * ++ * Copyright (C) 2019-2020 Icenowy Zheng ++ * ++ * Based on panel-rocktech-jh057n00900.c, which is: ++ * Copyright (C) Purism SPC 2019 ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++/* Manufacturer specific Commands send via DSI */ ++#define ST7703_CMD_ALL_PIXEL_OFF 0x22 ++#define ST7703_CMD_ALL_PIXEL_ON 0x23 ++#define ST7703_CMD_SETDISP 0xB2 ++#define ST7703_CMD_SETRGBIF 0xB3 ++#define ST7703_CMD_SETCYC 0xB4 ++#define ST7703_CMD_SETBGP 0xB5 ++#define ST7703_CMD_SETVCOM 0xB6 ++#define ST7703_CMD_SETOTP 0xB7 ++#define ST7703_CMD_SETPOWER_EXT 0xB8 ++#define ST7703_CMD_SETEXTC 0xB9 ++#define ST7703_CMD_SETMIPI 0xBA ++#define ST7703_CMD_SETVDC 0xBC ++#define ST7703_CMD_SETSCR 0xC0 ++#define ST7703_CMD_SETPOWER 0xC1 ++#define ST7703_CMD_UNK_C6 0xC6 ++#define ST7703_CMD_SETPANEL 0xCC ++#define ST7703_CMD_SETGAMMA 0xE0 ++#define ST7703_CMD_SETEQ 0xE3 ++#define ST7703_CMD_SETGIP1 0xE9 ++#define ST7703_CMD_SETGIP2 0xEA ++ ++static const char * const regulator_names[] = { ++ "iovcc", ++ "vcc", ++}; ++ ++struct xbd599 { ++ struct device *dev; ++ struct drm_panel panel; ++ struct gpio_desc *reset_gpio; ++ struct regulator_bulk_data supplies[ARRAY_SIZE(regulator_names)]; ++ bool prepared; ++}; ++ ++static inline struct xbd599 *panel_to_xbd599(struct drm_panel *panel) ++{ ++ return container_of(panel, struct xbd599, panel); ++} ++ ++#define dsi_dcs_write_seq(dsi, cmd, seq...) do { \ ++ static const u8 d[] = { seq }; \ ++ int ret; \ ++ ret = mipi_dsi_dcs_write(dsi, cmd, d, ARRAY_SIZE(d)); \ ++ if (ret < 0) \ ++ return ret; \ ++ } while (0) ++ ++static int xbd599_init_sequence(struct xbd599 *ctx) ++{ ++ struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); ++ struct device *dev = ctx->dev; ++ int ret; ++ ++ /* ++ * Init sequence was supplied by the panel vendor. ++ */ ++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETEXTC, ++ 0xF1, 0x12, 0x83); ++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETMIPI, ++ 0x33, 0x81, 0x05, 0xF9, 0x0E, 0x0E, 0x20, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x25, ++ 0x00, 0x91, 0x0a, 0x00, 0x00, 0x02, 0x4F, 0x11, ++ 0x00, 0x00, 0x37); ++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT, ++ 0x25, 0x22, 0x20, 0x03); ++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETRGBIF, ++ 0x10, 0x10, 0x05, 0x05, 0x03, 0xFF, 0x00, 0x00, ++ 0x00, 0x00); ++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETSCR, ++ 0x73, 0x73, 0x50, 0x50, 0x00, 0xC0, 0x08, 0x70, ++ 0x00); ++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETVDC, 0x4E); ++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETPANEL, 0x0B); ++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETCYC, 0x80); ++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETDISP, 0xF0, 0x12, 0xF0); ++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETEQ, ++ 0x00, 0x00, 0x0B, 0x0B, 0x10, 0x10, 0x00, 0x00, ++ 0x00, 0x00, 0xFF, 0x00, 0xC0, 0x10); ++ dsi_dcs_write_seq(dsi, 0xC6, 0x01, 0x00, 0xFF, 0xFF, 0x00); ++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER, ++ 0x74, 0x00, 0x32, 0x32, 0x77, 0xF1, 0xFF, 0xFF, ++ 0xCC, 0xCC, 0x77, 0x77); ++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETBGP, 0x07, 0x07); ++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, 0x2C, 0x2C); ++ dsi_dcs_write_seq(dsi, 0xBF, 0x02, 0x11, 0x00); ++ ++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETGIP1, ++ 0x82, 0x10, 0x06, 0x05, 0xA2, 0x0A, 0xA5, 0x12, ++ 0x31, 0x23, 0x37, 0x83, 0x04, 0xBC, 0x27, 0x38, ++ 0x0C, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x00, ++ 0x03, 0x00, 0x00, 0x00, 0x75, 0x75, 0x31, 0x88, ++ 0x88, 0x88, 0x88, 0x88, 0x88, 0x13, 0x88, 0x64, ++ 0x64, 0x20, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, ++ 0x02, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); ++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETGIP2, ++ 0x02, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x02, 0x46, 0x02, 0x88, ++ 0x88, 0x88, 0x88, 0x88, 0x88, 0x64, 0x88, 0x13, ++ 0x57, 0x13, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, ++ 0x75, 0x88, 0x23, 0x14, 0x00, 0x00, 0x02, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0A, ++ 0xA5, 0x00, 0x00, 0x00, 0x00); ++ dsi_dcs_write_seq(dsi, ST7703_CMD_SETGAMMA, ++ 0x00, 0x09, 0x0D, 0x23, 0x27, 0x3C, 0x41, 0x35, ++ 0x07, 0x0D, 0x0E, 0x12, 0x13, 0x10, 0x12, 0x12, ++ 0x18, 0x00, 0x09, 0x0D, 0x23, 0x27, 0x3C, 0x41, ++ 0x35, 0x07, 0x0D, 0x0E, 0x12, 0x13, 0x10, 0x12, ++ 0x12, 0x18); ++ msleep(20); ++ ++ ret = mipi_dsi_dcs_exit_sleep_mode(dsi); ++ if (ret < 0) { ++ DRM_DEV_ERROR(dev, "Failed to exit sleep mode\n"); ++ return ret; ++ } ++ msleep(250); ++ ++ ret = mipi_dsi_dcs_set_display_on(dsi); ++ if (ret) ++ return ret; ++ msleep(50); ++ ++ DRM_DEV_DEBUG_DRIVER(dev, "Panel init sequence done\n"); ++ return 0; ++} ++ ++static int xbd599_prepare(struct drm_panel *panel) ++{ ++ struct xbd599 *ctx = panel_to_xbd599(panel); ++ int ret; ++ ++ if (ctx->prepared) ++ return 0; ++ ++ ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies); ++ if (ret) ++ return ret; ++ ++ DRM_DEV_DEBUG_DRIVER(ctx->dev, "Resetting the panel\n"); ++ gpiod_set_value_cansleep(ctx->reset_gpio, 1); ++ usleep_range(20, 40); ++ gpiod_set_value_cansleep(ctx->reset_gpio, 0); ++ msleep(20); ++ ++ ctx->prepared = true; ++ ++ return 0; ++} ++ ++static int xbd599_enable(struct drm_panel *panel) ++{ ++ struct xbd599 *ctx = panel_to_xbd599(panel); ++ int ret; ++ ++ ret = xbd599_init_sequence(ctx); ++ if (ret < 0) { ++ DRM_DEV_ERROR(ctx->dev, "Panel init sequence failed: %d\n", ++ ret); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++static int xbd599_disable(struct drm_panel *panel) ++{ ++ struct xbd599 *ctx = panel_to_xbd599(panel); ++ struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); ++ ++ return mipi_dsi_dcs_set_display_off(dsi); ++} ++ ++static int xbd599_unprepare(struct drm_panel *panel) ++{ ++ struct xbd599 *ctx = panel_to_xbd599(panel); ++ ++ if (!ctx->prepared) ++ return 0; ++ ++ gpiod_set_value_cansleep(ctx->reset_gpio, 1); ++ regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies); ++ ctx->prepared = false; ++ ++ return 0; ++} ++ ++static const struct drm_display_mode xbd599_default_mode = { ++ .hdisplay = 720, ++ .hsync_start = 720 + 40, ++ .hsync_end = 720 + 40 + 40, ++ .htotal = 720 + 40 + 40 + 40, ++ .vdisplay = 1440, ++ .vsync_start = 1440 + 18, ++ .vsync_end = 1440 + 18 + 10, ++ .vtotal = 1440 + 18 + 10 + 17, ++ .vrefresh = 60, ++ .clock = 69000, ++ .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC, ++ ++ .width_mm = 68, ++ .height_mm = 136, ++ .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, ++}; ++ ++static int xbd599_get_modes(struct drm_panel *panel, ++ struct drm_connector *connector) ++{ ++ struct xbd599 *ctx = panel_to_xbd599(panel); ++ struct drm_display_mode *mode; ++ ++ mode = drm_mode_duplicate(connector->dev, &xbd599_default_mode); ++ if (!mode) { ++ DRM_DEV_ERROR(ctx->dev, "Failed to add mode\n"); ++ return -ENOMEM; ++ } ++ ++ drm_mode_set_name(mode); ++ ++ mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; ++ connector->display_info.width_mm = mode->width_mm; ++ connector->display_info.height_mm = mode->height_mm; ++ drm_mode_probed_add(connector, mode); ++ ++ return 1; ++} ++ ++static const struct drm_panel_funcs xbd599_drm_funcs = { ++ .prepare = xbd599_prepare, ++ .enable = xbd599_enable, ++ .disable = xbd599_disable, ++ .unprepare = xbd599_unprepare, ++ .get_modes = xbd599_get_modes, ++}; ++ ++static int xbd599_probe(struct mipi_dsi_device *dsi) ++{ ++ struct device *dev = &dsi->dev; ++ struct xbd599 *ctx; ++ int i, ret; ++ ++ ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); ++ if (!ctx) ++ return -ENOMEM; ++ ++ for (i = 0; i < ARRAY_SIZE(ctx->supplies); i++) ++ ctx->supplies[i].supply = regulator_names[i]; ++ ++ ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies), ++ ctx->supplies); ++ if (ret < 0) { ++ DRM_DEV_ERROR(&dsi->dev, "cannot get regulators\n"); ++ return ret; ++ } ++ ++ ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); ++ if (IS_ERR(ctx->reset_gpio)) { ++ DRM_DEV_ERROR(dev, "cannot get reset gpio\n"); ++ return PTR_ERR(ctx->reset_gpio); ++ } ++ ++ mipi_dsi_set_drvdata(dsi, ctx); ++ ++ ctx->dev = dev; ++ ++ dsi->lanes = 4; ++ dsi->format = MIPI_DSI_FMT_RGB888; ++ dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE; ++ ++ drm_panel_init(&ctx->panel, &dsi->dev, &xbd599_drm_funcs, ++ DRM_MODE_CONNECTOR_DSI); ++ ++ ret = drm_panel_of_backlight(&ctx->panel); ++ if (ret) ++ return ret; ++ ++ drm_panel_add(&ctx->panel); ++ ++ ret = mipi_dsi_attach(dsi); ++ if (ret < 0) { ++ DRM_DEV_ERROR(dev, "mipi_dsi_attach failed. Is host ready?\n"); ++ drm_panel_remove(&ctx->panel); ++ return ret; ++ } ++ ++ DRM_DEV_INFO(dev, "%ux%u@%u %ubpp dsi %udl - ready\n", ++ xbd599_default_mode.hdisplay, ++ xbd599_default_mode.vdisplay, ++ xbd599_default_mode.vrefresh, ++ mipi_dsi_pixel_format_to_bpp(dsi->format), dsi->lanes); ++ ++ return 0; ++} ++ ++static void xbd599_shutdown(struct mipi_dsi_device *dsi) ++{ ++ struct xbd599 *ctx = mipi_dsi_get_drvdata(dsi); ++ int ret; ++ ++ ret = drm_panel_unprepare(&ctx->panel); ++ if (ret < 0) ++ DRM_DEV_ERROR(&dsi->dev, "Failed to unprepare panel: %d\n", ++ ret); ++} ++ ++static int xbd599_remove(struct mipi_dsi_device *dsi) ++{ ++ struct xbd599 *ctx = mipi_dsi_get_drvdata(dsi); ++ int ret; ++ ++ xbd599_shutdown(dsi); ++ ++ ret = mipi_dsi_detach(dsi); ++ if (ret < 0) ++ DRM_DEV_ERROR(&dsi->dev, "Failed to detach from DSI host: %d\n", ++ ret); ++ ++ drm_panel_remove(&ctx->panel); ++ ++ return 0; ++} ++ ++static const struct of_device_id xbd599_of_match[] = { ++ { .compatible = "xingbangda,xbd599", }, ++ { /* sentinel */ } ++}; ++MODULE_DEVICE_TABLE(of, xbd599_of_match); ++ ++static struct mipi_dsi_driver xbd599_driver = { ++ .probe = xbd599_probe, ++ .remove = xbd599_remove, ++ .shutdown = xbd599_shutdown, ++ .driver = { ++ .name = "panel-xingbangda-xbd599", ++ .of_match_table = xbd599_of_match, ++ }, ++}; ++module_mipi_dsi_driver(xbd599_driver); ++ ++MODULE_AUTHOR("Icenowy Zheng "); ++MODULE_DESCRIPTION("DRM driver for Xingbangda XBD599 MIPI DSI panel"); ++MODULE_LICENSE("GPL v2"); +-- +2.26.2 + diff --git a/SOURCES/0001-drm-panel-rocktech-jh057n00900-Rename-the-driver-to-.patch b/SOURCES/0001-drm-panel-rocktech-jh057n00900-Rename-the-driver-to-.patch new file mode 100644 index 0000000..d78bf56 --- /dev/null +++ b/SOURCES/0001-drm-panel-rocktech-jh057n00900-Rename-the-driver-to-.patch @@ -0,0 +1,948 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ondrej Jirman +Date: Fri, 26 Jun 2020 02:55:52 +0200 +Subject: [PATCH] drm/panel: rocktech-jh057n00900: Rename the driver to st7703 + +This rename is done so that the driver matches the name of the +display controller and in preparation for adding support for more +panels to the driver. + +This is just a basic file rename, with no code changes. + +Signed-off-by: Ondrej Jirman +--- + drivers/gpu/drm/panel/Kconfig | 26 +- + drivers/gpu/drm/panel/Makefile | 2 +- + .../drm/panel/panel-rocktech-jh057n00900.c | 424 ------------------ + drivers/gpu/drm/panel/panel-sitronix-st7703.c | 424 ++++++++++++++++++ + 4 files changed, 438 insertions(+), 438 deletions(-) + delete mode 100644 drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c + create mode 100644 drivers/gpu/drm/panel/panel-sitronix-st7703.c + +diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig +index 39055c1f0e2f..de2f2a452be5 100644 +--- a/drivers/gpu/drm/panel/Kconfig ++++ b/drivers/gpu/drm/panel/Kconfig +@@ -283,19 +283,6 @@ config DRM_PANEL_RAYDIUM_RM68200 + Say Y here if you want to enable support for Raydium RM68200 + 720x1280 DSI video mode panel. + +-config DRM_PANEL_ROCKTECH_JH057N00900 +- tristate "Rocktech JH057N00900 MIPI touchscreen panel" +- depends on OF +- depends on DRM_MIPI_DSI +- depends on BACKLIGHT_CLASS_DEVICE +- help +- Say Y here if you want to enable support for Rocktech JH057N00900 +- MIPI DSI panel as e.g. used in the Librem 5 devkit. It has a +- resolution of 720x1440 pixels, a built in backlight and touch +- controller. +- Touch input support is provided by the goodix driver and needs to be +- selected separately. +- + config DRM_PANEL_RONBO_RB070D30 + tristate "Ronbo Electronics RB070D30 panel" + depends on OF +@@ -395,6 +382,19 @@ config DRM_PANEL_SITRONIX_ST7701 + ST7701 controller for 480X864 LCD panels with MIPI/RGB/SPI + system interfaces. + ++config DRM_PANEL_SITRONIX_ST7703 ++ tristate "Sitronix ST7703 based MIPI touchscreen panels" ++ depends on OF ++ depends on DRM_MIPI_DSI ++ depends on BACKLIGHT_CLASS_DEVICE ++ help ++ Say Y here if you want to enable support for Sitronix ST7703 based ++ panels, souch as Rocktech JH057N00900 MIPI DSI panel as e.g. used in ++ the Librem 5 devkit. It has a resolution of 720x1440 pixels, a built ++ in backlight and touch controller. ++ Touch input support is provided by the goodix driver and needs to be ++ selected separately. ++ + config DRM_PANEL_SITRONIX_ST7789V + tristate "Sitronix ST7789V panel" + depends on OF && SPI +diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile +index de74f282c433..e45ceac6286f 100644 +--- a/drivers/gpu/drm/panel/Makefile ++++ b/drivers/gpu/drm/panel/Makefile +@@ -27,7 +27,6 @@ obj-$(CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00) += panel-panasonic-vvx10f034n00.o + obj-$(CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN) += panel-raspberrypi-touchscreen.o + obj-$(CONFIG_DRM_PANEL_RAYDIUM_RM67191) += panel-raydium-rm67191.o + obj-$(CONFIG_DRM_PANEL_RAYDIUM_RM68200) += panel-raydium-rm68200.o +-obj-$(CONFIG_DRM_PANEL_ROCKTECH_JH057N00900) += panel-rocktech-jh057n00900.o + obj-$(CONFIG_DRM_PANEL_RONBO_RB070D30) += panel-ronbo-rb070d30.o + obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += panel-samsung-ld9040.o + obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D16D0) += panel-samsung-s6d16d0.o +@@ -41,6 +40,7 @@ obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o + obj-$(CONFIG_DRM_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o + obj-$(CONFIG_DRM_PANEL_SHARP_LS043T1LE01) += panel-sharp-ls043t1le01.o + obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7701) += panel-sitronix-st7701.o ++obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7703) += panel-sitronix-st7703.o + obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += panel-sitronix-st7789v.o + obj-$(CONFIG_DRM_PANEL_SONY_ACX424AKP) += panel-sony-acx424akp.o + obj-$(CONFIG_DRM_PANEL_SONY_ACX565AKM) += panel-sony-acx565akm.o +diff --git a/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c b/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c +deleted file mode 100644 +index 38ff742bc120..000000000000 +--- a/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c ++++ /dev/null +@@ -1,424 +0,0 @@ +-// SPDX-License-Identifier: GPL-2.0 +-/* +- * Rockteck jh057n00900 5.5" MIPI-DSI panel driver +- * +- * Copyright (C) Purism SPC 2019 +- */ +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include