diff --git a/packages/linux/package.mk b/packages/linux/package.mk index 4d91cf485b..85e2e8ada5 100644 --- a/packages/linux/package.mk +++ b/packages/linux/package.mk @@ -16,8 +16,8 @@ PKG_PATCH_DIRS="${LINUX}" case "${LINUX}" in amlogic) - PKG_VERSION="6cc049b8e0d05e1519d71afcf2d40d3aa5a48366" # 5.11.10 - PKG_SHA256="d5f4a33af53ef0b22049366b2ae2c30a9bf5741dce7d1d2ed6e499c1d9d31c20" + PKG_VERSION="f00712e27083550be3031099b7697925533a6e01" # 5.15.5 + PKG_SHA256="d1d06b7d0b2b23099f17b18559680821f39275e245d6be3d48a4867e0a7076c7" PKG_URL="https://github.com/torvalds/linux/archive/${PKG_VERSION}.tar.gz" PKG_SOURCE_NAME="linux-${LINUX}-${PKG_VERSION}.tar.gz" ;; diff --git a/projects/Amlogic/patches/linux/amlogic-0001-HACK-set-meson-gx-cma-pool-to-896MB.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0001-HACK-set-meson-gx-cma-pool-to-896MB.patch similarity index 79% rename from projects/Amlogic/patches/linux/amlogic-0001-HACK-set-meson-gx-cma-pool-to-896MB.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0001-HACK-set-meson-gx-cma-pool-to-896MB.patch index 6b733a7467..008f023f9f 100644 --- a/projects/Amlogic/patches/linux/amlogic-0001-HACK-set-meson-gx-cma-pool-to-896MB.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0001-HACK-set-meson-gx-cma-pool-to-896MB.patch @@ -1,7 +1,7 @@ -From 30c07b172a2ecc6f97ba2a781568806ecd8c10f7 Mon Sep 17 00:00:00 2001 +From 6441a37be7b5f73b21f575afc9414066e7c5dbf2 Mon Sep 17 00:00:00 2001 From: chewitt Date: Sat, 13 Apr 2019 05:41:51 +0000 -Subject: [PATCH 01/88] HACK: set meson-gx cma pool to 896MB +Subject: [PATCH 01/60] HACK: set meson-gx cma pool to 896MB This change sets the CMA pool to a larger 896MB! value for vdec use @@ -11,10 +11,10 @@ Signed-off-by: Christian Hewitt 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi -index 0edd137151f8..797e193af8e3 100644 +index 6b457b2c30a4..b87be6505a0d 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi -@@ -46,7 +46,7 @@ +@@ -52,7 +52,7 @@ linux,cma { compatible = "shared-dma-pool"; reusable; diff --git a/projects/Amlogic/patches/linux/amlogic-0002-HACK-set-meson-g12-cma-pool-to-896MB.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0002-HACK-set-meson-g12-cma-pool-to-896MB.patch similarity index 80% rename from projects/Amlogic/patches/linux/amlogic-0002-HACK-set-meson-g12-cma-pool-to-896MB.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0002-HACK-set-meson-g12-cma-pool-to-896MB.patch index 13c8a77205..a3be95fba4 100644 --- a/projects/Amlogic/patches/linux/amlogic-0002-HACK-set-meson-g12-cma-pool-to-896MB.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0002-HACK-set-meson-g12-cma-pool-to-896MB.patch @@ -1,7 +1,7 @@ -From 931e76338cb9030643c0228166258a7448bee56d Mon Sep 17 00:00:00 2001 +From 92cf54f0adfc83fb83e9f7564027b84f32ddd401 Mon Sep 17 00:00:00 2001 From: chewitt Date: Wed, 14 Aug 2019 19:58:14 +0000 -Subject: [PATCH 02/88] HACK: set meson-g12 cma pool to 896MB +Subject: [PATCH 02/60] HACK: set meson-g12 cma pool to 896MB This change sets the CMA pool to a larger 896MB! value for vdec use @@ -11,10 +11,10 @@ Signed-off-by: Christian Hewitt 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi -index b858c5e43cc8..3a4f20506a61 100644 +index 00c6f53290d4..93022e53c0db 100644 --- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi -@@ -104,7 +104,7 @@ +@@ -110,7 +110,7 @@ linux,cma { compatible = "shared-dma-pool"; reusable; diff --git a/projects/Amlogic/patches/linux/amlogic-0003-HACK-arm64-fix-Kodi-sysinfo-CPU-information.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0003-HACK-arm64-fix-Kodi-sysinfo-CPU-information.patch similarity index 84% rename from projects/Amlogic/patches/linux/amlogic-0003-HACK-arm64-fix-Kodi-sysinfo-CPU-information.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0003-HACK-arm64-fix-Kodi-sysinfo-CPU-information.patch index ba7e17f3fc..d2ff54514c 100644 --- a/projects/Amlogic/patches/linux/amlogic-0003-HACK-arm64-fix-Kodi-sysinfo-CPU-information.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0003-HACK-arm64-fix-Kodi-sysinfo-CPU-information.patch @@ -1,7 +1,7 @@ -From 0b3ddc882dfbb2b05b2bee78525d692824efb765 Mon Sep 17 00:00:00 2001 +From 3d98fa9b2f696f13eaa1baf1d6fa7f6f2ea31287 Mon Sep 17 00:00:00 2001 From: chewitt Date: Sat, 13 Apr 2019 05:45:18 +0000 -Subject: [PATCH 03/88] HACK: arm64: fix Kodi sysinfo CPU information +Subject: [PATCH 03/60] HACK: arm64: fix Kodi sysinfo CPU information This allows the CPU information to show in the Kodi sysinfo screen, e.g. @@ -13,7 +13,7 @@ Signed-off-by: Christian Hewitt 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c -index 77605aec25fe..d69b4e486098 100644 +index 87731fea5e41..322fec5320e3 100644 --- a/arch/arm64/kernel/cpuinfo.c +++ b/arch/arm64/kernel/cpuinfo.c @@ -148,8 +148,7 @@ static int c_show(struct seq_file *m, void *v) diff --git a/projects/Amlogic/patches/linux/amlogic-0004-HACK-arm64-dts-meson-gx-add-ATF-BL32-reserved-memory.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0004-HACK-arm64-dts-meson-gx-add-ATF-BL32-reserved-memory.patch similarity index 84% rename from projects/Amlogic/patches/linux/amlogic-0004-HACK-arm64-dts-meson-gx-add-ATF-BL32-reserved-memory.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0004-HACK-arm64-dts-meson-gx-add-ATF-BL32-reserved-memory.patch index fbdac83eb3..eb2e7c8e1f 100644 --- a/projects/Amlogic/patches/linux/amlogic-0004-HACK-arm64-dts-meson-gx-add-ATF-BL32-reserved-memory.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0004-HACK-arm64-dts-meson-gx-add-ATF-BL32-reserved-memory.patch @@ -1,7 +1,7 @@ -From 75325878062f46b0236ccdb6140cde7b2f490794 Mon Sep 17 00:00:00 2001 +From 796ed17addc9f7c7ab713b0d33fa7429ead84589 Mon Sep 17 00:00:00 2001 From: kszaq Date: Sat, 6 Jul 2019 07:54:44 +0000 -Subject: [PATCH 04/88] HACK: arm64: dts: meson-gx: add ATF BL32 reserved +Subject: [PATCH 04/60] HACK: arm64: dts: meson-gx: add ATF BL32 reserved memory region Vendor firmware/uboot has an additional reserved region for BL32 trusted @@ -16,10 +16,10 @@ Signed-off-by: kszaq 1 file changed, 6 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi -index 797e193af8e3..cf9eb7c8a6f0 100644 +index b87be6505a0d..99b8916e0c5d 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi -@@ -43,6 +43,12 @@ +@@ -49,6 +49,12 @@ no-map; }; diff --git a/projects/Amlogic/patches/linux/amlogic-0046-WIP-arm64-meson-add-Amlogic-Meson-GX-PM-Suspend.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0005-HACK-arm64-meson-add-Amlogic-Meson-GX-PM-Suspend.patch similarity index 96% rename from projects/Amlogic/patches/linux/amlogic-0046-WIP-arm64-meson-add-Amlogic-Meson-GX-PM-Suspend.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0005-HACK-arm64-meson-add-Amlogic-Meson-GX-PM-Suspend.patch index 373e76938c..413f5824a4 100644 --- a/projects/Amlogic/patches/linux/amlogic-0046-WIP-arm64-meson-add-Amlogic-Meson-GX-PM-Suspend.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0005-HACK-arm64-meson-add-Amlogic-Meson-GX-PM-Suspend.patch @@ -1,7 +1,7 @@ -From 7d2c3c596ee8b4703a2d4ba2f9f513d38e032541 Mon Sep 17 00:00:00 2001 +From 8cb8fc73cc2f53b73300037edfe81c9f9f6d5f4e Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Thu, 3 Nov 2016 15:29:23 +0100 -Subject: [PATCH 46/88] WIP: arm64: meson: add Amlogic Meson GX PM Suspend +Subject: [PATCH 05/60] HACK: arm64: meson: add Amlogic Meson GX PM Suspend The Amlogic Meson GX SoCs uses a non-standard argument to the PSCI CPU_SUSPEND call to enter system suspend. diff --git a/projects/Amlogic/patches/linux/amlogic-0049-WIP-arm64-dts-meson-add-support-for-GX-PM-and-Virtua.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0006-HACK-arm64-dts-meson-add-support-for-GX-PM-and-Virtu.patch similarity index 83% rename from projects/Amlogic/patches/linux/amlogic-0049-WIP-arm64-dts-meson-add-support-for-GX-PM-and-Virtua.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0006-HACK-arm64-dts-meson-add-support-for-GX-PM-and-Virtu.patch index da76a82e13..bf71a29853 100644 --- a/projects/Amlogic/patches/linux/amlogic-0049-WIP-arm64-dts-meson-add-support-for-GX-PM-and-Virtua.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0006-HACK-arm64-dts-meson-add-support-for-GX-PM-and-Virtu.patch @@ -1,7 +1,7 @@ -From 97f099f7b4e954a67d4c2612211520c6778559da Mon Sep 17 00:00:00 2001 +From f84b9abfe184af1bedf58c7492430b68cc6a0ac2 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Thu, 3 Nov 2016 15:29:25 +0100 -Subject: [PATCH 49/88] WIP: arm64: dts: meson: add support for GX PM and +Subject: [PATCH 06/60] HACK: arm64: dts: meson: add support for GX PM and Virtual RTC Signed-off-by: Neil Armstrong @@ -10,7 +10,7 @@ Signed-off-by: Neil Armstrong 1 file changed, 9 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi -index e58ebe3ba65c..a717e93eea94 100644 +index 99b8916e0c5d..d6dc407127cd 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi @@ -221,6 +221,10 @@ diff --git a/projects/Amlogic/patches/linux/amlogic-0050-WIP-arm64-dts-meson-add-rtc-vrtc-aliases-to-Khadas-V.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0007-HACK-arm64-dts-meson-add-rtc-vrtc-aliases-to-Khadas-.patch similarity index 81% rename from projects/Amlogic/patches/linux/amlogic-0050-WIP-arm64-dts-meson-add-rtc-vrtc-aliases-to-Khadas-V.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0007-HACK-arm64-dts-meson-add-rtc-vrtc-aliases-to-Khadas-.patch index 4be4e762f6..f90f7f5684 100644 --- a/projects/Amlogic/patches/linux/amlogic-0050-WIP-arm64-dts-meson-add-rtc-vrtc-aliases-to-Khadas-V.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0007-HACK-arm64-dts-meson-add-rtc-vrtc-aliases-to-Khadas-.patch @@ -1,7 +1,7 @@ -From 0036ea5b743d40190574fbd1d65ac19d37913050 Mon Sep 17 00:00:00 2001 +From 16e0395a999865b4450e46f3d53df3ed3ea7c023 Mon Sep 17 00:00:00 2001 From: Christian Hewitt Date: Thu, 21 Jan 2021 01:35:36 +0000 -Subject: [PATCH 50/88] WIP: arm64: dts: meson: add rtc/vrtc aliases to Khadas +Subject: [PATCH 07/60] HACK: arm64: dts: meson: add rtc/vrtc aliases to Khadas VIM Add aliases to ensure the vrtc time (which normally proves first) is /dev/rtc1 @@ -13,7 +13,7 @@ Signed-off-by: Christian Hewitt 1 file changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts -index 60feac0179c0..df287b12975b 100644 +index 6ab1cc125b96..24af15e18026 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts @@ -29,6 +29,8 @@ diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0008-HACK-arm64-dts-meson-add-rtc-vrtc-aliases-to-Khadas-.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0008-HACK-arm64-dts-meson-add-rtc-vrtc-aliases-to-Khadas-.patch new file mode 100644 index 0000000000..9ad8eeb37c --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0008-HACK-arm64-dts-meson-add-rtc-vrtc-aliases-to-Khadas-.patch @@ -0,0 +1,30 @@ +From c8d74b62cbf8c0f7c1cd331607540660a0e4d830 Mon Sep 17 00:00:00 2001 +From: Christian Hewitt +Date: Sat, 6 Nov 2021 13:01:08 +0000 +Subject: [PATCH 08/60] HACK: arm64: dts: meson: add rtc/vrtc aliases to Khadas + VIM2 + +Add aliases to ensure the vrtc time (which normally proves first) is /dev/rtc1 +while the onboard rtc chip claims /dev/rtc0. + +Signed-off-by: Christian Hewitt +--- + arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts +index 86bdc0baf032..9c26d7489d2a 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts ++++ b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts +@@ -18,6 +18,8 @@ + aliases { + serial0 = &uart_AO; + serial2 = &uart_AO_B; ++ rtc0 = &rtc; ++ rtc1 = &vrtc; + }; + + chosen { +-- +2.17.1 + diff --git a/projects/Amlogic/patches/linux/amlogic-0051-WIP-arm64-dts-meson-add-rtc-vrtc-aliases-to-Minix-NE.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0009-HACK-arm64-dts-meson-add-rtc-vrtc-aliases-to-Minix-N.patch similarity index 81% rename from projects/Amlogic/patches/linux/amlogic-0051-WIP-arm64-dts-meson-add-rtc-vrtc-aliases-to-Minix-NE.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0009-HACK-arm64-dts-meson-add-rtc-vrtc-aliases-to-Minix-N.patch index 1c19e70547..33999e8421 100644 --- a/projects/Amlogic/patches/linux/amlogic-0051-WIP-arm64-dts-meson-add-rtc-vrtc-aliases-to-Minix-NE.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0009-HACK-arm64-dts-meson-add-rtc-vrtc-aliases-to-Minix-N.patch @@ -1,7 +1,7 @@ -From 9a81dd203d2707526822ccdb79e58e5a13db5ac5 Mon Sep 17 00:00:00 2001 +From e2a996cefcd8feaa1ebd986b3f811571c7649293 Mon Sep 17 00:00:00 2001 From: Christian Hewitt Date: Mon, 1 Feb 2021 19:27:40 +0000 -Subject: [PATCH 51/88] WIP: arm64: dts: meson: add rtc/vrtc aliases to Minix +Subject: [PATCH 09/60] HACK: arm64: dts: meson: add rtc/vrtc aliases to Minix NEO U9-H Add node aliases to prevent meson-vrtc from claiming /dev/rtc0 @@ -12,7 +12,7 @@ Signed-off-by: Christian Hewitt 1 file changed, 5 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-minix-neo-u9h.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-minix-neo-u9h.dts -index a414cd39c2b1..443cea738e53 100644 +index ea9f234d1fc7..3a0955ce3c39 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxm-minix-neo-u9h.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxm-minix-neo-u9h.dts @@ -14,6 +14,11 @@ diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0010-HACK-of-partial-revert-of-fdt.c-changes.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0010-HACK-of-partial-revert-of-fdt.c-changes.patch new file mode 100644 index 0000000000..9b42c34f41 --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0010-HACK-of-partial-revert-of-fdt.c-changes.patch @@ -0,0 +1,36 @@ +From aaab5272187b1650776371c4381ea1373d818d1a Mon Sep 17 00:00:00 2001 +From: Stefan Agner +Date: Wed, 15 Sep 2021 05:00:45 +0000 +Subject: [PATCH 10/60] HACK: of: partial revert of fdt.c changes + +This resolves reports similar to the below which are present in dmesg +since Linux 5.10; which are also causing crashes in some distros: + +[ 0.000000] OF: fdt: Reserved memory: failed to reserve memory for node 'secmon@5000000': base 0x0000000005000000, size 3 MiB + +Signed-off-by: Christian Hewitt +--- + drivers/of/fdt.c | 7 ------- + 1 file changed, 7 deletions(-) + +diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c +index 4546572af24b..cf5c100cc5d4 100644 +--- a/drivers/of/fdt.c ++++ b/drivers/of/fdt.c +@@ -480,13 +480,6 @@ static int __init early_init_dt_reserve_memory_arch(phys_addr_t base, + phys_addr_t size, bool nomap) + { + if (nomap) { +- /* +- * If the memory is already reserved (by another region), we +- * should not allow it to be marked nomap. +- */ +- if (memblock_is_region_reserved(base, size)) +- return -EBUSY; +- + return memblock_mark_nomap(base, size); + } + return memblock_reserve(base, size); +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0011-FROMGIT-dt-bindings-arm-amlogic-add-support-for-Radx.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0011-FROMGIT-dt-bindings-arm-amlogic-add-support-for-Radx.patch new file mode 100644 index 0000000000..548ee034a4 --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0011-FROMGIT-dt-bindings-arm-amlogic-add-support-for-Radx.patch @@ -0,0 +1,29 @@ +From 92f35a36faa4dbcf0e562566a1f4a4a2deb615ca Mon Sep 17 00:00:00 2001 +From: Christian Hewitt +Date: Sat, 16 May 2020 07:04:58 +0000 +Subject: [PATCH 11/60] FROMGIT: dt-bindings: arm: amlogic: add support for + Radxa Zero + +Radxa Zero is a small form-factor SBC with an Amlogic S905Y2 chip. + +Signed-off-by: Christian Hewitt +Acked-by: Rob Herring +--- + Documentation/devicetree/bindings/arm/amlogic.yaml | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Documentation/devicetree/bindings/arm/amlogic.yaml b/Documentation/devicetree/bindings/arm/amlogic.yaml +index 6423377710ee..67dccdd9a5a4 100644 +--- a/Documentation/devicetree/bindings/arm/amlogic.yaml ++++ b/Documentation/devicetree/bindings/arm/amlogic.yaml +@@ -141,6 +141,7 @@ properties: + - enum: + - amediatech,x96-max + - amlogic,u200 ++ - radxa,zero + - seirobotics,sei510 + - const: amlogic,g12a + +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0012-FROMGIT-arm64-dts-amlogic-add-support-for-Radxa-Zero.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0012-FROMGIT-arm64-dts-amlogic-add-support-for-Radxa-Zero.patch new file mode 100644 index 0000000000..a73905054c --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0012-FROMGIT-arm64-dts-amlogic-add-support-for-Radxa-Zero.patch @@ -0,0 +1,453 @@ +From be960f16c8f919f083ebf6a1727d23da2b4690d2 Mon Sep 17 00:00:00 2001 +From: Christian Hewitt +Date: Fri, 6 Aug 2021 12:16:10 +0000 +Subject: [PATCH 12/60] FROMGIT: arm64: dts: amlogic: add support for Radxa + Zero + +Radxa Zero is a small form factor SBC based on the Amlogic S905Y2 +chipset that ships in a number of RAM/eMMC configurations: + +Boards with 512MB/1GB LPDDR4 RAM have no eMMC storage and BCM43436 +wireless (2.4GHz b/g/n) while 2GB/4GB boards have 8/16/32/64/128GB +eMMC storage and BCM4345 wireless (2.4/5GHz a/b/g/n/ac). + +- Amlogic S905Y2 quad-core Cortex-A53 +- Mali G31-MP2 GPU +- HDMI 2.1 output (micro) +- 1x USB 2.0 port - Type C (OTG) +- 1x USB 3.0 port - Type C (Host) +- 1x micro SD Card slot +- 40 Pin GPIO header + +Signed-off-by: Christian Hewitt +--- + arch/arm64/boot/dts/amlogic/Makefile | 1 + + .../dts/amlogic/meson-g12a-radxa-zero.dts | 405 ++++++++++++++++++ + 2 files changed, 406 insertions(+) + create mode 100644 arch/arm64/boot/dts/amlogic/meson-g12a-radxa-zero.dts + +diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile +index faa0a79a34f5..be308361e2f1 100644 +--- a/arch/arm64/boot/dts/amlogic/Makefile ++++ b/arch/arm64/boot/dts/amlogic/Makefile +@@ -1,5 +1,6 @@ + # SPDX-License-Identifier: GPL-2.0 + dtb-$(CONFIG_ARCH_MESON) += meson-axg-s400.dtb ++dtb-$(CONFIG_ARCH_MESON) += meson-g12a-radxa-zero.dtb + dtb-$(CONFIG_ARCH_MESON) += meson-g12a-sei510.dtb + dtb-$(CONFIG_ARCH_MESON) += meson-g12a-u200.dtb + dtb-$(CONFIG_ARCH_MESON) += meson-g12a-x96-max.dtb +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a-radxa-zero.dts b/arch/arm64/boot/dts/amlogic/meson-g12a-radxa-zero.dts +new file mode 100644 +index 000000000000..e3bb6df42ff3 +--- /dev/null ++++ b/arch/arm64/boot/dts/amlogic/meson-g12a-radxa-zero.dts +@@ -0,0 +1,405 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (c) 2018 BayLibre SAS. All rights reserved. ++ */ ++ ++/dts-v1/; ++ ++#include "meson-g12a.dtsi" ++#include ++#include ++ ++/ { ++ compatible = "radxa,zero", "amlogic,g12a"; ++ model = "Radxa Zero"; ++ ++ aliases { ++ serial0 = &uart_AO; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x0 0x0 0x0 0x40000000>; ++ }; ++ ++ cvbs-connector { ++ status = "disabled"; ++ compatible = "composite-video-connector"; ++ ++ port { ++ cvbs_connector_in: endpoint { ++ remote-endpoint = <&cvbs_vdac_out>; ++ }; ++ }; ++ }; ++ ++ hdmi-connector { ++ compatible = "hdmi-connector"; ++ type = "a"; ++ ++ port { ++ hdmi_connector_in: endpoint { ++ remote-endpoint = <&hdmi_tx_tmds_out>; ++ }; ++ }; ++ }; ++ ++ emmc_pwrseq: emmc-pwrseq { ++ compatible = "mmc-pwrseq-emmc"; ++ reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>; ++ }; ++ ++ sdio_pwrseq: sdio-pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>; ++ clocks = <&wifi32k>; ++ clock-names = "ext_clock"; ++ }; ++ ++ ao_5v: regulator-ao_5v { ++ compatible = "regulator-fixed"; ++ regulator-name = "AO_5V"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-always-on; ++ }; ++ ++ vcc_1v8: regulator-vcc_1v8 { ++ compatible = "regulator-fixed"; ++ regulator-name = "VCC_1V8"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ vin-supply = <&vcc_3v3>; ++ regulator-always-on; ++ }; ++ ++ vcc_3v3: regulator-vcc_3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "VCC_3V3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ vin-supply = <&vddao_3v3>; ++ regulator-always-on; ++ }; ++ ++ hdmi_pw: regulator-hdmi_pw { ++ compatible = "regulator-fixed"; ++ regulator-name = "HDMI_PW"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ vin-supply = <&ao_5v>; ++ regulator-always-on; ++ }; ++ ++ vddao_1v8: regulator-vddao_1v8 { ++ compatible = "regulator-fixed"; ++ regulator-name = "VDDAO_1V8"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ vin-supply = <&vddao_3v3>; ++ regulator-always-on; ++ }; ++ ++ vddao_3v3: regulator-vddao_3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "VDDAO_3V3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ vin-supply = <&ao_5v>; ++ regulator-always-on; ++ }; ++ ++ vddcpu: regulator-vddcpu { ++ compatible = "pwm-regulator"; ++ ++ regulator-name = "VDDCPU"; ++ regulator-min-microvolt = <721000>; ++ regulator-max-microvolt = <1022000>; ++ ++ vin-supply = <&ao_5v>; ++ ++ pwms = <&pwm_AO_cd 1 1250 0>; ++ pwm-dutycycle-range = <100 0>; ++ ++ regulator-boot-on; ++ regulator-always-on; ++ }; ++ ++ sound { ++ compatible = "amlogic,axg-sound-card"; ++ model = "RADXA-ZERO"; ++ audio-aux-devs = <&tdmout_b>; ++ audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1", ++ "TDMOUT_B IN 1", "FRDDR_B OUT 1", ++ "TDMOUT_B IN 2", "FRDDR_C OUT 1", ++ "TDM_B Playback", "TDMOUT_B OUT"; ++ ++ assigned-clocks = <&clkc CLKID_MPLL2>, ++ <&clkc CLKID_MPLL0>, ++ <&clkc CLKID_MPLL1>; ++ assigned-clock-parents = <0>, <0>, <0>; ++ assigned-clock-rates = <294912000>, ++ <270950400>, ++ <393216000>; ++ status = "okay"; ++ ++ dai-link-0 { ++ sound-dai = <&frddr_a>; ++ }; ++ ++ dai-link-1 { ++ sound-dai = <&frddr_b>; ++ }; ++ ++ dai-link-2 { ++ sound-dai = <&frddr_c>; ++ }; ++ ++ /* 8ch hdmi interface */ ++ dai-link-3 { ++ sound-dai = <&tdmif_b>; ++ dai-format = "i2s"; ++ dai-tdm-slot-tx-mask-0 = <1 1>; ++ dai-tdm-slot-tx-mask-1 = <1 1>; ++ dai-tdm-slot-tx-mask-2 = <1 1>; ++ dai-tdm-slot-tx-mask-3 = <1 1>; ++ mclk-fs = <256>; ++ ++ codec { ++ sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>; ++ }; ++ }; ++ ++ dai-link-4 { ++ sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>; ++ ++ codec { ++ sound-dai = <&hdmi_tx>; ++ }; ++ }; ++ }; ++ ++ wifi32k: wifi32k { ++ compatible = "pwm-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <32768>; ++ pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */ ++ }; ++}; ++ ++&arb { ++ status = "okay"; ++}; ++ ++&cec_AO { ++ pinctrl-0 = <&cec_ao_a_h_pins>; ++ pinctrl-names = "default"; ++ status = "disabled"; ++ hdmi-phandle = <&hdmi_tx>; ++}; ++ ++&cecb_AO { ++ pinctrl-0 = <&cec_ao_b_h_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++ hdmi-phandle = <&hdmi_tx>; ++}; ++ ++&clkc_audio { ++ status = "okay"; ++}; ++ ++&cpu0 { ++ cpu-supply = <&vddcpu>; ++ operating-points-v2 = <&cpu_opp_table>; ++ clocks = <&clkc CLKID_CPU_CLK>; ++ clock-latency = <50000>; ++}; ++ ++&cpu1 { ++ cpu-supply = <&vddcpu>; ++ operating-points-v2 = <&cpu_opp_table>; ++ clocks = <&clkc CLKID_CPU_CLK>; ++ clock-latency = <50000>; ++}; ++ ++&cpu2 { ++ cpu-supply = <&vddcpu>; ++ operating-points-v2 = <&cpu_opp_table>; ++ clocks = <&clkc CLKID_CPU_CLK>; ++ clock-latency = <50000>; ++}; ++ ++&cpu3 { ++ cpu-supply = <&vddcpu>; ++ operating-points-v2 = <&cpu_opp_table>; ++ clocks = <&clkc CLKID_CPU_CLK>; ++ clock-latency = <50000>; ++}; ++ ++&cvbs_vdac_port { ++ cvbs_vdac_out: endpoint { ++ remote-endpoint = <&cvbs_connector_in>; ++ }; ++}; ++ ++&frddr_a { ++ status = "okay"; ++}; ++ ++&frddr_b { ++ status = "okay"; ++}; ++ ++&frddr_c { ++ status = "okay"; ++}; ++ ++&hdmi_tx { ++ status = "okay"; ++ pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>; ++ pinctrl-names = "default"; ++ hdmi-supply = <&hdmi_pw>; ++}; ++ ++&hdmi_tx_tmds_port { ++ hdmi_tx_tmds_out: endpoint { ++ remote-endpoint = <&hdmi_connector_in>; ++ }; ++}; ++ ++&ir { ++ status = "disabled"; ++ pinctrl-0 = <&remote_input_ao_pins>; ++ pinctrl-names = "default"; ++}; ++ ++&pwm_AO_cd { ++ pinctrl-0 = <&pwm_ao_d_e_pins>; ++ pinctrl-names = "default"; ++ clocks = <&xtal>; ++ clock-names = "clkin1"; ++ status = "okay"; ++}; ++ ++&pwm_ef { ++ status = "okay"; ++ pinctrl-0 = <&pwm_e_pins>; ++ pinctrl-names = "default"; ++ clocks = <&xtal>; ++ clock-names = "clkin0"; ++}; ++ ++&saradc { ++ status = "okay"; ++ vref-supply = <&vddao_1v8>; ++}; ++ ++/* SDIO */ ++&sd_emmc_a { ++ status = "okay"; ++ pinctrl-0 = <&sdio_pins>; ++ pinctrl-1 = <&sdio_clk_gate_pins>; ++ pinctrl-names = "default", "clk-gate"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ bus-width = <4>; ++ cap-sd-highspeed; ++ sd-uhs-sdr50; ++ max-frequency = <100000000>; ++ ++ non-removable; ++ disable-wp; ++ ++ /* WiFi firmware requires power to be kept while in suspend */ ++ keep-power-in-suspend; ++ ++ mmc-pwrseq = <&sdio_pwrseq>; ++ ++ vmmc-supply = <&vddao_3v3>; ++ vqmmc-supply = <&vddao_1v8>; ++ ++ brcmf: wifi@1 { ++ reg = <1>; ++ compatible = "brcm,bcm4329-fmac"; ++ }; ++}; ++ ++/* SD card */ ++&sd_emmc_b { ++ status = "okay"; ++ pinctrl-0 = <&sdcard_c_pins>; ++ pinctrl-1 = <&sdcard_clk_gate_c_pins>; ++ pinctrl-names = "default", "clk-gate"; ++ ++ bus-width = <4>; ++ cap-sd-highspeed; ++ max-frequency = <100000000>; ++ disable-wp; ++ ++ cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>; ++ vmmc-supply = <&vddao_3v3>; ++ vqmmc-supply = <&vddao_3v3>; ++}; ++ ++/* eMMC */ ++&sd_emmc_c { ++ status = "okay"; ++ pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>; ++ pinctrl-1 = <&emmc_clk_gate_pins>; ++ pinctrl-names = "default", "clk-gate"; ++ ++ bus-width = <8>; ++ cap-mmc-highspeed; ++ mmc-ddr-1_8v; ++ mmc-hs200-1_8v; ++ max-frequency = <200000000>; ++ disable-wp; ++ ++ mmc-pwrseq = <&emmc_pwrseq>; ++ vmmc-supply = <&vcc_3v3>; ++ vqmmc-supply = <&vcc_1v8>; ++}; ++ ++&tdmif_b { ++ status = "okay"; ++}; ++ ++&tdmout_b { ++ status = "okay"; ++}; ++ ++&tohdmitx { ++ status = "okay"; ++}; ++ ++&uart_A { ++ status = "okay"; ++ pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>; ++ pinctrl-names = "default"; ++ uart-has-rtscts; ++ ++ bluetooth { ++ compatible = "brcm,bcm43438-bt"; ++ shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; ++ max-speed = <2000000>; ++ clocks = <&wifi32k>; ++ clock-names = "lpo"; ++ }; ++}; ++ ++&uart_AO { ++ status = "okay"; ++ pinctrl-0 = <&uart_ao_a_pins>; ++ pinctrl-names = "default"; ++}; ++ ++&usb { ++ status = "okay"; ++ dr_mode = "host"; ++}; +-- +2.17.1 + diff --git a/projects/Amlogic/patches/linux/amlogic-0057-WIP-arm64-dts-meson-add-audio-playback-to-rbox-pro.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0013-FROMGIT-arm64-dts-meson-add-audio-playback-to-rbox-p.patch similarity index 68% rename from projects/Amlogic/patches/linux/amlogic-0057-WIP-arm64-dts-meson-add-audio-playback-to-rbox-pro.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0013-FROMGIT-arm64-dts-meson-add-audio-playback-to-rbox-p.patch index 2f925fb826..428d8b75bd 100644 --- a/projects/Amlogic/patches/linux/amlogic-0057-WIP-arm64-dts-meson-add-audio-playback-to-rbox-pro.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0013-FROMGIT-arm64-dts-meson-add-audio-playback-to-rbox-p.patch @@ -1,17 +1,18 @@ -From 2a59ec1861a0dae5694969e14cb42fe6f7991519 Mon Sep 17 00:00:00 2001 +From 1fcbeb841274082a23ce1bccd597167a56132662 Mon Sep 17 00:00:00 2001 From: Christian Hewitt Date: Fri, 15 May 2020 08:13:00 +0000 -Subject: [PATCH 57/88] WIP: arm64: dts: meson: add audio playback to rbox-pro +Subject: [PATCH 13/60] FROMGIT: arm64: dts: meson: add audio playback to + rbox-pro Add initial support limited to HDMI i2s and SPDIF (LPCM). Signed-off-by: Christian Hewitt --- - .../boot/dts/amlogic/meson-gxm-rbox-pro.dts | 80 +++++++++++++++++++ - 1 file changed, 80 insertions(+) + .../boot/dts/amlogic/meson-gxm-rbox-pro.dts | 61 +++++++++++++++++++ + 1 file changed, 61 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts -index dde7cfe12cff..0208c95e92cf 100644 +index dde7cfe12cff..50137aafab10 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts @@ -14,6 +14,7 @@ @@ -36,33 +37,7 @@ index dde7cfe12cff..0208c95e92cf 100644 leds { compatible = "gpio-leds"; -@@ -51,6 +59,25 @@ - }; - }; - -+ vddio_ao18: regulator-vddio_ao18 { -+ compatible = "regulator-fixed"; -+ regulator-name = "VDDIO_AO18"; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ }; -+ -+ hdmi_5v: regulator-hdmi-5v { -+ compatible = "regulator-fixed"; -+ -+ regulator-name = "HDMI_5V"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ -+ gpio = <&gpio GPIOH_3 GPIO_ACTIVE_HIGH>; -+ enable-active-high; -+ regulator-always-on; -+ }; -+ - vddio_boot: regulator-vddio-boot { - compatible = "regulator-fixed"; - regulator-name = "VDDIO_BOOT"; -@@ -90,6 +117,59 @@ +@@ -90,6 +98,59 @@ clocks = <&wifi32k>; clock-names = "ext_clock"; }; diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0014-FROMGIT-arm64-dts-meson-sm1-odroid-add-cec-nodes.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0014-FROMGIT-arm64-dts-meson-sm1-odroid-add-cec-nodes.patch new file mode 100644 index 0000000000..f467a6783f --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0014-FROMGIT-arm64-dts-meson-sm1-odroid-add-cec-nodes.patch @@ -0,0 +1,40 @@ +From c59abdc476c8dd424ce2731ef5602a2d5dde6ee7 Mon Sep 17 00:00:00 2001 +From: Dmitry Shmidt +Date: Fri, 8 Oct 2021 03:54:31 +0000 +Subject: [PATCH 14/60] FROMGIT: arm64: dts: meson-sm1-odroid: add cec nodes + +Enable CEC in same way it is done for other meson odroid devices + +Signed-off-by: Dmitry Shmidt +--- + arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi +index 5779e70caccd..0bd1e98a0eef 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi ++++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi +@@ -225,6 +225,20 @@ + status = "okay"; + }; + ++&cec_AO { ++ pinctrl-0 = <&cec_ao_a_h_pins>; ++ pinctrl-names = "default"; ++ status = "disabled"; ++ hdmi-phandle = <&hdmi_tx>; ++}; ++ ++&cecb_AO { ++ pinctrl-0 = <&cec_ao_b_h_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++ hdmi-phandle = <&hdmi_tx>; ++}; ++ + &clkc_audio { + status = "okay"; + }; +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0015-FROMGIT-arm64-dts-meson-gxbb-wetek-fix-HDMI-in-early.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0015-FROMGIT-arm64-dts-meson-gxbb-wetek-fix-HDMI-in-early.patch new file mode 100644 index 0000000000..c425046ad9 --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0015-FROMGIT-arm64-dts-meson-gxbb-wetek-fix-HDMI-in-early.patch @@ -0,0 +1,39 @@ +From 6065e3208d647aebec8a3fb7b1986b1b8d8fdd83 Mon Sep 17 00:00:00 2001 +From: Christian Hewitt +Date: Tue, 12 Oct 2021 04:47:14 +0000 +Subject: [PATCH 15/60] FROMGIT: arm64: dts: meson-gxbb-wetek: fix HDMI in + early boot + +Mark the VDDIO_AO18 regulator always-on and set hdmi-supply for the hdmi_tx +node to ensure HDMI is powered in the early stages of boot. + +Fixes: fb72c03e0e32 ("ARM64: dts: meson-gxbb-wetek: add a wetek specific dtsi to cleanup hub and play2") + +Signed-off-by: Christian Hewitt +--- + arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi +index a350fee1264d..8e2af986ceba 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi ++++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi +@@ -64,6 +64,7 @@ + regulator-name = "VDDIO_AO18"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; ++ regulator-always-on; + }; + + vcc_3v3: regulator-vcc_3v3 { +@@ -161,6 +162,7 @@ + status = "okay"; + pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>; + pinctrl-names = "default"; ++ hdmi-supply = <&vddio_ao18>; + }; + + &hdmi_tx_tmds_port { +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0016-FROMGIT-arm64-dts-meson-gxbb-wetek-fix-missing-GPIO-.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0016-FROMGIT-arm64-dts-meson-gxbb-wetek-fix-missing-GPIO-.patch new file mode 100644 index 0000000000..1927ef4b98 --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0016-FROMGIT-arm64-dts-meson-gxbb-wetek-fix-missing-GPIO-.patch @@ -0,0 +1,32 @@ +From aaa7ab225b8b3f5a58baecf1d4522d893e9f8db5 Mon Sep 17 00:00:00 2001 +From: Christian Hewitt +Date: Tue, 12 Oct 2021 05:13:06 +0000 +Subject: [PATCH 16/60] FROMGIT: arm64: dts: meson-gxbb-wetek: fix missing GPIO + binding + +The absence of this binding appears to be harmless in Linux but it breaks +Ethernet support in mainline u-boot. So add the binding (which is present +in all other u-boot supported GXBB device-trees). + +Fixes: fb72c03e0e32 ("ARM64: dts: meson-gxbb-wetek: add a wetek specific dtsi to cleanup hub and play2") + +Signed-off-by: Christian Hewitt +--- + arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi +index 8e2af986ceba..a4d34398da35 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi ++++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi +@@ -6,6 +6,7 @@ + */ + + #include "meson-gxbb.dtsi" ++#include + + / { + aliases { +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0017-FROMGIT-arm64-dts-meson-gxbb-wetek-use-updated-LED-b.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0017-FROMGIT-arm64-dts-meson-gxbb-wetek-use-updated-LED-b.patch new file mode 100644 index 0000000000..07ac1dab35 --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0017-FROMGIT-arm64-dts-meson-gxbb-wetek-use-updated-LED-b.patch @@ -0,0 +1,41 @@ +From 8e92a8d45aecb19c6bcfe569cf238f0f476b293f Mon Sep 17 00:00:00 2001 +From: Christian Hewitt +Date: Tue, 12 Oct 2021 04:58:38 +0000 +Subject: [PATCH 17/60] FROMGIT: arm64: dts: meson-gxbb-wetek: use updated LED + bindings + +Update the dts to use the newer style of LED bindings. + +Signed-off-by: Christian Hewitt +--- + arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi +index a4d34398da35..94dafb955301 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi ++++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi +@@ -7,6 +7,7 @@ + + #include "meson-gxbb.dtsi" + #include ++#include + + / { + aliases { +@@ -26,8 +27,10 @@ + leds { + compatible = "gpio-leds"; + +- led-system { +- label = "wetek-play:system-status"; ++ led-power { ++ /* red in suspend or power-off */ ++ color = ; ++ function = LED_FUNCTION_POWER; + gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_HIGH>; + default-state = "on"; + panic-indicator; +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0018-FROMGIT-soc-amlogic-meson-gx-socinfo-Add-S905Y2-ID-f.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0018-FROMGIT-soc-amlogic-meson-gx-socinfo-Add-S905Y2-ID-f.patch new file mode 100644 index 0000000000..2ba7fe6e25 --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0018-FROMGIT-soc-amlogic-meson-gx-socinfo-Add-S905Y2-ID-f.patch @@ -0,0 +1,31 @@ +From 4b278c3214195ee59c936ff082a66a6593d1004b Mon Sep 17 00:00:00 2001 +From: Christian Hewitt +Date: Fri, 20 Aug 2021 01:17:54 +0000 +Subject: [PATCH 18/60] FROMGIT: soc: amlogic: meson-gx-socinfo: Add S905Y2 ID + for Radxa Zero + +Add the SOC ID for the S905Y2 used in the Radxa Zero. Before/After: + +[ 0.321650] soc soc0: Amlogic Meson G12A (Unknown) Revision 28:b (30:2) Detected +[ 0.318533] soc soc0: Amlogic Meson G12A (S905Y2) Revision 28:b (30:2) Detected + +Signed-off-by: Christian Hewitt +--- + drivers/soc/amlogic/meson-gx-socinfo.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/soc/amlogic/meson-gx-socinfo.c b/drivers/soc/amlogic/meson-gx-socinfo.c +index 6f54bd832c8b..165f7548401b 100644 +--- a/drivers/soc/amlogic/meson-gx-socinfo.c ++++ b/drivers/soc/amlogic/meson-gx-socinfo.c +@@ -65,6 +65,7 @@ static const struct meson_gx_package_id { + { "A113X", 0x25, 0x37, 0xff }, + { "A113D", 0x25, 0x22, 0xff }, + { "S905D2", 0x28, 0x10, 0xf0 }, ++ { "S905Y2", 0x28, 0x30, 0xf0 }, + { "S905X2", 0x28, 0x40, 0xf0 }, + { "A311D", 0x29, 0x10, 0xf0 }, + { "S922X", 0x29, 0x40, 0xf0 }, +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0019-FROMGIT-soc-amlogic-canvas-Make-use-of-the-helper-fu.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0019-FROMGIT-soc-amlogic-canvas-Make-use-of-the-helper-fu.patch new file mode 100644 index 0000000000..3967f96df5 --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0019-FROMGIT-soc-amlogic-canvas-Make-use-of-the-helper-fu.patch @@ -0,0 +1,43 @@ +From 3ca769d11ba14c46f2bc52fe633dc878c8d6f288 Mon Sep 17 00:00:00 2001 +From: Cai Huoqing +Date: Tue, 14 Sep 2021 15:10:02 +0000 +Subject: [PATCH 19/60] FROMGIT: soc: amlogic: canvas: Make use of the helper + function devm_platform_ioremap_resource() + +Use the devm_platform_ioremap_resource() helper instead of +calling platform_get_resource() and devm_ioremap_resource() +separately + +Signed-off-by: Cai Huoqing +Reviewed-by: Neil Armstrong +Signed-off-by: Neil Armstrong +Link: https://lore.kernel.org/r/20210908071544.603-1-caihuoqing@baidu.com +--- + drivers/soc/amlogic/meson-canvas.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/drivers/soc/amlogic/meson-canvas.c b/drivers/soc/amlogic/meson-canvas.c +index d0329ad170d1..383b0cfc584e 100644 +--- a/drivers/soc/amlogic/meson-canvas.c ++++ b/drivers/soc/amlogic/meson-canvas.c +@@ -168,7 +168,6 @@ EXPORT_SYMBOL_GPL(meson_canvas_free); + + static int meson_canvas_probe(struct platform_device *pdev) + { +- struct resource *res; + struct meson_canvas *canvas; + struct device *dev = &pdev->dev; + +@@ -176,8 +175,7 @@ static int meson_canvas_probe(struct platform_device *pdev) + if (!canvas) + return -ENOMEM; + +- res = platform_get_resource(pdev, IORESOURCE_MEM, 0); +- canvas->reg_base = devm_ioremap_resource(dev, res); ++ canvas->reg_base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(canvas->reg_base)) + return PTR_ERR(canvas->reg_base); + +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0020-FROMGIT-soc-amlogic-meson-clk-measure-Make-use-of-th.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0020-FROMGIT-soc-amlogic-meson-clk-measure-Make-use-of-th.patch new file mode 100644 index 0000000000..e780a48305 --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0020-FROMGIT-soc-amlogic-meson-clk-measure-Make-use-of-th.patch @@ -0,0 +1,43 @@ +From 14f405c0277266c8f09203813c93f2eb2d8be1b5 Mon Sep 17 00:00:00 2001 +From: Cai Huoqing +Date: Tue, 14 Sep 2021 15:10:45 +0000 +Subject: [PATCH 20/60] FROMGIT: soc: amlogic: meson-clk-measure: Make use of + the helper function devm_platform_ioremap_resource() + +Use the devm_platform_ioremap_resource() helper instead of +calling platform_get_resource() and devm_ioremap_resource() +separately + +Signed-off-by: Cai Huoqing +Reviewed-by: Neil Armstrong +Signed-off-by: Neil Armstrong +Link: https://lore.kernel.org/r/20210908071544.603-2-caihuoqing@baidu.com +--- + drivers/soc/amlogic/meson-clk-measure.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/drivers/soc/amlogic/meson-clk-measure.c b/drivers/soc/amlogic/meson-clk-measure.c +index 6dd190270123..3f3039600357 100644 +--- a/drivers/soc/amlogic/meson-clk-measure.c ++++ b/drivers/soc/amlogic/meson-clk-measure.c +@@ -606,7 +606,6 @@ static int meson_msr_probe(struct platform_device *pdev) + { + const struct meson_msr_id *match_data; + struct meson_msr *priv; +- struct resource *res; + struct dentry *root, *clks; + void __iomem *base; + int i; +@@ -624,8 +623,7 @@ static int meson_msr_probe(struct platform_device *pdev) + + memcpy(priv->msr_table, match_data, sizeof(priv->msr_table)); + +- res = platform_get_resource(pdev, IORESOURCE_MEM, 0); +- base = devm_ioremap_resource(&pdev->dev, res); ++ base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(base)) + return PTR_ERR(base); + +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0021-FROMGIT-ASoC-meson-implement-driver_name-for-snd_soc.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0021-FROMGIT-ASoC-meson-implement-driver_name-for-snd_soc.patch new file mode 100644 index 0000000000..b28a8891ef --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0021-FROMGIT-ASoC-meson-implement-driver_name-for-snd_soc.patch @@ -0,0 +1,30 @@ +From d74a4ec6a83b29c7706fe072b933b30b76c38b57 Mon Sep 17 00:00:00 2001 +From: Christian Hewitt +Date: Tue, 12 Oct 2021 11:19:54 +0000 +Subject: [PATCH 21/60] FROMGIT: ASoC: meson: implement driver_name for + snd_soc_card in meson-card-utils + +Implement driver_name to provide an alternative to card_name for userspace +configuration of Amlogic audio cards. + +Suggested-by: Matthias Reichl +Signed-off-by: Christian Hewitt +--- + sound/soc/meson/meson-card-utils.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/soc/meson/meson-card-utils.c b/sound/soc/meson/meson-card-utils.c +index 415cc0046e4b..29b0174f4b5c 100644 +--- a/sound/soc/meson/meson-card-utils.c ++++ b/sound/soc/meson/meson-card-utils.c +@@ -302,6 +302,7 @@ int meson_card_probe(struct platform_device *pdev) + + priv->card.owner = THIS_MODULE; + priv->card.dev = dev; ++ priv->card.driver_name = dev->driver->name; + priv->match_data = data; + + ret = snd_soc_of_parse_card_name(&priv->card, "model"); +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0022-FROMGIT-media-v4l2-core-fix-VIDIOC_DQEVENT-handling-.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0022-FROMGIT-media-v4l2-core-fix-VIDIOC_DQEVENT-handling-.patch new file mode 100644 index 0000000000..36cbfd8876 --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0022-FROMGIT-media-v4l2-core-fix-VIDIOC_DQEVENT-handling-.patch @@ -0,0 +1,133 @@ +From e25b25780778b016152db20e138f1944ab55fe19 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Sun, 21 Nov 2021 19:53:25 +0000 +Subject: [PATCH 22/60] FROMGIT: media: v4l2-core: fix VIDIOC_DQEVENT handling + on non-x86 + +My previous bugfix addressed an API inconsistency found by syzbot, +and it correctly fixed the issue on x86-64 machines, which now behave +correctly for both native and compat tasks. + +Unfortunately, John found that the patch broke compat mode on all other +architectures, as they can no longer rely on the VIDIOC_DQEVENT_TIME32 +code from the native handler as a fallback in the compat code. + +The best way I can see for addressing this is to generalize the +VIDIOC_DQEVENT32_TIME32 code from x86 and use that for all architectures, +leaving only the VIDIOC_DQEVENT32 variant as x86 specific. The original +code was trying to be clever and use the same conversion helper for native +32-bit code and compat mode, but that turned out to be too obscure so +even I missed that bit I had introduced myself when I made the fix. + +Fixes: c344f07aa1b4 ("media: v4l2-core: ignore native time32 ioctls on 64-bit") +Reported-by: John Stultz +Signed-off-by: Arnd Bergmann +--- + drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 41 ++++++++----------- + 1 file changed, 17 insertions(+), 24 deletions(-) + +diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c +index 47aff3b19742..80aaf07b16f2 100644 +--- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c ++++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c +@@ -744,10 +744,6 @@ static int put_v4l2_ext_controls32(struct v4l2_ext_controls *p64, + /* + * x86 is the only compat architecture with different struct alignment + * between 32-bit and 64-bit tasks. +- * +- * On all other architectures, v4l2_event32 and v4l2_event32_time32 are +- * the same as v4l2_event and v4l2_event_time32, so we can use the native +- * handlers, converting v4l2_event to v4l2_event_time32 if necessary. + */ + struct v4l2_event32 { + __u32 type; +@@ -765,21 +761,6 @@ struct v4l2_event32 { + __u32 reserved[8]; + }; + +-#ifdef CONFIG_COMPAT_32BIT_TIME +-struct v4l2_event32_time32 { +- __u32 type; +- union { +- compat_s64 value64; +- __u8 data[64]; +- } u; +- __u32 pending; +- __u32 sequence; +- struct old_timespec32 timestamp; +- __u32 id; +- __u32 reserved[8]; +-}; +-#endif +- + static int put_v4l2_event32(struct v4l2_event *p64, + struct v4l2_event32 __user *p32) + { +@@ -795,7 +776,22 @@ static int put_v4l2_event32(struct v4l2_event *p64, + return 0; + } + ++#endif ++ + #ifdef CONFIG_COMPAT_32BIT_TIME ++struct v4l2_event32_time32 { ++ __u32 type; ++ union { ++ compat_s64 value64; ++ __u8 data[64]; ++ } u; ++ __u32 pending; ++ __u32 sequence; ++ struct old_timespec32 timestamp; ++ __u32 id; ++ __u32 reserved[8]; ++}; ++ + static int put_v4l2_event32_time32(struct v4l2_event *p64, + struct v4l2_event32_time32 __user *p32) + { +@@ -811,7 +807,6 @@ static int put_v4l2_event32_time32(struct v4l2_event *p64, + return 0; + } + #endif +-#endif + + struct v4l2_edid32 { + __u32 pad; +@@ -873,9 +868,7 @@ static int put_v4l2_edid32(struct v4l2_edid *p64, + #define VIDIOC_QUERYBUF32_TIME32 _IOWR('V', 9, struct v4l2_buffer32_time32) + #define VIDIOC_QBUF32_TIME32 _IOWR('V', 15, struct v4l2_buffer32_time32) + #define VIDIOC_DQBUF32_TIME32 _IOWR('V', 17, struct v4l2_buffer32_time32) +-#ifdef CONFIG_X86_64 + #define VIDIOC_DQEVENT32_TIME32 _IOR ('V', 89, struct v4l2_event32_time32) +-#endif + #define VIDIOC_PREPARE_BUF32_TIME32 _IOWR('V', 93, struct v4l2_buffer32_time32) + #endif + +@@ -929,10 +922,10 @@ unsigned int v4l2_compat_translate_cmd(unsigned int cmd) + #ifdef CONFIG_X86_64 + case VIDIOC_DQEVENT32: + return VIDIOC_DQEVENT; ++#endif + #ifdef CONFIG_COMPAT_32BIT_TIME + case VIDIOC_DQEVENT32_TIME32: + return VIDIOC_DQEVENT; +-#endif + #endif + } + return cmd; +@@ -1025,10 +1018,10 @@ int v4l2_compat_put_user(void __user *arg, void *parg, unsigned int cmd) + #ifdef CONFIG_X86_64 + case VIDIOC_DQEVENT32: + return put_v4l2_event32(parg, arg); ++#endif + #ifdef CONFIG_COMPAT_32BIT_TIME + case VIDIOC_DQEVENT32_TIME32: + return put_v4l2_event32_time32(parg, arg); +-#endif + #endif + } + return 0; +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0023-FROMLIST-v1-arm64-dts-meson-g12b-odroid-n2-add-5v-re.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0023-FROMLIST-v1-arm64-dts-meson-g12b-odroid-n2-add-5v-re.patch new file mode 100644 index 0000000000..55711531ac --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0023-FROMLIST-v1-arm64-dts-meson-g12b-odroid-n2-add-5v-re.patch @@ -0,0 +1,37 @@ +From 8625017fb7c5f6e6547f075272574125e66e2259 Mon Sep 17 00:00:00 2001 +From: Anand Moon +Date: Wed, 22 Sep 2021 05:55:57 +0000 +Subject: [PATCH 23/60] FROMLIST(v1): arm64: dts: meson-g12b-odroid-n2: add 5v + regulator gpio + +As described in the Odroid-n2 & Odroid-n2-plus schematics, +the 5V regulator is controlled by GPIOH_8 and in Open Drain +since this GPIO doesn't support Push-Pull. + +Fixes: c35f6dc5c377 ("arm64: dts: meson: Add minimal support for Odroid-N2") +Fixes: ef599f5f3e10 ("arm64: dts: meson: convert ODROID-N2 to dtsi") + +Acked-by: Neil Armstrong +Signed-off-by: Anand Moon +Signed-off-by: Neil Armstrong +Link: https://lore.kernel.org/r/20210920204739.950-1-linux.amoon@gmail.com +--- + arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi +index 4f33820aba1f..e8a00a2f8812 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi ++++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi +@@ -99,6 +99,8 @@ + regulator-max-microvolt = <5000000>; + regulator-always-on; + vin-supply = <&main_12v>; ++ gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>; ++ enable-active-high; + }; + + vcc_1v8: regulator-vcc_1v8 { +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0024-FROMLIST-v1-hwrng-meson-Improve-error-handling-for-c.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0024-FROMLIST-v1-hwrng-meson-Improve-error-handling-for-c.patch new file mode 100644 index 0000000000..c7e32dc8d4 --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0024-FROMLIST-v1-hwrng-meson-Improve-error-handling-for-c.patch @@ -0,0 +1,42 @@ +From 557ca56ff23234e2cd8fce4d3aa1c752bedded9e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= +Date: Mon, 20 Sep 2021 09:44:05 +0200 +Subject: [PATCH 24/60] FROMLIST(v1): hwrng: meson - Improve error handling for + core clock +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +-ENOENT (ie. "there is no clock") is fine to ignore for an optional +clock, other values are not supposed to be ignored and should be +escalated to the caller (e.g. -EPROBE_DEFER). Ignore -ENOENT by using +devm_clk_get_optional(). + +While touching this code also add an error message for the fatal errors. + +Signed-off-by: Uwe Kleine-König +Reviewed-by: Neil Armstrong +--- + drivers/char/hw_random/meson-rng.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/char/hw_random/meson-rng.c b/drivers/char/hw_random/meson-rng.c +index e446236e81f2..8bb30282ca46 100644 +--- a/drivers/char/hw_random/meson-rng.c ++++ b/drivers/char/hw_random/meson-rng.c +@@ -54,9 +54,10 @@ static int meson_rng_probe(struct platform_device *pdev) + if (IS_ERR(data->base)) + return PTR_ERR(data->base); + +- data->core_clk = devm_clk_get(dev, "core"); ++ data->core_clk = devm_clk_get_optional(dev, "core"); + if (IS_ERR(data->core_clk)) +- data->core_clk = NULL; ++ return dev_err_probe(dev, PTR_ERR(data->core_clk), ++ "Failed to get core clock\n"); + + if (data->core_clk) { + ret = clk_prepare_enable(data->core_clk); +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0025-FROMLIST-v2-clk-meson-gxbb-Fix-the-SDM_EN-bit-for-MP.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0025-FROMLIST-v2-clk-meson-gxbb-Fix-the-SDM_EN-bit-for-MP.patch new file mode 100644 index 0000000000..9c860224c4 --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0025-FROMLIST-v2-clk-meson-gxbb-Fix-the-SDM_EN-bit-for-MP.patch @@ -0,0 +1,141 @@ +From 1918f1f5e7e8ddefa517d945b7dac6cdc73ef17d Mon Sep 17 00:00:00 2001 +From: Martin Blumenstingl +Date: Sat, 16 Oct 2021 13:45:35 +0000 +Subject: [PATCH 25/60] FROMLIST(v2): clk: meson: gxbb: Fix the SDM_EN bit for + MPLL0 on GXBB + +There are reports that 48kHz audio does not work on his WeTek Play 2 +(which uses a GXBB SoC), while 44.1kHz audio works fine on the same +board. There are also reports of 48kHz audio working fine on GXL and +GXM SoCs, which are using an (almost) identical AIU (audio controller). + +Experimenting has shown that MPLL0 is causing this problem. In the .dts +we have by default: + + assigned-clocks = <&clkc CLKID_MPLL0>, + <&clkc CLKID_MPLL1>, + <&clkc CLKID_MPLL2>; + assigned-clock-rates = <294912000>, + <270950400>, + <393216000>; + +The MPLL0 rate is divisible by 48kHz without remainder and the MPLL1 +rate is divisible by 44.1kHz without remainder. Swapping these two clock +rates "fixes" 48kHz audio but breaks 44.1kHz audio. + +Everything looks normal when looking at the info provided by the common +clock framework while playing 48kHz audio (via I2S with mclk-fs = 256): + mpll_prediv 1 1 0 2000000000 + mpll0_div 1 1 0 294909641 + mpll0 1 1 0 294909641 + cts_amclk_sel 1 1 0 294909641 + cts_amclk_div 1 1 0 12287902 + cts_amclk 1 1 0 12287902 + +meson-clk-msr however shows that the actual MPLL0 clock is off by more +than 38MHz: + mp0_out 333322917 +/-10416Hz + +The rate seen by meson-clk-msr is very close to what we would get when +SDM (the fractional part) was ignored: + + (2000000000Hz * 16384) / ((16384 * 6) = 333.33MHz +If SDM was considered the we should get close to: + (2000000000Hz * 16384) / ((16384 * 6) + 12808) = 294.9MHz + +Further experimenting shows that HHI_MPLL_CNTL7[15] does not have any +effect on the rate of MPLL0 as seen my meson-clk-msr (regardless of +whether that bit is zero or one the rate is always the same according to +meson-clk-msr). Using HHI_MPLL_CNTL[25] on the other hand as SDM_EN +results in SDM being considered for the rate output by the hardware. The +rate - as seen by meson-clk-msr - matches with what we expect when +SDM_EN is enabled (fractional part is being considered, resulting in a +294.9MHz output) or disable (fractional part being ignored, resulting in +a 333.33MHz output). + +Reported-by: Christian Hewitt +Suggested-by: Jerome Brunet +Signed-off-by: Martin Blumenstingl +--- + drivers/clk/meson/gxbb.c | 44 +++++++++++++++++++++++++++++++++++++--- + 1 file changed, 41 insertions(+), 3 deletions(-) + +diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c +index d6eed760327d..608e0e8ca49a 100644 +--- a/drivers/clk/meson/gxbb.c ++++ b/drivers/clk/meson/gxbb.c +@@ -713,6 +713,35 @@ static struct clk_regmap gxbb_mpll_prediv = { + }; + + static struct clk_regmap gxbb_mpll0_div = { ++ .data = &(struct meson_clk_mpll_data){ ++ .sdm = { ++ .reg_off = HHI_MPLL_CNTL7, ++ .shift = 0, ++ .width = 14, ++ }, ++ .sdm_en = { ++ .reg_off = HHI_MPLL_CNTL, ++ .shift = 25, ++ .width = 1, ++ }, ++ .n2 = { ++ .reg_off = HHI_MPLL_CNTL7, ++ .shift = 16, ++ .width = 9, ++ }, ++ .lock = &meson_clk_lock, ++ }, ++ .hw.init = &(struct clk_init_data){ ++ .name = "mpll0_div", ++ .ops = &meson_clk_mpll_ops, ++ .parent_hws = (const struct clk_hw *[]) { ++ &gxbb_mpll_prediv.hw ++ }, ++ .num_parents = 1, ++ }, ++}; ++ ++static struct clk_regmap gxl_mpll0_div = { + .data = &(struct meson_clk_mpll_data){ + .sdm = { + .reg_off = HHI_MPLL_CNTL7, +@@ -749,7 +778,16 @@ static struct clk_regmap gxbb_mpll0 = { + .hw.init = &(struct clk_init_data){ + .name = "mpll0", + .ops = &clk_regmap_gate_ops, +- .parent_hws = (const struct clk_hw *[]) { &gxbb_mpll0_div.hw }, ++ .parent_data = &(const struct clk_parent_data) { ++ /* ++ * Note: ++ * GXL and GXBB have different SDM_EN registers. We ++ * fallback to the global naming string mechanism so ++ * mpll0_div picks up the appropriate one. ++ */ ++ .name = "mpll0_div", ++ .index = -1, ++ }, + .num_parents = 1, + .flags = CLK_SET_RATE_PARENT, + }, +@@ -3044,7 +3082,7 @@ static struct clk_hw_onecell_data gxl_hw_onecell_data = { + [CLKID_VAPB_1] = &gxbb_vapb_1.hw, + [CLKID_VAPB_SEL] = &gxbb_vapb_sel.hw, + [CLKID_VAPB] = &gxbb_vapb.hw, +- [CLKID_MPLL0_DIV] = &gxbb_mpll0_div.hw, ++ [CLKID_MPLL0_DIV] = &gxl_mpll0_div.hw, + [CLKID_MPLL1_DIV] = &gxbb_mpll1_div.hw, + [CLKID_MPLL2_DIV] = &gxbb_mpll2_div.hw, + [CLKID_MPLL_PREDIV] = &gxbb_mpll_prediv.hw, +@@ -3439,7 +3477,7 @@ static struct clk_regmap *const gxl_clk_regmaps[] = { + &gxbb_mpll0, + &gxbb_mpll1, + &gxbb_mpll2, +- &gxbb_mpll0_div, ++ &gxl_mpll0_div, + &gxbb_mpll1_div, + &gxbb_mpll2_div, + &gxbb_cts_amclk_div, +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0026-FROMLIST-RFCv1-ASoC-meson-aiu-Fix-HDMI-codec-control.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0026-FROMLIST-RFCv1-ASoC-meson-aiu-Fix-HDMI-codec-control.patch new file mode 100644 index 0000000000..afa55d5baf --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0026-FROMLIST-RFCv1-ASoC-meson-aiu-Fix-HDMI-codec-control.patch @@ -0,0 +1,233 @@ +From 672fdfb31b8d41b0bc70ef8a42b917d566141fb4 Mon Sep 17 00:00:00 2001 +From: Martin Blumenstingl +Date: Sun, 3 Oct 2021 05:35:48 +0000 +Subject: [PATCH 26/60] FROMLIST(RFCv1): ASoC: meson: aiu: Fix HDMI codec + control selection + +The HDMI controllers on Amlogic Meson SoCs which use the AIU +audio-controller have two different audio format inputs: +- I2S which is also the only configuration supported on GXBB, GXL and + GXM SoCs since there's no SPDIF support in the DesignWare HDMI + controller driver (at the time of writing this) +- SPDIF can be used optionally, including pass-through formats + +Switching between these requires us to set different registers: +AIU_HDMI_CLK_DATA_CTRL[1:0] "HDMI_DATA_CLK_SEL": +- 0x0 disables the HDMI output clock +- 0x1 selects the PCM clock +- 0x2 selects the AIU clock +- 0x3 is reserved + +AIU_HDMI_CLK_DATA_CTRL[5:4] "HDMI_DATA_SEL": +- 0x0 outputs constant zero, disables HDMI data +- 0x1 selects PCM data +- 0x2 selects AIU I2S data +- 0x3 is reserved + +AIU_CLK_CTRL_MORE[6] "HDMITX_SEL_AOCLKX2": +- 0x0 selects cts_i958 as AIU clk to hdmi_tx_audio_master_clk +- 0x1 selects cts_aoclkx2_int as AIU clk to hdmi_tx_audio_master_clk + +The Meson8/8b/8m2 vendor driver uses the following settings: +SPDIF output to the HDMI controller: +- 0x2 (AIU clock) in AIU_HDMI_CLK_DATA_CTRL[1:0] +- 0x0 (no HDMI data) in AIU_HDMI_CLK_DATA_CTRL[5:4] +- 0x0 (using cts_i958 as AIU clk) in AIU_CLK_CTRL_MORE[6] +I2S output to the HDMI controller: +- 0x2 (AIU clock) in AIU_HDMI_CLK_DATA_CTRL[1:0] +- 0x2 (I2S data) in AIU_HDMI_CLK_DATA_CTRL[5:4] +- 0x0 (using cts_aoclkx2_int as AIU clk) in AIU_CLK_CTRL_MORE[6] + +The GXBB/GXL/GXM vendor driver uses the following settings: +SPDIF output to the HDMI controller: +- not setting AIU_HDMI_CLK_DATA_CTRL at all +- 0x0 (using cts_i958 as AIU clk) in AIU_CLK_CTRL_MORE[6] +I2S output to the HDMI controller: +- 0x2 (AIU clock) in AIU_HDMI_CLK_DATA_CTRL[1:0] +- 0x2 (I2S data) in AIU_HDMI_CLK_DATA_CTRL[5:4] +- 0x0 (using cts_aoclkx2_int as AIU clk) in AIU_CLK_CTRL_MORE[6] + +Set the three registers at the same time following what the vendor +driver does on Meson8/8b/8m2 SoCs. This makes the SPDIF output to the +HDMI controller work. The entries and order of the entries in the enum +is not changed on purpose to not break old configurations. + +Fixes: b82b734c0e9a7 ("ASoC: meson: aiu: add hdmi codec control support") +Signed-off-by: Martin Blumenstingl +--- + sound/soc/meson/aiu-codec-ctrl.c | 108 ++++++++++++++++++++++-------- + sound/soc/meson/aiu-encoder-i2s.c | 6 -- + 2 files changed, 80 insertions(+), 34 deletions(-) + +diff --git a/sound/soc/meson/aiu-codec-ctrl.c b/sound/soc/meson/aiu-codec-ctrl.c +index c3ea733fce91..2b8575491aeb 100644 +--- a/sound/soc/meson/aiu-codec-ctrl.c ++++ b/sound/soc/meson/aiu-codec-ctrl.c +@@ -12,14 +12,60 @@ + #include "aiu.h" + #include "meson-codec-glue.h" + +-#define CTRL_CLK_SEL GENMASK(1, 0) +-#define CTRL_DATA_SEL_SHIFT 4 +-#define CTRL_DATA_SEL (0x3 << CTRL_DATA_SEL_SHIFT) +- +-static const char * const aiu_codec_ctrl_mux_texts[] = { +- "DISABLED", "PCM", "I2S", ++#define AIU_HDMI_CLK_DATA_CTRL_CLK_SEL GENMASK(1, 0) ++#define AIU_HDMI_CLK_DATA_CTRL_CLK_SEL_DISABLE 0x0 ++#define AIU_HDMI_CLK_DATA_CTRL_CLK_SEL_PCM 0x1 ++#define AIU_HDMI_CLK_DATA_CTRL_CLK_SEL_AIU 0x2 ++#define AIU_HDMI_CLK_DATA_CTRL_DATA_SEL GENMASK(5, 4) ++#define AIU_HDMI_CLK_DATA_CTRL_DATA_SEL_OUTPUT_ZERO 0x0 ++#define AIU_HDMI_CLK_DATA_CTRL_DATA_SEL_PCM_DATA 0x1 ++#define AIU_HDMI_CLK_DATA_CTRL_DATA_SEL_I2S_DATA 0x2 ++ ++#define AIU_CLK_CTRL_MORE_AMCLK BIT(6) ++ ++#define AIU_HDMI_CTRL_MUX_DISABLED 0 ++#define AIU_HDMI_CTRL_MUX_PCM 1 ++#define AIU_HDMI_CTRL_MUX_I2S 2 ++ ++static const char * const aiu_codec_hdmi_ctrl_mux_texts[] = { ++ [AIU_HDMI_CTRL_MUX_DISABLED] = "DISABLED", ++ [AIU_HDMI_CTRL_MUX_PCM] = "PCM", ++ [AIU_HDMI_CTRL_MUX_I2S] = "I2S", + }; + ++static int aiu_codec_ctrl_mux_get_enum(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct snd_soc_component *component = ++ snd_soc_dapm_kcontrol_component(kcontrol); ++ unsigned int ctrl, more, mux = AIU_HDMI_CTRL_MUX_DISABLED; ++ ++ ctrl = snd_soc_component_read(component, AIU_HDMI_CLK_DATA_CTRL); ++ if (FIELD_GET(AIU_HDMI_CLK_DATA_CTRL_CLK_SEL, ctrl) != ++ AIU_HDMI_CLK_DATA_CTRL_CLK_SEL_AIU) { ++ goto out; ++ } ++ ++ more = snd_soc_component_read(component, AIU_CLK_CTRL_MORE); ++ if (FIELD_GET(AIU_HDMI_CLK_DATA_CTRL_DATA_SEL, ctrl) == ++ AIU_HDMI_CLK_DATA_CTRL_DATA_SEL_I2S_DATA && ++ !!(more & AIU_CLK_CTRL_MORE_AMCLK)) { ++ mux = AIU_HDMI_CTRL_MUX_I2S; ++ goto out; ++ } ++ ++ if (FIELD_GET(AIU_HDMI_CLK_DATA_CTRL_DATA_SEL, ctrl) == ++ AIU_HDMI_CLK_DATA_CTRL_DATA_SEL_OUTPUT_ZERO && ++ !(more & AIU_CLK_CTRL_MORE_AMCLK)) { ++ mux = AIU_HDMI_CTRL_MUX_PCM; ++ goto out; ++ } ++ ++out: ++ ucontrol->value.enumerated.item[0] = mux; ++ return 0; ++} ++ + static int aiu_codec_ctrl_mux_put_enum(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) + { +@@ -28,45 +74,51 @@ static int aiu_codec_ctrl_mux_put_enum(struct snd_kcontrol *kcontrol, + struct snd_soc_dapm_context *dapm = + snd_soc_dapm_kcontrol_dapm(kcontrol); + struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; +- unsigned int mux, changed; ++ unsigned int mux, ctrl, more; + + mux = snd_soc_enum_item_to_val(e, ucontrol->value.enumerated.item[0]); +- changed = snd_soc_component_test_bits(component, e->reg, +- CTRL_DATA_SEL, +- FIELD_PREP(CTRL_DATA_SEL, mux)); + +- if (!changed) +- return 0; ++ if (mux == AIU_HDMI_CTRL_MUX_I2S) { ++ ctrl = FIELD_PREP(AIU_HDMI_CLK_DATA_CTRL_DATA_SEL, ++ AIU_HDMI_CLK_DATA_CTRL_DATA_SEL_I2S_DATA); ++ more = AIU_CLK_CTRL_MORE_AMCLK; ++ } else { ++ ctrl = FIELD_PREP(AIU_HDMI_CLK_DATA_CTRL_DATA_SEL, ++ AIU_HDMI_CLK_DATA_CTRL_DATA_SEL_OUTPUT_ZERO); ++ more = 0; ++ } ++ ++ if (mux == AIU_HDMI_CTRL_MUX_DISABLED) { ++ ctrl |= FIELD_PREP(AIU_HDMI_CLK_DATA_CTRL_CLK_SEL, ++ AIU_HDMI_CLK_DATA_CTRL_CLK_SEL_DISABLE); ++ } else { ++ ctrl |= FIELD_PREP(AIU_HDMI_CLK_DATA_CTRL_CLK_SEL, ++ AIU_HDMI_CLK_DATA_CTRL_CLK_SEL_AIU); ++ } + + /* Force disconnect of the mux while updating */ + snd_soc_dapm_mux_update_power(dapm, kcontrol, 0, NULL, NULL); + +- /* Reset the source first */ +- snd_soc_component_update_bits(component, e->reg, +- CTRL_CLK_SEL | +- CTRL_DATA_SEL, +- FIELD_PREP(CTRL_CLK_SEL, 0) | +- FIELD_PREP(CTRL_DATA_SEL, 0)); ++ snd_soc_component_update_bits(component, AIU_HDMI_CLK_DATA_CTRL, ++ AIU_HDMI_CLK_DATA_CTRL_CLK_SEL | ++ AIU_HDMI_CLK_DATA_CTRL_DATA_SEL, ++ ctrl); + +- /* Set the appropriate source */ +- snd_soc_component_update_bits(component, e->reg, +- CTRL_CLK_SEL | +- CTRL_DATA_SEL, +- FIELD_PREP(CTRL_CLK_SEL, mux) | +- FIELD_PREP(CTRL_DATA_SEL, mux)); ++ snd_soc_component_update_bits(component, AIU_CLK_CTRL_MORE, ++ AIU_CLK_CTRL_MORE_AMCLK, ++ more); + + snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL); + + return 0; + } + +-static SOC_ENUM_SINGLE_DECL(aiu_hdmi_ctrl_mux_enum, AIU_HDMI_CLK_DATA_CTRL, +- CTRL_DATA_SEL_SHIFT, +- aiu_codec_ctrl_mux_texts); ++static SOC_ENUM_SINGLE_VIRT_DECL(aiu_hdmi_ctrl_mux_enum, ++ aiu_codec_hdmi_ctrl_mux_texts); + + static const struct snd_kcontrol_new aiu_hdmi_ctrl_mux = + SOC_DAPM_ENUM_EXT("HDMI Source", aiu_hdmi_ctrl_mux_enum, +- snd_soc_dapm_get_enum_double, ++ aiu_codec_ctrl_mux_get_enum, + aiu_codec_ctrl_mux_put_enum); + + static const struct snd_soc_dapm_widget aiu_hdmi_ctrl_widgets[] = { +diff --git a/sound/soc/meson/aiu-encoder-i2s.c b/sound/soc/meson/aiu-encoder-i2s.c +index 932224552146..f8378066d448 100644 +--- a/sound/soc/meson/aiu-encoder-i2s.c ++++ b/sound/soc/meson/aiu-encoder-i2s.c +@@ -24,7 +24,6 @@ + #define AIU_CLK_CTRL_AOCLK_INVERT BIT(6) + #define AIU_CLK_CTRL_LRCLK_INVERT BIT(7) + #define AIU_CLK_CTRL_LRCLK_SKEW GENMASK(9, 8) +-#define AIU_CLK_CTRL_MORE_HDMI_AMCLK BIT(6) + #define AIU_CLK_CTRL_MORE_I2S_DIV GENMASK(5, 0) + #define AIU_CODEC_DAC_LRCLK_CTRL_DIV GENMASK(11, 0) + +@@ -208,11 +207,6 @@ static int aiu_encoder_i2s_set_clocks(struct snd_soc_component *component, + if (ret) + return ret; + +- /* Make sure amclk is used for HDMI i2s as well */ +- snd_soc_component_update_bits(component, AIU_CLK_CTRL_MORE, +- AIU_CLK_CTRL_MORE_HDMI_AMCLK, +- AIU_CLK_CTRL_MORE_HDMI_AMCLK); +- + return 0; + } + +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0027-FROMLIST-v1-ASoC-meson-axg-card-make-links-nonatomic.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0027-FROMLIST-v1-ASoC-meson-axg-card-make-links-nonatomic.patch new file mode 100644 index 0000000000..995e3cdf22 --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0027-FROMLIST-v1-ASoC-meson-axg-card-make-links-nonatomic.patch @@ -0,0 +1,31 @@ +From 30c6fc86c9027949f04928cc5e7fb2b5bfcf721a Mon Sep 17 00:00:00 2001 +From: Jerome Brunet +Date: Wed, 20 Oct 2021 20:03:05 +0000 +Subject: [PATCH 27/60] FROMLIST(v1): ASoC: meson: axg-card: make links + nonatomic + +Non atomic operations need to be performed in the trigger callback +of the TDM interfaces. Those are BEs but what matters is the nonatomic +flag of the FE in the DPCM context. Just set nonatomic for everything so, +at least, it is clear. + +Signed-off-by: Jerome Brunet +--- + sound/soc/meson/axg-card.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/soc/meson/axg-card.c b/sound/soc/meson/axg-card.c +index 2b77010c2c5c..cbbaa55d92a6 100644 +--- a/sound/soc/meson/axg-card.c ++++ b/sound/soc/meson/axg-card.c +@@ -320,6 +320,7 @@ static int axg_card_add_link(struct snd_soc_card *card, struct device_node *np, + + dai_link->cpus = cpu; + dai_link->num_cpus = 1; ++ dai_link->nonatomic = true; + + ret = meson_card_parse_dai(card, np, &dai_link->cpus->of_node, + &dai_link->cpus->dai_name); +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0028-FROMLIST-v1-ASoC-meson-axg-tdm-interface-manage-form.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0028-FROMLIST-v1-ASoC-meson-axg-tdm-interface-manage-form.patch new file mode 100644 index 0000000000..a960fd0d26 --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0028-FROMLIST-v1-ASoC-meson-axg-tdm-interface-manage-form.patch @@ -0,0 +1,77 @@ +From 17c65fae4e17678468e7eb0c6107914adad7852f Mon Sep 17 00:00:00 2001 +From: Jerome Brunet +Date: Wed, 20 Oct 2021 20:03:57 +0000 +Subject: [PATCH 28/60] FROMLIST(v1): ASoC: meson: axg-tdm-interface: manage + formatters in trigger + +So far, the formatters have been reset/enabled using the .prepare() +callback. This was done in this callback because walking the formatters use +a mutex so it could not be done in .trigger(), which is atomic by default. + +It turns out there is a problem on capture path of the AXG series. +The FIFO may get out of sync with the TDM decoder if the IP are not enabled +in a specific order. The FIFO must be enabled before the formatter starts +producing data. IOW, we must deal with FE before the BE. The .prepare() +callback is called on the BEs before the FE so it is not OK for the AXG. + +The .trigger() callback order can be configured, and it deals with the FE +before the BEs by default. To solve our problem, we just need to start and +stop the formatters from the .trigger() callback. It is OK do so now that +the links have been made 'nonatomic' in the card driver. + +Signed-off-by: Jerome Brunet +--- + sound/soc/meson/axg-tdm-interface.c | 26 +++++++++++++++++++++----- + 1 file changed, 21 insertions(+), 5 deletions(-) + +diff --git a/sound/soc/meson/axg-tdm-interface.c b/sound/soc/meson/axg-tdm-interface.c +index 87cac440b369..db077773af7a 100644 +--- a/sound/soc/meson/axg-tdm-interface.c ++++ b/sound/soc/meson/axg-tdm-interface.c +@@ -351,13 +351,29 @@ static int axg_tdm_iface_hw_free(struct snd_pcm_substream *substream, + return 0; + } + +-static int axg_tdm_iface_prepare(struct snd_pcm_substream *substream, ++static int axg_tdm_iface_trigger(struct snd_pcm_substream *substream, ++ int cmd, + struct snd_soc_dai *dai) + { +- struct axg_tdm_stream *ts = snd_soc_dai_get_dma_data(dai, substream); ++ struct axg_tdm_stream *ts = ++ snd_soc_dai_get_dma_data(dai, substream); ++ ++ switch (cmd) { ++ case SNDRV_PCM_TRIGGER_START: ++ case SNDRV_PCM_TRIGGER_RESUME: ++ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: ++ axg_tdm_stream_start(ts); ++ break; ++ case SNDRV_PCM_TRIGGER_SUSPEND: ++ case SNDRV_PCM_TRIGGER_PAUSE_PUSH: ++ case SNDRV_PCM_TRIGGER_STOP: ++ axg_tdm_stream_stop(ts); ++ break; ++ default: ++ return -EINVAL; ++ } + +- /* Force all attached formatters to update */ +- return axg_tdm_stream_reset(ts); ++ return 0; + } + + static int axg_tdm_iface_remove_dai(struct snd_soc_dai *dai) +@@ -397,8 +413,8 @@ static const struct snd_soc_dai_ops axg_tdm_iface_ops = { + .set_fmt = axg_tdm_iface_set_fmt, + .startup = axg_tdm_iface_startup, + .hw_params = axg_tdm_iface_hw_params, +- .prepare = axg_tdm_iface_prepare, + .hw_free = axg_tdm_iface_hw_free, ++ .trigger = axg_tdm_iface_trigger, + }; + + /* TDM Backend DAIs */ +-- +2.17.1 + diff --git a/projects/Amlogic/patches/linux/amlogic-0067-WIP-mmc-meson-gx-mmc-set-core-clock-phase-to-270-deg.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0029-WIP-mmc-meson-gx-mmc-set-core-clock-phase-to-270-deg.patch similarity index 83% rename from projects/Amlogic/patches/linux/amlogic-0067-WIP-mmc-meson-gx-mmc-set-core-clock-phase-to-270-deg.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0029-WIP-mmc-meson-gx-mmc-set-core-clock-phase-to-270-deg.patch index 61250829e5..b33bb88b7a 100644 --- a/projects/Amlogic/patches/linux/amlogic-0067-WIP-mmc-meson-gx-mmc-set-core-clock-phase-to-270-deg.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0029-WIP-mmc-meson-gx-mmc-set-core-clock-phase-to-270-deg.patch @@ -1,7 +1,7 @@ -From 54b8e155e8fdb914751f1d8ed53f9edd66470008 Mon Sep 17 00:00:00 2001 +From 87f2074b73cf0d82a3cc77e0cba3761ea893b6b6 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Thu, 14 Jan 2021 17:43:02 +0100 -Subject: [PATCH 67/88] WIP: mmc: meson-gx-mmc: set core clock phase to 270 +Subject: [PATCH 29/60] WIP: mmc: meson-gx-mmc: set core clock phase to 270 degres for AXG compatible controllers Signed-off-by: Neil Armstrong @@ -10,7 +10,7 @@ Signed-off-by: Neil Armstrong 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c -index 13f6a2c0ed04..073d5bf41aef 100644 +index 8f36536cb1b6..a7cd96aefa8c 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -38,6 +38,7 @@ @@ -29,7 +29,7 @@ index 13f6a2c0ed04..073d5bf41aef 100644 }; struct sd_emmc_desc { -@@ -414,7 +416,7 @@ static int meson_mmc_clk_init(struct meson_host *host) +@@ -426,7 +428,7 @@ static int meson_mmc_clk_init(struct meson_host *host) /* init SD_EMMC_CLOCK to sane defaults w/min clock rate */ clk_reg = CLK_ALWAYS_ON(host); clk_reg |= CLK_DIV_MASK; @@ -38,7 +38,7 @@ index 13f6a2c0ed04..073d5bf41aef 100644 clk_reg |= FIELD_PREP(CLK_TX_PHASE_MASK, CLK_PHASE_0); clk_reg |= FIELD_PREP(CLK_RX_PHASE_MASK, CLK_PHASE_0); writel(clk_reg, host->regs + SD_EMMC_CLOCK); -@@ -1240,6 +1242,7 @@ static const struct meson_mmc_data meson_gx_data = { +@@ -1336,6 +1338,7 @@ static const struct meson_mmc_data meson_gx_data = { .rx_delay_mask = CLK_V2_RX_DELAY_MASK, .always_on = CLK_V2_ALWAYS_ON, .adjust = SD_EMMC_ADJUST, @@ -46,7 +46,7 @@ index 13f6a2c0ed04..073d5bf41aef 100644 }; static const struct meson_mmc_data meson_axg_data = { -@@ -1247,6 +1250,7 @@ static const struct meson_mmc_data meson_axg_data = { +@@ -1343,6 +1346,7 @@ static const struct meson_mmc_data meson_axg_data = { .rx_delay_mask = CLK_V3_RX_DELAY_MASK, .always_on = CLK_V3_ALWAYS_ON, .adjust = SD_EMMC_V3_ADJUST, diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0030-WIP-drivers-meson-vdec-remove-redundant-if-statement.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0030-WIP-drivers-meson-vdec-remove-redundant-if-statement.patch new file mode 100644 index 0000000000..41c23b6fca --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0030-WIP-drivers-meson-vdec-remove-redundant-if-statement.patch @@ -0,0 +1,29 @@ +From 8009e7c2cdf4f88da111c80c84b7d71f37527c6c Mon Sep 17 00:00:00 2001 +From: benjamin545 +Date: Thu, 15 Jul 2021 14:32:33 -0400 +Subject: [PATCH 30/60] WIP: drivers: meson: vdec: remove redundant if + statement + +checking if sess->fmt_out->pixfmt is V4L2_PIX_FMT_VP9 was already done +as a condition to enter the if statement where this additional check is performed +--- + drivers/staging/media/meson/vdec/esparser.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/staging/media/meson/vdec/esparser.c b/drivers/staging/media/meson/vdec/esparser.c +index db7022707ff8..e18334e57fc0 100644 +--- a/drivers/staging/media/meson/vdec/esparser.c ++++ b/drivers/staging/media/meson/vdec/esparser.c +@@ -314,8 +314,7 @@ esparser_queue(struct amvdec_session *sess, struct vb2_v4l2_buffer *vbuf) + num_dst_bufs = codec_ops->num_pending_bufs(sess); + + num_dst_bufs += v4l2_m2m_num_dst_bufs_ready(sess->m2m_ctx); +- if (sess->fmt_out->pixfmt == V4L2_PIX_FMT_VP9) +- num_dst_bufs -= 3; ++ num_dst_bufs -= 3; + + if (esparser_vififo_get_free_space(sess) < payload_size || + atomic_read(&sess->esparser_queued_bufs) >= num_dst_bufs) +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0031-WIP-drivers-meson-vdec-improve-mmu-and-fbc-handling-.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0031-WIP-drivers-meson-vdec-improve-mmu-and-fbc-handling-.patch new file mode 100644 index 0000000000..8770665acd --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0031-WIP-drivers-meson-vdec-improve-mmu-and-fbc-handling-.patch @@ -0,0 +1,586 @@ +From 1de7b27fc9e3a46e2e2566c0b5435e1acd050d32 Mon Sep 17 00:00:00 2001 +From: benjamin545 +Date: Thu, 15 Jul 2021 16:32:39 -0400 +Subject: [PATCH 31/60] WIP: drivers: meson: vdec: improve mmu and fbc handling + and add 10 bit handling + +--- + drivers/staging/media/meson/vdec/codec_h264.c | 3 +- + .../media/meson/vdec/codec_hevc_common.c | 164 +++++++++++------- + .../media/meson/vdec/codec_hevc_common.h | 3 +- + drivers/staging/media/meson/vdec/codec_vp9.c | 36 ++-- + drivers/staging/media/meson/vdec/esparser.c | 1 + + drivers/staging/media/meson/vdec/vdec.h | 1 + + .../staging/media/meson/vdec/vdec_helpers.c | 46 +++-- + .../staging/media/meson/vdec/vdec_helpers.h | 10 +- + 8 files changed, 163 insertions(+), 101 deletions(-) + +diff --git a/drivers/staging/media/meson/vdec/codec_h264.c b/drivers/staging/media/meson/vdec/codec_h264.c +index c61128fc4bb9..d53c9a464bde 100644 +--- a/drivers/staging/media/meson/vdec/codec_h264.c ++++ b/drivers/staging/media/meson/vdec/codec_h264.c +@@ -353,7 +353,8 @@ static void codec_h264_src_change(struct amvdec_session *sess) + frame_width, frame_height, crop_right, crop_bottom); + + codec_h264_set_par(sess); +- amvdec_src_change(sess, frame_width, frame_height, h264->max_refs + 5); ++ amvdec_src_change(sess, frame_width, frame_height, ++ h264->max_refs + 5, 8); + } + + /* +diff --git a/drivers/staging/media/meson/vdec/codec_hevc_common.c b/drivers/staging/media/meson/vdec/codec_hevc_common.c +index 0315cc0911cd..d6ed82dc93ca 100644 +--- a/drivers/staging/media/meson/vdec/codec_hevc_common.c ++++ b/drivers/staging/media/meson/vdec/codec_hevc_common.c +@@ -30,8 +30,11 @@ const u16 vdec_hevc_parser_cmd[] = { + void codec_hevc_setup_decode_head(struct amvdec_session *sess, int is_10bit) + { + struct amvdec_core *core = sess->core; +- u32 body_size = amvdec_am21c_body_size(sess->width, sess->height); +- u32 head_size = amvdec_am21c_head_size(sess->width, sess->height); ++ u32 use_mmu = codec_hevc_use_mmu(core->platform->revision, ++ sess->pixfmt_cap, is_10bit); ++ u32 body_size = amvdec_amfbc_body_size(sess->width, sess->height, ++ is_10bit, use_mmu); ++ u32 head_size = amvdec_amfbc_head_size(sess->width, sess->height); + + if (!codec_hevc_use_fbc(sess->pixfmt_cap, is_10bit)) { + /* Enable 2-plane reference read mode */ +@@ -39,9 +42,17 @@ void codec_hevc_setup_decode_head(struct amvdec_session *sess, int is_10bit) + return; + } + ++ /* enable mem saving mode for 8-bit */ ++ if (!is_10bit) ++ amvdec_write_dos_bits(core, HEVC_SAO_CTRL5, BIT(9)); ++ else ++ amvdec_clear_dos_bits(core, HEVC_SAO_CTRL5, BIT(9)); ++ + if (codec_hevc_use_mmu(core->platform->revision, + sess->pixfmt_cap, is_10bit)) + amvdec_write_dos(core, HEVCD_MPP_DECOMP_CTL1, BIT(4)); ++ else if (!is_10bit) ++ amvdec_write_dos(core, HEVCD_MPP_DECOMP_CTL1, BIT(3)); + else + amvdec_write_dos(core, HEVCD_MPP_DECOMP_CTL1, 0); + +@@ -73,7 +84,7 @@ static void codec_hevc_setup_buffers_gxbb(struct amvdec_session *sess, + + idx = vb->index; + +- if (codec_hevc_use_downsample(sess->pixfmt_cap, is_10bit)) ++ if (codec_hevc_use_fbc(sess->pixfmt_cap, is_10bit)) + buf_y_paddr = comm->fbc_buffer_paddr[idx]; + else + buf_y_paddr = vb2_dma_contig_plane_dma_addr(vb, 0); +@@ -114,8 +125,8 @@ static void codec_hevc_setup_buffers_gxl(struct amvdec_session *sess, + { + struct amvdec_core *core = sess->core; + struct v4l2_m2m_buffer *buf; +- u32 revision = core->platform->revision; + u32 pixfmt_cap = sess->pixfmt_cap; ++ const u32 revision = core->platform->revision; + int i; + + amvdec_write_dos(core, HEVCD_MPP_ANC2AXI_TBL_CONF_ADDR, +@@ -127,12 +138,14 @@ static void codec_hevc_setup_buffers_gxl(struct amvdec_session *sess, + dma_addr_t buf_uv_paddr = 0; + u32 idx = vb->index; + +- if (codec_hevc_use_mmu(revision, pixfmt_cap, is_10bit)) +- buf_y_paddr = comm->mmu_header_paddr[idx]; +- else if (codec_hevc_use_downsample(pixfmt_cap, is_10bit)) +- buf_y_paddr = comm->fbc_buffer_paddr[idx]; +- else +- buf_y_paddr = vb2_dma_contig_plane_dma_addr(vb, 0); ++ if (codec_hevc_use_downsample(pixfmt_cap, is_10bit)) { ++ if (codec_hevc_use_mmu(revision, pixfmt_cap, is_10bit)) ++ buf_y_paddr = comm->mmu_header_paddr[idx]; ++ else ++ buf_y_paddr = comm->fbc_buffer_paddr[idx]; ++ } else { ++ buf_y_paddr = vb2_dma_contig_plane_dma_addr(vb, 0); ++ } + + amvdec_write_dos(core, HEVCD_MPP_ANC2AXI_TBL_DATA, + buf_y_paddr >> 5); +@@ -150,60 +163,67 @@ static void codec_hevc_setup_buffers_gxl(struct amvdec_session *sess, + amvdec_write_dos(core, HEVCD_MPP_ANC_CANVAS_DATA_ADDR, 0); + } + +-void codec_hevc_free_fbc_buffers(struct amvdec_session *sess, ++void codec_hevc_free_mmu_headers(struct amvdec_session *sess, + struct codec_hevc_common *comm) + { + struct device *dev = sess->core->dev; +- u32 am21_size = amvdec_am21c_size(sess->width, sess->height); + int i; + + for (i = 0; i < MAX_REF_PIC_NUM; ++i) { +- if (comm->fbc_buffer_vaddr[i]) { +- dma_free_coherent(dev, am21_size, +- comm->fbc_buffer_vaddr[i], +- comm->fbc_buffer_paddr[i]); +- comm->fbc_buffer_vaddr[i] = NULL; ++ if (comm->mmu_header_vaddr[i]) { ++ dma_free_coherent(dev, MMU_COMPRESS_HEADER_SIZE, ++ comm->mmu_header_vaddr[i], ++ comm->mmu_header_paddr[i]); ++ comm->mmu_header_vaddr[i] = NULL; + } + } + } +-EXPORT_SYMBOL_GPL(codec_hevc_free_fbc_buffers); ++EXPORT_SYMBOL_GPL(codec_hevc_free_mmu_headers); + +-static int codec_hevc_alloc_fbc_buffers(struct amvdec_session *sess, ++static int codec_hevc_alloc_mmu_headers(struct amvdec_session *sess, + struct codec_hevc_common *comm) + { + struct device *dev = sess->core->dev; + struct v4l2_m2m_buffer *buf; +- u32 am21_size = amvdec_am21c_size(sess->width, sess->height); + + v4l2_m2m_for_each_dst_buf(sess->m2m_ctx, buf) { + u32 idx = buf->vb.vb2_buf.index; + dma_addr_t paddr; +- void *vaddr = dma_alloc_coherent(dev, am21_size, &paddr, +- GFP_KERNEL); ++ void *vaddr = dma_alloc_coherent(dev, MMU_COMPRESS_HEADER_SIZE, ++ &paddr, GFP_KERNEL); + if (!vaddr) { +- codec_hevc_free_fbc_buffers(sess, comm); ++ codec_hevc_free_mmu_headers(sess, comm); + return -ENOMEM; + } + +- comm->fbc_buffer_vaddr[idx] = vaddr; +- comm->fbc_buffer_paddr[idx] = paddr; ++ comm->mmu_header_vaddr[idx] = vaddr; ++ comm->mmu_header_paddr[idx] = paddr; + } + + return 0; + } + +-void codec_hevc_free_mmu_headers(struct amvdec_session *sess, ++void codec_hevc_free_fbc_buffers(struct amvdec_session *sess, + struct codec_hevc_common *comm) + { + struct device *dev = sess->core->dev; ++ u32 use_mmu; ++ u32 am21_size; + int i; + ++ use_mmu = codec_hevc_use_mmu(sess->core->platform->revision, ++ sess->pixfmt_cap, ++ sess->bitdepth == 10 ? 1 : 0); ++ ++ am21_size = amvdec_amfbc_size(sess->width, sess->height, ++ sess->bitdepth == 10 ? 1 : 0, use_mmu); ++ + for (i = 0; i < MAX_REF_PIC_NUM; ++i) { +- if (comm->mmu_header_vaddr[i]) { +- dma_free_coherent(dev, MMU_COMPRESS_HEADER_SIZE, +- comm->mmu_header_vaddr[i], +- comm->mmu_header_paddr[i]); +- comm->mmu_header_vaddr[i] = NULL; ++ if (comm->fbc_buffer_vaddr[i]) { ++ dma_free_coherent(dev, am21_size, ++ comm->fbc_buffer_vaddr[i], ++ comm->fbc_buffer_paddr[i]); ++ comm->fbc_buffer_vaddr[i] = NULL; + } + } + +@@ -213,33 +233,49 @@ void codec_hevc_free_mmu_headers(struct amvdec_session *sess, + comm->mmu_map_paddr); + comm->mmu_map_vaddr = NULL; + } ++ ++ codec_hevc_free_mmu_headers(sess, comm); + } +-EXPORT_SYMBOL_GPL(codec_hevc_free_mmu_headers); ++EXPORT_SYMBOL_GPL(codec_hevc_free_fbc_buffers); + +-static int codec_hevc_alloc_mmu_headers(struct amvdec_session *sess, ++static int codec_hevc_alloc_fbc_buffers(struct amvdec_session *sess, + struct codec_hevc_common *comm) + { + struct device *dev = sess->core->dev; + struct v4l2_m2m_buffer *buf; ++ u32 use_mmu; ++ u32 am21_size; ++ const u32 revision = sess->core->platform->revision; ++ const u32 is_10bit = sess->bitdepth == 10 ? 1 : 0; ++ int ret; + +- comm->mmu_map_vaddr = dma_alloc_coherent(dev, MMU_MAP_SIZE, +- &comm->mmu_map_paddr, +- GFP_KERNEL); +- if (!comm->mmu_map_vaddr) +- return -ENOMEM; ++ use_mmu = codec_hevc_use_mmu(revision, sess->pixfmt_cap, ++ is_10bit); ++ ++ am21_size = amvdec_amfbc_size(sess->width, sess->height, ++ is_10bit, use_mmu); + + v4l2_m2m_for_each_dst_buf(sess->m2m_ctx, buf) { + u32 idx = buf->vb.vb2_buf.index; + dma_addr_t paddr; +- void *vaddr = dma_alloc_coherent(dev, MMU_COMPRESS_HEADER_SIZE, +- &paddr, GFP_KERNEL); ++ void *vaddr = dma_alloc_coherent(dev, am21_size, &paddr, ++ GFP_KERNEL); + if (!vaddr) { +- codec_hevc_free_mmu_headers(sess, comm); ++ codec_hevc_free_fbc_buffers(sess, comm); + return -ENOMEM; + } + +- comm->mmu_header_vaddr[idx] = vaddr; +- comm->mmu_header_paddr[idx] = paddr; ++ comm->fbc_buffer_vaddr[idx] = vaddr; ++ comm->fbc_buffer_paddr[idx] = paddr; ++ } ++ ++ if (codec_hevc_use_mmu(revision, sess->pixfmt_cap, is_10bit) && ++ codec_hevc_use_downsample(sess->pixfmt_cap, is_10bit)) { ++ ret = codec_hevc_alloc_mmu_headers(sess, comm); ++ if (ret) { ++ codec_hevc_free_fbc_buffers(sess, comm); ++ return ret; ++ } + } + + return 0; +@@ -250,21 +286,24 @@ int codec_hevc_setup_buffers(struct amvdec_session *sess, + int is_10bit) + { + struct amvdec_core *core = sess->core; ++ struct device *dev = core->dev; + int ret; + +- if (codec_hevc_use_downsample(sess->pixfmt_cap, is_10bit)) { +- ret = codec_hevc_alloc_fbc_buffers(sess, comm); +- if (ret) +- return ret; ++ if (codec_hevc_use_mmu(core->platform->revision, ++ sess->pixfmt_cap, is_10bit)) { ++ comm->mmu_map_vaddr = dma_alloc_coherent(dev, MMU_MAP_SIZE, ++ &comm->mmu_map_paddr, ++ GFP_KERNEL); ++ if (!comm->mmu_map_vaddr) ++ return -ENOMEM; + } + + if (codec_hevc_use_mmu(core->platform->revision, +- sess->pixfmt_cap, is_10bit)) { +- ret = codec_hevc_alloc_mmu_headers(sess, comm); +- if (ret) { +- codec_hevc_free_fbc_buffers(sess, comm); +- return ret; +- } ++ sess->pixfmt_cap, is_10bit) || ++ codec_hevc_use_downsample(sess->pixfmt_cap, is_10bit)) { ++ ret = codec_hevc_alloc_fbc_buffers(sess, comm); ++ if (ret) ++ return ret; + } + + if (core->platform->revision == VDEC_REVISION_GXBB) +@@ -278,19 +317,24 @@ EXPORT_SYMBOL_GPL(codec_hevc_setup_buffers); + + void codec_hevc_fill_mmu_map(struct amvdec_session *sess, + struct codec_hevc_common *comm, +- struct vb2_buffer *vb) ++ struct vb2_buffer *vb, ++ u32 is_10bit) + { +- u32 size = amvdec_am21c_size(sess->width, sess->height); +- u32 nb_pages = size / PAGE_SIZE; ++ u32 use_mmu; ++ u32 size; ++ u32 nb_pages; + u32 *mmu_map = comm->mmu_map_vaddr; + u32 first_page; + u32 i; + +- if (sess->pixfmt_cap == V4L2_PIX_FMT_NV12M) +- first_page = comm->fbc_buffer_paddr[vb->index] >> PAGE_SHIFT; +- else +- first_page = vb2_dma_contig_plane_dma_addr(vb, 0) >> PAGE_SHIFT; ++ use_mmu = codec_hevc_use_mmu(sess->core->platform->revision, ++ sess->pixfmt_cap, is_10bit); ++ ++ size = amvdec_amfbc_size(sess->width, sess->height, is_10bit, ++ use_mmu); + ++ nb_pages = size / PAGE_SIZE; ++ first_page = comm->fbc_buffer_paddr[vb->index] >> PAGE_SHIFT; + for (i = 0; i < nb_pages; ++i) + mmu_map[i] = first_page + i; + } +diff --git a/drivers/staging/media/meson/vdec/codec_hevc_common.h b/drivers/staging/media/meson/vdec/codec_hevc_common.h +index cf072b8a9da2..13f9f1d90a94 100644 +--- a/drivers/staging/media/meson/vdec/codec_hevc_common.h ++++ b/drivers/staging/media/meson/vdec/codec_hevc_common.h +@@ -64,6 +64,7 @@ int codec_hevc_setup_buffers(struct amvdec_session *sess, + + void codec_hevc_fill_mmu_map(struct amvdec_session *sess, + struct codec_hevc_common *comm, +- struct vb2_buffer *vb); ++ struct vb2_buffer *vb, ++ u32 is_10bit); + + #endif +diff --git a/drivers/staging/media/meson/vdec/codec_vp9.c b/drivers/staging/media/meson/vdec/codec_vp9.c +index 897f5d7a6aad..bfc312ec2a56 100644 +--- a/drivers/staging/media/meson/vdec/codec_vp9.c ++++ b/drivers/staging/media/meson/vdec/codec_vp9.c +@@ -458,12 +458,6 @@ struct codec_vp9 { + struct list_head ref_frames_list; + u32 frames_num; + +- /* In case of downsampling (decoding with FBC but outputting in NV12M), +- * we need to allocate additional buffers for FBC. +- */ +- void *fbc_buffer_vaddr[MAX_REF_PIC_NUM]; +- dma_addr_t fbc_buffer_paddr[MAX_REF_PIC_NUM]; +- + int ref_frame_map[REF_FRAMES]; + int next_ref_frame_map[REF_FRAMES]; + struct vp9_frame *frame_refs[REFS_PER_FRAME]; +@@ -901,11 +895,8 @@ static void codec_vp9_set_sao(struct amvdec_session *sess, + buf_y_paddr = + vb2_dma_contig_plane_dma_addr(vb, 0); + +- if (codec_hevc_use_fbc(sess->pixfmt_cap, vp9->is_10bit)) { +- val = amvdec_read_dos(core, HEVC_SAO_CTRL5) & ~0xff0200; +- amvdec_write_dos(core, HEVC_SAO_CTRL5, val); +- amvdec_write_dos(core, HEVC_CM_BODY_START_ADDR, buf_y_paddr); +- } ++ if (codec_hevc_use_fbc(sess->pixfmt_cap, vp9->is_10bit)) ++ amvdec_write_dos(core, HEVC_CM_BODY_START_ADDR, buf_y_paddr); + + if (sess->pixfmt_cap == V4L2_PIX_FMT_NV12M) { + buf_y_paddr = +@@ -920,8 +911,12 @@ static void codec_vp9_set_sao(struct amvdec_session *sess, + + if (codec_hevc_use_mmu(core->platform->revision, sess->pixfmt_cap, + vp9->is_10bit)) { +- amvdec_write_dos(core, HEVC_CM_HEADER_START_ADDR, +- vp9->common.mmu_header_paddr[vb->index]); ++ dma_addr_t header_adr; ++ if (codec_hevc_use_downsample(sess->pixfmt_cap, vp9->is_10bit)) ++ header_adr = vp9->common.mmu_header_paddr[vb->index]; ++ else ++ header_adr = vb2_dma_contig_plane_dma_addr(vb, 0); ++ amvdec_write_dos(core, HEVC_CM_HEADER_START_ADDR, header_adr); + /* use HEVC_CM_HEADER_START_ADDR */ + amvdec_write_dos_bits(core, HEVC_SAO_CTRL5, BIT(10)); + } +@@ -1148,9 +1143,13 @@ static void codec_vp9_set_mc(struct amvdec_session *sess, + { + struct amvdec_core *core = sess->core; + u32 scale = 0; ++ u32 use_mmu; + u32 sz; + int i; + ++ use_mmu = codec_hevc_use_mmu(core->platform->revision, ++ sess->pixfmt_cap, vp9->is_10bit); ++ + amvdec_write_dos(core, HEVCD_MPP_ANC_CANVAS_ACCCONFIG_ADDR, 1); + codec_vp9_set_refs(sess, vp9); + amvdec_write_dos(core, HEVCD_MPP_ANC_CANVAS_ACCCONFIG_ADDR, +@@ -1166,8 +1165,9 @@ static void codec_vp9_set_mc(struct amvdec_session *sess, + vp9->frame_refs[i]->height != vp9->height) + scale = 1; + +- sz = amvdec_am21c_body_size(vp9->frame_refs[i]->width, +- vp9->frame_refs[i]->height); ++ sz = amvdec_amfbc_body_size(vp9->frame_refs[i]->width, ++ vp9->frame_refs[i]->height, ++ vp9->is_10bit, use_mmu); + + amvdec_write_dos(core, VP9D_MPP_REFINFO_DATA, + vp9->frame_refs[i]->width); +@@ -1283,7 +1283,8 @@ static void codec_vp9_process_frame(struct amvdec_session *sess) + if (codec_hevc_use_mmu(core->platform->revision, sess->pixfmt_cap, + vp9->is_10bit)) + codec_hevc_fill_mmu_map(sess, &vp9->common, +- &vp9->cur_frame->vbuf->vb2_buf); ++ &vp9->cur_frame->vbuf->vb2_buf, ++ vp9->is_10bit); + + intra_only = param->p.show_frame ? 0 : param->p.intra_only; + +@@ -2132,7 +2133,8 @@ static irqreturn_t codec_vp9_threaded_isr(struct amvdec_session *sess) + + codec_vp9_fetch_rpm(sess); + if (codec_vp9_process_rpm(vp9)) { +- amvdec_src_change(sess, vp9->width, vp9->height, 16); ++ amvdec_src_change(sess, vp9->width, vp9->height, 16, ++ vp9->is_10bit ? 10 : 8); + + /* No frame is actually processed */ + vp9->cur_frame = NULL; +diff --git a/drivers/staging/media/meson/vdec/esparser.c b/drivers/staging/media/meson/vdec/esparser.c +index e18334e57fc0..610a92b9f6f2 100644 +--- a/drivers/staging/media/meson/vdec/esparser.c ++++ b/drivers/staging/media/meson/vdec/esparser.c +@@ -319,6 +319,7 @@ esparser_queue(struct amvdec_session *sess, struct vb2_v4l2_buffer *vbuf) + if (esparser_vififo_get_free_space(sess) < payload_size || + atomic_read(&sess->esparser_queued_bufs) >= num_dst_bufs) + return -EAGAIN; ++ + } else if (esparser_vififo_get_free_space(sess) < payload_size) { + return -EAGAIN; + } +diff --git a/drivers/staging/media/meson/vdec/vdec.h b/drivers/staging/media/meson/vdec/vdec.h +index f95445ac0658..e3e4af73447a 100644 +--- a/drivers/staging/media/meson/vdec/vdec.h ++++ b/drivers/staging/media/meson/vdec/vdec.h +@@ -234,6 +234,7 @@ struct amvdec_session { + u32 width; + u32 height; + u32 colorspace; ++ u32 bitdepth; + u8 ycbcr_enc; + u8 quantization; + u8 xfer_func; +diff --git a/drivers/staging/media/meson/vdec/vdec_helpers.c b/drivers/staging/media/meson/vdec/vdec_helpers.c +index b9125c295d1d..bae69b55baf3 100644 +--- a/drivers/staging/media/meson/vdec/vdec_helpers.c ++++ b/drivers/staging/media/meson/vdec/vdec_helpers.c +@@ -50,32 +50,40 @@ void amvdec_write_parser(struct amvdec_core *core, u32 reg, u32 val) + } + EXPORT_SYMBOL_GPL(amvdec_write_parser); + +-/* 4 KiB per 64x32 block */ +-u32 amvdec_am21c_body_size(u32 width, u32 height) ++/* AMFBC body is made out of 64x32 blocks with varying block size */ ++u32 amvdec_amfbc_body_size(u32 width, u32 height, u32 is_10bit, u32 use_mmu) + { + u32 width_64 = ALIGN(width, 64) / 64; + u32 height_32 = ALIGN(height, 32) / 32; ++ u32 blk_size = 4096; + +- return SZ_4K * width_64 * height_32; ++ if (!is_10bit) { ++ if (use_mmu) ++ blk_size = 3200; ++ else ++ blk_size = 3072; ++ } ++ ++ return blk_size * width_64 * height_32; + } +-EXPORT_SYMBOL_GPL(amvdec_am21c_body_size); ++EXPORT_SYMBOL_GPL(amvdec_amfbc_body_size); + + /* 32 bytes per 128x64 block */ +-u32 amvdec_am21c_head_size(u32 width, u32 height) ++u32 amvdec_amfbc_head_size(u32 width, u32 height) + { + u32 width_128 = ALIGN(width, 128) / 128; + u32 height_64 = ALIGN(height, 64) / 64; + + return 32 * width_128 * height_64; + } +-EXPORT_SYMBOL_GPL(amvdec_am21c_head_size); ++EXPORT_SYMBOL_GPL(amvdec_amfbc_head_size); + +-u32 amvdec_am21c_size(u32 width, u32 height) ++u32 amvdec_amfbc_size(u32 width, u32 height, u32 is_10bit, u32 use_mmu) + { +- return ALIGN(amvdec_am21c_body_size(width, height) + +- amvdec_am21c_head_size(width, height), SZ_64K); ++ return ALIGN(amvdec_amfbc_body_size(width, height, is_10bit, use_mmu) + ++ amvdec_amfbc_head_size(width, height), SZ_64K); + } +-EXPORT_SYMBOL_GPL(amvdec_am21c_size); ++EXPORT_SYMBOL_GPL(amvdec_amfbc_size); + + static int canvas_alloc(struct amvdec_session *sess, u8 *canvas_id) + { +@@ -436,7 +444,7 @@ void amvdec_set_par_from_dar(struct amvdec_session *sess, + EXPORT_SYMBOL_GPL(amvdec_set_par_from_dar); + + void amvdec_src_change(struct amvdec_session *sess, u32 width, +- u32 height, u32 dpb_size) ++ u32 height, u32 dpb_size, u32 bitdepth) + { + static const struct v4l2_event ev = { + .type = V4L2_EVENT_SOURCE_CHANGE, +@@ -444,25 +452,27 @@ void amvdec_src_change(struct amvdec_session *sess, u32 width, + + v4l2_ctrl_s_ctrl(sess->ctrl_min_buf_capture, dpb_size); + ++ sess->bitdepth = bitdepth; ++ + /* + * Check if the capture queue is already configured well for our +- * usecase. If so, keep decoding with it and do not send the event ++ * usecase. If so, keep decoding with it. + */ + if (sess->streamon_cap && + sess->width == width && + sess->height == height && + dpb_size <= sess->num_dst_bufs) { + sess->fmt_out->codec_ops->resume(sess); +- return; +- } ++ } else { ++ sess->status = STATUS_NEEDS_RESUME; ++ sess->changed_format = 0; ++ } + +- sess->changed_format = 0; + sess->width = width; + sess->height = height; +- sess->status = STATUS_NEEDS_RESUME; + +- dev_dbg(sess->core->dev, "Res. changed (%ux%u), DPB size %u\n", +- width, height, dpb_size); ++ dev_dbg(sess->core->dev, "Res. changed (%ux%u), DPB %u, bitdepth %u\n", ++ width, height, dpb_size, bitdepth); + v4l2_event_queue_fh(&sess->fh, &ev); + } + EXPORT_SYMBOL_GPL(amvdec_src_change); +diff --git a/drivers/staging/media/meson/vdec/vdec_helpers.h b/drivers/staging/media/meson/vdec/vdec_helpers.h +index cfaed52ab526..e574c4349759 100644 +--- a/drivers/staging/media/meson/vdec/vdec_helpers.h ++++ b/drivers/staging/media/meson/vdec/vdec_helpers.h +@@ -27,9 +27,10 @@ void amvdec_clear_dos_bits(struct amvdec_core *core, u32 reg, u32 val); + u32 amvdec_read_parser(struct amvdec_core *core, u32 reg); + void amvdec_write_parser(struct amvdec_core *core, u32 reg, u32 val); + +-u32 amvdec_am21c_body_size(u32 width, u32 height); +-u32 amvdec_am21c_head_size(u32 width, u32 height); +-u32 amvdec_am21c_size(u32 width, u32 height); ++/* Helpers for the Amlogic compressed framebuffer format */ ++u32 amvdec_amfbc_body_size(u32 width, u32 height, u32 is_10bit, u32 use_mmu); ++u32 amvdec_amfbc_head_size(u32 width, u32 height); ++u32 amvdec_amfbc_size(u32 width, u32 height, u32 is_10bit, u32 use_mmu); + + /** + * amvdec_dst_buf_done_idx() - Signal that a buffer is done decoding +@@ -76,9 +77,10 @@ void amvdec_set_par_from_dar(struct amvdec_session *sess, + * @width: picture width detected by the hardware + * @height: picture height detected by the hardware + * @dpb_size: Decoded Picture Buffer size (= amount of buffers for decoding) ++ * @bitdepth: Bit depth (usually 10 or 8) of the coded content + */ + void amvdec_src_change(struct amvdec_session *sess, u32 width, +- u32 height, u32 dpb_size); ++ u32 height, u32 dpb_size, u32 bitdepth); + + /** + * amvdec_abort() - Abort the current decoding session +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0032-WIP-drivers-meson-vdec-add-hevc-decode-codec.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0032-WIP-drivers-meson-vdec-add-hevc-decode-codec.patch new file mode 100644 index 0000000000..46eba3c038 --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0032-WIP-drivers-meson-vdec-add-hevc-decode-codec.patch @@ -0,0 +1,1609 @@ +From f7dc4a36a0a2cefdc9f40ba440ef29d8c4b142a0 Mon Sep 17 00:00:00 2001 +From: benjamin545 +Date: Thu, 15 Jul 2021 17:08:42 -0400 +Subject: [PATCH 32/60] WIP: drivers: meson: vdec: add hevc decode codec + +--- + drivers/staging/media/meson/vdec/Makefile | 2 +- + drivers/staging/media/meson/vdec/codec_hevc.c | 1440 +++++++++++++++++ + drivers/staging/media/meson/vdec/codec_hevc.h | 13 + + drivers/staging/media/meson/vdec/esparser.c | 2 +- + drivers/staging/media/meson/vdec/hevc_regs.h | 1 + + .../staging/media/meson/vdec/vdec_platform.c | 49 + + 6 files changed, 1505 insertions(+), 2 deletions(-) + create mode 100644 drivers/staging/media/meson/vdec/codec_hevc.c + create mode 100644 drivers/staging/media/meson/vdec/codec_hevc.h + +diff --git a/drivers/staging/media/meson/vdec/Makefile b/drivers/staging/media/meson/vdec/Makefile +index 6e726af84ac9..16f848e456b9 100644 +--- a/drivers/staging/media/meson/vdec/Makefile ++++ b/drivers/staging/media/meson/vdec/Makefile +@@ -3,6 +3,6 @@ + + meson-vdec-objs = esparser.o vdec.o vdec_helpers.o vdec_platform.o + meson-vdec-objs += vdec_1.o vdec_hevc.o +-meson-vdec-objs += codec_mpeg12.o codec_h264.o codec_hevc_common.o codec_vp9.o ++meson-vdec-objs += codec_mpeg12.o codec_h264.o codec_hevc_common.o codec_vp9.o codec_hevc.o + + obj-$(CONFIG_VIDEO_MESON_VDEC) += meson-vdec.o +diff --git a/drivers/staging/media/meson/vdec/codec_hevc.c b/drivers/staging/media/meson/vdec/codec_hevc.c +new file mode 100644 +index 000000000000..3a6fd04a2d33 +--- /dev/null ++++ b/drivers/staging/media/meson/vdec/codec_hevc.c +@@ -0,0 +1,1440 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Copyright (C) 2018 Maxime Jourdan ++ * Copyright (C) 2015 Amlogic, Inc. All rights reserved. ++ */ ++ ++#include ++#include ++ ++#include "codec_hevc.h" ++#include "dos_regs.h" ++#include "hevc_regs.h" ++#include "vdec_helpers.h" ++#include "codec_hevc_common.h" ++ ++/* HEVC reg mapping */ ++#define HEVC_DEC_STATUS_REG HEVC_ASSIST_SCRATCH_0 ++ #define HEVC_ACTION_DONE 0xff ++#define HEVC_RPM_BUFFER HEVC_ASSIST_SCRATCH_1 ++#define HEVC_SHORT_TERM_RPS HEVC_ASSIST_SCRATCH_2 ++#define HEVC_VPS_BUFFER HEVC_ASSIST_SCRATCH_3 ++#define HEVC_SPS_BUFFER HEVC_ASSIST_SCRATCH_4 ++#define HEVC_PPS_BUFFER HEVC_ASSIST_SCRATCH_5 ++#define HEVC_SAO_UP HEVC_ASSIST_SCRATCH_6 ++#define HEVC_STREAM_SWAP_BUFFER HEVC_ASSIST_SCRATCH_7 ++#define H265_MMU_MAP_BUFFER HEVC_ASSIST_SCRATCH_7 ++#define HEVC_STREAM_SWAP_BUFFER2 HEVC_ASSIST_SCRATCH_8 ++#define HEVC_sao_mem_unit HEVC_ASSIST_SCRATCH_9 ++#define HEVC_SAO_ABV HEVC_ASSIST_SCRATCH_A ++#define HEVC_sao_vb_size HEVC_ASSIST_SCRATCH_B ++#define HEVC_SAO_VB HEVC_ASSIST_SCRATCH_C ++#define HEVC_SCALELUT HEVC_ASSIST_SCRATCH_D ++#define HEVC_WAIT_FLAG HEVC_ASSIST_SCRATCH_E ++#define RPM_CMD_REG HEVC_ASSIST_SCRATCH_F ++#define LMEM_DUMP_ADR HEVC_ASSIST_SCRATCH_F ++#define DEBUG_REG1 HEVC_ASSIST_SCRATCH_G ++#define HEVC_DECODE_MODE2 HEVC_ASSIST_SCRATCH_H ++#define NAL_SEARCH_CTL HEVC_ASSIST_SCRATCH_I ++#define HEVC_DECODE_MODE HEVC_ASSIST_SCRATCH_J ++ #define DECODE_MODE_SINGLE 0 ++#define DECODE_STOP_POS HEVC_ASSIST_SCRATCH_K ++#define HEVC_AUX_ADR HEVC_ASSIST_SCRATCH_L ++#define HEVC_AUX_DATA_SIZE HEVC_ASSIST_SCRATCH_M ++#define HEVC_DECODE_SIZE HEVC_ASSIST_SCRATCH_N ++ ++#define AMRISC_MAIN_REQ 0x04 ++ ++/* HEVC Constants */ ++#define MAX_REF_PIC_NUM 24 ++#define MAX_REF_ACTIVE 16 ++#define MAX_TILE_COL_NUM 10 ++#define MAX_TILE_ROW_NUM 20 ++#define MAX_SLICE_NUM 800 ++#define INVALID_POC 0x80000000 ++ ++/* HEVC Workspace layout */ ++#define MPRED_MV_BUF_SIZE 0x120000 ++ ++#define IPP_SIZE 0x4000 ++#define SAO_ABV_SIZE 0x30000 ++#define SAO_VB_SIZE 0x30000 ++#define SH_TM_RPS_SIZE 0x800 ++#define VPS_SIZE 0x800 ++#define SPS_SIZE 0x800 ++#define PPS_SIZE 0x2000 ++#define SAO_UP_SIZE 0x2800 ++#define SWAP_BUF_SIZE 0x800 ++#define SWAP_BUF2_SIZE 0x800 ++#define SCALELUT_SIZE 0x8000 ++#define DBLK_PARA_SIZE 0x20000 ++#define DBLK_DATA_SIZE 0x80000 ++#define DBLK_DATA2_SIZE 0x80000 ++#define MMU_VBH_SIZE 0x5000 ++#define MPRED_ABV_SIZE 0x8000 ++#define MPRED_MV_SIZE (MPRED_MV_BUF_SIZE * MAX_REF_PIC_NUM) ++#define RPM_BUF_SIZE 0x100 ++#define LMEM_SIZE 0xA00 ++ ++#define IPP_OFFSET 0x00 ++#define SAO_ABV_OFFSET (IPP_OFFSET + IPP_SIZE) ++#define SAO_VB_OFFSET (SAO_ABV_OFFSET + SAO_ABV_SIZE) ++#define SH_TM_RPS_OFFSET (SAO_VB_OFFSET + SAO_VB_SIZE) ++#define VPS_OFFSET (SH_TM_RPS_OFFSET + SH_TM_RPS_SIZE) ++#define SPS_OFFSET (VPS_OFFSET + VPS_SIZE) ++#define PPS_OFFSET (SPS_OFFSET + SPS_SIZE) ++#define SAO_UP_OFFSET (PPS_OFFSET + PPS_SIZE) ++#define SWAP_BUF_OFFSET (SAO_UP_OFFSET + SAO_UP_SIZE) ++#define SWAP_BUF2_OFFSET (SWAP_BUF_OFFSET + SWAP_BUF_SIZE) ++#define SCALELUT_OFFSET (SWAP_BUF2_OFFSET + SWAP_BUF2_SIZE) ++#define DBLK_PARA_OFFSET (SCALELUT_OFFSET + SCALELUT_SIZE) ++#define DBLK_DATA_OFFSET (DBLK_PARA_OFFSET + DBLK_PARA_SIZE) ++#define DBLK_DATA2_OFFSET (DBLK_DATA_OFFSET + DBLK_DATA_SIZE) ++#define MMU_VBH_OFFSET (DBLK_DATA2_OFFSET + DBLK_DATA2_SIZE) ++#define MPRED_ABV_OFFSET (MMU_VBH_OFFSET + MMU_VBH_SIZE) ++#define MPRED_MV_OFFSET (MPRED_ABV_OFFSET + MPRED_ABV_SIZE) ++#define RPM_OFFSET (MPRED_MV_OFFSET + MPRED_MV_SIZE) ++#define LMEM_OFFSET (RPM_OFFSET + RPM_BUF_SIZE) ++ ++/* ISR decode status */ ++#define HEVC_DEC_IDLE 0x0 ++#define HEVC_NAL_UNIT_VPS 0x1 ++#define HEVC_NAL_UNIT_SPS 0x2 ++#define HEVC_NAL_UNIT_PPS 0x3 ++#define HEVC_NAL_UNIT_CODED_SLICE_SEGMENT 0x4 ++#define HEVC_CODED_SLICE_SEGMENT_DAT 0x5 ++#define HEVC_SLICE_DECODING 0x6 ++#define HEVC_NAL_UNIT_SEI 0x7 ++#define HEVC_SLICE_SEGMENT_DONE 0x8 ++#define HEVC_NAL_SEARCH_DONE 0x9 ++#define HEVC_DECPIC_DATA_DONE 0xa ++#define HEVC_DECPIC_DATA_ERROR 0xb ++#define HEVC_SEI_DAT 0xc ++#define HEVC_SEI_DAT_DONE 0xd ++ ++/* RPM misc_flag0 */ ++#define PCM_LOOP_FILTER_DISABLED_FLAG_BIT 0 ++#define PCM_ENABLE_FLAG_BIT 1 ++#define LOOP_FILER_ACROSS_TILES_ENABLED_FLAG_BIT 2 ++#define PPS_LOOP_FILTER_ACROSS_SLICES_ENABLED_FLAG_BIT 3 ++#define DEBLOCKING_FILTER_OVERRIDE_ENABLED_FLAG_BIT 4 ++#define PPS_DEBLOCKING_FILTER_DISABLED_FLAG_BIT 5 ++#define DEBLOCKING_FILTER_OVERRIDE_FLAG_BIT 6 ++#define SLICE_DEBLOCKING_FILTER_DISABLED_FLAG_BIT 7 ++#define SLICE_SAO_LUMA_FLAG_BIT 8 ++#define SLICE_SAO_CHROMA_FLAG_BIT 9 ++#define SLICE_LOOP_FILTER_ACROSS_SLICES_ENABLED_FLAG_BIT 10 ++ ++/* Constants for HEVC_MPRED_CTRL1 */ ++#define AMVP_MAX_NUM_CANDS_MEM 3 ++#define AMVP_MAX_NUM_CANDS 2 ++#define NUM_CHROMA_MODE 5 ++#define DM_CHROMA_IDX 36 ++ ++/* Buffer sizes */ ++#define SIZE_WORKSPACE ALIGN(LMEM_OFFSET + LMEM_SIZE, 64 * SZ_1K) ++#define SIZE_AUX (SZ_1K * 16) ++#define SIZE_FRAME_MMU (0x1200 * 4) ++#define RPM_SIZE 0x80 ++#define RPS_USED_BIT 14 ++ ++/* Data received from the HW in this form, do not rearrange */ ++union rpm_param { ++ struct { ++ u16 data[RPM_SIZE]; ++ } l; ++ struct { ++ u16 CUR_RPS[MAX_REF_ACTIVE]; ++ u16 num_ref_idx_l0_active; ++ u16 num_ref_idx_l1_active; ++ u16 slice_type; ++ u16 slice_temporal_mvp_enable_flag; ++ u16 dependent_slice_segment_flag; ++ u16 slice_segment_address; ++ u16 num_title_rows_minus1; ++ u16 pic_width_in_luma_samples; ++ u16 pic_height_in_luma_samples; ++ u16 log2_min_coding_block_size_minus3; ++ u16 log2_diff_max_min_coding_block_size; ++ u16 log2_max_pic_order_cnt_lsb_minus4; ++ u16 POClsb; ++ u16 collocated_from_l0_flag; ++ u16 collocated_ref_idx; ++ u16 log2_parallel_merge_level; ++ u16 five_minus_max_num_merge_cand; ++ u16 sps_num_reorder_pics_0; ++ u16 modification_flag; ++ u16 tiles_flags; ++ u16 num_tile_columns_minus1; ++ u16 num_tile_rows_minus1; ++ u16 tile_width[8]; ++ u16 tile_height[8]; ++ u16 misc_flag0; ++ u16 pps_beta_offset_div2; ++ u16 pps_tc_offset_div2; ++ u16 slice_beta_offset_div2; ++ u16 slice_tc_offset_div2; ++ u16 pps_cb_qp_offset; ++ u16 pps_cr_qp_offset; ++ u16 first_slice_segment_in_pic_flag; ++ u16 m_temporalId; ++ u16 m_nalUnitType; ++ u16 vui_num_units_in_tick_hi; ++ u16 vui_num_units_in_tick_lo; ++ u16 vui_time_scale_hi; ++ u16 vui_time_scale_lo; ++ u16 bit_depth; ++ u16 profile_etc; ++ u16 sei_frame_field_info; ++ u16 video_signal_type; ++ u16 modification_list[0x20]; ++ u16 conformance_window_flag; ++ u16 conf_win_left_offset; ++ u16 conf_win_right_offset; ++ u16 conf_win_top_offset; ++ u16 conf_win_bottom_offset; ++ u16 chroma_format_idc; ++ u16 color_description; ++ u16 aspect_ratio_idc; ++ u16 sar_width; ++ u16 sar_height; ++ } p; ++}; ++ ++enum nal_unit_type { ++ NAL_UNIT_CODED_SLICE_BLA = 16, ++ NAL_UNIT_CODED_SLICE_BLANT = 17, ++ NAL_UNIT_CODED_SLICE_BLA_N_LP = 18, ++ NAL_UNIT_CODED_SLICE_IDR = 19, ++ NAL_UNIT_CODED_SLICE_IDR_N_LP = 20, ++}; ++ ++enum slice_type { ++ B_SLICE = 0, ++ P_SLICE = 1, ++ I_SLICE = 2, ++}; ++ ++/* A frame being decoded */ ++struct hevc_frame { ++ struct list_head list; ++ struct vb2_v4l2_buffer *vbuf; ++ u32 offset; ++ u32 poc; ++ ++ int referenced; ++ u32 num_reorder_pic; ++ ++ u32 cur_slice_idx; ++ u32 cur_slice_type; ++ ++ /* 2 lists (L0/L1) ; 800 slices ; 16 refs */ ++ u32 ref_poc_list[2][MAX_SLICE_NUM][MAX_REF_ACTIVE]; ++ u32 ref_num[2]; ++}; ++ ++struct codec_hevc { ++ struct mutex lock; ++ ++ /* Common part of the HEVC decoder */ ++ struct codec_hevc_common common; ++ ++ /* Buffer for the HEVC Workspace */ ++ void *workspace_vaddr; ++ dma_addr_t workspace_paddr; ++ ++ /* AUX buffer */ ++ void *aux_vaddr; ++ dma_addr_t aux_paddr; ++ ++ /* Contains many information parsed from the bitstream */ ++ union rpm_param rpm_param; ++ ++ /* Information computed from the RPM */ ++ u32 lcu_size; // Largest Coding Unit ++ u32 lcu_x_num; ++ u32 lcu_y_num; ++ u32 lcu_total; ++ ++ /* Current Frame being handled */ ++ struct hevc_frame *cur_frame; ++ u32 curr_poc; ++ /* Collocated Reference Picture */ ++ struct hevc_frame *col_frame; ++ u32 col_poc; ++ ++ /* All ref frames used by the HW at a given time */ ++ struct list_head ref_frames_list; ++ u32 frames_num; ++ ++ /* Coded resolution reported by the hardware */ ++ u32 width, height; ++ /* Resolution minus the conformance window offsets */ ++ u32 dst_width, dst_height; ++ ++ u32 prev_tid0_poc; ++ u32 slice_segment_addr; ++ u32 slice_addr; ++ u32 ldc_flag; ++ ++ /* Whether we detected the bitstream as 10-bit */ ++ int is_10bit; ++}; ++ ++static u32 codec_hevc_num_pending_bufs(struct amvdec_session *sess) ++{ ++ struct codec_hevc *hevc; ++ u32 ret; ++ ++ hevc = sess->priv; ++ if (!hevc) ++ return 0; ++ ++ mutex_lock(&hevc->lock); ++ ret = hevc->frames_num; ++ mutex_unlock(&hevc->lock); ++ ++ return ret; ++} ++ ++/* Update the L0 and L1 reference lists for a given frame */ ++static void codec_hevc_update_frame_refs(struct amvdec_session *sess, ++ struct hevc_frame *frame) ++{ ++ struct codec_hevc *hevc = sess->priv; ++ union rpm_param *params = &hevc->rpm_param; ++ int num_ref_idx_l0_active = ++ (params->p.num_ref_idx_l0_active > MAX_REF_ACTIVE) ? ++ MAX_REF_ACTIVE : params->p.num_ref_idx_l0_active; ++ int num_ref_idx_l1_active = ++ (params->p.num_ref_idx_l1_active > MAX_REF_ACTIVE) ? ++ MAX_REF_ACTIVE : params->p.num_ref_idx_l1_active; ++ int ref_picset0[MAX_REF_ACTIVE] = { 0 }; ++ int ref_picset1[MAX_REF_ACTIVE] = { 0 }; ++ u16 *mod_list = params->p.modification_list; ++ int num_neg = 0; ++ int num_pos = 0; ++ int total_num; ++ int i; ++ ++ for (i = 0; i < MAX_REF_ACTIVE; i++) { ++ frame->ref_poc_list[0][frame->cur_slice_idx][i] = 0; ++ frame->ref_poc_list[1][frame->cur_slice_idx][i] = 0; ++ } ++ ++ for (i = 0; i < MAX_REF_ACTIVE; i++) { ++ u16 cur_rps = params->p.CUR_RPS[i]; ++ int delt = cur_rps & ((1 << (RPS_USED_BIT - 1)) - 1); ++ ++ if (cur_rps & 0x8000) ++ break; ++ ++ if (!((cur_rps >> RPS_USED_BIT) & 1)) ++ continue; ++ ++ if ((cur_rps >> (RPS_USED_BIT - 1)) & 1) { ++ ref_picset0[num_neg] = ++ frame->poc - ((1 << (RPS_USED_BIT - 1)) - delt); ++ num_neg++; ++ } else { ++ ref_picset1[num_pos] = frame->poc + delt; ++ num_pos++; ++ } ++ } ++ ++ total_num = num_neg + num_pos; ++ ++ if (total_num <= 0) ++ goto end; ++ ++ for (i = 0; i < num_ref_idx_l0_active; i++) { ++ int cidx; ++ if (params->p.modification_flag & 0x1) ++ cidx = mod_list[i]; ++ else ++ cidx = i % total_num; ++ ++ frame->ref_poc_list[0][frame->cur_slice_idx][i] = ++ cidx >= num_neg ? ref_picset1[cidx - num_neg] : ++ ref_picset0[cidx]; ++ } ++ ++ if (params->p.slice_type != B_SLICE) ++ goto end; ++ ++ if (params->p.modification_flag & 0x2) { ++ for (i = 0; i < num_ref_idx_l1_active; i++) { ++ int cidx; ++ if (params->p.modification_flag & 0x1) ++ cidx = mod_list[num_ref_idx_l0_active + i]; ++ else ++ cidx = mod_list[i]; ++ ++ frame->ref_poc_list[1][frame->cur_slice_idx][i] = ++ (cidx >= num_pos) ? ref_picset0[cidx - num_pos] ++ : ref_picset1[cidx]; ++ } ++ } else { ++ for (i = 0; i < num_ref_idx_l1_active; i++) { ++ int cidx = i % total_num; ++ frame->ref_poc_list[1][frame->cur_slice_idx][i] = ++ cidx >= num_pos ? ref_picset0[cidx - num_pos] : ++ ref_picset1[cidx]; ++ } ++ } ++ ++end: ++ frame->ref_num[0] = num_ref_idx_l0_active; ++ frame->ref_num[1] = num_ref_idx_l1_active; ++ ++ dev_dbg(sess->core->dev, ++ "Frame %u; slice %u; slice_type %u; num_l0 %u; num_l1 %u\n", ++ frame->poc, frame->cur_slice_idx, params->p.slice_type, ++ frame->ref_num[0], frame->ref_num[1]); ++} ++ ++static void codec_hevc_update_ldc_flag(struct codec_hevc *hevc) ++{ ++ struct hevc_frame *frame = hevc->cur_frame; ++ u32 slice_type = frame->cur_slice_type; ++ u32 slice_idx = frame->cur_slice_idx; ++ int i; ++ ++ hevc->ldc_flag = 0; ++ ++ if (slice_type == I_SLICE) ++ return; ++ ++ hevc->ldc_flag = 1; ++ for (i = 0; (i < frame->ref_num[0]) && hevc->ldc_flag; i++) { ++ if (frame->ref_poc_list[0][slice_idx][i] > frame->poc) { ++ hevc->ldc_flag = 0; ++ break; ++ } ++ } ++ ++ if (slice_type == P_SLICE) ++ return; ++ ++ for (i = 0; (i < frame->ref_num[1]) && hevc->ldc_flag; i++) { ++ if (frame->ref_poc_list[1][slice_idx][i] > frame->poc) { ++ hevc->ldc_flag = 0; ++ break; ++ } ++ } ++} ++ ++/* Tag "old" frames that are no longer referenced */ ++static void codec_hevc_update_referenced(struct codec_hevc *hevc) ++{ ++ union rpm_param *param = &hevc->rpm_param; ++ struct hevc_frame *frame; ++ int i; ++ u32 curr_poc = hevc->curr_poc; ++ ++ list_for_each_entry(frame, &hevc->ref_frames_list, list) { ++ int is_referenced = 0; ++ u32 poc_tmp; ++ ++ if (!frame->referenced) ++ continue; ++ ++ for (i = 0; i < MAX_REF_ACTIVE; i++) { ++ int delt; ++ if (param->p.CUR_RPS[i] & 0x8000) ++ break; ++ ++ delt = param->p.CUR_RPS[i] & ++ ((1 << (RPS_USED_BIT - 1)) - 1); ++ if (param->p.CUR_RPS[i] & (1 << (RPS_USED_BIT - 1))) { ++ poc_tmp = curr_poc - ++ ((1 << (RPS_USED_BIT - 1)) - delt); ++ } else ++ poc_tmp = curr_poc + delt; ++ if (poc_tmp == frame->poc) { ++ is_referenced = 1; ++ break; ++ } ++ } ++ ++ frame->referenced = is_referenced; ++ } ++} ++ ++static struct hevc_frame * ++codec_hevc_get_lowest_poc_frame(struct codec_hevc *hevc) ++{ ++ struct hevc_frame *tmp, *ret = NULL; ++ u32 poc = INT_MAX; ++ ++ list_for_each_entry(tmp, &hevc->ref_frames_list, list) { ++ if (tmp->poc < poc) { ++ ret = tmp; ++ poc = tmp->poc; ++ } ++ } ++ ++ return ret; ++} ++ ++/* Try to output as many frames as possible */ ++static void codec_hevc_output_frames(struct amvdec_session *sess) ++{ ++ struct hevc_frame *tmp; ++ struct codec_hevc *hevc = sess->priv; ++ ++ while ((tmp = codec_hevc_get_lowest_poc_frame(hevc))) { ++ if (hevc->curr_poc && ++ (tmp->referenced || ++ tmp->num_reorder_pic >= hevc->frames_num)) ++ break; ++ ++ dev_dbg(sess->core->dev, "DONE frame poc %u; vbuf %u\n", ++ tmp->poc, tmp->vbuf->vb2_buf.index); ++ amvdec_dst_buf_done_offset(sess, tmp->vbuf, tmp->offset, ++ V4L2_FIELD_NONE, false); ++ list_del(&tmp->list); ++ kfree(tmp); ++ hevc->frames_num--; ++ } ++} ++ ++ ++static int ++codec_hevc_setup_workspace(struct amvdec_session *sess, ++ struct codec_hevc *hevc) ++{ ++ struct amvdec_core *core = sess->core; ++ u32 revision = core->platform->revision; ++ dma_addr_t wkaddr; ++ ++ /* Allocate some memory for the HEVC decoder's state */ ++ hevc->workspace_vaddr = dma_alloc_coherent(core->dev, SIZE_WORKSPACE, ++ &wkaddr, GFP_KERNEL); ++ if (!hevc->workspace_vaddr) ++ return -ENOMEM; ++ ++ hevc->workspace_paddr = wkaddr; ++ ++ amvdec_write_dos(core, HEVCD_IPP_LINEBUFF_BASE, wkaddr + IPP_OFFSET); ++ amvdec_write_dos(core, HEVC_RPM_BUFFER, wkaddr + RPM_OFFSET); ++ amvdec_write_dos(core, HEVC_SHORT_TERM_RPS, wkaddr + SH_TM_RPS_OFFSET); ++ amvdec_write_dos(core, HEVC_VPS_BUFFER, wkaddr + VPS_OFFSET); ++ amvdec_write_dos(core, HEVC_SPS_BUFFER, wkaddr + SPS_OFFSET); ++ amvdec_write_dos(core, HEVC_PPS_BUFFER, wkaddr + PPS_OFFSET); ++ amvdec_write_dos(core, HEVC_SAO_UP, wkaddr + SAO_UP_OFFSET); ++ ++ if (codec_hevc_use_mmu(revision, sess->pixfmt_cap, hevc->is_10bit)) { ++ amvdec_write_dos(core, HEVC_SAO_MMU_VH0_ADDR, ++ wkaddr + MMU_VBH_OFFSET); ++ amvdec_write_dos(core, HEVC_SAO_MMU_VH1_ADDR, ++ wkaddr + MMU_VBH_OFFSET + (MMU_VBH_SIZE / 2)); ++ ++ if (revision >= VDEC_REVISION_G12A) ++ amvdec_write_dos(core, HEVC_ASSIST_MMU_MAP_ADDR, ++ hevc->common.mmu_map_paddr); ++ else ++ amvdec_write_dos(core, H265_MMU_MAP_BUFFER, ++ hevc->common.mmu_map_paddr); ++ } else if (revision < VDEC_REVISION_G12A) { ++ amvdec_write_dos(core, HEVC_STREAM_SWAP_BUFFER, ++ wkaddr + SWAP_BUF_OFFSET); ++ amvdec_write_dos(core, HEVC_STREAM_SWAP_BUFFER2, ++ wkaddr + SWAP_BUF2_OFFSET); ++ } ++ ++ amvdec_write_dos(core, HEVC_SCALELUT, wkaddr + SCALELUT_OFFSET); ++ amvdec_write_dos(core, HEVC_DBLK_CFG4, wkaddr + DBLK_PARA_OFFSET); ++ amvdec_write_dos(core, HEVC_DBLK_CFG5, wkaddr + DBLK_DATA_OFFSET); ++ if (revision >= VDEC_REVISION_G12A) ++ amvdec_write_dos(core, HEVC_DBLK_CFGE, ++ wkaddr + DBLK_DATA2_OFFSET); ++ ++ amvdec_write_dos(core, LMEM_DUMP_ADR, wkaddr + LMEM_OFFSET); ++ ++ return 0; ++} ++ ++static int codec_hevc_start(struct amvdec_session *sess) ++{ ++ struct amvdec_core *core = sess->core; ++ struct codec_hevc *hevc; ++ u32 val; ++ int i; ++ int ret; ++ ++ hevc = kzalloc(sizeof(*hevc), GFP_KERNEL); ++ if (!hevc) ++ return -ENOMEM; ++ ++ INIT_LIST_HEAD(&hevc->ref_frames_list); ++ hevc->curr_poc = INVALID_POC; ++ ++ ret = codec_hevc_setup_workspace(sess, hevc); ++ if (ret) ++ goto free_hevc; ++ ++ val = BIT(0); /* stream_fetch_enable */ ++ if (core->platform->revision >= VDEC_REVISION_G12A) ++ val |= (0xf << 25); /* arwlen_axi_max */ ++ amvdec_write_dos_bits(core, HEVC_STREAM_CONTROL, val); ++ ++ val = amvdec_read_dos(core, HEVC_PARSER_INT_CONTROL) & 0x03ffffff; ++ val |= (3 << 29) | BIT(27) | BIT(24) | BIT(22) | BIT(7) | BIT(4) | ++ BIT(0); ++ amvdec_write_dos(core, HEVC_PARSER_INT_CONTROL, val); ++ amvdec_write_dos_bits(core, HEVC_SHIFT_STATUS, BIT(1) | BIT(0)); ++ amvdec_write_dos(core, HEVC_SHIFT_CONTROL, ++ (3 << 6) | BIT(5) | BIT(2) | BIT(0)); ++ amvdec_write_dos(core, HEVC_CABAC_CONTROL, 1); ++ amvdec_write_dos(core, HEVC_PARSER_CORE_CONTROL, 1); ++ amvdec_write_dos(core, HEVC_DEC_STATUS_REG, 0); ++ ++ amvdec_write_dos(core, HEVC_IQIT_SCALELUT_WR_ADDR, 0); ++ for (i = 0; i < 1024; ++i) ++ amvdec_write_dos(core, HEVC_IQIT_SCALELUT_DATA, 0); ++ ++ amvdec_write_dos(core, HEVC_DECODE_SIZE, 0); ++ ++ amvdec_write_dos(core, HEVC_PARSER_CMD_WRITE, BIT(16)); ++ for (i = 0; i < ARRAY_SIZE(vdec_hevc_parser_cmd); ++i) ++ amvdec_write_dos(core, HEVC_PARSER_CMD_WRITE, ++ vdec_hevc_parser_cmd[i]); ++ ++ amvdec_write_dos(core, HEVC_PARSER_CMD_SKIP_0, PARSER_CMD_SKIP_CFG_0); ++ amvdec_write_dos(core, HEVC_PARSER_CMD_SKIP_1, PARSER_CMD_SKIP_CFG_1); ++ amvdec_write_dos(core, HEVC_PARSER_CMD_SKIP_2, PARSER_CMD_SKIP_CFG_2); ++ amvdec_write_dos(core, HEVC_PARSER_IF_CONTROL, ++ BIT(5) | BIT(2) | BIT(0)); ++ ++ amvdec_write_dos(core, HEVCD_IPP_TOP_CNTL, BIT(0)); ++ amvdec_write_dos(core, HEVCD_IPP_TOP_CNTL, BIT(1)); ++ ++ amvdec_write_dos(core, HEVC_WAIT_FLAG, 1); ++ ++ /* clear mailbox interrupt */ ++ amvdec_write_dos(core, HEVC_ASSIST_MBOX1_CLR_REG, 1); ++ /* enable mailbox interrupt */ ++ amvdec_write_dos(core, HEVC_ASSIST_MBOX1_MASK, 1); ++ /* disable PSCALE for hardware sharing */ ++ amvdec_write_dos(core, HEVC_PSCALE_CTRL, 0); ++ /* Let the uCode do all the parsing */ ++ amvdec_write_dos(core, NAL_SEARCH_CTL, 0xc); ++ ++ amvdec_write_dos(core, DECODE_STOP_POS, 0); ++ amvdec_write_dos(core, HEVC_DECODE_MODE, DECODE_MODE_SINGLE); ++ amvdec_write_dos(core, HEVC_DECODE_MODE2, 0); ++ ++ /* AUX buffers */ ++ hevc->aux_vaddr = dma_alloc_coherent(core->dev, SIZE_AUX, ++ &hevc->aux_paddr, GFP_KERNEL); ++ if (!hevc->aux_vaddr) { ++ dev_err(core->dev, "Failed to request HEVC AUX\n"); ++ ret = -ENOMEM; ++ goto free_hevc; ++ } ++ ++ amvdec_write_dos(core, HEVC_AUX_ADR, hevc->aux_paddr); ++ amvdec_write_dos(core, HEVC_AUX_DATA_SIZE, ++ (((SIZE_AUX) >> 4) << 16) | 0); ++ mutex_init(&hevc->lock); ++ sess->priv = hevc; ++ ++ return 0; ++ ++free_hevc: ++ kfree(hevc); ++ return ret; ++} ++ ++static void codec_hevc_flush_output(struct amvdec_session *sess) ++{ ++ struct codec_hevc *hevc = sess->priv; ++ struct hevc_frame *tmp; ++ ++ while (!list_empty(&hevc->ref_frames_list)) { ++ tmp = codec_hevc_get_lowest_poc_frame(hevc); ++ amvdec_dst_buf_done(sess, tmp->vbuf, V4L2_FIELD_NONE); ++ list_del(&tmp->list); ++ kfree(tmp); ++ hevc->frames_num--; ++ } ++} ++ ++static int codec_hevc_stop(struct amvdec_session *sess) ++{ ++ struct codec_hevc *hevc = sess->priv; ++ struct amvdec_core *core = sess->core; ++ ++ mutex_lock(&hevc->lock); ++ codec_hevc_flush_output(sess); ++ ++ if (hevc->workspace_vaddr) ++ dma_free_coherent(core->dev, SIZE_WORKSPACE, ++ hevc->workspace_vaddr, ++ hevc->workspace_paddr); ++ ++ if (hevc->aux_vaddr) ++ dma_free_coherent(core->dev, SIZE_AUX, ++ hevc->aux_vaddr, hevc->aux_paddr); ++ ++ codec_hevc_free_fbc_buffers(sess, &hevc->common); ++ mutex_unlock(&hevc->lock); ++ mutex_destroy(&hevc->lock); ++ ++ return 0; ++} ++ ++static struct hevc_frame * ++codec_hevc_get_frame_by_poc(struct codec_hevc *hevc, u32 poc) ++{ ++ struct hevc_frame *tmp; ++ ++ list_for_each_entry(tmp, &hevc->ref_frames_list, list) { ++ if (tmp->poc == poc) ++ return tmp; ++ } ++ ++ return NULL; ++} ++ ++static struct hevc_frame * ++codec_hevc_prepare_new_frame(struct amvdec_session *sess) ++{ ++ struct amvdec_core *core = sess->core; ++ struct hevc_frame *new_frame = NULL; ++ struct codec_hevc *hevc = sess->priv; ++ struct vb2_v4l2_buffer *vbuf; ++ union rpm_param *params = &hevc->rpm_param; ++ ++ new_frame = kzalloc(sizeof(*new_frame), GFP_KERNEL); ++ if (!new_frame) ++ return NULL; ++ ++ vbuf = v4l2_m2m_dst_buf_remove(sess->m2m_ctx); ++ if (!vbuf) { ++ dev_err(sess->core->dev, "No dst buffer available\n"); ++ return NULL; ++ } ++ ++ new_frame->vbuf = vbuf; ++ new_frame->referenced = 1; ++ new_frame->poc = hevc->curr_poc; ++ new_frame->cur_slice_type = params->p.slice_type; ++ new_frame->num_reorder_pic = params->p.sps_num_reorder_pics_0; ++ new_frame->offset = amvdec_read_dos(core, HEVC_SHIFT_BYTE_COUNT); ++ ++ list_add_tail(&new_frame->list, &hevc->ref_frames_list); ++ hevc->frames_num++; ++ ++ return new_frame; ++} ++ ++static void ++codec_hevc_set_sao(struct amvdec_session *sess, struct hevc_frame *frame) ++{ ++ struct amvdec_core *core = sess->core; ++ struct codec_hevc *hevc = sess->priv; ++ struct vb2_buffer *vb = &frame->vbuf->vb2_buf; ++ union rpm_param *param = &hevc->rpm_param; ++ u32 pic_height_cu = ++ (hevc->height + hevc->lcu_size - 1) / hevc->lcu_size; ++ u32 sao_mem_unit = (hevc->lcu_size == 16 ? 9 : ++ hevc->lcu_size == 32 ? 14 : 24) << 4; ++ u32 sao_vb_size = (sao_mem_unit + (2 << 4)) * pic_height_cu; ++ u32 misc_flag0 = param->p.misc_flag0; ++ dma_addr_t buf_y_paddr; ++ dma_addr_t buf_u_v_paddr; ++ u32 slice_deblocking_filter_disabled_flag; ++ u32 val, val_2; ++ ++ val = (amvdec_read_dos(core, HEVC_SAO_CTRL0) & ~0xf) | ++ ilog2(hevc->lcu_size); ++ amvdec_write_dos(core, HEVC_SAO_CTRL0, val); ++ ++ amvdec_write_dos(core, HEVC_SAO_PIC_SIZE, ++ hevc->width | (hevc->height << 16)); ++ amvdec_write_dos(core, HEVC_SAO_PIC_SIZE_LCU, ++ (hevc->lcu_x_num - 1) | (hevc->lcu_y_num - 1) << 16); ++ ++ if (codec_hevc_use_downsample(sess->pixfmt_cap, hevc->is_10bit) || ++ codec_hevc_use_mmu(core->platform->revision, sess->pixfmt_cap, ++ hevc->is_10bit)) ++ buf_y_paddr = ++ hevc->common.fbc_buffer_paddr[vb->index]; ++ else ++ buf_y_paddr = ++ vb2_dma_contig_plane_dma_addr(vb, 0); ++ ++ if (codec_hevc_use_fbc(sess->pixfmt_cap, hevc->is_10bit)) { ++ val = amvdec_read_dos(core, HEVC_SAO_CTRL5) & ~0xff0000; ++ amvdec_write_dos(core, HEVC_SAO_CTRL5, val); ++ amvdec_write_dos(core, HEVC_CM_BODY_START_ADDR, buf_y_paddr); ++ } ++ ++ if (sess->pixfmt_cap == V4L2_PIX_FMT_NV12M) { ++ buf_y_paddr = ++ vb2_dma_contig_plane_dma_addr(vb, 0); ++ buf_u_v_paddr = ++ vb2_dma_contig_plane_dma_addr(vb, 1); ++ amvdec_write_dos(core, HEVC_SAO_Y_START_ADDR, buf_y_paddr); ++ amvdec_write_dos(core, HEVC_SAO_C_START_ADDR, buf_u_v_paddr); ++ amvdec_write_dos(core, HEVC_SAO_Y_WPTR, buf_y_paddr); ++ amvdec_write_dos(core, HEVC_SAO_C_WPTR, buf_u_v_paddr); ++ } ++ ++ if (codec_hevc_use_mmu(core->platform->revision, sess->pixfmt_cap, ++ hevc->is_10bit)) { ++ dma_addr_t header_adr = vb2_dma_contig_plane_dma_addr(vb, 0); ++ if (codec_hevc_use_downsample(sess->pixfmt_cap, hevc->is_10bit)) ++ header_adr = hevc->common.mmu_header_paddr[vb->index]; ++ amvdec_write_dos(core, HEVC_CM_HEADER_START_ADDR, header_adr); ++ /* use HEVC_CM_HEADER_START_ADDR */ ++ amvdec_write_dos_bits(core, HEVC_SAO_CTRL5, BIT(10)); ++ amvdec_write_dos_bits(core, HEVC_SAO_CTRL9, BIT(0)); ++ } ++ ++ amvdec_write_dos(core, HEVC_SAO_Y_LENGTH, ++ amvdec_get_output_size(sess)); ++ amvdec_write_dos(core, HEVC_SAO_C_LENGTH, ++ (amvdec_get_output_size(sess) / 2)); ++ ++ if (frame->cur_slice_idx == 0) { ++ if (core->platform->revision >= VDEC_REVISION_G12A) { ++ if (core->platform->revision >= VDEC_REVISION_SM1) ++ val = 0xfc << 8; ++ else ++ val = 0x54 << 8; ++ ++ /* enable first, compressed write */ ++ if (codec_hevc_use_fbc(sess->pixfmt_cap, ++ hevc->is_10bit)) ++ val |= BIT(8); ++ ++ /* enable second, uncompressed write */ ++ if (sess->pixfmt_cap == V4L2_PIX_FMT_NV12M) ++ val |= BIT(9); ++ ++ /* dblk pipeline mode=1 for performance */ ++ if (hevc->width >= 1280) ++ val |= BIT(4); ++ ++ amvdec_write_dos(core, HEVC_DBLK_CFGB, val); ++ amvdec_write_dos(core, HEVC_DBLK_STS1 + 16, BIT(28)); ++ } ++ ++ amvdec_write_dos(core, HEVC_DBLK_CFG2, ++ hevc->width | (hevc->height << 16)); ++ ++ val = 0; ++ if ((misc_flag0 >> PCM_ENABLE_FLAG_BIT) & 0x1) ++ val |= ((misc_flag0 >> ++ PCM_LOOP_FILTER_DISABLED_FLAG_BIT) & 0x1) << 3; ++ ++ val |= (param->p.pps_cb_qp_offset & 0x1f) << 4; ++ val |= (param->p.pps_cr_qp_offset & 0x1f) << 9; ++ val |= (hevc->lcu_size == 64) ? 0 : ++ ((hevc->lcu_size == 32) ? 1 : 2); ++ amvdec_write_dos(core, HEVC_DBLK_CFG1, val); ++ } ++ ++ val = amvdec_read_dos(core, HEVC_SAO_CTRL1) & ~0x3ff3; ++ val |= 0xff0; /* Set endianness for 2-bytes swaps (nv12) */ ++ if (core->platform->revision < VDEC_REVISION_G12A) { ++ if (!codec_hevc_use_fbc(sess->pixfmt_cap, hevc->is_10bit)) ++ val |= BIT(0); /* disable cm compression */ ++ /* TOFIX: Handle Amlogic Framebuffer compression */ ++ } ++ ++ amvdec_write_dos(core, HEVC_SAO_CTRL1, val); ++ ++ if (!codec_hevc_use_fbc(sess->pixfmt_cap, hevc->is_10bit)) { ++ /* no downscale for NV12 */ ++ val = amvdec_read_dos(core, HEVC_SAO_CTRL5) & ~0xff0000; ++ amvdec_write_dos(core, HEVC_SAO_CTRL5, val); ++ } ++ ++ val = amvdec_read_dos(core, HEVCD_IPP_AXIIF_CONFIG) & ~0x30; ++ val |= 0xf; ++ amvdec_write_dos(core, HEVCD_IPP_AXIIF_CONFIG, val); ++ ++ val = 0; ++ val_2 = amvdec_read_dos(core, HEVC_SAO_CTRL0); ++ val_2 &= (~0x300); ++ ++ slice_deblocking_filter_disabled_flag = (misc_flag0 >> ++ SLICE_DEBLOCKING_FILTER_DISABLED_FLAG_BIT) & 0x1; ++ if ((misc_flag0 & (1 << DEBLOCKING_FILTER_OVERRIDE_ENABLED_FLAG_BIT)) ++ && (misc_flag0 & (1 << DEBLOCKING_FILTER_OVERRIDE_FLAG_BIT))) { ++ val |= slice_deblocking_filter_disabled_flag << 2; ++ ++ if (!slice_deblocking_filter_disabled_flag) { ++ val |= (param->p.slice_beta_offset_div2 & 0xf) << 3; ++ val |= (param->p.slice_tc_offset_div2 & 0xf) << 7; ++ } ++ } else { ++ val |= ++ ((misc_flag0 >> ++ PPS_DEBLOCKING_FILTER_DISABLED_FLAG_BIT) & 0x1) << 2; ++ ++ if (((misc_flag0 >> PPS_DEBLOCKING_FILTER_DISABLED_FLAG_BIT) & ++ 0x1) == 0) { ++ val |= (param->p.pps_beta_offset_div2 & 0xf) << 3; ++ val |= (param->p.pps_tc_offset_div2 & 0xf) << 7; ++ } ++ } ++ if ((misc_flag0 & (1 << PPS_LOOP_FILTER_ACROSS_SLICES_ENABLED_FLAG_BIT)) ++ && ((misc_flag0 & (1 << SLICE_SAO_LUMA_FLAG_BIT)) ++ || (misc_flag0 & (1 << SLICE_SAO_CHROMA_FLAG_BIT)) ++ || (!slice_deblocking_filter_disabled_flag))) { ++ val |= ++ ((misc_flag0 >> ++ SLICE_LOOP_FILTER_ACROSS_SLICES_ENABLED_FLAG_BIT) ++ & 0x1) << 1; ++ val_2 |= ++ ((misc_flag0 >> ++ SLICE_LOOP_FILTER_ACROSS_SLICES_ENABLED_FLAG_BIT) ++ & 0x1) << 9; ++ } else { ++ val |= ++ ((misc_flag0 >> ++ PPS_LOOP_FILTER_ACROSS_SLICES_ENABLED_FLAG_BIT) ++ & 0x1) << 1; ++ val_2 |= ++ ((misc_flag0 >> ++ PPS_LOOP_FILTER_ACROSS_SLICES_ENABLED_FLAG_BIT) ++ & 0x1) << 9; ++ } ++ ++ amvdec_write_dos(core, HEVC_DBLK_CFG9, val); ++ amvdec_write_dos(core, HEVC_SAO_CTRL0, val_2); ++ ++ amvdec_write_dos(core, HEVC_sao_mem_unit, sao_mem_unit); ++ amvdec_write_dos(core, HEVC_SAO_ABV, ++ hevc->workspace_paddr + SAO_ABV_OFFSET); ++ amvdec_write_dos(core, HEVC_sao_vb_size, sao_vb_size); ++ amvdec_write_dos(core, HEVC_SAO_VB, ++ hevc->workspace_paddr + SAO_VB_OFFSET); ++} ++ ++static dma_addr_t codec_hevc_get_frame_mv_paddr(struct codec_hevc *hevc, ++ struct hevc_frame *frame) ++{ ++ return hevc->workspace_paddr + MPRED_MV_OFFSET + ++ (frame->vbuf->vb2_buf.index * MPRED_MV_BUF_SIZE); ++} ++ ++static void ++codec_hevc_set_mpred_ctrl(struct amvdec_core *core, struct codec_hevc *hevc) ++{ ++ union rpm_param *param = &hevc->rpm_param; ++ u32 slice_type = param->p.slice_type; ++ u32 lcu_size_log2 = ilog2(hevc->lcu_size); ++ u32 val; ++ ++ val = slice_type | ++ MPRED_CTRL0_ABOVE_EN | ++ MPRED_CTRL0_MV_WR_EN | ++ MPRED_CTRL0_BUF_LINEAR | ++ (lcu_size_log2 << 16) | ++ (3 << 20) | /* cu_size_log2 */ ++ (param->p.log2_parallel_merge_level << 24); ++ ++ if (slice_type != I_SLICE) ++ val |= MPRED_CTRL0_MV_RD_EN; ++ ++ if (param->p.collocated_from_l0_flag) ++ val |= MPRED_CTRL0_COL_FROM_L0; ++ ++ if (param->p.slice_temporal_mvp_enable_flag) ++ val |= MPRED_CTRL0_TMVP; ++ ++ if (hevc->ldc_flag) ++ val |= MPRED_CTRL0_LDC; ++ ++ if (param->p.dependent_slice_segment_flag) ++ val |= MPRED_CTRL0_NEW_SLI_SEG; ++ ++ if (param->p.slice_segment_address == 0) ++ val |= MPRED_CTRL0_NEW_PIC | ++ MPRED_CTRL0_NEW_TILE; ++ ++ amvdec_write_dos(core, HEVC_MPRED_CTRL0, val); ++ ++ val = (5 - param->p.five_minus_max_num_merge_cand) | ++ (AMVP_MAX_NUM_CANDS << 4) | ++ (AMVP_MAX_NUM_CANDS_MEM << 8) | ++ (NUM_CHROMA_MODE << 12) | ++ (DM_CHROMA_IDX << 16); ++ amvdec_write_dos(core, HEVC_MPRED_CTRL1, val); ++} ++ ++static void codec_hevc_set_mpred_mv(struct amvdec_core *core, ++ struct codec_hevc *hevc, ++ struct hevc_frame *frame, ++ struct hevc_frame *col_frame) ++{ ++ union rpm_param *param = &hevc->rpm_param; ++ u32 lcu_size_log2 = ilog2(hevc->lcu_size); ++ u32 mv_mem_unit = lcu_size_log2 == 6 ? 0x200 : ++ lcu_size_log2 == 5 ? 0x80 : 0x20; ++ dma_addr_t col_mv_rd_start_addr, col_mv_rd_ptr, col_mv_rd_end_addr; ++ dma_addr_t mpred_mv_wr_ptr; ++ u32 val; ++ ++ val = amvdec_read_dos(core, HEVC_MPRED_CURR_LCU); ++ ++ col_mv_rd_start_addr = codec_hevc_get_frame_mv_paddr(hevc, col_frame); ++ mpred_mv_wr_ptr = codec_hevc_get_frame_mv_paddr(hevc, frame) + ++ (hevc->slice_addr * mv_mem_unit); ++ col_mv_rd_ptr = col_mv_rd_start_addr + ++ (hevc->slice_addr * mv_mem_unit); ++ col_mv_rd_end_addr = col_mv_rd_start_addr + ++ (hevc->lcu_total * mv_mem_unit); ++ ++ amvdec_write_dos(core, HEVC_MPRED_MV_WR_START_ADDR, ++ codec_hevc_get_frame_mv_paddr(hevc, frame)); ++ amvdec_write_dos(core, HEVC_MPRED_MV_RD_START_ADDR, ++ col_mv_rd_start_addr); ++ ++ if (param->p.slice_segment_address == 0) { ++ amvdec_write_dos(core, HEVC_MPRED_ABV_START_ADDR, ++ hevc->workspace_paddr + MPRED_ABV_OFFSET); ++ amvdec_write_dos(core, HEVC_MPRED_MV_WPTR, mpred_mv_wr_ptr); ++ amvdec_write_dos(core, HEVC_MPRED_MV_RPTR, ++ col_mv_rd_start_addr); ++ } else { ++ amvdec_write_dos(core, HEVC_MPRED_MV_RPTR, col_mv_rd_ptr); ++ } ++ ++ amvdec_write_dos(core, HEVC_MPRED_MV_RD_END_ADDR, col_mv_rd_end_addr); ++} ++ ++/* Update motion prediction with the current slice */ ++static void codec_hevc_set_mpred(struct amvdec_session *sess, ++ struct hevc_frame *frame, ++ struct hevc_frame *col_frame) ++{ ++ struct amvdec_core *core = sess->core; ++ struct codec_hevc *hevc = sess->priv; ++ u32 *ref_num = frame->ref_num; ++ u32 *ref_poc_l0 = frame->ref_poc_list[0][frame->cur_slice_idx]; ++ u32 *ref_poc_l1 = frame->ref_poc_list[1][frame->cur_slice_idx]; ++ u32 val; ++ int i; ++ ++ codec_hevc_set_mpred_ctrl(core, hevc); ++ codec_hevc_set_mpred_mv(core, hevc, frame, col_frame); ++ ++ amvdec_write_dos(core, HEVC_MPRED_PIC_SIZE, ++ hevc->width | (hevc->height << 16)); ++ ++ val = ((hevc->lcu_x_num - 1) | (hevc->lcu_y_num - 1) << 16); ++ amvdec_write_dos(core, HEVC_MPRED_PIC_SIZE_LCU, val); ++ ++ amvdec_write_dos(core, HEVC_MPRED_REF_NUM, ++ (ref_num[1] << 8) | ref_num[0]); ++ amvdec_write_dos(core, HEVC_MPRED_REF_EN_L0, (1 << ref_num[0]) - 1); ++ amvdec_write_dos(core, HEVC_MPRED_REF_EN_L1, (1 << ref_num[1]) - 1); ++ ++ amvdec_write_dos(core, HEVC_MPRED_CUR_POC, hevc->curr_poc); ++ amvdec_write_dos(core, HEVC_MPRED_COL_POC, hevc->col_poc); ++ ++ for (i = 0; i < MAX_REF_ACTIVE; ++i) { ++ amvdec_write_dos(core, HEVC_MPRED_L0_REF00_POC + i * 4, ++ ref_poc_l0[i]); ++ amvdec_write_dos(core, HEVC_MPRED_L1_REF00_POC + i * 4, ++ ref_poc_l1[i]); ++ } ++} ++ ++/* motion compensation reference cache controller */ ++static void codec_hevc_set_mcrcc(struct amvdec_session *sess) ++{ ++ struct amvdec_core *core = sess->core; ++ struct codec_hevc *hevc = sess->priv; ++ u32 val, val_2; ++ int l0_cnt = 0; ++ int l1_cnt = 0x7fff; ++ ++ if (!codec_hevc_use_fbc(sess->pixfmt_cap, hevc->is_10bit)) { ++ l0_cnt = hevc->cur_frame->ref_num[0]; ++ l1_cnt = hevc->cur_frame->ref_num[1]; ++ } ++ ++ if (hevc->cur_frame->cur_slice_type == I_SLICE) { ++ amvdec_write_dos(core, HEVCD_MCRCC_CTL1, 0); ++ return; ++ } ++ ++ if (hevc->cur_frame->cur_slice_type == P_SLICE) { ++ amvdec_write_dos(core, HEVCD_MPP_ANC_CANVAS_ACCCONFIG_ADDR, ++ BIT(1)); ++ val = amvdec_read_dos(core, HEVCD_MPP_ANC_CANVAS_DATA_ADDR); ++ val &= 0xffff; ++ val |= (val << 16); ++ amvdec_write_dos(core, HEVCD_MCRCC_CTL2, val); ++ ++ if (l0_cnt == 1) { ++ amvdec_write_dos(core, HEVCD_MCRCC_CTL3, val); ++ } else { ++ val = amvdec_read_dos(core, ++ HEVCD_MPP_ANC_CANVAS_DATA_ADDR); ++ val &= 0xffff; ++ val |= (val << 16); ++ amvdec_write_dos(core, HEVCD_MCRCC_CTL3, val); ++ } ++ } else { /* B_SLICE */ ++ amvdec_write_dos(core, HEVCD_MPP_ANC_CANVAS_ACCCONFIG_ADDR, 0); ++ val = amvdec_read_dos(core, HEVCD_MPP_ANC_CANVAS_DATA_ADDR); ++ val &= 0xffff; ++ val |= (val << 16); ++ amvdec_write_dos(core, HEVCD_MCRCC_CTL2, val); ++ ++ amvdec_write_dos(core, HEVCD_MPP_ANC_CANVAS_ACCCONFIG_ADDR, ++ BIT(12) | BIT(1)); ++ val_2 = amvdec_read_dos(core, HEVCD_MPP_ANC_CANVAS_DATA_ADDR); ++ val_2 &= 0xffff; ++ val_2 |= (val_2 << 16); ++ if (val == val_2 && l1_cnt > 1) { ++ val_2 = amvdec_read_dos(core, ++ HEVCD_MPP_ANC_CANVAS_DATA_ADDR); ++ val_2 &= 0xffff; ++ val_2 |= (val_2 << 16); ++ } ++ amvdec_write_dos(core, HEVCD_MCRCC_CTL3, val); ++ } ++ ++ /* enable mcrcc progressive-mode */ ++ amvdec_write_dos(core, HEVCD_MCRCC_CTL1, 0xff0); ++} ++ ++static void codec_hevc_set_ref_list(struct amvdec_session *sess, ++ u32 ref_num, u32 *ref_poc_list) ++{ ++ struct codec_hevc *hevc = sess->priv; ++ struct hevc_frame *ref_frame; ++ struct amvdec_core *core = sess->core; ++ int i; ++ u32 buf_id_y; ++ u32 buf_id_uv; ++ ++ for (i = 0; i < ref_num; i++) { ++ ref_frame = codec_hevc_get_frame_by_poc(hevc, ref_poc_list[i]); ++ ++ if (!ref_frame) { ++ dev_warn(core->dev, "Couldn't find ref. frame %u\n", ++ ref_poc_list[i]); ++ continue; ++ } ++ ++ if (codec_hevc_use_fbc(sess->pixfmt_cap, hevc->is_10bit)) { ++ buf_id_y = buf_id_uv = ref_frame->vbuf->vb2_buf.index; ++ } else { ++ buf_id_y = ref_frame->vbuf->vb2_buf.index * 2; ++ buf_id_uv = buf_id_y + 1; ++ } ++ ++ amvdec_write_dos(core, HEVCD_MPP_ANC_CANVAS_DATA_ADDR, ++ (buf_id_uv << 16) | ++ (buf_id_uv << 8) | ++ buf_id_y); ++ } ++} ++ ++static void codec_hevc_set_mc(struct amvdec_session *sess, ++ struct hevc_frame *frame) ++{ ++ struct amvdec_core *core = sess->core; ++ ++ if (frame->cur_slice_type == I_SLICE) ++ return; ++ ++ amvdec_write_dos(core, HEVCD_MPP_ANC_CANVAS_ACCCONFIG_ADDR, 1); ++ codec_hevc_set_ref_list(sess, frame->ref_num[0], ++ frame->ref_poc_list[0][frame->cur_slice_idx]); ++ ++ if (frame->cur_slice_type == P_SLICE) ++ return; ++ ++ amvdec_write_dos(core, HEVCD_MPP_ANC_CANVAS_ACCCONFIG_ADDR, ++ BIT(12) | BIT(0)); ++ codec_hevc_set_ref_list(sess, frame->ref_num[1], ++ frame->ref_poc_list[1][frame->cur_slice_idx]); ++} ++ ++static void codec_hevc_update_col_frame(struct codec_hevc *hevc) ++{ ++ struct hevc_frame *cur_frame = hevc->cur_frame; ++ union rpm_param *param = &hevc->rpm_param; ++ u32 list_no = 0; ++ u32 col_ref = param->p.collocated_ref_idx; ++ u32 col_from_l0 = param->p.collocated_from_l0_flag; ++ u32 cur_slice_idx = cur_frame->cur_slice_idx; ++ ++ if (cur_frame->cur_slice_type == B_SLICE) ++ list_no = 1 - col_from_l0; ++ ++ if (col_ref >= cur_frame->ref_num[list_no]) ++ hevc->col_poc = INVALID_POC; ++ else ++ hevc->col_poc = cur_frame->ref_poc_list[list_no] ++ [cur_slice_idx] ++ [col_ref]; ++ ++ if (cur_frame->cur_slice_type == I_SLICE) ++ goto end; ++ ++ if (hevc->col_poc != INVALID_POC) ++ hevc->col_frame = codec_hevc_get_frame_by_poc(hevc, ++ hevc->col_poc); ++ else ++ hevc->col_frame = hevc->cur_frame; ++ ++end: ++ if (!hevc->col_frame) ++ hevc->col_frame = hevc->cur_frame; ++} ++ ++static void codec_hevc_update_pocs(struct amvdec_session *sess) ++{ ++ struct codec_hevc *hevc = sess->priv; ++ union rpm_param *param = &hevc->rpm_param; ++ u32 nal_unit_type = param->p.m_nalUnitType; ++ u32 temporal_id = param->p.m_temporalId & 0x7; ++ int max_poc_lsb = ++ 1 << (param->p.log2_max_pic_order_cnt_lsb_minus4 + 4); ++ int prev_poc_lsb; ++ int prev_poc_msb; ++ int poc_msb; ++ int poc_lsb = param->p.POClsb; ++ ++ if (nal_unit_type == NAL_UNIT_CODED_SLICE_IDR || ++ nal_unit_type == NAL_UNIT_CODED_SLICE_IDR_N_LP) { ++ hevc->curr_poc = 0; ++ if ((temporal_id - 1) == 0) ++ hevc->prev_tid0_poc = hevc->curr_poc; ++ ++ return; ++ } ++ ++ prev_poc_lsb = hevc->prev_tid0_poc % max_poc_lsb; ++ prev_poc_msb = hevc->prev_tid0_poc - prev_poc_lsb; ++ ++ if ((poc_lsb < prev_poc_lsb) && ++ ((prev_poc_lsb - poc_lsb) >= (max_poc_lsb / 2))) ++ poc_msb = prev_poc_msb + max_poc_lsb; ++ else if ((poc_lsb > prev_poc_lsb) && ++ ((poc_lsb - prev_poc_lsb) > (max_poc_lsb / 2))) ++ poc_msb = prev_poc_msb - max_poc_lsb; ++ else ++ poc_msb = prev_poc_msb; ++ ++ if (nal_unit_type == NAL_UNIT_CODED_SLICE_BLA || ++ nal_unit_type == NAL_UNIT_CODED_SLICE_BLANT || ++ nal_unit_type == NAL_UNIT_CODED_SLICE_BLA_N_LP) ++ poc_msb = 0; ++ ++ hevc->curr_poc = (poc_msb + poc_lsb); ++ if ((temporal_id - 1) == 0) ++ hevc->prev_tid0_poc = hevc->curr_poc; ++} ++ ++static void codec_hevc_process_segment_header(struct amvdec_session *sess) ++{ ++ struct codec_hevc *hevc = sess->priv; ++ union rpm_param *param = &hevc->rpm_param; ++ ++ if (param->p.first_slice_segment_in_pic_flag == 0) { ++ hevc->slice_segment_addr = param->p.slice_segment_address; ++ if (!param->p.dependent_slice_segment_flag) ++ hevc->slice_addr = hevc->slice_segment_addr; ++ } else { ++ hevc->slice_segment_addr = 0; ++ hevc->slice_addr = 0; ++ } ++ ++ codec_hevc_update_pocs(sess); ++} ++ ++static int codec_hevc_process_segment(struct amvdec_session *sess) ++{ ++ struct codec_hevc *hevc = sess->priv; ++ struct amvdec_core *core = sess->core; ++ union rpm_param *param = &hevc->rpm_param; ++ u32 slice_segment_address = param->p.slice_segment_address; ++ ++ /* First slice: new frame */ ++ if (slice_segment_address == 0) { ++ codec_hevc_update_referenced(hevc); ++ codec_hevc_output_frames(sess); ++ ++ hevc->cur_frame = codec_hevc_prepare_new_frame(sess); ++ if (!hevc->cur_frame) ++ return -1; ++ } else { ++ hevc->cur_frame->cur_slice_idx++; ++ } ++ ++ codec_hevc_update_frame_refs(sess, hevc->cur_frame); ++ codec_hevc_update_col_frame(hevc); ++ codec_hevc_update_ldc_flag(hevc); ++ if (codec_hevc_use_mmu(core->platform->revision, sess->pixfmt_cap, ++ hevc->is_10bit)) ++ codec_hevc_fill_mmu_map(sess, &hevc->common, ++ &hevc->cur_frame->vbuf->vb2_buf, ++ hevc->is_10bit); ++ codec_hevc_set_mc(sess, hevc->cur_frame); ++ codec_hevc_set_mcrcc(sess); ++ codec_hevc_set_mpred(sess, hevc->cur_frame, hevc->col_frame); ++ codec_hevc_set_sao(sess, hevc->cur_frame); ++ ++ amvdec_write_dos_bits(core, HEVC_WAIT_FLAG, BIT(1)); ++ amvdec_write_dos(core, HEVC_DEC_STATUS_REG, ++ HEVC_CODED_SLICE_SEGMENT_DAT); ++ ++ /* Interrupt the firmware's processor */ ++ amvdec_write_dos(core, HEVC_MCPU_INTR_REQ, AMRISC_MAIN_REQ); ++ ++ return 0; ++} ++ ++static int codec_hevc_process_rpm(struct codec_hevc *hevc) ++{ ++ union rpm_param *param = &hevc->rpm_param; ++ int src_changed = 0; ++ u32 dst_width, dst_height; ++ u32 lcu_size; ++ u32 is_10bit = 0; ++ ++ if (param->p.slice_segment_address || ++ !param->p.pic_width_in_luma_samples || ++ !param->p.pic_height_in_luma_samples) ++ return 0; ++ ++ if (param->p.bit_depth) ++ is_10bit = 1; ++ ++ hevc->width = param->p.pic_width_in_luma_samples; ++ hevc->height = param->p.pic_height_in_luma_samples; ++ dst_width = hevc->width; ++ dst_height = hevc->height; ++ ++ lcu_size = 1 << (param->p.log2_min_coding_block_size_minus3 + ++ 3 + param->p.log2_diff_max_min_coding_block_size); ++ ++ hevc->lcu_x_num = (hevc->width + lcu_size - 1) / lcu_size; ++ hevc->lcu_y_num = (hevc->height + lcu_size - 1) / lcu_size; ++ hevc->lcu_total = hevc->lcu_x_num * hevc->lcu_y_num; ++ ++ if (param->p.conformance_window_flag) { ++ u32 sub_width = 1, sub_height = 1; ++ ++ switch (param->p.chroma_format_idc) { ++ case 1: ++ sub_height = 2; /* fallthrough */ ++ case 2: ++ sub_width = 2; ++ break; ++ } ++ ++ dst_width -= sub_width * ++ (param->p.conf_win_left_offset + ++ param->p.conf_win_right_offset); ++ dst_height -= sub_height * ++ (param->p.conf_win_top_offset + ++ param->p.conf_win_bottom_offset); ++ } ++ ++ if (dst_width != hevc->dst_width || ++ dst_height != hevc->dst_height || ++ lcu_size != hevc->lcu_size || ++ is_10bit != hevc->is_10bit) ++ src_changed = 1; ++ ++ hevc->dst_width = dst_width; ++ hevc->dst_height = dst_height; ++ hevc->lcu_size = lcu_size; ++ hevc->is_10bit = is_10bit; ++ ++ return src_changed; ++} ++ ++/* ++ * The RPM section within the workspace contains ++ * many information regarding the parsed bitstream ++ */ ++static void codec_hevc_fetch_rpm(struct amvdec_session *sess) ++{ ++ struct codec_hevc *hevc = sess->priv; ++ u16 *rpm_vaddr = hevc->workspace_vaddr + RPM_OFFSET; ++ int i, j; ++ ++ for (i = 0; i < RPM_SIZE; i += 4) ++ for (j = 0; j < 4; j++) ++ hevc->rpm_param.l.data[i + j] = rpm_vaddr[i + 3 - j]; ++} ++ ++static void codec_hevc_resume(struct amvdec_session *sess) ++{ ++ struct codec_hevc *hevc = sess->priv; ++ ++ if (codec_hevc_setup_buffers(sess, &hevc->common, hevc->is_10bit)) { ++ amvdec_abort(sess); ++ return; ++ } ++ ++ codec_hevc_setup_decode_head(sess, hevc->is_10bit); ++ codec_hevc_process_segment_header(sess); ++ if (codec_hevc_process_segment(sess)) ++ amvdec_abort(sess); ++} ++ ++static irqreturn_t codec_hevc_threaded_isr(struct amvdec_session *sess) ++{ ++ struct amvdec_core *core = sess->core; ++ struct codec_hevc *hevc = sess->priv; ++ u32 dec_status = amvdec_read_dos(core, HEVC_DEC_STATUS_REG); ++ ++ if (!hevc) ++ return IRQ_HANDLED; ++ ++ mutex_lock(&hevc->lock); ++ if (dec_status != HEVC_SLICE_SEGMENT_DONE) { ++ dev_err(core->dev_dec, "Unrecognized dec_status: %08X\n", ++ dec_status); ++ amvdec_abort(sess); ++ goto unlock; ++ } ++ ++ sess->keyframe_found = 1; ++ codec_hevc_fetch_rpm(sess); ++ if (codec_hevc_process_rpm(hevc)) { ++ amvdec_src_change(sess, hevc->dst_width, hevc->dst_height, 16, ++ hevc->is_10bit ? 10 : 8); ++ goto unlock; ++ } ++ ++ codec_hevc_process_segment_header(sess); ++ if (codec_hevc_process_segment(sess)) ++ amvdec_abort(sess); ++ ++unlock: ++ mutex_unlock(&hevc->lock); ++ return IRQ_HANDLED; ++} ++ ++static irqreturn_t codec_hevc_isr(struct amvdec_session *sess) ++{ ++ return IRQ_WAKE_THREAD; ++} ++ ++struct amvdec_codec_ops codec_hevc_ops = { ++ .start = codec_hevc_start, ++ .stop = codec_hevc_stop, ++ .isr = codec_hevc_isr, ++ .threaded_isr = codec_hevc_threaded_isr, ++ .num_pending_bufs = codec_hevc_num_pending_bufs, ++ .drain = codec_hevc_flush_output, ++ .resume = codec_hevc_resume, ++}; +diff --git a/drivers/staging/media/meson/vdec/codec_hevc.h b/drivers/staging/media/meson/vdec/codec_hevc.h +new file mode 100644 +index 000000000000..f2f9b2464df1 +--- /dev/null ++++ b/drivers/staging/media/meson/vdec/codec_hevc.h +@@ -0,0 +1,13 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Copyright (C) 2018 Maxime Jourdan ++ */ ++ ++#ifndef __MESON_VDEC_CODEC_HEVC_H_ ++#define __MESON_VDEC_CODEC_HEVC_H_ ++ ++#include "vdec.h" ++ ++extern struct amvdec_codec_ops codec_hevc_ops; ++ ++#endif +diff --git a/drivers/staging/media/meson/vdec/esparser.c b/drivers/staging/media/meson/vdec/esparser.c +index 610a92b9f6f2..9b6034936d32 100644 +--- a/drivers/staging/media/meson/vdec/esparser.c ++++ b/drivers/staging/media/meson/vdec/esparser.c +@@ -309,7 +309,7 @@ esparser_queue(struct amvdec_session *sess, struct vb2_v4l2_buffer *vbuf) + * they could pause when there is no capture buffer available and + * resume on this notification. + */ +- if (sess->fmt_out->pixfmt == V4L2_PIX_FMT_VP9) { ++ if (sess->fmt_out->pixfmt == V4L2_PIX_FMT_VP9 || sess->fmt_out->pixfmt ==V4L2_PIX_FMT_HEVC) { + if (codec_ops->num_pending_bufs) + num_dst_bufs = codec_ops->num_pending_bufs(sess); + +diff --git a/drivers/staging/media/meson/vdec/hevc_regs.h b/drivers/staging/media/meson/vdec/hevc_regs.h +index 0392f41a1eed..e7eabdd2b119 100644 +--- a/drivers/staging/media/meson/vdec/hevc_regs.h ++++ b/drivers/staging/media/meson/vdec/hevc_regs.h +@@ -205,6 +205,7 @@ + #define HEVC_CM_HEADER_START_ADDR 0xd8a0 + #define HEVC_CM_HEADER_LENGTH 0xd8a4 + #define HEVC_CM_HEADER_OFFSET 0xd8ac ++#define HEVC_SAO_CTRL9 0xd8b4 + #define HEVC_SAO_MMU_VH0_ADDR 0xd8e8 + #define HEVC_SAO_MMU_VH1_ADDR 0xd8ec + +diff --git a/drivers/staging/media/meson/vdec/vdec_platform.c b/drivers/staging/media/meson/vdec/vdec_platform.c +index eabbebab2da2..3f463e0538fd 100644 +--- a/drivers/staging/media/meson/vdec/vdec_platform.c ++++ b/drivers/staging/media/meson/vdec/vdec_platform.c +@@ -11,6 +11,7 @@ + #include "vdec_hevc.h" + #include "codec_mpeg12.h" + #include "codec_h264.h" ++#include "codec_hevc.h" + #include "codec_vp9.h" + + static const struct amvdec_format vdec_formats_gxbb[] = { +@@ -64,6 +65,18 @@ static const struct amvdec_format vdec_formats_gxl[] = { + .pixfmts_cap = { V4L2_PIX_FMT_NV12M, 0 }, + .flags = V4L2_FMT_FLAG_COMPRESSED | + V4L2_FMT_FLAG_DYN_RESOLUTION, ++ }, { ++ .pixfmt = V4L2_PIX_FMT_HEVC, ++ .min_buffers = 4, ++ .max_buffers = 24, ++ .max_width = 3840, ++ .max_height = 2160, ++ .vdec_ops = &vdec_hevc_ops, ++ .codec_ops = &codec_hevc_ops, ++ .firmware_path = "meson/vdec/gxl_hevc.bin", ++ .pixfmts_cap = { V4L2_PIX_FMT_NV12M, 0 }, ++ .flags = V4L2_FMT_FLAG_COMPRESSED | ++ V4L2_FMT_FLAG_DYN_RESOLUTION, + }, { + .pixfmt = V4L2_PIX_FMT_H264, + .min_buffers = 2, +@@ -103,6 +116,18 @@ static const struct amvdec_format vdec_formats_gxl[] = { + + static const struct amvdec_format vdec_formats_gxm[] = { + { ++ .pixfmt = V4L2_PIX_FMT_HEVC, ++ .min_buffers = 4, ++ .max_buffers = 24, ++ .max_width = 3840, ++ .max_height = 2160, ++ .vdec_ops = &vdec_hevc_ops, ++ .codec_ops = &codec_hevc_ops, ++ .firmware_path = "meson/vdec/gxl_hevc.bin", ++ .pixfmts_cap = { V4L2_PIX_FMT_NV12M, 0 }, ++ .flags = V4L2_FMT_FLAG_COMPRESSED | ++ V4L2_FMT_FLAG_DYN_RESOLUTION, ++ }, { + .pixfmt = V4L2_PIX_FMT_H264, + .min_buffers = 2, + .max_buffers = 24, +@@ -153,6 +178,18 @@ static const struct amvdec_format vdec_formats_g12a[] = { + .flags = V4L2_FMT_FLAG_COMPRESSED | + V4L2_FMT_FLAG_DYN_RESOLUTION, + }, { ++ .pixfmt = V4L2_PIX_FMT_HEVC, ++ .min_buffers = 4, ++ .max_buffers = 24, ++ .max_width = 3840, ++ .max_height = 2160, ++ .vdec_ops = &vdec_hevc_ops, ++ .codec_ops = &codec_hevc_ops, ++ .firmware_path = "meson/vdec/g12a_hevc_mmu.bin", ++ .pixfmts_cap = { V4L2_PIX_FMT_NV12M, 0 }, ++ .flags = V4L2_FMT_FLAG_COMPRESSED | ++ V4L2_FMT_FLAG_DYN_RESOLUTION, ++ },{ + .pixfmt = V4L2_PIX_FMT_H264, + .min_buffers = 2, + .max_buffers = 24, +@@ -202,6 +239,18 @@ static const struct amvdec_format vdec_formats_sm1[] = { + .pixfmts_cap = { V4L2_PIX_FMT_NV12M, 0 }, + .flags = V4L2_FMT_FLAG_COMPRESSED | + V4L2_FMT_FLAG_DYN_RESOLUTION, ++ }, { ++ .pixfmt = V4L2_PIX_FMT_HEVC, ++ .min_buffers = 4, ++ .max_buffers = 24, ++ .max_width = 3840, ++ .max_height = 2160, ++ .vdec_ops = &vdec_hevc_ops, ++ .codec_ops = &codec_hevc_ops, ++ .firmware_path = "meson/vdec/sm1_hevc_mmu.bin", ++ .pixfmts_cap = { V4L2_PIX_FMT_NV12M, 0 }, ++ .flags = V4L2_FMT_FLAG_COMPRESSED | ++ V4L2_FMT_FLAG_DYN_RESOLUTION, + }, { + .pixfmt = V4L2_PIX_FMT_H264, + .min_buffers = 2, +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0033-WIP-drivers-meson-vdec-add-handling-to-HEVC-decoder-.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0033-WIP-drivers-meson-vdec-add-handling-to-HEVC-decoder-.patch new file mode 100644 index 0000000000..01c310cecf --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0033-WIP-drivers-meson-vdec-add-handling-to-HEVC-decoder-.patch @@ -0,0 +1,157 @@ +From afb9610594bffe6728a10c63c6d4999a1ab1529b Mon Sep 17 00:00:00 2001 +From: benjamin545 +Date: Mon, 2 Aug 2021 15:18:40 -0400 +Subject: [PATCH 33/60] WIP: drivers: meson: vdec: add handling to HEVC decoder + to show frames when ready + +..rather than when no longer referenced + +the HEVC decode driver would not show the next frame until it was no longer referenced, +this would cause a backup of frames that were ready to render but held up by one or more +frames that were still referenced. The decoded picture buffer would fill up and stall +playback as no new frames could be placed in the decoded picture buffer. +--- + drivers/staging/media/meson/vdec/codec_hevc.c | 52 ++++++++++++------- + 1 file changed, 34 insertions(+), 18 deletions(-) + +diff --git a/drivers/staging/media/meson/vdec/codec_hevc.c b/drivers/staging/media/meson/vdec/codec_hevc.c +index 3a6fd04a2d33..01218efde99b 100644 +--- a/drivers/staging/media/meson/vdec/codec_hevc.c ++++ b/drivers/staging/media/meson/vdec/codec_hevc.c +@@ -223,6 +223,7 @@ struct hevc_frame { + u32 poc; + + int referenced; ++ int show; + u32 num_reorder_pic; + + u32 cur_slice_idx; +@@ -448,9 +449,11 @@ static void codec_hevc_update_referenced(struct codec_hevc *hevc) + ((1 << (RPS_USED_BIT - 1)) - 1); + if (param->p.CUR_RPS[i] & (1 << (RPS_USED_BIT - 1))) { + poc_tmp = curr_poc - +- ((1 << (RPS_USED_BIT - 1)) - delt); +- } else ++ ((1 << (RPS_USED_BIT - 1)) - delt); ++ } else { + poc_tmp = curr_poc + delt; ++ } ++ + if (poc_tmp == frame->poc) { + is_referenced = 1; + break; +@@ -462,13 +465,13 @@ static void codec_hevc_update_referenced(struct codec_hevc *hevc) + } + + static struct hevc_frame * +-codec_hevc_get_lowest_poc_frame(struct codec_hevc *hevc) ++codec_hevc_get_next_ready_frame(struct codec_hevc *hevc) + { + struct hevc_frame *tmp, *ret = NULL; + u32 poc = INT_MAX; + + list_for_each_entry(tmp, &hevc->ref_frames_list, list) { +- if (tmp->poc < poc) { ++ if ((tmp->poc < poc) && tmp->show) { + ret = tmp; + poc = tmp->poc; + } +@@ -478,28 +481,35 @@ codec_hevc_get_lowest_poc_frame(struct codec_hevc *hevc) + } + + /* Try to output as many frames as possible */ +-static void codec_hevc_output_frames(struct amvdec_session *sess) ++static void codec_hevc_show_frames(struct amvdec_session *sess) + { +- struct hevc_frame *tmp; ++ struct hevc_frame *tmp, *n; + struct codec_hevc *hevc = sess->priv; + +- while ((tmp = codec_hevc_get_lowest_poc_frame(hevc))) { ++ while ((tmp = codec_hevc_get_next_ready_frame(hevc))) { + if (hevc->curr_poc && +- (tmp->referenced || +- tmp->num_reorder_pic >= hevc->frames_num)) ++ (hevc->frames_num <= tmp->num_reorder_pic)) + break; + + dev_dbg(sess->core->dev, "DONE frame poc %u; vbuf %u\n", + tmp->poc, tmp->vbuf->vb2_buf.index); + amvdec_dst_buf_done_offset(sess, tmp->vbuf, tmp->offset, + V4L2_FIELD_NONE, false); ++ ++ tmp->show = 0; ++ hevc->frames_num--; ++ } ++ ++ /* clean output frame buffer */ ++ list_for_each_entry_safe(tmp, n, &hevc->ref_frames_list, list) { ++ if (tmp->referenced || tmp->show) ++ continue; ++ + list_del(&tmp->list); + kfree(tmp); +- hevc->frames_num--; + } + } + +- + static int + codec_hevc_setup_workspace(struct amvdec_session *sess, + struct codec_hevc *hevc) +@@ -650,14 +660,17 @@ static int codec_hevc_start(struct amvdec_session *sess) + static void codec_hevc_flush_output(struct amvdec_session *sess) + { + struct codec_hevc *hevc = sess->priv; +- struct hevc_frame *tmp; ++ struct hevc_frame *tmp, *n; + +- while (!list_empty(&hevc->ref_frames_list)) { +- tmp = codec_hevc_get_lowest_poc_frame(hevc); ++ while ((tmp = codec_hevc_get_next_ready_frame(hevc))) { + amvdec_dst_buf_done(sess, tmp->vbuf, V4L2_FIELD_NONE); ++ tmp->show = 0; ++ hevc->frames_num--; ++ } ++ ++ list_for_each_entry_safe(tmp, n, &hevc->ref_frames_list, list) { + list_del(&tmp->list); + kfree(tmp); +- hevc->frames_num--; + } + } + +@@ -719,6 +732,7 @@ codec_hevc_prepare_new_frame(struct amvdec_session *sess) + + new_frame->vbuf = vbuf; + new_frame->referenced = 1; ++ new_frame->show = 1; + new_frame->poc = hevc->curr_poc; + new_frame->cur_slice_type = params->p.slice_type; + new_frame->num_reorder_pic = params->p.sps_num_reorder_pics_0; +@@ -1267,7 +1281,7 @@ static int codec_hevc_process_segment(struct amvdec_session *sess) + /* First slice: new frame */ + if (slice_segment_address == 0) { + codec_hevc_update_referenced(hevc); +- codec_hevc_output_frames(sess); ++ codec_hevc_show_frames(sess); + + hevc->cur_frame = codec_hevc_prepare_new_frame(sess); + if (!hevc->cur_frame) +@@ -1370,9 +1384,11 @@ static void codec_hevc_fetch_rpm(struct amvdec_session *sess) + u16 *rpm_vaddr = hevc->workspace_vaddr + RPM_OFFSET; + int i, j; + +- for (i = 0; i < RPM_SIZE; i += 4) ++ for (i = 0; i < RPM_SIZE; i += 4) { + for (j = 0; j < 4; j++) +- hevc->rpm_param.l.data[i + j] = rpm_vaddr[i + 3 - j]; ++ hevc->rpm_param.l.data[i + j] = ++ rpm_vaddr[i + 3 - j]; ++ } + } + + static void codec_hevc_resume(struct amvdec_session *sess) +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0034-WIP-drivers-meson-vdec-add-HEVC-support-to-GXBB.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0034-WIP-drivers-meson-vdec-add-HEVC-support-to-GXBB.patch new file mode 100644 index 0000000000..f4a8e0cb79 --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0034-WIP-drivers-meson-vdec-add-HEVC-support-to-GXBB.patch @@ -0,0 +1,39 @@ +From e4ac25d2996360ae77fcd685f0f5bbbb17635c18 Mon Sep 17 00:00:00 2001 +From: Christian Hewitt +Date: Sun, 21 Nov 2021 19:12:07 +0000 +Subject: [PATCH 34/60] WIP: drivers: meson: vdec: add HEVC support to GXBB + +It's not clear whether the GXL firmware is the same one used with GXBB +but let's try it and see! + +Signed-off-by: Christian Hewitt +--- + drivers/staging/media/meson/vdec/vdec_platform.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/drivers/staging/media/meson/vdec/vdec_platform.c b/drivers/staging/media/meson/vdec/vdec_platform.c +index 3f463e0538fd..b03527705cc8 100644 +--- a/drivers/staging/media/meson/vdec/vdec_platform.c ++++ b/drivers/staging/media/meson/vdec/vdec_platform.c +@@ -16,6 +16,18 @@ + + static const struct amvdec_format vdec_formats_gxbb[] = { + { ++ .pixfmt = V4L2_PIX_FMT_HEVC, ++ .min_buffers = 4, ++ .max_buffers = 24, ++ .max_width = 3840, ++ .max_height = 2160, ++ .vdec_ops = &vdec_hevc_ops, ++ .codec_ops = &codec_hevc_ops, ++ .firmware_path = "meson/vdec/gxl_hevc.bin", ++ .pixfmts_cap = { V4L2_PIX_FMT_NV12M, 0 }, ++ .flags = V4L2_FMT_FLAG_COMPRESSED | ++ V4L2_FMT_FLAG_DYN_RESOLUTION, ++ }, { + .pixfmt = V4L2_PIX_FMT_H264, + .min_buffers = 2, + .max_buffers = 24, +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0035-WIP-drivers-meson-vdec-check-if-parser-has-really-pa.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0035-WIP-drivers-meson-vdec-check-if-parser-has-really-pa.patch new file mode 100644 index 0000000000..d2e48d79ac --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0035-WIP-drivers-meson-vdec-check-if-parser-has-really-pa.patch @@ -0,0 +1,51 @@ +From 04190a885f16165acba6c1de28f50ac8d8d4d616 Mon Sep 17 00:00:00 2001 +From: Neil Armstrong +Date: Mon, 22 Nov 2021 09:15:21 +0000 +Subject: [PATCH 35/60] WIP: drivers: meson: vdec: check if parser has really + parser before marking input buffer as error + +Signed-off-by: Neil Armstrong +--- + drivers/staging/media/meson/vdec/esparser.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +diff --git a/drivers/staging/media/meson/vdec/esparser.c b/drivers/staging/media/meson/vdec/esparser.c +index 9b6034936d32..bb9480f0a70c 100644 +--- a/drivers/staging/media/meson/vdec/esparser.c ++++ b/drivers/staging/media/meson/vdec/esparser.c +@@ -300,6 +300,7 @@ esparser_queue(struct amvdec_session *sess, struct vb2_v4l2_buffer *vbuf) + u32 num_dst_bufs = 0; + u32 offset; + u32 pad_size; ++ u32 wp, wp2; + + /* + * When max ref frame is held by VP9, this should be -= 3 to prevent a +@@ -349,15 +350,20 @@ esparser_queue(struct amvdec_session *sess, struct vb2_v4l2_buffer *vbuf) + } + + pad_size = esparser_pad_start_code(core, vb, payload_size); ++ wp = amvdec_read_parser(core, PARSER_VIDEO_WP); + ret = esparser_write_data(core, phy, payload_size + pad_size); ++ wp2 = amvdec_read_parser(core, PARSER_VIDEO_WP); + + if (ret <= 0) { +- dev_warn(core->dev, "esparser: input parsing error\n"); +- amvdec_remove_ts(sess, vb->timestamp); +- v4l2_m2m_buf_done(vbuf, VB2_BUF_STATE_ERROR); + amvdec_write_parser(core, PARSER_FETCH_CMD, 0); + +- return 0; ++ if (ret < 0 || wp2 == wp) { ++ dev_err(core->dev, "esparser: input parsing error ret %d (%x <=> %x)\n", ret, wp, wp2); ++ amvdec_remove_ts(sess, vb->timestamp); ++ v4l2_m2m_buf_done(vbuf, VB2_BUF_STATE_ERROR); ++ ++ return 0; ++ } + } + + atomic_inc(&sess->esparser_queued_bufs); +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0036-WIP-arm64-dts-amlogic-radxa-zero-add-support-for-the.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0036-WIP-arm64-dts-amlogic-radxa-zero-add-support-for-the.patch new file mode 100644 index 0000000000..0de65900b8 --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0036-WIP-arm64-dts-amlogic-radxa-zero-add-support-for-the.patch @@ -0,0 +1,97 @@ +From 6dcf2f9273f30e6f9e6222d3e01087908b84caad Mon Sep 17 00:00:00 2001 +From: Christian Hewitt +Date: Tue, 17 Aug 2021 16:16:43 +0000 +Subject: [PATCH 36/60] WIP: arm64: dts: amlogic: radxa-zero: add support for + the usb type-c controller + +Radxa Zero uses an FUSB302 type-c controller, so lets enable it. + +NB: Polarity swapping via GPIO is not implemented in the current driver +(see drivers/usb/typec/tcpm/fusb302.c) so it is not possible to handle +GPIOAO_6 for USB3 polarity control. + +Suggested-by: Neil Armstrong +Signed-off-by: Christian Hewitt +--- + .../dts/amlogic/meson-g12a-radxa-zero.dts | 47 +++++++++++++++++++ + 1 file changed, 47 insertions(+) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a-radxa-zero.dts b/arch/arm64/boot/dts/amlogic/meson-g12a-radxa-zero.dts +index e3bb6df42ff3..30d799b44559 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12a-radxa-zero.dts ++++ b/arch/arm64/boot/dts/amlogic/meson-g12a-radxa-zero.dts +@@ -60,6 +60,17 @@ + clock-names = "ext_clock"; + }; + ++ typec2_vbus: regulator-typec2_vbus { ++ compatible = "regulator-fixed"; ++ regulator-name = "TYPEC2_VBUS"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ vin-supply = <&ao_5v>; ++ ++ gpio = <&gpio_ao GPIOAO_7 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++ }; ++ + ao_5v: regulator-ao_5v { + compatible = "regulator-fixed"; + regulator-name = "AO_5V"; +@@ -191,6 +202,18 @@ + }; + }; + ++&ao_pinctrl { ++ /* Ensure the TYPE C controller irq pin is not driven by the SoC */ ++ fusb302_irq_pins: fusb302_irq { ++ mux { ++ groups = "GPIOAO_5"; ++ function = "gpio_aobus"; ++ bias-pull-up; ++ output-disable; ++ }; ++ }; ++}; ++ + &arb { + status = "okay"; + }; +@@ -278,6 +301,22 @@ + pinctrl-names = "default"; + }; + ++&i2c_AO { ++ fusb302@22 { ++ compatible = "fcs,fusb302"; ++ reg = <0x22>; ++ ++ pinctrl-0 = <&fusb302_irq_pins>; ++ pinctrl-names = "default"; ++ interrupt-parent = <&gpio_intc>; ++ interrupts = <59 IRQ_TYPE_LEVEL_LOW>; ++ ++ vbus-supply = <&typec2_vbus>; ++ ++ status = "okay"; ++ }; ++}; ++ + &pwm_AO_cd { + pinctrl-0 = <&pwm_ao_d_e_pins>; + pinctrl-names = "default"; +@@ -403,3 +442,11 @@ + status = "okay"; + dr_mode = "host"; + }; ++ ++&usb2_phy0 { ++ phy-supply = <&typec2_vbus>; ++}; ++ ++&usb3_pcie_phy { ++ phy-supply = <&typec2_vbus>; ++}; +-- +2.17.1 + diff --git a/projects/Amlogic/patches/linux/amlogic-0054-WIP-arm64-dts-meson-add-audio-playback-to-p201.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0037-WIP-arm64-dts-meson-add-audio-playback-to-p201.patch similarity index 92% rename from projects/Amlogic/patches/linux/amlogic-0054-WIP-arm64-dts-meson-add-audio-playback-to-p201.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0037-WIP-arm64-dts-meson-add-audio-playback-to-p201.patch index e7a43bd17e..44f348965d 100644 --- a/projects/Amlogic/patches/linux/amlogic-0054-WIP-arm64-dts-meson-add-audio-playback-to-p201.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0037-WIP-arm64-dts-meson-add-audio-playback-to-p201.patch @@ -1,7 +1,7 @@ -From ff0ee624fc64933c03a9132da00f450ae3558e22 Mon Sep 17 00:00:00 2001 +From dc121392d96a65e226ba87e7105c462c90f3232d Mon Sep 17 00:00:00 2001 From: Christian Hewitt Date: Fri, 15 May 2020 07:52:47 +0000 -Subject: [PATCH 54/88] WIP: arm64: dts: meson: add audio playback to p201 +Subject: [PATCH 37/60] WIP: arm64: dts: meson: add audio playback to p201 Add initial audio support limited to HDMI i2s. diff --git a/projects/Amlogic/patches/linux/amlogic-0055-WIP-arm64-dts-meson-add-audio-playback-to-p200.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0038-WIP-arm64-dts-meson-add-audio-playback-to-p200.patch similarity index 94% rename from projects/Amlogic/patches/linux/amlogic-0055-WIP-arm64-dts-meson-add-audio-playback-to-p200.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0038-WIP-arm64-dts-meson-add-audio-playback-to-p200.patch index e727910c57..5c7a6dc1de 100644 --- a/projects/Amlogic/patches/linux/amlogic-0055-WIP-arm64-dts-meson-add-audio-playback-to-p200.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0038-WIP-arm64-dts-meson-add-audio-playback-to-p200.patch @@ -1,7 +1,7 @@ -From a4d6030f56b249cdd7a6234e157e6f731c89f2f7 Mon Sep 17 00:00:00 2001 +From 09c0826a05c34391894102abf3dbe925daa9e97a Mon Sep 17 00:00:00 2001 From: Christian Hewitt Date: Fri, 15 May 2020 07:56:15 +0000 -Subject: [PATCH 55/88] WIP: arm64: dts: meson: add audio playback to p200 +Subject: [PATCH 38/60] WIP: arm64: dts: meson: add audio playback to p200 Add initial support limited to HDMI i2s and SPDIF (LPCM). diff --git a/projects/Amlogic/patches/linux/amlogic-0056-WIP-arm64-dts-meson-add-audio-playback-to-p212-s905x.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0039-WIP-arm64-dts-meson-add-audio-playback-to-p212-s905x.patch similarity index 92% rename from projects/Amlogic/patches/linux/amlogic-0056-WIP-arm64-dts-meson-add-audio-playback-to-p212-s905x.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0039-WIP-arm64-dts-meson-add-audio-playback-to-p212-s905x.patch index 94e344582e..3ddbdfaa7d 100644 --- a/projects/Amlogic/patches/linux/amlogic-0056-WIP-arm64-dts-meson-add-audio-playback-to-p212-s905x.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0039-WIP-arm64-dts-meson-add-audio-playback-to-p212-s905x.patch @@ -1,7 +1,7 @@ -From 84482c9385e9eeb3420d308908eb78be7a3794c4 Mon Sep 17 00:00:00 2001 +From a6edde22c0cd4c04635b13b253a72194078653c9 Mon Sep 17 00:00:00 2001 From: Christian Hewitt Date: Fri, 15 May 2020 08:02:54 +0000 -Subject: [PATCH 56/88] WIP: arm64: dts: meson: add audio playback to +Subject: [PATCH 39/60] WIP: arm64: dts: meson: add audio playback to p212-s905x dtsi Add initial audio support limited to HDMI i2s. diff --git a/projects/Amlogic/patches/linux/amlogic-0058-WIP-arm64-dts-meson-add-audio-playback-to-u200.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0040-WIP-arm64-dts-meson-add-audio-playback-to-u200.patch similarity index 90% rename from projects/Amlogic/patches/linux/amlogic-0058-WIP-arm64-dts-meson-add-audio-playback-to-u200.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0040-WIP-arm64-dts-meson-add-audio-playback-to-u200.patch index 6cc8e03c7b..c41e547572 100644 --- a/projects/Amlogic/patches/linux/amlogic-0058-WIP-arm64-dts-meson-add-audio-playback-to-u200.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0040-WIP-arm64-dts-meson-add-audio-playback-to-u200.patch @@ -1,17 +1,17 @@ -From 67e838ec7820b19e5a359280fea47b016cb64d30 Mon Sep 17 00:00:00 2001 +From 17cf7d25e74c64ad18a85aa8f55d0b7f5f8b795f Mon Sep 17 00:00:00 2001 From: Christian Hewitt Date: Sun, 17 May 2020 05:00:55 +0000 -Subject: [PATCH 58/88] WIP: arm64: dts: meson: add audio playback to u200 +Subject: [PATCH 40/60] WIP: arm64: dts: meson: add audio playback to u200 Add initial support limited to HDMI i2s and SPDIF (LPCM). Signed-off-by: Christian Hewitt --- - .../boot/dts/amlogic/meson-g12a-u200.dts | 131 ++++++++++++++++++ - 1 file changed, 131 insertions(+) + .../boot/dts/amlogic/meson-g12a-u200.dts | 130 ++++++++++++++++++ + 1 file changed, 130 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts b/arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts -index a26bfe72550f..280f8159ebb1 100644 +index 4b5d11e56364..61a85c27a463 100644 --- a/arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts +++ b/arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts @@ -8,6 +8,7 @@ @@ -36,12 +36,11 @@ index a26bfe72550f..280f8159ebb1 100644 chosen { stdout-path = "serial0:115200n8"; }; -@@ -147,6 +155,91 @@ +@@ -147,6 +155,90 @@ regulator-boot-on; regulator-always-on; }; + -+ + sound { + compatible = "amlogic,axg-sound-card"; + model = "U200"; @@ -128,7 +127,7 @@ index a26bfe72550f..280f8159ebb1 100644 }; &cec_AO { -@@ -163,6 +256,10 @@ +@@ -163,6 +255,10 @@ hdmi-phandle = <&hdmi_tx>; }; @@ -139,7 +138,7 @@ index a26bfe72550f..280f8159ebb1 100644 &cpu0 { cpu-supply = <&vddcpu>; operating-points-v2 = <&cpu_opp_table>; -@@ -203,6 +300,18 @@ +@@ -203,6 +299,18 @@ phy-mode = "rmii"; }; @@ -158,7 +157,7 @@ index a26bfe72550f..280f8159ebb1 100644 &hdmi_tx { status = "okay"; pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>; -@@ -288,6 +397,28 @@ +@@ -288,6 +396,28 @@ vqmmc-supply = <&flash_1v8>; }; diff --git a/projects/Amlogic/patches/linux/amlogic-0062-WIP-ASoC-hdmi-codec-reorder-channel-allocation-list.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0041-WIP-ASoC-hdmi-codec-reorder-channel-allocation-list.patch similarity index 96% rename from projects/Amlogic/patches/linux/amlogic-0062-WIP-ASoC-hdmi-codec-reorder-channel-allocation-list.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0041-WIP-ASoC-hdmi-codec-reorder-channel-allocation-list.patch index ac620e61e9..1ae1773a28 100644 --- a/projects/Amlogic/patches/linux/amlogic-0062-WIP-ASoC-hdmi-codec-reorder-channel-allocation-list.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0041-WIP-ASoC-hdmi-codec-reorder-channel-allocation-list.patch @@ -1,7 +1,7 @@ -From 04c165c9794f2ad3b3d18fe3999fb305292cb1e6 Mon Sep 17 00:00:00 2001 +From 6624d186fdaedc4c3795b741b202987d63e81691 Mon Sep 17 00:00:00 2001 From: Jonas Karlman Date: Sun, 23 Dec 2018 02:24:38 +0100 -Subject: [PATCH 62/88] WIP: ASoC: hdmi-codec: reorder channel allocation list +Subject: [PATCH 41/60] WIP: ASoC: hdmi-codec: reorder channel allocation list Wrong channel allocation is selected by hdmi_codec_get_ch_alloc_table_idx(). @@ -24,10 +24,10 @@ Signed-off-by: Jonas Karlman 1 file changed, 77 insertions(+), 63 deletions(-) diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c -index 0f3ac22f2cf8..9f7573cbfaf4 100644 +index b61f980cabdc..74e58cd2a021 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c -@@ -189,84 +189,97 @@ static const struct snd_pcm_chmap_elem hdmi_codec_8ch_chmaps[] = { +@@ -188,84 +188,97 @@ static const struct snd_pcm_chmap_elem hdmi_codec_8ch_chmaps[] = { /* * hdmi_codec_channel_alloc: speaker configuration available for CEA * diff --git a/projects/Amlogic/patches/linux/amlogic-0063-WIP-ASoC-meson-aiu-encoder-spdif-implement-the-.mute.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0042-WIP-ASoC-meson-aiu-encoder-spdif-implement-the-.mute.patch similarity index 93% rename from projects/Amlogic/patches/linux/amlogic-0063-WIP-ASoC-meson-aiu-encoder-spdif-implement-the-.mute.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0042-WIP-ASoC-meson-aiu-encoder-spdif-implement-the-.mute.patch index 35c7364b8e..0c9e215479 100644 --- a/projects/Amlogic/patches/linux/amlogic-0063-WIP-ASoC-meson-aiu-encoder-spdif-implement-the-.mute.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0042-WIP-ASoC-meson-aiu-encoder-spdif-implement-the-.mute.patch @@ -1,7 +1,7 @@ -From ecfecfa8d87e6ffc0958076467e82b4a26dcab98 Mon Sep 17 00:00:00 2001 +From a4af329ff09bb610bb7206f629589a2b98d04f29 Mon Sep 17 00:00:00 2001 From: Martin Blumenstingl Date: Wed, 23 Dec 2020 02:45:27 +0100 -Subject: [PATCH 63/88] WIP: ASoC: meson: aiu: encoder-spdif: implement the +Subject: [PATCH 42/60] WIP: ASoC: meson: aiu: encoder-spdif: implement the .mute_stream callback Implement the .mute_stream callback based on code from the vendor diff --git a/projects/Amlogic/patches/linux/amlogic-0064-WIP-ASoC-meson-aiu-encoder-i2s-implement-the-.mute_s.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0043-WIP-ASoC-meson-aiu-encoder-i2s-implement-the-.mute_s.patch similarity index 86% rename from projects/Amlogic/patches/linux/amlogic-0064-WIP-ASoC-meson-aiu-encoder-i2s-implement-the-.mute_s.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0043-WIP-ASoC-meson-aiu-encoder-i2s-implement-the-.mute_s.patch index a4303290ff..8303cfda70 100644 --- a/projects/Amlogic/patches/linux/amlogic-0064-WIP-ASoC-meson-aiu-encoder-i2s-implement-the-.mute_s.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0043-WIP-ASoC-meson-aiu-encoder-i2s-implement-the-.mute_s.patch @@ -1,7 +1,7 @@ -From 27a0b699cf76c8fc3e2ad354af85bfe3cb04bfc0 Mon Sep 17 00:00:00 2001 +From b3ddc4fc78ab0ff9e01958408c8c1b2a40633ebf Mon Sep 17 00:00:00 2001 From: Martin Blumenstingl Date: Wed, 23 Dec 2020 02:46:54 +0100 -Subject: [PATCH 64/88] WIP: ASoC: meson: aiu: encoder-i2s: implement the +Subject: [PATCH 43/60] WIP: ASoC: meson: aiu: encoder-i2s: implement the .mute_stream callback Implement the .mute_stream callback based on the code from the vendor @@ -14,10 +14,10 @@ Signed-off-by: Martin Blumenstingl 2 files changed, 16 insertions(+) diff --git a/sound/soc/meson/aiu-encoder-i2s.c b/sound/soc/meson/aiu-encoder-i2s.c -index 932224552146..d6aea7797641 100644 +index f8378066d448..ba3dac987112 100644 --- a/sound/soc/meson/aiu-encoder-i2s.c +++ b/sound/soc/meson/aiu-encoder-i2s.c -@@ -28,6 +28,8 @@ +@@ -27,6 +27,8 @@ #define AIU_CLK_CTRL_MORE_I2S_DIV GENMASK(5, 0) #define AIU_CODEC_DAC_LRCLK_CTRL_DIV GENMASK(11, 0) @@ -26,7 +26,7 @@ index 932224552146..d6aea7797641 100644 static void aiu_encoder_i2s_divider_enable(struct snd_soc_component *component, bool enable) { -@@ -352,6 +354,18 @@ static void aiu_encoder_i2s_shutdown(struct snd_pcm_substream *substream, +@@ -346,6 +348,18 @@ static void aiu_encoder_i2s_shutdown(struct snd_pcm_substream *substream, clk_bulk_disable_unprepare(aiu->i2s.clk_num, aiu->i2s.clks); } @@ -45,7 +45,7 @@ index 932224552146..d6aea7797641 100644 const struct snd_soc_dai_ops aiu_encoder_i2s_dai_ops = { .trigger = aiu_encoder_i2s_trigger, .hw_params = aiu_encoder_i2s_hw_params, -@@ -360,5 +374,6 @@ const struct snd_soc_dai_ops aiu_encoder_i2s_dai_ops = { +@@ -354,5 +368,6 @@ const struct snd_soc_dai_ops aiu_encoder_i2s_dai_ops = { .set_sysclk = aiu_encoder_i2s_set_sysclk, .startup = aiu_encoder_i2s_startup, .shutdown = aiu_encoder_i2s_shutdown, diff --git a/projects/Amlogic/patches/linux/amlogic-0065-WIP-ALSA-pcm-fix-ELD-constraints-for-some-compressed.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0044-WIP-ALSA-pcm-fix-ELD-constraints-for-some-compressed.patch similarity index 93% rename from projects/Amlogic/patches/linux/amlogic-0065-WIP-ALSA-pcm-fix-ELD-constraints-for-some-compressed.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0044-WIP-ALSA-pcm-fix-ELD-constraints-for-some-compressed.patch index 4d584290ad..5783b26622 100644 --- a/projects/Amlogic/patches/linux/amlogic-0065-WIP-ALSA-pcm-fix-ELD-constraints-for-some-compressed.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0044-WIP-ALSA-pcm-fix-ELD-constraints-for-some-compressed.patch @@ -1,7 +1,7 @@ -From 56f9f701c98ffbb339f51cbfbaf653ee6fa52111 Mon Sep 17 00:00:00 2001 +From 2ddece0262c3fae2df9b3579b572936bc5491534 Mon Sep 17 00:00:00 2001 From: Matthias Reichl -Date: Sat, 20 Mar 2021 08:32:12 +0000 -Subject: [PATCH 65/88] WIP: ALSA: pcm: fix ELD constraints for some compressed +Date: Fri, 19 Mar 2021 12:14:17 +0100 +Subject: [PATCH 44/60] WIP: ALSA: pcm: fix ELD constraints for some compressed audio formats The SADs of compressed formats like AC3 and DTS contain the channel diff --git a/projects/Amlogic/patches/linux/amlogic-0066-WIP-ALSA-pcm-ignore-formats-not-supported-by-kodi-in.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0045-WIP-ALSA-pcm-ignore-formats-not-supported-by-kodi-in.patch similarity index 90% rename from projects/Amlogic/patches/linux/amlogic-0066-WIP-ALSA-pcm-ignore-formats-not-supported-by-kodi-in.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0045-WIP-ALSA-pcm-ignore-formats-not-supported-by-kodi-in.patch index 0fb8dc1899..17abf1f001 100644 --- a/projects/Amlogic/patches/linux/amlogic-0066-WIP-ALSA-pcm-ignore-formats-not-supported-by-kodi-in.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0045-WIP-ALSA-pcm-ignore-formats-not-supported-by-kodi-in.patch @@ -1,7 +1,7 @@ -From 546929867bf75032dbfa1c94160c4eb417a5efe7 Mon Sep 17 00:00:00 2001 +From f49ba4a1cbe32f949e68a91f0da55189acccf09e Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sat, 20 Mar 2021 10:48:54 +0100 -Subject: [PATCH 66/88] WIP: ALSA: pcm: ignore formats not supported by kodi in +Subject: [PATCH 45/60] WIP: ALSA: pcm: ignore formats not supported by kodi in ELD constraints Only parse channel info and rates from the PCM SAD. All other SAD diff --git a/projects/Amlogic/patches/linux/amlogic-0073-arm64-dts-meson-add-common-SM1-ac2xx-dtsi.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0046-arm64-dts-meson-add-common-SM1-ac2xx-dtsi.patch similarity index 86% rename from projects/Amlogic/patches/linux/amlogic-0073-arm64-dts-meson-add-common-SM1-ac2xx-dtsi.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0046-arm64-dts-meson-add-common-SM1-ac2xx-dtsi.patch index aebcfe7dcf..c6d0a6311b 100644 --- a/projects/Amlogic/patches/linux/amlogic-0073-arm64-dts-meson-add-common-SM1-ac2xx-dtsi.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0046-arm64-dts-meson-add-common-SM1-ac2xx-dtsi.patch @@ -1,7 +1,7 @@ -From a2e5abe104b6d593a1a0879b256a2c696acfac0e Mon Sep 17 00:00:00 2001 +From 00c422fab52c36c4a76ba4f480d887960191db6a Mon Sep 17 00:00:00 2001 From: Christian Hewitt Date: Wed, 24 Jun 2020 12:41:46 +0000 -Subject: [PATCH 73/88] arm64: dts: meson: add common SM1 ac2xx dtsi +Subject: [PATCH 46/60] arm64: dts: meson: add common SM1 ac2xx dtsi Add a common dtsi for Android STB devices based on the Amlogic S905X3 (AC213/AC214) and S905D3 (AC201/AC202) reference designs. The dtsi is @@ -9,16 +9,30 @@ loosely based on the existing SEI610 device-tree. Signed-off-by: Christian Hewitt --- - .../boot/dts/amlogic/meson-sm1-ac2xx.dtsi | 298 ++++++++++++++++++ - 1 file changed, 298 insertions(+) + .../devicetree/bindings/arm/amlogic.yaml | 2 + + .../boot/dts/amlogic/meson-sm1-ac2xx.dtsi | 300 ++++++++++++++++++ + 2 files changed, 302 insertions(+) create mode 100644 arch/arm64/boot/dts/amlogic/meson-sm1-ac2xx.dtsi +diff --git a/Documentation/devicetree/bindings/arm/amlogic.yaml b/Documentation/devicetree/bindings/arm/amlogic.yaml +index 67dccdd9a5a4..61aebbb3090e 100644 +--- a/Documentation/devicetree/bindings/arm/amlogic.yaml ++++ b/Documentation/devicetree/bindings/arm/amlogic.yaml +@@ -168,6 +168,8 @@ properties: + - description: Boards with the Amlogic Meson SM1 S905X3/D3/Y3 SoC + items: + - enum: ++ - amediatech,x96-air-100 ++ - amediatech,x96-air-1000 + - bananapi,bpi-m5 + - hardkernel,odroid-c4 + - hardkernel,odroid-hc4 diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-ac2xx.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1-ac2xx.dtsi new file mode 100644 -index 000000000000..b3872983b5ce +index 000000000000..46a34731f7e2 --- /dev/null +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-ac2xx.dtsi -@@ -0,0 +1,298 @@ +@@ -0,0 +1,300 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2019 BayLibre SAS. All rights reserved. @@ -256,7 +270,8 @@ index 000000000000..b3872983b5ce + + bus-width = <4>; + cap-sd-highspeed; -+ max-frequency = <100000000>; ++ sd-uhs-sdr104; ++ max-frequency = <200000000>; + + non-removable; + disable-wp; @@ -270,7 +285,7 @@ index 000000000000..b3872983b5ce + vqmmc-supply = <&vddio_ao1v8>; +}; + -+/* SD card */ ++/* SD Card */ +&sd_emmc_b { + status = "okay"; + pinctrl-0 = <&sdcard_c_pins>; @@ -279,7 +294,8 @@ index 000000000000..b3872983b5ce + + bus-width = <4>; + cap-sd-highspeed; -+ max-frequency = <50000000>; ++ /* CRC errors are observed at 50MHz */ ++ max-frequency = <35000000>; + disable-wp; + + cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>; diff --git a/projects/Amlogic/patches/linux/amlogic-0075-arm64-dts-meson-add-initial-device-trees-for-X96-AIR.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0047-arm64-dts-meson-add-initial-device-trees-for-X96-AIR.patch similarity index 88% rename from projects/Amlogic/patches/linux/amlogic-0075-arm64-dts-meson-add-initial-device-trees-for-X96-AIR.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0047-arm64-dts-meson-add-initial-device-trees-for-X96-AIR.patch index e9718d56bb..0e4ea457c7 100644 --- a/projects/Amlogic/patches/linux/amlogic-0075-arm64-dts-meson-add-initial-device-trees-for-X96-AIR.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0047-arm64-dts-meson-add-initial-device-trees-for-X96-AIR.patch @@ -1,7 +1,7 @@ -From 90fb7b38afcfc6d1e5b134525e988781cd56adc3 Mon Sep 17 00:00:00 2001 +From 2efcc5d41cecfba052a80c8645e17bebd6bb849e Mon Sep 17 00:00:00 2001 From: Christian Hewitt Date: Wed, 24 Jun 2020 15:04:10 +0000 -Subject: [PATCH 75/88] arm64: dts: meson: add initial device-trees for X96-AIR +Subject: [PATCH 47/60] arm64: dts: meson: add initial device-trees for X96-AIR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -29,18 +29,32 @@ and with -1000 suffix supports models with Gigabit Ethernet. Signed-off-by: Christian Hewitt --- + .../devicetree/bindings/arm/amlogic.yaml | 2 + arch/arm64/boot/dts/amlogic/Makefile | 2 + .../dts/amlogic/meson-sm1-x96-air-100.dts | 112 +++++++++++++++ .../dts/amlogic/meson-sm1-x96-air-1000.dts | 133 ++++++++++++++++++ - 3 files changed, 247 insertions(+) + 4 files changed, 249 insertions(+) create mode 100644 arch/arm64/boot/dts/amlogic/meson-sm1-x96-air-100.dts create mode 100644 arch/arm64/boot/dts/amlogic/meson-sm1-x96-air-1000.dts +diff --git a/Documentation/devicetree/bindings/arm/amlogic.yaml b/Documentation/devicetree/bindings/arm/amlogic.yaml +index 61aebbb3090e..172ed028e686 100644 +--- a/Documentation/devicetree/bindings/arm/amlogic.yaml ++++ b/Documentation/devicetree/bindings/arm/amlogic.yaml +@@ -171,6 +171,8 @@ properties: + - amediatech,x96-air-100 + - amediatech,x96-air-1000 + - bananapi,bpi-m5 ++ - cyx,a95xf3-air-100 ++ - cyx,a95xf3-air-1000 + - hardkernel,odroid-c4 + - hardkernel,odroid-hc4 + - khadas,vim3l diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile -index da11ef28a47b..5de47ce6d8a4 100644 +index be308361e2f1..69f7d5fd29ea 100644 --- a/arch/arm64/boot/dts/amlogic/Makefile +++ b/arch/arm64/boot/dts/amlogic/Makefile -@@ -51,4 +51,6 @@ dtb-$(CONFIG_ARCH_MESON) += meson-sm1-khadas-vim3l.dtb +@@ -54,4 +54,6 @@ dtb-$(CONFIG_ARCH_MESON) += meson-sm1-khadas-vim3l.dtb dtb-$(CONFIG_ARCH_MESON) += meson-sm1-odroid-c4.dtb dtb-$(CONFIG_ARCH_MESON) += meson-sm1-odroid-hc4.dtb dtb-$(CONFIG_ARCH_MESON) += meson-sm1-sei610.dtb diff --git a/projects/Amlogic/patches/linux/amlogic-0077-arm64-dts-meson-add-initial-device-trees-for-A95XF3-.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0048-arm64-dts-meson-add-initial-device-trees-for-A95XF3-.patch similarity index 96% rename from projects/Amlogic/patches/linux/amlogic-0077-arm64-dts-meson-add-initial-device-trees-for-A95XF3-.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0048-arm64-dts-meson-add-initial-device-trees-for-A95XF3-.patch index bb4cb58958..64dc047fca 100644 --- a/projects/Amlogic/patches/linux/amlogic-0077-arm64-dts-meson-add-initial-device-trees-for-A95XF3-.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0048-arm64-dts-meson-add-initial-device-trees-for-A95XF3-.patch @@ -1,7 +1,7 @@ -From fcb882d32ac78cf1c121a7cce2242cef327bd67f Mon Sep 17 00:00:00 2001 +From 3c5414373037e6ecdafe87fecb97e2b083517f63 Mon Sep 17 00:00:00 2001 From: Christian Hewitt Date: Wed, 3 Jun 2020 18:03:22 +0000 -Subject: [PATCH 77/88] arm64: dts: meson: add initial device-trees for +Subject: [PATCH 48/60] arm64: dts: meson: add initial device-trees for A95XF3-AIR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -38,10 +38,10 @@ Signed-off-by: Christian Hewitt create mode 100644 arch/arm64/boot/dts/amlogic/meson-sm1-a95xf3-air-1000.dts diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile -index 5de47ce6d8a4..47a9d1f85596 100644 +index 69f7d5fd29ea..111425d59da0 100644 --- a/arch/arm64/boot/dts/amlogic/Makefile +++ b/arch/arm64/boot/dts/amlogic/Makefile -@@ -46,6 +46,8 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxm-rbox-pro.dtb +@@ -49,6 +49,8 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxm-rbox-pro.dtb dtb-$(CONFIG_ARCH_MESON) += meson-gxm-s912-libretech-pc.dtb dtb-$(CONFIG_ARCH_MESON) += meson-gxm-vega-s96.dtb dtb-$(CONFIG_ARCH_MESON) += meson-gxm-wetek-core2.dtb diff --git a/projects/Amlogic/patches/linux/amlogic-0078-dt-bindings-vendor-prefixes-add-haochuangyi-prefix.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0049-dt-bindings-vendor-prefixes-add-haochuangyi-prefix.patch similarity index 80% rename from projects/Amlogic/patches/linux/amlogic-0078-dt-bindings-vendor-prefixes-add-haochuangyi-prefix.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0049-dt-bindings-vendor-prefixes-add-haochuangyi-prefix.patch index c89e88d1c4..86c058103f 100644 --- a/projects/Amlogic/patches/linux/amlogic-0078-dt-bindings-vendor-prefixes-add-haochuangyi-prefix.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0049-dt-bindings-vendor-prefixes-add-haochuangyi-prefix.patch @@ -1,7 +1,7 @@ -From 506523142679a04de69412e08765538b398fa7e2 Mon Sep 17 00:00:00 2001 +From 97716a8c52bb002a8ec1e1e1814f6ad752a32940 Mon Sep 17 00:00:00 2001 From: Christian Hewitt Date: Tue, 12 Jan 2021 17:24:07 +0000 -Subject: [PATCH 78/88] dt-bindings: vendor-prefixes: add haochuangyi prefix +Subject: [PATCH 49/60] dt-bindings: vendor-prefixes: add haochuangyi prefix Shenzhen Haochuangyi Technology Co.,Ltd are a manufcaturer of Android Set-Top Box devices. @@ -12,10 +12,10 @@ Signed-off-by: Christian Hewitt 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml -index 041ae90b0d8f..bfceecbaf717 100644 +index a867f7102c35..fc3e9205946f 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml -@@ -449,6 +449,8 @@ patternProperties: +@@ -471,6 +471,8 @@ patternProperties: deprecated: true "^hannstar,.*": description: HannStar Display Corporation diff --git a/projects/Amlogic/patches/linux/amlogic-0079-dt-bindings-arm-amlogic-add-H96-Max-bindings.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0050-dt-bindings-arm-amlogic-add-H96-Max-bindings.patch similarity index 76% rename from projects/Amlogic/patches/linux/amlogic-0079-dt-bindings-arm-amlogic-add-H96-Max-bindings.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0050-dt-bindings-arm-amlogic-add-H96-Max-bindings.patch index 89ee537649..c64abd3d81 100644 --- a/projects/Amlogic/patches/linux/amlogic-0079-dt-bindings-arm-amlogic-add-H96-Max-bindings.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0050-dt-bindings-arm-amlogic-add-H96-Max-bindings.patch @@ -1,7 +1,7 @@ -From 50d360d344ebf97f7453b3ec1fae4053879ab33f Mon Sep 17 00:00:00 2001 +From 242a6ff12de0a23a10cd96f20882b1717ee76b57 Mon Sep 17 00:00:00 2001 From: Christian Hewitt Date: Tue, 12 Jan 2021 17:25:33 +0000 -Subject: [PATCH 79/88] dt-bindings: arm: amlogic: add H96-Max bindings +Subject: [PATCH 50/60] dt-bindings: arm: amlogic: add H96-Max bindings Add the board binding for the Haochuangyi H96-Max STB device. @@ -11,17 +11,17 @@ Signed-off-by: Christian Hewitt 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/arm/amlogic.yaml b/Documentation/devicetree/bindings/arm/amlogic.yaml -index 6a6eec15747b..455cdd951c6e 100644 +index 172ed028e686..903ab1796c07 100644 --- a/Documentation/devicetree/bindings/arm/amlogic.yaml +++ b/Documentation/devicetree/bindings/arm/amlogic.yaml -@@ -171,6 +171,7 @@ properties: +@@ -175,6 +175,7 @@ properties: - cyx,a95xf3-air-1000 - hardkernel,odroid-c4 - hardkernel,odroid-hc4 + - haochuangyi,h96-max - khadas,vim3l - seirobotics,sei610 - - sinovoip,bananapi-m5 + - const: amlogic,sm1 -- 2.17.1 diff --git a/projects/Amlogic/patches/linux/amlogic-0080-arm64-dts-meson-add-initial-device-tree-for-H96-Max.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0051-arm64-dts-meson-add-initial-device-tree-for-H96-Max.patch similarity index 95% rename from projects/Amlogic/patches/linux/amlogic-0080-arm64-dts-meson-add-initial-device-tree-for-H96-Max.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0051-arm64-dts-meson-add-initial-device-tree-for-H96-Max.patch index 5569aed470..1640b7154a 100644 --- a/projects/Amlogic/patches/linux/amlogic-0080-arm64-dts-meson-add-initial-device-tree-for-H96-Max.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0051-arm64-dts-meson-add-initial-device-tree-for-H96-Max.patch @@ -1,7 +1,7 @@ -From a3fcc16aac001adb400a8576e280d3c1dc9b10a6 Mon Sep 17 00:00:00 2001 +From ba87086b3333005e2a1b1a6b1b9552b0f598d7eb Mon Sep 17 00:00:00 2001 From: Christian Hewitt Date: Tue, 12 Jan 2021 17:26:42 +0000 -Subject: [PATCH 80/88] arm64: dts: meson: add initial device-tree for H96-Max +Subject: [PATCH 51/60] arm64: dts: meson: add initial device-tree for H96-Max The Haochuangyi H96-Max is based on the Amlogic S905X3 reference design with the following specs: @@ -29,10 +29,10 @@ Signed-off-by: Christian Hewitt create mode 100644 arch/arm64/boot/dts/amlogic/meson-sm1-h96-max.dts diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile -index 47a9d1f85596..7dd039173ef0 100644 +index 111425d59da0..60a12b6d560a 100644 --- a/arch/arm64/boot/dts/amlogic/Makefile +++ b/arch/arm64/boot/dts/amlogic/Makefile -@@ -49,6 +49,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxm-wetek-core2.dtb +@@ -52,6 +52,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxm-wetek-core2.dtb dtb-$(CONFIG_ARCH_MESON) += meson-sm1-a95xf3-air-100.dtb dtb-$(CONFIG_ARCH_MESON) += meson-sm1-a95xf3-air-1000.dtb dtb-$(CONFIG_ARCH_MESON) += meson-sm1-bananapi-m5.dtb diff --git a/projects/Amlogic/patches/linux/amlogic-0081-dt-bindings-arm-amlogic-add-support-for-the-Tanix-TX.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0052-dt-bindings-arm-amlogic-add-support-for-the-Tanix-TX.patch similarity index 74% rename from projects/Amlogic/patches/linux/amlogic-0081-dt-bindings-arm-amlogic-add-support-for-the-Tanix-TX.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0052-dt-bindings-arm-amlogic-add-support-for-the-Tanix-TX.patch index 39ff16e3cc..e04b82e9f5 100644 --- a/projects/Amlogic/patches/linux/amlogic-0081-dt-bindings-arm-amlogic-add-support-for-the-Tanix-TX.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0052-dt-bindings-arm-amlogic-add-support-for-the-Tanix-TX.patch @@ -1,7 +1,7 @@ -From 8af4f9a08f739fd9b832c13939b765211a166097 Mon Sep 17 00:00:00 2001 +From addcdc01e7d6682d82ca1019f62b6dfcf6f1ac9d Mon Sep 17 00:00:00 2001 From: Christian Hewitt Date: Sat, 29 Feb 2020 15:13:02 +0000 -Subject: [PATCH 81/88] dt-bindings: arm: amlogic: add support for the Tanix +Subject: [PATCH 52/60] dt-bindings: arm: amlogic: add support for the Tanix TX5 Max The Oranth (Tanix) TX5 Max is based on the Amlogic U200 reference @@ -13,17 +13,17 @@ Signed-off-by: Christian Hewitt 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/arm/amlogic.yaml b/Documentation/devicetree/bindings/arm/amlogic.yaml -index 455cdd951c6e..e8aec4b53553 100644 +index 903ab1796c07..5554d23362f8 100644 --- a/Documentation/devicetree/bindings/arm/amlogic.yaml +++ b/Documentation/devicetree/bindings/arm/amlogic.yaml -@@ -140,6 +140,7 @@ properties: +@@ -141,6 +141,7 @@ properties: + - enum: - amediatech,x96-max - amlogic,u200 - - seirobotics,sei510 + - oranth,tx5-max + - radxa,zero + - seirobotics,sei510 - const: amlogic,g12a - - - description: Boards with the Amlogic Meson G12B A311D SoC -- 2.17.1 diff --git a/projects/Amlogic/patches/linux/amlogic-0082-arm64-dts-meson-add-support-for-the-Tanix-TX5-Max.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0053-arm64-dts-meson-add-support-for-the-Tanix-TX5-Max.patch similarity index 97% rename from projects/Amlogic/patches/linux/amlogic-0082-arm64-dts-meson-add-support-for-the-Tanix-TX5-Max.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0053-arm64-dts-meson-add-support-for-the-Tanix-TX5-Max.patch index 9d189406be..20ceda8956 100644 --- a/projects/Amlogic/patches/linux/amlogic-0082-arm64-dts-meson-add-support-for-the-Tanix-TX5-Max.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0053-arm64-dts-meson-add-support-for-the-Tanix-TX5-Max.patch @@ -1,7 +1,7 @@ -From fc88070f5e6cb37b9b0e30c13065a56333a16f1d Mon Sep 17 00:00:00 2001 +From e7614444f2c3b7b529d7fbf0528aafa3f0d3dc30 Mon Sep 17 00:00:00 2001 From: Christian Hewitt Date: Sun, 20 Oct 2019 04:06:59 +0000 -Subject: [PATCH 82/88] arm64: dts: meson: add support for the Tanix TX5 Max +Subject: [PATCH 53/60] arm64: dts: meson: add support for the Tanix TX5 Max The Tanix TX5 Max is based on the Amlogic U200 reference design using the S905X2 chipset. Hardware specification: @@ -25,12 +25,12 @@ Signed-off-by: Christian Hewitt create mode 100644 arch/arm64/boot/dts/amlogic/meson-g12a-tanix-tx5max.dts diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile -index 7dd039173ef0..7d8586c718a1 100644 +index 60a12b6d560a..9566cfdbb54b 100644 --- a/arch/arm64/boot/dts/amlogic/Makefile +++ b/arch/arm64/boot/dts/amlogic/Makefile -@@ -1,6 +1,7 @@ - # SPDX-License-Identifier: GPL-2.0 +@@ -2,6 +2,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-axg-s400.dtb + dtb-$(CONFIG_ARCH_MESON) += meson-g12a-radxa-zero.dtb dtb-$(CONFIG_ARCH_MESON) += meson-g12a-sei510.dtb +dtb-$(CONFIG_ARCH_MESON) += meson-g12a-tanix-tx5max.dtb dtb-$(CONFIG_ARCH_MESON) += meson-g12a-u200.dtb diff --git a/projects/Amlogic/patches/linux/amlogic-0088-arm64-dts-meson-add-multiple-MeCool-device-trees.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0054-arm64-dts-meson-add-multiple-MeCool-device-trees.patch similarity index 95% rename from projects/Amlogic/patches/linux/amlogic-0088-arm64-dts-meson-add-multiple-MeCool-device-trees.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0054-arm64-dts-meson-add-multiple-MeCool-device-trees.patch index f9bde02e0b..074dc01bbd 100644 --- a/projects/Amlogic/patches/linux/amlogic-0088-arm64-dts-meson-add-multiple-MeCool-device-trees.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0054-arm64-dts-meson-add-multiple-MeCool-device-trees.patch @@ -1,7 +1,7 @@ -From 67b08c3ffacee708e8f2f08f8c42c7021c9cd6f3 Mon Sep 17 00:00:00 2001 +From 59d403256f734cb20f89cb0c47f909df3d144e7b Mon Sep 17 00:00:00 2001 From: Christian Hewitt Date: Mon, 21 Oct 2019 03:58:06 +0000 -Subject: [PATCH 88/88] arm64: dts: meson: add multiple MeCool device trees +Subject: [PATCH 54/60] arm64: dts: meson: add multiple MeCool device trees This adds initial device trees for a range of MeCool devices based on various Amlogic GXBB, GXL and GXM reference designs. The current purpose is to allow @@ -24,10 +24,10 @@ Signed-off-by: Christian Hewitt create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxl-s905d-mecool-m8s-plus.dts diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile -index 82265e80cbe2..3e72b2ad3a2d 100644 +index 9566cfdbb54b..a8213077ed67 100644 --- a/arch/arm64/boot/dts/amlogic/Makefile +++ b/arch/arm64/boot/dts/amlogic/Makefile -@@ -13,6 +13,8 @@ dtb-$(CONFIG_ARCH_MESON) += meson-g12b-odroid-n2.dtb +@@ -14,6 +14,8 @@ dtb-$(CONFIG_ARCH_MESON) += meson-g12b-odroid-n2.dtb dtb-$(CONFIG_ARCH_MESON) += meson-g12b-odroid-n2-plus.dtb dtb-$(CONFIG_ARCH_MESON) += meson-g12b-ugoos-am6.dtb dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-kii-pro.dtb @@ -36,7 +36,7 @@ index 82265e80cbe2..3e72b2ad3a2d 100644 dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-nanopi-k2.dtb dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-nexbox-a95x.dtb dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-odroidc2.dtb -@@ -30,7 +32,10 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-libretech-cc.dtb +@@ -31,7 +33,10 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-libretech-cc.dtb dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-libretech-cc-v2.dtb dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-nexbox-a95x.dtb dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-p212.dtb diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0055-dt-bindings-arm-amlogic-add-support-for-Minix-NEO-U1.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0055-dt-bindings-arm-amlogic-add-support-for-Minix-NEO-U1.patch new file mode 100644 index 0000000000..5ba088389e --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0055-dt-bindings-arm-amlogic-add-support-for-Minix-NEO-U1.patch @@ -0,0 +1,28 @@ +From 969f5a6bcf04e02bdfbf39d062d22ceee09957ce Mon Sep 17 00:00:00 2001 +From: Christian Hewitt +Date: Sun, 11 Apr 2021 05:50:13 +0000 +Subject: [PATCH 55/60] dt-bindings: arm: amlogic: add support for Minix NEO-U1 + +The Minix NEO-U1 is an Android STB based on the Amlogic P200 (GXBB) +reference design with an S905 chip. + +Signed-off-by: Christian Hewitt +--- + Documentation/devicetree/bindings/arm/amlogic.yaml | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Documentation/devicetree/bindings/arm/amlogic.yaml b/Documentation/devicetree/bindings/arm/amlogic.yaml +index 5554d23362f8..79b3f93a172d 100644 +--- a/Documentation/devicetree/bindings/arm/amlogic.yaml ++++ b/Documentation/devicetree/bindings/arm/amlogic.yaml +@@ -58,6 +58,7 @@ properties: + - amlogic,p201 + - friendlyarm,nanopi-k2 + - hardkernel,odroid-c2 ++ - minix,neo-u1 + - nexbox,a95x + - videostrong,kii-pro + - wetek,hub +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0056-arm64-dts-meson-add-initial-device-tree-for-Minix-NE.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0056-arm64-dts-meson-add-initial-device-tree-for-Minix-NE.patch new file mode 100644 index 0000000000..d8c5ff68b1 --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0056-arm64-dts-meson-add-initial-device-tree-for-Minix-NE.patch @@ -0,0 +1,241 @@ +From 5525e2ab1a8ac6bf6513bdd7cdf9113df5d18c31 Mon Sep 17 00:00:00 2001 +From: Christian Hewitt +Date: Sun, 11 Apr 2021 05:52:14 +0000 +Subject: [PATCH 56/60] arm64: dts: meson: add initial device-tree for Minix + NEO-U1 + +The Minix NEO-U1 is an Android STB based on the Amlogic P200 (GXBB) +reference design with an S905-H chip and the following specs: + +- 2GB DDR3 RAM +- 16GB eMMC +- 10/100/1000 Base-T Ethernet +- AP6356 Wireless (802.11 b/g/n/ac, BT 5.0) +- HDMI 2.1 video +- S/PDIF optical output +- ES8323 DAC +- 3x USB 2.0 port +- 1x USB micro OTG port +- RTC chip (hym8563) +- IR receiver +- 1x Power LED (white) +- 1x Update/Reset button (underside) +- 1x micro SD card slot + +Signed-off-by: Christian Hewitt +--- + arch/arm64/boot/dts/amlogic/Makefile | 1 + + .../dts/amlogic/meson-gxbb-minix-neo-u1.dts | 189 ++++++++++++++++++ + 2 files changed, 190 insertions(+) + create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxbb-minix-neo-u1.dts + +diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile +index a8213077ed67..5f59dc6a8a94 100644 +--- a/arch/arm64/boot/dts/amlogic/Makefile ++++ b/arch/arm64/boot/dts/amlogic/Makefile +@@ -16,6 +16,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-g12b-ugoos-am6.dtb + dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-kii-pro.dtb + dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-mecool-ki-plus.dtb + dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-mecool-kii-pro.dtb ++dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-minix-neo-u1.dtb + dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-nanopi-k2.dtb + dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-nexbox-a95x.dtb + dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-odroidc2.dtb +diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-minix-neo-u1.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-minix-neo-u1.dts +new file mode 100644 +index 000000000000..5343e90f9f34 +--- /dev/null ++++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-minix-neo-u1.dts +@@ -0,0 +1,189 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (c) 2021 Christian Hewitt ++ */ ++ ++/dts-v1/; ++ ++#include "meson-gxbb-p20x.dtsi" ++#include ++#include ++#include ++#include ++ ++/ { ++ compatible = "minix,neo-u1", "amlogic,meson-gxbb"; ++ model = "Minix NEO U1"; ++ ++ aliases { ++ rtc0 = &rtc; ++ }; ++ ++ spdif_dit: audio-codec-0 { ++ #sound-dai-cells = <0>; ++ compatible = "linux,spdif-dit"; ++ status = "okay"; ++ sound-name-prefix = "DIT"; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led-status { ++ color = ; ++ function = LED_FUNCTION_STATUS; ++ gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_HIGH>; ++ default-state = "on"; ++ }; ++ }; ++ ++ gpio-keys-polled { ++ compatible = "gpio-keys-polled"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ poll-interval = <20>; ++ ++ button-reset { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ ++ avdd18_usb_adc: regulator-avdd18_usb_adc { ++ compatible = "regulator-fixed"; ++ regulator-name = "AVDD18_USB_ADC"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ }; ++ ++ sound { ++ compatible = "amlogic,gx-sound-card"; ++ model = "MINIX-NEO"; ++ assigned-clocks = <&clkc CLKID_MPLL0>, ++ <&clkc CLKID_MPLL1>, ++ <&clkc CLKID_MPLL2>; ++ assigned-clock-parents = <0>, <0>, <0>; ++ assigned-clock-rates = <294912000>, ++ <270950400>, ++ <393216000>; ++ status = "okay"; ++ ++ dai-link-0 { ++ sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>; ++ }; ++ ++ dai-link-1 { ++ sound-dai = <&aiu AIU_CPU CPU_SPDIF_FIFO>; ++ }; ++ ++ dai-link-2 { ++ sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>; ++ dai-format = "i2s"; ++ mclk-fs = <256>; ++ ++ codec-0 { ++ sound-dai = <&aiu AIU_HDMI CTRL_I2S>; ++ }; ++ }; ++ ++ dai-link-3 { ++ sound-dai = <&aiu AIU_CPU CPU_SPDIF_ENCODER>; ++ ++ codec-0 { ++ sound-dai = <&spdif_dit>; ++ }; ++ }; ++ ++ dai-link-4 { ++ sound-dai = <&aiu AIU_HDMI CTRL_OUT>; ++ ++ codec-0 { ++ sound-dai = <&hdmi_tx>; ++ }; ++ }; ++ }; ++}; ++ ++&aiu { ++ status = "okay"; ++ pinctrl-0 = <&spdif_out_y_pins>; ++ pinctrl-names = "default"; ++}; ++ ++ðmac { ++ status = "okay"; ++ pinctrl-0 = <ð_rgmii_pins>; ++ pinctrl-names = "default"; ++ ++ phy-handle = <ð_phy0>; ++ phy-mode = "rgmii"; ++ ++ amlogic,tx-delay-ns = <2>; ++ ++ mdio { ++ compatible = "snps,dwmac-mdio"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ eth_phy0: ethernet-phy@0 { ++ /* Realtek RTL8211F (0x001cc916) */ ++ reg = <0>; ++ ++ reset-assert-us = <10000>; ++ reset-deassert-us = <80000>; ++ reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>; ++ ++ interrupt-parent = <&gpio_intc>; ++ /* MAC_INTR on GPIOZ_15 */ ++ interrupts = <29 IRQ_TYPE_LEVEL_LOW>; ++ }; ++ }; ++}; ++ ++&ir { ++ linux,rc-map-name = "rc-minix-neo"; ++}; ++ ++&i2c_A { ++ status = "okay"; ++ pinctrl-0 = <&i2c_a_pins>; ++ pinctrl-names = "default"; ++}; ++ ++&i2c_B { ++ status = "okay"; ++ pinctrl-0 = <&i2c_b_pins>; ++ pinctrl-names = "default"; ++ ++ rtc: rtc@51 { ++ status = "okay"; ++ compatible = "haoyu,hym8563"; ++ reg = <0x51>; ++ #clock-cells = <0>; ++ clock-frequency = <32768>; ++ clock-output-names = "xin32k"; ++ wakeup-source; ++ }; ++}; ++ ++&saradc { ++ status = "okay"; ++ vref-supply = <&avdd18_usb_adc>; ++}; ++ ++/* This is connected to the Bluetooth module: */ ++&uart_A { ++ status = "okay"; ++ pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>; ++ pinctrl-names = "default"; ++ uart-has-rtscts; ++ ++ bluetooth { ++ compatible = "bcm43438-bt"; ++ shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; ++ max-speed = <2000000>; ++ clocks = <&wifi32k>; ++ clock-names = "lpo"; ++ }; ++}; +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0057-TEST-new-registers.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0057-TEST-new-registers.patch new file mode 100644 index 0000000000..b33d652c4f --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0057-TEST-new-registers.patch @@ -0,0 +1,44 @@ +From de35bb96122893c0d7eaea9de949cff3cb87ad24 Mon Sep 17 00:00:00 2001 +From: Christian Hewitt +Date: Thu, 4 Nov 2021 02:08:38 +0000 +Subject: [PATCH 57/60] TEST: new registers + +Signed-off-by: Christian Hewitt +--- + sound/soc/meson/aiu-encoder-i2s.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/meson/aiu-encoder-i2s.c b/sound/soc/meson/aiu-encoder-i2s.c +index ba3dac987112..eeff716c1b8d 100644 +--- a/sound/soc/meson/aiu-encoder-i2s.c ++++ b/sound/soc/meson/aiu-encoder-i2s.c +@@ -19,6 +19,7 @@ + + #define AIU_I2S_DAC_CFG_MSB_FIRST BIT(2) + #define AIU_I2S_MISC_HOLD_EN BIT(2) ++#define AIU_I2S_MISC_FORCE_LEFT_RIGHT BIT(4) + #define AIU_CLK_CTRL_I2S_DIV_EN BIT(0) + #define AIU_CLK_CTRL_I2S_DIV GENMASK(3, 2) + #define AIU_CLK_CTRL_AOCLK_INVERT BIT(6) +@@ -40,9 +41,16 @@ static void aiu_encoder_i2s_divider_enable(struct snd_soc_component *component, + static void aiu_encoder_i2s_hold(struct snd_soc_component *component, + bool enable) + { ++ unsigned int value; ++ ++ if (enable) ++ value = AIU_I2S_MISC_HOLD_EN; ++ else ++ value = AIU_I2S_MISC_FORCE_LEFT_RIGHT; ++ + snd_soc_component_update_bits(component, AIU_I2S_MISC, +- AIU_I2S_MISC_HOLD_EN, +- enable ? AIU_I2S_MISC_HOLD_EN : 0); ++ AIU_I2S_MISC_HOLD_EN | ++ AIU_I2S_MISC_FORCE_LEFT_RIGHT, value); + } + + static int aiu_encoder_i2s_trigger(struct snd_pcm_substream *substream, int cmd, +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0058-FROMLIST-v2-ath10k-Fix-the-MTU-size-on-QCA9377-SDIO.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0058-FROMLIST-v2-ath10k-Fix-the-MTU-size-on-QCA9377-SDIO.patch new file mode 100644 index 0000000000..59b2c0df42 --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0058-FROMLIST-v2-ath10k-Fix-the-MTU-size-on-QCA9377-SDIO.patch @@ -0,0 +1,80 @@ +From 783c76adcf53f7e47cd2a974fafbc2835d070579 Mon Sep 17 00:00:00 2001 +From: Fabio Estevam +Date: Wed, 24 Nov 2021 13:20:05 +0000 +Subject: [PATCH 58/60] FROMLIST(v2): ath10k: Fix the MTU size on QCA9377 SDIO + +On an imx6dl-pico-pi board with a QCA9377 SDIO chip, simply trying to +connect via ssh to another machine causes: + +[ 55.824159] ath10k_sdio mmc1:0001:1: failed to transmit packet, dropping: -12 +[ 55.832169] ath10k_sdio mmc1:0001:1: failed to submit frame: -12 +[ 55.838529] ath10k_sdio mmc1:0001:1: failed to push frame: -12 +[ 55.905863] ath10k_sdio mmc1:0001:1: failed to transmit packet, dropping: -12 +[ 55.913650] ath10k_sdio mmc1:0001:1: failed to submit frame: -12 +[ 55.919887] ath10k_sdio mmc1:0001:1: failed to push frame: -12 + +, leading to an ssh connection failure. + +One user inspected the size of frames on Wireshark and reported +the followig: + +"I was able to narrow the issue down to the mtu. If I set the mtu for +the wlan0 device to 1486 instead of 1500, the issue does not happen. + +The size of frames that I see on Wireshark is exactly 1500 after +setting it to 1486." + +Clearing the HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE avoids the problem and +the ssh command works successfully after that. + +Introduce a 'credit_size_workaround' field to ath10k_hw_params for +the QCA9377 SDIO, so that the HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE +is not set in this case. + +Tested with QCA9377 SDIO with firmware WLAN.TF.1.1.1-00061-QCATFSWPZ-1. + +Fixes: 2f918ea98606 ("ath10k: enable alt data of TX path for sdio") +Signed-off-by: Fabio Estevam +--- + drivers/net/wireless/ath/ath10k/core.c | 3 ++- + drivers/net/wireless/ath/ath10k/hw.h | 3 +++ + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c +index 64c7145b51a2..afae168159ea 100644 +--- a/drivers/net/wireless/ath/ath10k/core.c ++++ b/drivers/net/wireless/ath/ath10k/core.c +@@ -714,6 +714,7 @@ static void ath10k_send_suspend_complete(struct ath10k *ar) + + static int ath10k_init_sdio(struct ath10k *ar, enum ath10k_firmware_mode mode) + { ++ bool mtu_workaround = ar->hw_params.credit_size_workaround; + int ret; + u32 param = 0; + +@@ -731,7 +732,7 @@ static int ath10k_init_sdio(struct ath10k *ar, enum ath10k_firmware_mode mode) + + param |= HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_SET; + +- if (mode == ATH10K_FIRMWARE_MODE_NORMAL) ++ if (mode == ATH10K_FIRMWARE_MODE_NORMAL && !mtu_workaround) + param |= HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE; + else + param &= ~HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE; +diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h +index 6b03c7787e36..591ef7416b61 100644 +--- a/drivers/net/wireless/ath/ath10k/hw.h ++++ b/drivers/net/wireless/ath/ath10k/hw.h +@@ -618,6 +618,9 @@ struct ath10k_hw_params { + */ + bool uart_pin_workaround; + ++ /* Workaround for the credit size calculation */ ++ bool credit_size_workaround; ++ + /* tx stats support over pktlog */ + bool tx_stats_over_pktlog; + +-- +2.17.1 + diff --git a/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0059-WIP-arm64-dts-amlogic-set-4GB-ram-size-for-Beelink-S.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0059-WIP-arm64-dts-amlogic-set-4GB-ram-size-for-Beelink-S.patch new file mode 100644 index 0000000000..6fc9e78237 --- /dev/null +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0059-WIP-arm64-dts-amlogic-set-4GB-ram-size-for-Beelink-S.patch @@ -0,0 +1,67 @@ +From 872551950d5a45f3163626e1c28b145a1100e1e0 Mon Sep 17 00:00:00 2001 +From: Christian Hewitt +Date: Thu, 25 Nov 2021 02:34:41 +0000 +Subject: [PATCH 59/60] WIP: arm64: dts: amlogic: set 4GB ram size for Beelink + S922X devices + +Set 4GB RAM size to see if this resolves the kernel panic issue +seen when boxes are booted from vendor u-boot. + +Signed-off-by: Christian Hewitt +--- + arch/arm64/boot/dts/amlogic/meson-g12b-gsking-x.dts | 5 +++++ + arch/arm64/boot/dts/amlogic/meson-g12b-gtking-pro.dts | 5 +++++ + arch/arm64/boot/dts/amlogic/meson-g12b-gtking.dts | 5 +++++ + 3 files changed, 15 insertions(+) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-gsking-x.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-gsking-x.dts +index 6c7bfacbad78..93c7acccf5be 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12b-gsking-x.dts ++++ b/arch/arm64/boot/dts/amlogic/meson-g12b-gsking-x.dts +@@ -20,6 +20,11 @@ + rtc1 = &vrtc; + }; + ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x0 0x0 0x0 0xf0800000>; ++ }; ++ + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-gtking-pro.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-gtking-pro.dts +index 707daf92787b..6e1e1a680df0 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12b-gtking-pro.dts ++++ b/arch/arm64/boot/dts/amlogic/meson-g12b-gtking-pro.dts +@@ -19,6 +19,11 @@ + rtc1 = &vrtc; + }; + ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x0 0x0 0x0 0xf0800000>; ++ }; ++ + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-gtking.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-gtking.dts +index 5d96c1449050..64039df7e0a4 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12b-gtking.dts ++++ b/arch/arm64/boot/dts/amlogic/meson-g12b-gtking.dts +@@ -19,6 +19,11 @@ + rtc1 = &vrtc; + }; + ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x0 0x0 0x0 0xf0800000>; ++ }; ++ + spdif_dit: audio-codec-1 { + #sound-dai-cells = <0>; + compatible = "linux,spdif-dit"; +-- +2.17.1 + diff --git a/projects/Amlogic/patches/linux/amlogic-0048-WIP-arm64-dts-meson-g12-sm1-remove-opps-below-1GHz.patch b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0060-HACK-arm64-dts-amlogic-remove-opps-below-1GHz-for-g1.patch similarity index 61% rename from projects/Amlogic/patches/linux/amlogic-0048-WIP-arm64-dts-meson-g12-sm1-remove-opps-below-1GHz.patch rename to projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0060-HACK-arm64-dts-amlogic-remove-opps-below-1GHz-for-g1.patch index 1df50b52b5..cb7f2d549e 100644 --- a/projects/Amlogic/patches/linux/amlogic-0048-WIP-arm64-dts-meson-g12-sm1-remove-opps-below-1GHz.patch +++ b/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0060-HACK-arm64-dts-amlogic-remove-opps-below-1GHz-for-g1.patch @@ -1,33 +1,37 @@ -From c6a298534815027cbcafe0a2015c5e4ca6a1ea53 Mon Sep 17 00:00:00 2001 -From: Jerome Brunet -Date: Fri, 4 Dec 2020 14:33:39 +0100 -Subject: [PATCH 48/88] WIP: arm64: dts: meson: g12/sm1: remove opps below 1GHz +From 0dd3d24b886da5098bb8048a53d182dd086c6f30 Mon Sep 17 00:00:00 2001 +From: Christian Hewitt +Date: Thu, 25 Nov 2021 11:31:43 +0000 +Subject: [PATCH 60/60] HACK: arm64: dts: amlogic: remove opps below 1GHz for + g12/sm1 -Various CPU stall and crash, often related to the CPU sys pll, have been -reported on the odroid-n2, n2+ and vim3/3l. It still not entirely clear -what the problem is. The problem only happens on some samples, not all, -often after more than 24h running fine. +This seems to workaround or hide occurrences of CPU stalls and other +board wedges that are not seen when 'performance' is forced. -Boards running fixed CPU frequency, like the one using the performance -governor, appear unaffected. Doing more tests seems to show that problem -appears only with the lower opps. Removing opps with a rate lower than 1GHz -seems to solve/hide the problem - -Signed-off-by: Jerome Brunet +Signed-off-by: Christian Hewitt --- - .../boot/dts/amlogic/meson-g12b-a311d.dtsi | 20 ------------------- - .../boot/dts/amlogic/meson-g12b-s922x.dtsi | 20 ------------------- - arch/arm64/boot/dts/amlogic/meson-sm1.dtsi | 20 ------------------- - 3 files changed, 60 deletions(-) + .../boot/dts/amlogic/meson-g12b-a311d.dtsi | 40 ------------------- + .../boot/dts/amlogic/meson-g12b-s922x.dtsi | 40 ------------------- + arch/arm64/boot/dts/amlogic/meson-sm1.dtsi | 20 ---------- + 3 files changed, 100 deletions(-) diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-a311d.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-a311d.dtsi -index 7d29756451a5..4a8acff92ba5 100644 +index d61f43052a34..8e9ad1e51d66 100644 --- a/arch/arm64/boot/dts/amlogic/meson-g12b-a311d.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-a311d.dtsi -@@ -11,16 +11,6 @@ +@@ -11,26 +11,6 @@ compatible = "operating-points-v2"; opp-shared; +- opp-100000000 { +- opp-hz = /bits/ 64 <100000000>; +- opp-microvolt = <731000>; +- }; +- +- opp-250000000 { +- opp-hz = /bits/ 64 <250000000>; +- opp-microvolt = <731000>; +- }; +- - opp-500000000 { - opp-hz = /bits/ 64 <500000000>; - opp-microvolt = <731000>; @@ -41,10 +45,20 @@ index 7d29756451a5..4a8acff92ba5 100644 opp-1000000000 { opp-hz = /bits/ 64 <1000000000>; opp-microvolt = <761000>; -@@ -61,16 +51,6 @@ +@@ -71,26 +51,6 @@ compatible = "operating-points-v2"; opp-shared; +- opp-100000000 { +- opp-hz = /bits/ 64 <100000000>; +- opp-microvolt = <731000>; +- }; +- +- opp-250000000 { +- opp-hz = /bits/ 64 <250000000>; +- opp-microvolt = <731000>; +- }; +- - opp-500000000 { - opp-hz = /bits/ 64 <500000000>; - opp-microvolt = <731000>; @@ -59,13 +73,23 @@ index 7d29756451a5..4a8acff92ba5 100644 opp-hz = /bits/ 64 <1000000000>; opp-microvolt = <731000>; diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-s922x.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-s922x.dtsi -index ad4096be8db2..df7a2cd7265d 100644 +index 1e5d0ee5d541..44c23c984034 100644 --- a/arch/arm64/boot/dts/amlogic/meson-g12b-s922x.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-s922x.dtsi -@@ -11,16 +11,6 @@ +@@ -11,26 +11,6 @@ compatible = "operating-points-v2"; opp-shared; +- opp-100000000 { +- opp-hz = /bits/ 64 <100000000>; +- opp-microvolt = <731000>; +- }; +- +- opp-250000000 { +- opp-hz = /bits/ 64 <250000000>; +- opp-microvolt = <731000>; +- }; +- - opp-500000000 { - opp-hz = /bits/ 64 <500000000>; - opp-microvolt = <731000>; @@ -79,10 +103,20 @@ index ad4096be8db2..df7a2cd7265d 100644 opp-1000000000 { opp-hz = /bits/ 64 <1000000000>; opp-microvolt = <731000>; -@@ -61,16 +51,6 @@ +@@ -76,26 +56,6 @@ compatible = "operating-points-v2"; opp-shared; +- opp-100000000 { +- opp-hz = /bits/ 64 <100000000>; +- opp-microvolt = <751000>; +- }; +- +- opp-250000000 { +- opp-hz = /bits/ 64 <250000000>; +- opp-microvolt = <751000>; +- }; +- - opp-500000000 { - opp-hz = /bits/ 64 <500000000>; - opp-microvolt = <751000>; @@ -97,7 +131,7 @@ index ad4096be8db2..df7a2cd7265d 100644 opp-hz = /bits/ 64 <1000000000>; opp-microvolt = <771000>; diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi -index c309517abae3..defe0b8d4d27 100644 +index 3d8b1f4f2001..78bdbd2ccc9d 100644 --- a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi @@ -95,26 +95,6 @@ diff --git a/projects/Amlogic/linux/linux.aarch64.conf b/projects/Amlogic/linux/linux.aarch64.conf index f940eecddb..cded9622c9 100644 --- a/projects/Amlogic/linux/linux.aarch64.conf +++ b/projects/Amlogic/linux/linux.aarch64.conf @@ -1,17 +1,21 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm64 5.11.10 Kernel Configuration +# Linux/arm64 5.15.0 Kernel Configuration # -CONFIG_CC_VERSION_TEXT="aarch64-none-linux-gnu-gcc.real (GNU Toolchain for the A-profile Architecture 10.2-2020.11 (arm-10.16)) 10.2.1 20201103" +CONFIG_CC_VERSION_TEXT="aarch64-none-linux-gnu-gcc.real (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 10.3.1 20210621" CONFIG_CC_IS_GCC=y -CONFIG_GCC_VERSION=100201 -CONFIG_LD_VERSION=235010000 +CONFIG_GCC_VERSION=100301 CONFIG_CLANG_VERSION=0 +CONFIG_AS_IS_GNU=y +CONFIG_AS_VERSION=23601 +CONFIG_LD_IS_BFD=y +CONFIG_LD_VERSION=23601 CONFIG_LLD_VERSION=0 CONFIG_CC_CAN_LINK=y CONFIG_CC_CAN_LINK_STATIC=y CONFIG_CC_HAS_ASM_GOTO=y CONFIG_CC_HAS_ASM_INLINE=y +CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_TABLE_SORT=y CONFIG_THREAD_INFO_IN_TASK=y @@ -21,6 +25,7 @@ CONFIG_THREAD_INFO_IN_TASK=y # CONFIG_INIT_ENV_ARG_LIMIT=32 # CONFIG_COMPILE_TEST is not set +# CONFIG_WERROR is not set CONFIG_LOCALVERSION="" # CONFIG_LOCALVERSION_AUTO is not set CONFIG_BUILD_SALT="" @@ -58,7 +63,6 @@ CONFIG_SPARSE_IRQ=y # CONFIG_GENERIC_IRQ_DEBUGFS is not set # end of IRQ subsystem -CONFIG_GENERIC_IRQ_MULTI_HANDLER=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_ARCH_HAS_TICK_BROADCAST=y @@ -76,11 +80,25 @@ CONFIG_NO_HZ_IDLE=y CONFIG_HIGH_RES_TIMERS=y # end of Timers subsystem +CONFIG_BPF=y +CONFIG_HAVE_EBPF_JIT=y +CONFIG_ARCH_WANT_DEFAULT_BPF_JIT=y + +# +# BPF subsystem +# +CONFIG_BPF_SYSCALL=y +# CONFIG_BPF_JIT is not set +# CONFIG_BPF_UNPRIV_DEFAULT_OFF is not set +# CONFIG_BPF_PRELOAD is not set +# end of BPF subsystem + # CONFIG_PREEMPT_NONE is not set # CONFIG_PREEMPT_VOLUNTARY is not set CONFIG_PREEMPT=y CONFIG_PREEMPT_COUNT=y CONFIG_PREEMPTION=y +# CONFIG_SCHED_CORE is not set # # CPU/Task time and stats accounting @@ -117,6 +135,7 @@ CONFIG_IKCONFIG_PROC=y CONFIG_LOG_BUF_SHIFT=18 CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13 +# CONFIG_PRINTK_INDEX is not set CONFIG_GENERIC_SCHED_CLOCK=y # @@ -137,7 +156,7 @@ CONFIG_CGROUP_WRITEBACK=y CONFIG_CGROUP_SCHED=y CONFIG_FAIR_GROUP_SCHED=y CONFIG_CFS_BANDWIDTH=y -CONFIG_RT_GROUP_SCHED=y +# CONFIG_RT_GROUP_SCHED is not set CONFIG_CGROUP_PIDS=y CONFIG_CGROUP_RDMA=y CONFIG_CGROUP_FREEZER=y @@ -147,6 +166,7 @@ CONFIG_CGROUP_DEVICE=y CONFIG_CGROUP_CPUACCT=y CONFIG_CGROUP_PERF=y CONFIG_CGROUP_BPF=y +# CONFIG_CGROUP_MISC is not set # CONFIG_CGROUP_DEBUG is not set CONFIG_SOCK_CGROUP_DATA=y CONFIG_NAMESPACES=y @@ -179,7 +199,6 @@ CONFIG_LD_ORPHAN_WARN=y CONFIG_SYSCTL=y CONFIG_HAVE_UID16=y CONFIG_SYSCTL_EXCEPTION_TRACE=y -CONFIG_BPF=y CONFIG_EXPERT=y CONFIG_UID16=y CONFIG_MULTIUSER=y @@ -188,7 +207,6 @@ CONFIG_SYSFS_SYSCALL=y CONFIG_FHANDLE=y CONFIG_POSIX_TIMERS=y CONFIG_PRINTK=y -CONFIG_PRINTK_NMI=y CONFIG_BUG=y CONFIG_ELF_CORE=y CONFIG_BASE_FULL=y @@ -207,9 +225,6 @@ CONFIG_MEMBARRIER=y CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y CONFIG_KALLSYMS_BASE_RELATIVE=y -CONFIG_BPF_SYSCALL=y -CONFIG_ARCH_WANT_DEFAULT_BPF_JIT=y -# CONFIG_BPF_PRELOAD is not set # CONFIG_USERFAULTFD is not set CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y CONFIG_KCMP=y @@ -228,7 +243,6 @@ CONFIG_PERF_EVENTS=y CONFIG_VM_EVENT_COUNTERS=y CONFIG_SLUB_DEBUG=y -# CONFIG_SLUB_MEMCG_SYSFS_ON is not set # CONFIG_COMPAT_BRK is not set # CONFIG_SLAB is not set CONFIG_SLUB=y @@ -255,16 +269,12 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16 CONFIG_STACKTRACE_SUPPORT=y CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 CONFIG_LOCKDEP_SUPPORT=y -CONFIG_TRACE_IRQFLAGS_SUPPORT=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_CSUM=y CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_ZONE_DMA=y -CONFIG_ZONE_DMA32=y -CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y -CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y +CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y CONFIG_SMP=y CONFIG_KERNEL_MODE_NEON=y CONFIG_FIX_EARLYCON_MEM=y @@ -276,9 +286,9 @@ CONFIG_ARCH_PROC_KCORE_TEXT=y # Platform selection # # CONFIG_ARCH_ACTIONS is not set -# CONFIG_ARCH_AGILEX is not set # CONFIG_ARCH_SUNXI is not set # CONFIG_ARCH_ALPINE is not set +# CONFIG_ARCH_APPLE is not set # CONFIG_ARCH_BCM2835 is not set # CONFIG_ARCH_BCM4908 is not set # CONFIG_ARCH_BCM_IPROC is not set @@ -302,7 +312,7 @@ CONFIG_ARCH_MESON=y # CONFIG_ARCH_ROCKCHIP is not set # CONFIG_ARCH_S32 is not set # CONFIG_ARCH_SEATTLE is not set -# CONFIG_ARCH_STRATIX10 is not set +# CONFIG_ARCH_INTEL_SOCFPGA is not set # CONFIG_ARCH_SYNQUACER is not set # CONFIG_ARCH_TEGRA is not set # CONFIG_ARCH_SPRD is not set @@ -312,7 +322,6 @@ CONFIG_ARCH_MESON=y # CONFIG_ARCH_VEXPRESS is not set # CONFIG_ARCH_VISCONTI is not set # CONFIG_ARCH_XGENE is not set -# CONFIG_ARCH_ZX is not set # CONFIG_ARCH_ZYNQMP is not set # end of Platform selection @@ -331,6 +340,7 @@ CONFIG_ARM64_ERRATUM_819472=y CONFIG_ARM64_ERRATUM_832075=y CONFIG_ARM64_ERRATUM_845719=y CONFIG_ARM64_ERRATUM_843419=y +CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y CONFIG_ARM64_ERRATUM_1024718=y CONFIG_ARM64_ERRATUM_1418040=y CONFIG_ARM64_WORKAROUND_SPECULATIVE_AT=y @@ -353,6 +363,7 @@ CONFIG_ARM64_ERRATUM_1508412=y # CONFIG_QCOM_FALKOR_ERRATUM_1009 is not set # CONFIG_QCOM_QDF2400_ERRATUM_0065 is not set # CONFIG_QCOM_FALKOR_ERRATUM_E1041 is not set +# CONFIG_NVIDIA_CARMEL_CNP_ERRATUM is not set # CONFIG_SOCIONEXT_SYNQUACER_PREITS is not set # end of ARM errata workarounds via the alternatives framework @@ -371,7 +382,6 @@ CONFIG_SCHED_SMT=y CONFIG_NR_CPUS=8 CONFIG_HOTPLUG_CPU=y # CONFIG_NUMA is not set -CONFIG_HOLES_IN_ZONE=y # CONFIG_HZ_100 is not set CONFIG_HZ_250=y # CONFIG_HZ_300 is not set @@ -379,13 +389,7 @@ CONFIG_HZ_250=y CONFIG_HZ=250 CONFIG_SCHED_HRTICK=y CONFIG_ARCH_SPARSEMEM_ENABLE=y -CONFIG_ARCH_SPARSEMEM_DEFAULT=y -CONFIG_ARCH_SELECT_MEMORY_MODEL=y -CONFIG_ARCH_FLATMEM_ENABLE=y -CONFIG_SYS_SUPPORTS_HUGETLBFS=y -CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y -CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y -CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y +CONFIG_ARCH_HAS_FILTER_PGPROT=y # CONFIG_PARAVIRT is not set # CONFIG_PARAVIRT_TIME_ACCOUNTING is not set # CONFIG_KEXEC is not set @@ -409,11 +413,10 @@ CONFIG_ARMV8_DEPRECATED=y # CONFIG_ARM64_HW_AFDBM=y CONFIG_ARM64_PAN=y -CONFIG_AS_HAS_LSE_ATOMICS=y CONFIG_AS_HAS_LDAPR=y +CONFIG_AS_HAS_LSE_ATOMICS=y CONFIG_ARM64_LSE_ATOMICS=y CONFIG_ARM64_USE_LSE_ATOMICS=y -CONFIG_ARM64_VHE=y # end of ARMv8.1 architectural features # @@ -428,6 +431,7 @@ CONFIG_ARM64_CNP=y # ARMv8.3 architectural features # CONFIG_ARM64_PTR_AUTH=y +CONFIG_ARM64_PTR_AUTH_KERNEL=y CONFIG_CC_HAS_BRANCH_PROT_PAC_RET=y CONFIG_CC_HAS_SIGN_RETURN_ADDRESS=y CONFIG_AS_HAS_PAC=y @@ -455,6 +459,12 @@ CONFIG_ARM64_AS_HAS_MTE=y CONFIG_ARM64_MTE=y # end of ARMv8.5 architectural features +# +# ARMv8.7 architectural features +# +CONFIG_ARM64_EPAN=y +# end of ARMv8.7 architectural features + CONFIG_ARM64_SVE=y CONFIG_ARM64_MODULE_PLTS=y CONFIG_ARM64_PSEUDO_NMI=y @@ -474,7 +484,6 @@ CONFIG_CMDLINE="" # end of Boot options CONFIG_SYSVIPC_COMPAT=y -CONFIG_ARCH_ENABLE_THP_MIGRATION=y # # Power management options @@ -551,30 +560,6 @@ CONFIG_ARM_SCPI_CPUFREQ=y # end of CPU Frequency scaling # end of CPU Power Management -# -# Firmware Drivers -# -# CONFIG_ARM_SCMI_PROTOCOL is not set -CONFIG_ARM_SCPI_PROTOCOL=y -CONFIG_ARM_SCPI_POWER_DOMAIN=y -# CONFIG_ARM_SDE_INTERFACE is not set -# CONFIG_FIRMWARE_MEMMAP is not set -# CONFIG_FW_CFG_SYSFS is not set -# CONFIG_GOOGLE_FIRMWARE is not set -CONFIG_MESON_SM=y -CONFIG_MESON_GX_PM=y -CONFIG_ARM_PSCI_FW=y -# CONFIG_ARM_PSCI_CHECKER is not set -CONFIG_HAVE_ARM_SMCCC=y -CONFIG_HAVE_ARM_SMCCC_DISCOVERY=y -CONFIG_ARM_SMCCC_SOC_ID=y - -# -# Tegra firmware driver -# -# end of Tegra firmware driver -# end of Firmware Drivers - # CONFIG_VIRTUALIZATION is not set CONFIG_ARM64_CRYPTO=y CONFIG_CRYPTO_SHA256_ARM64=y @@ -608,6 +593,7 @@ CONFIG_HAVE_KPROBES=y CONFIG_HAVE_KRETPROBES=y CONFIG_HAVE_FUNCTION_ERROR_INJECTION=y CONFIG_HAVE_NMI=y +CONFIG_TRACE_IRQFLAGS_SUPPORT=y CONFIG_HAVE_ARCH_TRACEHOOK=y CONFIG_HAVE_DMA_CONTIGUOUS=y CONFIG_GENERIC_SMP_IDLE_THREAD=y @@ -617,6 +603,7 @@ CONFIG_ARCH_HAS_KEEPINITRD=y CONFIG_ARCH_HAS_SET_MEMORY=y CONFIG_ARCH_HAS_SET_DIRECT_MAP=y CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y +CONFIG_ARCH_WANTS_NO_INSTR=y CONFIG_HAVE_ASM_MODVERSIONS=y CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y CONFIG_HAVE_RSEQ=y @@ -642,6 +629,10 @@ CONFIG_HAVE_ARCH_STACKLEAK=y CONFIG_HAVE_STACKPROTECTOR=y CONFIG_STACKPROTECTOR=y CONFIG_STACKPROTECTOR_STRONG=y +CONFIG_ARCH_SUPPORTS_LTO_CLANG=y +CONFIG_ARCH_SUPPORTS_LTO_CLANG_THIN=y +CONFIG_LTO_NONE=y +CONFIG_ARCH_SUPPORTS_CFI_CLANG=y CONFIG_HAVE_CONTEXT_TRACKING=y CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y @@ -649,6 +640,7 @@ CONFIG_HAVE_MOVE_PUD=y CONFIG_HAVE_MOVE_PMD=y CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y CONFIG_HAVE_ARCH_HUGE_VMAP=y +CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y CONFIG_HAVE_MOD_ARCH_SPECIFIC=y CONFIG_MODULES_USE_ELF_RELA=y CONFIG_ARCH_HAS_ELF_RANDOMIZE=y @@ -663,6 +655,8 @@ CONFIG_COMPAT_OLD_SIGACTION=y CONFIG_COMPAT_32BIT_TIME=y CONFIG_HAVE_ARCH_VMAP_STACK=y CONFIG_VMAP_STACK=y +CONFIG_HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET=y +# CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT is not set CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y CONFIG_STRICT_KERNEL_RWX=y CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y @@ -698,25 +692,27 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MODVERSIONS is not set # CONFIG_MODULE_SRCVERSION_ALL is not set # CONFIG_MODULE_SIG is not set -# CONFIG_MODULE_COMPRESS is not set +CONFIG_MODULE_COMPRESS_NONE=y +# CONFIG_MODULE_COMPRESS_GZIP is not set +# CONFIG_MODULE_COMPRESS_XZ is not set +# CONFIG_MODULE_COMPRESS_ZSTD is not set # CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS is not set -# CONFIG_UNUSED_SYMBOLS is not set +CONFIG_MODPROBE_PATH="/sbin/modprobe" # CONFIG_TRIM_UNUSED_KSYMS is not set CONFIG_MODULES_TREE_LOOKUP=y CONFIG_BLOCK=y -CONFIG_BLK_SCSI_REQUEST=y CONFIG_BLK_CGROUP_RWSTAT=y -CONFIG_BLK_DEV_BSG=y +CONFIG_BLK_DEV_BSG_COMMON=y CONFIG_BLK_DEV_BSGLIB=y CONFIG_BLK_DEV_INTEGRITY=y CONFIG_BLK_DEV_INTEGRITY_T10=y # CONFIG_BLK_DEV_ZONED is not set CONFIG_BLK_DEV_THROTTLING=y # CONFIG_BLK_DEV_THROTTLING_LOW is not set -# CONFIG_BLK_CMDLINE_PARSER is not set # CONFIG_BLK_WBT is not set CONFIG_BLK_CGROUP_IOLATENCY=y # CONFIG_BLK_CGROUP_IOCOST is not set +# CONFIG_BLK_CGROUP_IOPRIO is not set CONFIG_BLK_DEBUG_FS=y # CONFIG_BLK_SED_OPAL is not set # CONFIG_BLK_INLINE_ENCRYPTION is not set @@ -792,9 +788,6 @@ CONFIG_COREDUMP=y # # Memory Management options # -CONFIG_SELECT_MEMORY_MODEL=y -# CONFIG_FLATMEM_MANUAL is not set -CONFIG_SPARSEMEM_MANUAL=y CONFIG_SPARSEMEM=y CONFIG_SPARSEMEM_EXTREME=y CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y @@ -802,14 +795,17 @@ CONFIG_SPARSEMEM_VMEMMAP=y CONFIG_HAVE_FAST_GUP=y CONFIG_ARCH_KEEP_MEMBLOCK=y CONFIG_MEMORY_ISOLATION=y +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y # CONFIG_MEMORY_HOTPLUG is not set +CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y CONFIG_SPLIT_PTLOCK_CPUS=4 +CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y CONFIG_COMPACTION=y # CONFIG_PAGE_REPORTING is not set CONFIG_MIGRATION=y +CONFIG_ARCH_ENABLE_THP_MIGRATION=y CONFIG_CONTIG_ALLOC=y CONFIG_PHYS_ADDR_T_64BIT=y -CONFIG_BOUNCE=y # CONFIG_KSM is not set CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y @@ -823,21 +819,30 @@ CONFIG_FRONTSWAP=y CONFIG_CMA=y # CONFIG_CMA_DEBUG is not set CONFIG_CMA_DEBUGFS=y +# CONFIG_CMA_SYSFS is not set CONFIG_CMA_AREAS=7 # CONFIG_ZSWAP is not set # CONFIG_ZPOOL is not set -# CONFIG_ZBUD is not set # CONFIG_ZSMALLOC is not set CONFIG_GENERIC_EARLY_IOREMAP=y # CONFIG_DEFERRED_STRUCT_PAGE_INIT is not set # CONFIG_IDLE_PAGE_TRACKING is not set +CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y CONFIG_ARCH_HAS_PTE_DEVMAP=y -CONFIG_FRAME_VECTOR=y +CONFIG_ARCH_HAS_ZONE_DMA_SET=y +CONFIG_ZONE_DMA=y +CONFIG_ZONE_DMA32=y CONFIG_ARCH_USES_HIGH_VMA_FLAGS=y # CONFIG_PERCPU_STATS is not set # CONFIG_GUP_TEST is not set # CONFIG_READ_ONLY_THP_FOR_FS is not set CONFIG_ARCH_HAS_PTE_SPECIAL=y + +# +# Data Access Monitoring +# +# CONFIG_DAMON is not set +# end of Data Access Monitoring # end of Memory Management options CONFIG_NET=y @@ -852,6 +857,7 @@ CONFIG_PACKET=y # CONFIG_PACKET_DIAG is not set CONFIG_UNIX=y CONFIG_UNIX_SCM=y +CONFIG_AF_UNIX_OOB=y # CONFIG_UNIX_DIAG is not set CONFIG_TLS=y # CONFIG_TLS_DEVICE is not set @@ -877,7 +883,7 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_IP_PNP_RARP is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE_DEMUX is not set -CONFIG_NET_IP_TUNNEL=y +CONFIG_NET_IP_TUNNEL=m CONFIG_IP_MROUTE_COMMON=y CONFIG_IP_MROUTE=y # CONFIG_IP_MROUTE_MULTIPLE_TABLES is not set @@ -885,7 +891,7 @@ CONFIG_IP_MROUTE=y # CONFIG_IP_PIMSM_V2 is not set # CONFIG_SYN_COOKIES is not set # CONFIG_NET_IPVTI is not set -CONFIG_NET_UDP_TUNNEL=y +CONFIG_NET_UDP_TUNNEL=m CONFIG_NET_FOU=m # CONFIG_NET_FOU_IP_TUNNELS is not set # CONFIG_INET_AH is not set @@ -937,6 +943,7 @@ CONFIG_IPV6_FOU=m # CONFIG_IPV6_SEG6_LWTUNNEL is not set # CONFIG_IPV6_SEG6_HMAC is not set # CONFIG_IPV6_RPL_LWTUNNEL is not set +# CONFIG_IPV6_IOAM6_LWTUNNEL is not set # CONFIG_MPTCP is not set # CONFIG_NETWORK_SECMARK is not set # CONFIG_NETWORK_PHY_TIMESTAMPING is not set @@ -955,7 +962,7 @@ CONFIG_NETFILTER_FAMILY_BRIDGE=y CONFIG_NETFILTER_NETLINK_LOG=m # CONFIG_NETFILTER_NETLINK_OSF is not set CONFIG_NF_CONNTRACK=m -# CONFIG_NF_LOG_NETDEV is not set +# CONFIG_NF_LOG_SYSLOG is not set # CONFIG_NF_CONNTRACK_MARK is not set # CONFIG_NF_CONNTRACK_ZONES is not set CONFIG_NF_CONNTRACK_PROCFS=y @@ -986,6 +993,7 @@ CONFIG_NF_NAT_SIP=m CONFIG_NF_NAT_MASQUERADE=y # CONFIG_NF_TABLES is not set CONFIG_NETFILTER_XTABLES=m +CONFIG_NETFILTER_XTABLES_COMPAT=y # # Xtables combined modules @@ -1147,7 +1155,6 @@ CONFIG_BRIDGE_IGMP_SNOOPING=y # CONFIG_BRIDGE_VLAN_FILTERING is not set # CONFIG_BRIDGE_MRP is not set # CONFIG_BRIDGE_CFM is not set -CONFIG_HAVE_NET_DSA=y # CONFIG_NET_DSA is not set CONFIG_VLAN_8021Q=m # CONFIG_VLAN_8021Q_GVRP is not set @@ -1228,14 +1235,15 @@ CONFIG_DNS_RESOLVER=y # CONFIG_NET_L3_MASTER_DEV is not set # CONFIG_QRTR is not set # CONFIG_NET_NCSI is not set +CONFIG_PCPU_DEV_REFCNT=y CONFIG_RPS=y CONFIG_RFS_ACCEL=y +CONFIG_SOCK_RX_QUEUE_MAPPING=y CONFIG_XPS=y # CONFIG_CGROUP_NET_PRIO is not set # CONFIG_CGROUP_NET_CLASSID is not set CONFIG_NET_RX_BUSY_POLL=y CONFIG_BQL=y -# CONFIG_BPF_JIT is not set # CONFIG_BPF_STREAM_PARSER is not set CONFIG_NET_FLOW_LIMIT=y @@ -1258,7 +1266,8 @@ CONFIG_BT_HS=y CONFIG_BT_LE=y # CONFIG_BT_LEDS is not set # CONFIG_BT_MSFTEXT is not set -# CONFIG_BT_DEBUGFS is not set +# CONFIG_BT_AOSPEXT is not set +CONFIG_BT_DEBUGFS=y # CONFIG_BT_SELFTEST is not set # CONFIG_BT_FEATURE_DEBUG is not set @@ -1302,6 +1311,7 @@ CONFIG_BT_MTKUART=m # CONFIG_AF_RXRPC is not set # CONFIG_AF_KCM is not set CONFIG_STREAM_PARSER=y +# CONFIG_MCTP is not set CONFIG_WIRELESS=y CONFIG_WIRELESS_EXT=y CONFIG_WEXT_CORE=y @@ -1341,11 +1351,11 @@ CONFIG_RFKILL_GPIO=m # CONFIG_LWTUNNEL is not set CONFIG_DST_CACHE=y CONFIG_GRO_CELLS=y +CONFIG_NET_SELFTESTS=y CONFIG_NET_SOCK_MSG=y CONFIG_PAGE_POOL=y CONFIG_FAILOVER=m CONFIG_ETHTOOL_NETLINK=y -CONFIG_HAVE_EBPF_JIT=y # # Device Drivers @@ -1388,6 +1398,7 @@ CONFIG_PCIE_BUS_DEFAULT=y # CONFIG_PCIE_ALTERA is not set # CONFIG_PCI_HOST_THUNDER_PEM is not set # CONFIG_PCI_HOST_THUNDER_ECAM is not set +# CONFIG_PCIE_MICROCHIP_HOST is not set # # DesignWare PCI Core Support @@ -1404,7 +1415,6 @@ CONFIG_PCI_MESON=y # # Mobiveil PCIe Core Support # -# CONFIG_PCIE_LAYERSCAPE_GEN4 is not set # end of Mobiveil PCIe Core Support # @@ -1427,6 +1437,7 @@ CONFIG_PCI_MESON=y # CONFIG_PCI_SW_SWITCHTEC is not set # end of PCI switch controller drivers +# CONFIG_CXL_BUS is not set # CONFIG_PCCARD is not set # CONFIG_RAPIDIO is not set @@ -1473,12 +1484,43 @@ CONFIG_GENERIC_ARCH_TOPOLOGY=y # # CONFIG_BRCMSTB_GISB_ARB is not set # CONFIG_MOXTET is not set -# CONFIG_SIMPLE_PM_BUS is not set # CONFIG_VEXPRESS_CONFIG is not set # CONFIG_MHI_BUS is not set # end of Bus devices # CONFIG_CONNECTOR is not set + +# +# Firmware Drivers +# + +# +# ARM System Control and Management Interface Protocol +# +# CONFIG_ARM_SCMI_PROTOCOL is not set +# end of ARM System Control and Management Interface Protocol + +CONFIG_ARM_SCPI_PROTOCOL=y +CONFIG_ARM_SCPI_POWER_DOMAIN=y +# CONFIG_ARM_SDE_INTERFACE is not set +# CONFIG_FIRMWARE_MEMMAP is not set +# CONFIG_FW_CFG_SYSFS is not set +# CONFIG_ARM_FFA_TRANSPORT is not set +# CONFIG_GOOGLE_FIRMWARE is not set +CONFIG_MESON_SM=y +CONFIG_MESON_GX_PM=y +CONFIG_ARM_PSCI_FW=y +# CONFIG_ARM_PSCI_CHECKER is not set +CONFIG_HAVE_ARM_SMCCC=y +CONFIG_HAVE_ARM_SMCCC_DISCOVERY=y +CONFIG_ARM_SMCCC_SOC_ID=y + +# +# Tegra firmware driver +# +# end of Tegra firmware driver +# end of Firmware Drivers + # CONFIG_GNSS is not set CONFIG_MTD=y # CONFIG_MTD_TESTS is not set @@ -1498,6 +1540,10 @@ CONFIG_MTD_OF_PARTS=y # CONFIG_MTD_BLKDEVS=y CONFIG_MTD_BLOCK=y + +# +# Note that in some cases UBI block is preferred. See MTD_UBI_BLOCK. +# # CONFIG_FTL is not set # CONFIG_NFTL is not set # CONFIG_INFTL is not set @@ -1537,6 +1583,7 @@ CONFIG_MTD_CFI_I2=y # CONFIG_MTD_PMC551 is not set # CONFIG_MTD_DATAFLASH is not set # CONFIG_MTD_MCHP23K256 is not set +# CONFIG_MTD_MCHP48L640 is not set # CONFIG_MTD_SST25L is not set # CONFIG_MTD_SLRAM is not set # CONFIG_MTD_PHRAM is not set @@ -1595,13 +1642,11 @@ CONFIG_BLK_DEV=y # CONFIG_BLK_DEV_NULL_BLK is not set CONFIG_CDROM=y # CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set -# CONFIG_BLK_DEV_UMEM is not set CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_LOOP_MIN_COUNT=0 # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_DRBD is not set CONFIG_BLK_DEV_NBD=y -# CONFIG_BLK_DEV_SKD is not set # CONFIG_BLK_DEV_SX8 is not set CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 @@ -1616,6 +1661,7 @@ CONFIG_BLK_DEV_RAM_SIZE=4096 # # CONFIG_BLK_DEV_NVME is not set # CONFIG_NVME_FC is not set +# CONFIG_NVME_TCP is not set # CONFIG_NVME_TARGET is not set # end of NVME Support @@ -1628,6 +1674,7 @@ CONFIG_BLK_DEV_RAM_SIZE=4096 # CONFIG_TIFM_CORE is not set # CONFIG_ICS932S401 is not set # CONFIG_ENCLOSURE_SERVICES is not set +# CONFIG_HI6421V600_IRQ is not set # CONFIG_HP_ILO is not set # CONFIG_APDS9802ALS is not set # CONFIG_ISL29003 is not set @@ -1639,9 +1686,9 @@ CONFIG_BLK_DEV_RAM_SIZE=4096 # CONFIG_DS1682 is not set # CONFIG_LATTICE_ECP3_CONFIG is not set # CONFIG_SRAM is not set +# CONFIG_DW_XDATA_PCIE is not set # CONFIG_PCI_ENDPOINT_TEST is not set # CONFIG_XILINX_SDFEC is not set -# CONFIG_PVPANIC is not set # CONFIG_HISI_HIKEY_USB is not set # CONFIG_C2PORT is not set @@ -1671,11 +1718,13 @@ CONFIG_EEPROM_93CX6=m # CONFIG_ALTERA_STAPL is not set # CONFIG_GENWQE is not set # CONFIG_ECHO is not set +# CONFIG_BCM_VK is not set # CONFIG_MISC_ALCOR_PCI is not set # CONFIG_MISC_RTSX_PCI is not set # CONFIG_MISC_RTSX_USB is not set # CONFIG_HABANA_AI is not set # CONFIG_UACCE is not set +# CONFIG_PVPANIC is not set # end of Misc devices # @@ -1683,6 +1732,7 @@ CONFIG_EEPROM_93CX6=m # CONFIG_SCSI_MOD=y # CONFIG_RAID_ATTRS is not set +CONFIG_SCSI_COMMON=y CONFIG_SCSI=y CONFIG_SCSI_DMA=y # CONFIG_SCSI_PROC_FS is not set @@ -1694,6 +1744,7 @@ CONFIG_BLK_DEV_SD=y # CONFIG_CHR_DEV_ST is not set CONFIG_BLK_DEV_SR=y # CONFIG_CHR_DEV_SG is not set +CONFIG_BLK_DEV_BSG=y # CONFIG_CHR_DEV_SCH is not set # CONFIG_SCSI_CONSTANTS is not set # CONFIG_SCSI_LOGGING is not set @@ -1738,6 +1789,7 @@ CONFIG_ISCSI_BOOT_SYSFS=y # CONFIG_MEGARAID_SAS is not set # CONFIG_SCSI_MPT3SAS is not set # CONFIG_SCSI_MPT2SAS is not set +# CONFIG_SCSI_MPI3MR is not set # CONFIG_SCSI_SMARTPQI is not set # CONFIG_SCSI_UFSHCD is not set # CONFIG_SCSI_HPTIOP is not set @@ -1746,7 +1798,6 @@ CONFIG_ISCSI_BOOT_SYSFS=y # CONFIG_SCSI_SNIC is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_FDOMAIN_PCI is not set -# CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_IPS is not set # CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set @@ -1877,7 +1928,7 @@ CONFIG_MII=y CONFIG_NET_CORE=y # CONFIG_BONDING is not set # CONFIG_DUMMY is not set -CONFIG_WIREGUARD=y +CONFIG_WIREGUARD=m # CONFIG_WIREGUARD_DEBUG is not set # CONFIG_EQUALIZER is not set # CONFIG_NET_FC is not set @@ -1899,12 +1950,6 @@ CONFIG_TUN=y CONFIG_VETH=m # CONFIG_NLMON is not set # CONFIG_ARCNET is not set - -# -# Distributed Switch Architecture drivers -# -# end of Distributed Switch Architecture drivers - CONFIG_ETHERNET=y # CONFIG_NET_VENDOR_3COM is not set # CONFIG_NET_VENDOR_ADAPTEC is not set @@ -1917,7 +1962,6 @@ CONFIG_ETHERNET=y # CONFIG_NET_VENDOR_AQUANTIA is not set # CONFIG_NET_VENDOR_ARC is not set # CONFIG_NET_VENDOR_ATHEROS is not set -# CONFIG_NET_VENDOR_AURORA is not set # CONFIG_NET_VENDOR_BROADCOM is not set # CONFIG_NET_VENDOR_BROCADE is not set # CONFIG_NET_VENDOR_CADENCE is not set @@ -1934,7 +1978,9 @@ CONFIG_ETHERNET=y # CONFIG_NET_VENDOR_HISILICON is not set # CONFIG_NET_VENDOR_HUAWEI is not set # CONFIG_NET_VENDOR_INTEL is not set +# CONFIG_NET_VENDOR_MICROSOFT is not set # CONFIG_JME is not set +# CONFIG_NET_VENDOR_LITEX is not set # CONFIG_NET_VENDOR_MARVELL is not set # CONFIG_NET_VENDOR_MELLANOX is not set # CONFIG_NET_VENDOR_MICREL is not set @@ -1975,6 +2021,7 @@ CONFIG_STMMAC_PLATFORM=y CONFIG_DWMAC_GENERIC=y CONFIG_DWMAC_MESON=y # CONFIG_DWMAC_INTEL_PLAT is not set +# CONFIG_DWMAC_LOONGSON is not set # CONFIG_STMMAC_PCI is not set # CONFIG_NET_VENDOR_SUN is not set # CONFIG_NET_VENDOR_SYNOPSYS is not set @@ -1999,7 +2046,7 @@ CONFIG_FIXED_PHY=y CONFIG_MESON_GXL_PHY=y # CONFIG_ADIN_PHY is not set # CONFIG_AQUANTIA_PHY is not set -# CONFIG_AX88796B_PHY is not set +CONFIG_AX88796B_PHY=m # CONFIG_BROADCOM_PHY is not set # CONFIG_BCM54140_PHY is not set # CONFIG_BCM7XXX_PHY is not set @@ -2014,11 +2061,16 @@ CONFIG_MESON_GXL_PHY=y # CONFIG_LSI_ET1011C_PHY is not set # CONFIG_MARVELL_PHY is not set # CONFIG_MARVELL_10G_PHY is not set +# CONFIG_MARVELL_88X2222_PHY is not set +# CONFIG_MAXLINEAR_GPHY is not set +# CONFIG_MEDIATEK_GE_PHY is not set # CONFIG_MICREL_PHY is not set CONFIG_MICROCHIP_PHY=m # CONFIG_MICROCHIP_T1_PHY is not set # CONFIG_MICROSEMI_PHY is not set +# CONFIG_MOTORCOMM_PHY is not set # CONFIG_NATIONAL_PHY is not set +# CONFIG_NXP_C45_TJA11XX_PHY is not set # CONFIG_NXP_TJA11XX_PHY is not set # CONFIG_AT803X_PHY is not set # CONFIG_QSEMI_PHY is not set @@ -2038,11 +2090,12 @@ CONFIG_SMSC_PHY=m # CONFIG_MICREL_KS8995MA is not set CONFIG_MDIO_DEVICE=y CONFIG_MDIO_BUS=y +CONFIG_FWNODE_MDIO=y CONFIG_OF_MDIO=y CONFIG_MDIO_DEVRES=y CONFIG_MDIO_BITBANG=y # CONFIG_MDIO_BCM_UNIMAC is not set -# CONFIG_MDIO_GPIO is not set +CONFIG_MDIO_GPIO=y # CONFIG_MDIO_HISI_FEMAC is not set # CONFIG_MDIO_MVUSB is not set # CONFIG_MDIO_MSCC_MIIM is not set @@ -2204,7 +2257,6 @@ CONFIG_P54_USB=m # CONFIG_P54_PCI is not set # CONFIG_P54_SPI is not set CONFIG_P54_LEDS=y -# CONFIG_PRISM54 is not set CONFIG_WLAN_VENDOR_MARVELL=y # CONFIG_LIBERTAS is not set # CONFIG_LIBERTAS_THINFIRM is not set @@ -2218,6 +2270,7 @@ CONFIG_MT76_USB=m CONFIG_MT76_SDIO=m CONFIG_MT76x02_LIB=m CONFIG_MT76x02_USB=m +CONFIG_MT76_CONNAC_LIB=m CONFIG_MT76x0_COMMON=m CONFIG_MT76x0U=m # CONFIG_MT76x0E is not set @@ -2231,6 +2284,7 @@ CONFIG_MT7663_USB_SDIO_COMMON=m CONFIG_MT7663U=m CONFIG_MT7663S=m # CONFIG_MT7915E is not set +# CONFIG_MT7921E is not set CONFIG_WLAN_VENDOR_MICROCHIP=y # CONFIG_WILC1000_SDIO is not set # CONFIG_WILC1000_SPI is not set @@ -2275,7 +2329,7 @@ CONFIG_RTLWIFI_USB=m # CONFIG_RTLWIFI_DEBUG is not set CONFIG_RTL8192C_COMMON=m CONFIG_RTL8XXXU=m -# CONFIG_RTL8XXXU_UNTESTED is not set +CONFIG_RTL8XXXU_UNTESTED=m CONFIG_RTW88=m # CONFIG_RTW88_8822BE is not set # CONFIG_RTW88_8822CE is not set @@ -2294,11 +2348,17 @@ CONFIG_ZD1211RW=m CONFIG_USB_NET_RNDIS_WLAN=m # CONFIG_VIRT_WIFI is not set # CONFIG_WAN is not set + +# +# Wireless WAN +# +# CONFIG_WWAN is not set +# end of Wireless WAN + # CONFIG_VMXNET3 is not set # CONFIG_NETDEVSIM is not set # CONFIG_NET_FAILOVER is not set # CONFIG_ISDN is not set -# CONFIG_NVM is not set # # Input device support @@ -2393,6 +2453,7 @@ CONFIG_JOYSTICK_XPAD_LEDS=y CONFIG_JOYSTICK_PSXPAD_SPI=m CONFIG_JOYSTICK_PSXPAD_SPI_FF=y # CONFIG_JOYSTICK_PXRC is not set +# CONFIG_JOYSTICK_QWIIC is not set # CONFIG_JOYSTICK_FSIA6B is not set # CONFIG_INPUT_TABLET is not set # CONFIG_INPUT_TOUCHSCREEN is not set @@ -2422,6 +2483,7 @@ CONFIG_INPUT_GPIO_ROTARY_ENCODER=m # CONFIG_INPUT_ADXL34X is not set # CONFIG_INPUT_IMS_PCU is not set # CONFIG_INPUT_IQS269A is not set +# CONFIG_INPUT_IQS626A is not set # CONFIG_INPUT_CMA3000 is not set # CONFIG_INPUT_DRV260X_HAPTICS is not set # CONFIG_INPUT_DRV2665_HAPTICS is not set @@ -2519,7 +2581,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y # CONFIG_SERIAL_BCM63XX is not set # CONFIG_SERIAL_ALTERA_JTAGUART is not set # CONFIG_SERIAL_ALTERA_UART is not set -# CONFIG_SERIAL_IFX6X60 is not set # CONFIG_SERIAL_XILINX_PS_UART is not set # CONFIG_SERIAL_ARC is not set # CONFIG_SERIAL_RP2 is not set @@ -2534,7 +2595,6 @@ CONFIG_SERIAL_MCTRL_GPIO=y # CONFIG_N_GSM is not set # CONFIG_NOZOMI is not set # CONFIG_NULL_TTY is not set -# CONFIG_TRACE_SINK is not set # CONFIG_HVC_DCC is not set CONFIG_SERIAL_DEV_BUS=y CONFIG_SERIAL_DEV_CTRL_TTYPORT=y @@ -2550,16 +2610,16 @@ CONFIG_HW_RANDOM_MESON=y CONFIG_HW_RANDOM_OPTEE=m # CONFIG_HW_RANDOM_CCTRNG is not set # CONFIG_HW_RANDOM_XIPHERA is not set +CONFIG_HW_RANDOM_ARM_SMCCC_TRNG=y # CONFIG_APPLICOM is not set CONFIG_DEVMEM=y -# CONFIG_RAW_DRIVER is not set CONFIG_DEVPORT=y # CONFIG_TCG_TPM is not set # CONFIG_XILLYBUS is not set -# end of Character devices - +# CONFIG_XILLYUSB is not set # CONFIG_RANDOM_TRUST_CPU is not set # CONFIG_RANDOM_TRUST_BOOTLOADER is not set +# end of Character devices # # I2C support @@ -2636,6 +2696,7 @@ CONFIG_I2C_MESON=y # External I2C/SMBus adapter drivers # # CONFIG_I2C_DIOLAN_U2C is not set +# CONFIG_I2C_CP2615 is not set # CONFIG_I2C_ROBOTFUZZ_OSIF is not set # CONFIG_I2C_TAOS_EVM is not set # CONFIG_I2C_TINY_USB is not set @@ -2643,6 +2704,7 @@ CONFIG_I2C_MESON=y # # Other I2C/SMBus bus drivers # +# CONFIG_I2C_VIRTIO is not set # end of I2C Hardware Bus support # CONFIG_I2C_STUB is not set @@ -2701,6 +2763,7 @@ CONFIG_SPI_SPIDEV=m # CONFIG_SPI_SLAVE is not set CONFIG_SPI_DYNAMIC=y CONFIG_SPMI=y +# CONFIG_SPMI_HISI3670 is not set # CONFIG_HSI is not set CONFIG_PPS=y # CONFIG_PPS_DEBUG is not set @@ -2720,6 +2783,7 @@ CONFIG_PPS=y # PTP clock support # # CONFIG_PTP_1588_CLOCK is not set +CONFIG_PTP_1588_CLOCK_OPTIONAL=y # # Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks. @@ -2873,6 +2937,7 @@ CONFIG_POWER_SUPPLY_HWMON=y # CONFIG_CHARGER_GPIO is not set # CONFIG_CHARGER_MANAGER is not set # CONFIG_CHARGER_LT3651 is not set +# CONFIG_CHARGER_LTC4162L is not set # CONFIG_CHARGER_DETECTOR_MAX14656 is not set # CONFIG_CHARGER_BQ2415X is not set # CONFIG_CHARGER_BQ24190 is not set @@ -2881,8 +2946,11 @@ CONFIG_POWER_SUPPLY_HWMON=y # CONFIG_CHARGER_BQ2515X is not set # CONFIG_CHARGER_BQ25890 is not set # CONFIG_CHARGER_BQ25980 is not set +# CONFIG_CHARGER_BQ256XX is not set # CONFIG_CHARGER_SMB347 is not set # CONFIG_BATTERY_GAUGE_LTC2941 is not set +# CONFIG_BATTERY_GOLDFISH is not set +# CONFIG_BATTERY_RT5033 is not set # CONFIG_CHARGER_RT9455 is not set # CONFIG_CHARGER_UCS1002 is not set # CONFIG_CHARGER_BD99954 is not set @@ -2908,6 +2976,8 @@ CONFIG_HWMON=y # CONFIG_SENSORS_ADT7462 is not set # CONFIG_SENSORS_ADT7470 is not set # CONFIG_SENSORS_ADT7475 is not set +# CONFIG_SENSORS_AHT10 is not set +# CONFIG_SENSORS_AQUACOMPUTER_D5NEXT is not set # CONFIG_SENSORS_AS370 is not set # CONFIG_SENSORS_ASC7621 is not set # CONFIG_SENSORS_AXI_FAN_CONTROL is not set @@ -2962,6 +3032,7 @@ CONFIG_SENSORS_GPIO_FAN=m # CONFIG_SENSORS_MAX31790 is not set # CONFIG_SENSORS_MCP3021 is not set # CONFIG_SENSORS_TC654 is not set +# CONFIG_SENSORS_TPS23861 is not set # CONFIG_SENSORS_MR75203 is not set # CONFIG_SENSORS_ADCXX is not set # CONFIG_SENSORS_LM63 is not set @@ -2988,14 +3059,17 @@ CONFIG_SENSORS_GPIO_FAN=m # CONFIG_SENSORS_NCT7802 is not set # CONFIG_SENSORS_NCT7904 is not set # CONFIG_SENSORS_NPCM7XX is not set +# CONFIG_SENSORS_NZXT_KRAKEN2 is not set # CONFIG_SENSORS_OCC_P8_I2C is not set # CONFIG_SENSORS_PCF8591 is not set # CONFIG_PMBUS is not set CONFIG_SENSORS_PWM_FAN=m # CONFIG_SENSORS_SBTSI is not set +# CONFIG_SENSORS_SBRMI is not set # CONFIG_SENSORS_SHT15 is not set # CONFIG_SENSORS_SHT21 is not set # CONFIG_SENSORS_SHT3x is not set +# CONFIG_SENSORS_SHT4x is not set # CONFIG_SENSORS_SHTC1 is not set # CONFIG_SENSORS_SIS5595 is not set # CONFIG_SENSORS_DME1737 is not set @@ -3064,6 +3138,7 @@ CONFIG_WATCHDOG_CORE=y CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y CONFIG_WATCHDOG_OPEN_TIMEOUT=0 # CONFIG_WATCHDOG_SYSFS is not set +# CONFIG_WATCHDOG_HRTIMER_PRETIMEOUT is not set # # Watchdog Pretimeout Governors @@ -3150,6 +3225,7 @@ CONFIG_MFD_CORE=y # CONFIG_MFD_MC13XXX_I2C is not set # CONFIG_MFD_MP2629 is not set # CONFIG_MFD_HI6421_PMIC is not set +# CONFIG_MFD_HI6421_SPMI is not set # CONFIG_HTC_PASIC3 is not set # CONFIG_HTC_I2CPLD is not set # CONFIG_LPC_ICH is not set @@ -3177,9 +3253,11 @@ CONFIG_MFD_CORE=y # CONFIG_EZX_PCAP is not set # CONFIG_MFD_CPCAP is not set # CONFIG_MFD_VIPERBOARD is not set +# CONFIG_MFD_NTXEC is not set # CONFIG_MFD_RETU is not set # CONFIG_MFD_PCF50633 is not set # CONFIG_MFD_RDC321X is not set +# CONFIG_MFD_RT4831 is not set # CONFIG_MFD_RT5033 is not set # CONFIG_MFD_RC5T583 is not set CONFIG_MFD_RK808=y @@ -3188,7 +3266,6 @@ CONFIG_MFD_SEC_CORE=y # CONFIG_MFD_SI476X_CORE is not set # CONFIG_MFD_SM501 is not set # CONFIG_MFD_SKY81452 is not set -# CONFIG_ABX500_CORE is not set # CONFIG_MFD_STMPE is not set CONFIG_MFD_SYSCON=y # CONFIG_MFD_TI_AM335X_TSCADC is not set @@ -3228,11 +3305,16 @@ CONFIG_MFD_SYSCON=y # CONFIG_MFD_ROHM_BD718XX is not set # CONFIG_MFD_ROHM_BD70528 is not set # CONFIG_MFD_ROHM_BD71828 is not set +# CONFIG_MFD_ROHM_BD957XMUF is not set # CONFIG_MFD_STPMIC1 is not set # CONFIG_MFD_STMFX is not set +# CONFIG_MFD_ATC260X_I2C is not set CONFIG_MFD_KHADAS_MCU=m +# CONFIG_MFD_QCOM_PM8008 is not set # CONFIG_RAVE_SP_CORE is not set # CONFIG_MFD_INTEL_M10_BMC is not set +# CONFIG_MFD_RSMU_I2C is not set +# CONFIG_MFD_RSMU_SPI is not set # end of Multifunction device drivers CONFIG_REGULATOR=y @@ -3260,6 +3342,7 @@ CONFIG_REGULATOR_GPIO=y # CONFIG_REGULATOR_MAX1586 is not set # CONFIG_REGULATOR_MAX8649 is not set # CONFIG_REGULATOR_MAX8660 is not set +# CONFIG_REGULATOR_MAX8893 is not set # CONFIG_REGULATOR_MAX8952 is not set # CONFIG_REGULATOR_MAX8973 is not set # CONFIG_REGULATOR_MAX77826 is not set @@ -3269,6 +3352,7 @@ CONFIG_REGULATOR_GPIO=y # CONFIG_REGULATOR_MP886X is not set # CONFIG_REGULATOR_MPQ7920 is not set # CONFIG_REGULATOR_MT6311 is not set +# CONFIG_REGULATOR_MT6315 is not set # CONFIG_REGULATOR_PCA9450 is not set # CONFIG_REGULATOR_PF8X00 is not set # CONFIG_REGULATOR_PFUZE100 is not set @@ -3281,7 +3365,11 @@ CONFIG_REGULATOR_PWM=y # CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY is not set # CONFIG_REGULATOR_RK808 is not set # CONFIG_REGULATOR_RT4801 is not set +# CONFIG_REGULATOR_RT6160 is not set +# CONFIG_REGULATOR_RT6245 is not set +# CONFIG_REGULATOR_RTQ2134 is not set # CONFIG_REGULATOR_RTMV20 is not set +# CONFIG_REGULATOR_RTQ6752 is not set # CONFIG_REGULATOR_S2MPA01 is not set # CONFIG_REGULATOR_S2MPS11 is not set # CONFIG_REGULATOR_S5M8767 is not set @@ -3320,6 +3408,7 @@ CONFIG_IR_IMON=m CONFIG_IR_IMON_RAW=m CONFIG_IR_MCEUSB=m CONFIG_IR_MESON=m +# CONFIG_IR_MESON_TX is not set CONFIG_IR_REDRAT3=m # CONFIG_IR_SPI is not set CONFIG_IR_STREAMZAP=m @@ -3402,7 +3491,6 @@ CONFIG_DVB_MAX_ADAPTERS=8 # # Media drivers # -CONFIG_TTPCI_EEPROM=m CONFIG_MEDIA_USB_SUPPORT=y # @@ -3520,6 +3608,7 @@ CONFIG_MEDIA_COMMON_OPTIONS=y # CONFIG_VIDEO_CX2341X=m CONFIG_VIDEO_TVEEPROM=m +CONFIG_TTPCI_EEPROM=m CONFIG_CYPRESS_FIRMWARE=m CONFIG_VIDEOBUF2_CORE=y CONFIG_VIDEOBUF2_V4L2=y @@ -3661,13 +3750,17 @@ CONFIG_VIDEO_CX25840=m # Camera sensor devices # # CONFIG_VIDEO_HI556 is not set +# CONFIG_VIDEO_IMX208 is not set # CONFIG_VIDEO_IMX214 is not set # CONFIG_VIDEO_IMX219 is not set # CONFIG_VIDEO_IMX258 is not set # CONFIG_VIDEO_IMX274 is not set # CONFIG_VIDEO_IMX290 is not set # CONFIG_VIDEO_IMX319 is not set +# CONFIG_VIDEO_IMX334 is not set +# CONFIG_VIDEO_IMX335 is not set # CONFIG_VIDEO_IMX355 is not set +# CONFIG_VIDEO_IMX412 is not set # CONFIG_VIDEO_OV02A10 is not set # CONFIG_VIDEO_OV2640 is not set # CONFIG_VIDEO_OV2659 is not set @@ -3676,6 +3769,7 @@ CONFIG_VIDEO_CX25840=m # CONFIG_VIDEO_OV5640 is not set # CONFIG_VIDEO_OV5645 is not set # CONFIG_VIDEO_OV5647 is not set +# CONFIG_VIDEO_OV5648 is not set # CONFIG_VIDEO_OV6650 is not set # CONFIG_VIDEO_OV5670 is not set # CONFIG_VIDEO_OV5675 is not set @@ -3686,6 +3780,8 @@ CONFIG_VIDEO_CX25840=m # CONFIG_VIDEO_OV7670 is not set # CONFIG_VIDEO_OV7740 is not set # CONFIG_VIDEO_OV8856 is not set +# CONFIG_VIDEO_OV8865 is not set +# CONFIG_VIDEO_OV9282 is not set # CONFIG_VIDEO_OV9640 is not set # CONFIG_VIDEO_OV9650 is not set # CONFIG_VIDEO_OV13858 is not set @@ -3703,6 +3799,7 @@ CONFIG_VIDEO_CX25840=m # CONFIG_VIDEO_NOON010PC30 is not set # CONFIG_VIDEO_M5MOLS is not set # CONFIG_VIDEO_RDACM20 is not set +# CONFIG_VIDEO_RDACM21 is not set # CONFIG_VIDEO_RJ54N1 is not set # CONFIG_VIDEO_S5K6AA is not set # CONFIG_VIDEO_S5K6A3 is not set @@ -3846,7 +3943,6 @@ CONFIG_DVB_TDA10071=m # # DVB-T (terrestrial) frontends # -# CONFIG_DVB_SP8870 is not set # CONFIG_DVB_SP887X is not set # CONFIG_DVB_CX22700 is not set CONFIG_DVB_CX22702=m @@ -3901,6 +3997,7 @@ CONFIG_DVB_AU8522=m CONFIG_DVB_AU8522_DTV=m CONFIG_DVB_AU8522_V4L=m CONFIG_DVB_S5H1411=m +CONFIG_DVB_MXL692=m # # ISDB-T (terrestrial) frontends @@ -3968,7 +4065,6 @@ CONFIG_DRM=y # CONFIG_DRM_DEBUG_MM is not set # CONFIG_DRM_DEBUG_SELFTEST is not set CONFIG_DRM_KMS_HELPER=y -CONFIG_DRM_KMS_FB_HELPER=y # CONFIG_DRM_DEBUG_DP_MST_TOPOLOGY_REFS is not set CONFIG_DRM_FBDEV_EMULATION=y CONFIG_DRM_FBDEV_OVERALLOC=100 @@ -4002,13 +4098,13 @@ CONFIG_DRM_SCHED=m # CONFIG_DRM_NOUVEAU is not set # CONFIG_DRM_VGEM is not set # CONFIG_DRM_VKMS is not set +# CONFIG_DRM_VMWGFX is not set # CONFIG_DRM_UDL is not set # CONFIG_DRM_AST is not set # CONFIG_DRM_MGAG200 is not set # CONFIG_DRM_RCAR_DW_HDMI is not set # CONFIG_DRM_RCAR_LVDS is not set # CONFIG_DRM_QXL is not set -# CONFIG_DRM_BOCHS is not set CONFIG_DRM_PANEL=y # @@ -4019,12 +4115,16 @@ CONFIG_DRM_PANEL=y # CONFIG_DRM_PANEL_LVDS is not set # CONFIG_DRM_PANEL_SIMPLE is not set # CONFIG_DRM_PANEL_ILITEK_IL9322 is not set +# CONFIG_DRM_PANEL_ILITEK_ILI9341 is not set +# CONFIG_DRM_PANEL_INNOLUX_EJ030NA is not set # CONFIG_DRM_PANEL_SAMSUNG_LD9040 is not set # CONFIG_DRM_PANEL_LG_LB035Q02 is not set # CONFIG_DRM_PANEL_LG_LG4573 is not set # CONFIG_DRM_PANEL_NEC_NL8048HL11 is not set # CONFIG_DRM_PANEL_NOVATEK_NT39016 is not set # CONFIG_DRM_PANEL_OLIMEX_LCD_OLINUXINO is not set +# CONFIG_DRM_PANEL_SAMSUNG_ATNA33XC20 is not set +# CONFIG_DRM_PANEL_SAMSUNG_DB7430 is not set # CONFIG_DRM_PANEL_SAMSUNG_S6E63M0 is not set # CONFIG_DRM_PANEL_SAMSUNG_S6E88A0_AMS452EF01 is not set # CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0 is not set @@ -4035,6 +4135,7 @@ CONFIG_DRM_PANEL=y # CONFIG_DRM_PANEL_TPO_TD028TTEC1 is not set # CONFIG_DRM_PANEL_TPO_TD043MTEA1 is not set # CONFIG_DRM_PANEL_TPO_TPG110 is not set +# CONFIG_DRM_PANEL_WIDECHIPS_WS2401 is not set # end of Display Panels CONFIG_DRM_BRIDGE=y @@ -4044,10 +4145,13 @@ CONFIG_DRM_PANEL_BRIDGE=y # Display Interface Bridges # # CONFIG_DRM_CDNS_DSI is not set +# CONFIG_DRM_CHIPONE_ICN6211 is not set # CONFIG_DRM_CHRONTEL_CH7033 is not set CONFIG_DRM_DISPLAY_CONNECTOR=y +# CONFIG_DRM_LONTIUM_LT8912B is not set # CONFIG_DRM_LONTIUM_LT9611 is not set # CONFIG_DRM_LONTIUM_LT9611UXC is not set +# CONFIG_DRM_ITE_IT66121 is not set # CONFIG_DRM_LVDS_CODEC is not set # CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW is not set # CONFIG_DRM_NWL_MIPI_DSI is not set @@ -4065,6 +4169,7 @@ CONFIG_DRM_DISPLAY_CONNECTOR=y # CONFIG_DRM_TOSHIBA_TC358768 is not set # CONFIG_DRM_TOSHIBA_TC358775 is not set # CONFIG_DRM_TI_TFP410 is not set +# CONFIG_DRM_TI_SN65DSI83 is not set # CONFIG_DRM_TI_SN65DSI86 is not set # CONFIG_DRM_TI_TPD12S015 is not set # CONFIG_DRM_ANALOGIX_ANX6345 is not set @@ -4079,14 +4184,16 @@ CONFIG_DRM_DW_HDMI_I2S_AUDIO=y # end of Display Interface Bridges # CONFIG_DRM_ETNAVIV is not set -# CONFIG_DRM_ARCPGU is not set # CONFIG_DRM_HISI_HIBMC is not set # CONFIG_DRM_HISI_KIRIN is not set # CONFIG_DRM_MXSFB is not set CONFIG_DRM_MESON=y CONFIG_DRM_MESON_DW_HDMI=y +# CONFIG_DRM_ARCPGU is not set +# CONFIG_DRM_BOCHS is not set # CONFIG_DRM_CIRRUS_QEMU is not set # CONFIG_DRM_GM12U320 is not set +# CONFIG_DRM_SIMPLEDRM is not set # CONFIG_TINYDRM_HX8357D is not set # CONFIG_TINYDRM_ILI9225 is not set # CONFIG_TINYDRM_ILI9341 is not set @@ -4099,6 +4206,7 @@ CONFIG_DRM_MESON_DW_HDMI=y CONFIG_DRM_LIMA=m CONFIG_DRM_PANFROST=m # CONFIG_DRM_TIDSS is not set +# CONFIG_DRM_GUD is not set # CONFIG_DRM_LEGACY is not set CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y @@ -4309,7 +4417,6 @@ CONFIG_SND_SOC_MESON_T9015=y # CONFIG_SND_SOC_XILINX_AUDIO_FORMATTER is not set # CONFIG_SND_SOC_XILINX_SPDIF is not set # CONFIG_SND_SOC_XTFPGA_I2S is not set -# CONFIG_ZX_TDM is not set CONFIG_SND_SOC_I2C_AND_SPI=y # @@ -4352,6 +4459,7 @@ CONFIG_SND_SOC_I2C_AND_SPI=y # CONFIG_SND_SOC_CS4271_SPI is not set # CONFIG_SND_SOC_CS42XX8_I2C is not set # CONFIG_SND_SOC_CS43130 is not set +CONFIG_SND_SOC_CS4334=y # CONFIG_SND_SOC_CS4341 is not set # CONFIG_SND_SOC_CS4349 is not set # CONFIG_SND_SOC_CS53L30 is not set @@ -4366,6 +4474,7 @@ CONFIG_SND_SOC_ES8328=y CONFIG_SND_SOC_ES8328_I2C=y # CONFIG_SND_SOC_ES8328_SPI is not set # CONFIG_SND_SOC_GTM601 is not set +# CONFIG_SND_SOC_ICS43432 is not set # CONFIG_SND_SOC_INNO_RK3036 is not set # CONFIG_SND_SOC_MAX98088 is not set CONFIG_SND_SOC_MAX98357A=y @@ -4391,14 +4500,17 @@ CONFIG_SND_SOC_MAX98357A=y # CONFIG_SND_SOC_PCM512x_I2C is not set # CONFIG_SND_SOC_PCM512x_SPI is not set # CONFIG_SND_SOC_RK3328 is not set +# CONFIG_SND_SOC_RK817 is not set # CONFIG_SND_SOC_RT5616 is not set # CONFIG_SND_SOC_RT5631 is not set +# CONFIG_SND_SOC_RT5640 is not set +# CONFIG_SND_SOC_RT5659 is not set # CONFIG_SND_SOC_SGTL5000 is not set CONFIG_SND_SOC_SIMPLE_AMPLIFIER=y # CONFIG_SND_SOC_SIMPLE_MUX is not set -# CONFIG_SND_SOC_SIRF_AUDIO_CODEC is not set CONFIG_SND_SOC_SPDIF=y # CONFIG_SND_SOC_SSM2305 is not set +# CONFIG_SND_SOC_SSM2518 is not set # CONFIG_SND_SOC_SSM2602_SPI is not set # CONFIG_SND_SOC_SSM2602_I2C is not set # CONFIG_SND_SOC_SSM4567 is not set @@ -4415,12 +4527,14 @@ CONFIG_SND_SOC_SPDIF=y # CONFIG_SND_SOC_TAS6424 is not set # CONFIG_SND_SOC_TDA7419 is not set # CONFIG_SND_SOC_TFA9879 is not set +# CONFIG_SND_SOC_TFA989X is not set # CONFIG_SND_SOC_TLV320AIC23_I2C is not set # CONFIG_SND_SOC_TLV320AIC23_SPI is not set # CONFIG_SND_SOC_TLV320AIC31XX is not set # CONFIG_SND_SOC_TLV320AIC32X4_I2C is not set # CONFIG_SND_SOC_TLV320AIC32X4_SPI is not set -# CONFIG_SND_SOC_TLV320AIC3X is not set +# CONFIG_SND_SOC_TLV320AIC3X_I2C is not set +# CONFIG_SND_SOC_TLV320AIC3X_SPI is not set # CONFIG_SND_SOC_TLV320ADCX140 is not set # CONFIG_SND_SOC_TS3A227E is not set # CONFIG_SND_SOC_TSCS42XX is not set @@ -4450,7 +4564,6 @@ CONFIG_SND_SOC_SPDIF=y # CONFIG_SND_SOC_WM8978 is not set # CONFIG_SND_SOC_WM8985 is not set # CONFIG_SND_SOC_ZL38060 is not set -# CONFIG_SND_SOC_ZX_AUD96P22 is not set # CONFIG_SND_SOC_MAX9759 is not set # CONFIG_SND_SOC_MT6351 is not set # CONFIG_SND_SOC_MT6358 is not set @@ -4463,6 +4576,8 @@ CONFIG_SND_SOC_SPDIF=y # CONFIG_SND_SOC_TPA6130A2 is not set # CONFIG_SND_SOC_LPASS_WSA_MACRO is not set # CONFIG_SND_SOC_LPASS_VA_MACRO is not set +# CONFIG_SND_SOC_LPASS_RX_MACRO is not set +# CONFIG_SND_SOC_LPASS_TX_MACRO is not set # end of CODEC drivers CONFIG_SND_SIMPLE_CARD_UTILS=y @@ -4508,6 +4623,7 @@ CONFIG_DRAGONRISE_FF=y # CONFIG_HID_ELECOM is not set # CONFIG_HID_ELO is not set CONFIG_HID_EZKEY=y +# CONFIG_HID_FT260 is not set # CONFIG_HID_GEMBIRD is not set # CONFIG_HID_GFRM is not set # CONFIG_HID_GLORIOUS is not set @@ -4551,11 +4667,13 @@ CONFIG_HID_PENMOUNT=y CONFIG_HID_PETALYNX=y # CONFIG_HID_PICOLCD is not set # CONFIG_HID_PLANTRONICS is not set +# CONFIG_HID_PLAYSTATION is not set # CONFIG_HID_PRIMAX is not set # CONFIG_HID_RETRODE is not set # CONFIG_HID_ROCCAT is not set # CONFIG_HID_SAITEK is not set CONFIG_HID_SAMSUNG=y +# CONFIG_HID_SEMITEK is not set CONFIG_HID_SONY=y CONFIG_SONY_FF=y # CONFIG_HID_SPEEDLINK is not set @@ -4593,7 +4711,8 @@ CONFIG_USB_HIDDEV=y # # I2C HID support # -# CONFIG_I2C_HID is not set +# CONFIG_I2C_HID_OF is not set +# CONFIG_I2C_HID_OF_GOODIX is not set # end of I2C HID support # end of HID support @@ -4685,7 +4804,7 @@ CONFIG_USB_UAS=y # CONFIG_USB_MDC800 is not set # CONFIG_USB_MICROTEK is not set # CONFIG_USBIP_CORE is not set -# CONFIG_USB_CDNS3 is not set +# CONFIG_USB_CDNS_SUPPORT is not set # CONFIG_USB_MUSB_HDRC is not set CONFIG_USB_DWC3=y # CONFIG_USB_DWC3_HOST is not set @@ -4764,6 +4883,7 @@ CONFIG_USB_SERIAL_PL2303=m # CONFIG_USB_SERIAL_SSU100 is not set # CONFIG_USB_SERIAL_QT2 is not set # CONFIG_USB_SERIAL_UPD78F0730 is not set +# CONFIG_USB_SERIAL_XR is not set # CONFIG_USB_SERIAL_DEBUG is not set # @@ -4860,8 +4980,8 @@ CONFIG_TYPEC_TCPM=m # CONFIG_TYPEC_TCPCI is not set CONFIG_TYPEC_FUSB302=m # CONFIG_TYPEC_UCSI is not set -# CONFIG_TYPEC_HD3SS3220 is not set # CONFIG_TYPEC_TPS6598X is not set +# CONFIG_TYPEC_HD3SS3220 is not set # CONFIG_TYPEC_STUSB160X is not set # @@ -4983,6 +5103,7 @@ CONFIG_LEDS_TRIGGER_DEFAULT_ON=y # CONFIG_LEDS_TRIGGER_NETDEV is not set # CONFIG_LEDS_TRIGGER_PATTERN is not set # CONFIG_LEDS_TRIGGER_AUDIO is not set +# CONFIG_LEDS_TRIGGER_TTY is not set # CONFIG_ACCESSIBILITY is not set # CONFIG_INFINIBAND is not set CONFIG_EDAC_SUPPORT=y @@ -5111,8 +5232,10 @@ CONFIG_SYNC_FILE=y # CONFIG_SW_SYNC is not set CONFIG_UDMABUF=y # CONFIG_DMABUF_MOVE_NOTIFY is not set +# CONFIG_DMABUF_DEBUG is not set # CONFIG_DMABUF_SELFTESTS is not set CONFIG_DMABUF_HEAPS=y +# CONFIG_DMABUF_SYSFS_STATS is not set CONFIG_DMABUF_HEAPS_SYSTEM=y CONFIG_DMABUF_HEAPS_CMA=y # end of DMABUF options @@ -5131,14 +5254,15 @@ CONFIG_DMABUF_HEAPS_CMA=y # end of Microsoft Hyper-V guest support # CONFIG_GREYBUS is not set +# CONFIG_COMEDI is not set CONFIG_STAGING=y # CONFIG_PRISM2_USB is not set -# CONFIG_COMEDI is not set -# CONFIG_RTL8192U is not set -# CONFIG_RTLLIB is not set +CONFIG_RTL8192U=m +CONFIG_RTLLIB=m # CONFIG_RTL8723BS is not set # CONFIG_R8712U is not set -# CONFIG_R8188EU is not set +CONFIG_R8188EU=m +# CONFIG_88EU_AP_MODE is not set # CONFIG_RTS5208 is not set # CONFIG_VT6655 is not set # CONFIG_VT6656 is not set @@ -5170,7 +5294,6 @@ CONFIG_STAGING=y # # Capacitance to digital converters # -# CONFIG_AD7150 is not set # CONFIG_AD7746 is not set # end of Capacitance to digital converters @@ -5204,6 +5327,7 @@ CONFIG_STAGING=y CONFIG_STAGING_MEDIA=y CONFIG_VIDEO_MESON_VDEC=y # CONFIG_VIDEO_ZORAN is not set +# CONFIG_DVB_AV7110 is not set # # Android @@ -5214,30 +5338,29 @@ CONFIG_VIDEO_MESON_VDEC=y # CONFIG_LTE_GDM724X is not set # CONFIG_GS_FPGABOOT is not set # CONFIG_UNISYSSPAR is not set +# CONFIG_COMMON_CLK_XLNX_CLKWZRD is not set # CONFIG_FB_TFT is not set # CONFIG_KS7010 is not set # CONFIG_PI433 is not set - -# -# Gasket devices -# -# CONFIG_STAGING_GASKET_FRAMEWORK is not set -# end of Gasket devices - # CONFIG_XIL_AXIS_FIFO is not set # CONFIG_FIELDBUS_DEV is not set # CONFIG_QLGE is not set -# CONFIG_WIMAX is not set # CONFIG_WFX is not set -# CONFIG_SPMI_HISI3670 is not set -# CONFIG_MFD_HI6421_SPMI is not set # CONFIG_GOLDFISH is not set # CONFIG_CHROME_PLATFORMS is not set # CONFIG_MELLANOX_PLATFORM is not set CONFIG_HAVE_CLK=y -CONFIG_CLKDEV_LOOKUP=y CONFIG_HAVE_CLK_PREPARE=y CONFIG_COMMON_CLK=y + +# +# Clock driver for ARM Reference designs +# +# CONFIG_ICST is not set +# CONFIG_CLK_SP810 is not set +# end of Clock driver for ARM Reference designs + +# CONFIG_LMK04832 is not set # CONFIG_COMMON_CLK_MAX9485 is not set CONFIG_COMMON_CLK_RK808=y CONFIG_COMMON_CLK_SCPI=y @@ -5250,6 +5373,7 @@ CONFIG_COMMON_CLK_SCPI=y # CONFIG_COMMON_CLK_CDCE925 is not set # CONFIG_COMMON_CLK_CS2000_CP is not set # CONFIG_COMMON_CLK_S2MPS11 is not set +# CONFIG_COMMON_CLK_AXI_CLKGEN is not set # CONFIG_COMMON_CLK_XGENE is not set CONFIG_COMMON_CLK_PWM=y # CONFIG_COMMON_CLK_VC5 is not set @@ -5274,6 +5398,7 @@ CONFIG_COMMON_CLK_AXG_AUDIO=y CONFIG_COMMON_CLK_G12A=y # end of Clock support for Amlogic platforms +# CONFIG_XILINX_VCU is not set # CONFIG_HWSPINLOCK is not set # @@ -5311,6 +5436,8 @@ CONFIG_IOMMU_IO_PGTABLE_LPAE=y # end of Generic IOMMU Pagetable Support # CONFIG_IOMMU_DEBUGFS is not set +CONFIG_IOMMU_DEFAULT_DMA_STRICT=y +# CONFIG_IOMMU_DEFAULT_DMA_LAZY is not set # CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set CONFIG_OF_IOMMU=y CONFIG_IOMMU_DMA=y @@ -5381,7 +5508,6 @@ CONFIG_MESON_SECURE_PM_DOMAINS=y # # Xilinx SoC drivers # -# CONFIG_XILINX_VCU is not set # end of Xilinx SoC drivers # end of SOC (System On Chip) specific Drivers @@ -5443,11 +5569,14 @@ CONFIG_IIO_CONSUMERS_PER_TRIGGER=2 # CONFIG_BMA220 is not set # CONFIG_BMA400 is not set # CONFIG_BMC150_ACCEL is not set +# CONFIG_BMI088_ACCEL is not set # CONFIG_DA280 is not set # CONFIG_DA311 is not set # CONFIG_DMARD06 is not set # CONFIG_DMARD09 is not set # CONFIG_DMARD10 is not set +# CONFIG_FXLS8962AF_I2C is not set +# CONFIG_FXLS8962AF_SPI is not set # CONFIG_IIO_ST_ACCEL_3AXIS is not set # CONFIG_KXSD9 is not set # CONFIG_KXCJK1013 is not set @@ -5461,6 +5590,7 @@ CONFIG_IIO_CONSUMERS_PER_TRIGGER=2 # CONFIG_MXC4005 is not set # CONFIG_MXC6255 is not set # CONFIG_SCA3000 is not set +# CONFIG_SCA3300 is not set # CONFIG_STK8312 is not set # CONFIG_STK8BA50 is not set # end of Accelerometers @@ -5487,7 +5617,6 @@ CONFIG_IIO_CONSUMERS_PER_TRIGGER=2 # CONFIG_AD7923 is not set # CONFIG_AD7949 is not set # CONFIG_AD799X is not set -# CONFIG_AD9467 is not set # CONFIG_ADI_AXI_ADC is not set # CONFIG_CC10001_ADC is not set # CONFIG_ENVELOPE_DETECTOR is not set @@ -5525,7 +5654,9 @@ CONFIG_MESON_SARADC=y # CONFIG_TI_ADS8344 is not set # CONFIG_TI_ADS8688 is not set # CONFIG_TI_ADS124S08 is not set +# CONFIG_TI_ADS131E08 is not set # CONFIG_TI_TLC4541 is not set +# CONFIG_TI_TSC2046 is not set # CONFIG_VF610_ADC is not set # CONFIG_XILINX_XADC is not set # end of Analog to digital converters @@ -5543,6 +5674,12 @@ CONFIG_MESON_SARADC=y # CONFIG_HMC425 is not set # end of Amplifiers +# +# Capacitance to digital converters +# +# CONFIG_AD7150 is not set +# end of Capacitance to digital converters + # # Chemical Sensors # @@ -5554,7 +5691,9 @@ CONFIG_MESON_SARADC=y # CONFIG_PMS7003 is not set # CONFIG_SCD30_CORE is not set # CONFIG_SENSIRION_SGP30 is not set -# CONFIG_SPS30 is not set +# CONFIG_SENSIRION_SGP40 is not set +# CONFIG_SPS30_I2C is not set +# CONFIG_SPS30_SERIAL is not set # CONFIG_VZ89X is not set # end of Chemical Sensors @@ -5563,6 +5702,11 @@ CONFIG_MESON_SARADC=y # # end of Hid Sensor IIO Common +# +# IIO SCMI Sensors +# +# end of IIO SCMI Sensors + # # SSP Sensor Common # @@ -5588,6 +5732,7 @@ CONFIG_MESON_SARADC=y # CONFIG_AD5758 is not set # CONFIG_AD5761 is not set # CONFIG_AD5764 is not set +# CONFIG_AD5766 is not set # CONFIG_AD5770R is not set # CONFIG_AD5791 is not set # CONFIG_AD7303 is not set @@ -5691,6 +5836,7 @@ CONFIG_MESON_SARADC=y # CONFIG_INV_MPU6050_I2C is not set # CONFIG_INV_MPU6050_SPI is not set # CONFIG_IIO_ST_LSM6DSX is not set +# CONFIG_IIO_ST_LSM9DS0 is not set # end of Inertial measurement units # @@ -5732,6 +5878,7 @@ CONFIG_MESON_SARADC=y # CONFIG_TCS3472 is not set # CONFIG_SENSORS_TSL2563 is not set # CONFIG_TSL2583 is not set +# CONFIG_TSL2591 is not set # CONFIG_TSL2772 is not set # CONFIG_TSL4531 is not set # CONFIG_US5182D is not set @@ -5758,6 +5905,7 @@ CONFIG_MESON_SARADC=y # CONFIG_SENSORS_HMC5843_SPI is not set # CONFIG_SENSORS_RM3100_I2C is not set # CONFIG_SENSORS_RM3100_SPI is not set +# CONFIG_YAMAHA_YAS530 is not set # end of Magnetometer sensors # @@ -5786,6 +5934,7 @@ CONFIG_MESON_SARADC=y # # Digital potentiometers # +# CONFIG_AD5110 is not set # CONFIG_AD5272 is not set # CONFIG_DS1803 is not set # CONFIG_MAX5432 is not set @@ -5862,6 +6011,7 @@ CONFIG_MESON_SARADC=y # CONFIG_MLX90632 is not set # CONFIG_TMP006 is not set # CONFIG_TMP007 is not set +# CONFIG_TMP117 is not set # CONFIG_TSYS01 is not set # CONFIG_TSYS02D is not set # CONFIG_MAX31856 is not set @@ -5895,8 +6045,6 @@ CONFIG_MESON_IRQ_GPIO=y # CONFIG_IPACK_BUS is not set CONFIG_RESET_CONTROLLER=y -# CONFIG_RESET_BRCMSTB_RESCAL is not set -# CONFIG_RESET_INTEL_GW is not set CONFIG_RESET_MESON=y CONFIG_RESET_MESON_AUDIO_ARB=y # CONFIG_RESET_TI_SYSCON is not set @@ -5907,6 +6055,7 @@ CONFIG_RESET_MESON_AUDIO_ARB=y CONFIG_GENERIC_PHY=y CONFIG_GENERIC_PHY_MIPI_DPHY=y # CONFIG_PHY_XGENE is not set +# CONFIG_PHY_CAN_TRANSCEIVER is not set CONFIG_PHY_MESON8B_USB2=y CONFIG_PHY_MESON_GXL_USB2=y CONFIG_PHY_MESON_G12A_USB2=y @@ -5959,6 +6108,7 @@ CONFIG_NVMEM_SYSFS=y # CONFIG_NVMEM_SPMI_SDAM is not set CONFIG_MESON_EFUSE=y # CONFIG_MESON_MX_EFUSE is not set +# CONFIG_NVMEM_RMEM is not set # # HW tracing support @@ -6033,7 +6183,7 @@ CONFIG_XFS_SUPPORT_V4=y # CONFIG_GFS2_FS is not set # CONFIG_OCFS2_FS is not set CONFIG_BTRFS_FS=m -# CONFIG_BTRFS_FS_POSIX_ACL is not set +CONFIG_BTRFS_FS_POSIX_ACL=y # CONFIG_BTRFS_FS_CHECK_INTEGRITY is not set # CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set # CONFIG_BTRFS_DEBUG is not set @@ -6046,12 +6196,12 @@ CONFIG_F2FS_STAT_FS=y CONFIG_F2FS_CHECK_FS=y # CONFIG_F2FS_FAULT_INJECTION is not set # CONFIG_F2FS_FS_COMPRESSION is not set +CONFIG_F2FS_IOSTAT=y # CONFIG_FS_DAX is not set CONFIG_FS_POSIX_ACL=y CONFIG_EXPORTFS=y # CONFIG_EXPORTFS_BLOCK_OPS is not set CONFIG_FILE_LOCKING=y -CONFIG_MANDATORY_FILE_LOCKING=y # CONFIG_FS_ENCRYPTION is not set # CONFIG_FS_VERITY is not set CONFIG_FSNOTIFY=y @@ -6074,11 +6224,11 @@ CONFIG_OVERLAY_FS_REDIRECT_ALWAYS_FOLLOW=y # # Caches # +CONFIG_NETFS_SUPPORT=y +# CONFIG_NETFS_STATS is not set CONFIG_FSCACHE=y # CONFIG_FSCACHE_STATS is not set -# CONFIG_FSCACHE_HISTOGRAM is not set # CONFIG_FSCACHE_DEBUG is not set -# CONFIG_FSCACHE_OBJECT_LIST is not set # CONFIG_CACHEFILES is not set # end of Caches @@ -6103,6 +6253,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="ascii" CONFIG_EXFAT_FS=m CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8" # CONFIG_NTFS_FS is not set +CONFIG_NTFS3_FS=m # end of DOS/FAT/EXFAT/NT Filesystems # @@ -6119,6 +6270,7 @@ CONFIG_TMPFS=y CONFIG_TMPFS_POSIX_ACL=y CONFIG_TMPFS_XATTR=y # CONFIG_TMPFS_INODE64 is not set +CONFIG_ARCH_SUPPORTS_HUGETLBFS=y # CONFIG_HUGETLBFS is not set CONFIG_MEMFD_CREATE=y CONFIG_ARCH_HAS_GIGANTIC_PAGE=y @@ -6173,7 +6325,7 @@ CONFIG_NFS_V4=y CONFIG_NFS_V4_1=y CONFIG_NFS_V4_2=y CONFIG_PNFS_FILE_LAYOUT=y -CONFIG_PNFS_FLEXFILE_LAYOUT=m +CONFIG_PNFS_FLEXFILE_LAYOUT=y CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org" CONFIG_NFS_V4_1_MIGRATION=y CONFIG_ROOT_NFS=y @@ -6187,6 +6339,7 @@ CONFIG_GRACE_PERIOD=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y CONFIG_NFS_COMMON=y +CONFIG_NFS_V4_2_SSC_HELPER=y CONFIG_SUNRPC=y CONFIG_SUNRPC_GSS=y CONFIG_SUNRPC_BACKCHANNEL=y @@ -6197,7 +6350,6 @@ CONFIG_RPCSEC_GSS_KRB5=m CONFIG_CIFS=y CONFIG_CIFS_STATS2=y CONFIG_CIFS_ALLOW_INSECURE_LEGACY=y -# CONFIG_CIFS_WEAK_PW_HASH is not set # CONFIG_CIFS_UPCALL is not set # CONFIG_CIFS_XATTR is not set CONFIG_CIFS_DEBUG=y @@ -6207,6 +6359,8 @@ CONFIG_CIFS_DEBUG=y # CONFIG_CIFS_SWN_UPCALL is not set CONFIG_CIFS_FSCACHE=y # CONFIG_CIFS_ROOT is not set +# CONFIG_SMB_SERVER is not set +CONFIG_SMBFS_COMMON=y # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set CONFIG_NLS=y @@ -6345,6 +6499,7 @@ CONFIG_CRYPTO_RSA=y CONFIG_CRYPTO_DH=y CONFIG_CRYPTO_ECC=m CONFIG_CRYPTO_ECDH=m +# CONFIG_CRYPTO_ECDSA is not set # CONFIG_CRYPTO_ECRDSA is not set # CONFIG_CRYPTO_SM2 is not set # CONFIG_CRYPTO_CURVE25519 is not set @@ -6397,17 +6552,13 @@ CONFIG_CRYPTO_GHASH=y CONFIG_CRYPTO_MD4=y CONFIG_CRYPTO_MD5=y # CONFIG_CRYPTO_MICHAEL_MIC is not set -# CONFIG_CRYPTO_RMD128 is not set # CONFIG_CRYPTO_RMD160 is not set -# CONFIG_CRYPTO_RMD256 is not set -# CONFIG_CRYPTO_RMD320 is not set CONFIG_CRYPTO_SHA1=y CONFIG_CRYPTO_SHA256=y CONFIG_CRYPTO_SHA512=y # CONFIG_CRYPTO_SHA3 is not set # CONFIG_CRYPTO_SM3 is not set # CONFIG_CRYPTO_STREEBOG is not set -# CONFIG_CRYPTO_TGR192 is not set # CONFIG_CRYPTO_WP512 is not set # @@ -6424,7 +6575,6 @@ CONFIG_CRYPTO_ARC4=y CONFIG_CRYPTO_DES=y # CONFIG_CRYPTO_FCRYPT is not set # CONFIG_CRYPTO_KHAZAD is not set -# CONFIG_CRYPTO_SALSA20 is not set CONFIG_CRYPTO_CHACHA20=y # CONFIG_CRYPTO_SEED is not set # CONFIG_CRYPTO_SERPENT is not set @@ -6507,6 +6657,8 @@ CONFIG_SYSTEM_TRUSTED_KEYS="" # CONFIG_SYSTEM_BLACKLIST_KEYRING is not set # end of Certificates for signature checking +CONFIG_BINARY_PRINTF=y + # # Library routines # @@ -6519,6 +6671,7 @@ CONFIG_HAVE_ARCH_BITREVERSE=y CONFIG_GENERIC_STRNCPY_FROM_USER=y CONFIG_GENERIC_STRNLEN_USER=y CONFIG_GENERIC_NET_UTILS=y +CONFIG_GENERIC_FIND_FIRST_BIT=y CONFIG_CORDIC=m # CONFIG_PRIME_NUMBERS is not set CONFIG_RATIONAL=y @@ -6577,6 +6730,7 @@ CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE=y CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU=y CONFIG_ARCH_HAS_DMA_PREP_COHERENT=y CONFIG_SWIOTLB=y +# CONFIG_DMA_RESTRICTED_POOL is not set CONFIG_DMA_NONCOHERENT_MMAP=y CONFIG_DMA_COHERENT_POOL=y CONFIG_DMA_REMAP=y @@ -6587,7 +6741,7 @@ CONFIG_DMA_CMA=y # # Default contiguous memory area size: # -CONFIG_CMA_SIZE_MBYTES=128 +CONFIG_CMA_SIZE_MBYTES=256 CONFIG_CMA_SIZE_SEL_MBYTES=y # CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set # CONFIG_CMA_SIZE_SEL_MIN is not set @@ -6616,7 +6770,6 @@ CONFIG_FONT_8x16=y CONFIG_SG_POOL=y CONFIG_ARCH_STACKWALK=y CONFIG_SBITMAP=y -# CONFIG_STRING_SELFTEST is not set # end of Library routines CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y @@ -6630,6 +6783,7 @@ CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y # CONFIG_PRINTK_TIME=y # CONFIG_PRINTK_CALLER is not set +# CONFIG_STACKTRACE_BUILD_ID is not set CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7 CONFIG_CONSOLE_LOGLEVEL_QUIET=4 CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 @@ -6650,9 +6804,10 @@ CONFIG_STRIP_ASM_SYMS=y # CONFIG_HEADERS_INSTALL is not set # CONFIG_DEBUG_SECTION_MISMATCH is not set CONFIG_SECTION_MISMATCH_WARN_ONLY=y -# CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_32B is not set +# CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_64B is not set CONFIG_ARCH_WANT_FRAME_POINTERS=y CONFIG_FRAME_POINTER=y +# CONFIG_VMLINUX_MAP is not set # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set # end of Compile-time checks and compiler options @@ -6705,9 +6860,12 @@ CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y CONFIG_HAVE_ARCH_KASAN=y CONFIG_HAVE_ARCH_KASAN_SW_TAGS=y CONFIG_HAVE_ARCH_KASAN_HW_TAGS=y +CONFIG_HAVE_ARCH_KASAN_VMALLOC=y CONFIG_CC_HAS_KASAN_GENERIC=y CONFIG_CC_HAS_WORKING_NOSANITIZE_ADDRESS=y # CONFIG_KASAN is not set +CONFIG_HAVE_ARCH_KFENCE=y +# CONFIG_KFENCE is not set # end of Memory Debugging # CONFIG_DEBUG_SHIRQ is not set @@ -6747,6 +6905,11 @@ CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y CONFIG_DEBUG_RWSEMS=y CONFIG_DEBUG_LOCK_ALLOC=y CONFIG_LOCKDEP=y +CONFIG_LOCKDEP_BITS=15 +CONFIG_LOCKDEP_CHAINS_BITS=16 +CONFIG_LOCKDEP_STACK_TRACE_BITS=19 +CONFIG_LOCKDEP_STACK_TRACE_HASH_BITS=14 +CONFIG_LOCKDEP_CIRCULAR_QUEUE_BITS=12 # CONFIG_DEBUG_LOCKDEP is not set # CONFIG_DEBUG_ATOMIC_SLEEP is not set # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set @@ -6756,10 +6919,10 @@ CONFIG_LOCKDEP=y # CONFIG_CSD_LOCK_WAIT_DEBUG is not set # end of Lock Debugging (spinlocks, mutexes, etc...) +# CONFIG_DEBUG_IRQFLAGS is not set CONFIG_STACKTRACE=y # CONFIG_WARN_ALL_UNSEEDED_RANDOM is not set # CONFIG_DEBUG_KOBJECT is not set -CONFIG_HAVE_DEBUG_BUGVERBOSE=y # # Debug kernel data structures @@ -6785,7 +6948,6 @@ CONFIG_RCU_CPU_STALL_TIMEOUT=21 # end of RCU Debugging # CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set -# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set # CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set # CONFIG_LATENCYTOP is not set CONFIG_HAVE_FUNCTION_TRACER=y @@ -6818,6 +6980,7 @@ CONFIG_ARCH_HAS_KCOV=y CONFIG_CC_HAS_SANCOV_TRACE_PC=y # CONFIG_KCOV is not set # CONFIG_RUNTIME_TESTING_MENU is not set +CONFIG_ARCH_USE_MEMTEST=y # CONFIG_MEMTEST is not set # end of Kernel Testing and Coverage # end of Kernel hacking diff --git a/projects/Amlogic/patches/linux/amlogic-0005-HACK-drm-meson-add-YUV422-output-support.patch b/projects/Amlogic/patches/linux/amlogic-0005-HACK-drm-meson-add-YUV422-output-support.patch deleted file mode 100644 index 30bdf99c7e..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0005-HACK-drm-meson-add-YUV422-output-support.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 227da4272ca9ccecfbff90cd3e8678f0aee6e3ea Mon Sep 17 00:00:00 2001 -From: Dongjin Kim -Date: Wed, 29 Jul 2020 04:05:03 +0900 -Subject: [PATCH 05/88] HACK: drm/meson: add YUV422 output support - -Support YUV422 output from the Amlogic Meson SoC VPU to the HDMI -controller. This incorrectly fixes the green-line on GX devices. - -Signed-off-by: Dongjin Kim ---- - drivers/gpu/drm/meson/meson_dw_hdmi.c | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c -index aad75a22dc33..97d670081824 100644 ---- a/drivers/gpu/drm/meson/meson_dw_hdmi.c -+++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c -@@ -703,6 +703,7 @@ dw_hdmi_mode_valid(struct dw_hdmi *hdmi, void *data, - - static const u32 meson_dw_hdmi_out_bus_fmts[] = { - MEDIA_BUS_FMT_YUV8_1X24, -+ MEDIA_BUS_FMT_UYVY8_1X16, - MEDIA_BUS_FMT_UYYVYY8_0_5X24, - }; - -@@ -802,7 +803,8 @@ static void meson_venc_hdmi_encoder_mode_set(struct drm_bridge *bridge, - if (dw_hdmi->output_bus_fmt == MEDIA_BUS_FMT_UYYVYY8_0_5X24) { - ycrcb_map = VPU_HDMI_OUTPUT_CRYCB; - yuv420_mode = true; -- } -+ } else if (dw_hdmi->output_bus_fmt == MEDIA_BUS_FMT_UYVY8_1X16) -+ ycrcb_map = VPU_HDMI_OUTPUT_CRYCB; - - /* VENC + VENC-DVI Mode setup */ - meson_venc_hdmi_mode_set(priv, vic, ycrcb_map, yuv420_mode, mode); -@@ -814,6 +816,10 @@ static void meson_venc_hdmi_encoder_mode_set(struct drm_bridge *bridge, - /* Setup YUV420 to HDMI-TX, no 10bit diphering */ - writel_relaxed(2 | (2 << 2), - priv->io_base + _REG(VPU_HDMI_FMT_CTRL)); -+ else if (dw_hdmi->output_bus_fmt == MEDIA_BUS_FMT_UYVY8_1X16) -+ /* Setup YUV422 to HDMI-TX, no 10bit diphering */ -+ writel_relaxed(1 | (2 << 2), -+ priv->io_base + _REG(VPU_HDMI_FMT_CTRL)); - else - /* Setup YUV444 to HDMI-TX, no 10bit diphering */ - writel_relaxed(0, priv->io_base + _REG(VPU_HDMI_FMT_CTRL)); --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0006-HACK-mmc-core-always-re-init-sdcards-to-set-default-.patch b/projects/Amlogic/patches/linux/amlogic-0006-HACK-mmc-core-always-re-init-sdcards-to-set-default-.patch deleted file mode 100644 index 3a378b3633..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0006-HACK-mmc-core-always-re-init-sdcards-to-set-default-.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 592630a4362674aaaa3791bf107e57dbe3d4f0cf Mon Sep 17 00:00:00 2001 -From: Neil Armstrong -Date: Thu, 16 Apr 2020 08:31:55 +0000 -Subject: [PATCH 06/88] HACK: mmc: core: always re-init sdcards to set default - 3.3v regulator ios - -sd-uhs-** in device-tree changes the voltage to 1.8v, so we need to ensure -the card is reset to 3.3v before rebooting else on reboot there is no card -to boot from. - -Signed-off-by: Neil Armstrong ---- - drivers/mmc/core/sd.c | 22 +++++++++++++++++++++- - 1 file changed, 21 insertions(+), 1 deletion(-) - -diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c -index 6f054c449d46..5eeccc8b1e00 100644 ---- a/drivers/mmc/core/sd.c -+++ b/drivers/mmc/core/sd.c -@@ -1245,6 +1245,26 @@ static int mmc_sd_suspend(struct mmc_host *host) - return err; - } - -+/* -+ * Callback for shutdown -+ */ -+static int mmc_sd_shutdown(struct mmc_host *host) -+{ -+ mmc_claim_host(host); -+ -+ if (mmc_card_suspended(host->card)) -+ goto out; -+ -+ mmc_power_off(host); -+ mmc_card_set_suspended(host->card); -+ -+ pm_runtime_disable(&host->card->dev); -+ pm_runtime_set_suspended(&host->card->dev); -+ -+out: -+ return 0; -+} -+ - /* - * This function tries to determine if the same card is still present - * and, if so, restore all state to it. -@@ -1323,7 +1343,7 @@ static const struct mmc_bus_ops mmc_sd_ops = { - .suspend = mmc_sd_suspend, - .resume = mmc_sd_resume, - .alive = mmc_sd_alive, -- .shutdown = mmc_sd_suspend, -+ .shutdown = mmc_sd_shutdown, - .hw_reset = mmc_sd_hw_reset, - }; - --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0007-HACK-Revert-Bluetooth-Always-request-for-user-confir.patch b/projects/Amlogic/patches/linux/amlogic-0007-HACK-Revert-Bluetooth-Always-request-for-user-confir.patch deleted file mode 100644 index a50192628c..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0007-HACK-Revert-Bluetooth-Always-request-for-user-confir.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 9f7e0e762eb7e98293dc7c8bd00b4881e82ea68a Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Wed, 10 Mar 2021 10:57:20 +0000 -Subject: [PATCH 07/88] HACK: Revert "Bluetooth: Always request for user - confirmation for Just Works" - -This reverts commit 92516cd97fd4d8ad5b1421a0d51771044f453a5f. - -The commit "Bluetooth: Always request for user confirmation for Just -Works" prevents BLE devices pairing in (at least) the Raspberry Pi OS -GUI. After reverting it, pairing works again. - -If another solution to the problem is found then this reversion will -be removed. - -See: https://github.com/raspberrypi/linux/issues/4139 - -Signed-off-by: Phil Elwell -Signed-off-by: Fang Yafen -Signed-off-by: Zheng Zengkai ---- - net/bluetooth/smp.c | 11 ++--------- - 1 file changed, 2 insertions(+), 9 deletions(-) - -diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c -index c659c464f7ca..05696317f302 100644 ---- a/net/bluetooth/smp.c -+++ b/net/bluetooth/smp.c -@@ -883,16 +883,9 @@ static int tk_request(struct l2cap_conn *conn, u8 remote_oob, u8 auth, - hcon->io_capability == HCI_IO_NO_INPUT_OUTPUT) - smp->method = JUST_WORKS; - -- /* If Just Works, Continue with Zero TK and ask user-space for -- * confirmation */ -+ /* If Just Works, Continue with Zero TK */ - if (smp->method == JUST_WORKS) { -- ret = mgmt_user_confirm_request(hcon->hdev, &hcon->dst, -- hcon->type, -- hcon->dst_type, -- passkey, 1); -- if (ret) -- return ret; -- set_bit(SMP_FLAG_WAIT_USER, &smp->flags); -+ set_bit(SMP_FLAG_TK_VALID, &smp->flags); - return 0; - } - --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0008-FROMGIT-arm64-dts-meson-Fix-schema-warnings-for-pwm-.patch b/projects/Amlogic/patches/linux/amlogic-0008-FROMGIT-arm64-dts-meson-Fix-schema-warnings-for-pwm-.patch deleted file mode 100644 index 0771884b2d..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0008-FROMGIT-arm64-dts-meson-Fix-schema-warnings-for-pwm-.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 4a6c74f4230afce1b9ae525ce09ee8da3a222003 Mon Sep 17 00:00:00 2001 -From: Alexander Dahl -Date: Mon, 11 Jan 2021 14:47:38 +0000 -Subject: [PATCH 08/88] FROMGIT: arm64: dts: meson: Fix schema warnings for - pwm-leds - -The node names for devices using the pwm-leds driver follow a certain -naming scheme (now). Parent node name is not enforced, but recommended -by DT project. - -Signed-off-by: Alexander Dahl -Reviewed-by: Neil Armstrong -Signed-off-by: Kevin Hilman ---- - .../arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts | 4 ++-- - arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts | 4 ++-- - arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts | 8 ++++---- - 3 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts -index 6fe589cd2ba2..45adae480a3d 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts -@@ -42,10 +42,10 @@ - }; - }; - -- pwmleds { -+ led-controller { - compatible = "pwm-leds"; - -- power { -+ led-1 { - label = "vim:red:power"; - pwms = <&pwm_AO_ab 1 7812500 0>; - max-brightness = <255>; -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts -index bf9877d33427..25857e0c0831 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts -@@ -81,10 +81,10 @@ - }; - }; - -- pwmleds { -+ led-controller { - compatible = "pwm-leds"; - -- power { -+ led-1 { - label = "vim:red:power"; - pwms = <&pwm_AO_ab 1 7812500 0>; - max-brightness = <255>; -diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts -index 5ab139a34c01..039a8d0d1e9b 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts -@@ -101,20 +101,20 @@ - }; - }; - -- leds { -+ led-controller-1 { - compatible = "gpio-leds"; - -- led-bluetooth { -+ led-1 { - label = "sei610:blue:bt"; - gpios = <&gpio GPIOC_7 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; - default-state = "off"; - }; - }; - -- pwmleds { -+ led-controller-2 { - compatible = "pwm-leds"; - -- power { -+ led-2 { - label = "sei610:red:power"; - pwms = <&pwm_AO_ab 0 30518 0>; - max-brightness = <255>; --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0009-FROMGIT-arm64-dts-meson-vim3-whitespace-fixups.patch b/projects/Amlogic/patches/linux/amlogic-0009-FROMGIT-arm64-dts-meson-vim3-whitespace-fixups.patch deleted file mode 100644 index 027e698775..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0009-FROMGIT-arm64-dts-meson-vim3-whitespace-fixups.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 7e76e4b0d180e5fb56825c1763a219c88bd79f28 Mon Sep 17 00:00:00 2001 -From: Jerome Brunet -Date: Fri, 4 Dec 2020 14:48:41 +0100 -Subject: [PATCH 09/88] FROMGIT: arm64: dts: meson: vim3: whitespace fixups - -Spaces have been used to indent 2 nodes. -Replace those with tabs and remove one extra newline - -Signed-off-by: Jerome Brunet ---- - .../boot/dts/amlogic/meson-khadas-vim3.dtsi | 19 +++++++++---------- - 1 file changed, 9 insertions(+), 10 deletions(-) - -diff --git a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi -index 8f8656262ae7..d3b25163b421 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi -@@ -283,12 +283,12 @@ - }; - - ðmac { -- pinctrl-0 = <ð_pins>, <ð_rgmii_pins>; -- pinctrl-names = "default"; -- status = "okay"; -- phy-mode = "rgmii"; -- phy-handle = <&external_phy>; -- amlogic,tx-delay-ns = <2>; -+ pinctrl-0 = <ð_pins>, <ð_rgmii_pins>; -+ pinctrl-names = "default"; -+ status = "okay"; -+ phy-mode = "rgmii"; -+ phy-handle = <&external_phy>; -+ amlogic,tx-delay-ns = <2>; - }; - - &frddr_a { -@@ -354,9 +354,9 @@ - }; - - &pwm_ef { -- status = "okay"; -- pinctrl-0 = <&pwm_e_pins>; -- pinctrl-names = "default"; -+ status = "okay"; -+ pinctrl-0 = <&pwm_e_pins>; -+ pinctrl-names = "default"; - }; - - &saradc { -@@ -450,7 +450,6 @@ - }; - }; - -- - &tdmif_a { - status = "okay"; - }; --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0010-FROMGIT-arm64-dts-meson-vim3-enable-hdmi-audio-loopb.patch b/projects/Amlogic/patches/linux/amlogic-0010-FROMGIT-arm64-dts-meson-vim3-enable-hdmi-audio-loopb.patch deleted file mode 100644 index 9774e14059..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0010-FROMGIT-arm64-dts-meson-vim3-enable-hdmi-audio-loopb.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 8a50ed513979ecde63a49d0aaa71c302ac537980 Mon Sep 17 00:00:00 2001 -From: Jerome Brunet -Date: Fri, 4 Dec 2020 16:23:55 +0100 -Subject: [PATCH 10/88] FROMGIT: arm64: dts: meson: vim3: enable hdmi audio - loopback - -Enable audio capture frontends and a tdm decoder. -This makes it possible to loopback the audio played on the hdmi codec, -which is the only output interface at the moment. - -Of course, one TODDR device would be enough to do that but since -the 3 FRDDRs are enabled on the playback side, let's do the same on the -capture side. - -Signed-off-by: Jerome Brunet ---- - .../boot/dts/amlogic/meson-khadas-vim3.dtsi | 41 +++++++++++++++++-- - 1 file changed, 37 insertions(+), 4 deletions(-) - -diff --git a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi -index d3b25163b421..4e4c2f924486 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi -@@ -171,11 +171,16 @@ - sound { - compatible = "amlogic,axg-sound-card"; - model = "G12B-KHADAS-VIM3"; -- audio-aux-devs = <&tdmout_a>; -+ audio-aux-devs = <&tdmin_a>, <&tdmout_a>; - audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 0", - "TDMOUT_A IN 1", "FRDDR_B OUT 0", - "TDMOUT_A IN 2", "FRDDR_C OUT 0", -- "TDM_A Playback", "TDMOUT_A OUT"; -+ "TDM_A Playback", "TDMOUT_A OUT", -+ "TDMIN_A IN 1", "TDM_A Capture", -+ "TDMIN_A IN 3", "TDM_A Loopback", -+ "TODDR_A IN 0", "TDMIN_A OUT", -+ "TODDR_B IN 0", "TDMIN_A OUT", -+ "TODDR_C IN 0", "TDMIN_A OUT"; - - assigned-clocks = <&clkc CLKID_MPLL2>, - <&clkc CLKID_MPLL0>, -@@ -198,8 +203,20 @@ - sound-dai = <&frddr_c>; - }; - -- /* 8ch hdmi interface */ - dai-link-3 { -+ sound-dai = <&toddr_a>; -+ }; -+ -+ dai-link-4 { -+ sound-dai = <&toddr_b>; -+ }; -+ -+ dai-link-5 { -+ sound-dai = <&toddr_c>; -+ }; -+ -+ /* 8ch hdmi interface */ -+ dai-link-6 { - sound-dai = <&tdmif_a>; - dai-format = "i2s"; - dai-tdm-slot-tx-mask-0 = <1 1>; -@@ -214,7 +231,7 @@ - }; - - /* hdmi glue */ -- dai-link-4 { -+ dai-link-7 { - sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>; - - codec { -@@ -454,10 +471,26 @@ - status = "okay"; - }; - -+&tdmin_a { -+ status = "okay"; -+}; -+ - &tdmout_a { - status = "okay"; - }; - -+&toddr_a { -+ status = "okay"; -+}; -+ -+&toddr_b { -+ status = "okay"; -+}; -+ -+&toddr_c { -+ status = "okay"; -+}; -+ - &tohdmitx { - status = "okay"; - }; --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0011-FROMGIT-arm64-dts-meson-add-i2c3-rtc-nodes-and-rtc-a.patch b/projects/Amlogic/patches/linux/amlogic-0011-FROMGIT-arm64-dts-meson-add-i2c3-rtc-nodes-and-rtc-a.patch deleted file mode 100644 index 72dddb8006..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0011-FROMGIT-arm64-dts-meson-add-i2c3-rtc-nodes-and-rtc-a.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 0ac730a8509d4ad8ad800c6fb904c743a4721063 Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Mon, 21 Dec 2020 12:06:25 +0000 -Subject: [PATCH 11/88] FROMGIT: arm64: dts: meson: add i2c3/rtc nodes and rtc - aliases to ODROID-N2 dtsi - -Enable the onboard pcf8563 rtc hardware on ODROID N2/N2+ boards via the -common dtsi. Also add aliases to ensure vrtc does not claim /dev/rtc0. - -Signed-off-by: Christian Hewitt ---- - .../boot/dts/amlogic/meson-g12b-odroid-n2.dtsi | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - -diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi -index 39a09661c5f6..b78be3e6974d 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi -@@ -13,6 +13,8 @@ - aliases { - serial0 = &uart_AO; - ethernet0 = ðmac; -+ rtc0 = &rtc; -+ rtc1 = &vrtc; - }; - - dioo2133: audio-amplifier-0 { -@@ -478,6 +480,18 @@ - linux,rc-map-name = "rc-odroid"; - }; - -+&i2c3 { -+ status = "okay"; -+ pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>; -+ pinctrl-names = "default"; -+ -+ rtc: rtc@51 { -+ compatible = "nxp,pcf8563"; -+ reg = <0x51>; -+ wakeup-source; -+ }; -+}; -+ - &pwm_ab { - pinctrl-0 = <&pwm_a_e_pins>; - pinctrl-names = "default"; --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0012-FROMGIT-arm64-dts-meson-add-initial-Beelink-GS-King-.patch b/projects/Amlogic/patches/linux/amlogic-0012-FROMGIT-arm64-dts-meson-add-initial-Beelink-GS-King-.patch deleted file mode 100644 index f468ea987f..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0012-FROMGIT-arm64-dts-meson-add-initial-Beelink-GS-King-.patch +++ /dev/null @@ -1,188 +0,0 @@ -From 63dd112ad3698275df592895cc46b4afc950186a Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Fri, 12 Jun 2020 08:05:20 +0000 -Subject: [PATCH 12/88] FROMGIT: arm64: dts: meson: add initial Beelink - GS-King-X device-tree - -The Shenzen AZW (Beelink) GS-King-X is based on the Amlogic W400 reference -board with an S922X-H chip. - -- 4GB LPDDR4 RAM -- 64GB eMMC storage -- 10/100/1000 Base-T Ethernet -- AP6356S Wireless (802.11 a/b/g/n/ac, BT 4.1) -- HDMI 2.1 video -- S/PDIF optical output -- 2x ESS9018 audio DACs -- 4x Ricor RT6862 audio amps -- Analogue headphone output -- 1x USB 2.0 OTG port -- 3x USB 3.0 ports -- IR receiver -- 1x micro SD card slot (internal) -- USB SATA controller with 2x 3.5" drive bays -- 1x Power on/off button - -Signed-off-by: Christian Hewitt -Acked-by: Martin Blumenstingl -Tested-by: Neil Armstrong ---- - arch/arm64/boot/dts/amlogic/Makefile | 1 + - .../boot/dts/amlogic/meson-g12b-gsking-x.dts | 133 ++++++++++++++++++ - 2 files changed, 134 insertions(+) - create mode 100644 arch/arm64/boot/dts/amlogic/meson-g12b-gsking-x.dts - -diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile -index ced03946314f..dce41cd3f347 100644 ---- a/arch/arm64/boot/dts/amlogic/Makefile -+++ b/arch/arm64/boot/dts/amlogic/Makefile -@@ -3,6 +3,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-axg-s400.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-g12a-sei510.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-g12a-u200.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-g12a-x96-max.dtb -+dtb-$(CONFIG_ARCH_MESON) += meson-g12b-gsking-x.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-g12b-gtking.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-g12b-gtking-pro.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-g12b-a311d-khadas-vim3.dtb -diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-gsking-x.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-gsking-x.dts -new file mode 100644 -index 000000000000..211191f66344 ---- /dev/null -+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-gsking-x.dts -@@ -0,0 +1,133 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+/* -+ * Copyright (c) 2019 BayLibre, SAS -+ * Author: Neil Armstrong -+ * Copyright (c) 2019 Christian Hewitt -+ */ -+ -+/dts-v1/; -+ -+#include "meson-g12b-w400.dtsi" -+#include -+#include -+ -+/ { -+ compatible = "azw,gsking-x", "amlogic,g12b"; -+ model = "Beelink GS-King X"; -+ -+ aliases { -+ rtc0 = &rtc; -+ rtc1 = &vrtc; -+ }; -+ -+ gpio-keys-polled { -+ compatible = "gpio-keys-polled"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ poll-interval = <100>; -+ -+ power-button { -+ label = "power"; -+ linux,code = ; -+ gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>; -+ }; -+ }; -+ -+ sound { -+ compatible = "amlogic,axg-sound-card"; -+ model = "GSKING-X"; -+ audio-aux-devs = <&tdmout_a>; -+ audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 1", -+ "TDMOUT_A IN 1", "FRDDR_B OUT 1", -+ "TDMOUT_A IN 2", "FRDDR_C OUT 1", -+ "TDM_A Playback", "TDMOUT_A OUT"; -+ -+ assigned-clocks = <&clkc CLKID_MPLL2>, -+ <&clkc CLKID_MPLL0>, -+ <&clkc CLKID_MPLL1>; -+ assigned-clock-parents = <0>, <0>, <0>; -+ assigned-clock-rates = <294912000>, -+ <270950400>, -+ <393216000>; -+ status = "okay"; -+ -+ dai-link-0 { -+ sound-dai = <&frddr_a>; -+ }; -+ -+ dai-link-1 { -+ sound-dai = <&frddr_b>; -+ }; -+ -+ dai-link-2 { -+ sound-dai = <&frddr_c>; -+ }; -+ -+ /* 8ch hdmi interface */ -+ dai-link-3 { -+ sound-dai = <&tdmif_a>; -+ dai-format = "i2s"; -+ dai-tdm-slot-tx-mask-0 = <1 1>; -+ dai-tdm-slot-tx-mask-1 = <1 1>; -+ dai-tdm-slot-tx-mask-2 = <1 1>; -+ dai-tdm-slot-tx-mask-3 = <1 1>; -+ mclk-fs = <256>; -+ -+ codec { -+ sound-dai = <&tohdmitx TOHDMITX_I2S_IN_A>; -+ }; -+ }; -+ -+ dai-link-4 { -+ sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>; -+ -+ codec { -+ sound-dai = <&hdmi_tx>; -+ }; -+ }; -+ }; -+}; -+ -+&arb { -+ status = "okay"; -+}; -+ -+&clkc_audio { -+ status = "okay"; -+}; -+ -+&frddr_a { -+ status = "okay"; -+}; -+ -+&frddr_b { -+ status = "okay"; -+}; -+ -+&frddr_c { -+ status = "okay"; -+}; -+ -+&i2c3 { -+ status = "okay"; -+ pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>; -+ pinctrl-names = "default"; -+ -+ rtc: rtc@51 { -+ compatible = "nxp,pcf8563"; -+ reg = <0x51>; -+ wakeup-source; -+ }; -+}; -+ -+&tdmif_a { -+ status = "okay"; -+}; -+ -+&tdmout_a { -+ status = "okay"; -+}; -+ -+&tohdmitx { -+ status = "okay"; -+}; --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0013-FROMGIT-arm64-dts-meson-shorten-audio-card-names-for.patch b/projects/Amlogic/patches/linux/amlogic-0013-FROMGIT-arm64-dts-meson-shorten-audio-card-names-for.patch deleted file mode 100644 index 1ce22f1f45..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0013-FROMGIT-arm64-dts-meson-shorten-audio-card-names-for.patch +++ /dev/null @@ -1,313 +0,0 @@ -From a8a95cf3c9eb46bd3645e170500d18ecf4774eff Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Thu, 31 Dec 2020 15:54:34 +0000 -Subject: [PATCH 13/88] FROMGIT: arm64: dts: meson: shorten audio card names - for alsa compatibility - -This patch shortens all audio card model names by dropping the SoC prefix -(for conformity) and rewording those that are still longer than alsa's 15 -character name limit [0] to avoid userspace config issues. - -[0] https://github.com/torvalds/linux/blob/master/Documentation/sound/alsa-configuration.rst#common-parameters-for-top-sound-card-modules - -Signed-off-by: Christian Hewitt ---- - arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts | 2 +- - arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts | 2 +- - arch/arm64/boot/dts/amlogic/meson-g12b-gtking-pro.dts | 2 +- - arch/arm64/boot/dts/amlogic/meson-g12b-gtking.dts | 2 +- - arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi | 2 +- - arch/arm64/boot/dts/amlogic/meson-g12b-ugoos-am6.dts | 2 +- - arch/arm64/boot/dts/amlogic/meson-gx-libretech-pc.dtsi | 2 +- - arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi | 2 +- - arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts | 2 +- - arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts | 2 +- - arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 2 +- - arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-hub.dts | 2 +- - arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts | 2 +- - arch/arm64/boot/dts/amlogic/meson-gxl-s805x-libretech-ac.dts | 2 +- - arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts | 2 +- - arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc-v2.dts | 2 +- - arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts | 2 +- - arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts | 2 +- - arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi | 2 +- - arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts | 2 +- - arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts | 2 +- - 21 files changed, 21 insertions(+), 21 deletions(-) - -diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts b/arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts -index b00d0468c753..81269ccc2496 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts -@@ -181,7 +181,7 @@ - - sound { - compatible = "amlogic,axg-sound-card"; -- model = "G12A-SEI510"; -+ model = "SEI510"; - audio-aux-devs = <&tdmout_a>, <&tdmout_b>, - <&tdmin_a>, <&tdmin_b>; - audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 0", -diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts b/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts -index 463a72d6bb7c..579f3d02d613 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts -@@ -150,7 +150,7 @@ - - sound { - compatible = "amlogic,axg-sound-card"; -- model = "G12A-X96-MAX"; -+ model = "X96-MAX"; - audio-aux-devs = <&tdmout_b>; - audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1", - "TDMOUT_B IN 1", "FRDDR_B OUT 1", -diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-gtking-pro.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-gtking-pro.dts -index 0e5c500fb78f..0e331aa5a2d7 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-g12b-gtking-pro.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-gtking-pro.dts -@@ -44,7 +44,7 @@ - - sound { - compatible = "amlogic,axg-sound-card"; -- model = "G12B-GTKING-PRO"; -+ model = "GTKING-PRO"; - audio-aux-devs = <&tdmout_b>; - audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1", - "TDMOUT_B IN 1", "FRDDR_B OUT 1", -diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-gtking.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-gtking.dts -index 10b87eb97b14..a7db84a500bb 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-g12b-gtking.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-gtking.dts -@@ -28,7 +28,7 @@ - - sound { - compatible = "amlogic,axg-sound-card"; -- model = "G12B-GTKING"; -+ model = "GTKING"; - audio-aux-devs = <&tdmout_b>; - audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1", - "TDMOUT_B IN 1", "FRDDR_B OUT 1", -diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi -index b78be3e6974d..58ce569b2ace 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi -@@ -213,7 +213,7 @@ - - sound { - compatible = "amlogic,axg-sound-card"; -- model = "G12B-ODROID-N2"; -+ model = "ODROID-N2"; - audio-widgets = "Line", "Lineout"; - audio-aux-devs = <&tdmout_b>, <&tdmout_c>, <&tdmin_a>, - <&tdmin_b>, <&tdmin_c>, <&tdmin_lb>, -diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-ugoos-am6.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-ugoos-am6.dts -index b57bb0befc69..0c7892600d56 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-g12b-ugoos-am6.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-ugoos-am6.dts -@@ -23,7 +23,7 @@ - - sound { - compatible = "amlogic,axg-sound-card"; -- model = "G12B-UGOOS-AM6"; -+ model = "UGOOS-AM6"; - audio-aux-devs = <&tdmout_b>; - audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1", - "TDMOUT_B IN 1", "FRDDR_B OUT 1", -diff --git a/arch/arm64/boot/dts/amlogic/meson-gx-libretech-pc.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx-libretech-pc.dtsi -index c2480bab8d33..2d7032f41e4b 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gx-libretech-pc.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-gx-libretech-pc.dtsi -@@ -186,7 +186,7 @@ - - sound { - compatible = "amlogic,gx-sound-card"; -- model = "GXL-LIBRETECH-S9XX-PC"; -+ model = "LIBRETECH-PC"; - audio-aux-devs = <&dio2133>; - audio-widgets = "Speaker", "7J4-14 LEFT", - "Speaker", "7J4-11 RIGHT"; -diff --git a/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi -index 6b57e15aade3..dafc841f7c16 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi -@@ -121,7 +121,7 @@ - - sound { - compatible = "amlogic,gx-sound-card"; -- model = "GX-P230-Q200"; -+ model = "P230-Q200"; - audio-aux-devs = <&dio2133>; - audio-widgets = "Line", "Lineout"; - audio-routing = "AU2 INL", "ACODEC LOLP", -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts -index 089e0636ba8a..7273eed5292c 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts -@@ -134,7 +134,7 @@ - - sound { - compatible = "amlogic,gx-sound-card"; -- model = "GXBB-NANOPI-K2"; -+ model = "NANOPI-K2"; - assigned-clocks = <&clkc CLKID_MPLL0>, - <&clkc CLKID_MPLL1>, - <&clkc CLKID_MPLL2>; -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts -index b5b11cb9f393..f887bfb445fd 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts -@@ -143,7 +143,7 @@ - - sound { - compatible = "amlogic,gx-sound-card"; -- model = "GXBB-NEXBOX-A95X"; -+ model = "NEXBOX-A95X"; - assigned-clocks = <&clkc CLKID_MPLL0>, - <&clkc CLKID_MPLL1>, - <&clkc CLKID_MPLL2>; -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts -index c04ef57f7b3b..bfaf7f41a2d6 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts -@@ -176,7 +176,7 @@ - - sound { - compatible = "amlogic,gx-sound-card"; -- model = "GXBB-ODROID-C2"; -+ model = "ODROID-C2"; - assigned-clocks = <&clkc CLKID_MPLL0>, - <&clkc CLKID_MPLL1>, - <&clkc CLKID_MPLL2>; -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-hub.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-hub.dts -index 0c1570153842..58733017eda8 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-hub.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-hub.dts -@@ -15,7 +15,7 @@ - - sound { - compatible = "amlogic,gx-sound-card"; -- model = "GXBB-WETEK-HUB"; -+ model = "WETEK-HUB"; - assigned-clocks = <&clkc CLKID_MPLL0>, - <&clkc CLKID_MPLL1>, - <&clkc CLKID_MPLL2>; -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts -index f2562c7de67c..6eae692792ec 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts -@@ -50,7 +50,7 @@ - - sound { - compatible = "amlogic,gx-sound-card"; -- model = "GXBB-WETEK-PLAY2"; -+ model = "WETEK-PLAY2"; - assigned-clocks = <&clkc CLKID_MPLL0>, - <&clkc CLKID_MPLL1>, - <&clkc CLKID_MPLL2>; -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s805x-libretech-ac.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s805x-libretech-ac.dts -index 9e43f4dca90d..2d769203f671 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxl-s805x-libretech-ac.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s805x-libretech-ac.dts -@@ -118,7 +118,7 @@ - - sound { - compatible = "amlogic,gx-sound-card"; -- model = "GXL-LIBRETECH-S805X-AC"; -+ model = "LIBRETECH-AC"; - audio-widgets = "Speaker", "9J5-3 LEFT", - "Speaker", "9J5-2 RIGHT"; - audio-routing = "9J5-3 LEFT", "ACODEC LOLN", -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts -index 45adae480a3d..60feac0179c0 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts -@@ -66,7 +66,7 @@ - - sound { - compatible = "amlogic,gx-sound-card"; -- model = "GXL-KHADAS-VIM1"; -+ model = "KHADAS-VIM"; - assigned-clocks = <&clkc CLKID_MPLL0>, - <&clkc CLKID_MPLL1>, - <&clkc CLKID_MPLL2>; -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc-v2.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc-v2.dts -index 9a3c08e6e6cc..93d8f8aff70d 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc-v2.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc-v2.dts -@@ -159,7 +159,7 @@ - - sound { - compatible = "amlogic,gx-sound-card"; -- model = "GXL-LIBRETECH-S905X-CC-V2"; -+ model = "LIBRETECH-CC-V2"; - assigned-clocks = <&clkc CLKID_MPLL0>, - <&clkc CLKID_MPLL1>, - <&clkc CLKID_MPLL2>; -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts -index 5ae7bb6209cb..82bfabfbd39c 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts -@@ -135,7 +135,7 @@ - - sound { - compatible = "amlogic,gx-sound-card"; -- model = "GXL-LIBRETECH-S905X-CC"; -+ model = "LIBRETECH-CC"; - audio-aux-devs = <&dio2133>; - audio-widgets = "Line", "Lineout"; - audio-routing = "AU2 INL", "ACODEC LOLN", -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts -index 25857e0c0831..18a4b7a6c5df 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts -@@ -148,7 +148,7 @@ - - sound { - compatible = "amlogic,gx-sound-card"; -- model = "GXM-KHADAS-VIM2"; -+ model = "KHADAS-VIM2"; - assigned-clocks = <&clkc CLKID_MPLL0>, - <&clkc CLKID_MPLL1>, - <&clkc CLKID_MPLL2>; -diff --git a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi -index 4e4c2f924486..f1706873d7a8 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi -@@ -170,7 +170,7 @@ - - sound { - compatible = "amlogic,axg-sound-card"; -- model = "G12B-KHADAS-VIM3"; -+ model = "KHADAS-VIM3"; - audio-aux-devs = <&tdmin_a>, <&tdmout_a>; - audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 0", - "TDMOUT_A IN 1", "FRDDR_B OUT 0", -diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts -index a712273c905a..eadd75e6e067 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts -@@ -190,7 +190,7 @@ - - sound { - compatible = "amlogic,axg-sound-card"; -- model = "SM1-ODROID-C4"; -+ model = "ODROID-C4"; - audio-aux-devs = <&tdmout_b>; - audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1", - "TDMOUT_B IN 1", "FRDDR_B OUT 1", -diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts -index 039a8d0d1e9b..2194a778973f 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts -@@ -220,7 +220,7 @@ - - sound { - compatible = "amlogic,axg-sound-card"; -- model = "SM1-SEI610"; -+ model = "SEI610"; - audio-aux-devs = <&tdmout_a>, <&tdmout_b>, - <&tdmin_a>, <&tdmin_b>; - audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 0", --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0014-FROMGIT-arm64-dts-meson-sort-Amlogic-dtb-Makefile.patch b/projects/Amlogic/patches/linux/amlogic-0014-FROMGIT-arm64-dts-meson-sort-Amlogic-dtb-Makefile.patch deleted file mode 100644 index b27228d02d..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0014-FROMGIT-arm64-dts-meson-sort-Amlogic-dtb-Makefile.patch +++ /dev/null @@ -1,29 +0,0 @@ -From a3fd9e94d211ec9cda74584e5828e76d6496c279 Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Tue, 19 Jan 2021 15:34:53 +0000 -Subject: [PATCH 14/88] FROMGIT: arm64: dts: meson: sort Amlogic dtb Makefile - -Sort the Makefile before adding new SM1 devices. - -Signed-off-by: Christian Hewitt -Acked-by: Neil Armstrong ---- - arch/arm64/boot/dts/amlogic/Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile -index dce41cd3f347..f3c8a85fe987 100644 ---- a/arch/arm64/boot/dts/amlogic/Makefile -+++ b/arch/arm64/boot/dts/amlogic/Makefile -@@ -45,7 +45,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxm-rbox-pro.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxm-s912-libretech-pc.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxm-vega-s96.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxm-wetek-core2.dtb --dtb-$(CONFIG_ARCH_MESON) += meson-sm1-sei610.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-sm1-khadas-vim3l.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-sm1-odroid-c4.dtb -+dtb-$(CONFIG_ARCH_MESON) += meson-sm1-sei610.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-a1-ad401.dtb --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0015-FROMGIT-arm64-dts-meson-convert-meson-sm1-odroid-c4-.patch b/projects/Amlogic/patches/linux/amlogic-0015-FROMGIT-arm64-dts-meson-convert-meson-sm1-odroid-c4-.patch deleted file mode 100644 index 36875f8afa..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0015-FROMGIT-arm64-dts-meson-convert-meson-sm1-odroid-c4-.patch +++ /dev/null @@ -1,941 +0,0 @@ -From 8ae8a8444e462cca3927367af8ca36ab00dd5592 Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Fri, 29 Jan 2021 02:10:14 +0000 -Subject: [PATCH 15/88] FROMGIT: arm64: dts: meson: convert meson-sm1-odroid-c4 - to dtsi - -Convert the ODRIOD-C4 dts to meson-sm1-odroid.dtsi and C4 board dts in -preparation for adding additional C4 family boards. - -Signed-off-by: Christian Hewitt -Reviewed-by: Neil Armstrong ---- - .../boot/dts/amlogic/meson-sm1-odroid-c4.dts | 427 +---------------- - .../boot/dts/amlogic/meson-sm1-odroid.dtsi | 441 ++++++++++++++++++ - 2 files changed, 442 insertions(+), 426 deletions(-) - create mode 100644 arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi - -diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts -index eadd75e6e067..b2a4e823c1d8 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts -@@ -5,34 +5,12 @@ - - /dts-v1/; - --#include "meson-sm1.dtsi" --#include --#include --#include -+#include "meson-sm1-odroid.dtsi" - - / { - compatible = "hardkernel,odroid-c4", "amlogic,sm1"; - model = "Hardkernel ODROID-C4"; - -- aliases { -- serial0 = &uart_AO; -- ethernet0 = ðmac; -- }; -- -- chosen { -- stdout-path = "serial0:115200n8"; -- }; -- -- memory@0 { -- device_type = "memory"; -- reg = <0x0 0x0 0x0 0x40000000>; -- }; -- -- emmc_pwrseq: emmc-pwrseq { -- compatible = "mmc-pwrseq-emmc"; -- reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>; -- }; -- - leds { - compatible = "gpio-leds"; - -@@ -45,96 +23,6 @@ - }; - }; - -- tflash_vdd: regulator-tflash_vdd { -- compatible = "regulator-fixed"; -- -- regulator-name = "TFLASH_VDD"; -- regulator-min-microvolt = <3300000>; -- regulator-max-microvolt = <3300000>; -- -- gpio = <&gpio_ao GPIOAO_3 GPIO_OPEN_DRAIN>; -- enable-active-high; -- regulator-always-on; -- }; -- -- tf_io: gpio-regulator-tf_io { -- compatible = "regulator-gpio"; -- -- regulator-name = "TF_IO"; -- regulator-min-microvolt = <1800000>; -- regulator-max-microvolt = <3300000>; -- -- gpios = <&gpio_ao GPIOAO_6 GPIO_ACTIVE_HIGH>; -- gpios-states = <0>; -- -- states = <3300000 0>, -- <1800000 1>; -- }; -- -- flash_1v8: regulator-flash_1v8 { -- compatible = "regulator-fixed"; -- regulator-name = "FLASH_1V8"; -- regulator-min-microvolt = <1800000>; -- regulator-max-microvolt = <1800000>; -- vin-supply = <&vcc_3v3>; -- regulator-always-on; -- }; -- -- main_12v: regulator-main_12v { -- compatible = "regulator-fixed"; -- regulator-name = "12V"; -- regulator-min-microvolt = <12000000>; -- regulator-max-microvolt = <12000000>; -- regulator-always-on; -- }; -- -- vcc_5v: regulator-vcc_5v { -- compatible = "regulator-fixed"; -- regulator-name = "5V"; -- regulator-min-microvolt = <5000000>; -- regulator-max-microvolt = <5000000>; -- regulator-always-on; -- vin-supply = <&main_12v>; -- }; -- -- vcc_1v8: regulator-vcc_1v8 { -- compatible = "regulator-fixed"; -- regulator-name = "VCC_1V8"; -- regulator-min-microvolt = <1800000>; -- regulator-max-microvolt = <1800000>; -- vin-supply = <&vcc_3v3>; -- regulator-always-on; -- }; -- -- vcc_3v3: regulator-vcc_3v3 { -- compatible = "regulator-fixed"; -- regulator-name = "VCC_3V3"; -- regulator-min-microvolt = <3300000>; -- regulator-max-microvolt = <3300000>; -- vin-supply = <&vddao_3v3>; -- regulator-always-on; -- /* FIXME: actually controlled by VDDCPU_B_EN */ -- }; -- -- vddcpu: regulator-vddcpu { -- /* -- * MP8756GD Regulator. -- */ -- compatible = "pwm-regulator"; -- -- regulator-name = "VDDCPU"; -- regulator-min-microvolt = <721000>; -- regulator-max-microvolt = <1022000>; -- -- vin-supply = <&main_12v>; -- -- pwms = <&pwm_AO_cd 1 1250 0>; -- pwm-dutycycle-range = <100 0>; -- -- regulator-boot-on; -- regulator-always-on; -- }; -- - hub_5v: regulator-hub_5v { - compatible = "regulator-fixed"; - regulator-name = "HUB_5V"; -@@ -147,215 +35,12 @@ - enable-active-high; - }; - -- usb_pwr_en: regulator-usb_pwr_en { -- compatible = "regulator-fixed"; -- regulator-name = "USB_PWR_EN"; -- regulator-min-microvolt = <5000000>; -- regulator-max-microvolt = <5000000>; -- vin-supply = <&vcc_5v>; -- -- /* Connected to the microUSB port power enable */ -- gpio = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>; -- enable-active-high; -- }; -- -- vddao_1v8: regulator-vddao_1v8 { -- compatible = "regulator-fixed"; -- regulator-name = "VDDAO_1V8"; -- regulator-min-microvolt = <1800000>; -- regulator-max-microvolt = <1800000>; -- vin-supply = <&vddao_3v3>; -- regulator-always-on; -- }; -- -- vddao_3v3: regulator-vddao_3v3 { -- compatible = "regulator-fixed"; -- regulator-name = "VDDAO_3V3"; -- regulator-min-microvolt = <3300000>; -- regulator-max-microvolt = <3300000>; -- vin-supply = <&main_12v>; -- regulator-always-on; -- }; -- -- hdmi-connector { -- compatible = "hdmi-connector"; -- type = "a"; -- -- port { -- hdmi_connector_in: endpoint { -- remote-endpoint = <&hdmi_tx_tmds_out>; -- }; -- }; -- }; -- - sound { -- compatible = "amlogic,axg-sound-card"; - model = "ODROID-C4"; -- audio-aux-devs = <&tdmout_b>; -- audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1", -- "TDMOUT_B IN 1", "FRDDR_B OUT 1", -- "TDMOUT_B IN 2", "FRDDR_C OUT 1", -- "TDM_B Playback", "TDMOUT_B OUT"; -- -- assigned-clocks = <&clkc CLKID_MPLL2>, -- <&clkc CLKID_MPLL0>, -- <&clkc CLKID_MPLL1>; -- assigned-clock-parents = <0>, <0>, <0>; -- assigned-clock-rates = <294912000>, -- <270950400>, -- <393216000>; -- status = "okay"; -- -- dai-link-0 { -- sound-dai = <&frddr_a>; -- }; -- -- dai-link-1 { -- sound-dai = <&frddr_b>; -- }; -- -- dai-link-2 { -- sound-dai = <&frddr_c>; -- }; -- -- /* 8ch hdmi interface */ -- dai-link-3 { -- sound-dai = <&tdmif_b>; -- dai-format = "i2s"; -- dai-tdm-slot-tx-mask-0 = <1 1>; -- dai-tdm-slot-tx-mask-1 = <1 1>; -- dai-tdm-slot-tx-mask-2 = <1 1>; -- dai-tdm-slot-tx-mask-3 = <1 1>; -- mclk-fs = <256>; -- -- codec { -- sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>; -- }; -- }; -- -- /* hdmi glue */ -- dai-link-4 { -- sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>; -- -- codec { -- sound-dai = <&hdmi_tx>; -- }; -- }; -- }; --}; -- --&arb { -- status = "okay"; --}; -- --&clkc_audio { -- status = "okay"; --}; -- --&cpu0 { -- cpu-supply = <&vddcpu>; -- operating-points-v2 = <&cpu_opp_table>; -- clocks = <&clkc CLKID_CPU_CLK>; -- clock-latency = <50000>; --}; -- --&cpu1 { -- cpu-supply = <&vddcpu>; -- operating-points-v2 = <&cpu_opp_table>; -- clocks = <&clkc CLKID_CPU1_CLK>; -- clock-latency = <50000>; --}; -- --&cpu2 { -- cpu-supply = <&vddcpu>; -- operating-points-v2 = <&cpu_opp_table>; -- clocks = <&clkc CLKID_CPU2_CLK>; -- clock-latency = <50000>; --}; -- --&cpu3 { -- cpu-supply = <&vddcpu>; -- operating-points-v2 = <&cpu_opp_table>; -- clocks = <&clkc CLKID_CPU3_CLK>; -- clock-latency = <50000>; --}; -- --&ext_mdio { -- external_phy: ethernet-phy@0 { -- /* Realtek RTL8211F (0x001cc916) */ -- reg = <0>; -- max-speed = <1000>; -- -- interrupt-parent = <&gpio_intc>; -- /* MAC_INTR on GPIOZ_14 */ -- interrupts = <26 IRQ_TYPE_LEVEL_LOW>; - }; - }; - --ðmac { -- pinctrl-0 = <ð_pins>, <ð_rgmii_pins>; -- pinctrl-names = "default"; -- status = "okay"; -- phy-mode = "rgmii"; -- phy-handle = <&external_phy>; -- amlogic,tx-delay-ns = <2>; --}; -- --&frddr_a { -- status = "okay"; --}; -- --&frddr_b { -- status = "okay"; --}; -- --&frddr_c { -- status = "okay"; --}; -- - &gpio { -- gpio-line-names = -- /* GPIOZ */ -- "", "", "", "", "", "", "", "", -- "", "", "", "", "", "", "", "", -- /* GPIOH */ -- "", "", "", "", "", -- "PIN_36", /* GPIOH_5 */ -- "PIN_26", /* GPIOH_6 */ -- "PIN_32", /* GPIOH_7 */ -- "", -- /* BOOT */ -- "", "", "", "", "", "", "", "", -- "", "", "", "", "", "", "", "", -- /* GPIOC */ -- "", "", "", "", "", "", "", "", -- /* GPIOA */ -- "", "", "", "", "", "", "", "", -- "", "", "", "", "", "", -- "PIN_27", /* GPIOA_14 */ -- "PIN_28", /* GPIOA_15 */ -- /* GPIOX */ -- "PIN_16", /* GPIOX_0 */ -- "PIN_18", /* GPIOX_1 */ -- "PIN_22", /* GPIOX_2 */ -- "PIN_11", /* GPIOX_3 */ -- "PIN_13", /* GPIOX_4 */ -- "PIN_7", /* GPIOX_5 */ -- "PIN_33", /* GPIOX_6 */ -- "PIN_15", /* GPIOX_7 */ -- "PIN_19", /* GPIOX_8 */ -- "PIN_21", /* GPIOX_9 */ -- "PIN_24", /* GPIOX_10 */ -- "PIN_23", /* GPIOX_11 */ -- "PIN_8", /* GPIOX_12 */ -- "PIN_10", /* GPIOX_13 */ -- "PIN_29", /* GPIOX_14 */ -- "PIN_31", /* GPIOX_15 */ -- "PIN_12", /* GPIOX_16 */ -- "PIN_3", /* GPIOX_17 */ -- "PIN_5", /* GPIOX_18 */ -- "PIN_35"; /* GPIOX_19 */ -- - /* - * WARNING: The USB Hub on the Odroid-C4 needs a reset signal - * to be turned high in order to be detected by the USB Controller -@@ -370,120 +55,10 @@ - }; - }; - --&gpio_ao { -- gpio-line-names = -- /* GPIOAO */ -- "", "", "", "", -- "PIN_47", /* GPIOAO_4 */ -- "", "", -- "PIN_45", /* GPIOAO_7 */ -- "PIN_46", /* GPIOAO_8 */ -- "PIN_44", /* GPIOAO_9 */ -- "PIN_42", /* GPIOAO_10 */ -- "", -- /* GPIOE */ -- "", "", ""; --}; -- --&hdmi_tx { -- status = "okay"; -- pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>; -- pinctrl-names = "default"; -- hdmi-supply = <&vcc_5v>; --}; -- --&hdmi_tx_tmds_port { -- hdmi_tx_tmds_out: endpoint { -- remote-endpoint = <&hdmi_connector_in>; -- }; --}; -- - &ir { -- status = "okay"; -- pinctrl-0 = <&remote_input_ao_pins>; -- pinctrl-names = "default"; - linux,rc-map-name = "rc-odroid"; - }; - --&pwm_AO_cd { -- pinctrl-0 = <&pwm_ao_d_e_pins>; -- pinctrl-names = "default"; -- clocks = <&xtal>; -- clock-names = "clkin1"; -- status = "okay"; --}; -- --&saradc { -- status = "okay"; --}; -- --/* SD card */ --&sd_emmc_b { -- status = "okay"; -- pinctrl-0 = <&sdcard_c_pins>; -- pinctrl-1 = <&sdcard_clk_gate_c_pins>; -- pinctrl-names = "default", "clk-gate"; -- -- bus-width = <4>; -- cap-sd-highspeed; -- max-frequency = <200000000>; -- sd-uhs-sdr12; -- sd-uhs-sdr25; -- sd-uhs-sdr50; -- sd-uhs-sdr104; -- disable-wp; -- -- cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>; -- vmmc-supply = <&tflash_vdd>; -- vqmmc-supply = <&tf_io>; --}; -- --/* eMMC */ --&sd_emmc_c { -- status = "okay"; -- pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>; -- pinctrl-1 = <&emmc_clk_gate_pins>; -- pinctrl-names = "default", "clk-gate"; -- -- bus-width = <8>; -- cap-mmc-highspeed; -- mmc-ddr-1_8v; -- mmc-hs200-1_8v; -- max-frequency = <200000000>; -- disable-wp; -- -- mmc-pwrseq = <&emmc_pwrseq>; -- vmmc-supply = <&vcc_3v3>; -- vqmmc-supply = <&flash_1v8>; --}; -- --&tdmif_b { -- status = "okay"; --}; -- --&tdmout_b { -- status = "okay"; --}; -- --&tohdmitx { -- status = "okay"; --}; -- --&uart_AO { -- status = "okay"; -- pinctrl-0 = <&uart_ao_a_pins>; -- pinctrl-names = "default"; --}; -- --&usb { -- status = "okay"; -- vbus-supply = <&usb_pwr_en>; --}; -- --&usb2_phy0 { -- phy-supply = <&vcc_5v>; --}; -- - &usb2_phy1 { - /* Enable the hub which is connected to this port */ - phy-supply = <&hub_5v>; -diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi -new file mode 100644 -index 000000000000..a66d55d93183 ---- /dev/null -+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi -@@ -0,0 +1,441 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+/* -+ * Copyright (c) 2020 Dongjin Kim -+ */ -+ -+#include "meson-sm1.dtsi" -+#include -+#include -+#include -+ -+/ { -+ aliases { -+ serial0 = &uart_AO; -+ ethernet0 = ðmac; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+ -+ memory@0 { -+ device_type = "memory"; -+ reg = <0x0 0x0 0x0 0x40000000>; -+ }; -+ -+ emmc_pwrseq: emmc-pwrseq { -+ compatible = "mmc-pwrseq-emmc"; -+ reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>; -+ }; -+ -+ tflash_vdd: regulator-tflash_vdd { -+ compatible = "regulator-fixed"; -+ -+ regulator-name = "TFLASH_VDD"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ -+ gpio = <&gpio_ao GPIOAO_3 GPIO_OPEN_DRAIN>; -+ enable-active-high; -+ regulator-always-on; -+ }; -+ -+ tf_io: gpio-regulator-tf_io { -+ compatible = "regulator-gpio"; -+ -+ regulator-name = "TF_IO"; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <3300000>; -+ -+ gpios = <&gpio_ao GPIOAO_6 GPIO_ACTIVE_HIGH>; -+ gpios-states = <0>; -+ -+ states = <3300000 0>, -+ <1800000 1>; -+ }; -+ -+ flash_1v8: regulator-flash_1v8 { -+ compatible = "regulator-fixed"; -+ regulator-name = "FLASH_1V8"; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ vin-supply = <&vcc_3v3>; -+ regulator-always-on; -+ }; -+ -+ main_12v: regulator-main_12v { -+ compatible = "regulator-fixed"; -+ regulator-name = "12V"; -+ regulator-min-microvolt = <12000000>; -+ regulator-max-microvolt = <12000000>; -+ regulator-always-on; -+ }; -+ -+ vcc_5v: regulator-vcc_5v { -+ compatible = "regulator-fixed"; -+ regulator-name = "5V"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ regulator-always-on; -+ vin-supply = <&main_12v>; -+ }; -+ -+ vcc_1v8: regulator-vcc_1v8 { -+ compatible = "regulator-fixed"; -+ regulator-name = "VCC_1V8"; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ vin-supply = <&vcc_3v3>; -+ regulator-always-on; -+ }; -+ -+ vcc_3v3: regulator-vcc_3v3 { -+ compatible = "regulator-fixed"; -+ regulator-name = "VCC_3V3"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ vin-supply = <&vddao_3v3>; -+ regulator-always-on; -+ /* FIXME: actually controlled by VDDCPU_B_EN */ -+ }; -+ -+ vddcpu: regulator-vddcpu { -+ /* -+ * MP8756GD Regulator. -+ */ -+ compatible = "pwm-regulator"; -+ -+ regulator-name = "VDDCPU"; -+ regulator-min-microvolt = <721000>; -+ regulator-max-microvolt = <1022000>; -+ -+ vin-supply = <&main_12v>; -+ -+ pwms = <&pwm_AO_cd 1 1250 0>; -+ pwm-dutycycle-range = <100 0>; -+ -+ regulator-boot-on; -+ regulator-always-on; -+ }; -+ -+ usb_pwr_en: regulator-usb_pwr_en { -+ compatible = "regulator-fixed"; -+ regulator-name = "USB_PWR_EN"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ vin-supply = <&vcc_5v>; -+ -+ /* Connected to the microUSB port power enable */ -+ gpio = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>; -+ enable-active-high; -+ }; -+ -+ vddao_1v8: regulator-vddao_1v8 { -+ compatible = "regulator-fixed"; -+ regulator-name = "VDDAO_1V8"; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ vin-supply = <&vddao_3v3>; -+ regulator-always-on; -+ }; -+ -+ vddao_3v3: regulator-vddao_3v3 { -+ compatible = "regulator-fixed"; -+ regulator-name = "VDDAO_3V3"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ vin-supply = <&main_12v>; -+ regulator-always-on; -+ }; -+ -+ hdmi-connector { -+ compatible = "hdmi-connector"; -+ type = "a"; -+ -+ port { -+ hdmi_connector_in: endpoint { -+ remote-endpoint = <&hdmi_tx_tmds_out>; -+ }; -+ }; -+ }; -+ -+ sound { -+ compatible = "amlogic,axg-sound-card"; -+ audio-aux-devs = <&tdmout_b>; -+ audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1", -+ "TDMOUT_B IN 1", "FRDDR_B OUT 1", -+ "TDMOUT_B IN 2", "FRDDR_C OUT 1", -+ "TDM_B Playback", "TDMOUT_B OUT"; -+ -+ assigned-clocks = <&clkc CLKID_MPLL2>, -+ <&clkc CLKID_MPLL0>, -+ <&clkc CLKID_MPLL1>; -+ -+ assigned-clock-parents = <0>, <0>, <0>; -+ assigned-clock-rates = <294912000>, -+ <270950400>, -+ <393216000>; -+ status = "okay"; -+ -+ dai-link-0 { -+ sound-dai = <&frddr_a>; -+ }; -+ -+ dai-link-1 { -+ sound-dai = <&frddr_b>; -+ }; -+ -+ dai-link-2 { -+ sound-dai = <&frddr_c>; -+ }; -+ -+ /* 8ch hdmi interface */ -+ dai-link-3 { -+ sound-dai = <&tdmif_b>; -+ dai-format = "i2s"; -+ dai-tdm-slot-tx-mask-0 = <1 1>; -+ dai-tdm-slot-tx-mask-1 = <1 1>; -+ dai-tdm-slot-tx-mask-2 = <1 1>; -+ dai-tdm-slot-tx-mask-3 = <1 1>; -+ mclk-fs = <256>; -+ -+ codec { -+ sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>; -+ }; -+ }; -+ -+ /* hdmi glue */ -+ dai-link-4 { -+ sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>; -+ codec { -+ sound-dai = <&hdmi_tx>; -+ }; -+ }; -+ }; -+}; -+ -+&arb { -+ status = "okay"; -+}; -+ -+&clkc_audio { -+ status = "okay"; -+}; -+ -+&cpu0 { -+ cpu-supply = <&vddcpu>; -+ operating-points-v2 = <&cpu_opp_table>; -+ clocks = <&clkc CLKID_CPU_CLK>; -+ clock-latency = <50000>; -+}; -+ -+&cpu1 { -+ cpu-supply = <&vddcpu>; -+ operating-points-v2 = <&cpu_opp_table>; -+ clocks = <&clkc CLKID_CPU1_CLK>; -+ clock-latency = <50000>; -+}; -+ -+&cpu2 { -+ cpu-supply = <&vddcpu>; -+ operating-points-v2 = <&cpu_opp_table>; -+ clocks = <&clkc CLKID_CPU2_CLK>; -+ clock-latency = <50000>; -+}; -+ -+&cpu3 { -+ cpu-supply = <&vddcpu>; -+ operating-points-v2 = <&cpu_opp_table>; -+ clocks = <&clkc CLKID_CPU3_CLK>; -+ clock-latency = <50000>; -+}; -+ -+&ext_mdio { -+ external_phy: ethernet-phy@0 { -+ /* Realtek RTL8211F (0x001cc916) */ -+ reg = <0>; -+ max-speed = <1000>; -+ -+ interrupt-parent = <&gpio_intc>; -+ /* MAC_INTR on GPIOZ_14 */ -+ interrupts = <26 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+ðmac { -+ pinctrl-0 = <ð_pins>, <ð_rgmii_pins>; -+ pinctrl-names = "default"; -+ status = "okay"; -+ phy-mode = "rgmii"; -+ phy-handle = <&external_phy>; -+ amlogic,tx-delay-ns = <2>; -+}; -+ -+&frddr_a { -+ status = "okay"; -+}; -+ -+&frddr_b { -+ status = "okay"; -+}; -+ -+&frddr_c { -+ status = "okay"; -+}; -+ -+&gpio { -+ gpio-line-names = -+ /* GPIOZ */ -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ /* GPIOH */ -+ "", "", "", "", "", -+ "PIN_36", /* GPIOH_5 */ -+ "PIN_26", /* GPIOH_6 */ -+ "PIN_32", /* GPIOH_7 */ -+ "", -+ /* BOOT */ -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ /* GPIOC */ -+ "", "", "", "", "", "", "", "", -+ /* GPIOA */ -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", -+ "PIN_27", /* GPIOA_14 */ -+ "PIN_28", /* GPIOA_15 */ -+ /* GPIOX */ -+ "PIN_16", /* GPIOX_0 */ -+ "PIN_18", /* GPIOX_1 */ -+ "PIN_22", /* GPIOX_2 */ -+ "PIN_11", /* GPIOX_3 */ -+ "PIN_13", /* GPIOX_4 */ -+ "PIN_7", /* GPIOX_5 */ -+ "PIN_33", /* GPIOX_6 */ -+ "PIN_15", /* GPIOX_7 */ -+ "PIN_19", /* GPIOX_8 */ -+ "PIN_21", /* GPIOX_9 */ -+ "PIN_24", /* GPIOX_10 */ -+ "PIN_23", /* GPIOX_11 */ -+ "PIN_8", /* GPIOX_12 */ -+ "PIN_10", /* GPIOX_13 */ -+ "PIN_29", /* GPIOX_14 */ -+ "PIN_31", /* GPIOX_15 */ -+ "PIN_12", /* GPIOX_16 */ -+ "PIN_3", /* GPIOX_17 */ -+ "PIN_5", /* GPIOX_18 */ -+ "PIN_35"; /* GPIOX_19 */ -+}; -+ -+&gpio_ao { -+ gpio-line-names = -+ /* GPIOAO */ -+ "", "", "", "", -+ "PIN_47", /* GPIOAO_4 */ -+ "", "", -+ "PIN_45", /* GPIOAO_7 */ -+ "PIN_46", /* GPIOAO_8 */ -+ "PIN_44", /* GPIOAO_9 */ -+ "PIN_42", /* GPIOAO_10 */ -+ "", -+ /* GPIOE */ -+ "", "", ""; -+}; -+ -+&hdmi_tx { -+ status = "okay"; -+ pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>; -+ pinctrl-names = "default"; -+ hdmi-supply = <&vcc_5v>; -+}; -+ -+&hdmi_tx_tmds_port { -+ hdmi_tx_tmds_out: endpoint { -+ remote-endpoint = <&hdmi_connector_in>; -+ }; -+}; -+ -+&ir { -+ status = "okay"; -+ pinctrl-0 = <&remote_input_ao_pins>; -+ pinctrl-names = "default"; -+}; -+ -+&pwm_AO_cd { -+ pinctrl-0 = <&pwm_ao_d_e_pins>; -+ pinctrl-names = "default"; -+ clocks = <&xtal>; -+ clock-names = "clkin1"; -+ status = "okay"; -+}; -+ -+&saradc { -+ status = "okay"; -+}; -+ -+/* SD card */ -+&sd_emmc_b { -+ status = "okay"; -+ pinctrl-0 = <&sdcard_c_pins>; -+ pinctrl-1 = <&sdcard_clk_gate_c_pins>; -+ pinctrl-names = "default", "clk-gate"; -+ -+ bus-width = <4>; -+ cap-sd-highspeed; -+ max-frequency = <200000000>; -+ sd-uhs-sdr12; -+ sd-uhs-sdr25; -+ sd-uhs-sdr50; -+ sd-uhs-sdr104; -+ disable-wp; -+ -+ cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>; -+ vmmc-supply = <&tflash_vdd>; -+ vqmmc-supply = <&tf_io>; -+}; -+ -+/* eMMC */ -+&sd_emmc_c { -+ status = "okay"; -+ pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>; -+ pinctrl-1 = <&emmc_clk_gate_pins>; -+ pinctrl-names = "default", "clk-gate"; -+ -+ bus-width = <8>; -+ cap-mmc-highspeed; -+ mmc-ddr-1_8v; -+ mmc-hs200-1_8v; -+ max-frequency = <200000000>; -+ disable-wp; -+ -+ mmc-pwrseq = <&emmc_pwrseq>; -+ vmmc-supply = <&vcc_3v3>; -+ vqmmc-supply = <&flash_1v8>; -+}; -+ -+&tdmif_b { -+ status = "okay"; -+}; -+ -+&tdmout_b { -+ status = "okay"; -+}; -+ -+&tohdmitx { -+ status = "okay"; -+}; -+ -+&uart_AO { -+ status = "okay"; -+ pinctrl-0 = <&uart_ao_a_pins>; -+ pinctrl-names = "default"; -+}; -+ -+&usb { -+ status = "okay"; -+ vbus-supply = <&usb_pwr_en>; -+}; -+ -+&usb2_phy0 { -+ phy-supply = <&vcc_5v>; -+}; --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0016-FROMGIT-arm64-dts-meson-add-initial-device-tree-for-.patch b/projects/Amlogic/patches/linux/amlogic-0016-FROMGIT-arm64-dts-meson-add-initial-device-tree-for-.patch deleted file mode 100644 index bf11b85993..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0016-FROMGIT-arm64-dts-meson-add-initial-device-tree-for-.patch +++ /dev/null @@ -1,137 +0,0 @@ -From dfd0471eb3cb255d376c901574768213183e8765 Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Fri, 29 Jan 2021 02:12:43 +0000 -Subject: [PATCH 16/88] FROMGIT: arm64: dts: meson: add initial device-tree for - ODROID-HC4 - -ODROID-HC4 is a derivative of the C4 with minor differences: - -- 16MB SPI-NOR flash -- 2x SATA ports via ASM1061 PCIe to SATA controller -- 7-pin header with SPI and I2C for 1-inch OLED display and RTC -- 1x USB 2.0 host port - -Signed-off-by: Christian Hewitt -Reviewed-by: Neil Armstrong ---- - arch/arm64/boot/dts/amlogic/Makefile | 1 + - .../boot/dts/amlogic/meson-sm1-odroid-hc4.dts | 96 +++++++++++++++++++ - 2 files changed, 97 insertions(+) - create mode 100644 arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts - -diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile -index f3c8a85fe987..78a569d7fa20 100644 ---- a/arch/arm64/boot/dts/amlogic/Makefile -+++ b/arch/arm64/boot/dts/amlogic/Makefile -@@ -47,5 +47,6 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxm-vega-s96.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxm-wetek-core2.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-sm1-khadas-vim3l.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-sm1-odroid-c4.dtb -+dtb-$(CONFIG_ARCH_MESON) += meson-sm1-odroid-hc4.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-sm1-sei610.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-a1-ad401.dtb -diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts -new file mode 100644 -index 000000000000..bf15700c4b15 ---- /dev/null -+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts -@@ -0,0 +1,96 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+/* -+ * Copyright (c) 2020 Dongjin Kim -+ */ -+ -+/dts-v1/; -+ -+#include "meson-sm1-odroid.dtsi" -+ -+/ { -+ compatible = "hardkernel,odroid-hc4", "amlogic,sm1"; -+ model = "Hardkernel ODROID-HC4"; -+ -+ aliases { -+ rtc0 = &rtc; -+ rtc1 = &vrtc; -+ }; -+ -+ fan0: pwm-fan { -+ compatible = "pwm-fan"; -+ #cooling-cells = <2>; -+ cooling-min-state = <0>; -+ cooling-max-state = <3>; -+ cooling-levels = <0 120 170 220>; -+ pwms = <&pwm_cd 1 40000 0>; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ -+ led-blue { -+ color = ; -+ function = LED_FUNCTION_STATUS; -+ gpios = <&gpio_ao GPIOAO_11 GPIO_ACTIVE_HIGH>; -+ linux,default-trigger = "heartbeat"; -+ panic-indicator; -+ }; -+ -+ led-red { -+ color = ; -+ function = LED_FUNCTION_POWER; -+ gpios = <&gpio_ao GPIOAO_7 GPIO_ACTIVE_HIGH>; -+ default-state = "on"; -+ }; -+ }; -+ -+ sound { -+ model = "ODROID-HC4"; -+ }; -+}; -+ -+&cpu_thermal { -+ cooling-maps { -+ map { -+ trip = <&cpu_passive>; -+ cooling-device = <&fan0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; -+ }; -+ }; -+}; -+ -+&ir { -+ linux,rc-map-name = "rc-odroid"; -+}; -+ -+&i2c2 { -+ status = "okay"; -+ pinctrl-0 = <&i2c2_sda_x_pins>, <&i2c2_sck_x_pins>; -+ pinctrl-names = "default"; -+ -+ rtc: rtc@51 { -+ status = "okay"; -+ compatible = "nxp,pcf8563"; -+ reg = <0x51>; -+ wakeup-source; -+ }; -+}; -+ -+&pcie { -+ status = "okay"; -+ reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>; -+}; -+ -+&pwm_cd { -+ status = "okay"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwm_d_x6_pins>; -+}; -+ -+&sd_emmc_c { -+ status = "disabled"; -+}; -+ -+&usb { -+ phys = <&usb2_phy0>, <&usb2_phy1>; -+ phy-names = "usb2-phy0", "usb2-phy1"; -+}; --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0017-FROMGIT-arm64-dts-meson-add-initial-device-tree-for-.patch b/projects/Amlogic/patches/linux/amlogic-0017-FROMGIT-arm64-dts-meson-add-initial-device-tree-for-.patch deleted file mode 100644 index 4cfe2e7b76..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0017-FROMGIT-arm64-dts-meson-add-initial-device-tree-for-.patch +++ /dev/null @@ -1,174 +0,0 @@ -From 08dba4427036ff0544670a4a2fd0127236a8abff Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Tue, 19 Jan 2021 12:57:11 +0000 -Subject: [PATCH 17/88] FROMGIT: arm64: dts: meson: add initial device-tree for - Minix NEO U9-H - -Minix NEO U9-H is based on the Amlogic Q200 reference board with an -S912-H chip and the following specs: - -- 2GB DDR3 RAM -- 16GB eMMC -- 10/100/1000 Base-T Ethernet -- AP6356S Wireless (802.11 a/b/g/n/ac, BT 4.1) -- RTC chip -- HDMI 2.1 video -- S/PDIF optical output -- ES8323 audio codec -- Analogue headphone output -- 3x USB 2.0 ports (1x OTG) -- IR receiver -- 1x Power LED (white) -- 1x Power button (rear) -- 1x Update/Reset button (underside) -- 1x micro SD card slot - -Tested-by: Wes Bradley -Signed-off-by: Christian Hewitt ---- - arch/arm64/boot/dts/amlogic/Makefile | 1 + - .../dts/amlogic/meson-gxm-minix-neo-u9h.dts | 120 ++++++++++++++++++ - 2 files changed, 121 insertions(+) - create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxm-minix-neo-u9h.dts - -diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile -index 78a569d7fa20..aebd49c88719 100644 ---- a/arch/arm64/boot/dts/amlogic/Makefile -+++ b/arch/arm64/boot/dts/amlogic/Makefile -@@ -38,6 +38,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905w-p281.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905w-tx3-mini.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905d-libretech-pc.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxm-khadas-vim2.dtb -+dtb-$(CONFIG_ARCH_MESON) += meson-gxm-minix-neo-u9h.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxm-nexbox-a1.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxm-q200.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxm-q201.dtb -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-minix-neo-u9h.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-minix-neo-u9h.dts -new file mode 100644 -index 000000000000..a414cd39c2b1 ---- /dev/null -+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-minix-neo-u9h.dts -@@ -0,0 +1,120 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+/* -+ * Copyright (c) Christian Hewitt -+ */ -+ -+/dts-v1/; -+ -+#include "meson-gxm.dtsi" -+#include "meson-gx-p23x-q20x.dtsi" -+#include -+#include -+ -+/ { -+ compatible = "minix,neo-u9h", "amlogic,s912", "amlogic,meson-gxm"; -+ model = "Minix Neo U9-H"; -+ -+ leds { -+ compatible = "gpio-leds"; -+ -+ white { -+ color = ; -+ function = LED_FUNCTION_POWER; -+ gpios = <&gpio_ao GPIOAO_9 GPIO_ACTIVE_HIGH>; -+ default-state = "on"; -+ panic-indicator; -+ }; -+ }; -+ -+ adc-keys { -+ compatible = "adc-keys"; -+ io-channels = <&saradc 0>; -+ io-channel-names = "buttons"; -+ keyup-threshold-microvolt = <1710000>; -+ -+ button-function { -+ label = "update"; -+ linux,code = ; -+ press-threshold-microvolt = <10000>; -+ }; -+ }; -+ -+ gpio-keys-polled { -+ compatible = "gpio-keys-polled"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ poll-interval = <100>; -+ -+ button@0 { -+ label = "power"; -+ linux,code = ; -+ gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+}; -+ -+ðmac { -+ pinctrl-0 = <ð_pins>; -+ pinctrl-names = "default"; -+ phy-handle = <&external_phy>; -+ amlogic,tx-delay-ns = <2>; -+ phy-mode = "rgmii"; -+}; -+ -+&external_mdio { -+ external_phy: ethernet-phy@0 { -+ /* Realtek RTL8211F (0x001cc916) */ -+ reg = <0>; -+ max-speed = <1000>; -+ -+ reset-assert-us = <10000>; -+ reset-deassert-us = <80000>; -+ reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>; -+ -+ interrupt-parent = <&gpio_intc>; -+ /* MAC_INTR on GPIOZ_15 */ -+ interrupts = <25 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+&ir { -+ linux,rc-map-name = "rc-minix-neo"; -+}; -+ -+&i2c_B { -+ status = "okay"; -+ pinctrl-0 = <&i2c_b_pins>; -+ pinctrl-names = "default"; -+ -+ rtc: rtc@51 { -+ status = "okay"; -+ compatible = "haoyu,hym8563"; -+ reg = <0x51>; -+ #clock-cells = <0>; -+ clock-frequency = <32768>; -+ clock-output-names = "xin32k"; -+ wakeup-source; -+ }; -+}; -+ -+&sd_emmc_a { -+ brcmf: wifi@1 { -+ reg = <1>; -+ compatible = "brcm,bcm4329-fmac"; -+ }; -+}; -+ -+&uart_A { -+ status = "okay"; -+ pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>; -+ pinctrl-names = "default"; -+ uart-has-rtscts; -+ -+ bluetooth { -+ compatible = "brcm,bcm43438-bt"; -+ shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; -+ max-speed = <2000000>; -+ clocks = <&wifi32k>; -+ clock-names = "lpo"; -+ }; -+}; --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0018-FROMGIT-dt-bindings-arm-amlogic-add-support-for-the-.patch b/projects/Amlogic/patches/linux/amlogic-0018-FROMGIT-dt-bindings-arm-amlogic-add-support-for-the-.patch deleted file mode 100644 index 5f120c2b81..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0018-FROMGIT-dt-bindings-arm-amlogic-add-support-for-the-.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 5735377a099b9eb5f9f0a36ebd43f0c429b8addf Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Fri, 29 Jan 2021 04:46:21 +0000 -Subject: [PATCH 18/88] FROMGIT: dt-bindings: arm: amlogic: add support for the - Minix NEO U9-H - -The Minix NEO U9-H is a small form-factor Android STB based on the -Amlogic Q200 reference board with an S912-H chip. - -Signed-off-by: Christian Hewitt ---- - Documentation/devicetree/bindings/arm/amlogic.yaml | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/Documentation/devicetree/bindings/arm/amlogic.yaml b/Documentation/devicetree/bindings/arm/amlogic.yaml -index 3341788d1096..860a456f7858 100644 ---- a/Documentation/devicetree/bindings/arm/amlogic.yaml -+++ b/Documentation/devicetree/bindings/arm/amlogic.yaml -@@ -120,6 +120,7 @@ properties: - - khadas,vim2 - - kingnovel,r-box-pro - - libretech,aml-s912-pc -+ - minix,neo-u9h - - nexbox,a1 - - tronsmart,vega-s96 - - wetek,core2 --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0019-FROMGIT-dt-bindings-net-dwmac-meson-use-picoseconds-.patch b/projects/Amlogic/patches/linux/amlogic-0019-FROMGIT-dt-bindings-net-dwmac-meson-use-picoseconds-.patch deleted file mode 100644 index 30b6aafd2f..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0019-FROMGIT-dt-bindings-net-dwmac-meson-use-picoseconds-.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 3be6c1ed0ae21099b733ce16c709fad3061994ea Mon Sep 17 00:00:00 2001 -From: Martin Blumenstingl -Date: Sat, 14 Nov 2020 17:37:09 +0100 -Subject: [PATCH 19/88] FROMGIT: dt-bindings: net: dwmac-meson: use picoseconds - for the RGMII RX delay - -Amlogic Meson G12A, G12B and SM1 SoCs have a more advanced RGMII RX -delay register which allows picoseconds precision. Deprecate the old -"amlogic,rx-delay-ns" in favour of the generic "rx-internal-delay-ps" -property. - -For older SoCs the only known supported values were 0ns and 2ns. The new -SoCs have support for RGMII RX delays between 0ps and 3000ps in 200ps -steps. - -Don't carry over the description for the "rx-internal-delay-ps" property -and inherit that from ethernet-controller.yaml instead. - -Signed-off-by: Martin Blumenstingl ---- - .../bindings/net/amlogic,meson-dwmac.yaml | 55 +++++++++++++++++-- - 1 file changed, 49 insertions(+), 6 deletions(-) - -diff --git a/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml b/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml -index 1f133f4a2924..0467441d7037 100644 ---- a/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml -+++ b/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml -@@ -74,17 +74,60 @@ allOf: - Any configuration is ignored when the phy-mode is set to "rmii". - - amlogic,rx-delay-ns: -+ deprecated: true - enum: - - 0 - - 2 - default: 0 - description: -- The internal RGMII RX clock delay (provided by this IP block) in -- nanoseconds. When phy-mode is set to "rgmii" then the RX delay -- should be explicitly configured. When the phy-mode is set to -- either "rgmii-id" or "rgmii-rxid" the RX clock delay is already -- provided by the PHY. Any configuration is ignored when the -- phy-mode is set to "rmii". -+ The internal RGMII RX clock delay in nanoseconds. Deprecated, use -+ rx-internal-delay-ps instead. -+ -+ rx-internal-delay-ps: -+ default: 0 -+ -+ - if: -+ properties: -+ compatible: -+ contains: -+ enum: -+ - amlogic,meson8b-dwmac -+ - amlogic,meson8m2-dwmac -+ - amlogic,meson-gxbb-dwmac -+ - amlogic,meson-axg-dwmac -+ then: -+ properties: -+ rx-internal-delay-ps: -+ enum: -+ - 0 -+ - 2000 -+ -+ - if: -+ properties: -+ compatible: -+ contains: -+ enum: -+ - amlogic,meson-g12a-dwmac -+ then: -+ properties: -+ rx-internal-delay-ps: -+ enum: -+ - 0 -+ - 200 -+ - 400 -+ - 600 -+ - 800 -+ - 1000 -+ - 1200 -+ - 1400 -+ - 1600 -+ - 1800 -+ - 2000 -+ - 2200 -+ - 2400 -+ - 2600 -+ - 2800 -+ - 3000 - - properties: - compatible: --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0020-FROMGIT-dt-bindings-arm-amlogic-add-support-for-the-.patch b/projects/Amlogic/patches/linux/amlogic-0020-FROMGIT-dt-bindings-arm-amlogic-add-support-for-the-.patch deleted file mode 100644 index b6d504da0f..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0020-FROMGIT-dt-bindings-arm-amlogic-add-support-for-the-.patch +++ /dev/null @@ -1,31 +0,0 @@ -From cf2108617180aa24416089735fa49bfba7dca5c7 Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Fri, 12 Jun 2020 08:04:00 +0000 -Subject: [PATCH 20/88] FROMGIT: dt-bindings: arm: amlogic: add support for the - Beelink GS-King-X - -The Shenzen AZW (Beelink) GS-King-X is based on the Amlogic W400 reference -board with an S922X-H chip. - -Signed-off-by: Christian Hewitt -Acked-by: Rob Herring -Reviewed-by: Martin Blumenstingl ---- - Documentation/devicetree/bindings/arm/amlogic.yaml | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/Documentation/devicetree/bindings/arm/amlogic.yaml b/Documentation/devicetree/bindings/arm/amlogic.yaml -index 860a456f7858..dccfc048fb1c 100644 ---- a/Documentation/devicetree/bindings/arm/amlogic.yaml -+++ b/Documentation/devicetree/bindings/arm/amlogic.yaml -@@ -152,6 +152,7 @@ properties: - - description: Boards with the Amlogic Meson G12B S922X SoC - items: - - enum: -+ - azw,gsking-x - - azw,gtking - - azw,gtking-pro - - hardkernel,odroid-n2 --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0021-FROMGIT-dt-bindings-arm-amlogic-sort-SM1-bindings.patch b/projects/Amlogic/patches/linux/amlogic-0021-FROMGIT-dt-bindings-arm-amlogic-sort-SM1-bindings.patch deleted file mode 100644 index 7866ee6201..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0021-FROMGIT-dt-bindings-arm-amlogic-sort-SM1-bindings.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 96bb0e73cb58befe53b8b3783d258f9db38cd70e Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Tue, 19 Jan 2021 15:32:38 +0000 -Subject: [PATCH 21/88] FROMGIT: dt-bindings: arm: amlogic: sort SM1 bindings - -Sort the bindings before adding new SM1 devices. - -Signed-off-by: Christian Hewitt -Acked-by: Neil Armstrong ---- - Documentation/devicetree/bindings/arm/amlogic.yaml | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/Documentation/devicetree/bindings/arm/amlogic.yaml b/Documentation/devicetree/bindings/arm/amlogic.yaml -index dccfc048fb1c..35995a1f97db 100644 ---- a/Documentation/devicetree/bindings/arm/amlogic.yaml -+++ b/Documentation/devicetree/bindings/arm/amlogic.yaml -@@ -165,9 +165,9 @@ properties: - - description: Boards with the Amlogic Meson SM1 S905X3/D3/Y3 SoC - items: - - enum: -- - seirobotics,sei610 -- - khadas,vim3l - - hardkernel,odroid-c4 -+ - khadas,vim3l -+ - seirobotics,sei610 - - const: amlogic,sm1 - - - description: Boards with the Amlogic Meson A1 A113L SoC --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0022-FROMGIT-dt-bindings-arm-amlogic-add-ODROID-HC4-bindi.patch b/projects/Amlogic/patches/linux/amlogic-0022-FROMGIT-dt-bindings-arm-amlogic-add-ODROID-HC4-bindi.patch deleted file mode 100644 index 7a59ac0b96..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0022-FROMGIT-dt-bindings-arm-amlogic-add-ODROID-HC4-bindi.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 281f759bb1ad6bad61f045c3b2a6f6ed1db16ed1 Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Sat, 12 Dec 2020 05:44:14 +0000 -Subject: [PATCH 22/88] FROMGIT: dt-bindings: arm: amlogic: add ODROID-HC4 - bindings - -Add the board bindings for the ODROID-HC4 device. - -Signed-off-by: Christian Hewitt ---- - Documentation/devicetree/bindings/arm/amlogic.yaml | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/Documentation/devicetree/bindings/arm/amlogic.yaml b/Documentation/devicetree/bindings/arm/amlogic.yaml -index 35995a1f97db..d24334e1e166 100644 ---- a/Documentation/devicetree/bindings/arm/amlogic.yaml -+++ b/Documentation/devicetree/bindings/arm/amlogic.yaml -@@ -166,6 +166,7 @@ properties: - items: - - enum: - - hardkernel,odroid-c4 -+ - hardkernel,odroid-hc4 - - khadas,vim3l - - seirobotics,sei610 - - const: amlogic,sm1 --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0023-FROMGIT-drm-panfrost-add-governor-data-with-pre-defi.patch b/projects/Amlogic/patches/linux/amlogic-0023-FROMGIT-drm-panfrost-add-governor-data-with-pre-defi.patch deleted file mode 100644 index d5fe438b50..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0023-FROMGIT-drm-panfrost-add-governor-data-with-pre-defi.patch +++ /dev/null @@ -1,64 +0,0 @@ -From e093d955d72107cc92008e0813e5e2cc7015fd9f Mon Sep 17 00:00:00 2001 -From: Lukasz Luba -Date: Sun, 24 Jan 2021 03:57:47 +0000 -Subject: [PATCH 23/88] FROMGIT: drm/panfrost: add governor data with - pre-defined thresholds - -The simple_ondemand devfreq governor uses two thresholds to decide about -the frequency change: upthreshold, downdifferential. These two tunable -change the behavior of the governor decision, e.g. how fast to increase -the frequency or how rapidly limit the frequency. This patch adds needed -governor data with thresholds values gathered experimentally in different -workloads. - -Signed-off-by: Lukasz Luba ---- - drivers/gpu/drm/panfrost/panfrost_devfreq.c | 10 +++++++++- - drivers/gpu/drm/panfrost/panfrost_devfreq.h | 2 ++ - 2 files changed, 11 insertions(+), 1 deletion(-) - -diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c -index f44d28fad085..ffbf16506bb5 100644 ---- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c -+++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c -@@ -129,8 +129,16 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) - panfrost_devfreq_profile.initial_freq = cur_freq; - dev_pm_opp_put(opp); - -+ /* -+ * Setup default thresholds for the simple_ondemand governor. -+ * The values are chosen based on experiments. -+ */ -+ pfdevfreq->gov_data.upthreshold = 45; -+ pfdevfreq->gov_data.downdifferential = 5; -+ - devfreq = devm_devfreq_add_device(dev, &panfrost_devfreq_profile, -- DEVFREQ_GOV_SIMPLE_ONDEMAND, NULL); -+ DEVFREQ_GOV_SIMPLE_ONDEMAND, -+ &pfdevfreq->gov_data); - if (IS_ERR(devfreq)) { - DRM_DEV_ERROR(dev, "Couldn't initialize GPU devfreq\n"); - ret = PTR_ERR(devfreq); -diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.h b/drivers/gpu/drm/panfrost/panfrost_devfreq.h -index db6ea48e21f9..1e2a4de941aa 100644 ---- a/drivers/gpu/drm/panfrost/panfrost_devfreq.h -+++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.h -@@ -4,6 +4,7 @@ - #ifndef __PANFROST_DEVFREQ_H__ - #define __PANFROST_DEVFREQ_H__ - -+#include - #include - #include - -@@ -17,6 +18,7 @@ struct panfrost_devfreq { - struct devfreq *devfreq; - struct opp_table *regulators_opp_table; - struct thermal_cooling_device *cooling; -+ struct devfreq_simple_ondemand_data gov_data; - bool opp_of_table_added; - - ktime_t busy_time; --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0024-FROMGIT-media-rc-add-keymap-for-minix-neo-remote.patch b/projects/Amlogic/patches/linux/amlogic-0024-FROMGIT-media-rc-add-keymap-for-minix-neo-remote.patch deleted file mode 100644 index 2d151030c4..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0024-FROMGIT-media-rc-add-keymap-for-minix-neo-remote.patch +++ /dev/null @@ -1,117 +0,0 @@ -From 07105df02a7e21818de0ad1bbb193827e36cfa90 Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Tue, 19 Jan 2021 11:55:20 +0000 -Subject: [PATCH 24/88] FROMGIT: media: rc: add keymap for minix-neo remote - -Add a keymap and bindings for the simple IR (NEC) remote used with -Minix 'NEO' branded Android STB devices. - -Signed-off-by: Christian Hewitt ---- - .../devicetree/bindings/media/rc.yaml | 1 + - drivers/media/rc/keymaps/Makefile | 1 + - drivers/media/rc/keymaps/rc-minix-neo.c | 55 +++++++++++++++++++ - include/media/rc-map.h | 1 + - 4 files changed, 58 insertions(+) - create mode 100644 drivers/media/rc/keymaps/rc-minix-neo.c - -diff --git a/Documentation/devicetree/bindings/media/rc.yaml b/Documentation/devicetree/bindings/media/rc.yaml -index 946441b4e1a5..cbffdd6a470d 100644 ---- a/Documentation/devicetree/bindings/media/rc.yaml -+++ b/Documentation/devicetree/bindings/media/rc.yaml -@@ -93,6 +93,7 @@ properties: - - rc-medion-x10 - - rc-medion-x10-digitainer - - rc-medion-x10-or2x -+ - rc-minix-neo - - rc-msi-digivox-ii - - rc-msi-digivox-iii - - rc-msi-tvanywhere -diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile -index cc6662e1903f..79c529340853 100644 ---- a/drivers/media/rc/keymaps/Makefile -+++ b/drivers/media/rc/keymaps/Makefile -@@ -69,6 +69,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \ - rc-medion-x10.o \ - rc-medion-x10-digitainer.o \ - rc-medion-x10-or2x.o \ -+ rc-minix-neo.o \ - rc-msi-digivox-ii.o \ - rc-msi-digivox-iii.o \ - rc-msi-tvanywhere.o \ -diff --git a/drivers/media/rc/keymaps/rc-minix-neo.c b/drivers/media/rc/keymaps/rc-minix-neo.c -new file mode 100644 -index 000000000000..9165af548ff1 ---- /dev/null -+++ b/drivers/media/rc/keymaps/rc-minix-neo.c -@@ -0,0 +1,55 @@ -+// SPDX-License-Identifier: GPL-2.0+ -+// -+// Copyright (C) 2021 Christian Hewitt -+ -+#include -+#include -+ -+// -+// Keytable for the Minix NEO remote control -+// -+ -+static struct rc_map_table minix_neo[] = { -+ -+ { 0x118, KEY_POWER }, -+ -+ { 0x146, KEY_UP }, -+ { 0x116, KEY_DOWN }, -+ { 0x147, KEY_LEFT }, -+ { 0x115, KEY_RIGHT }, -+ { 0x155, KEY_ENTER }, -+ -+ { 0x110, KEY_VOLUMEDOWN }, -+ { 0x140, KEY_BACK }, -+ { 0x114, KEY_VOLUMEUP }, -+ -+ { 0x10d, KEY_HOME }, -+ { 0x104, KEY_MENU }, -+ { 0x112, KEY_CONFIG }, -+ -+}; -+ -+static struct rc_map_list minix_neo_map = { -+ .map = { -+ .scan = minix_neo, -+ .size = ARRAY_SIZE(minix_neo), -+ .rc_proto = RC_PROTO_NEC, -+ .name = RC_MAP_MINIX_NEO, -+ } -+}; -+ -+static int __init init_rc_map_minix_neo(void) -+{ -+ return rc_map_register(&minix_neo_map); -+} -+ -+static void __exit exit_rc_map_minix_neo(void) -+{ -+ rc_map_unregister(&minix_neo_map); -+} -+ -+module_init(init_rc_map_minix_neo) -+module_exit(exit_rc_map_minix_neo) -+ -+MODULE_LICENSE("GPL"); -+MODULE_AUTHOR("Christian Hewitt -Date: Sat, 14 Nov 2020 17:41:04 +0100 -Subject: [PATCH 25/88] FROMGIT: net: stmmac: dwmac-meson8b: use picoseconds - for the RGMII RX delay - -Amlogic Meson G12A, G12B and SM1 SoCs have a more advanced RGMII RX -delay register which allows picoseconds precision. Parse the new -"rx-internal-delay-ps" property or fall back to the value from the old -"amlogic,rx-delay-ns" property. - -No upstream DTB uses the old "amlogic,rx-delay-ns" property (yet). -Only include minimalistic logic to fall back to the old property, -without any special validation (for example if the old and new -property are given at the same time). - -Reviewed-by: Andrew Lunn -Reviewed-by: Florian Fainelli -Signed-off-by: Martin Blumenstingl ---- - .../ethernet/stmicro/stmmac/dwmac-meson8b.c | 21 ++++++++++++------- - 1 file changed, 13 insertions(+), 8 deletions(-) - -diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c -index 5f500141567d..d2be3a7bd8fd 100644 ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c -@@ -82,7 +82,7 @@ struct meson8b_dwmac { - phy_interface_t phy_mode; - struct clk *rgmii_tx_clk; - u32 tx_delay_ns; -- u32 rx_delay_ns; -+ u32 rx_delay_ps; - struct clk *timing_adj_clk; - }; - -@@ -276,7 +276,7 @@ static int meson8b_init_prg_eth(struct meson8b_dwmac *dwmac) - tx_dly_config = FIELD_PREP(PRG_ETH0_TXDLY_MASK, - dwmac->tx_delay_ns >> 1); - -- if (dwmac->rx_delay_ns == 2) -+ if (dwmac->rx_delay_ps == 2000) - rx_dly_config = PRG_ETH0_ADJ_ENABLE | PRG_ETH0_ADJ_SETUP; - else - rx_dly_config = 0; -@@ -406,14 +406,19 @@ static int meson8b_dwmac_probe(struct platform_device *pdev) - &dwmac->tx_delay_ns)) - dwmac->tx_delay_ns = 2; - -- /* use 0ns as fallback since this is what most boards actually use */ -- if (of_property_read_u32(pdev->dev.of_node, "amlogic,rx-delay-ns", -- &dwmac->rx_delay_ns)) -- dwmac->rx_delay_ns = 0; -+ /* RX delay defaults to 0ps since this is what many boards use */ -+ if (of_property_read_u32(pdev->dev.of_node, "rx-internal-delay-ps", -+ &dwmac->rx_delay_ps)) { -+ if (!of_property_read_u32(pdev->dev.of_node, -+ "amlogic,rx-delay-ns", -+ &dwmac->rx_delay_ps)) -+ /* convert ns to ps */ -+ dwmac->rx_delay_ps *= 1000; -+ } - -- if (dwmac->rx_delay_ns != 0 && dwmac->rx_delay_ns != 2) { -+ if (dwmac->rx_delay_ps != 0 && dwmac->rx_delay_ps != 2000) { - dev_err(&pdev->dev, -- "The only allowed RX delays values are: 0ns, 2ns"); -+ "The only allowed RX delays values are: 0ps, 2000ps"); - ret = -EINVAL; - goto err_remove_config_dt; - } --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0026-FROMGIT-net-stmmac-dwmac-meson8b-move-RGMII-delays-i.patch b/projects/Amlogic/patches/linux/amlogic-0026-FROMGIT-net-stmmac-dwmac-meson8b-move-RGMII-delays-i.patch deleted file mode 100644 index a62eb27682..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0026-FROMGIT-net-stmmac-dwmac-meson8b-move-RGMII-delays-i.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 165518937eeef628d4848881bbd4e4f94fa3f863 Mon Sep 17 00:00:00 2001 -From: Martin Blumenstingl -Date: Sat, 14 Nov 2020 18:02:03 +0100 -Subject: [PATCH 26/88] FROMGIT: net: stmmac: dwmac-meson8b: move RGMII delays - into a separate function - -Newer SoCs starting with the Amlogic Meson G12A have more a precise -RGMII RX delay configuration register. This means more complexity in the -code. Extract the existing RGMII delay configuration code into a -separate function to make it easier to read/understand even when adding -more logic in the future. - -Reviewed-by: Andrew Lunn -Reviewed-by: Florian Fainelli -Signed-off-by: Martin Blumenstingl ---- - drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c | 13 ++++++++++++- - 1 file changed, 12 insertions(+), 1 deletion(-) - -diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c -index d2be3a7bd8fd..4937432ac70d 100644 ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c -@@ -268,7 +268,7 @@ static int meson8b_devm_clk_prepare_enable(struct meson8b_dwmac *dwmac, - return 0; - } - --static int meson8b_init_prg_eth(struct meson8b_dwmac *dwmac) -+static int meson8b_init_rgmii_delays(struct meson8b_dwmac *dwmac) - { - u32 tx_dly_config, rx_dly_config, delay_config; - int ret; -@@ -323,6 +323,13 @@ static int meson8b_init_prg_eth(struct meson8b_dwmac *dwmac) - PRG_ETH0_ADJ_DELAY | PRG_ETH0_ADJ_SKEW, - delay_config); - -+ return 0; -+} -+ -+static int meson8b_init_prg_eth(struct meson8b_dwmac *dwmac) -+{ -+ int ret; -+ - if (phy_interface_mode_is_rgmii(dwmac->phy_mode)) { - /* only relevant for RMII mode -> disable in RGMII mode */ - meson8b_dwmac_mask_bits(dwmac, PRG_ETH0, -@@ -430,6 +437,10 @@ static int meson8b_dwmac_probe(struct platform_device *pdev) - goto err_remove_config_dt; - } - -+ ret = meson8b_init_rgmii_delays(dwmac); -+ if (ret) -+ goto err_remove_config_dt; -+ - ret = meson8b_init_rgmii_tx_clk(dwmac); - if (ret) - goto err_remove_config_dt; --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0027-FROMGIT-net-stmmac-dwmac-meson8b-add-support-for-the.patch b/projects/Amlogic/patches/linux/amlogic-0027-FROMGIT-net-stmmac-dwmac-meson8b-add-support-for-the.patch deleted file mode 100644 index b85f62d8f3..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0027-FROMGIT-net-stmmac-dwmac-meson8b-add-support-for-the.patch +++ /dev/null @@ -1,156 +0,0 @@ -From af5a137b69d3f9f88b89601abf8a2be3aec2c180 Mon Sep 17 00:00:00 2001 -From: Martin Blumenstingl -Date: Sat, 14 Nov 2020 19:41:11 +0100 -Subject: [PATCH 27/88] FROMGIT: net: stmmac: dwmac-meson8b: add support for - the RGMII RX delay on G12A - -Amlogic Meson G12A (and newer: G12B, SM1) SoCs have a more advanced RX -delay logic. Instead of fine-tuning the delay in the nanoseconds range -it now allows tuning in 200 picosecond steps. This support comes with -new bits in the PRG_ETH1[19:16] register. - -Add support for validating the RGMII RX delay as well as configuring the -register accordingly on these platforms. - -Reviewed-by: Andrew Lunn -Reviewed-by: Florian Fainelli -Signed-off-by: Martin Blumenstingl ---- - .../ethernet/stmicro/stmmac/dwmac-meson8b.c | 61 +++++++++++++++---- - 1 file changed, 48 insertions(+), 13 deletions(-) - -diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c -index 4937432ac70d..55152d7ba99a 100644 ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c -@@ -68,10 +68,21 @@ - */ - #define PRG_ETH0_ADJ_SKEW GENMASK(24, 20) - -+#define PRG_ETH1 0x4 -+ -+/* Defined for adding a delay to the input RX_CLK for better timing. -+ * Each step is 200ps. These bits are used with external RGMII PHYs -+ * because RGMII RX only has the small window. cfg_rxclk_dly can -+ * adjust the window between RX_CLK and RX_DATA and improve the stability -+ * of "rx data valid". -+ */ -+#define PRG_ETH1_CFG_RXCLK_DLY GENMASK(19, 16) -+ - struct meson8b_dwmac; - - struct meson8b_dwmac_data { - int (*set_phy_mode)(struct meson8b_dwmac *dwmac); -+ bool has_prg_eth1_rgmii_rx_delay; - }; - - struct meson8b_dwmac { -@@ -270,30 +281,35 @@ static int meson8b_devm_clk_prepare_enable(struct meson8b_dwmac *dwmac, - - static int meson8b_init_rgmii_delays(struct meson8b_dwmac *dwmac) - { -- u32 tx_dly_config, rx_dly_config, delay_config; -+ u32 tx_dly_config, rx_adj_config, cfg_rxclk_dly, delay_config; - int ret; - -+ rx_adj_config = 0; -+ cfg_rxclk_dly = 0; - tx_dly_config = FIELD_PREP(PRG_ETH0_TXDLY_MASK, - dwmac->tx_delay_ns >> 1); - -- if (dwmac->rx_delay_ps == 2000) -- rx_dly_config = PRG_ETH0_ADJ_ENABLE | PRG_ETH0_ADJ_SETUP; -- else -- rx_dly_config = 0; -+ if (dwmac->data->has_prg_eth1_rgmii_rx_delay) -+ cfg_rxclk_dly = FIELD_PREP(PRG_ETH1_CFG_RXCLK_DLY, -+ dwmac->rx_delay_ps / 200); -+ else if (dwmac->rx_delay_ps == 2000) -+ rx_adj_config = PRG_ETH0_ADJ_ENABLE | PRG_ETH0_ADJ_SETUP; - - switch (dwmac->phy_mode) { - case PHY_INTERFACE_MODE_RGMII: -- delay_config = tx_dly_config | rx_dly_config; -+ delay_config = tx_dly_config | rx_adj_config; - break; - case PHY_INTERFACE_MODE_RGMII_RXID: - delay_config = tx_dly_config; -+ cfg_rxclk_dly = 0; - break; - case PHY_INTERFACE_MODE_RGMII_TXID: -- delay_config = rx_dly_config; -+ delay_config = rx_adj_config; - break; - case PHY_INTERFACE_MODE_RGMII_ID: - case PHY_INTERFACE_MODE_RMII: - delay_config = 0; -+ cfg_rxclk_dly = 0; - break; - default: - dev_err(dwmac->dev, "unsupported phy-mode %s\n", -@@ -323,6 +339,9 @@ static int meson8b_init_rgmii_delays(struct meson8b_dwmac *dwmac) - PRG_ETH0_ADJ_DELAY | PRG_ETH0_ADJ_SKEW, - delay_config); - -+ meson8b_dwmac_mask_bits(dwmac, PRG_ETH1, PRG_ETH1_CFG_RXCLK_DLY, -+ cfg_rxclk_dly); -+ - return 0; - } - -@@ -423,11 +442,20 @@ static int meson8b_dwmac_probe(struct platform_device *pdev) - dwmac->rx_delay_ps *= 1000; - } - -- if (dwmac->rx_delay_ps != 0 && dwmac->rx_delay_ps != 2000) { -- dev_err(&pdev->dev, -- "The only allowed RX delays values are: 0ps, 2000ps"); -- ret = -EINVAL; -- goto err_remove_config_dt; -+ if (dwmac->data->has_prg_eth1_rgmii_rx_delay) { -+ if (dwmac->rx_delay_ps != 0 && dwmac->rx_delay_ps != 2000) { -+ dev_err(dwmac->dev, -+ "The only allowed RGMII RX delays values are: 0ps, 2000ps"); -+ ret = -EINVAL; -+ goto err_remove_config_dt; -+ } -+ } else { -+ if (dwmac->rx_delay_ps > 3000 || dwmac->rx_delay_ps % 200) { -+ dev_err(dwmac->dev, -+ "The RGMII RX delay range is 0..3000ps in 200ps steps"); -+ ret = -EINVAL; -+ goto err_remove_config_dt; -+ } - } - - dwmac->timing_adj_clk = devm_clk_get_optional(dwmac->dev, -@@ -469,10 +497,17 @@ static int meson8b_dwmac_probe(struct platform_device *pdev) - - static const struct meson8b_dwmac_data meson8b_dwmac_data = { - .set_phy_mode = meson8b_set_phy_mode, -+ .has_prg_eth1_rgmii_rx_delay = false, - }; - - static const struct meson8b_dwmac_data meson_axg_dwmac_data = { - .set_phy_mode = meson_axg_set_phy_mode, -+ .has_prg_eth1_rgmii_rx_delay = false, -+}; -+ -+static const struct meson8b_dwmac_data meson_g12a_dwmac_data = { -+ .set_phy_mode = meson_axg_set_phy_mode, -+ .has_prg_eth1_rgmii_rx_delay = true, - }; - - static const struct of_device_id meson8b_dwmac_match[] = { -@@ -494,7 +529,7 @@ static const struct of_device_id meson8b_dwmac_match[] = { - }, - { - .compatible = "amlogic,meson-g12a-dwmac", -- .data = &meson_axg_dwmac_data, -+ .data = &meson_g12a_dwmac_data, - }, - { } - }; --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0028-FROMGIT-net-stmmac-dwmac-meson8b-fix-the-RX-delay-va.patch b/projects/Amlogic/patches/linux/amlogic-0028-FROMGIT-net-stmmac-dwmac-meson8b-fix-the-RX-delay-va.patch deleted file mode 100644 index d6a0e47b3b..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0028-FROMGIT-net-stmmac-dwmac-meson8b-fix-the-RX-delay-va.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 9720f6152c85aabc9dbf9fcbce0ac4c19a6648aa Mon Sep 17 00:00:00 2001 -From: Martin Blumenstingl -Date: Wed, 20 Jan 2021 02:57:45 +0000 -Subject: [PATCH 28/88] FROMGIT: net: stmmac: dwmac-meson8b: fix the RX delay - validation - -When has_prg_eth1_rgmii_rx_delay is true then we support RX delays -between 0ps and 3000ps in 200ps steps. Swap the validation of the RX -delay based on the has_prg_eth1_rgmii_rx_delay flag so the 200ps check -is now applied correctly on G12A SoCs (instead of only allow 0ps or -2000ps on G12A, but 0..3000ps in 200ps steps on older SoCs which don't -support that). - -Fixes: de94fc104d58ea ("net: stmmac: dwmac-meson8b: add support for the RGMII RX delay on G12A") -Reported-by: Martijn van Deventer -Signed-off-by: Martin Blumenstingl ---- - drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c -index 55152d7ba99a..848e5c37746b 100644 ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c -@@ -443,16 +443,16 @@ static int meson8b_dwmac_probe(struct platform_device *pdev) - } - - if (dwmac->data->has_prg_eth1_rgmii_rx_delay) { -- if (dwmac->rx_delay_ps != 0 && dwmac->rx_delay_ps != 2000) { -+ if (dwmac->rx_delay_ps > 3000 || dwmac->rx_delay_ps % 200) { - dev_err(dwmac->dev, -- "The only allowed RGMII RX delays values are: 0ps, 2000ps"); -+ "The RGMII RX delay range is 0..3000ps in 200ps steps"); - ret = -EINVAL; - goto err_remove_config_dt; - } - } else { -- if (dwmac->rx_delay_ps > 3000 || dwmac->rx_delay_ps % 200) { -+ if (dwmac->rx_delay_ps != 0 && dwmac->rx_delay_ps != 2000) { - dev_err(dwmac->dev, -- "The RGMII RX delay range is 0..3000ps in 200ps steps"); -+ "The only allowed RGMII RX delays values are: 0ps, 2000ps"); - ret = -EINVAL; - goto err_remove_config_dt; - } --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0029-FROMLIST-v1-drm-panfrost-fix-reference-leak-in-panfr.patch b/projects/Amlogic/patches/linux/amlogic-0029-FROMLIST-v1-drm-panfrost-fix-reference-leak-in-panfr.patch deleted file mode 100644 index 46fec7c4e0..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0029-FROMLIST-v1-drm-panfrost-fix-reference-leak-in-panfr.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 569efb24817177301f4789a8b45df8d389df97a7 Mon Sep 17 00:00:00 2001 -From: Qinglang Miao -Date: Sat, 28 Nov 2020 16:10:04 +0000 -Subject: [PATCH 29/88] FROMLIST(v1): drm/panfrost: fix reference leak in - panfrost_job_hw_submit - -pm_runtime_get_sync will increment pm usage counter even it -failed. Forgetting to putting operation will result in a -reference leak here. - -A new function pm_runtime_resume_and_get is introduced in -[0] to keep usage counter balanced. So We fix the reference -leak by replacing it with new funtion. - -[0] dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter") - -Fixes: f3ba91228e8e ("drm/panfrost: Add initial panfrost driver") -Reported-by: Hulk Robot -Signed-off-by: Qinglang Miao ---- - drivers/gpu/drm/panfrost/panfrost_job.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c -index 04e6f6f9b742..d6d5c15184f9 100644 ---- a/drivers/gpu/drm/panfrost/panfrost_job.c -+++ b/drivers/gpu/drm/panfrost/panfrost_job.c -@@ -157,7 +157,7 @@ static void panfrost_job_hw_submit(struct panfrost_job *job, int js) - - panfrost_devfreq_record_busy(&pfdev->pfdevfreq); - -- ret = pm_runtime_get_sync(pfdev->dev); -+ ret = pm_runtime_resume_and_get(pfdev->dev); - if (ret < 0) - return; - --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0030-FROMLIST-v1-drm-panfrost-Use-delayed-timer-as-defaul.patch b/projects/Amlogic/patches/linux/amlogic-0030-FROMLIST-v1-drm-panfrost-Use-delayed-timer-as-defaul.patch deleted file mode 100644 index 3d29165264..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0030-FROMLIST-v1-drm-panfrost-Use-delayed-timer-as-defaul.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 5360a4ad62c054ecc8c1eb0896f85ae2e4566275 Mon Sep 17 00:00:00 2001 -From: Lukasz Luba -Date: Tue, 12 Jan 2021 02:49:18 +0000 -Subject: [PATCH 30/88] FROMLIST(v1): drm/panfrost: Use delayed timer as - default in devfreq profile - -Devfreq framework supports 2 modes for monitoring devices. -Use delayed timer as default instead of deferrable timer -in order to monitor the GPU status regardless of CPU idle. - -Signed-off-by: Lukasz Luba ---- - drivers/gpu/drm/panfrost/panfrost_devfreq.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c -index ffbf16506bb5..7c5ffc81dce1 100644 ---- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c -+++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c -@@ -76,6 +76,7 @@ static int panfrost_devfreq_get_dev_status(struct device *dev, - } - - static struct devfreq_dev_profile panfrost_devfreq_profile = { -+ .timer = DEVFREQ_TIMER_DELAYED, - .polling_ms = 50, /* ~3 frames */ - .target = panfrost_devfreq_target, - .get_dev_status = panfrost_devfreq_get_dev_status, --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0031-FROMLIST-v2-drm-panfrost-Clear-MMU-irqs-before-handl.patch b/projects/Amlogic/patches/linux/amlogic-0031-FROMLIST-v2-drm-panfrost-Clear-MMU-irqs-before-handl.patch deleted file mode 100644 index 805b171020..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0031-FROMLIST-v2-drm-panfrost-Clear-MMU-irqs-before-handl.patch +++ /dev/null @@ -1,44 +0,0 @@ -From bf7b6026eb3bf452b4fad8c77efacd323f3ddd96 Mon Sep 17 00:00:00 2001 -From: Boris Brezillon -Date: Thu, 4 Feb 2021 07:34:34 +0000 -Subject: [PATCH 31/88] FROMLIST(v2): drm/panfrost: Clear MMU irqs before - handling the fault - -When a fault is handled it will unblock the GPU which will continue -executing its shader and might fault almost immediately on a different -page. If we clear interrupts after handling the fault we might miss new -faults, so clear them before. - -Cc: -Fixes: 187d2929206e ("drm/panfrost: Add support for GPU heap allocations") -Signed-off-by: Boris Brezillon -Reviewed-by: Steven Price ---- - drivers/gpu/drm/panfrost/panfrost_mmu.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c -index 7c1b3481b785..904d63450862 100644 ---- a/drivers/gpu/drm/panfrost/panfrost_mmu.c -+++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c -@@ -593,6 +593,8 @@ static irqreturn_t panfrost_mmu_irq_handler_thread(int irq, void *data) - access_type = (fault_status >> 8) & 0x3; - source_id = (fault_status >> 16); - -+ mmu_write(pfdev, MMU_INT_CLEAR, mask); -+ - /* Page fault only */ - ret = -1; - if ((status & mask) == BIT(i) && (exception_type & 0xF8) == 0xC0) -@@ -616,8 +618,6 @@ static irqreturn_t panfrost_mmu_irq_handler_thread(int irq, void *data) - access_type, access_type_name(pfdev, fault_status), - source_id); - -- mmu_write(pfdev, MMU_INT_CLEAR, mask); -- - status &= ~mask; - } - --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0032-FROMLIST-v2-drm-panfrost-Don-t-try-to-map-pages-that.patch b/projects/Amlogic/patches/linux/amlogic-0032-FROMLIST-v2-drm-panfrost-Don-t-try-to-map-pages-that.patch deleted file mode 100644 index 6c2c69addd..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0032-FROMLIST-v2-drm-panfrost-Don-t-try-to-map-pages-that.patch +++ /dev/null @@ -1,50 +0,0 @@ -From cd56ab64a7743dc966a8c2406afedf0027784ee9 Mon Sep 17 00:00:00 2001 -From: Boris Brezillon -Date: Thu, 4 Feb 2021 07:35:52 +0000 -Subject: [PATCH 32/88] FROMLIST(v2): drm/panfrost: Don't try to map pages that - are already mapped - -We allocate 2MB chunks at a time, so it might appear that a page fault -has already been handled by a previous page fault when we reach -panfrost_mmu_map_fault_addr(). Bail out in that case to avoid mapping the -same area twice. - -Cc: -Fixes: 187d2929206e ("drm/panfrost: Add support for GPU heap allocations") -Signed-off-by: Boris Brezillon -Reviewed-by: Steven Price ---- - drivers/gpu/drm/panfrost/panfrost_mmu.c | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c -index 904d63450862..21e552d1ac71 100644 ---- a/drivers/gpu/drm/panfrost/panfrost_mmu.c -+++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c -@@ -488,8 +488,14 @@ static int panfrost_mmu_map_fault_addr(struct panfrost_device *pfdev, int as, - } - bo->base.pages = pages; - bo->base.pages_use_count = 1; -- } else -+ } else { - pages = bo->base.pages; -+ if (pages[page_offset]) { -+ /* Pages are already mapped, bail out. */ -+ mutex_unlock(&bo->base.pages_lock); -+ goto out; -+ } -+ } - - mapping = bo->base.base.filp->f_mapping; - mapping_set_unevictable(mapping); -@@ -522,6 +528,7 @@ static int panfrost_mmu_map_fault_addr(struct panfrost_device *pfdev, int as, - - dev_dbg(pfdev->dev, "mapped page fault @ AS%d %llx", as, addr); - -+out: - panfrost_gem_mapping_put(bomapping); - - return 0; --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0033-FROMLIST-v2-drm-panfrost-Stay-in-the-threaded-MMU-IR.patch b/projects/Amlogic/patches/linux/amlogic-0033-FROMLIST-v2-drm-panfrost-Stay-in-the-threaded-MMU-IR.patch deleted file mode 100644 index fdc03a75d9..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0033-FROMLIST-v2-drm-panfrost-Stay-in-the-threaded-MMU-IR.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 0cddc2b363c390a6c567b8c353bc7f9d4944dfe3 Mon Sep 17 00:00:00 2001 -From: Boris Brezillon -Date: Thu, 4 Feb 2021 07:37:53 +0000 -Subject: [PATCH 33/88] FROMLIST(v2): drm/panfrost: Stay in the threaded MMU - IRQ handler until we've handled all IRQs - -Doing a hw-irq -> threaded-irq round-trip is counter-productive, stay -in the threaded irq handler as long as we can. - -v2: -* Rework the loop to avoid a goto - -Signed-off-by: Boris Brezillon -Reviewed-by: Steven Price ---- - drivers/gpu/drm/panfrost/panfrost_mmu.c | 26 +++++++++++++------------ - 1 file changed, 14 insertions(+), 12 deletions(-) - -diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c -index 21e552d1ac71..0581186ebfb3 100644 ---- a/drivers/gpu/drm/panfrost/panfrost_mmu.c -+++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c -@@ -578,22 +578,20 @@ static irqreturn_t panfrost_mmu_irq_handler_thread(int irq, void *data) - { - struct panfrost_device *pfdev = data; - u32 status = mmu_read(pfdev, MMU_INT_RAWSTAT); -- int i, ret; -+ int ret; - -- for (i = 0; status; i++) { -- u32 mask = BIT(i) | BIT(i + 16); -+ while (status) { -+ u32 as = ffs(status | (status >> 16)) - 1; -+ u32 mask = BIT(as) | BIT(as + 16); - u64 addr; - u32 fault_status; - u32 exception_type; - u32 access_type; - u32 source_id; - -- if (!(status & mask)) -- continue; -- -- fault_status = mmu_read(pfdev, AS_FAULTSTATUS(i)); -- addr = mmu_read(pfdev, AS_FAULTADDRESS_LO(i)); -- addr |= (u64)mmu_read(pfdev, AS_FAULTADDRESS_HI(i)) << 32; -+ fault_status = mmu_read(pfdev, AS_FAULTSTATUS(as)); -+ addr = mmu_read(pfdev, AS_FAULTADDRESS_LO(as)); -+ addr |= (u64)mmu_read(pfdev, AS_FAULTADDRESS_HI(as)) << 32; - - /* decode the fault status */ - exception_type = fault_status & 0xFF; -@@ -604,8 +602,8 @@ static irqreturn_t panfrost_mmu_irq_handler_thread(int irq, void *data) - - /* Page fault only */ - ret = -1; -- if ((status & mask) == BIT(i) && (exception_type & 0xF8) == 0xC0) -- ret = panfrost_mmu_map_fault_addr(pfdev, i, addr); -+ if ((status & mask) == BIT(as) && (exception_type & 0xF8) == 0xC0) -+ ret = panfrost_mmu_map_fault_addr(pfdev, as, addr); - - if (ret) - /* terminal fault, print info about the fault */ -@@ -617,7 +615,7 @@ static irqreturn_t panfrost_mmu_irq_handler_thread(int irq, void *data) - "exception type 0x%X: %s\n" - "access type 0x%X: %s\n" - "source id 0x%X\n", -- i, addr, -+ as, addr, - "TODO", - fault_status, - (fault_status & (1 << 10) ? "DECODER FAULT" : "SLAVE FAULT"), -@@ -626,6 +624,10 @@ static irqreturn_t panfrost_mmu_irq_handler_thread(int irq, void *data) - source_id); - - status &= ~mask; -+ -+ /* If we received new MMU interrupts, process them before returning. */ -+ if (!status) -+ status = mmu_read(pfdev, MMU_INT_RAWSTAT); - } - - mmu_write(pfdev, MMU_INT_MASK, ~0); --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0034-FROMLIST-v2-drm-lima-add-governor-data-with-pre-defi.patch b/projects/Amlogic/patches/linux/amlogic-0034-FROMLIST-v2-drm-lima-add-governor-data-with-pre-defi.patch deleted file mode 100644 index d4971e41c7..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0034-FROMLIST-v2-drm-lima-add-governor-data-with-pre-defi.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 5413886e2d16195eceda3720c998422b04d8c336 Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Sun, 24 Jan 2021 11:27:35 +0000 -Subject: [PATCH 34/88] FROMLIST(v2): drm/lima: add governor data with - pre-defined thresholds - -This patch adapts the panfrost pre-defined thresholds change [0] to the -lima driver to improve real-world performance. The upthreshold value has -been set to ramp GPU frequency to max freq faster (compared to panfrost) -to compensate for the lower overall performance of utgard devices. - -[0] https://patchwork.kernel.org/project/dri-devel/patch/20210121170445.19761-1-lukasz.luba@arm.com/ - -Signed-off-by: Christian Hewitt ---- - drivers/gpu/drm/lima/lima_devfreq.c | 10 +++++++++- - drivers/gpu/drm/lima/lima_devfreq.h | 2 ++ - 2 files changed, 11 insertions(+), 1 deletion(-) - -diff --git a/drivers/gpu/drm/lima/lima_devfreq.c b/drivers/gpu/drm/lima/lima_devfreq.c -index 5686ad4aaf7c..c9854315a0b5 100644 ---- a/drivers/gpu/drm/lima/lima_devfreq.c -+++ b/drivers/gpu/drm/lima/lima_devfreq.c -@@ -163,8 +163,16 @@ int lima_devfreq_init(struct lima_device *ldev) - lima_devfreq_profile.initial_freq = cur_freq; - dev_pm_opp_put(opp); - -+ /* -+ * Setup default thresholds for the simple_ondemand governor. -+ * The values are chosen based on experiments. -+ */ -+ ldevfreq->gov_data.upthreshold = 30; -+ ldevfreq->gov_data.downdifferential = 5; -+ - devfreq = devm_devfreq_add_device(dev, &lima_devfreq_profile, -- DEVFREQ_GOV_SIMPLE_ONDEMAND, NULL); -+ DEVFREQ_GOV_SIMPLE_ONDEMAND, -+ &ldevfreq->gov_data); - if (IS_ERR(devfreq)) { - dev_err(dev, "Couldn't initialize GPU devfreq\n"); - ret = PTR_ERR(devfreq); -diff --git a/drivers/gpu/drm/lima/lima_devfreq.h b/drivers/gpu/drm/lima/lima_devfreq.h -index 2d9b3008ce77..b0c7c736e81a 100644 ---- a/drivers/gpu/drm/lima/lima_devfreq.h -+++ b/drivers/gpu/drm/lima/lima_devfreq.h -@@ -4,6 +4,7 @@ - #ifndef __LIMA_DEVFREQ_H__ - #define __LIMA_DEVFREQ_H__ - -+#include - #include - #include - -@@ -18,6 +19,7 @@ struct lima_devfreq { - struct opp_table *clkname_opp_table; - struct opp_table *regulators_opp_table; - struct thermal_cooling_device *cooling; -+ struct devfreq_simple_ondemand_data gov_data; - - ktime_t busy_time; - ktime_t idle_time; --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0035-FROMLIST-v1-drm-lima-Use-delayed-timer-as-default-in.patch b/projects/Amlogic/patches/linux/amlogic-0035-FROMLIST-v1-drm-lima-Use-delayed-timer-as-default-in.patch deleted file mode 100644 index 28de37a812..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0035-FROMLIST-v1-drm-lima-Use-delayed-timer-as-default-in.patch +++ /dev/null @@ -1,30 +0,0 @@ -From e9d96f0ba2d250037f877b02792326c44ca6cfea Mon Sep 17 00:00:00 2001 -From: Lukasz Luba -Date: Wed, 27 Jan 2021 11:36:36 +0000 -Subject: [PATCH 35/88] FROMLIST(v1): drm/lima: Use delayed timer as default in - devfreq profile - -Devfreq framework supports 2 modes for monitoring devices. -Use delayed timer as default instead of deferrable timer -in order to monitor the GPU status regardless of CPU idle. - -Signed-off-by: Lukasz Luba ---- - drivers/gpu/drm/lima/lima_devfreq.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/drivers/gpu/drm/lima/lima_devfreq.c b/drivers/gpu/drm/lima/lima_devfreq.c -index c9854315a0b5..4f64940b9055 100644 ---- a/drivers/gpu/drm/lima/lima_devfreq.c -+++ b/drivers/gpu/drm/lima/lima_devfreq.c -@@ -81,6 +81,7 @@ static int lima_devfreq_get_dev_status(struct device *dev, - } - - static struct devfreq_dev_profile lima_devfreq_profile = { -+ .timer = DEVFREQ_TIMER_DELAYED, - .polling_ms = 50, /* ~3 frames */ - .target = lima_devfreq_target, - .get_dev_status = lima_devfreq_get_dev_status, --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0036-FROMLIST-v1-phy-amlogic-phy-meson-gxl-usb2-fix-share.patch b/projects/Amlogic/patches/linux/amlogic-0036-FROMLIST-v1-phy-amlogic-phy-meson-gxl-usb2-fix-share.patch deleted file mode 100644 index 99f0497153..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0036-FROMLIST-v1-phy-amlogic-phy-meson-gxl-usb2-fix-share.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 09312f60d216525cc3f139575497e2c2775d7042 Mon Sep 17 00:00:00 2001 -From: Amjad Ouled-Ameur -Date: Fri, 13 Nov 2020 07:45:15 +0000 -Subject: [PATCH 36/88] FROMLIST(v1): phy: amlogic: phy-meson-gxl-usb2: fix - shared reset controller use - -Use reset_control_rearm() call if an error occurs in case -phy_meson_gxl_usb2_init() fails after reset() has been called ; or in case -phy_meson_gxl_usb2_exit() is called i.e the resource is no longer used -and the reset line may be triggered again by other devices. - -reset_control_rearm() keeps use of triggered_count sane in the reset -framework. Therefore, use of reset_control_reset() on shared reset line -should be balanced with reset_control_rearm(). - -Signed-off-by: Amjad Ouled-Ameur -Reported-by: Jerome Brunet ---- - drivers/phy/amlogic/phy-meson-gxl-usb2.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/drivers/phy/amlogic/phy-meson-gxl-usb2.c b/drivers/phy/amlogic/phy-meson-gxl-usb2.c -index 2b3c0d730f20..17826cd03142 100644 ---- a/drivers/phy/amlogic/phy-meson-gxl-usb2.c -+++ b/drivers/phy/amlogic/phy-meson-gxl-usb2.c -@@ -114,8 +114,10 @@ static int phy_meson_gxl_usb2_init(struct phy *phy) - return ret; - - ret = clk_prepare_enable(priv->clk); -- if (ret) -+ if (ret) { -+ reset_control_rearm(priv->reset); - return ret; -+ } - - return 0; - } -@@ -124,6 +126,7 @@ static int phy_meson_gxl_usb2_exit(struct phy *phy) - { - struct phy_meson_gxl_usb2_priv *priv = phy_get_drvdata(phy); - -+ reset_control_rearm(priv->reset); - clk_disable_unprepare(priv->clk); - - return 0; --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0037-FROMLIST-v1-usb-dwc3-meson-g12a-fix-shared-reset-con.patch b/projects/Amlogic/patches/linux/amlogic-0037-FROMLIST-v1-usb-dwc3-meson-g12a-fix-shared-reset-con.patch deleted file mode 100644 index 185b3d2815..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0037-FROMLIST-v1-usb-dwc3-meson-g12a-fix-shared-reset-con.patch +++ /dev/null @@ -1,105 +0,0 @@ -From f2c61b02ed90ebab65ffde60d7349c53e1839dac Mon Sep 17 00:00:00 2001 -From: Amjad Ouled-Ameur -Date: Fri, 13 Nov 2020 07:46:15 +0000 -Subject: [PATCH 37/88] FROMLIST(v1): usb: dwc3: meson-g12a: fix shared reset - control use - -reset_control_(de)assert() calls are called on a shared reset line when -reset_control_reset has been used. This is not allowed by the reset -framework. - -Use reset_control_rearm() call in suspend() and remove() as a way to state -that the resource is no longer used, hence the shared reset line -may be triggered again by other devices. Use reset_control_rearm() also in -case probe fails after reset() has been called. - -reset_control_rearm() keeps use of triggered_count sane in the reset -framework, use of reset_control_reset() on shared reset line should be -balanced with reset_control_rearm(). - -Signed-off-by: Amjad Ouled-Ameur -Reported-by: Jerome Brunet ---- - drivers/usb/dwc3/dwc3-meson-g12a.c | 19 +++++++++++++------ - 1 file changed, 13 insertions(+), 6 deletions(-) - -diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c -index bdf1f98dfad8..6570146cabc5 100644 ---- a/drivers/usb/dwc3/dwc3-meson-g12a.c -+++ b/drivers/usb/dwc3/dwc3-meson-g12a.c -@@ -750,7 +750,7 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev) - - ret = dwc3_meson_g12a_get_phys(priv); - if (ret) -- goto err_disable_clks; -+ goto err_rearm; - - ret = priv->drvdata->setup_regmaps(priv, base); - if (ret) -@@ -759,7 +759,7 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev) - if (priv->vbus) { - ret = regulator_enable(priv->vbus); - if (ret) -- goto err_disable_clks; -+ goto err_rearm; - } - - /* Get dr_mode */ -@@ -772,13 +772,13 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev) - - ret = priv->drvdata->usb_init(priv); - if (ret) -- goto err_disable_clks; -+ goto err_rearm; - - /* Init PHYs */ - for (i = 0 ; i < PHY_COUNT ; ++i) { - ret = phy_init(priv->phys[i]); - if (ret) -- goto err_disable_clks; -+ goto err_rearm; - } - - /* Set PHY Power */ -@@ -816,6 +816,9 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev) - for (i = 0 ; i < PHY_COUNT ; ++i) - phy_exit(priv->phys[i]); - -+err_rearm: -+ reset_control_rearm(priv->reset); -+ - err_disable_clks: - clk_bulk_disable_unprepare(priv->drvdata->num_clks, - priv->drvdata->clks); -@@ -843,6 +846,8 @@ static int dwc3_meson_g12a_remove(struct platform_device *pdev) - pm_runtime_put_noidle(dev); - pm_runtime_set_suspended(dev); - -+ reset_control_rearm(priv->reset); -+ - clk_bulk_disable_unprepare(priv->drvdata->num_clks, - priv->drvdata->clks); - -@@ -883,7 +888,7 @@ static int __maybe_unused dwc3_meson_g12a_suspend(struct device *dev) - phy_exit(priv->phys[i]); - } - -- reset_control_assert(priv->reset); -+ reset_control_rearm(priv->reset); - - return 0; - } -@@ -893,7 +898,9 @@ static int __maybe_unused dwc3_meson_g12a_resume(struct device *dev) - struct dwc3_meson_g12a *priv = dev_get_drvdata(dev); - int i, ret; - -- reset_control_deassert(priv->reset); -+ ret = reset_control_reset(priv->reset); -+ if (ret) -+ return ret; - - ret = priv->drvdata->usb_init(priv); - if (ret) --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0038-FROMLIST-v1-ASoC-meson-Use-managed-DMA-buffer-alloca.patch b/projects/Amlogic/patches/linux/amlogic-0038-FROMLIST-v1-ASoC-meson-Use-managed-DMA-buffer-alloca.patch deleted file mode 100644 index 1adbd0d0f0..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0038-FROMLIST-v1-ASoC-meson-Use-managed-DMA-buffer-alloca.patch +++ /dev/null @@ -1,97 +0,0 @@ -From ecd739d6b9c792b39f430c6972cf50cc03b4ee0e Mon Sep 17 00:00:00 2001 -From: Lars-Peter Clausen -Date: Mon, 21 Dec 2020 14:19:57 +0000 -Subject: [PATCH 38/88] FROMLIST(v1): ASoC: meson: Use managed DMA buffer - allocation - -Using a managed buffer will pre-allocate the buffer using -snd_pcm_lib_preallocate_pages() and automatically free it when the PCM is -destroyed. - -In addition it will call snd_pcm_lib_malloc_pages() before the driver's -hw_params() callback and snd_pcm_lib_free_pages() after the driver's -hw_free() callback. - -This slightly reduces the boilerplate code of the driver. - -Signed-off-by: Lars-Peter Clausen ---- - sound/soc/meson/aiu-fifo-i2s.c | 1 - - sound/soc/meson/aiu-fifo-spdif.c | 1 - - sound/soc/meson/aiu-fifo.c | 18 ++---------------- - 3 files changed, 2 insertions(+), 18 deletions(-) - -diff --git a/sound/soc/meson/aiu-fifo-i2s.c b/sound/soc/meson/aiu-fifo-i2s.c -index d91b0d874342..2388a2d0b3a6 100644 ---- a/sound/soc/meson/aiu-fifo-i2s.c -+++ b/sound/soc/meson/aiu-fifo-i2s.c -@@ -124,7 +124,6 @@ const struct snd_soc_dai_ops aiu_fifo_i2s_dai_ops = { - .trigger = aiu_fifo_i2s_trigger, - .prepare = aiu_fifo_i2s_prepare, - .hw_params = aiu_fifo_i2s_hw_params, -- .hw_free = aiu_fifo_hw_free, - .startup = aiu_fifo_startup, - .shutdown = aiu_fifo_shutdown, - }; -diff --git a/sound/soc/meson/aiu-fifo-spdif.c b/sound/soc/meson/aiu-fifo-spdif.c -index 44eb6faacf44..2fb30f89bf7a 100644 ---- a/sound/soc/meson/aiu-fifo-spdif.c -+++ b/sound/soc/meson/aiu-fifo-spdif.c -@@ -158,7 +158,6 @@ const struct snd_soc_dai_ops aiu_fifo_spdif_dai_ops = { - .trigger = fifo_spdif_trigger, - .prepare = fifo_spdif_prepare, - .hw_params = fifo_spdif_hw_params, -- .hw_free = aiu_fifo_hw_free, - .startup = aiu_fifo_startup, - .shutdown = aiu_fifo_shutdown, - }; -diff --git a/sound/soc/meson/aiu-fifo.c b/sound/soc/meson/aiu-fifo.c -index aa88aae8e517..4ad23267cace 100644 ---- a/sound/soc/meson/aiu-fifo.c -+++ b/sound/soc/meson/aiu-fifo.c -@@ -99,11 +99,6 @@ int aiu_fifo_hw_params(struct snd_pcm_substream *substream, - struct snd_soc_component *component = dai->component; - struct aiu_fifo *fifo = dai->playback_dma_data; - dma_addr_t end; -- int ret; -- -- ret = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); -- if (ret < 0) -- return ret; - - /* Setup the fifo boundaries */ - end = runtime->dma_addr + runtime->dma_bytes - fifo->fifo_block; -@@ -124,12 +119,6 @@ int aiu_fifo_hw_params(struct snd_pcm_substream *substream, - return 0; - } - --int aiu_fifo_hw_free(struct snd_pcm_substream *substream, -- struct snd_soc_dai *dai) --{ -- return snd_pcm_lib_free_pages(substream); --} -- - static irqreturn_t aiu_fifo_isr(int irq, void *dev_id) - { - struct snd_pcm_substream *playback = dev_id; -@@ -187,15 +176,12 @@ void aiu_fifo_shutdown(struct snd_pcm_substream *substream, - int aiu_fifo_pcm_new(struct snd_soc_pcm_runtime *rtd, - struct snd_soc_dai *dai) - { -- struct snd_pcm_substream *substream = -- rtd->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; - struct snd_card *card = rtd->card->snd_card; - struct aiu_fifo *fifo = dai->playback_dma_data; - size_t size = fifo->pcm->buffer_bytes_max; - -- snd_pcm_lib_preallocate_pages(substream, -- SNDRV_DMA_TYPE_DEV, -- card->dev, size, size); -+ snd_pcm_set_managed_buffer_all(rtd->pcm, SNDRV_DMA_TYPE_DEV, -+ card->dev, size, size); - - return 0; - } --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0039-FROMLIST-v1-ASoC-constify-of_phandle_args-in-snd_soc.patch b/projects/Amlogic/patches/linux/amlogic-0039-FROMLIST-v1-ASoC-constify-of_phandle_args-in-snd_soc.patch deleted file mode 100644 index 7259f6dda3..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0039-FROMLIST-v1-ASoC-constify-of_phandle_args-in-snd_soc.patch +++ /dev/null @@ -1,176 +0,0 @@ -From 68243c7496fe3dbb51702617b2fb5be39ebda48c Mon Sep 17 00:00:00 2001 -From: Krzysztof Kozlowski -Date: Sun, 21 Feb 2021 16:27:16 +0000 -Subject: [PATCH 39/88] FROMLIST(v1): ASoC: constify of_phandle_args in - snd_soc_get_dai_name() - -The pointer to of_phandle_args passed to snd_soc_get_dai_name() and -of_xlate_dai_name() implementations is not modified. Since it is being -used only to translate passed OF node to a DAI name, it should not be -modified, so mark it as const for correctness and safer code. - -Signed-off-by: Krzysztof Kozlowski ---- - include/sound/soc-component.h | 4 ++-- - include/sound/soc.h | 2 +- - sound/soc/meson/aiu-acodec-ctrl.c | 2 +- - sound/soc/meson/aiu-codec-ctrl.c | 2 +- - sound/soc/meson/aiu.c | 4 ++-- - sound/soc/meson/aiu.h | 2 +- - sound/soc/qcom/lpass-cpu.c | 2 +- - sound/soc/qcom/qdsp6/q6afe-dai.c | 2 +- - sound/soc/soc-component.c | 2 +- - sound/soc/soc-core.c | 2 +- - 10 files changed, 12 insertions(+), 12 deletions(-) - -diff --git a/include/sound/soc-component.h b/include/sound/soc-component.h -index 0bce41fefd30..00494f955134 100644 ---- a/include/sound/soc-component.h -+++ b/include/sound/soc-component.h -@@ -101,7 +101,7 @@ struct snd_soc_component_driver { - - /* DT */ - int (*of_xlate_dai_name)(struct snd_soc_component *component, -- struct of_phandle_args *args, -+ const struct of_phandle_args *args, - const char **dai_name); - int (*of_xlate_dai_id)(struct snd_soc_component *comment, - struct device_node *endpoint); -@@ -444,7 +444,7 @@ void snd_soc_component_remove(struct snd_soc_component *component); - int snd_soc_component_of_xlate_dai_id(struct snd_soc_component *component, - struct device_node *ep); - int snd_soc_component_of_xlate_dai_name(struct snd_soc_component *component, -- struct of_phandle_args *args, -+ const struct of_phandle_args *args, - const char **dai_name); - int snd_soc_component_compr_open(struct snd_compr_stream *cstream); - void snd_soc_component_compr_free(struct snd_compr_stream *cstream, -diff --git a/include/sound/soc.h b/include/sound/soc.h -index 3fa6c40a63b7..1aaf3cedefb3 100644 ---- a/include/sound/soc.h -+++ b/include/sound/soc.h -@@ -1219,7 +1219,7 @@ unsigned int snd_soc_of_parse_daifmt(struct device_node *np, - struct device_node **bitclkmaster, - struct device_node **framemaster); - int snd_soc_get_dai_id(struct device_node *ep); --int snd_soc_get_dai_name(struct of_phandle_args *args, -+int snd_soc_get_dai_name(const struct of_phandle_args *args, - const char **dai_name); - int snd_soc_of_get_dai_name(struct device_node *of_node, - const char **dai_name); -diff --git a/sound/soc/meson/aiu-acodec-ctrl.c b/sound/soc/meson/aiu-acodec-ctrl.c -index 7078197e0cc5..27a6d3259c50 100644 ---- a/sound/soc/meson/aiu-acodec-ctrl.c -+++ b/sound/soc/meson/aiu-acodec-ctrl.c -@@ -159,7 +159,7 @@ static const struct snd_kcontrol_new aiu_acodec_ctrl_controls[] = { - }; - - static int aiu_acodec_of_xlate_dai_name(struct snd_soc_component *component, -- struct of_phandle_args *args, -+ const struct of_phandle_args *args, - const char **dai_name) - { - return aiu_of_xlate_dai_name(component, args, dai_name, AIU_ACODEC); -diff --git a/sound/soc/meson/aiu-codec-ctrl.c b/sound/soc/meson/aiu-codec-ctrl.c -index 4b773d3e8b07..c3ea733fce91 100644 ---- a/sound/soc/meson/aiu-codec-ctrl.c -+++ b/sound/soc/meson/aiu-codec-ctrl.c -@@ -125,7 +125,7 @@ static const struct snd_soc_dapm_route aiu_hdmi_ctrl_routes[] = { - }; - - static int aiu_hdmi_of_xlate_dai_name(struct snd_soc_component *component, -- struct of_phandle_args *args, -+ const struct of_phandle_args *args, - const char **dai_name) - { - return aiu_of_xlate_dai_name(component, args, dai_name, AIU_HDMI); -diff --git a/sound/soc/meson/aiu.c b/sound/soc/meson/aiu.c -index dc35ca79021c..ba15d5762b0b 100644 ---- a/sound/soc/meson/aiu.c -+++ b/sound/soc/meson/aiu.c -@@ -42,7 +42,7 @@ static const struct snd_soc_dapm_route aiu_cpu_dapm_routes[] = { - }; - - int aiu_of_xlate_dai_name(struct snd_soc_component *component, -- struct of_phandle_args *args, -+ const struct of_phandle_args *args, - const char **dai_name, - unsigned int component_id) - { -@@ -72,7 +72,7 @@ int aiu_of_xlate_dai_name(struct snd_soc_component *component, - } - - static int aiu_cpu_of_xlate_dai_name(struct snd_soc_component *component, -- struct of_phandle_args *args, -+ const struct of_phandle_args *args, - const char **dai_name) - { - return aiu_of_xlate_dai_name(component, args, dai_name, AIU_CPU); -diff --git a/sound/soc/meson/aiu.h b/sound/soc/meson/aiu.h -index 87aa19ac4af3..393b6c2307e4 100644 ---- a/sound/soc/meson/aiu.h -+++ b/sound/soc/meson/aiu.h -@@ -45,7 +45,7 @@ struct aiu { - SNDRV_PCM_FMTBIT_S24_LE) - - int aiu_of_xlate_dai_name(struct snd_soc_component *component, -- struct of_phandle_args *args, -+ const struct of_phandle_args *args, - const char **dai_name, - unsigned int component_id); - -diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c -index cd4fb77e9d51..5efcbb6681e2 100644 ---- a/sound/soc/qcom/lpass-cpu.c -+++ b/sound/soc/qcom/lpass-cpu.c -@@ -340,7 +340,7 @@ int asoc_qcom_lpass_cpu_dai_probe(struct snd_soc_dai *dai) - EXPORT_SYMBOL_GPL(asoc_qcom_lpass_cpu_dai_probe); - - static int asoc_qcom_of_xlate_dai_name(struct snd_soc_component *component, -- struct of_phandle_args *args, -+ const struct of_phandle_args *args, - const char **dai_name) - { - struct lpass_data *drvdata = snd_soc_component_get_drvdata(component); -diff --git a/sound/soc/qcom/qdsp6/q6afe-dai.c b/sound/soc/qcom/qdsp6/q6afe-dai.c -index 4e1f101281e7..e8915519f427 100644 ---- a/sound/soc/qcom/qdsp6/q6afe-dai.c -+++ b/sound/soc/qcom/qdsp6/q6afe-dai.c -@@ -1315,7 +1315,7 @@ static struct snd_soc_dai_driver q6afe_dais[] = { - }; - - static int q6afe_of_xlate_dai_name(struct snd_soc_component *component, -- struct of_phandle_args *args, -+ const struct of_phandle_args *args, - const char **dai_name) - { - int id = args->args[0]; -diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c -index 760523382f3c..8b958db3a353 100644 ---- a/sound/soc/soc-component.c -+++ b/sound/soc/soc-component.c -@@ -357,7 +357,7 @@ int snd_soc_component_of_xlate_dai_id(struct snd_soc_component *component, - } - - int snd_soc_component_of_xlate_dai_name(struct snd_soc_component *component, -- struct of_phandle_args *args, -+ const struct of_phandle_args *args, - const char **dai_name) - { - if (component->driver->of_xlate_dai_name) -diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c -index f6d4e99b590c..50190654edda 100644 ---- a/sound/soc/soc-core.c -+++ b/sound/soc/soc-core.c -@@ -2994,7 +2994,7 @@ int snd_soc_get_dai_id(struct device_node *ep) - } - EXPORT_SYMBOL_GPL(snd_soc_get_dai_id); - --int snd_soc_get_dai_name(struct of_phandle_args *args, -+int snd_soc_get_dai_name(const struct of_phandle_args *args, - const char **dai_name) - { - struct snd_soc_component *pos; --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0040-FROMLIST-v1-spi-nor-add-support-for-XT25F128B.patch b/projects/Amlogic/patches/linux/amlogic-0040-FROMLIST-v1-spi-nor-add-support-for-XT25F128B.patch deleted file mode 100644 index 29986c84b8..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0040-FROMLIST-v1-spi-nor-add-support-for-XT25F128B.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 3233168b0c100fd31f2b0b94cdadf7e5d4c1bdc8 Mon Sep 17 00:00:00 2001 -From: Andreas Rammhold -Date: Thu, 28 Jan 2021 09:43:36 +0000 -Subject: [PATCH 40/88] FROMLIST(v1): spi-nor: add support for XT25F128B - -This adds support for the XT25F128B as found on the RockPi4b SBC. - -Signed-off-by: Andreas Rammhold ---- - -This continues the efforts done in [1] & [2] that went stale. I've -tested this patch on my RockPi4b which only has the xt25f128b (and not -the xt25f32b as also propsed in [2]). I have tried to obtain a copy of -the datasheets but was unable to find them. Not sure whre you would get -them. - -While [1] was already for the new spi-nor layout it was missing the bits -in the core.{c,h} files. - -[1]: https://patchwork.ozlabs.org/project/linux-mtd/patch/CAMgqO2y9MYDj6antOaWLBRKU8vGEwqCB-Y1TkXTSWsmsed+W6A@mail.gmail.com/ -[2]: https://patchwork.ozlabs.org/project/linux-mtd/patch/20200206171941.GA2398@makrotopia.org/ ---- - drivers/mtd/spi-nor/Makefile | 1 + - drivers/mtd/spi-nor/core.c | 1 + - drivers/mtd/spi-nor/core.h | 1 + - drivers/mtd/spi-nor/xtx.c | 16 ++++++++++++++++ - 4 files changed, 19 insertions(+) - create mode 100644 drivers/mtd/spi-nor/xtx.c - -diff --git a/drivers/mtd/spi-nor/Makefile b/drivers/mtd/spi-nor/Makefile -index 653923896205..3f7a52d7fa0b 100644 ---- a/drivers/mtd/spi-nor/Makefile -+++ b/drivers/mtd/spi-nor/Makefile -@@ -17,6 +17,7 @@ spi-nor-objs += sst.o - spi-nor-objs += winbond.o - spi-nor-objs += xilinx.o - spi-nor-objs += xmc.o -+spi-nor-objs += xtx.o - obj-$(CONFIG_MTD_SPI_NOR) += spi-nor.o - - obj-$(CONFIG_MTD_SPI_NOR) += controllers/ -diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c -index b17faccc95c4..427af2298e37 100644 ---- a/drivers/mtd/spi-nor/core.c -+++ b/drivers/mtd/spi-nor/core.c -@@ -2178,6 +2178,7 @@ static const struct spi_nor_manufacturer *manufacturers[] = { - &spi_nor_winbond, - &spi_nor_xilinx, - &spi_nor_xmc, -+ &spi_nor_xtx, - }; - - static const struct flash_info * -diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h -index d631ee299de3..345ec7dc3bbb 100644 ---- a/drivers/mtd/spi-nor/core.h -+++ b/drivers/mtd/spi-nor/core.h -@@ -425,6 +425,7 @@ extern const struct spi_nor_manufacturer spi_nor_sst; - extern const struct spi_nor_manufacturer spi_nor_winbond; - extern const struct spi_nor_manufacturer spi_nor_xilinx; - extern const struct spi_nor_manufacturer spi_nor_xmc; -+extern const struct spi_nor_manufacturer spi_nor_xtx; - - void spi_nor_spimem_setup_op(const struct spi_nor *nor, - struct spi_mem_op *op, -diff --git a/drivers/mtd/spi-nor/xtx.c b/drivers/mtd/spi-nor/xtx.c -new file mode 100644 -index 000000000000..a10102d8b3e2 ---- /dev/null -+++ b/drivers/mtd/spi-nor/xtx.c -@@ -0,0 +1,16 @@ -+// SPDX-License-Identifier: GPL-2.0 -+ -+#include -+ -+#include "core.h" -+ -+static const struct flash_info xtx_parts[] = { -+ /* XTX (Shenzhen Xin Tian Xia Tech) */ -+ { "xt25f128b", INFO(0x0b4018, 0, 64 * 1024, 256, SECT_4K) }, -+}; -+ -+const struct spi_nor_manufacturer spi_nor_xtx = { -+ .name = "xtx", -+ .parts = xtx_parts, -+ .nparts = ARRAY_SIZE(xtx_parts), -+}; --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0041-FROMLIST-v2-arm64-dts-amlogic-assign-a-fixed-index-t.patch b/projects/Amlogic/patches/linux/amlogic-0041-FROMLIST-v2-arm64-dts-amlogic-assign-a-fixed-index-t.patch deleted file mode 100644 index 171a9313fd..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0041-FROMLIST-v2-arm64-dts-amlogic-assign-a-fixed-index-t.patch +++ /dev/null @@ -1,63 +0,0 @@ -From ade673edcd545e29c4d262c9c2ddcc0efe17e835 Mon Sep 17 00:00:00 2001 -From: Alexander Stein -Date: Wed, 3 Feb 2021 17:03:42 +0000 -Subject: [PATCH 41/88] FROMLIST(v2): arm64: dts: amlogic: assign a fixed index - to mmc devices - -Recently introduced async probe on mmc devices can shuffle block IDs. -Pin them to fixed values to ease booting in environments where UUIDs -are not practical. Use newly introduced aliases for mmcblk devices -from [1]. - -The unconventional order (B, C, A) is due to the fact that sd_emmc_a is -(according to the comments) only used for SDIO. - -AFAICS all boards either have both sd_emmc_b and sd_emmc_c or only one -of them enabled. So the alias order should match the previous non-async -order for all of them. - -[1] https://patchwork.kernel.org/patch/11747669/ - -Signed-off-by: Alexander Stein ---- - arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 6 ++++++ - arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 6 ++++++ - 2 files changed, 12 insertions(+) - -diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi -index 3a4f20506a61..bd6e48e3c51a 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi -@@ -17,6 +17,12 @@ - #address-cells = <2>; - #size-cells = <2>; - -+ aliases { -+ mmc0 = &sd_emmc_b; -+ mmc1 = &sd_emmc_c; -+ mmc2 = &sd_emmc_a; -+ }; -+ - chosen { - #address-cells = <2>; - #size-cells = <2>; -diff --git a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi -index cf9eb7c8a6f0..14ff467c6be8 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi -@@ -20,6 +20,12 @@ - #address-cells = <2>; - #size-cells = <2>; - -+ aliases { -+ mmc0 = &sd_emmc_b; -+ mmc1 = &sd_emmc_c; -+ mmc2 = &sd_emmc_a; -+ }; -+ - reserved-memory { - #address-cells = <2>; - #size-cells = <2>; --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0042-FROMLIST-v1-dt-bindings-serial-amlogic-meson-uart-ad.patch b/projects/Amlogic/patches/linux/amlogic-0042-FROMLIST-v1-dt-bindings-serial-amlogic-meson-uart-ad.patch deleted file mode 100644 index 99f3bddceb..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0042-FROMLIST-v1-dt-bindings-serial-amlogic-meson-uart-ad.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 81d454a24a2bdd4430e1d5638e503dccf0b98e80 Mon Sep 17 00:00:00 2001 -From: Neil Armstrong -Date: Mon, 15 Mar 2021 10:54:48 +0000 -Subject: [PATCH 42/88] FROMLIST(v1): dt-bindings: serial: amlogic, meson-uart: - add amlogic, uart-fifosize property - -On most of the Amlogic SoCs, the first UART controller in the "Everything-Else" -power domain has 128bytes of RX & TX FIFO, so add an optional property to describe -a different FIFO size from the other ports (64bytes). - -Signed-off-by: Neil Armstrong ---- - .../devicetree/bindings/serial/amlogic,meson-uart.yaml | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/Documentation/devicetree/bindings/serial/amlogic,meson-uart.yaml b/Documentation/devicetree/bindings/serial/amlogic,meson-uart.yaml -index 75ebc9952a99..e0a742112783 100644 ---- a/Documentation/devicetree/bindings/serial/amlogic,meson-uart.yaml -+++ b/Documentation/devicetree/bindings/serial/amlogic,meson-uart.yaml -@@ -55,6 +55,12 @@ properties: - - const: pclk - - const: baud - -+ -+ amlogic,uart-fifosize: -+ description: The fifo size supported by the UART channel. -+ $ref: /schemas/types.yaml#/definitions/uint32 -+ enum: [64, 128] -+ - required: - - compatible - - reg --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0043-FROMLIST-v1-tty-serial-meson-retrieve-port-FIFO-size.patch b/projects/Amlogic/patches/linux/amlogic-0043-FROMLIST-v1-tty-serial-meson-retrieve-port-FIFO-size.patch deleted file mode 100644 index 2c4dda961d..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0043-FROMLIST-v1-tty-serial-meson-retrieve-port-FIFO-size.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 8cf1d1a9aa05c5bc3b85d6a87e3097c1c0400766 Mon Sep 17 00:00:00 2001 -From: Neil Armstrong -Date: Mon, 15 Mar 2021 10:55:41 +0000 -Subject: [PATCH 43/88] FROMLIST(v1): tty: serial: meson: retrieve port FIFO - size from DT - -Now the DT bindings has a property to get the FIFO size for a particular port, -retrieve it and use to setup the FIFO interrupts threshold. - -Signed-off-by: Neil Armstrong ---- - drivers/tty/serial/meson_uart.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c -index 69eeef9edfa5..7244b12aefab 100644 ---- a/drivers/tty/serial/meson_uart.c -+++ b/drivers/tty/serial/meson_uart.c -@@ -717,6 +717,7 @@ static int meson_uart_probe(struct platform_device *pdev) - { - struct resource *res_mem, *res_irq; - struct uart_port *port; -+ u32 fifosize = 64; /* Default is 64, 128 for EE UART_0 */ - int ret = 0; - int id = -1; - -@@ -743,6 +744,8 @@ static int meson_uart_probe(struct platform_device *pdev) - if (!res_irq) - return -ENODEV; - -+ of_property_read_u32(pdev->dev.of_node, "amlogic,uart-fifosize", &fifosize); -+ - if (meson_ports[pdev->id]) { - dev_err(&pdev->dev, "port %d already allocated\n", pdev->id); - return -EBUSY; -@@ -772,7 +775,7 @@ static int meson_uart_probe(struct platform_device *pdev) - port->type = PORT_MESON; - port->x_char = 0; - port->ops = &meson_uart_ops; -- port->fifosize = 64; -+ port->fifosize = fifosize; - - meson_ports[pdev->id] = port; - platform_set_drvdata(pdev, port); --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0044-FROMLIST-v1-arm64-dts-meson-set-128bytes-FIFO-size-o.patch b/projects/Amlogic/patches/linux/amlogic-0044-FROMLIST-v1-arm64-dts-meson-set-128bytes-FIFO-size-o.patch deleted file mode 100644 index 9c558ca521..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0044-FROMLIST-v1-arm64-dts-meson-set-128bytes-FIFO-size-o.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 8a409915a1e005100c11457e11a198ceb0b1e507 Mon Sep 17 00:00:00 2001 -From: Neil Armstrong -Date: Mon, 15 Mar 2021 10:56:36 +0000 -Subject: [PATCH 44/88] FROMLIST(v1): arm64: dts: meson: set 128bytes FIFO size - on uart A - -The first UART controller in "Everything-Else" power domain, usually used -for Bluetooth HCI has 128bytes FIFO depth. - -Signed-off-by: Neil Armstrong ---- - arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 1 + - arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 1 + - arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 1 + - 3 files changed, 3 insertions(+) - -diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi -index d945c84ab697..571383c12855 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi -@@ -1872,6 +1872,7 @@ - status = "disabled"; - clocks = <&xtal>, <&clkc CLKID_UART0>, <&xtal>; - clock-names = "xtal", "pclk", "baud"; -+ amlogic,uart-fifosize = <128>; - }; - }; - -diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi -index bd6e48e3c51a..48fa9961fd81 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi -@@ -2317,6 +2317,7 @@ - clocks = <&xtal>, <&clkc CLKID_UART0>, <&xtal>; - clock-names = "xtal", "pclk", "baud"; - status = "disabled"; -+ amlogic,uart-fifosize = <128>; - }; - }; - -diff --git a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi -index 14ff467c6be8..e58ebe3ba65c 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi -@@ -307,6 +307,7 @@ - reg = <0x0 0x84c0 0x0 0x18>; - interrupts = ; - status = "disabled"; -+ amlogic,uart-fifosize = <128>; - }; - - uart_B: serial@84dc { --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0045-WIP-drm-panfrost-Make-sure-MMU-context-lifetime-is-n.patch b/projects/Amlogic/patches/linux/amlogic-0045-WIP-drm-panfrost-Make-sure-MMU-context-lifetime-is-n.patch deleted file mode 100644 index 12abd5fb73..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0045-WIP-drm-panfrost-Make-sure-MMU-context-lifetime-is-n.patch +++ /dev/null @@ -1,459 +0,0 @@ -From 07907f68a180df81c9d5e7e3cd88708048a694f0 Mon Sep 17 00:00:00 2001 -From: Boris Brezillon -Date: Tue, 4 Feb 2020 15:35:03 +0100 -Subject: [PATCH 45/88] WIP: drm/panfrost: Make sure MMU context lifetime is - not bound to panfrost_priv - -Jobs can be in-flight when the file descriptor is closed (either because -the process did not terminate properly, or because it didn't wait for -all GPU jobs to be finished), and apparently panfrost_job_close() does -not cancel already running jobs. Let's refcount the MMU context object -so it's lifetime is no longer bound to the FD lifetime and running jobs -can finish properly without generating spurious page faults. - -Reported-by: Icecream95 -Fixes: 7282f7645d06 ("drm/panfrost: Implement per FD address spaces") -Cc: -Signed-off-by: Boris Brezillon ---- - drivers/gpu/drm/panfrost/panfrost_device.h | 8 +- - drivers/gpu/drm/panfrost/panfrost_drv.c | 50 ++----- - drivers/gpu/drm/panfrost/panfrost_gem.c | 20 ++- - drivers/gpu/drm/panfrost/panfrost_job.c | 4 +- - drivers/gpu/drm/panfrost/panfrost_mmu.c | 160 ++++++++++++++------- - drivers/gpu/drm/panfrost/panfrost_mmu.h | 5 +- - 6 files changed, 136 insertions(+), 111 deletions(-) - -diff --git a/drivers/gpu/drm/panfrost/panfrost_device.h b/drivers/gpu/drm/panfrost/panfrost_device.h -index 597cf1459b0a..4c6bdea5537b 100644 ---- a/drivers/gpu/drm/panfrost/panfrost_device.h -+++ b/drivers/gpu/drm/panfrost/panfrost_device.h -@@ -120,8 +120,12 @@ struct panfrost_device { - }; - - struct panfrost_mmu { -+ struct panfrost_device *pfdev; -+ struct kref refcount; - struct io_pgtable_cfg pgtbl_cfg; - struct io_pgtable_ops *pgtbl_ops; -+ struct drm_mm mm; -+ spinlock_t mm_lock; - int as; - atomic_t as_count; - struct list_head list; -@@ -132,9 +136,7 @@ struct panfrost_file_priv { - - struct drm_sched_entity sched_entity[NUM_JOB_SLOTS]; - -- struct panfrost_mmu mmu; -- struct drm_mm mm; -- spinlock_t mm_lock; -+ struct panfrost_mmu *mmu; - }; - - static inline struct panfrost_device *to_panfrost_device(struct drm_device *ddev) -diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c -index 83a461bdeea8..b2aa8e050314 100644 ---- a/drivers/gpu/drm/panfrost/panfrost_drv.c -+++ b/drivers/gpu/drm/panfrost/panfrost_drv.c -@@ -417,7 +417,7 @@ static int panfrost_ioctl_madvise(struct drm_device *dev, void *data, - * anyway, so let's not bother. - */ - if (!list_is_singular(&bo->mappings.list) || -- WARN_ON_ONCE(first->mmu != &priv->mmu)) { -+ WARN_ON_ONCE(first->mmu != priv->mmu)) { - ret = -EINVAL; - goto out_unlock_mappings; - } -@@ -449,32 +449,6 @@ int panfrost_unstable_ioctl_check(void) - return 0; - } - --#define PFN_4G (SZ_4G >> PAGE_SHIFT) --#define PFN_4G_MASK (PFN_4G - 1) --#define PFN_16M (SZ_16M >> PAGE_SHIFT) -- --static void panfrost_drm_mm_color_adjust(const struct drm_mm_node *node, -- unsigned long color, -- u64 *start, u64 *end) --{ -- /* Executable buffers can't start or end on a 4GB boundary */ -- if (!(color & PANFROST_BO_NOEXEC)) { -- u64 next_seg; -- -- if ((*start & PFN_4G_MASK) == 0) -- (*start)++; -- -- if ((*end & PFN_4G_MASK) == 0) -- (*end)--; -- -- next_seg = ALIGN(*start, PFN_4G); -- if (next_seg - *start <= PFN_16M) -- *start = next_seg + 1; -- -- *end = min(*end, ALIGN(*start, PFN_4G) - 1); -- } --} -- - static int - panfrost_open(struct drm_device *dev, struct drm_file *file) - { -@@ -489,15 +463,11 @@ panfrost_open(struct drm_device *dev, struct drm_file *file) - panfrost_priv->pfdev = pfdev; - file->driver_priv = panfrost_priv; - -- spin_lock_init(&panfrost_priv->mm_lock); -- -- /* 4G enough for now. can be 48-bit */ -- drm_mm_init(&panfrost_priv->mm, SZ_32M >> PAGE_SHIFT, (SZ_4G - SZ_32M) >> PAGE_SHIFT); -- panfrost_priv->mm.color_adjust = panfrost_drm_mm_color_adjust; -- -- ret = panfrost_mmu_pgtable_alloc(panfrost_priv); -- if (ret) -- goto err_pgtable; -+ panfrost_priv->mmu = panfrost_mmu_ctx_create(pfdev); -+ if (IS_ERR(panfrost_priv->mmu)) { -+ ret = PTR_ERR(panfrost_priv->mmu); -+ goto err_free; -+ } - - ret = panfrost_job_open(panfrost_priv); - if (ret) -@@ -506,9 +476,8 @@ panfrost_open(struct drm_device *dev, struct drm_file *file) - return 0; - - err_job: -- panfrost_mmu_pgtable_free(panfrost_priv); --err_pgtable: -- drm_mm_takedown(&panfrost_priv->mm); -+ panfrost_mmu_ctx_put(panfrost_priv->mmu); -+err_free: - kfree(panfrost_priv); - return ret; - } -@@ -521,8 +490,7 @@ panfrost_postclose(struct drm_device *dev, struct drm_file *file) - panfrost_perfcnt_close(file); - panfrost_job_close(panfrost_priv); - -- panfrost_mmu_pgtable_free(panfrost_priv); -- drm_mm_takedown(&panfrost_priv->mm); -+ panfrost_mmu_ctx_put(panfrost_priv->mmu); - kfree(panfrost_priv); - } - -diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/gpu/drm/panfrost/panfrost_gem.c -index 3e0723bc36bd..23377481f4e3 100644 ---- a/drivers/gpu/drm/panfrost/panfrost_gem.c -+++ b/drivers/gpu/drm/panfrost/panfrost_gem.c -@@ -60,7 +60,7 @@ panfrost_gem_mapping_get(struct panfrost_gem_object *bo, - - mutex_lock(&bo->mappings.lock); - list_for_each_entry(iter, &bo->mappings.list, node) { -- if (iter->mmu == &priv->mmu) { -+ if (iter->mmu == priv->mmu) { - kref_get(&iter->refcount); - mapping = iter; - break; -@@ -74,16 +74,13 @@ panfrost_gem_mapping_get(struct panfrost_gem_object *bo, - static void - panfrost_gem_teardown_mapping(struct panfrost_gem_mapping *mapping) - { -- struct panfrost_file_priv *priv; -- - if (mapping->active) - panfrost_mmu_unmap(mapping); - -- priv = container_of(mapping->mmu, struct panfrost_file_priv, mmu); -- spin_lock(&priv->mm_lock); -+ spin_lock(&mapping->mmu->mm_lock); - if (drm_mm_node_allocated(&mapping->mmnode)) - drm_mm_remove_node(&mapping->mmnode); -- spin_unlock(&priv->mm_lock); -+ spin_unlock(&mapping->mmu->mm_lock); - } - - static void panfrost_gem_mapping_release(struct kref *kref) -@@ -94,6 +91,7 @@ static void panfrost_gem_mapping_release(struct kref *kref) - - panfrost_gem_teardown_mapping(mapping); - drm_gem_object_put(&mapping->obj->base.base); -+ panfrost_mmu_ctx_put(mapping->mmu); - kfree(mapping); - } - -@@ -143,11 +141,11 @@ int panfrost_gem_open(struct drm_gem_object *obj, struct drm_file *file_priv) - else - align = size >= SZ_2M ? SZ_2M >> PAGE_SHIFT : 0; - -- mapping->mmu = &priv->mmu; -- spin_lock(&priv->mm_lock); -- ret = drm_mm_insert_node_generic(&priv->mm, &mapping->mmnode, -+ mapping->mmu = panfrost_mmu_ctx_get(priv->mmu); -+ spin_lock(&mapping->mmu->mm_lock); -+ ret = drm_mm_insert_node_generic(&mapping->mmu->mm, &mapping->mmnode, - size >> PAGE_SHIFT, align, color, 0); -- spin_unlock(&priv->mm_lock); -+ spin_unlock(&mapping->mmu->mm_lock); - if (ret) - goto err; - -@@ -176,7 +174,7 @@ void panfrost_gem_close(struct drm_gem_object *obj, struct drm_file *file_priv) - - mutex_lock(&bo->mappings.lock); - list_for_each_entry(iter, &bo->mappings.list, node) { -- if (iter->mmu == &priv->mmu) { -+ if (iter->mmu == priv->mmu) { - mapping = iter; - list_del(&iter->node); - break; -diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c -index d6d5c15184f9..b600618abb49 100644 ---- a/drivers/gpu/drm/panfrost/panfrost_job.c -+++ b/drivers/gpu/drm/panfrost/panfrost_job.c -@@ -165,7 +165,7 @@ static void panfrost_job_hw_submit(struct panfrost_job *job, int js) - return; - } - -- cfg = panfrost_mmu_as_get(pfdev, &job->file_priv->mmu); -+ cfg = panfrost_mmu_as_get(pfdev, job->file_priv->mmu); - - job_write(pfdev, JS_HEAD_NEXT_LO(js), jc_head & 0xFFFFFFFF); - job_write(pfdev, JS_HEAD_NEXT_HI(js), jc_head >> 32); -@@ -524,7 +524,7 @@ static irqreturn_t panfrost_job_irq_handler(int irq, void *data) - if (job) { - pfdev->jobs[j] = NULL; - -- panfrost_mmu_as_put(pfdev, &job->file_priv->mmu); -+ panfrost_mmu_as_put(pfdev, job->file_priv->mmu); - panfrost_devfreq_record_idle(&pfdev->pfdevfreq); - - dma_fence_signal_locked(job->done_fence); -diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c -index 0581186ebfb3..569509c2ba27 100644 ---- a/drivers/gpu/drm/panfrost/panfrost_mmu.c -+++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c -@@ -1,5 +1,8 @@ - // SPDX-License-Identifier: GPL-2.0 - /* Copyright 2019 Linaro, Ltd, Rob Herring */ -+ -+#include -+ - #include - #include - #include -@@ -337,7 +340,7 @@ static void mmu_tlb_inv_context_s1(void *cookie) - - static void mmu_tlb_sync_context(void *cookie) - { -- //struct panfrost_device *pfdev = cookie; -+ //struct panfrost_mmu *mmu = cookie; - // TODO: Wait 1000 GPU cycles for HW_ISSUE_6367/T60X - } - -@@ -352,57 +355,10 @@ static const struct iommu_flush_ops mmu_tlb_ops = { - .tlb_flush_walk = mmu_tlb_flush_walk, - }; - --int panfrost_mmu_pgtable_alloc(struct panfrost_file_priv *priv) --{ -- struct panfrost_mmu *mmu = &priv->mmu; -- struct panfrost_device *pfdev = priv->pfdev; -- -- INIT_LIST_HEAD(&mmu->list); -- mmu->as = -1; -- -- mmu->pgtbl_cfg = (struct io_pgtable_cfg) { -- .pgsize_bitmap = SZ_4K | SZ_2M, -- .ias = FIELD_GET(0xff, pfdev->features.mmu_features), -- .oas = FIELD_GET(0xff00, pfdev->features.mmu_features), -- .coherent_walk = pfdev->coherent, -- .tlb = &mmu_tlb_ops, -- .iommu_dev = pfdev->dev, -- }; -- -- mmu->pgtbl_ops = alloc_io_pgtable_ops(ARM_MALI_LPAE, &mmu->pgtbl_cfg, -- priv); -- if (!mmu->pgtbl_ops) -- return -EINVAL; -- -- return 0; --} -- --void panfrost_mmu_pgtable_free(struct panfrost_file_priv *priv) --{ -- struct panfrost_device *pfdev = priv->pfdev; -- struct panfrost_mmu *mmu = &priv->mmu; -- -- spin_lock(&pfdev->as_lock); -- if (mmu->as >= 0) { -- pm_runtime_get_noresume(pfdev->dev); -- if (pm_runtime_active(pfdev->dev)) -- panfrost_mmu_disable(pfdev, mmu->as); -- pm_runtime_put_autosuspend(pfdev->dev); -- -- clear_bit(mmu->as, &pfdev->as_alloc_mask); -- clear_bit(mmu->as, &pfdev->as_in_use_mask); -- list_del(&mmu->list); -- } -- spin_unlock(&pfdev->as_lock); -- -- free_io_pgtable_ops(mmu->pgtbl_ops); --} -- - static struct panfrost_gem_mapping * - addr_to_mapping(struct panfrost_device *pfdev, int as, u64 addr) - { - struct panfrost_gem_mapping *mapping = NULL; -- struct panfrost_file_priv *priv; - struct drm_mm_node *node; - u64 offset = addr >> PAGE_SHIFT; - struct panfrost_mmu *mmu; -@@ -415,11 +371,10 @@ addr_to_mapping(struct panfrost_device *pfdev, int as, u64 addr) - goto out; - - found_mmu: -- priv = container_of(mmu, struct panfrost_file_priv, mmu); - -- spin_lock(&priv->mm_lock); -+ spin_lock(&mmu->mm_lock); - -- drm_mm_for_each_node(node, &priv->mm) { -+ drm_mm_for_each_node(node, &mmu->mm) { - if (offset >= node->start && - offset < (node->start + node->size)) { - mapping = drm_mm_node_to_panfrost_mapping(node); -@@ -429,7 +384,7 @@ addr_to_mapping(struct panfrost_device *pfdev, int as, u64 addr) - } - } - -- spin_unlock(&priv->mm_lock); -+ spin_unlock(&mmu->mm_lock); - out: - spin_unlock(&pfdev->as_lock); - return mapping; -@@ -542,6 +497,107 @@ static int panfrost_mmu_map_fault_addr(struct panfrost_device *pfdev, int as, - return ret; - } - -+static void panfrost_mmu_release_ctx(struct kref *kref) -+{ -+ struct panfrost_mmu *mmu = container_of(kref, struct panfrost_mmu, -+ refcount); -+ struct panfrost_device *pfdev = mmu->pfdev; -+ -+ spin_lock(&pfdev->as_lock); -+ if (mmu->as >= 0) { -+ pm_runtime_get_noresume(pfdev->dev); -+ if (pm_runtime_active(pfdev->dev)) -+ panfrost_mmu_disable(pfdev, mmu->as); -+ pm_runtime_put_autosuspend(pfdev->dev); -+ -+ clear_bit(mmu->as, &pfdev->as_alloc_mask); -+ clear_bit(mmu->as, &pfdev->as_in_use_mask); -+ list_del(&mmu->list); -+ } -+ spin_unlock(&pfdev->as_lock); -+ -+ free_io_pgtable_ops(mmu->pgtbl_ops); -+ drm_mm_takedown(&mmu->mm); -+ kfree(mmu); -+} -+ -+void panfrost_mmu_ctx_put(struct panfrost_mmu *mmu) -+{ -+ kref_put(&mmu->refcount, panfrost_mmu_release_ctx); -+} -+ -+struct panfrost_mmu *panfrost_mmu_ctx_get(struct panfrost_mmu *mmu) -+{ -+ kref_get(&mmu->refcount); -+ -+ return mmu; -+} -+ -+#define PFN_4G (SZ_4G >> PAGE_SHIFT) -+#define PFN_4G_MASK (PFN_4G - 1) -+#define PFN_16M (SZ_16M >> PAGE_SHIFT) -+ -+static void panfrost_drm_mm_color_adjust(const struct drm_mm_node *node, -+ unsigned long color, -+ u64 *start, u64 *end) -+{ -+ /* Executable buffers can't start or end on a 4GB boundary */ -+ if (!(color & PANFROST_BO_NOEXEC)) { -+ u64 next_seg; -+ -+ if ((*start & PFN_4G_MASK) == 0) -+ (*start)++; -+ -+ if ((*end & PFN_4G_MASK) == 0) -+ (*end)--; -+ -+ next_seg = ALIGN(*start, PFN_4G); -+ if (next_seg - *start <= PFN_16M) -+ *start = next_seg + 1; -+ -+ *end = min(*end, ALIGN(*start, PFN_4G) - 1); -+ } -+} -+ -+struct panfrost_mmu *panfrost_mmu_ctx_create(struct panfrost_device *pfdev) -+{ -+ struct panfrost_mmu *mmu; -+ -+ mmu = kzalloc(sizeof(*mmu), GFP_KERNEL); -+ if (!mmu) -+ return ERR_PTR(-ENOMEM); -+ -+ mmu->pfdev = pfdev; -+ spin_lock_init(&mmu->mm_lock); -+ -+ /* 4G enough for now. can be 48-bit */ -+ drm_mm_init(&mmu->mm, SZ_32M >> PAGE_SHIFT, (SZ_4G - SZ_32M) >> PAGE_SHIFT); -+ mmu->mm.color_adjust = panfrost_drm_mm_color_adjust; -+ -+ INIT_LIST_HEAD(&mmu->list); -+ mmu->as = -1; -+ -+ mmu->pgtbl_cfg = (struct io_pgtable_cfg) { -+ .pgsize_bitmap = SZ_4K | SZ_2M, -+ .ias = FIELD_GET(0xff, pfdev->features.mmu_features), -+ .oas = FIELD_GET(0xff00, pfdev->features.mmu_features), -+ .coherent_walk = pfdev->coherent, -+ .tlb = &mmu_tlb_ops, -+ .iommu_dev = pfdev->dev, -+ }; -+ -+ mmu->pgtbl_ops = alloc_io_pgtable_ops(ARM_MALI_LPAE, &mmu->pgtbl_cfg, -+ mmu); -+ if (!mmu->pgtbl_ops) { -+ kfree(mmu); -+ return ERR_PTR(-EINVAL); -+ } -+ -+ kref_init(&mmu->refcount); -+ -+ return mmu; -+} -+ - static const char *access_type_name(struct panfrost_device *pfdev, - u32 fault_status) - { -diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.h b/drivers/gpu/drm/panfrost/panfrost_mmu.h -index 44fc2edf63ce..cc2a0d307feb 100644 ---- a/drivers/gpu/drm/panfrost/panfrost_mmu.h -+++ b/drivers/gpu/drm/panfrost/panfrost_mmu.h -@@ -18,7 +18,8 @@ void panfrost_mmu_reset(struct panfrost_device *pfdev); - u32 panfrost_mmu_as_get(struct panfrost_device *pfdev, struct panfrost_mmu *mmu); - void panfrost_mmu_as_put(struct panfrost_device *pfdev, struct panfrost_mmu *mmu); - --int panfrost_mmu_pgtable_alloc(struct panfrost_file_priv *priv); --void panfrost_mmu_pgtable_free(struct panfrost_file_priv *priv); -+struct panfrost_mmu *panfrost_mmu_ctx_get(struct panfrost_mmu *mmu); -+void panfrost_mmu_ctx_put(struct panfrost_mmu *mmu); -+struct panfrost_mmu *panfrost_mmu_ctx_create(struct panfrost_device *pfdev); - - #endif --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0047-WIP-arm64-dts-meson-g12b-sync-with-aml-opps.patch b/projects/Amlogic/patches/linux/amlogic-0047-WIP-arm64-dts-meson-g12b-sync-with-aml-opps.patch deleted file mode 100644 index a99a7b13d4..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0047-WIP-arm64-dts-meson-g12b-sync-with-aml-opps.patch +++ /dev/null @@ -1,138 +0,0 @@ -From 49d25d19b35687df540c6c732c03206f7c9475bc Mon Sep 17 00:00:00 2001 -From: Jerome Brunet -Date: Mon, 26 Oct 2020 10:36:48 +0100 -Subject: [PATCH 47/88] WIP: arm64: dts: meson: g12b: sync with aml opps - -Signed-off-by: Jerome Brunet ---- - .../boot/dts/amlogic/meson-g12b-a311d.dtsi | 24 +----------- - .../boot/dts/amlogic/meson-g12b-s922x.dtsi | 39 +------------------ - 2 files changed, 4 insertions(+), 59 deletions(-) - -diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-a311d.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-a311d.dtsi -index d61f43052a34..7d29756451a5 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-g12b-a311d.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-a311d.dtsi -@@ -11,16 +11,6 @@ - compatible = "operating-points-v2"; - opp-shared; - -- opp-100000000 { -- opp-hz = /bits/ 64 <100000000>; -- opp-microvolt = <731000>; -- }; -- -- opp-250000000 { -- opp-hz = /bits/ 64 <250000000>; -- opp-microvolt = <731000>; -- }; -- - opp-500000000 { - opp-hz = /bits/ 64 <500000000>; - opp-microvolt = <731000>; -@@ -58,12 +48,12 @@ - - opp-1704000000 { - opp-hz = /bits/ 64 <1704000000>; -- opp-microvolt = <951000>; -+ opp-microvolt = <960000>; - }; - - opp-1800000000 { - opp-hz = /bits/ 64 <1800000000>; -- opp-microvolt = <1001000>; -+ opp-microvolt = <1030000>; - }; - }; - -@@ -71,16 +61,6 @@ - compatible = "operating-points-v2"; - opp-shared; - -- opp-100000000 { -- opp-hz = /bits/ 64 <100000000>; -- opp-microvolt = <731000>; -- }; -- -- opp-250000000 { -- opp-hz = /bits/ 64 <250000000>; -- opp-microvolt = <731000>; -- }; -- - opp-500000000 { - opp-hz = /bits/ 64 <500000000>; - opp-microvolt = <731000>; -diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-s922x.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-s922x.dtsi -index 1e5d0ee5d541..ad4096be8db2 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-g12b-s922x.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-s922x.dtsi -@@ -11,16 +11,6 @@ - compatible = "operating-points-v2"; - opp-shared; - -- opp-100000000 { -- opp-hz = /bits/ 64 <100000000>; -- opp-microvolt = <731000>; -- }; -- -- opp-250000000 { -- opp-hz = /bits/ 64 <250000000>; -- opp-microvolt = <731000>; -- }; -- - opp-500000000 { - opp-hz = /bits/ 64 <500000000>; - opp-microvolt = <731000>; -@@ -61,31 +51,16 @@ - opp-microvolt = <861000>; - }; - -- opp-1896000000 { -- opp-hz = /bits/ 64 <1896000000>; -+ opp-1800000000 { -+ opp-hz = /bits/ 64 <1800000000>; - opp-microvolt = <981000>; - }; -- -- opp-1992000000 { -- opp-hz = /bits/ 64 <1992000000>; -- opp-microvolt = <1001000>; -- }; - }; - - cpub_opp_table_1: opp-table-1 { - compatible = "operating-points-v2"; - opp-shared; - -- opp-100000000 { -- opp-hz = /bits/ 64 <100000000>; -- opp-microvolt = <751000>; -- }; -- -- opp-250000000 { -- opp-hz = /bits/ 64 <250000000>; -- opp-microvolt = <751000>; -- }; -- - opp-500000000 { - opp-hz = /bits/ 64 <500000000>; - opp-microvolt = <751000>; -@@ -125,15 +100,5 @@ - opp-hz = /bits/ 64 <1704000000>; - opp-microvolt = <891000>; - }; -- -- opp-1800000000 { -- opp-hz = /bits/ 64 <1800000000>; -- opp-microvolt = <981000>; -- }; -- -- opp-1908000000 { -- opp-hz = /bits/ 64 <1908000000>; -- opp-microvolt = <1022000>; -- }; - }; - }; --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0052-WIP-arm64-dts-meson-add-spifc-node-to-ODROID-HC4.patch b/projects/Amlogic/patches/linux/amlogic-0052-WIP-arm64-dts-meson-add-spifc-node-to-ODROID-HC4.patch deleted file mode 100644 index 454d0cab47..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0052-WIP-arm64-dts-meson-add-spifc-node-to-ODROID-HC4.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 5dc36db40e38ffb7eaae693f7a17dcb3c2980263 Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Thu, 28 Jan 2021 17:15:22 +0000 -Subject: [PATCH 52/88] WIP: arm64: dts: meson: add spifc node to ODROID-HC4 - -Add a node for the XT25F128B SPI-NOR flash to make it accessible -from Linux. - -Signed-off-by: Christian Hewitt ---- - .../boot/dts/amlogic/meson-sm1-odroid-hc4.dts | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - -diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts -index bf15700c4b15..5268d064ba1b 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts -@@ -90,6 +90,20 @@ - status = "disabled"; - }; - -+&spifc { -+ status = "okay"; -+ pinctrl-0 = <&nor_pins>; -+ pinctrl-names = "default"; -+ -+ xt25f128b: spi-flash@0 { -+ #address-cells = <1>; -+ #size-cells = <1>; -+ compatible = "jedec,spi-nor"; -+ reg = <0>; -+ spi-max-frequency = <104000000>; -+ }; -+}; -+ - &usb { - phys = <&usb2_phy0>, <&usb2_phy1>; - phy-names = "usb2-phy0", "usb2-phy1"; --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0053-WIP-arm64-dts-meson-add-audio-playback-to-nexbox-a1.patch b/projects/Amlogic/patches/linux/amlogic-0053-WIP-arm64-dts-meson-add-audio-playback-to-nexbox-a1.patch deleted file mode 100644 index 45157bdca9..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0053-WIP-arm64-dts-meson-add-audio-playback-to-nexbox-a1.patch +++ /dev/null @@ -1,125 +0,0 @@ -From 2601a4d008a0e65f05b5750efc6014032da05864 Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Fri, 15 May 2020 07:23:05 +0000 -Subject: [PATCH 53/88] WIP: arm64: dts: meson: add audio playback to nexbox-a1 - -Add initial support is limited to HDMI i2s and SPDIF (LPCM). - -Signed-off-by: Christian Hewitt ---- - .../boot/dts/amlogic/meson-gxm-nexbox-a1.dts | 80 +++++++++++++++++++ - 1 file changed, 80 insertions(+) - -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts -index dfa7a37a1281..a8c9ffbd97a4 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts -@@ -10,6 +10,7 @@ - /dts-v1/; - - #include "meson-gxm.dtsi" -+#include - - / { - compatible = "nexbox,a1", "amlogic,s912", "amlogic,meson-gxm"; -@@ -24,11 +25,37 @@ - stdout-path = "serial0:115200n8"; - }; - -+ spdif_dit: audio-codec-0 { -+ #sound-dai-cells = <0>; -+ compatible = "linux,spdif-dit"; -+ status = "okay"; -+ sound-name-prefix = "DIT"; -+ }; -+ - memory@0 { - device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; - }; - -+ vddio_ao18: regulator-vddio_ao18 { -+ compatible = "regulator-fixed"; -+ regulator-name = "VDDIO_AO18"; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ }; -+ -+ hdmi_5v: regulator-hdmi-5v { -+ compatible = "regulator-fixed"; -+ -+ regulator-name = "HDMI_5V"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ -+ gpio = <&gpio GPIOH_3 GPIO_ACTIVE_HIGH>; -+ enable-active-high; -+ regulator-always-on; -+ }; -+ - vddio_boot: regulator-vddio-boot { - compatible = "regulator-fixed"; - regulator-name = "VDDIO_BOOT"; -@@ -75,6 +102,59 @@ - }; - }; - }; -+ -+ sound { -+ compatible = "amlogic,gx-sound-card"; -+ model = "NEXBOX-A1"; -+ assigned-clocks = <&clkc CLKID_MPLL0>, -+ <&clkc CLKID_MPLL1>, -+ <&clkc CLKID_MPLL2>; -+ assigned-clock-parents = <0>, <0>, <0>; -+ assigned-clock-rates = <294912000>, -+ <270950400>, -+ <393216000>; -+ status = "okay"; -+ -+ dai-link-0 { -+ sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>; -+ }; -+ -+ dai-link-1 { -+ sound-dai = <&aiu AIU_CPU CPU_SPDIF_FIFO>; -+ }; -+ -+ dai-link-2 { -+ sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>; -+ dai-format = "i2s"; -+ mclk-fs = <256>; -+ -+ codec-0 { -+ sound-dai = <&aiu AIU_HDMI CTRL_I2S>; -+ }; -+ }; -+ -+ dai-link-3 { -+ sound-dai = <&aiu AIU_CPU CPU_SPDIF_ENCODER>; -+ -+ codec-0 { -+ sound-dai = <&spdif_dit>; -+ }; -+ }; -+ -+ dai-link-4 { -+ sound-dai = <&aiu AIU_HDMI CTRL_OUT>; -+ -+ codec-0 { -+ sound-dai = <&hdmi_tx>; -+ }; -+ }; -+ }; -+}; -+ -+&aiu { -+ status = "okay"; -+ pinctrl-0 = <&spdif_out_h_pins>; -+ pinctrl-names = "default"; - }; - - &cec_AO { --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0059-WIP-arm64-dts-meson-add-audio-playback-to-vega-s95-d.patch b/projects/Amlogic/patches/linux/amlogic-0059-WIP-arm64-dts-meson-add-audio-playback-to-vega-s95-d.patch deleted file mode 100644 index 57762c7d5a..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0059-WIP-arm64-dts-meson-add-audio-playback-to-vega-s95-d.patch +++ /dev/null @@ -1,103 +0,0 @@ -From edb660df5a1b9dc560e98a2c877053698d375a80 Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Sat, 16 May 2020 07:04:58 +0000 -Subject: [PATCH 59/88] WIP: arm64: dts: meson: add audio playback to vega-s95 - dtsi - -Add initial support limited to HDMI i2s and SPDIF (LPCM). - -Tested-by: Oleg Ivanov <150balbes@yandex.ru> -Signed-off-by: Christian Hewitt ---- - .../boot/dts/amlogic/meson-gxbb-vega-s95.dtsi | 61 +++++++++++++++++++ - 1 file changed, 61 insertions(+) - -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi -index 9b0b81f191f1..66daf3af34c3 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi -@@ -4,6 +4,7 @@ - */ - - #include "meson-gxbb.dtsi" -+#include - - / { - compatible = "tronsmart,vega-s95", "amlogic,meson-gxbb"; -@@ -17,6 +18,13 @@ - stdout-path = "serial0:115200n8"; - }; - -+ spdif_dit: audio-codec-0 { -+ #sound-dai-cells = <0>; -+ compatible = "linux,spdif-dit"; -+ status = "okay"; -+ sound-name-prefix = "DIT"; -+ }; -+ - leds { - compatible = "gpio-leds"; - -@@ -97,6 +105,59 @@ - clocks = <&wifi32k>; - clock-names = "ext_clock"; - }; -+ -+ sound { -+ compatible = "amlogic,gx-sound-card"; -+ model = "VEGA-S95"; -+ assigned-clocks = <&clkc CLKID_MPLL0>, -+ <&clkc CLKID_MPLL1>, -+ <&clkc CLKID_MPLL2>; -+ assigned-clock-parents = <0>, <0>, <0>; -+ assigned-clock-rates = <294912000>, -+ <270950400>, -+ <393216000>; -+ status = "okay"; -+ -+ dai-link-0 { -+ sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>; -+ }; -+ -+ dai-link-1 { -+ sound-dai = <&aiu AIU_CPU CPU_SPDIF_FIFO>; -+ }; -+ -+ dai-link-2 { -+ sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>; -+ dai-format = "i2s"; -+ mclk-fs = <256>; -+ -+ codec-0 { -+ sound-dai = <&aiu AIU_HDMI CTRL_I2S>; -+ }; -+ }; -+ -+ dai-link-3 { -+ sound-dai = <&aiu AIU_CPU CPU_SPDIF_ENCODER>; -+ -+ codec-0 { -+ sound-dai = <&spdif_dit>; -+ }; -+ }; -+ -+ dai-link-4 { -+ sound-dai = <&aiu AIU_HDMI CTRL_OUT>; -+ -+ codec-0 { -+ sound-dai = <&hdmi_tx>; -+ }; -+ }; -+ }; -+}; -+ -+&aiu { -+ status = "okay"; -+ pinctrl-0 = <&spdif_out_y_pins>; -+ pinctrl-names = "default"; - }; - - &cec_AO { --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0060-WIP-clk-meson-g12a-fix-gp0-and-hifi-ranges.patch b/projects/Amlogic/patches/linux/amlogic-0060-WIP-clk-meson-g12a-fix-gp0-and-hifi-ranges.patch deleted file mode 100644 index a98dbd79df..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0060-WIP-clk-meson-g12a-fix-gp0-and-hifi-ranges.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 70abd18511ab50fc7c77b5a724dedbc10106320f Mon Sep 17 00:00:00 2001 -From: Jerome Brunet -Date: Fri, 15 Feb 2019 14:21:27 +0100 -Subject: [PATCH 60/88] WIP: clk: meson: g12a: fix gp0 and hifi ranges - -While some SoC samples are able to lock with a PLL factor of 55, others -samples can't. ATM, a minimum of 60 appears to work on all the samples -I have tried. - -Even with 60, it sometimes takes a long time for the PLL to eventually -lock. The documentation says that the minimum rate of these PLLs DCO -should be 3GHz, a factor of 125. Let's use that to be on the safe side. - -With factor range changed, the PLL seems to lock quickly (enough) so far. -It is still unclear if the range was the only reason for the delay. - -Fixes: 085a4ea93d54 ("clk: meson: g12a: add peripheral clock controller") -Signed-off-by: Jerome Brunet ---- - drivers/clk/meson/g12a.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/clk/meson/g12a.c b/drivers/clk/meson/g12a.c -index b080359b4645..a805bac93c11 100644 ---- a/drivers/clk/meson/g12a.c -+++ b/drivers/clk/meson/g12a.c -@@ -1603,7 +1603,7 @@ static struct clk_regmap g12b_cpub_clk_trace = { - }; - - static const struct pll_mult_range g12a_gp0_pll_mult_range = { -- .min = 55, -+ .min = 125, - .max = 255, - }; - --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0061-WIP-clk-meson-g12a-fix-hifi-pll-lock.patch b/projects/Amlogic/patches/linux/amlogic-0061-WIP-clk-meson-g12a-fix-hifi-pll-lock.patch deleted file mode 100644 index cb837e2ef0..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0061-WIP-clk-meson-g12a-fix-hifi-pll-lock.patch +++ /dev/null @@ -1,33 +0,0 @@ -From c4b9d6d8feaf91a9b83285052ac7b4f45580ddb0 Mon Sep 17 00:00:00 2001 -From: Jerome Brunet -Date: Tue, 14 Apr 2020 10:45:08 +0200 -Subject: [PATCH 61/88] WIP: clk: meson: g12a: fix hifi pll lock - -The HIFI pll of the g12a sometimes takes a long time to report the lock in -HIFI_PLL_CNTL0 bit 31. The would eventually be reported but the delay may -be so long that the driver consider it a lock failure. - -Bit 30 seems to do the same job but more quickly, let's try this instead. - -Fixes: 085a4ea93d54 ("clk: meson: g12a: add peripheral clock controller") -Signed-off-by: Jerome Brunet ---- - drivers/clk/meson/g12a.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/clk/meson/g12a.c b/drivers/clk/meson/g12a.c -index a805bac93c11..c22611d3669a 100644 ---- a/drivers/clk/meson/g12a.c -+++ b/drivers/clk/meson/g12a.c -@@ -1783,7 +1783,7 @@ static struct clk_regmap g12a_hifi_pll_dco = { - }, - .l = { - .reg_off = HHI_HIFI_PLL_CNTL0, -- .shift = 31, -+ .shift = 30, - .width = 1, - }, - .rst = { --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0068-arm64-dts-meson-add-GPIO-line-names-to-ODROID-N2-N2.patch b/projects/Amlogic/patches/linux/amlogic-0068-arm64-dts-meson-add-GPIO-line-names-to-ODROID-N2-N2.patch deleted file mode 100644 index f16df50578..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0068-arm64-dts-meson-add-GPIO-line-names-to-ODROID-N2-N2.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 906edbb3c5bdb0d8977e0ffecc1a80ae1a82702a Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Sun, 21 Feb 2021 05:58:56 +0000 -Subject: [PATCH 68/88] arm64: dts: meson: add GPIO line names to ODROID N2/N2+ - -Add GPIO line-name identifiers to the ODROID N2/N2+ common dtsi. - -Signed-off-by: Christian Hewitt ---- - .../dts/amlogic/meson-g12b-odroid-n2.dtsi | 45 +++++++++++++++++++ - 1 file changed, 45 insertions(+) - -diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi -index 58ce569b2ace..b9bee949b543 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi -@@ -446,6 +446,51 @@ - }; - - &gpio { -+ gpio-line-names = -+ /* GPIOZ */ -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ /* GPIOH */ -+ "", "", "", "", "", "", "", "", -+ "", -+ /* BOOT */ -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ /* GPIOC */ -+ "", "", "", "", "", "", "", "", -+ /* GPIOA */ -+ "PIN_44", /* GPIOA_0 */ -+ "PIN_46", /* GPIOA_1 */ -+ "PIN_45", /* GPIOA_2 */ -+ "PIN_47", /* GPIOA_3 */ -+ "PIN_26", /* GPIOA_4 */ -+ "", "", "", "", "", "", -+ "PIN_42", /* GPIOA_11 */ -+ "PIN_32", /* GPIOA_12 */ -+ "PIN_7", /* GPIOA_13 */ -+ "PIN_27", /* GPIOA_14 */ -+ "PIN_28", /* GPIOA_15 */ -+ /* GPIOX */ -+ "PIN_16", /* GPIOX_0 */ -+ "PIN_18", /* GPIOX_1 */ -+ "PIN_22", /* GPIOX_2 */ -+ "PIN_11", /* GPIOX_3 */ -+ "PIN_13", /* GPIOX_4 */ -+ "PIN_33", /* GPIOX_5 */ -+ "PIN_35", /* GPIOX_6 */ -+ "PIN_15", /* GPIOX_7 */ -+ "PIN_19", /* GPIOX_8 */ -+ "PIN_21", /* GPIOX_9 */ -+ "PIN_24", /* GPIOX_10 */ -+ "PIN_23", /* GPIOX_11 */ -+ "PIN_8", /* GPIOX_12 */ -+ "PIN_10", /* GPIOX_13 */ -+ "PIN_29", /* GPIOX_14 */ -+ "PIN_31", /* GPIOX_15 */ -+ "PIN_12", /* GPIOX_16 */ -+ "PIN_3", /* GPIOX_17 */ -+ "PIN_5", /* GPIOX_18 */ -+ "PIN_36"; /* GPIOX_19 */ - /* - * WARNING: The USB Hub on the Odroid-N2 needs a reset signal - * to be turned high in order to be detected by the USB Controller --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0069-arm64-dts-meson-add-saradc-node-to-ODROID-N2-N2.patch b/projects/Amlogic/patches/linux/amlogic-0069-arm64-dts-meson-add-saradc-node-to-ODROID-N2-N2.patch deleted file mode 100644 index 26c54424a3..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0069-arm64-dts-meson-add-saradc-node-to-ODROID-N2-N2.patch +++ /dev/null @@ -1,30 +0,0 @@ -From c7786a603428f55dc0cb590e04cdee0939aa708e Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Sun, 21 Feb 2021 06:03:20 +0000 -Subject: [PATCH 69/88] arm64: dts: meson: add saradc node to ODROID N2/N2+ - -Add the meson saradc node to the ODROID N2/N2+ common dtsi. - -Signed-off-by: Christian Hewitt ---- - arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi -index b9bee949b543..6b9f216d760c 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi -@@ -553,6 +553,10 @@ - status = "okay"; - }; - -+&saradc { -+ status = "okay"; -+}; -+ - /* SD card */ - &sd_emmc_b { - status = "okay"; --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0070-arm64-dts-meson-remove-extra-tab-from-ODROID-N2-N2-e.patch b/projects/Amlogic/patches/linux/amlogic-0070-arm64-dts-meson-remove-extra-tab-from-ODROID-N2-N2-e.patch deleted file mode 100644 index 07a1a15421..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0070-arm64-dts-meson-remove-extra-tab-from-ODROID-N2-N2-e.patch +++ /dev/null @@ -1,30 +0,0 @@ -From dbd3e3f39e77bf63e6712e8f21ff6b47a710a117 Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Sun, 21 Feb 2021 06:05:25 +0000 -Subject: [PATCH 70/88] arm64: dts: meson: remove extra tab from ODROID N2/N2+ - ext_mdio node - -Remove an extra tab from the ext_mdio node in the ODROID N2/N2+ common -dtsi file. - -Signed-off-by: Christian Hewitt ---- - arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi -index 6b9f216d760c..4489715fc4f3 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi -@@ -410,7 +410,7 @@ - - &ext_mdio { - external_phy: ethernet-phy@0 { -- /* Realtek RTL8211F (0x001cc916) */ -+ /* Realtek RTL8211F (0x001cc916) */ - reg = <0>; - max-speed = <1000>; - --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0071-dt-bindings-arm-amlogic-add-Bananapi-BPI-M5-bindings.patch b/projects/Amlogic/patches/linux/amlogic-0071-dt-bindings-arm-amlogic-add-Bananapi-BPI-M5-bindings.patch deleted file mode 100644 index 2210aca51c..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0071-dt-bindings-arm-amlogic-add-Bananapi-BPI-M5-bindings.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 6228426c54a777a499e7076fd0eaa3a65dfe33c7 Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Sun, 27 Dec 2020 15:27:44 +0000 -Subject: [PATCH 71/88] dt-bindings: arm: amlogic: add Bananapi BPI-M5 bindings - -Add the board bindings for the Sinovoip (Bananapi) BPI-M5 device. - -Signed-off-by: Christian Hewitt ---- - Documentation/devicetree/bindings/arm/amlogic.yaml | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/Documentation/devicetree/bindings/arm/amlogic.yaml b/Documentation/devicetree/bindings/arm/amlogic.yaml -index d24334e1e166..4ab110d6b3f0 100644 ---- a/Documentation/devicetree/bindings/arm/amlogic.yaml -+++ b/Documentation/devicetree/bindings/arm/amlogic.yaml -@@ -169,6 +169,7 @@ properties: - - hardkernel,odroid-hc4 - - khadas,vim3l - - seirobotics,sei610 -+ - sinovoip,bananapi-m5 - - const: amlogic,sm1 - - - description: Boards with the Amlogic Meson A1 A113L SoC --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0072-arm64-dts-meson-add-initial-device-tree-for-Bananapi.patch b/projects/Amlogic/patches/linux/amlogic-0072-arm64-dts-meson-add-initial-device-tree-for-Bananapi.patch deleted file mode 100644 index 55858d83a6..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0072-arm64-dts-meson-add-initial-device-tree-for-Bananapi.patch +++ /dev/null @@ -1,108 +0,0 @@ -From d7bdfe46cd2513200112787ad200e69bbd24e907 Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Sun, 27 Dec 2020 15:11:59 +0000 -Subject: [PATCH 72/88] arm64: dts: meson: add initial device-tree for Bananapi - BPI-M5 - -The Bananapi Wiki links to Amlogic BSP kernel sources which show [0] -BPI-M5 to be aligned with the HardKernel ODROID-C4 device-tree with -relatively minor differences: - -- 1x Green LED -- 4x Switches labelled SW1/RST/SW3/SW4 -- 3.5mm A/V connector -- USB-C power connector (5V) - -[0] https://github.com/Dangku/amlogic-linux/commit/bddc95f88a07e7e66f73192d8307af5b547c5b32 - -Signed-off-by: Christian Hewitt ---- - arch/arm64/boot/dts/amlogic/Makefile | 1 + - .../dts/amlogic/meson-sm1-bananapi-m5.dts | 63 +++++++++++++++++++ - 2 files changed, 64 insertions(+) - create mode 100644 arch/arm64/boot/dts/amlogic/meson-sm1-bananapi-m5.dts - -diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile -index aebd49c88719..da11ef28a47b 100644 ---- a/arch/arm64/boot/dts/amlogic/Makefile -+++ b/arch/arm64/boot/dts/amlogic/Makefile -@@ -46,6 +46,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxm-rbox-pro.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxm-s912-libretech-pc.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxm-vega-s96.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxm-wetek-core2.dtb -+dtb-$(CONFIG_ARCH_MESON) += meson-sm1-bananapi-m5.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-sm1-khadas-vim3l.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-sm1-odroid-c4.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-sm1-odroid-hc4.dtb -diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-bananapi-m5.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-bananapi-m5.dts -new file mode 100644 -index 000000000000..a98301777622 ---- /dev/null -+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-bananapi-m5.dts -@@ -0,0 +1,63 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+/* -+ * Copyright (c) 2020 Christian Hewitt -+ */ -+ -+/dts-v1/; -+ -+#include "meson-sm1-odroid.dtsi" -+ -+/ { -+ compatible = "sinovoip,bananapi-m5", "amlogic,sm1"; -+ model = "Bananapi BPI-M5"; -+ -+ leds { -+ compatible = "gpio-leds"; -+ -+ blue { -+ color = ; -+ function = LED_FUNCTION_STATUS; -+ gpios = <&gpio_ao GPIOAO_11 GPIO_ACTIVE_LOW>; -+ linux,default-trigger = "heartbeat"; -+ panic-indicator; -+ }; -+ -+ green { -+ color = ; -+ function = LED_FUNCTION_STATUS; -+ gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>; -+ default-state = "off"; -+ }; -+ }; -+ -+ hub_5v: regulator-hub_5v { -+ compatible = "regulator-fixed"; -+ regulator-name = "HUB_5V"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ vin-supply = <&vcc_5v>; -+ -+ /* Connected to the Hub CHIPENABLE, LOW sets low power state */ -+ gpio = <&gpio GPIOH_4 GPIO_ACTIVE_HIGH>; -+ enable-active-high; -+ }; -+}; -+ -+&gpio { -+ /* -+ * WARNING: The USB Hub on the Bananapi M5 needs a reset signal -+ * to be turned high in order to be detected by the USB Controller -+ * This signal should be handled by a USB specific power sequence -+ * in order to reset the Hub when USB bus is powered down. -+ */ -+ usb-hub { -+ gpio-hog; -+ gpios = ; -+ output-high; -+ line-name = "usb-hub-reset"; -+ }; -+}; -+ -+&ir { -+ linux,rc-map-name = "rc-odroid"; -+}; --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0074-dt-bindings-arm-amlogic-add-X96-AIR-bindings.patch b/projects/Amlogic/patches/linux/amlogic-0074-dt-bindings-arm-amlogic-add-X96-AIR-bindings.patch deleted file mode 100644 index d0d3aab58a..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0074-dt-bindings-arm-amlogic-add-X96-AIR-bindings.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 179925a3bc8a5ce03f3930b508c3103406998dd5 Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Mon, 18 May 2020 23:23:40 +0000 -Subject: [PATCH 74/88] dt-bindings: arm: amlogic: add X96-AIR bindings - -Add board bindings for the Amediatech X96-AIR STB which ships with -model variants distiguished by Ethernet configuration: models using -internal 10/100 PHY have a -100 suffix, while models using external -Gigabit PHY have a -1000 suffix. - -Signed-off-by: Christian Hewitt ---- - Documentation/devicetree/bindings/arm/amlogic.yaml | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/Documentation/devicetree/bindings/arm/amlogic.yaml b/Documentation/devicetree/bindings/arm/amlogic.yaml -index 4ab110d6b3f0..bbf2b77fa5bf 100644 ---- a/Documentation/devicetree/bindings/arm/amlogic.yaml -+++ b/Documentation/devicetree/bindings/arm/amlogic.yaml -@@ -165,6 +165,8 @@ properties: - - description: Boards with the Amlogic Meson SM1 S905X3/D3/Y3 SoC - items: - - enum: -+ - amediatech,x96-air-100 -+ - amediatech,x96-air-1000 - - hardkernel,odroid-c4 - - hardkernel,odroid-hc4 - - khadas,vim3l --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0076-dt-bindings-arm-amlogic-add-A95XF3-AIR-bindings.patch b/projects/Amlogic/patches/linux/amlogic-0076-dt-bindings-arm-amlogic-add-A95XF3-AIR-bindings.patch deleted file mode 100644 index 478871e3aa..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0076-dt-bindings-arm-amlogic-add-A95XF3-AIR-bindings.patch +++ /dev/null @@ -1,31 +0,0 @@ -From d3f8339a14bb50d961ea6abd4d391355d2b21858 Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Mon, 29 Jun 2020 15:54:45 +0000 -Subject: [PATCH 76/88] dt-bindings: arm: amlogic: add A95XF3-AIR bindings - -Add board bindings for the CYX A95XF3-AIR set-top box which ships -with model variants distiguished by Ethernet configuration: models -using internal 10/100 PHY have a -100 suffix, while models using -external Gigabit PHY have a -1000 suffix. - -Signed-off-by: Christian Hewitt ---- - Documentation/devicetree/bindings/arm/amlogic.yaml | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/Documentation/devicetree/bindings/arm/amlogic.yaml b/Documentation/devicetree/bindings/arm/amlogic.yaml -index bbf2b77fa5bf..6a6eec15747b 100644 ---- a/Documentation/devicetree/bindings/arm/amlogic.yaml -+++ b/Documentation/devicetree/bindings/arm/amlogic.yaml -@@ -167,6 +167,8 @@ properties: - - enum: - - amediatech,x96-air-100 - - amediatech,x96-air-1000 -+ - cyx,a95xf3-air-100 -+ - cyx,a95xf3-air-1000 - - hardkernel,odroid-c4 - - hardkernel,odroid-hc4 - - khadas,vim3l --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0083-arm64-dts-meson-fixups-for-WeTek-common-dtsi.patch b/projects/Amlogic/patches/linux/amlogic-0083-arm64-dts-meson-fixups-for-WeTek-common-dtsi.patch deleted file mode 100644 index c0cbebfc97..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0083-arm64-dts-meson-fixups-for-WeTek-common-dtsi.patch +++ /dev/null @@ -1,68 +0,0 @@ -From cc7f9f99d5e29270dca4952502f2c661f4aa0ac0 Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Tue, 29 Dec 2020 09:31:57 +0000 -Subject: [PATCH 83/88] arm64: dts: meson: fixups for WeTek common dtsi - -Minor changes that result from work on mainline u-boot support, closer -study of vendor 3.14 device-tree, and access to vendor schematics: - -- Add missing GPIO binding -- Add higher max-freq to SDIO and SD -- Add higher rates to SDIO -- Use updated LED bindings - -Signed-off-by: Christian Hewitt ---- - arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi | 15 +++++++++++---- - 1 file changed, 11 insertions(+), 4 deletions(-) - -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi -index a350fee1264d..8c6453fd130f 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi -@@ -6,6 +6,8 @@ - */ - - #include "meson-gxbb.dtsi" -+#include -+#include - - / { - aliases { -@@ -25,8 +27,10 @@ - leds { - compatible = "gpio-leds"; - -- led-system { -- label = "wetek-play:system-status"; -+ blue { -+ /* red in suspend or power-off */ -+ color = ; -+ function = LED_FUNCTION_POWER; - gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_HIGH>; - default-state = "on"; - panic-indicator; -@@ -199,7 +203,10 @@ - - bus-width = <4>; - cap-sd-highspeed; -- max-frequency = <50000000>; -+ sd-uhs-sdr12; -+ sd-uhs-sdr25; -+ sd-uhs-sdr50; -+ max-frequency = <200000000>; - - non-removable; - disable-wp; -@@ -227,7 +234,7 @@ - - bus-width = <4>; - cap-sd-highspeed; -- max-frequency = <50000000>; -+ max-frequency = <100000000>; - disable-wp; - - cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>; --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0084-media-rc-add-keymaps-for-mecool-kii-pro-kiii-pro-rem.patch b/projects/Amlogic/patches/linux/amlogic-0084-media-rc-add-keymaps-for-mecool-kii-pro-kiii-pro-rem.patch deleted file mode 100644 index e56a97c27f..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0084-media-rc-add-keymaps-for-mecool-kii-pro-kiii-pro-rem.patch +++ /dev/null @@ -1,258 +0,0 @@ -From 903c0bd72155f8cf84b0bdcd6e129f6470a954e5 Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Mon, 8 Mar 2021 02:51:01 +0000 -Subject: [PATCH 84/88] media: rc: add keymaps for mecool-kii-pro/kiii-pro - remotes - -Add keymaps and bindings for the simple IR (NEC) remotes used with -the MeCool KII-Pro and MeCool KIII-Pro Android STB devices. - -Tested-by: Drazen Spio -Signed-off-by: Christian Hewitt ---- - .../devicetree/bindings/media/rc.yaml | 2 + - drivers/media/rc/keymaps/Makefile | 2 + - drivers/media/rc/keymaps/rc-mecool-kii-pro.c | 93 +++++++++++++++++++ - drivers/media/rc/keymaps/rc-mecool-kiii-pro.c | 90 ++++++++++++++++++ - include/media/rc-map.h | 2 + - 5 files changed, 189 insertions(+) - create mode 100644 drivers/media/rc/keymaps/rc-mecool-kii-pro.c - create mode 100644 drivers/media/rc/keymaps/rc-mecool-kiii-pro.c - -diff --git a/Documentation/devicetree/bindings/media/rc.yaml b/Documentation/devicetree/bindings/media/rc.yaml -index cbffdd6a470d..79c166a2cc1a 100644 ---- a/Documentation/devicetree/bindings/media/rc.yaml -+++ b/Documentation/devicetree/bindings/media/rc.yaml -@@ -90,6 +90,8 @@ properties: - - rc-leadtek-y04g0051 - - rc-lme2510 - - rc-manli -+ - rc-mecool-kii-pro -+ - rc-mecool-kiii-pro - - rc-medion-x10 - - rc-medion-x10-digitainer - - rc-medion-x10-or2x -diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile -index 79c529340853..707148cb37f4 100644 ---- a/drivers/media/rc/keymaps/Makefile -+++ b/drivers/media/rc/keymaps/Makefile -@@ -66,6 +66,8 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \ - rc-leadtek-y04g0051.o \ - rc-lme2510.o \ - rc-manli.o \ -+ rc-mecool-kii-pro.o \ -+ rc-mecool-kiii-pro.o \ - rc-medion-x10.o \ - rc-medion-x10-digitainer.o \ - rc-medion-x10-or2x.o \ -diff --git a/drivers/media/rc/keymaps/rc-mecool-kii-pro.c b/drivers/media/rc/keymaps/rc-mecool-kii-pro.c -new file mode 100644 -index 000000000000..08ffdd1352ce ---- /dev/null -+++ b/drivers/media/rc/keymaps/rc-mecool-kii-pro.c -@@ -0,0 +1,93 @@ -+// SPDX-License-Identifier: GPL-2.0+ -+// -+// Copyright (C) 2021 Christian Hewitt -+ -+#include -+#include -+ -+// -+// Keytable for the Mecool Kii Pro remote control -+// -+ -+static struct rc_map_table mecool_kii_pro[] = { -+ -+ { 0x59, KEY_POWER }, -+ { 0x19, KEY_MUTE }, -+ -+ { 0x42, KEY_RED }, -+ { 0x40, KEY_GREEN }, -+ { 0x00, KEY_YELLOW}, -+ { 0x03, KEY_BLUE }, -+ -+ { 0x4a, KEY_REWIND }, -+ { 0x48, KEY_FORWARD }, -+ { 0x08, KEY_PREVIOUSSONG}, -+ { 0x0b, KEY_NEXTSONG}, -+ -+ { 0x46, KEY_PLAYPAUSE }, -+ { 0x44, KEY_STOP }, -+ { 0x1f, KEY_FAVORITES}, -+ { 0x04, KEY_PVR }, -+ -+ { 0x4d, KEY_EPG }, -+ { 0x02, KEY_INFO }, -+ { 0x09, KEY_SUBTITLE }, -+ { 0x01, KEY_LANGUAGE }, // AUDIO -+ -+ { 0x0d, KEY_HOME }, -+ { 0x11, KEY_TV }, -+ { 0x45, KEY_MENU }, -+ { 0x05, KEY_EXIT }, -+ -+ { 0x5a, KEY_LEFT }, -+ { 0x1b, KEY_RIGHT }, -+ { 0x06, KEY_UP }, -+ { 0x16, KEY_DOWN }, -+ { 0x1a, KEY_OK }, -+ -+ { 0x13, KEY_VOLUMEUP }, -+ { 0x17, KEY_VOLUMEDOWN }, -+ { 0x58, KEY_APPSELECT }, // APPS -+ { 0x12, KEY_CONTEXT_MENU }, // MOUSE -+ { 0x55, KEY_CHANNELUP }, // PAGE_UP -+ { 0x15, KEY_CHANNELDOWN }, // PAGE_DOWN -+ -+ { 0x52, KEY_1 }, -+ { 0x50, KEY_2 }, -+ { 0x10, KEY_3 }, -+ { 0x56, KEY_4 }, -+ { 0x54, KEY_5 }, -+ { 0x14, KEY_6 }, -+ { 0x4e, KEY_7 }, -+ { 0x4c, KEY_8 }, -+ { 0x0c, KEY_9 }, -+ { 0x18, KEY_WWW }, -+ { 0x0f, KEY_0 }, -+ { 0x51, KEY_DELETE }, -+ -+}; -+ -+static struct rc_map_list mecool_kii_pro_map = { -+ .map = { -+ .scan = mecool_kii_pro, -+ .size = ARRAY_SIZE(mecool_kii_pro), -+ .rc_proto = RC_PROTO_NEC, -+ .name = RC_MAP_MECOOL_KII_PRO, -+ } -+}; -+ -+static int __init init_rc_map_mecool_kii_pro(void) -+{ -+ return rc_map_register(&mecool_kii_pro_map); -+} -+ -+static void __exit exit_rc_map_mecool_kii_pro(void) -+{ -+ rc_map_unregister(&mecool_kii_pro_map); -+} -+ -+module_init(init_rc_map_mecool_kii_pro) -+module_exit(exit_rc_map_mecool_kii_pro) -+ -+MODULE_LICENSE("GPL"); -+MODULE_AUTHOR("Christian Hewitt -+ -+#include -+#include -+ -+// -+// Keytable for the Mecool Kiii Pro remote control -+// -+ -+static struct rc_map_table mecool_kiii_pro[] = { -+ -+ { 0x59, KEY_POWER }, -+ -+ { 0x52, KEY_1 }, -+ { 0x50, KEY_2 }, -+ { 0x10, KEY_3 }, -+ { 0x56, KEY_4 }, -+ { 0x54, KEY_5 }, -+ { 0x14, KEY_6 }, -+ { 0x4e, KEY_7 }, -+ { 0x4c, KEY_8 }, -+ { 0x0c, KEY_9 }, -+ { 0x02, KEY_INFO }, -+ { 0x0f, KEY_0 }, -+ { 0x51, KEY_DELETE }, -+ { 0x1f, KEY_FAVORITES}, -+ { 0x09, KEY_SUBTITLE }, -+ { 0x01, KEY_LANGUAGE }, // AUDIO -+ -+ { 0x42, KEY_RED }, -+ { 0x40, KEY_GREEN }, -+ { 0x00, KEY_YELLOW}, -+ { 0x03, KEY_BLUE }, // RADIO -+ -+ { 0x0d, KEY_HOME }, -+ { 0x4d, KEY_EPG }, -+ { 0x45, KEY_MENU }, -+ { 0x05, KEY_EXIT }, -+ -+ { 0x5a, KEY_LEFT }, -+ { 0x1b, KEY_RIGHT }, -+ { 0x06, KEY_UP }, -+ { 0x16, KEY_DOWN }, -+ { 0x1a, KEY_OK }, -+ -+ { 0x13, KEY_VOLUMEUP }, -+ { 0x17, KEY_VOLUMEDOWN }, -+ { 0x19, KEY_MUTE }, -+ { 0x12, KEY_CONTEXT_MENU }, // MOUSE -+ { 0x55, KEY_CHANNELUP }, // PAGE_UP -+ { 0x15, KEY_CHANNELDOWN }, // PAGE_DOWN -+ -+ { 0x4a, KEY_REWIND }, -+ { 0x48, KEY_FORWARD }, -+ { 0x46, KEY_PLAYPAUSE }, -+ { 0x44, KEY_STOP }, -+ -+ { 0x08, KEY_PREVIOUSSONG}, -+ { 0x0b, KEY_NEXTSONG}, -+ { 0x04, KEY_PVR }, -+ { 0x64, KEY_RECORD }, -+ -+}; -+ -+static struct rc_map_list mecool_kiii_pro_map = { -+ .map = { -+ .scan = mecool_kiii_pro, -+ .size = ARRAY_SIZE(mecool_kiii_pro), -+ .rc_proto = RC_PROTO_NEC, -+ .name = RC_MAP_MECOOL_KIII_PRO, -+ } -+}; -+ -+static int __init init_rc_map_mecool_kiii_pro(void) -+{ -+ return rc_map_register(&mecool_kiii_pro_map); -+} -+ -+static void __exit exit_rc_map_mecool_kiii_pro(void) -+{ -+ rc_map_unregister(&mecool_kiii_pro_map); -+} -+ -+module_init(init_rc_map_mecool_kiii_pro) -+module_exit(exit_rc_map_mecool_kiii_pro) -+ -+MODULE_LICENSE("GPL"); -+MODULE_AUTHOR("Christian Hewitt -Date: Tue, 9 Mar 2021 05:04:10 +0000 -Subject: [PATCH 85/88] dt-bindings: arm: amlogic: add MeCool KII/KIII Pro - bindings - -Add the board bindings for the MeCool (Videostrong Technology Co., Ltd) -KII-Pro (S905D) and KIII-Pro (S912) devices. - -Signed-off-by: Christian Hewitt ---- - Documentation/devicetree/bindings/arm/amlogic.yaml | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/Documentation/devicetree/bindings/arm/amlogic.yaml b/Documentation/devicetree/bindings/arm/amlogic.yaml -index e8aec4b53553..f32b798d1a1c 100644 ---- a/Documentation/devicetree/bindings/arm/amlogic.yaml -+++ b/Documentation/devicetree/bindings/arm/amlogic.yaml -@@ -109,6 +109,7 @@ properties: - - libretech,aml-s905d-pc - - phicomm,n1 - - smartlabs,sml5442tw -+ - videostrong,gxl-kii-pro - - const: amlogic,s905d - - const: amlogic,meson-gxl - -@@ -123,6 +124,7 @@ properties: - - minix,neo-u9h - - nexbox,a1 - - tronsmart,vega-s96 -+ - videostrong,gxm-kiii-pro - - wetek,core2 - - const: amlogic,s912 - - const: amlogic,meson-gxm --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0086-arm64-dts-meson-add-initial-device-tree-for-MeCool-K.patch b/projects/Amlogic/patches/linux/amlogic-0086-arm64-dts-meson-add-initial-device-tree-for-MeCool-K.patch deleted file mode 100644 index 25f6e57d52..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0086-arm64-dts-meson-add-initial-device-tree-for-MeCool-K.patch +++ /dev/null @@ -1,137 +0,0 @@ -From a0eebfc1fee709f56a275643f878d34bc847823c Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Tue, 9 Mar 2021 06:19:20 +0000 -Subject: [PATCH 86/88] arm64: dts: meson: add initial device-tree for MeCool - KII Pro - -MeCool (Videostrong) KII Pro is based on the Amlogic P230 reference -board with an S905D chip and the following specs: - -- 2GB DDR3 RAM -- 16GB eMMC -- 10/100 Base-T Ethernet -- BCM4335 Wireless (802.11 b/g/n/ac, BT 4.0) -- DVB-C/T/T2/S/S2 (AVL6862TA demod + R848 tuner) -- HDMI 2.0a video -- S/PDIF optical output -- CVBS/Analogue output -- 4x USB 2.0 ports -- IR receiver -- 1x Power button (with integrated blue LED) -- 1x micro SD card slot - -Tested-by: Drazen Spio -Signed-off-by: Christian Hewitt ---- - arch/arm64/boot/dts/amlogic/Makefile | 1 + - .../meson-gxl-s905d-mecool-kii-pro.dts | 86 +++++++++++++++++++ - 2 files changed, 87 insertions(+) - create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxl-s905d-mecool-kii-pro.dts - -diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile -index 7d8586c718a1..cdfb5573acbc 100644 ---- a/arch/arm64/boot/dts/amlogic/Makefile -+++ b/arch/arm64/boot/dts/amlogic/Makefile -@@ -30,6 +30,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-libretech-cc.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-libretech-cc-v2.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-nexbox-a95x.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-p212.dtb -+dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905d-mecool-kii-pro.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905d-p230.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905d-p231.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905d-phicomm-n1.dtb -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-mecool-kii-pro.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-mecool-kii-pro.dts -new file mode 100644 -index 000000000000..5ab5d3aa0646 ---- /dev/null -+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-mecool-kii-pro.dts -@@ -0,0 +1,86 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+ -+/* -+ * Author: Christian Hewitt -+ */ -+ -+/dts-v1/; -+ -+#include "meson-gxl-s905d.dtsi" -+#include "meson-gx-p23x-q20x.dtsi" -+#include -+#include -+ -+/ { -+ compatible = "videostrong,gxl-kii-pro", "amlogic,s905d", "amlogic,meson-gxl"; -+ model = "MeCool KII Pro"; -+ -+ adc-keys { -+ compatible = "adc-keys"; -+ io-channels = <&saradc 0>; -+ io-channel-names = "buttons"; -+ keyup-threshold-microvolt = <1710000>; -+ -+ button-function { -+ label = "Update"; -+ linux,code = ; -+ press-threshold-microvolt = <10000>; -+ }; -+ }; -+ -+ gpio-keys-polled { -+ compatible = "gpio-keys-polled"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ poll-interval = <100>; -+ -+ button@0 { -+ label = "power"; -+ linux,code = ; -+ gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ -+ blue { -+ color = ; -+ function = LED_FUNCTION_POWER; -+ gpios = <&gpio GPIODV_24 GPIO_ACTIVE_HIGH>; -+ default-state = "on"; -+ panic-indicator; -+ }; -+ }; -+}; -+ -+ðmac { -+ phy-mode = "rmii"; -+ phy-handle = <&internal_phy>; -+}; -+ -+&ir { -+ linux,rc-map-name = "rc-mecool-kii-pro"; -+}; -+ -+&sd_emmc_a { -+ brcmf: wifi@1 { -+ reg = <1>; -+ compatible = "brcm,bcm4329-fmac"; -+ }; -+}; -+ -+&uart_A { -+ status = "okay"; -+ pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>; -+ pinctrl-names = "default"; -+ uart-has-rtscts; -+ -+ bluetooth { -+ compatible = "brcm,bcm43438-bt"; -+ shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; -+ max-speed = <2000000>; -+ clocks = <&wifi32k>; -+ clock-names = "lpo"; -+ }; -+}; --- -2.17.1 - diff --git a/projects/Amlogic/patches/linux/amlogic-0087-arm64-dts-meson-add-initial-device-tree-for-MeCool-K.patch b/projects/Amlogic/patches/linux/amlogic-0087-arm64-dts-meson-add-initial-device-tree-for-MeCool-K.patch deleted file mode 100644 index 49fd88b475..0000000000 --- a/projects/Amlogic/patches/linux/amlogic-0087-arm64-dts-meson-add-initial-device-tree-for-MeCool-K.patch +++ /dev/null @@ -1,165 +0,0 @@ -From 1683ff2960679c9d26baffdd5716eaae683c81b7 Mon Sep 17 00:00:00 2001 -From: Christian Hewitt -Date: Tue, 9 Mar 2021 06:58:47 +0000 -Subject: [PATCH 87/88] arm64: dts: meson: add initial device-tree for MeCool - KIII Pro - -MeCool (Videostrong) KIII Pro is based on the Amlogic Q200 reference -board with an S912 chip and the following specs: - -- 3GB DDR3 RAM -- 16GB eMMC -- 10/100/1000 Base-T Ethernet -- BCM4335 Wireless (802.11 b/g/n/ac, BT 4.0) -- DVB-C/T/T2/S/S2 (AVL6862TA demod + R912 tuner) -- HDMI 2.0a video -- S/PDIF optical output -- CVBS/Analogue output -- 4x USB 2.0 ports -- IR receiver -- 1x Power button (with integrated blue LED) -- 1x Update/Reset button (underside) -- 1x micro SD card slot - -Tested-by: Drazen Spio -Signed-off-by: Christian Hewitt ---- - arch/arm64/boot/dts/amlogic/Makefile | 1 + - .../dts/amlogic/meson-gxm-mecool-kiii-pro.dts | 113 ++++++++++++++++++ - 2 files changed, 114 insertions(+) - create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxm-mecool-kiii-pro.dts - -diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile -index cdfb5573acbc..82265e80cbe2 100644 ---- a/arch/arm64/boot/dts/amlogic/Makefile -+++ b/arch/arm64/boot/dts/amlogic/Makefile -@@ -40,6 +40,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905w-p281.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905w-tx3-mini.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905d-libretech-pc.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxm-khadas-vim2.dtb -+dtb-$(CONFIG_ARCH_MESON) += meson-gxm-mecool-kiii-pro.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxm-minix-neo-u9h.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxm-nexbox-a1.dtb - dtb-$(CONFIG_ARCH_MESON) += meson-gxm-q200.dtb -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-mecool-kiii-pro.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-mecool-kiii-pro.dts -new file mode 100644 -index 000000000000..0651756d7fb5 ---- /dev/null -+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-mecool-kiii-pro.dts -@@ -0,0 +1,113 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+ -+/* -+ * Author: Christian Hewitt -+ */ -+ -+/dts-v1/; -+ -+#include "meson-gxm.dtsi" -+#include "meson-gx-p23x-q20x.dtsi" -+#include -+#include -+ -+/ { -+ compatible = "videostrong,gxm-kiii-pro", "amlogic,s912", "amlogic,meson-gxm"; -+ model = "MeCool KIII Pro"; -+ -+ memory@0 { -+ device_type = "memory"; -+ reg = <0x0 0x0 0x0 0xC0000000>; -+ }; -+ -+ adc-keys { -+ compatible = "adc-keys"; -+ io-channels = <&saradc 0>; -+ io-channel-names = "buttons"; -+ keyup-threshold-microvolt = <1710000>; -+ -+ button-function { -+ label = "Update"; -+ linux,code = ; -+ press-threshold-microvolt = <10000>; -+ }; -+ }; -+ -+ gpio-keys-polled { -+ compatible = "gpio-keys-polled"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ poll-interval = <100>; -+ -+ button@0 { -+ label = "power"; -+ linux,code = ; -+ gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ -+ blue { -+ color = ; -+ function = LED_FUNCTION_POWER; -+ gpios = <&gpio GPIODV_24 GPIO_ACTIVE_HIGH>; -+ default-state = "on"; -+ panic-indicator; -+ }; -+ }; -+}; -+ -+ðmac { -+ pinctrl-0 = <ð_pins>; -+ pinctrl-names = "default"; -+ -+ phy-handle = <&external_phy>; -+ -+ amlogic,tx-delay-ns = <2>; -+ -+ phy-mode = "rgmii"; -+}; -+ -+&external_mdio { -+ external_phy: ethernet-phy@0 { -+ /* Realtek RTL8211F (0x001cc916) */ -+ reg = <0>; -+ max-speed = <1000>; -+ -+ reset-assert-us = <10000>; -+ reset-deassert-us = <80000>; -+ reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>; -+ -+ interrupt-parent = <&gpio_intc>; -+ /* MAC_INTR on GPIOZ_15 */ -+ interrupts = <25 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+&ir { -+ linux,rc-map-name = "rc-mecool-kiii-pro"; -+}; -+ -+&sd_emmc_a { -+ brcmf: wifi@1 { -+ reg = <1>; -+ compatible = "brcm,bcm4329-fmac"; -+ }; -+}; -+ -+&uart_A { -+ status = "okay"; -+ pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>; -+ pinctrl-names = "default"; -+ uart-has-rtscts; -+ -+ bluetooth { -+ compatible = "brcm,bcm43438-bt"; -+ shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; -+ max-speed = <2000000>; -+ clocks = <&wifi32k>; -+ clock-names = "lpo"; -+ }; -+}; --- -2.17.1 -