diff --git a/packages/linux/package.mk b/packages/linux/package.mk index 991511a142..088498ff41 100644 --- a/packages/linux/package.mk +++ b/packages/linux/package.mk @@ -28,8 +28,8 @@ case "${LINUX}" in PKG_SOURCE_NAME="linux-${LINUX}-${PKG_VERSION}.tar.gz" ;; *) - PKG_VERSION="5.10.61" - PKG_SHA256="82eae38cc5cd11dd6aaac91c02ff0d006c7bafd6d4cf5c6a791930820a3a91d1" + PKG_VERSION="5.10.76" + PKG_SHA256="480a09ba1962862ff18df9453fa0df6ba11cbe19eefedeab81bf2c84f49e1890" PKG_URL="https://www.kernel.org/pub/linux/kernel/v5.x/${PKG_NAME}-${PKG_VERSION}.tar.xz" PKG_PATCH_DIRS="default" ;; diff --git a/projects/Allwinner/devices/A64/patches/linux/0001-HACK-a64-Add-HDMI-sound-card.patch b/projects/Allwinner/devices/A64/patches/linux/0001-HACK-a64-Add-HDMI-sound-card.patch index be4cdd7bfa..e4b9e99e12 100644 --- a/projects/Allwinner/devices/A64/patches/linux/0001-HACK-a64-Add-HDMI-sound-card.patch +++ b/projects/Allwinner/devices/A64/patches/linux/0001-HACK-a64-Add-HDMI-sound-card.patch @@ -1,4 +1,4 @@ -From ff9ed48eb584e583e20509af6cde1ba80ebd3edd Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sat, 16 Jan 2021 10:49:00 +0100 Subject: [PATCH] HACK: a64: Add HDMI sound card @@ -8,9 +8,11 @@ Signed-off-by: Jernej Skrabec arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +index 57786fc120c3..2e671a45fdd0 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -@@ -161,6 +161,24 @@ +@@ -154,6 +154,24 @@ link_codec: simple-audio-card,codec { }; }; @@ -35,7 +37,7 @@ Signed-off-by: Jernej Skrabec timer { compatible = "arm,armv8-timer"; allwinner,erratum-unknown1; -@@ -878,7 +896,6 @@ +@@ -861,7 +879,6 @@ i2s2: i2s@1c22800 { resets = <&ccu RST_BUS_I2S2>; dma-names = "rx", "tx"; dmas = <&dma 27>, <&dma 27>; @@ -43,7 +45,7 @@ Signed-off-by: Jernej Skrabec }; dai: dai@1c22c00 { -@@ -1178,6 +1195,7 @@ +@@ -1161,6 +1178,7 @@ deinterlace: deinterlace@1e00000 { }; hdmi: hdmi@1ee0000 { diff --git a/projects/Allwinner/devices/A64/patches/linux/0002-a64-increase-mali-frequency.patch b/projects/Allwinner/devices/A64/patches/linux/0002-arm64-dts-allwinner-a64-increase-mali-frequency.patch similarity index 64% rename from projects/Allwinner/devices/A64/patches/linux/0002-a64-increase-mali-frequency.patch rename to projects/Allwinner/devices/A64/patches/linux/0002-arm64-dts-allwinner-a64-increase-mali-frequency.patch index be00c324aa..9f10bc34ed 100644 --- a/projects/Allwinner/devices/A64/patches/linux/0002-a64-increase-mali-frequency.patch +++ b/projects/Allwinner/devices/A64/patches/linux/0002-arm64-dts-allwinner-a64-increase-mali-frequency.patch @@ -1,16 +1,18 @@ -From 6c2c1ff1f601956df8afe70b6ad2a936f5a581de Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sat, 4 Apr 2020 11:30:02 +0200 -Subject: [PATCH 1/3] arm64: dts: allwinner: a64: increase mali frequency +Subject: [PATCH] arm64: dts: allwinner: a64: increase mali frequency Signed-off-by: Jernej Skrabec --- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 3 +++ 1 file changed, 3 insertions(+) +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +index 2e671a45fdd0..7e0b77fa80d6 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -@@ -1101,6 +1101,9 @@ +@@ -1084,6 +1084,9 @@ mali: gpu@1c40000 { clocks = <&ccu CLK_BUS_GPU>, <&ccu CLK_GPU>; clock-names = "bus", "core"; resets = <&ccu RST_BUS_GPU>; diff --git a/projects/Allwinner/devices/H2-plus/patches/linux/0001-ARM-dts-sun8i-h2-plus-bananapi-m2-zero-Increase-BT-U.patch b/projects/Allwinner/devices/H2-plus/patches/linux/0001-ARM-dts-sun8i-h2-plus-bananapi-m2-zero-Increase-BT-U.patch index 21047f5b7a..78052bef63 100644 --- a/projects/Allwinner/devices/H2-plus/patches/linux/0001-ARM-dts-sun8i-h2-plus-bananapi-m2-zero-Increase-BT-U.patch +++ b/projects/Allwinner/devices/H2-plus/patches/linux/0001-ARM-dts-sun8i-h2-plus-bananapi-m2-zero-Increase-BT-U.patch @@ -1,8 +1,8 @@ -From 4cc652f2c660bd01bd0d8cefde272400cbe82fbe Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sat, 16 Jan 2021 11:32:04 +0100 -Subject: [PATCH 1/2] ARM: dts: sun8i: h2-plus: bananapi-m2-zero: Increase BT - UART speed +Subject: [PATCH] ARM: dts: sun8i: h2-plus: bananapi-m2-zero: Increase BT UART + speed Bluetooth module on BananaPi M2 Zero can also be used for streaming audio. However, for that case higher UART speed is required. @@ -14,9 +14,11 @@ Signed-off-by: Jernej Skrabec arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts | 1 + 1 file changed, 1 insertion(+) +diff --git a/arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts b/arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts +index 4c6704e4c57e..240e0f363cd1 100644 --- a/arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts +++ b/arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts -@@ -125,6 +125,7 @@ +@@ -125,6 +125,7 @@ &uart1 { bluetooth { compatible = "brcm,bcm43438-bt"; diff --git a/projects/Allwinner/devices/H2-plus/patches/linux/0002-ARM-dts-sunxi-h2-plus-bananapi-m2-zero-Add-HDMI-out.patch b/projects/Allwinner/devices/H2-plus/patches/linux/0002-ARM-dts-sunxi-h2-plus-bananapi-m2-zero-Add-HDMI-out.patch index daeef7f63f..51f4a62375 100644 --- a/projects/Allwinner/devices/H2-plus/patches/linux/0002-ARM-dts-sunxi-h2-plus-bananapi-m2-zero-Add-HDMI-out.patch +++ b/projects/Allwinner/devices/H2-plus/patches/linux/0002-ARM-dts-sunxi-h2-plus-bananapi-m2-zero-Add-HDMI-out.patch @@ -1,16 +1,18 @@ -From aa47c3b292cb0ffcf2c00b2a12c477ec3027a729 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: PJBrs Date: Sat, 16 Jan 2021 11:39:45 +0100 -Subject: [PATCH 2/2] ARM: dts: sunxi: h2-plus-bananapi-m2-zero: Add HDMI out +Subject: [PATCH] ARM: dts: sunxi: h2-plus-bananapi-m2-zero: Add HDMI out Add HDMI out, including the display engine, to the BananaPi M2 Zero. --- .../dts/sun8i-h2-plus-bananapi-m2-zero.dts | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) +diff --git a/arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts b/arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts +index 240e0f363cd1..3202506eb564 100644 --- a/arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts +++ b/arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts -@@ -26,6 +26,17 @@ +@@ -26,6 +26,17 @@ chosen { stdout-path = "serial0:115200n8"; }; @@ -28,7 +30,7 @@ Add HDMI out, including the display engine, to the BananaPi M2 Zero. leds { compatible = "gpio-leds"; -@@ -107,6 +118,20 @@ +@@ -107,6 +118,20 @@ brcmf: wifi@1 { }; }; diff --git a/projects/Allwinner/devices/H3/patches/linux/0001-HACK-SW-CEC-implementation-for-H3.patch b/projects/Allwinner/devices/H3/patches/linux/0001-HACK-SW-CEC-implementation-for-H3.patch index 151e91a58b..1368bb2940 100644 --- a/projects/Allwinner/devices/H3/patches/linux/0001-HACK-SW-CEC-implementation-for-H3.patch +++ b/projects/Allwinner/devices/H3/patches/linux/0001-HACK-SW-CEC-implementation-for-H3.patch @@ -1,4 +1,4 @@ -From 411f022496f0f9715ca3dc9296f5823cbc0c867c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Mon, 11 Oct 2021 20:13:41 +0200 Subject: [PATCH] HACK: SW CEC implementation for H3 @@ -87,7 +87,7 @@ index bffe1b9cd3dc..438f7398e26d 100644 struct clk *clk_mod; struct clk *clk_phy; diff --git a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c -index 78b152973957..0d87b56b700a 100644 +index b64d93da651d..4e324e7f4b64 100644 --- a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c +++ b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c @@ -498,8 +498,9 @@ static void sun8i_hdmi_phy_init_h3(struct sun8i_hdmi_phy *phy) @@ -225,6 +225,3 @@ index ea34ca146b82..e66a4edc2a93 100644 }; struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, --- -2.33.0 - diff --git a/projects/Allwinner/devices/H3/patches/linux/0002-ARM-dts-sunxi-bananapi-m2-plus-Increase-BT-UART-spee.patch b/projects/Allwinner/devices/H3/patches/linux/0002-ARM-dts-sunxi-bananapi-m2-plus-Increase-BT-UART-spee.patch index 12059e3a72..c74e7775dc 100644 --- a/projects/Allwinner/devices/H3/patches/linux/0002-ARM-dts-sunxi-bananapi-m2-plus-Increase-BT-UART-spee.patch +++ b/projects/Allwinner/devices/H3/patches/linux/0002-ARM-dts-sunxi-bananapi-m2-plus-Increase-BT-UART-spee.patch @@ -1,4 +1,4 @@ -From 54b5c2cb4fc87ca72daa662423d4d969f3b5edb8 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sat, 16 Jan 2021 11:49:57 +0100 Subject: [PATCH] ARM: dts: sunxi: bananapi-m2-plus: Increase BT UART speed @@ -13,9 +13,11 @@ Signed-off-by: Jernej Skrabec arch/arm/boot/dts/sunxi-bananapi-m2-plus.dtsi | 1 + 1 file changed, 1 insertion(+) +diff --git a/arch/arm/boot/dts/sunxi-bananapi-m2-plus.dtsi b/arch/arm/boot/dts/sunxi-bananapi-m2-plus.dtsi +index b1066dedc1a2..d03f5853ef7b 100644 --- a/arch/arm/boot/dts/sunxi-bananapi-m2-plus.dtsi +++ b/arch/arm/boot/dts/sunxi-bananapi-m2-plus.dtsi -@@ -219,6 +219,7 @@ +@@ -220,6 +220,7 @@ &uart1 { bluetooth { compatible = "brcm,bcm43438-bt"; diff --git a/projects/Allwinner/devices/H6/patches/linux/0001-HACK-h6-Add-HDMI-sound-card.patch b/projects/Allwinner/devices/H6/patches/linux/0001-HACK-h6-Add-HDMI-sound-card.patch index 71663f441c..0120ae45f3 100644 --- a/projects/Allwinner/devices/H6/patches/linux/0001-HACK-h6-Add-HDMI-sound-card.patch +++ b/projects/Allwinner/devices/H6/patches/linux/0001-HACK-h6-Add-HDMI-sound-card.patch @@ -8,9 +8,11 @@ Signed-off-by: Jernej Skrabec arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +index 11bfd674ea72..3b6566a8a65d 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi -@@ -108,6 +108,24 @@ +@@ -101,6 +101,24 @@ timer { (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; }; @@ -35,7 +37,7 @@ Signed-off-by: Jernej Skrabec soc { compatible = "simple-bus"; #address-cells = <1>; -@@ -652,7 +670,6 @@ +@@ -633,7 +651,6 @@ i2s1: i2s@5091000 { dmas = <&dma 4>, <&dma 4>; resets = <&ccu RST_BUS_I2S1>; dma-names = "rx", "tx"; @@ -43,7 +45,7 @@ Signed-off-by: Jernej Skrabec }; spdif: spdif@5093000 { -@@ -785,6 +802,7 @@ +@@ -770,6 +787,7 @@ ohci3: usb@5311400 { }; hdmi: hdmi@6000000 { diff --git a/projects/Allwinner/devices/H6/patches/linux/0002-net-stmmac-sun8i-Use-devm_regulator_get-for-PHY-regu.patch b/projects/Allwinner/devices/H6/patches/linux/0002-net-stmmac-sun8i-Use-devm_regulator_get-for-PHY-regu.patch index 50e7cc4d46..6b22144562 100644 --- a/projects/Allwinner/devices/H6/patches/linux/0002-net-stmmac-sun8i-Use-devm_regulator_get-for-PHY-regu.patch +++ b/projects/Allwinner/devices/H6/patches/linux/0002-net-stmmac-sun8i-Use-devm_regulator_get-for-PHY-regu.patch @@ -20,9 +20,11 @@ Signed-off-by: Ondrej Jirman .../net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) +diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +index 9f5ccf1a0a54..361c6fb14313 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c -@@ -549,12 +549,10 @@ static int sun8i_dwmac_init(struct platf +@@ -549,12 +549,10 @@ static int sun8i_dwmac_init(struct platform_device *pdev, void *priv) struct sunxi_priv_data *gmac = priv; int ret; @@ -39,7 +41,7 @@ Signed-off-by: Ondrej Jirman } ret = clk_prepare_enable(gmac->tx_clk); -@@ -1021,8 +1019,7 @@ static void sun8i_dwmac_exit(struct plat +@@ -1026,8 +1024,7 @@ static void sun8i_dwmac_exit(struct platform_device *pdev, void *priv) clk_disable_unprepare(gmac->tx_clk); @@ -49,7 +51,7 @@ Signed-off-by: Ondrej Jirman } static void sun8i_dwmac_set_mac_loopback(void __iomem *ioaddr, bool enable) -@@ -1150,12 +1147,12 @@ static int sun8i_dwmac_probe(struct plat +@@ -1155,12 +1152,12 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) } /* Optional regulator for PHY */ diff --git a/projects/Allwinner/devices/H6/patches/linux/0003-net-stmmac-sun8i-Rename-PHY-regulator-variable-to-re.patch b/projects/Allwinner/devices/H6/patches/linux/0003-net-stmmac-sun8i-Rename-PHY-regulator-variable-to-re.patch index 81132eb2b0..b905afe029 100644 --- a/projects/Allwinner/devices/H6/patches/linux/0003-net-stmmac-sun8i-Rename-PHY-regulator-variable-to-re.patch +++ b/projects/Allwinner/devices/H6/patches/linux/0003-net-stmmac-sun8i-Rename-PHY-regulator-variable-to-re.patch @@ -12,6 +12,8 @@ Signed-off-by: Ondrej Jirman .../net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) +diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +index 361c6fb14313..7c0d037ef5f4 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -57,20 +57,22 @@ struct emac_variant { @@ -47,7 +49,7 @@ Signed-off-by: Ondrej Jirman struct reset_control *rst_ephy; const struct emac_variant *variant; struct regmap_field *regmap_field; -@@ -549,9 +551,9 @@ static int sun8i_dwmac_init(struct platf +@@ -549,9 +551,9 @@ static int sun8i_dwmac_init(struct platform_device *pdev, void *priv) struct sunxi_priv_data *gmac = priv; int ret; @@ -59,7 +61,7 @@ Signed-off-by: Ondrej Jirman return ret; } -@@ -572,8 +574,7 @@ static int sun8i_dwmac_init(struct platf +@@ -572,8 +574,7 @@ static int sun8i_dwmac_init(struct platform_device *pdev, void *priv) err_disable_clk: clk_disable_unprepare(gmac->tx_clk); err_disable_regulator: @@ -69,7 +71,7 @@ Signed-off-by: Ondrej Jirman return ret; } -@@ -1019,7 +1020,7 @@ static void sun8i_dwmac_exit(struct plat +@@ -1024,7 +1025,7 @@ static void sun8i_dwmac_exit(struct platform_device *pdev, void *priv) clk_disable_unprepare(gmac->tx_clk); @@ -78,7 +80,7 @@ Signed-off-by: Ondrej Jirman } static void sun8i_dwmac_set_mac_loopback(void __iomem *ioaddr, bool enable) -@@ -1147,11 +1148,9 @@ static int sun8i_dwmac_probe(struct plat +@@ -1152,11 +1153,9 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) } /* Optional regulator for PHY */ diff --git a/projects/Allwinner/devices/H6/patches/linux/0004-net-stmmac-sun8i-Add-support-for-enabling-a-regulato.patch b/projects/Allwinner/devices/H6/patches/linux/0004-net-stmmac-sun8i-Add-support-for-enabling-a-regulato.patch index a38543d319..b0a9ddfc20 100644 --- a/projects/Allwinner/devices/H6/patches/linux/0004-net-stmmac-sun8i-Add-support-for-enabling-a-regulato.patch +++ b/projects/Allwinner/devices/H6/patches/linux/0004-net-stmmac-sun8i-Add-support-for-enabling-a-regulato.patch @@ -15,6 +15,8 @@ Signed-off-by: Ondrej Jirman .../net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) +diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +index 7c0d037ef5f4..8a0f5f0a1f25 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -61,6 +61,8 @@ struct emac_variant { @@ -34,7 +36,7 @@ Signed-off-by: Ondrej Jirman struct reset_control *rst_ephy; const struct emac_variant *variant; struct regmap_field *regmap_field; -@@ -551,10 +554,16 @@ static int sun8i_dwmac_init(struct platf +@@ -551,10 +554,16 @@ static int sun8i_dwmac_init(struct platform_device *pdev, void *priv) struct sunxi_priv_data *gmac = priv; int ret; @@ -52,7 +54,7 @@ Signed-off-by: Ondrej Jirman } ret = clk_prepare_enable(gmac->tx_clk); -@@ -575,6 +584,8 @@ err_disable_clk: +@@ -575,6 +584,8 @@ static int sun8i_dwmac_init(struct platform_device *pdev, void *priv) clk_disable_unprepare(gmac->tx_clk); err_disable_regulator: regulator_disable(gmac->regulator_phy); @@ -61,7 +63,7 @@ Signed-off-by: Ondrej Jirman return ret; } -@@ -1021,6 +1032,7 @@ static void sun8i_dwmac_exit(struct plat +@@ -1026,6 +1037,7 @@ static void sun8i_dwmac_exit(struct platform_device *pdev, void *priv) clk_disable_unprepare(gmac->tx_clk); regulator_disable(gmac->regulator_phy); @@ -69,7 +71,7 @@ Signed-off-by: Ondrej Jirman } static void sun8i_dwmac_set_mac_loopback(void __iomem *ioaddr, bool enable) -@@ -1154,6 +1166,15 @@ static int sun8i_dwmac_probe(struct plat +@@ -1159,6 +1171,15 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) return ret; } diff --git a/projects/Allwinner/devices/H6/patches/linux/0005-arm64-dts-allwinner-orange-pi-3-Enable-ethernet.patch b/projects/Allwinner/devices/H6/patches/linux/0005-arm64-dts-allwinner-orange-pi-3-Enable-ethernet.patch index 82baa0f4d0..0c9afa702b 100644 --- a/projects/Allwinner/devices/H6/patches/linux/0005-arm64-dts-allwinner-orange-pi-3-Enable-ethernet.patch +++ b/projects/Allwinner/devices/H6/patches/linux/0005-arm64-dts-allwinner-orange-pi-3-Enable-ethernet.patch @@ -28,9 +28,11 @@ Signed-off-by: Ondrej Jirman .../dts/allwinner/sun50i-h6-orangepi-3.dts | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts +index 15c9dd8c4479..2e96605106c5 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts -@@ -15,6 +15,7 @@ +@@ -15,6 +15,7 @@ / { aliases { serial0 = &uart0; serial1 = &uart1; @@ -38,7 +40,7 @@ Signed-off-by: Ondrej Jirman }; chosen { -@@ -64,6 +65,15 @@ +@@ -64,6 +65,15 @@ reg_vcc5v: vcc5v { regulator-always-on; }; @@ -54,7 +56,7 @@ Signed-off-by: Ondrej Jirman reg_vcc33_wifi: vcc33-wifi { /* Always on 3.3V regulator for WiFi and BT */ compatible = "regulator-fixed"; -@@ -128,6 +138,35 @@ +@@ -128,6 +138,35 @@ hdmi_out_con: endpoint { }; }; @@ -90,7 +92,7 @@ Signed-off-by: Ondrej Jirman &mmc0 { vmmc-supply = <®_cldo1>; cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ -@@ -207,6 +246,7 @@ +@@ -207,6 +246,7 @@ reg_aldo2: aldo2 { regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-name = "vcc33-audio-tv-ephy-mac"; diff --git a/projects/Allwinner/devices/H6/patches/linux/0006-arm64-allwinner-dts-h6-enable-USB3-port-on-Pine-H64.patch b/projects/Allwinner/devices/H6/patches/linux/0006-arm64-allwinner-dts-h6-enable-USB3-port-on-Pine-H64.patch index 7178bfbf23..9ed1b96b74 100644 --- a/projects/Allwinner/devices/H6/patches/linux/0006-arm64-allwinner-dts-h6-enable-USB3-port-on-Pine-H64.patch +++ b/projects/Allwinner/devices/H6/patches/linux/0006-arm64-allwinner-dts-h6-enable-USB3-port-on-Pine-H64.patch @@ -15,9 +15,11 @@ Reviewed-by: Chen-Yu Tsai arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts | 9 +++++++++ 1 file changed, 9 insertions(+) +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts +index 961732c52aa0..c2f0cfef0703 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts -@@ -97,6 +97,10 @@ +@@ -97,6 +97,10 @@ &ehci3 { status = "okay"; }; @@ -28,7 +30,7 @@ Reviewed-by: Chen-Yu Tsai &emac { pinctrl-names = "default"; pinctrl-0 = <&ext_rgmii_pins>; -@@ -331,3 +335,8 @@ +@@ -331,3 +335,8 @@ &usb2phy { usb3_vbus-supply = <®_usb_vbus>; status = "okay"; }; diff --git a/projects/Allwinner/devices/H6/patches/linux/0007-arm64-dts-allwinner-h6-Add-AC200-EPHY-related-nodes.patch b/projects/Allwinner/devices/H6/patches/linux/0007-arm64-dts-allwinner-h6-Add-AC200-EPHY-related-nodes.patch index fd11bccf83..1b14649f48 100644 --- a/projects/Allwinner/devices/H6/patches/linux/0007-arm64-dts-allwinner-h6-Add-AC200-EPHY-related-nodes.patch +++ b/projects/Allwinner/devices/H6/patches/linux/0007-arm64-dts-allwinner-h6-Add-AC200-EPHY-related-nodes.patch @@ -8,9 +8,11 @@ Signed-off-by: Jernej Skrabec arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 56 ++++++++++++++++++++ 1 file changed, 56 insertions(+) +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +index 3b6566a8a65d..717502911d24 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi -@@ -16,6 +16,16 @@ +@@ -16,6 +16,16 @@ / { #address-cells = <1>; #size-cells = <1>; @@ -27,7 +29,7 @@ Signed-off-by: Jernej Skrabec cpus { #address-cells = <1>; #size-cells = <0>; -@@ -319,6 +329,10 @@ +@@ -298,6 +308,10 @@ ths_calibration: thermal-sensor-calibration@14 { cpu_speed_grade: cpu-speed-grade@1c { reg = <0x1c 0x4>; }; @@ -38,7 +40,7 @@ Signed-off-by: Jernej Skrabec }; watchdog: watchdog@30090a0 { -@@ -364,6 +378,13 @@ +@@ -342,6 +356,13 @@ ext_rgmii_pins: rgmii-pins { drive-strength = <40>; }; @@ -52,7 +54,7 @@ Signed-off-by: Jernej Skrabec hdmi_pins: hdmi-pins { pins = "PH8", "PH9", "PH10"; function = "hdmi"; -@@ -384,6 +405,11 @@ +@@ -362,6 +383,11 @@ i2c2_pins: i2c2-pins { function = "i2c2"; }; @@ -64,7 +66,7 @@ Signed-off-by: Jernej Skrabec mmc0_pins: mmc0-pins { pins = "PF0", "PF1", "PF2", "PF3", "PF4", "PF5"; -@@ -410,6 +436,11 @@ +@@ -388,6 +414,11 @@ mmc2_pins: mmc2-pins { bias-pull-up; }; @@ -76,7 +78,7 @@ Signed-off-by: Jernej Skrabec /omit-if-no-ref/ spi0_pins: spi0-pins { pins = "PC0", "PC2", "PC3"; -@@ -640,6 +671,31 @@ +@@ -621,6 +652,31 @@ spi1: spi@5011000 { #size-cells = <0>; }; diff --git a/projects/Allwinner/devices/H6/patches/linux/0008-arm64-dts-allwinner-h6-tanix-tx6-Add-PIO-power-suppl.patch b/projects/Allwinner/devices/H6/patches/linux/0008-arm64-dts-allwinner-h6-tanix-tx6-Add-PIO-power-suppl.patch new file mode 100644 index 0000000000..ef323deb8d --- /dev/null +++ b/projects/Allwinner/devices/H6/patches/linux/0008-arm64-dts-allwinner-h6-tanix-tx6-Add-PIO-power-suppl.patch @@ -0,0 +1,53 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jernej Skrabec +Date: Thu, 22 Jul 2021 18:12:19 +0200 +Subject: [PATCH] arm64: dts: allwinner: h6: tanix-tx6: Add PIO power supplies + +While there is no publicly available schematic of this board, it's not +hard to determine voltage of GPIO port C, D and G (only ones which can +be set). + +Port C and G are used for MMC/SDIO communication, so they use 1.8 V +power supply. It's not clear if port D is even used, but if it is, it's +pretty safe to assume it uses 3.3 V power supply. Value read from PIO +Group Withstand Voltage Mode Select register from within pre-installed +Android agrees with that assesment. + +Signed-off-by: Jernej Skrabec +Signed-off-by: Maxime Ripard +Link: https://lore.kernel.org/r/20210722161220.51181-3-jernej.skrabec@gmail.com +--- + .../boot/dts/allwinner/sun50i-h6-tanix-tx6.dts | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts +index 02641191682e..cf9721ca6370 100644 +--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts +@@ -32,6 +32,13 @@ hdmi_con_in: endpoint { + }; + }; + ++ reg_vcc1v8: regulator-vcc1v8 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc1v8"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ }; ++ + reg_vcc3v3: regulator-vcc3v3 { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3"; +@@ -99,6 +106,12 @@ &ohci3 { + status = "okay"; + }; + ++&pio { ++ vcc-pc-supply = <®_vcc1v8>; ++ vcc-pd-supply = <®_vcc3v3>; ++ vcc-pg-supply = <®_vcc1v8>; ++}; ++ + &r_ir { + linux,rc-map-name = "rc-tanix-tx5max"; + status = "okay"; diff --git a/projects/Allwinner/devices/H6/patches/linux/0008-arm64-dts-allwinner-h6-tanix-tx6-enable-emmc.patch b/projects/Allwinner/devices/H6/patches/linux/0008-arm64-dts-allwinner-h6-tanix-tx6-enable-emmc.patch deleted file mode 100644 index 0ba7100157..0000000000 --- a/projects/Allwinner/devices/H6/patches/linux/0008-arm64-dts-allwinner-h6-tanix-tx6-enable-emmc.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jernej Skrabec -Date: Wed, 15 Jan 2020 18:39:17 +0100 -Subject: [PATCH] arm64: dts: allwinner: h6: tanix-tx6: enable emmc - -Tanix TX6 has 32 GiB eMMC. Add a node for it. - -Signed-off-by: Jernej Skrabec ---- - .../dts/allwinner/sun50i-h6-tanix-tx6.dts | 20 +++++++++++++++++++ - 1 file changed, 20 insertions(+) - ---- a/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts -+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts -@@ -32,6 +32,13 @@ - }; - }; - -+ reg_vcc1v8: vcc1v8 { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc1v8"; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ }; -+ - reg_vcc3v3: vcc3v3 { - compatible = "regulator-fixed"; - regulator-name = "vcc3v3"; -@@ -91,6 +98,15 @@ - status = "okay"; - }; - -+&mmc2 { -+ vmmc-supply = <®_vcc3v3>; -+ vqmmc-supply = <®_vcc1v8>; -+ non-removable; -+ cap-mmc-hw-reset; -+ bus-width = <8>; -+ status = "okay"; -+}; -+ - &ohci0 { - status = "okay"; - }; -@@ -99,6 +115,10 @@ - status = "okay"; - }; - -+&pio { -+ vcc-pc-supply = <®_vcc1v8>; -+}; -+ - &r_ir { - linux,rc-map-name = "rc-tanix-tx5max"; - status = "okay"; diff --git a/projects/Allwinner/devices/H6/patches/linux/0009-arm64-dts-allwinner-h6-tanix-tx6-enable-emmc.patch b/projects/Allwinner/devices/H6/patches/linux/0009-arm64-dts-allwinner-h6-tanix-tx6-enable-emmc.patch new file mode 100644 index 0000000000..6e16d813f9 --- /dev/null +++ b/projects/Allwinner/devices/H6/patches/linux/0009-arm64-dts-allwinner-h6-tanix-tx6-enable-emmc.patch @@ -0,0 +1,35 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jernej Skrabec +Date: Thu, 22 Jul 2021 18:12:20 +0200 +Subject: [PATCH] arm64: dts: allwinner: h6: tanix-tx6: enable emmc + +Tanix TX6 has 32 GiB eMMC. Add a node for it. + +Signed-off-by: Jernej Skrabec +Signed-off-by: Maxime Ripard +Link: https://lore.kernel.org/r/20210722161220.51181-4-jernej.skrabec@gmail.com +--- + arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts +index cf9721ca6370..8f2a80f128de 100644 +--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts +@@ -98,6 +98,16 @@ &mmc0 { + status = "okay"; + }; + ++&mmc2 { ++ vmmc-supply = <®_vcc3v3>; ++ vqmmc-supply = <®_vcc1v8>; ++ bus-width = <8>; ++ non-removable; ++ cap-mmc-hw-reset; ++ mmc-hs200-1_8v; ++ status = "okay"; ++}; ++ + &ohci0 { + status = "okay"; + }; diff --git a/projects/Allwinner/devices/H6/patches/linux/0009-arm64-dts-allwinner-h6-tanix-tx6-enable-ethernet.patch b/projects/Allwinner/devices/H6/patches/linux/0010-arm64-dts-allwinner-h6-tanix-tx6-enable-ethernet.patch similarity index 77% rename from projects/Allwinner/devices/H6/patches/linux/0009-arm64-dts-allwinner-h6-tanix-tx6-enable-ethernet.patch rename to projects/Allwinner/devices/H6/patches/linux/0010-arm64-dts-allwinner-h6-tanix-tx6-enable-ethernet.patch index 1fe0dd8805..c362d8f6d6 100644 --- a/projects/Allwinner/devices/H6/patches/linux/0009-arm64-dts-allwinner-h6-tanix-tx6-enable-ethernet.patch +++ b/projects/Allwinner/devices/H6/patches/linux/0010-arm64-dts-allwinner-h6-tanix-tx6-enable-ethernet.patch @@ -8,9 +8,11 @@ Signed-off-by: Jernej Skrabec .../dts/allwinner/sun50i-h6-tanix-tx6.dts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts +index 8f2a80f128de..8ef7d3bd4a5d 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts -@@ -13,6 +13,7 @@ +@@ -13,6 +13,7 @@ / { compatible = "oranth,tanix-tx6", "allwinner,sun50i-h6"; aliases { @@ -18,7 +20,7 @@ Signed-off-by: Jernej Skrabec serial0 = &uart0; }; -@@ -54,6 +55,10 @@ +@@ -54,6 +55,10 @@ reg_vdd_cpu_gpu: regulator-vdd-cpu-gpu { }; }; @@ -29,7 +31,7 @@ Signed-off-by: Jernej Skrabec &cpu0 { cpu-supply = <®_vdd_cpu_gpu>; }; -@@ -74,6 +79,14 @@ +@@ -74,6 +79,14 @@ &ehci3 { status = "okay"; }; @@ -44,7 +46,7 @@ Signed-off-by: Jernej Skrabec &gpu { mali-supply = <®_vdd_cpu_gpu>; status = "okay"; -@@ -89,6 +102,17 @@ +@@ -89,6 +102,17 @@ hdmi_out_con: endpoint { }; }; @@ -62,8 +64,8 @@ Signed-off-by: Jernej Skrabec &mmc0 { pinctrl-names = "default"; pinctrl-0 = <&mmc0_pins>; -@@ -119,6 +143,10 @@ - vcc-pc-supply = <®_vcc1v8>; +@@ -122,6 +146,10 @@ &pio { + vcc-pg-supply = <®_vcc1v8>; }; +&pwm { diff --git a/projects/Allwinner/devices/H6/patches/linux/0010-arm64-allwinner-h6-Enable-USB3-for-OrangePi-Lite2.patch b/projects/Allwinner/devices/H6/patches/linux/0011-arm64-allwinner-h6-Enable-USB3-for-OrangePi-Lite2.patch similarity index 80% rename from projects/Allwinner/devices/H6/patches/linux/0010-arm64-allwinner-h6-Enable-USB3-for-OrangePi-Lite2.patch rename to projects/Allwinner/devices/H6/patches/linux/0011-arm64-allwinner-h6-Enable-USB3-for-OrangePi-Lite2.patch index 3162bccf97..54580d63af 100644 --- a/projects/Allwinner/devices/H6/patches/linux/0010-arm64-allwinner-h6-Enable-USB3-for-OrangePi-Lite2.patch +++ b/projects/Allwinner/devices/H6/patches/linux/0011-arm64-allwinner-h6-Enable-USB3-for-OrangePi-Lite2.patch @@ -8,9 +8,11 @@ Signed-off-by: Sebastian Meyer .../allwinner/sun50i-h6-orangepi-lite2.dts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-lite2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-lite2.dts +index e8770858b5d0..6ca46b1cabb9 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-lite2.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-lite2.dts -@@ -11,6 +11,16 @@ +@@ -11,6 +11,16 @@ aliases { serial1 = &uart1; /* BT-UART */ }; @@ -27,7 +29,7 @@ Signed-off-by: Sebastian Meyer wifi_pwrseq: wifi_pwrseq { compatible = "mmc-pwrseq-simple"; clocks = <&rtc 1>; -@@ -20,6 +30,10 @@ +@@ -20,6 +30,10 @@ wifi_pwrseq: wifi_pwrseq { }; }; @@ -38,7 +40,7 @@ Signed-off-by: Sebastian Meyer &mmc1 { vmmc-supply = <®_cldo2>; vqmmc-supply = <®_bldo3>; -@@ -72,3 +86,8 @@ +@@ -72,3 +86,8 @@ bluetooth { max-speed = <1500000>; }; }; diff --git a/projects/Allwinner/devices/H6/patches/linux/0011-mmc-sunxi-fix-unusuable-eMMC-on-some-H6-boards-by-di.patch b/projects/Allwinner/devices/H6/patches/linux/0012-mmc-sunxi-fix-unusuable-eMMC-on-some-H6-boards-by-di.patch similarity index 95% rename from projects/Allwinner/devices/H6/patches/linux/0011-mmc-sunxi-fix-unusuable-eMMC-on-some-H6-boards-by-di.patch rename to projects/Allwinner/devices/H6/patches/linux/0012-mmc-sunxi-fix-unusuable-eMMC-on-some-H6-boards-by-di.patch index 5770fa769d..9d9d4c6d2c 100644 --- a/projects/Allwinner/devices/H6/patches/linux/0011-mmc-sunxi-fix-unusuable-eMMC-on-some-H6-boards-by-di.patch +++ b/projects/Allwinner/devices/H6/patches/linux/0012-mmc-sunxi-fix-unusuable-eMMC-on-some-H6-boards-by-di.patch @@ -35,9 +35,11 @@ Signed-off-by: Alejandro González drivers/mmc/host/sunxi-mmc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) +diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c +index cebb15cf81f2..a4dc0e1cc988 100644 --- a/drivers/mmc/host/sunxi-mmc.c +++ b/drivers/mmc/host/sunxi-mmc.c -@@ -1398,14 +1398,17 @@ static int sunxi_mmc_probe(struct platfo +@@ -1398,14 +1398,17 @@ static int sunxi_mmc_probe(struct platform_device *pdev) /* * Some H5 devices do not have signal traces precise enough to diff --git a/projects/Allwinner/devices/H6/patches/linux/0012-pineh64-model-b-bluetooth-wip.patch b/projects/Allwinner/devices/H6/patches/linux/0013-pineh64-model-b-bluetooth-wip.patch similarity index 76% rename from projects/Allwinner/devices/H6/patches/linux/0012-pineh64-model-b-bluetooth-wip.patch rename to projects/Allwinner/devices/H6/patches/linux/0013-pineh64-model-b-bluetooth-wip.patch index 0b76f232ae..351e8a6d8f 100644 --- a/projects/Allwinner/devices/H6/patches/linux/0012-pineh64-model-b-bluetooth-wip.patch +++ b/projects/Allwinner/devices/H6/patches/linux/0013-pineh64-model-b-bluetooth-wip.patch @@ -9,9 +9,11 @@ Signed-off-by: Jernej Skrabec drivers/bluetooth/hci_h5.c | 3 +++ 2 files changed, 19 insertions(+) +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts +index 7fea1e4e2d49..9bff717b3444 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts -@@ -34,3 +34,19 @@ +@@ -34,3 +34,19 @@ &mmc1 { non-removable; status = "okay"; }; @@ -31,9 +33,11 @@ Signed-off-by: Jernej Skrabec + max-speed = <1500000>; + }; +}; +diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c +index 996729e78105..35eb58607392 100644 --- a/drivers/bluetooth/hci_h5.c +++ b/drivers/bluetooth/hci_h5.c -@@ -820,6 +820,9 @@ static int h5_serdev_probe(struct serdev +@@ -820,6 +820,9 @@ static int h5_serdev_probe(struct serdev_device *serdev) if (!data) return -ENODEV; diff --git a/projects/Allwinner/devices/H6/patches/linux/0013-WIP-OPi3-DT-fixes.patch b/projects/Allwinner/devices/H6/patches/linux/0014-WIP-OPi3-DT-fixes.patch similarity index 96% rename from projects/Allwinner/devices/H6/patches/linux/0013-WIP-OPi3-DT-fixes.patch rename to projects/Allwinner/devices/H6/patches/linux/0014-WIP-OPi3-DT-fixes.patch index 55deabea56..c921675dd2 100644 --- a/projects/Allwinner/devices/H6/patches/linux/0013-WIP-OPi3-DT-fixes.patch +++ b/projects/Allwinner/devices/H6/patches/linux/0014-WIP-OPi3-DT-fixes.patch @@ -1,4 +1,4 @@ -From 08e3fa7c43d72fb4c9fc8c9bf689b26827570c2a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sun, 26 Sep 2021 09:31:45 +0200 Subject: [PATCH] WIP: OPi3 DT fixes @@ -8,7 +8,7 @@ Subject: [PATCH] WIP: OPi3 DT fixes 1 file changed, 34 insertions(+), 36 deletions(-) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts -index d561e3526284..556fc0b22793 100644 +index 2e96605106c5..587c2b33c52f 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts @@ -74,26 +74,6 @@ reg_gmac_2v5: gmac-2v5 { @@ -130,6 +130,3 @@ index d561e3526284..556fc0b22793 100644 &rtc { clocks = <&ext_osc32k>; }; --- -2.33.0 - diff --git a/projects/Allwinner/devices/H6/patches/linux/0020-arm64-dts-allwinner-h6-tanix-tx6-add-bt-enable-rtw88.patch b/projects/Allwinner/devices/H6/patches/linux/0015-Allwinner-linux-enable-BT-on-Tanix-TX6-and-add-wifi-.patch similarity index 89% rename from projects/Allwinner/devices/H6/patches/linux/0020-arm64-dts-allwinner-h6-tanix-tx6-add-bt-enable-rtw88.patch rename to projects/Allwinner/devices/H6/patches/linux/0015-Allwinner-linux-enable-BT-on-Tanix-TX6-and-add-wifi-.patch index 7adac809ec..fe172d3ccd 100644 --- a/projects/Allwinner/devices/H6/patches/linux/0020-arm64-dts-allwinner-h6-tanix-tx6-add-bt-enable-rtw88.patch +++ b/projects/Allwinner/devices/H6/patches/linux/0015-Allwinner-linux-enable-BT-on-Tanix-TX6-and-add-wifi-.patch @@ -1,7 +1,8 @@ -From ba918badf612c19b4e31a57b2ff4baa06e99d7d5 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: heitbaum Date: Sun, 23 May 2021 06:37:45 +0000 -Subject: [PATCH] Allwinner: linux: enable BT on Tanix TX6 and add wifi node for rtl8822cs (rtw88) +Subject: [PATCH] Allwinner: linux: enable BT on Tanix TX6 and add wifi node + for rtl8822cs (rtw88) Add and enable dts nodes for both rtw88 (rtl8822cs sdio) and uart rtl8822cs bluetooth. @@ -24,16 +25,15 @@ Bluetooth: hci0: RTL: examining hci_ver=08 hci_rev=000c subver=8822 Bluetooth: hci0: RTL: rom_version status=0 version=3 Bluetooth: hci0: RTL: loading rtl_bt/rtl8822cs_fw.bin Bluetooth: hci0: RTL: loading rtl_bt/rtl8822cs_config.bin - --- - .../dts/allwinner/sun50i-h6-tanix-tx6.dts | 32 +++++++++++++++++++ + .../dts/allwinner/sun50i-h6-tanix-tx6.dts | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts -index 5233ad1488..06e7820fd9 100644 +index 8ef7d3bd4a5d..54a7d6a6b52e 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts -@@ -47,12 +47,29 @@ reg_vcc3v3: vcc3v3 { +@@ -47,12 +47,29 @@ reg_vcc3v3: regulator-vcc3v3 { regulator-max-microvolt = <3300000>; }; @@ -47,7 +47,7 @@ index 5233ad1488..06e7820fd9 100644 + vin-supply = <®_vcc3v3>; + }; + - reg_vdd_cpu_gpu: vdd-cpu-gpu { + reg_vdd_cpu_gpu: regulator-vdd-cpu-gpu { compatible = "regulator-fixed"; regulator-name = "vdd-cpu-gpu"; regulator-min-microvolt = <1135000>; @@ -86,7 +86,7 @@ index 5233ad1488..06e7820fd9 100644 &mmc2 { vmmc-supply = <®_vcc3v3>; vqmmc-supply = <®_vcc1v8>; -@@ -158,6 +191,21 @@ &uart0 { +@@ -161,6 +194,21 @@ &uart0 { status = "okay"; }; @@ -108,6 +108,3 @@ index 5233ad1488..06e7820fd9 100644 &usb2otg { dr_mode = "host"; status = "okay"; --- -2.29.2 - diff --git a/projects/Allwinner/devices/R40/patches/linux/0001-ARM-dts-sun8i-r40-Add-timer-node.patch b/projects/Allwinner/devices/R40/patches/linux/0001-ARM-dts-sun8i-r40-Add-timer-node.patch index 58fd3e7398..af318d4086 100644 --- a/projects/Allwinner/devices/R40/patches/linux/0001-ARM-dts-sun8i-r40-Add-timer-node.patch +++ b/projects/Allwinner/devices/R40/patches/linux/0001-ARM-dts-sun8i-r40-Add-timer-node.patch @@ -1,4 +1,4 @@ -From 8e2b67acc77a0c7704b2001dd4bf8646f286e4be Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sat, 16 Jan 2021 13:09:00 +0100 Subject: [PATCH] ARM: dts: sun8i: r40: Add timer node @@ -12,9 +12,11 @@ Signed-off-by: Jernej Skrabec arch/arm/boot/dts/sun8i-r40.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+) +diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi +index d5ad3b9efd12..c13a1427c813 100644 --- a/arch/arm/boot/dts/sun8i-r40.dtsi +++ b/arch/arm/boot/dts/sun8i-r40.dtsi -@@ -647,6 +647,18 @@ +@@ -647,6 +647,18 @@ uart3_rts_cts_pg_pins: uart3-rts-cts-pg-pins { }; }; diff --git a/projects/Allwinner/devices/R40/patches/linux/0002-bpi-m2u-analog-codec.patch b/projects/Allwinner/devices/R40/patches/linux/0002-dts-enable-analog-codec.patch similarity index 67% rename from projects/Allwinner/devices/R40/patches/linux/0002-bpi-m2u-analog-codec.patch rename to projects/Allwinner/devices/R40/patches/linux/0002-dts-enable-analog-codec.patch index 7b19556c09..cb7e66edcf 100644 --- a/projects/Allwinner/devices/R40/patches/linux/0002-bpi-m2u-analog-codec.patch +++ b/projects/Allwinner/devices/R40/patches/linux/0002-dts-enable-analog-codec.patch @@ -1,17 +1,19 @@ -From 958ad802878443a2f5f06f5f3c796d163fd03ca9 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Mon, 24 Aug 2020 16:35:54 +0200 -Subject: [PATCH 16/17] dts: enable analog codec +Subject: [PATCH] dts: enable analog codec Signed-off-by: Jernej Skrabec --- - .../boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 9 ++++ - arch/arm/boot/dts/sun8i-r40.dtsi | 42 +++++++++++++++++++ - 2 files changed, 51 insertions(+) + .../boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 9 +++++++++ + arch/arm/boot/dts/sun8i-r40.dtsi | 19 +++++++++++++++++++ + 2 files changed, 28 insertions(+) +diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts +index a6a1087a0c9b..417e28b1a808 100644 --- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts +++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts -@@ -113,6 +113,15 @@ +@@ -113,6 +113,15 @@ &ahci { status = "okay"; }; @@ -27,9 +29,11 @@ Signed-off-by: Jernej Skrabec &de { status = "okay"; }; +diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi +index c13a1427c813..82a4ee50e4d0 100644 --- a/arch/arm/boot/dts/sun8i-r40.dtsi +++ b/arch/arm/boot/dts/sun8i-r40.dtsi -@@ -692,6 +692,25 @@ +@@ -692,6 +692,25 @@ ir1: ir@1c21c00 { status = "disabled"; }; diff --git a/projects/Allwinner/devices/R40/patches/linux/0003-r40-hdmi-audio-wip.patch b/projects/Allwinner/devices/R40/patches/linux/0003-r40-hdmi-audio-wip.patch index 76fcb9d50d..d274b0e2d6 100644 --- a/projects/Allwinner/devices/R40/patches/linux/0003-r40-hdmi-audio-wip.patch +++ b/projects/Allwinner/devices/R40/patches/linux/0003-r40-hdmi-audio-wip.patch @@ -1,16 +1,18 @@ -From 4347f8f825bf0a775ab552ca37eaa2204fb65188 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sun, 16 Aug 2020 11:01:11 +0200 -Subject: [PATCH 17/17] r40 hdmi audio wip +Subject: [PATCH] r40 hdmi audio wip Signed-off-by: Jernej Skrabec --- arch/arm/boot/dts/sun8i-r40.dtsi | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) +diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi +index 82a4ee50e4d0..ed3bb5778fcb 100644 --- a/arch/arm/boot/dts/sun8i-r40.dtsi +++ b/arch/arm/boot/dts/sun8i-r40.dtsi -@@ -111,6 +111,24 @@ +@@ -111,6 +111,24 @@ de: display-engine { status = "disabled"; }; @@ -35,7 +37,7 @@ Signed-off-by: Jernej Skrabec thermal-zones { cpu_thermal: cpu0-thermal { /* milliseconds */ -@@ -666,6 +684,19 @@ +@@ -666,6 +684,19 @@ wdt: watchdog@1c20c90 { clocks = <&osc24M>; }; @@ -55,7 +57,7 @@ Signed-off-by: Jernej Skrabec ir0: ir@1c21800 { compatible = "allwinner,sun8i-r40-ir", "allwinner,sun6i-a31-ir"; -@@ -1142,6 +1173,7 @@ +@@ -1142,6 +1173,7 @@ gic: interrupt-controller@1c81000 { }; hdmi: hdmi@1ee0000 { diff --git a/projects/Allwinner/patches/linux/0001-media-cedrus-Add-support-for-R40.patch b/projects/Allwinner/patches/linux/0001-media-cedrus-Add-support-for-R40.patch index 37665933e4..e50b5d1d9f 100644 --- a/projects/Allwinner/patches/linux/0001-media-cedrus-Add-support-for-R40.patch +++ b/projects/Allwinner/patches/linux/0001-media-cedrus-Add-support-for-R40.patch @@ -1,7 +1,7 @@ -From 9a7e6c2d8a18a24b013c1ad165ed04bb7d2c7716 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 25 Aug 2020 19:35:22 +0200 -Subject: [PATCH 01/44] media: cedrus: Add support for R40 +Subject: [PATCH] media: cedrus: Add support for R40 Video engine in R40 is very similar to that in A33 but it runs on lower speed, at least according to OS images released by board designer. @@ -13,9 +13,11 @@ Link: https://lore.kernel.org/r/20200825173523.1289379-5-jernej.skrabec@siol.net drivers/staging/media/sunxi/cedrus/cedrus.c | 9 +++++++++ 1 file changed, 9 insertions(+) +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c +index 1dd833757c4e..97000f0e0011 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus.c -@@ -508,6 +508,11 @@ static const struct cedrus_variant sun8i +@@ -527,6 +527,11 @@ static const struct cedrus_variant sun8i_h3_cedrus_variant = { .mod_rate = 402000000, }; @@ -27,14 +29,14 @@ Link: https://lore.kernel.org/r/20200825173523.1289379-5-jernej.skrabec@siol.net static const struct cedrus_variant sun50i_a64_cedrus_variant = { .capabilities = CEDRUS_CAPABILITY_UNTILED | CEDRUS_CAPABILITY_H265_DEC, -@@ -549,6 +554,10 @@ static const struct of_device_id cedrus_ +@@ -567,6 +572,10 @@ static const struct of_device_id cedrus_dt_match[] = { + .compatible = "allwinner,sun8i-h3-video-engine", .data = &sun8i_h3_cedrus_variant, }, - { ++ { + .compatible = "allwinner,sun8i-r40-video-engine", + .data = &sun8i_r40_cedrus_variant, + }, -+ { + { .compatible = "allwinner,sun50i-a64-video-engine", .data = &sun50i_a64_cedrus_variant, - }, diff --git a/projects/Allwinner/patches/linux/0002-media-sunxi-cir-allow-timeout-to-be-set-at-runtime.patch b/projects/Allwinner/patches/linux/0002-media-sunxi-cir-allow-timeout-to-be-set-at-runtime.patch index 602c26a462..71ffd6b264 100644 --- a/projects/Allwinner/patches/linux/0002-media-sunxi-cir-allow-timeout-to-be-set-at-runtime.patch +++ b/projects/Allwinner/patches/linux/0002-media-sunxi-cir-allow-timeout-to-be-set-at-runtime.patch @@ -1,7 +1,7 @@ -From f710d6403b7716d7a5319e51c4cb3c217ec85b73 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Sean Young Date: Tue, 10 Nov 2020 09:30:38 +0100 -Subject: [PATCH 02/44] media: sunxi-cir: allow timeout to be set at runtime +Subject: [PATCH] media: sunxi-cir: allow timeout to be set at runtime This allows the timeout to be set with the LIRC_SET_REC_TIMEOUT ioctl. @@ -18,6 +18,8 @@ Signed-off-by: Mauro Carvalho Chehab drivers/media/rc/sunxi-cir.c | 48 ++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 8 deletions(-) +diff --git a/drivers/media/rc/sunxi-cir.c b/drivers/media/rc/sunxi-cir.c +index 4afc5895bee7..8555c7798706 100644 --- a/drivers/media/rc/sunxi-cir.c +++ b/drivers/media/rc/sunxi-cir.c @@ -73,10 +73,6 @@ @@ -31,7 +33,7 @@ Signed-off-by: Mauro Carvalho Chehab /** * struct sunxi_ir_quirks - Differences between SoC variants. -@@ -146,6 +142,41 @@ static irqreturn_t sunxi_ir_irq(int irqn +@@ -146,6 +142,41 @@ static irqreturn_t sunxi_ir_irq(int irqno, void *dev_id) return IRQ_HANDLED; } @@ -73,7 +75,7 @@ Signed-off-by: Mauro Carvalho Chehab static int sunxi_ir_probe(struct platform_device *pdev) { int ret = 0; -@@ -242,9 +273,11 @@ static int sunxi_ir_probe(struct platfor +@@ -242,9 +273,11 @@ static int sunxi_ir_probe(struct platform_device *pdev) ir->rc->map_name = ir->map_name ?: RC_MAP_EMPTY; ir->rc->dev.parent = dev; ir->rc->allowed_protocols = RC_PROTO_BIT_ALL_IR_DECODER; @@ -87,7 +89,7 @@ Signed-off-by: Mauro Carvalho Chehab ir->rc->driver_name = SUNXI_IR_DEV; ret = rc_register_device(ir->rc); -@@ -272,8 +305,7 @@ static int sunxi_ir_probe(struct platfor +@@ -272,8 +305,7 @@ static int sunxi_ir_probe(struct platform_device *pdev) writel(REG_CTL_MD, ir->base+SUNXI_IR_CTL_REG); /* Set noise threshold and idle threshold */ diff --git a/projects/Allwinner/patches/linux/0003-ASoC-sun4i-i2s-Change-set_chan_cfg-params.patch b/projects/Allwinner/patches/linux/0003-ASoC-sun4i-i2s-Change-set_chan_cfg-params.patch index 5cb7c89a06..7a5c63d654 100644 --- a/projects/Allwinner/patches/linux/0003-ASoC-sun4i-i2s-Change-set_chan_cfg-params.patch +++ b/projects/Allwinner/patches/linux/0003-ASoC-sun4i-i2s-Change-set_chan_cfg-params.patch @@ -1,7 +1,7 @@ -From a8bdfe3893f9b226492dac4b4e0d37a27dbee201 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= Date: Fri, 30 Oct 2020 15:46:35 +0100 -Subject: [PATCH 03/44] ASoC: sun4i-i2s: Change set_chan_cfg() params +Subject: [PATCH] ASoC: sun4i-i2s: Change set_chan_cfg() params MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -30,6 +30,8 @@ Signed-off-by: Mark Brown sound/soc/sunxi/sun4i-i2s.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) +diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c +index a994b5cf87b3..4ff2068779fd 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -162,8 +162,15 @@ struct sun4i_i2s_quirks { @@ -50,7 +52,7 @@ Signed-off-by: Mark Brown int (*set_fmt)(const struct sun4i_i2s *, unsigned int); }; -@@ -399,10 +406,9 @@ static s8 sun8i_i2s_get_sr_wss(const str +@@ -399,10 +406,9 @@ static s8 sun8i_i2s_get_sr_wss(const struct sun4i_i2s *i2s, int width) } static int sun4i_i2s_set_chan_cfg(const struct sun4i_i2s *i2s, @@ -63,7 +65,7 @@ Signed-off-by: Mark Brown /* Map the channels for playback and capture */ regmap_write(i2s->regmap, SUN4I_I2S_TX_CHAN_MAP_REG, 0x76543210); regmap_write(i2s->regmap, SUN4I_I2S_RX_CHAN_MAP_REG, 0x00003210); -@@ -419,15 +425,11 @@ static int sun4i_i2s_set_chan_cfg(const +@@ -419,15 +425,11 @@ static int sun4i_i2s_set_chan_cfg(const struct sun4i_i2s *i2s, } static int sun8i_i2s_set_chan_cfg(const struct sun4i_i2s *i2s, @@ -81,7 +83,7 @@ Signed-off-by: Mark Brown /* Map the channels for playback and capture */ regmap_write(i2s->regmap, SUN8I_I2S_TX_CHAN_MAP_REG, 0x76543210); regmap_write(i2s->regmap, SUN8I_I2S_RX_CHAN_MAP_REG, 0x76543210); -@@ -450,13 +452,13 @@ static int sun8i_i2s_set_chan_cfg(const +@@ -450,13 +452,13 @@ static int sun8i_i2s_set_chan_cfg(const struct sun4i_i2s *i2s, switch (i2s->format & SND_SOC_DAIFMT_FORMAT_MASK) { case SND_SOC_DAIFMT_DSP_A: case SND_SOC_DAIFMT_DSP_B: @@ -97,7 +99,7 @@ Signed-off-by: Mark Brown break; default: -@@ -482,7 +484,9 @@ static int sun4i_i2s_hw_params(struct sn +@@ -482,7 +484,9 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream *substream, unsigned int word_size = params_width(params); unsigned int slot_width = params_physical_width(params); unsigned int channels = params_channels(params); @@ -107,7 +109,7 @@ Signed-off-by: Mark Brown int ret, sr, wss; u32 width; -@@ -492,7 +496,7 @@ static int sun4i_i2s_hw_params(struct sn +@@ -492,7 +496,7 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream *substream, if (i2s->slot_width) slot_width = i2s->slot_width; diff --git a/projects/Allwinner/patches/linux/0004-ASoC-sun4i-i2s-Add-support-for-H6-I2S.patch b/projects/Allwinner/patches/linux/0004-ASoC-sun4i-i2s-Add-support-for-H6-I2S.patch index a1c67052ce..ad29cf4be2 100644 --- a/projects/Allwinner/patches/linux/0004-ASoC-sun4i-i2s-Add-support-for-H6-I2S.patch +++ b/projects/Allwinner/patches/linux/0004-ASoC-sun4i-i2s-Add-support-for-H6-I2S.patch @@ -1,7 +1,7 @@ -From 8ff0df5dffe58a2d1595a6e59ccd5ce63d6bf0e5 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Fri, 30 Oct 2020 15:46:36 +0100 -Subject: [PATCH 04/44] ASoC: sun4i-i2s: Add support for H6 I2S +Subject: [PATCH] ASoC: sun4i-i2s: Add support for H6 I2S MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -20,6 +20,8 @@ Signed-off-by: Mark Brown sound/soc/sunxi/sun4i-i2s.c | 222 ++++++++++++++++++++++++++++++++++++ 1 file changed, 222 insertions(+) +diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c +index 4ff2068779fd..24b3137afbc2 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -124,6 +124,21 @@ @@ -44,7 +46,7 @@ Signed-off-by: Mark Brown struct sun4i_i2s; /** -@@ -476,6 +491,60 @@ static int sun8i_i2s_set_chan_cfg(const +@@ -476,6 +491,60 @@ static int sun8i_i2s_set_chan_cfg(const struct sun4i_i2s *i2s, return 0; } @@ -105,7 +107,7 @@ Signed-off-by: Mark Brown static int sun4i_i2s_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) -@@ -703,6 +772,108 @@ static int sun8i_i2s_set_soc_fmt(const s +@@ -703,6 +772,108 @@ static int sun8i_i2s_set_soc_fmt(const struct sun4i_i2s *i2s, return 0; } @@ -214,7 +216,7 @@ Signed-off-by: Mark Brown static int sun4i_i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) { struct sun4i_i2s *i2s = snd_soc_dai_get_drvdata(dai); -@@ -983,6 +1154,22 @@ static const struct reg_default sun8i_i2 +@@ -983,6 +1154,22 @@ static const struct reg_default sun8i_i2s_reg_defaults[] = { { SUN8I_I2S_RX_CHAN_MAP_REG, 0x00000000 }, }; @@ -237,7 +239,7 @@ Signed-off-by: Mark Brown static const struct regmap_config sun4i_i2s_regmap_config = { .reg_bits = 32, .reg_stride = 4, -@@ -1010,6 +1197,19 @@ static const struct regmap_config sun8i_ +@@ -1010,6 +1197,19 @@ static const struct regmap_config sun8i_i2s_regmap_config = { .volatile_reg = sun8i_i2s_volatile_reg, }; @@ -257,7 +259,7 @@ Signed-off-by: Mark Brown static int sun4i_i2s_runtime_resume(struct device *dev) { struct sun4i_i2s *i2s = dev_get_drvdata(dev); -@@ -1168,6 +1368,24 @@ static const struct sun4i_i2s_quirks sun +@@ -1168,6 +1368,24 @@ static const struct sun4i_i2s_quirks sun50i_a64_codec_i2s_quirks = { .set_fmt = sun4i_i2s_set_soc_fmt, }; @@ -282,7 +284,7 @@ Signed-off-by: Mark Brown static int sun4i_i2s_init_regmap_fields(struct device *dev, struct sun4i_i2s *i2s) { -@@ -1337,6 +1555,10 @@ static const struct of_device_id sun4i_i +@@ -1337,6 +1555,10 @@ static const struct of_device_id sun4i_i2s_match[] = { .compatible = "allwinner,sun50i-a64-codec-i2s", .data = &sun50i_a64_codec_i2s_quirks, }, diff --git a/projects/Allwinner/patches/linux/0005-ASoC-sun4i-i2s-Change-get_sr-and-get_wss-to-be-more-.patch b/projects/Allwinner/patches/linux/0005-ASoC-sun4i-i2s-Change-get_sr-and-get_wss-to-be-more-.patch index 731610a0f7..7a979a0db0 100644 --- a/projects/Allwinner/patches/linux/0005-ASoC-sun4i-i2s-Change-get_sr-and-get_wss-to-be-more-.patch +++ b/projects/Allwinner/patches/linux/0005-ASoC-sun4i-i2s-Change-get_sr-and-get_wss-to-be-more-.patch @@ -1,8 +1,8 @@ -From aec30a56043a890b75440bb8c9673a07166cf104 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= Date: Fri, 30 Oct 2020 15:46:37 +0100 -Subject: [PATCH 05/44] ASoC: sun4i-i2s: Change get_sr() and get_wss() to be - more explicit +Subject: [PATCH] ASoC: sun4i-i2s: Change get_sr() and get_wss() to be more + explicit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -24,9 +24,11 @@ Signed-off-by: Clément Péron Link: https://lore.kernel.org/r/20201030144648.397824-5-peron.clem@gmail.com Signed-off-by: Mark Brown --- - sound/soc/sunxi/sun4i-i2s.c | 75 +++++++++++++++++++++++-------------- - 1 file changed, 47 insertions(+), 28 deletions(-) + sound/soc/sunxi/sun4i-i2s.c | 69 +++++++++++++++++++++++-------------- + 1 file changed, 44 insertions(+), 25 deletions(-) +diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c +index 24b3137afbc2..6ee9c2995b4f 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -175,8 +175,8 @@ struct sun4i_i2s_quirks { @@ -40,7 +42,7 @@ Signed-off-by: Mark Brown /* * In the set_chan_cfg() function pointer: -@@ -387,37 +387,56 @@ static int sun4i_i2s_set_clk_rate(struct +@@ -387,37 +387,56 @@ static int sun4i_i2s_set_clk_rate(struct snd_soc_dai *dai, return 0; } @@ -118,7 +120,7 @@ Signed-off-by: Mark Brown } static int sun4i_i2s_set_chan_cfg(const struct sun4i_i2s *i2s, -@@ -582,11 +601,11 @@ static int sun4i_i2s_hw_params(struct sn +@@ -582,11 +601,11 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream *substream, } i2s->playback_dma_data.addr_width = width; diff --git a/projects/Allwinner/patches/linux/0006-ASoC-sun4i-i2s-Set-sign-extend-sample.patch b/projects/Allwinner/patches/linux/0006-ASoC-sun4i-i2s-Set-sign-extend-sample.patch index b4e6c89dec..b24e7fda5d 100644 --- a/projects/Allwinner/patches/linux/0006-ASoC-sun4i-i2s-Set-sign-extend-sample.patch +++ b/projects/Allwinner/patches/linux/0006-ASoC-sun4i-i2s-Set-sign-extend-sample.patch @@ -1,7 +1,7 @@ -From fe1ae019879d51633d8dcd705117c70b701b77e9 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Marcus Cooper Date: Fri, 30 Oct 2020 15:46:38 +0100 -Subject: [PATCH 06/44] ASoC: sun4i-i2s: Set sign extend sample +Subject: [PATCH] ASoC: sun4i-i2s: Set sign extend sample MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -30,6 +30,8 @@ Signed-off-by: Mark Brown sound/soc/sunxi/sun4i-i2s.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) +diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c +index 6ee9c2995b4f..46e4da18c27f 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -48,6 +48,9 @@ @@ -52,7 +54,7 @@ Signed-off-by: Mark Brown #define SUN8I_I2S_INT_STA_REG 0x0c #define SUN8I_I2S_FIFO_TX_REG 0x20 -@@ -686,6 +692,7 @@ static int sun4i_i2s_set_soc_fmt(const s +@@ -686,6 +692,7 @@ static int sun4i_i2s_set_soc_fmt(const struct sun4i_i2s *i2s, } regmap_update_bits(i2s->regmap, SUN4I_I2S_CTRL_REG, SUN4I_I2S_CTRL_MODE_MASK, val); @@ -60,7 +62,7 @@ Signed-off-by: Mark Brown return 0; } -@@ -788,6 +795,11 @@ static int sun8i_i2s_set_soc_fmt(const s +@@ -788,6 +795,11 @@ static int sun8i_i2s_set_soc_fmt(const struct sun4i_i2s *i2s, SUN8I_I2S_CTRL_BCLK_OUT | SUN8I_I2S_CTRL_LRCK_OUT, val); @@ -72,7 +74,7 @@ Signed-off-by: Mark Brown return 0; } -@@ -890,6 +902,11 @@ static int sun50i_h6_i2s_set_soc_fmt(con +@@ -890,6 +902,11 @@ static int sun50i_h6_i2s_set_soc_fmt(const struct sun4i_i2s *i2s, SUN8I_I2S_CTRL_BCLK_OUT | SUN8I_I2S_CTRL_LRCK_OUT, val); diff --git a/projects/Allwinner/patches/linux/0007-ASoC-sun4i-i2s-Add-20-and-24-bit-support.patch b/projects/Allwinner/patches/linux/0007-ASoC-sun4i-i2s-Add-20-and-24-bit-support.patch index 0205308b31..3a99f88a0f 100644 --- a/projects/Allwinner/patches/linux/0007-ASoC-sun4i-i2s-Add-20-and-24-bit-support.patch +++ b/projects/Allwinner/patches/linux/0007-ASoC-sun4i-i2s-Add-20-and-24-bit-support.patch @@ -1,7 +1,7 @@ -From 9c2121fe514f12c830bceea7b33872fa67af3e97 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Marcus Cooper Date: Fri, 30 Oct 2020 15:46:39 +0100 -Subject: [PATCH 07/44] ASoC: sun4i-i2s: Add 20 and 24 bit support +Subject: [PATCH] ASoC: sun4i-i2s: Add 20 and 24 bit support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -19,9 +19,11 @@ Signed-off-by: Mark Brown sound/soc/sunxi/sun4i-i2s.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) +diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c +index 46e4da18c27f..786731191d90 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c -@@ -600,6 +600,9 @@ static int sun4i_i2s_hw_params(struct sn +@@ -600,6 +600,9 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream *substream, case 16: width = DMA_SLAVE_BUSWIDTH_2_BYTES; break; @@ -31,7 +33,7 @@ Signed-off-by: Mark Brown default: dev_err(dai->dev, "Unsupported physical sample width: %d\n", params_physical_width(params)); -@@ -1081,6 +1084,10 @@ static int sun4i_i2s_dai_probe(struct sn +@@ -1081,6 +1084,10 @@ static int sun4i_i2s_dai_probe(struct snd_soc_dai *dai) return 0; } @@ -42,7 +44,7 @@ Signed-off-by: Mark Brown static struct snd_soc_dai_driver sun4i_i2s_dai = { .probe = sun4i_i2s_dai_probe, .capture = { -@@ -1088,14 +1095,14 @@ static struct snd_soc_dai_driver sun4i_i +@@ -1088,14 +1095,14 @@ static struct snd_soc_dai_driver sun4i_i2s_dai = { .channels_min = 1, .channels_max = 8, .rates = SNDRV_PCM_RATE_8000_192000, diff --git a/projects/Allwinner/patches/linux/0008-ASoC-sun4i-i2s-Fix-sun8i-volatile-regs.patch b/projects/Allwinner/patches/linux/0008-ASoC-sun4i-i2s-Fix-sun8i-volatile-regs.patch index 8c4dd63320..daa09b9c7a 100644 --- a/projects/Allwinner/patches/linux/0008-ASoC-sun4i-i2s-Fix-sun8i-volatile-regs.patch +++ b/projects/Allwinner/patches/linux/0008-ASoC-sun4i-i2s-Fix-sun8i-volatile-regs.patch @@ -1,7 +1,7 @@ -From 9f0cbed8e957216d58a2dd5c9c8e795ec39004ad Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= Date: Fri, 30 Oct 2020 15:46:40 +0100 -Subject: [PATCH 08/44] ASoC: sun4i-i2s: Fix sun8i volatile regs +Subject: [PATCH] ASoC: sun4i-i2s: Fix sun8i volatile regs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -21,9 +21,11 @@ Signed-off-by: Mark Brown sound/soc/sunxi/sun4i-i2s.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) +diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c +index 786731191d90..003610c0badf 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c -@@ -1162,12 +1162,19 @@ static bool sun8i_i2s_rd_reg(struct devi +@@ -1162,12 +1162,19 @@ static bool sun8i_i2s_rd_reg(struct device *dev, unsigned int reg) static bool sun8i_i2s_volatile_reg(struct device *dev, unsigned int reg) { diff --git a/projects/Allwinner/patches/linux/0009-ASoC-sun4i-i2s-Fix-setting-of-FIFO-modes.patch b/projects/Allwinner/patches/linux/0009-ASoC-sun4i-i2s-Fix-setting-of-FIFO-modes.patch index 14cc889b76..75e8f4016c 100644 --- a/projects/Allwinner/patches/linux/0009-ASoC-sun4i-i2s-Fix-setting-of-FIFO-modes.patch +++ b/projects/Allwinner/patches/linux/0009-ASoC-sun4i-i2s-Fix-setting-of-FIFO-modes.patch @@ -1,7 +1,7 @@ -From de8ff7b3ac4736f5aa0c55968170bd449e46c88f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Fri, 30 Oct 2020 15:46:41 +0100 -Subject: [PATCH 09/44] ASoC: sun4i-i2s: Fix setting of FIFO modes +Subject: [PATCH] ASoC: sun4i-i2s: Fix setting of FIFO modes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -21,9 +21,11 @@ Signed-off-by: Mark Brown sound/soc/sunxi/sun4i-i2s.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) +diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c +index 003610c0badf..4f5cd850752d 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c -@@ -596,6 +596,13 @@ static int sun4i_i2s_hw_params(struct sn +@@ -596,6 +596,13 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream *substream, return ret; } @@ -37,7 +39,7 @@ Signed-off-by: Mark Brown switch (params_physical_width(params)) { case 16: width = DMA_SLAVE_BUSWIDTH_2_BYTES; -@@ -924,13 +931,6 @@ static int sun4i_i2s_set_fmt(struct snd_ +@@ -924,13 +931,6 @@ static int sun4i_i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) return ret; } diff --git a/projects/Allwinner/patches/linux/0010-ASoC-sun4i-i2s-fix-coding-style-for-callback-definit.patch b/projects/Allwinner/patches/linux/0010-ASoC-sun4i-i2s-fix-coding-style-for-callback-definit.patch index 15899dd1e6..48bdcf1129 100644 --- a/projects/Allwinner/patches/linux/0010-ASoC-sun4i-i2s-fix-coding-style-for-callback-definit.patch +++ b/projects/Allwinner/patches/linux/0010-ASoC-sun4i-i2s-fix-coding-style-for-callback-definit.patch @@ -1,8 +1,7 @@ -From 82b0eb24d554180fdea8a254553dcce22085cc74 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= Date: Fri, 30 Oct 2020 15:46:42 +0100 -Subject: [PATCH 10/44] ASoC: sun4i-i2s: fix coding-style for callback - definition +Subject: [PATCH] ASoC: sun4i-i2s: fix coding-style for callback definition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -22,6 +21,8 @@ Signed-off-by: Mark Brown sound/soc/sunxi/sun4i-i2s.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c +index 4f5cd850752d..4b8ca5be0a29 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -180,7 +180,7 @@ struct sun4i_i2s_quirks { diff --git a/projects/Allwinner/patches/linux/0011-ARM-dts-sun8i-r40-Add-deinterlace-node.patch b/projects/Allwinner/patches/linux/0011-ARM-dts-sun8i-r40-Add-deinterlace-node.patch index ee4b752ba2..4dea99e0bd 100644 --- a/projects/Allwinner/patches/linux/0011-ARM-dts-sun8i-r40-Add-deinterlace-node.patch +++ b/projects/Allwinner/patches/linux/0011-ARM-dts-sun8i-r40-Add-deinterlace-node.patch @@ -1,7 +1,7 @@ -From 51ebc019df15b46d109bafe7068ebb6fe0b266b5 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Wed, 6 Jan 2021 19:19:01 +0100 -Subject: [PATCH 11/44] ARM: dts: sun8i: r40: Add deinterlace node +Subject: [PATCH] ARM: dts: sun8i: r40: Add deinterlace node R40 contains deinterlace core compatible to that in H3. One peculiarity is that RAM gate is shared with CSI1. User manual states it's separate @@ -15,9 +15,11 @@ Link: https://lore.kernel.org/r/20210106181901.1324075-3-jernej.skrabec@siol.net arch/arm/boot/dts/sun8i-r40.dtsi | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) +diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi +index 7907569e7b5c..d5ad3b9efd12 100644 --- a/arch/arm/boot/dts/sun8i-r40.dtsi +++ b/arch/arm/boot/dts/sun8i-r40.dtsi -@@ -190,6 +190,25 @@ +@@ -190,6 +190,25 @@ mixer1_out_tcon_top: endpoint { }; }; diff --git a/projects/Allwinner/patches/linux/0012-arm64-dts-allwinner-h5-Add-deinterlace-node.patch b/projects/Allwinner/patches/linux/0012-arm64-dts-allwinner-h5-Add-deinterlace-node.patch index 5bcbc7e9c5..4e8a15ce61 100644 --- a/projects/Allwinner/patches/linux/0012-arm64-dts-allwinner-h5-Add-deinterlace-node.patch +++ b/projects/Allwinner/patches/linux/0012-arm64-dts-allwinner-h5-Add-deinterlace-node.patch @@ -1,7 +1,7 @@ -From 7166a5b6ab1f3d9ba0f5236b738525e828138c8e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Wed, 6 Jan 2021 19:25:23 +0100 -Subject: [PATCH 12/44] arm64: dts: allwinner: h5: Add deinterlace node +Subject: [PATCH] arm64: dts: allwinner: h5: Add deinterlace node Deinterlace core is completely compatible to H3. @@ -14,9 +14,11 @@ Link: https://lore.kernel.org/r/20210106182523.1325796-1-jernej.skrabec@siol.net arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi | 13 +++++++++++++ 1 file changed, 13 insertions(+) +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi +index 10489e508695..578a63dedf46 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi -@@ -121,6 +121,19 @@ +@@ -121,6 +121,19 @@ crypto: crypto@1c15000 { resets = <&ccu RST_BUS_CE>; }; diff --git a/projects/Allwinner/patches/linux/0013-drm-sun4i-csc-Rework-DE3-CSC-macros.patch b/projects/Allwinner/patches/linux/0013-drm-sun4i-csc-Rework-DE3-CSC-macros.patch index f8fdf0b2ff..dab92d2702 100644 --- a/projects/Allwinner/patches/linux/0013-drm-sun4i-csc-Rework-DE3-CSC-macros.patch +++ b/projects/Allwinner/patches/linux/0013-drm-sun4i-csc-Rework-DE3-CSC-macros.patch @@ -1,7 +1,7 @@ -From dcd9635dc6027b04a64e19ebb3dc15aaae082400 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 18 Feb 2020 19:24:29 +0100 -Subject: [PATCH 13/44] drm/sun4i: csc: Rework DE3 CSC macros +Subject: [PATCH] drm/sun4i: csc: Rework DE3 CSC macros Rework DE3 CSC macros to take just one coordinate instead of two. This will make its usage easier in subsequent commit. @@ -12,9 +12,11 @@ Signed-off-by: Jernej Skrabec drivers/gpu/drm/sun4i/sun8i_mixer.h | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) +diff --git a/drivers/gpu/drm/sun4i/sun8i_csc.c b/drivers/gpu/drm/sun4i/sun8i_csc.c +index 781955dd4995..5c6ad643dae2 100644 --- a/drivers/gpu/drm/sun4i/sun8i_csc.c +++ b/drivers/gpu/drm/sun4i/sun8i_csc.c -@@ -194,7 +194,7 @@ static void sun8i_de3_ccsc_set_coefficie +@@ -194,7 +194,7 @@ static void sun8i_de3_ccsc_set_coefficients(struct regmap *map, int layer, return; } @@ -23,6 +25,8 @@ Signed-off-by: Jernej Skrabec regmap_bulk_write(map, base_reg, table, 12); } +diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.h b/drivers/gpu/drm/sun4i/sun8i_mixer.h +index 7576b523fdbb..ea4fa6fe567a 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.h +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.h @@ -50,10 +50,8 @@ diff --git a/projects/Allwinner/patches/linux/0014-drm-sun4i-de2-de3-Remove-redundant-CSC-matrices.patch b/projects/Allwinner/patches/linux/0014-drm-sun4i-de2-de3-Remove-redundant-CSC-matrices.patch index de6c92f2bf..bd390a273a 100644 --- a/projects/Allwinner/patches/linux/0014-drm-sun4i-de2-de3-Remove-redundant-CSC-matrices.patch +++ b/projects/Allwinner/patches/linux/0014-drm-sun4i-de2-de3-Remove-redundant-CSC-matrices.patch @@ -1,7 +1,7 @@ -From acdfa534d3fe6759f43c1fe0bcd2fd40f31d3797 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 18 Feb 2020 19:44:33 +0100 -Subject: [PATCH 14/44] drm/sun4i: de2/de3: Remove redundant CSC matrices +Subject: [PATCH] drm/sun4i: de2/de3: Remove redundant CSC matrices YUV to RGB matrices are almost identical to YVU to RGB matrices. They only have second and third column reversed. Do that reversion in code in @@ -12,6 +12,8 @@ Signed-off-by: Jernej Skrabec drivers/gpu/drm/sun4i/sun8i_csc.c | 99 +++++++++++-------------------- 1 file changed, 34 insertions(+), 65 deletions(-) +diff --git a/drivers/gpu/drm/sun4i/sun8i_csc.c b/drivers/gpu/drm/sun4i/sun8i_csc.c +index 5c6ad643dae2..1d10714e417e 100644 --- a/drivers/gpu/drm/sun4i/sun8i_csc.c +++ b/drivers/gpu/drm/sun4i/sun8i_csc.c @@ -46,33 +46,6 @@ static const u32 yuv2rgb[2][2][12] = { @@ -48,7 +50,7 @@ Signed-off-by: Jernej Skrabec /* * DE3 has a bit different CSC units. Factors are in two's complement format. * First three factors in a row are multiplication factors which have 17 bits -@@ -123,33 +96,6 @@ static const u32 yuv2rgb_de3[2][2][12] = +@@ -123,33 +96,6 @@ static const u32 yuv2rgb_de3[2][2][12] = { }, }; @@ -82,7 +84,7 @@ Signed-off-by: Jernej Skrabec static void sun8i_csc_set_coefficients(struct regmap *map, u32 base, enum sun8i_csc_mode mode, enum drm_color_encoding encoding, -@@ -157,21 +103,30 @@ static void sun8i_csc_set_coefficients(s +@@ -157,21 +103,30 @@ static void sun8i_csc_set_coefficients(struct regmap *map, u32 base, { const u32 *table; u32 base_reg; @@ -118,7 +120,7 @@ Signed-off-by: Jernej Skrabec } static void sun8i_de3_ccsc_set_coefficients(struct regmap *map, int layer, -@@ -180,22 +135,36 @@ static void sun8i_de3_ccsc_set_coefficie +@@ -180,22 +135,36 @@ static void sun8i_de3_ccsc_set_coefficients(struct regmap *map, int layer, enum drm_color_range range) { const u32 *table; diff --git a/projects/Allwinner/patches/linux/0015-drm-sun4i-Add-support-for-BT2020-to-DE3.patch b/projects/Allwinner/patches/linux/0015-drm-sun4i-Add-support-for-BT2020-to-DE3.patch index f94f13d1b8..874e1793cf 100644 --- a/projects/Allwinner/patches/linux/0015-drm-sun4i-Add-support-for-BT2020-to-DE3.patch +++ b/projects/Allwinner/patches/linux/0015-drm-sun4i-Add-support-for-BT2020-to-DE3.patch @@ -1,7 +1,7 @@ -From 2c9a7a5a71d5ed6db9ee28a5ccd11f0db45f574d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Wed, 15 Apr 2020 10:24:05 +0200 -Subject: [PATCH 15/44] drm/sun4i: Add support for BT2020 to DE3 +Subject: [PATCH] drm/sun4i: Add support for BT2020 to DE3 DE3 supports 10-bit formats, so it's only naturally to also support BT2020 encoding. @@ -14,6 +14,8 @@ Signed-off-by: Jernej Skrabec drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) +diff --git a/drivers/gpu/drm/sun4i/sun8i_csc.c b/drivers/gpu/drm/sun4i/sun8i_csc.c +index 1d10714e417e..9bd62de0c288 100644 --- a/drivers/gpu/drm/sun4i/sun8i_csc.c +++ b/drivers/gpu/drm/sun4i/sun8i_csc.c @@ -69,7 +69,7 @@ static const u32 yuv2rgb[2][2][12] = { @@ -25,7 +27,7 @@ Signed-off-by: Jernej Skrabec [DRM_COLOR_YCBCR_LIMITED_RANGE] = { [DRM_COLOR_YCBCR_BT601] = { 0x0002542A, 0x00000000, 0x0003312A, 0xFFC00000, -@@ -80,6 +80,11 @@ static const u32 yuv2rgb_de3[2][2][12] = +@@ -80,6 +80,11 @@ static const u32 yuv2rgb_de3[2][2][12] = { 0x0002542A, 0x00000000, 0x000395E2, 0xFFC00000, 0x0002542A, 0xFFFF92D2, 0xFFFEEF27, 0xFE000000, 0x0002542A, 0x0004398C, 0x00000000, 0xFE000000, @@ -37,7 +39,7 @@ Signed-off-by: Jernej Skrabec } }, [DRM_COLOR_YCBCR_FULL_RANGE] = { -@@ -92,6 +97,11 @@ static const u32 yuv2rgb_de3[2][2][12] = +@@ -92,6 +97,11 @@ static const u32 yuv2rgb_de3[2][2][12] = { 0x00020000, 0x00000000, 0x0003264C, 0x00000000, 0x00020000, 0xFFFFA018, 0xFFFF1053, 0xFE000000, 0x00020000, 0x0003B611, 0x00000000, 0xFE000000, @@ -49,9 +51,11 @@ Signed-off-by: Jernej Skrabec } }, }; +diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c +index 76393fc976fe..8cc294a9969d 100644 --- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c +++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c -@@ -543,6 +543,8 @@ struct sun8i_vi_layer *sun8i_vi_layer_in +@@ -543,6 +543,8 @@ struct sun8i_vi_layer *sun8i_vi_layer_init_one(struct drm_device *drm, supported_encodings = BIT(DRM_COLOR_YCBCR_BT601) | BIT(DRM_COLOR_YCBCR_BT709); diff --git a/projects/Allwinner/patches/linux/0016-mmc-sunxi-mmc-Ensure-host-is-suspended-during-system.patch b/projects/Allwinner/patches/linux/0016-mmc-sunxi-mmc-Ensure-host-is-suspended-during-system.patch index 1a4b75baa0..5871646d5b 100644 --- a/projects/Allwinner/patches/linux/0016-mmc-sunxi-mmc-Ensure-host-is-suspended-during-system.patch +++ b/projects/Allwinner/patches/linux/0016-mmc-sunxi-mmc-Ensure-host-is-suspended-during-system.patch @@ -1,8 +1,7 @@ -From e689f3536e632e26166e66eac88728c6653a18b6 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Tue, 12 Jan 2021 23:24:21 -0600 -Subject: [PATCH 16/44] mmc: sunxi-mmc: Ensure host is suspended during system - sleep +Subject: [PATCH] mmc: sunxi-mmc: Ensure host is suspended during system sleep If the device suspend process begins before the mmc host's autosuspend timeout, the host will continue running during system sleep. Avoid @@ -14,9 +13,11 @@ Acked-by: Maxime Ripard drivers/mmc/host/sunxi-mmc.c | 2 ++ 1 file changed, 2 insertions(+) +diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c +index fc62773602ec..cebb15cf81f2 100644 --- a/drivers/mmc/host/sunxi-mmc.c +++ b/drivers/mmc/host/sunxi-mmc.c -@@ -1506,6 +1506,8 @@ static int sunxi_mmc_runtime_suspend(str +@@ -1506,6 +1506,8 @@ static int sunxi_mmc_runtime_suspend(struct device *dev) #endif static const struct dev_pm_ops sunxi_mmc_pm_ops = { diff --git a/projects/Allwinner/patches/linux/0017-arm64-dts-allwinner-h6-Add-I2S1-node.patch b/projects/Allwinner/patches/linux/0017-arm64-dts-allwinner-h6-Add-I2S1-node.patch index 58c540517a..950ceea7be 100644 --- a/projects/Allwinner/patches/linux/0017-arm64-dts-allwinner-h6-Add-I2S1-node.patch +++ b/projects/Allwinner/patches/linux/0017-arm64-dts-allwinner-h6-Add-I2S1-node.patch @@ -1,7 +1,7 @@ -From e019a54d084020e6acc2869da341b376700bfe4c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Fri, 30 Oct 2020 15:46:44 +0100 -Subject: [PATCH 17/44] arm64: dts: allwinner: h6: Add I2S1 node +Subject: [PATCH] arm64: dts: allwinner: h6: Add I2S1 node MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -18,9 +18,11 @@ Link: https://lore.kernel.org/r/20201030144648.397824-12-peron.clem@gmail.com arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 13 +++++++++++++ 1 file changed, 13 insertions(+) +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +index 4592fb7a6161..15e794ebf377 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi -@@ -609,6 +609,19 @@ +@@ -612,6 +612,19 @@ mdio: mdio { }; }; diff --git a/projects/Allwinner/patches/linux/0018-arm64-dts-allwinner-a64-Add-I2S2-node.patch b/projects/Allwinner/patches/linux/0018-arm64-dts-allwinner-a64-Add-I2S2-node.patch index e47e95c9fb..1454d937c2 100644 --- a/projects/Allwinner/patches/linux/0018-arm64-dts-allwinner-a64-Add-I2S2-node.patch +++ b/projects/Allwinner/patches/linux/0018-arm64-dts-allwinner-a64-Add-I2S2-node.patch @@ -1,7 +1,7 @@ -From 0175a3d5680924d3d64ee8181b50c8b06ee715d1 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Marcus Cooper Date: Fri, 30 Oct 2020 15:46:45 +0100 -Subject: [PATCH 18/44] arm64: dts: allwinner: a64: Add I2S2 node +Subject: [PATCH] arm64: dts: allwinner: a64: Add I2S2 node MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -18,9 +18,11 @@ Link: https://lore.kernel.org/r/20201030144648.397824-13-peron.clem@gmail.com arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 14 ++++++++++++++ 1 file changed, 14 insertions(+) +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +index 7a41015a9ce5..57786fc120c3 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -@@ -846,6 +846,20 @@ +@@ -850,6 +850,20 @@ i2s1: i2s@1c22400 { status = "disabled"; }; diff --git a/projects/Allwinner/patches/linux/0019-arm-dts-sunxi-h3-h5-Add-I2S2-node.patch b/projects/Allwinner/patches/linux/0019-arm-dts-sunxi-h3-h5-Add-I2S2-node.patch index dfd107a942..bf61716d8b 100644 --- a/projects/Allwinner/patches/linux/0019-arm-dts-sunxi-h3-h5-Add-I2S2-node.patch +++ b/projects/Allwinner/patches/linux/0019-arm-dts-sunxi-h3-h5-Add-I2S2-node.patch @@ -1,7 +1,7 @@ -From fd67e65487b4e5e2a93df2868043302a99f93098 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Marcus Cooper Date: Fri, 30 Oct 2020 15:46:48 +0100 -Subject: [PATCH 19/44] arm: dts: sunxi: h3/h5: Add I2S2 node +Subject: [PATCH] arm: dts: sunxi: h3/h5: Add I2S2 node MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -18,9 +18,11 @@ Link: https://lore.kernel.org/r/20201030144648.397824-16-peron.clem@gmail.com arch/arm/boot/dts/sunxi-h3-h5.dtsi | 13 +++++++++++++ 1 file changed, 13 insertions(+) +diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi +index 22d533d18992..9be13378d4df 100644 --- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi +++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi -@@ -662,6 +662,19 @@ +@@ -662,6 +662,19 @@ i2s1: i2s@1c22400 { status = "disabled"; }; diff --git a/projects/Allwinner/patches/linux/0020-arm64-dts-allwinner-h6-PineH64-model-B-Add-wifi.patch b/projects/Allwinner/patches/linux/0020-arm64-dts-allwinner-h6-PineH64-model-B-Add-wifi.patch index 12fd8d08a8..3f8a20d09f 100644 --- a/projects/Allwinner/patches/linux/0020-arm64-dts-allwinner-h6-PineH64-model-B-Add-wifi.patch +++ b/projects/Allwinner/patches/linux/0020-arm64-dts-allwinner-h6-PineH64-model-B-Add-wifi.patch @@ -1,7 +1,7 @@ -From 3c970c9e87e403b190407dec5c6e4745aef78e6a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Fri, 30 Oct 2020 18:25:30 +0100 -Subject: [PATCH 20/44] arm64: dts: allwinner: h6: PineH64 model B: Add wifi +Subject: [PATCH] arm64: dts: allwinner: h6: PineH64 model B: Add wifi PineH64 model B contains RTL8723CS wifi+bt combo module. @@ -17,9 +17,11 @@ Link: https://lore.kernel.org/r/20201030172530.1096394-1-jernej.skrabec@siol.net .../dts/allwinner/sun50i-h6-pine-h64-model-b.dts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts +index f4c8966a6497..7fea1e4e2d49 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts -@@ -10,6 +10,12 @@ +@@ -10,6 +10,12 @@ / { compatible = "pine64,pine-h64-model-b", "allwinner,sun50i-h6"; /delete-node/ reg_gmac_3v3; @@ -32,7 +34,7 @@ Link: https://lore.kernel.org/r/20201030172530.1096394-1-jernej.skrabec@siol.net }; &hdmi_connector { -@@ -19,3 +25,12 @@ +@@ -19,3 +25,12 @@ &hdmi_connector { &emac { phy-supply = <®_aldo2>; }; diff --git a/projects/Allwinner/patches/linux/0022-ASoC-hdmi-codec-fix-channel-allocation.patch b/projects/Allwinner/patches/linux/0021-ASoC-hdmi-codec-fix-channel-allocation.patch similarity index 93% rename from projects/Allwinner/patches/linux/0022-ASoC-hdmi-codec-fix-channel-allocation.patch rename to projects/Allwinner/patches/linux/0021-ASoC-hdmi-codec-fix-channel-allocation.patch index b5a73b1af7..25f036d1e0 100644 --- a/projects/Allwinner/patches/linux/0022-ASoC-hdmi-codec-fix-channel-allocation.patch +++ b/projects/Allwinner/patches/linux/0021-ASoC-hdmi-codec-fix-channel-allocation.patch @@ -1,15 +1,17 @@ -From 91b69779e0875e58d8973b2938a1cc4b7a1c455b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonas Karlman Date: Sun, 25 Mar 2018 22:17:06 +0200 -Subject: [PATCH 22/44] ASoC: hdmi-codec: fix channel allocation +Subject: [PATCH] ASoC: hdmi-codec: fix channel allocation --- sound/soc/codecs/hdmi-codec.c | 113 ++++++++++++++++------------------ 1 file changed, 52 insertions(+), 61 deletions(-) +diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c +index 403d4c6a49a8..7505c3eee4c1 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c -@@ -195,78 +195,69 @@ static const struct snd_pcm_chmap_elem h +@@ -195,78 +195,69 @@ static const struct snd_pcm_chmap_elem hdmi_codec_8ch_chmaps[] = { */ static const struct hdmi_codec_cea_spk_alloc hdmi_codec_channel_alloc[] = { { .ca_id = 0x00, .n_ch = 2, diff --git a/projects/Allwinner/patches/linux/0023-media-uapi-hevc-Add-scaling-matrix-control.patch b/projects/Allwinner/patches/linux/0022-media-uapi-hevc-Add-scaling-matrix-control.patch similarity index 80% rename from projects/Allwinner/patches/linux/0023-media-uapi-hevc-Add-scaling-matrix-control.patch rename to projects/Allwinner/patches/linux/0022-media-uapi-hevc-Add-scaling-matrix-control.patch index 8add1ecf3a..5795e9951c 100644 --- a/projects/Allwinner/patches/linux/0023-media-uapi-hevc-Add-scaling-matrix-control.patch +++ b/projects/Allwinner/patches/linux/0022-media-uapi-hevc-Add-scaling-matrix-control.patch @@ -1,7 +1,7 @@ -From 82a8ceccbaf9aa3d8cbc56d10e3905eec0d4ffb4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sat, 26 Oct 2019 13:55:15 +0200 -Subject: [PATCH 23/44] media: uapi: hevc: Add scaling matrix control +Subject: [PATCH] media: uapi: hevc: Add scaling matrix control HEVC has a scaling matrix concept. Add support for it. @@ -11,6 +11,8 @@ Signed-off-by: Jernej Skrabec include/media/hevc-ctrls.h | 11 +++++++++++ 2 files changed, 21 insertions(+) +diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c +index 41f8410d08d6..1b981066f94c 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -1021,6 +1021,7 @@ const char *v4l2_ctrl_get_name(u32 id) @@ -21,7 +23,7 @@ Signed-off-by: Jernej Skrabec case V4L2_CID_MPEG_VIDEO_HEVC_DECODE_MODE: return "HEVC Decode Mode"; case V4L2_CID_MPEG_VIDEO_HEVC_START_CODE: return "HEVC Start Code"; -@@ -1461,6 +1462,9 @@ void v4l2_ctrl_fill(u32 id, const char * +@@ -1461,6 +1462,9 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, case V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS: *type = V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS; break; @@ -31,7 +33,7 @@ Signed-off-by: Jernej Skrabec case V4L2_CID_UNIT_CELL_SIZE: *type = V4L2_CTRL_TYPE_AREA; *flags |= V4L2_CTRL_FLAG_READ_ONLY; -@@ -1934,6 +1938,9 @@ static int std_validate_compound(const s +@@ -1934,6 +1938,9 @@ static int std_validate_compound(const struct v4l2_ctrl *ctrl, u32 idx, zero_padding(*p_hevc_slice_params); break; @@ -41,7 +43,7 @@ Signed-off-by: Jernej Skrabec case V4L2_CTRL_TYPE_AREA: area = p; if (!area->width || !area->height) -@@ -2626,6 +2633,9 @@ static struct v4l2_ctrl *v4l2_ctrl_new(s +@@ -2644,6 +2651,9 @@ static struct v4l2_ctrl *v4l2_ctrl_new(struct v4l2_ctrl_handler *hdl, case V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS: elem_size = sizeof(struct v4l2_ctrl_hevc_slice_params); break; @@ -51,6 +53,8 @@ Signed-off-by: Jernej Skrabec case V4L2_CTRL_TYPE_AREA: elem_size = sizeof(struct v4l2_area); break; +diff --git a/include/media/hevc-ctrls.h b/include/media/hevc-ctrls.h +index a3b650ab00f6..3cf7da003cd9 100644 --- a/include/media/hevc-ctrls.h +++ b/include/media/hevc-ctrls.h @@ -19,6 +19,7 @@ @@ -69,7 +73,7 @@ Signed-off-by: Jernej Skrabec enum v4l2_mpeg_video_hevc_decode_mode { V4L2_MPEG_VIDEO_HEVC_DECODE_MODE_SLICE_BASED, -@@ -209,4 +211,13 @@ struct v4l2_ctrl_hevc_slice_params { +@@ -210,4 +212,13 @@ struct v4l2_ctrl_hevc_slice_params { __u64 flags; }; diff --git a/projects/Allwinner/patches/linux/0024-media-cedrus-hevc-Add-support-for-scaling-matrix.patch b/projects/Allwinner/patches/linux/0023-media-cedrus-hevc-Add-support-for-scaling-matrix.patch similarity index 81% rename from projects/Allwinner/patches/linux/0024-media-cedrus-hevc-Add-support-for-scaling-matrix.patch rename to projects/Allwinner/patches/linux/0023-media-cedrus-hevc-Add-support-for-scaling-matrix.patch index ddf6ff9f6b..7a61ebcae4 100644 --- a/projects/Allwinner/patches/linux/0024-media-cedrus-hevc-Add-support-for-scaling-matrix.patch +++ b/projects/Allwinner/patches/linux/0023-media-cedrus-hevc-Add-support-for-scaling-matrix.patch @@ -1,7 +1,7 @@ -From b4b79b4eeacb63f0a72c866526e4a2021a201090 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sat, 26 Oct 2019 13:58:49 +0200 -Subject: [PATCH 24/44] media: cedrus: hevc: Add support for scaling matrix +Subject: [PATCH] media: cedrus: hevc: Add support for scaling matrix HEVC frames may use scaling list feature. Add support for it. @@ -14,22 +14,26 @@ Signed-off-by: Jernej Skrabec .../staging/media/sunxi/cedrus/cedrus_regs.h | 2 + 5 files changed, 81 insertions(+), 1 deletion(-) +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c +index 97000f0e0011..e1379cceea10 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus.c -@@ -126,6 +126,13 @@ static const struct cedrus_control cedru +@@ -143,6 +143,13 @@ static const struct cedrus_control cedrus_controls[] = { + .codec = CEDRUS_CODEC_H265, + .required = true, }, - { - .cfg = { ++ { ++ .cfg = { + .id = V4L2_CID_MPEG_VIDEO_HEVC_SCALING_MATRIX, + }, + .codec = CEDRUS_CODEC_H265, + .required = true, + }, -+ { -+ .cfg = { + { + .cfg = { .id = V4L2_CID_MPEG_VIDEO_HEVC_DECODE_MODE, - .max = V4L2_MPEG_VIDEO_HEVC_DECODE_MODE_SLICE_BASED, - .def = V4L2_MPEG_VIDEO_HEVC_DECODE_MODE_SLICE_BASED, +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.h b/drivers/staging/media/sunxi/cedrus/cedrus.h +index 93c843ae14bb..c5202cbb1db6 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.h +++ b/drivers/staging/media/sunxi/cedrus/cedrus.h @@ -74,6 +74,7 @@ struct cedrus_h265_run { @@ -40,6 +44,8 @@ Signed-off-by: Jernej Skrabec }; struct cedrus_run { +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_dec.c b/drivers/staging/media/sunxi/cedrus/cedrus_dec.c +index 6385026d1b6b..81050cde9ed7 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_dec.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_dec.c @@ -68,6 +68,8 @@ void cedrus_device_run(void *priv) @@ -51,9 +57,11 @@ Signed-off-by: Jernej Skrabec break; default: +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h265.c b/drivers/staging/media/sunxi/cedrus/cedrus_h265.c +index 10744fab7cea..71a08b11eebf 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_h265.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_h265.c -@@ -238,6 +238,69 @@ static void cedrus_h265_skip_bits(struct +@@ -238,6 +238,69 @@ static void cedrus_h265_skip_bits(struct cedrus_dev *dev, int num) } } @@ -123,7 +131,7 @@ Signed-off-by: Jernej Skrabec static void cedrus_h265_setup(struct cedrus_ctx *ctx, struct cedrus_run *run) { -@@ -519,7 +582,12 @@ static void cedrus_h265_setup(struct ced +@@ -519,7 +582,12 @@ static void cedrus_h265_setup(struct cedrus_ctx *ctx, /* Scaling list. */ @@ -137,9 +145,11 @@ Signed-off-by: Jernej Skrabec cedrus_write(dev, VE_DEC_H265_SCALING_LIST_CTRL0, reg); /* Neightbor information address. */ +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_regs.h b/drivers/staging/media/sunxi/cedrus/cedrus_regs.h +index 426387cf16ac..a763647133b9 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_regs.h +++ b/drivers/staging/media/sunxi/cedrus/cedrus_regs.h -@@ -493,6 +493,8 @@ +@@ -494,6 +494,8 @@ #define VE_DEC_H265_ENTRY_POINT_OFFSET_ADDR (VE_ENGINE_DEC_H265 + 0x64) #define VE_DEC_H265_TILE_START_CTB (VE_ENGINE_DEC_H265 + 0x68) #define VE_DEC_H265_TILE_END_CTB (VE_ENGINE_DEC_H265 + 0x6c) diff --git a/projects/Allwinner/patches/linux/0025-media-uapi-hevc-Add-segment-address-field.patch b/projects/Allwinner/patches/linux/0024-media-uapi-hevc-Add-segment-address-field.patch similarity index 73% rename from projects/Allwinner/patches/linux/0025-media-uapi-hevc-Add-segment-address-field.patch rename to projects/Allwinner/patches/linux/0024-media-uapi-hevc-Add-segment-address-field.patch index d2632df423..5ac6d8b651 100644 --- a/projects/Allwinner/patches/linux/0025-media-uapi-hevc-Add-segment-address-field.patch +++ b/projects/Allwinner/patches/linux/0024-media-uapi-hevc-Add-segment-address-field.patch @@ -1,7 +1,7 @@ -From e61cf76fca5984dd9edcb0daf6c5cb5278f32e05 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sat, 26 Oct 2019 15:42:28 +0200 -Subject: [PATCH 25/44] media: uapi: hevc: Add segment address field +Subject: [PATCH] media: uapi: hevc: Add segment address field If HEVC frame consists of multiple slices, segment address has to be known in order to properly decode it. @@ -13,9 +13,11 @@ Signed-off-by: Jernej Skrabec include/media/hevc-ctrls.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) +diff --git a/include/media/hevc-ctrls.h b/include/media/hevc-ctrls.h +index 3cf7da003cd9..ffc701e268eb 100644 --- a/include/media/hevc-ctrls.h +++ b/include/media/hevc-ctrls.h -@@ -167,6 +167,9 @@ struct v4l2_ctrl_hevc_slice_params { +@@ -168,6 +168,9 @@ struct v4l2_ctrl_hevc_slice_params { __u32 bit_size; __u32 data_bit_offset; @@ -25,7 +27,7 @@ Signed-off-by: Jernej Skrabec /* ISO/IEC 23008-2, ITU-T Rec. H.265: NAL unit header */ __u8 nal_unit_type; __u8 nuh_temporal_id_plus1; -@@ -200,7 +203,7 @@ struct v4l2_ctrl_hevc_slice_params { +@@ -201,7 +204,7 @@ struct v4l2_ctrl_hevc_slice_params { __u8 num_rps_poc_st_curr_after; __u8 num_rps_poc_lt_curr; diff --git a/projects/Allwinner/patches/linux/0026-media-cedrus-hevc-Add-support-for-multiple-slices.patch b/projects/Allwinner/patches/linux/0025-media-cedrus-hevc-Add-support-for-multiple-slices.patch similarity index 79% rename from projects/Allwinner/patches/linux/0026-media-cedrus-hevc-Add-support-for-multiple-slices.patch rename to projects/Allwinner/patches/linux/0025-media-cedrus-hevc-Add-support-for-multiple-slices.patch index eb22de15b0..207e442ec0 100644 --- a/projects/Allwinner/patches/linux/0026-media-cedrus-hevc-Add-support-for-multiple-slices.patch +++ b/projects/Allwinner/patches/linux/0025-media-cedrus-hevc-Add-support-for-multiple-slices.patch @@ -1,7 +1,7 @@ -From d99740197a9776b9332d21b9f3b05dab658a90eb Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sat, 26 Oct 2019 15:44:15 +0200 -Subject: [PATCH 26/44] media: cedrus: hevc: Add support for multiple slices +Subject: [PATCH] media: cedrus: hevc: Add support for multiple slices Now that segment address is available, support for multi-slice frames can be easily added. @@ -12,9 +12,11 @@ Signed-off-by: Jernej Skrabec .../staging/media/sunxi/cedrus/cedrus_video.c | 1 + 2 files changed, 17 insertions(+), 10 deletions(-) +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h265.c b/drivers/staging/media/sunxi/cedrus/cedrus_h265.c +index 71a08b11eebf..2cb14be41ead 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_h265.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_h265.c -@@ -309,6 +309,8 @@ static void cedrus_h265_setup(struct ced +@@ -309,6 +309,8 @@ static void cedrus_h265_setup(struct cedrus_ctx *ctx, const struct v4l2_ctrl_hevc_pps *pps; const struct v4l2_ctrl_hevc_slice_params *slice_params; const struct v4l2_hevc_pred_weight_table *pred_weight_table; @@ -23,7 +25,7 @@ Signed-off-by: Jernej Skrabec dma_addr_t src_buf_addr; dma_addr_t src_buf_end_addr; u32 chroma_log2_weight_denom; -@@ -321,15 +323,17 @@ static void cedrus_h265_setup(struct ced +@@ -321,15 +323,17 @@ static void cedrus_h265_setup(struct cedrus_ctx *ctx, slice_params = run->h265.slice_params; pred_weight_table = &slice_params->pred_weight_table; @@ -46,7 +48,7 @@ Signed-off-by: Jernej Skrabec /* * Each CTB requires a MV col buffer with a specific unit size. -@@ -383,15 +387,17 @@ static void cedrus_h265_setup(struct ced +@@ -383,15 +387,17 @@ static void cedrus_h265_setup(struct cedrus_ctx *ctx, reg = VE_DEC_H265_BITS_END_ADDR_BASE(src_buf_end_addr); cedrus_write(dev, VE_DEC_H265_BITS_END_ADDR, reg); @@ -67,9 +69,9 @@ Signed-off-by: Jernej Skrabec /* Initialize bitstream access. */ cedrus_write(dev, VE_DEC_H265_TRIGGER, VE_DEC_H265_TRIGGER_INIT_SWDEC); -@@ -543,8 +549,8 @@ static void cedrus_h265_setup(struct ced +@@ -543,8 +549,8 @@ static void cedrus_h265_setup(struct cedrus_ctx *ctx, V4L2_HEVC_SLICE_PARAMS_FLAG_DEPENDENT_SLICE_SEGMENT, - pps->flags); + slice_params->flags); - /* FIXME: For multi-slice support. */ - reg |= VE_DEC_H265_DEC_SLICE_HDR_INFO0_FLAG_FIRST_SLICE_SEGMENT_IN_PIC; @@ -78,9 +80,11 @@ Signed-off-by: Jernej Skrabec cedrus_write(dev, VE_DEC_H265_DEC_SLICE_HDR_INFO0, reg); +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c b/drivers/staging/media/sunxi/cedrus/cedrus_video.c +index 16327be904d1..f9dae546aa7e 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c -@@ -332,6 +332,7 @@ static int cedrus_s_fmt_vid_out(struct f +@@ -332,6 +332,7 @@ static int cedrus_s_fmt_vid_out(struct file *file, void *priv, switch (ctx->src_fmt.pixelformat) { case V4L2_PIX_FMT_H264_SLICE: diff --git a/projects/Allwinner/patches/linux/0027-media-cedrus-hevc-tiles-hack.patch b/projects/Allwinner/patches/linux/0026-media-cedrus-hevc-tiles-hack.patch similarity index 85% rename from projects/Allwinner/patches/linux/0027-media-cedrus-hevc-tiles-hack.patch rename to projects/Allwinner/patches/linux/0026-media-cedrus-hevc-tiles-hack.patch index e1eb4ebb84..2653738e27 100644 --- a/projects/Allwinner/patches/linux/0027-media-cedrus-hevc-tiles-hack.patch +++ b/projects/Allwinner/patches/linux/0026-media-cedrus-hevc-tiles-hack.patch @@ -1,15 +1,16 @@ -From 9e203d78974aa445086dbe6b667e49b3f00d36d0 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sat, 26 Oct 2019 21:23:55 +0200 -Subject: [PATCH 27/44] media: cedrus: hevc: tiles hack +Subject: [PATCH] media: cedrus: hevc: tiles hack Signed-off-by: Jernej Skrabec --- drivers/staging/media/sunxi/cedrus/cedrus.h | 2 + .../staging/media/sunxi/cedrus/cedrus_h265.c | 93 +++++++++++++++++-- - include/media/hevc-ctrls.h | 5 +- - 3 files changed, 93 insertions(+), 7 deletions(-) + 2 files changed, 89 insertions(+), 6 deletions(-) +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.h b/drivers/staging/media/sunxi/cedrus/cedrus.h +index c5202cbb1db6..c3cc8d1b63cc 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.h +++ b/drivers/staging/media/sunxi/cedrus/cedrus.h @@ -135,6 +135,8 @@ struct cedrus_ctx { @@ -21,9 +22,11 @@ Signed-off-by: Jernej Skrabec } h265; } codec; }; +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h265.c b/drivers/staging/media/sunxi/cedrus/cedrus_h265.c +index 2cb14be41ead..3b355de4c097 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_h265.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_h265.c -@@ -301,6 +301,61 @@ static void cedrus_h265_write_scaling_li +@@ -301,6 +301,61 @@ static void cedrus_h265_write_scaling_list(struct cedrus_ctx *ctx, } } @@ -85,7 +88,7 @@ Signed-off-by: Jernej Skrabec static void cedrus_h265_setup(struct cedrus_ctx *ctx, struct cedrus_run *run) { -@@ -311,6 +366,7 @@ static void cedrus_h265_setup(struct ced +@@ -311,6 +366,7 @@ static void cedrus_h265_setup(struct cedrus_ctx *ctx, const struct v4l2_hevc_pred_weight_table *pred_weight_table; unsigned int width_in_ctb_luma, ctb_size_luma; unsigned int log2_max_luma_coding_block_size; @@ -93,7 +96,7 @@ Signed-off-by: Jernej Skrabec dma_addr_t src_buf_addr; dma_addr_t src_buf_end_addr; u32 chroma_log2_weight_denom; -@@ -388,12 +444,19 @@ static void cedrus_h265_setup(struct ced +@@ -388,12 +444,19 @@ static void cedrus_h265_setup(struct cedrus_ctx *ctx, cedrus_write(dev, VE_DEC_H265_BITS_END_ADDR, reg); /* Coding tree block address */ @@ -117,7 +120,7 @@ Signed-off-by: Jernej Skrabec /* Clear the number of correctly-decoded coding tree blocks. */ if (ctx->fh.m2m_ctx->new_frame) -@@ -497,7 +560,9 @@ static void cedrus_h265_setup(struct ced +@@ -497,7 +560,9 @@ static void cedrus_h265_setup(struct cedrus_ctx *ctx, V4L2_HEVC_PPS_FLAG_ENTROPY_CODING_SYNC_ENABLED, pps->flags); @@ -128,7 +131,7 @@ Signed-off-by: Jernej Skrabec reg |= VE_DEC_H265_FLAG(VE_DEC_H265_DEC_PPS_CTRL1_FLAG_TRANSQUANT_BYPASS_ENABLED, V4L2_HEVC_PPS_FLAG_TRANSQUANT_BYPASS_ENABLED, -@@ -573,12 +638,14 @@ static void cedrus_h265_setup(struct ced +@@ -573,12 +638,14 @@ static void cedrus_h265_setup(struct cedrus_ctx *ctx, chroma_log2_weight_denom = pred_weight_table->luma_log2_weight_denom + pred_weight_table->delta_chroma_log2_weight_denom; @@ -144,7 +147,7 @@ Signed-off-by: Jernej Skrabec /* Decoded picture size. */ reg = VE_DEC_H265_DEC_PIC_SIZE_WIDTH(ctx->src_fmt.width) | -@@ -672,6 +739,17 @@ static int cedrus_h265_start(struct cedr +@@ -672,6 +739,17 @@ static int cedrus_h265_start(struct cedrus_ctx *ctx) if (!ctx->codec.h265.neighbor_info_buf) return -ENOMEM; @@ -162,7 +165,7 @@ Signed-off-by: Jernej Skrabec return 0; } -@@ -690,6 +768,9 @@ static void cedrus_h265_stop(struct cedr +@@ -690,6 +768,9 @@ static void cedrus_h265_stop(struct cedrus_ctx *ctx) dma_free_coherent(dev->dev, CEDRUS_H265_NEIGHBOR_INFO_BUF_SIZE, ctx->codec.h265.neighbor_info_buf, ctx->codec.h265.neighbor_info_buf_addr); diff --git a/projects/Allwinner/patches/linux/0028-media-cedrus-Add-callback-for-buffer-cleanup.patch b/projects/Allwinner/patches/linux/0027-media-cedrus-Add-callback-for-buffer-cleanup.patch similarity index 73% rename from projects/Allwinner/patches/linux/0028-media-cedrus-Add-callback-for-buffer-cleanup.patch rename to projects/Allwinner/patches/linux/0027-media-cedrus-Add-callback-for-buffer-cleanup.patch index b8006ee8a9..724a78c687 100644 --- a/projects/Allwinner/patches/linux/0028-media-cedrus-Add-callback-for-buffer-cleanup.patch +++ b/projects/Allwinner/patches/linux/0027-media-cedrus-Add-callback-for-buffer-cleanup.patch @@ -1,7 +1,7 @@ -From b6d288bb8823e11114297d1e406ccd977106aaf9 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sat, 9 Nov 2019 13:06:15 +0100 -Subject: [PATCH 28/44] media: cedrus: Add callback for buffer cleanup +Subject: [PATCH] media: cedrus: Add callback for buffer cleanup Signed-off-by: Jernej Skrabec --- @@ -9,6 +9,8 @@ Signed-off-by: Jernej Skrabec drivers/staging/media/sunxi/cedrus/cedrus_video.c | 13 +++++++++++++ 2 files changed, 14 insertions(+) +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.h b/drivers/staging/media/sunxi/cedrus/cedrus.h +index c3cc8d1b63cc..c9ec43be260f 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.h +++ b/drivers/staging/media/sunxi/cedrus/cedrus.h @@ -149,6 +149,7 @@ struct cedrus_dec_ops { @@ -19,9 +21,11 @@ Signed-off-by: Jernej Skrabec }; struct cedrus_variant { +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c b/drivers/staging/media/sunxi/cedrus/cedrus_video.c +index f9dae546aa7e..a41365646e58 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c -@@ -455,6 +455,18 @@ static int cedrus_buf_prepare(struct vb2 +@@ -461,6 +461,18 @@ static int cedrus_buf_prepare(struct vb2_buffer *vb) return 0; } @@ -40,7 +44,7 @@ Signed-off-by: Jernej Skrabec static int cedrus_start_streaming(struct vb2_queue *vq, unsigned int count) { struct cedrus_ctx *ctx = vb2_get_drv_priv(vq); -@@ -535,6 +547,7 @@ static void cedrus_buf_request_complete( +@@ -541,6 +553,7 @@ static void cedrus_buf_request_complete(struct vb2_buffer *vb) static struct vb2_ops cedrus_qops = { .queue_setup = cedrus_queue_setup, .buf_prepare = cedrus_buf_prepare, diff --git a/projects/Allwinner/patches/linux/0029-media-cedrus-hevc-Improve-buffer-management.patch b/projects/Allwinner/patches/linux/0028-media-cedrus-hevc-Improve-buffer-management.patch similarity index 85% rename from projects/Allwinner/patches/linux/0029-media-cedrus-hevc-Improve-buffer-management.patch rename to projects/Allwinner/patches/linux/0028-media-cedrus-hevc-Improve-buffer-management.patch index fa357267c3..7d82e8b9c3 100644 --- a/projects/Allwinner/patches/linux/0029-media-cedrus-hevc-Improve-buffer-management.patch +++ b/projects/Allwinner/patches/linux/0028-media-cedrus-hevc-Improve-buffer-management.patch @@ -1,7 +1,7 @@ -From d4ffac11f0d8b3a844f528e963b953a6bfe540af Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sat, 9 Nov 2019 13:22:05 +0100 -Subject: [PATCH 29/44] media: cedrus: hevc: Improve buffer management +Subject: [PATCH] media: cedrus: hevc: Improve buffer management Signed-off-by: Jernej Skrabec --- @@ -9,6 +9,8 @@ Signed-off-by: Jernej Skrabec .../staging/media/sunxi/cedrus/cedrus_h265.c | 117 ++++++++++-------- 2 files changed, 69 insertions(+), 57 deletions(-) +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.h b/drivers/staging/media/sunxi/cedrus/cedrus.h +index c9ec43be260f..6fa2df354cbf 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.h +++ b/drivers/staging/media/sunxi/cedrus/cedrus.h @@ -96,6 +96,11 @@ struct cedrus_buffer { @@ -34,9 +36,11 @@ Signed-off-by: Jernej Skrabec void *neighbor_info_buf; dma_addr_t neighbor_info_buf_addr; void *entry_points_buf; +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h265.c b/drivers/staging/media/sunxi/cedrus/cedrus_h265.c +index 3b355de4c097..9e21a40867d7 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_h265.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_h265.c -@@ -91,26 +91,66 @@ static void cedrus_h265_sram_write_data( +@@ -91,26 +91,66 @@ static void cedrus_h265_sram_write_data(struct cedrus_dev *dev, void *data, static inline dma_addr_t cedrus_h265_frame_info_mv_col_buf_addr(struct cedrus_ctx *ctx, @@ -111,7 +115,7 @@ Signed-off-by: Jernej Skrabec }; u32 offset = VE_DEC_H265_SRAM_OFFSET_FRAME_INFO + VE_DEC_H265_SRAM_OFFSET_FRAME_INFO_UNIT * index; -@@ -134,7 +174,8 @@ static void cedrus_h265_frame_info_write +@@ -134,7 +174,8 @@ static void cedrus_h265_frame_info_write_single(struct cedrus_ctx *ctx, static void cedrus_h265_frame_info_write_dpb(struct cedrus_ctx *ctx, const struct v4l2_hevc_dpb_entry *dpb, @@ -121,7 +125,7 @@ Signed-off-by: Jernej Skrabec { struct vb2_queue *vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE); -@@ -149,7 +190,7 @@ static void cedrus_h265_frame_info_write +@@ -149,7 +190,7 @@ static void cedrus_h265_frame_info_write_dpb(struct cedrus_ctx *ctx, cedrus_h265_frame_info_write_single(ctx, i, dpb[i].field_pic, pic_order_cnt, @@ -130,7 +134,7 @@ Signed-off-by: Jernej Skrabec } } -@@ -386,36 +427,6 @@ static void cedrus_h265_setup(struct ced +@@ -386,36 +427,6 @@ static void cedrus_h265_setup(struct cedrus_ctx *ctx, width_in_ctb_luma = DIV_ROUND_UP(sps->pic_width_in_luma_samples, ctb_size_luma); @@ -167,7 +171,7 @@ Signed-off-by: Jernej Skrabec /* Activate H265 engine. */ cedrus_engine_enable(ctx, CEDRUS_CODEC_H265); -@@ -669,7 +680,7 @@ static void cedrus_h265_setup(struct ced +@@ -669,7 +680,7 @@ static void cedrus_h265_setup(struct cedrus_ctx *ctx, /* Write decoded picture buffer in pic list. */ cedrus_h265_frame_info_write_dpb(ctx, slice_params->dpb, @@ -176,7 +180,7 @@ Signed-off-by: Jernej Skrabec /* Output frame. */ -@@ -680,7 +691,7 @@ static void cedrus_h265_setup(struct ced +@@ -680,7 +691,7 @@ static void cedrus_h265_setup(struct cedrus_ctx *ctx, cedrus_h265_frame_info_write_single(ctx, output_pic_list_index, slice_params->pic_struct != 0, pic_order_cnt, @@ -185,7 +189,7 @@ Signed-off-by: Jernej Skrabec cedrus_write(dev, VE_DEC_H265_OUTPUT_FRAME_IDX, output_pic_list_index); -@@ -729,9 +740,6 @@ static int cedrus_h265_start(struct cedr +@@ -729,9 +740,6 @@ static int cedrus_h265_start(struct cedrus_ctx *ctx) { struct cedrus_dev *dev = ctx->dev; @@ -195,7 +199,7 @@ Signed-off-by: Jernej Skrabec ctx->codec.h265.neighbor_info_buf = dma_alloc_coherent(dev->dev, CEDRUS_H265_NEIGHBOR_INFO_BUF_SIZE, &ctx->codec.h265.neighbor_info_buf_addr, -@@ -757,14 +765,6 @@ static void cedrus_h265_stop(struct cedr +@@ -757,14 +765,6 @@ static void cedrus_h265_stop(struct cedrus_ctx *ctx) { struct cedrus_dev *dev = ctx->dev; @@ -210,7 +214,7 @@ Signed-off-by: Jernej Skrabec dma_free_coherent(dev->dev, CEDRUS_H265_NEIGHBOR_INFO_BUF_SIZE, ctx->codec.h265.neighbor_info_buf, ctx->codec.h265.neighbor_info_buf_addr); -@@ -780,6 +780,16 @@ static void cedrus_h265_trigger(struct c +@@ -780,6 +780,16 @@ static void cedrus_h265_trigger(struct cedrus_ctx *ctx) cedrus_write(dev, VE_DEC_H265_TRIGGER, VE_DEC_H265_TRIGGER_DEC_SLICE); } @@ -227,7 +231,7 @@ Signed-off-by: Jernej Skrabec struct cedrus_dec_ops cedrus_dec_ops_h265 = { .irq_clear = cedrus_h265_irq_clear, .irq_disable = cedrus_h265_irq_disable, -@@ -788,4 +798,5 @@ struct cedrus_dec_ops cedrus_dec_ops_h26 +@@ -788,4 +798,5 @@ struct cedrus_dec_ops cedrus_dec_ops_h265 = { .start = cedrus_h265_start, .stop = cedrus_h265_stop, .trigger = cedrus_h265_trigger, diff --git a/projects/Allwinner/patches/linux/0030-media-cedrus-h264-Improve-buffer-management.patch b/projects/Allwinner/patches/linux/0029-media-cedrus-h264-Improve-buffer-management.patch similarity index 82% rename from projects/Allwinner/patches/linux/0030-media-cedrus-h264-Improve-buffer-management.patch rename to projects/Allwinner/patches/linux/0029-media-cedrus-h264-Improve-buffer-management.patch index 648ade8589..cede87b31d 100644 --- a/projects/Allwinner/patches/linux/0030-media-cedrus-h264-Improve-buffer-management.patch +++ b/projects/Allwinner/patches/linux/0029-media-cedrus-h264-Improve-buffer-management.patch @@ -1,7 +1,7 @@ -From a881ce25cba8e45c6a86b5a680981c3b14b5b1e1 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sat, 9 Nov 2019 14:12:42 +0100 -Subject: [PATCH 30/44] media: cedrus: h264: Improve buffer management +Subject: [PATCH] media: cedrus: h264: Improve buffer management Signed-off-by: Jernej Skrabec --- @@ -9,6 +9,8 @@ Signed-off-by: Jernej Skrabec .../staging/media/sunxi/cedrus/cedrus_h264.c | 93 ++++++++----------- 2 files changed, 44 insertions(+), 52 deletions(-) +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.h b/drivers/staging/media/sunxi/cedrus/cedrus.h +index 6fa2df354cbf..dfd62942d451 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.h +++ b/drivers/staging/media/sunxi/cedrus/cedrus.h @@ -95,6 +95,9 @@ struct cedrus_buffer { @@ -21,9 +23,11 @@ Signed-off-by: Jernej Skrabec } h264; struct { void *mv_col_buf; +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c +index de7442d4834d..ab5cb4dce50b 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c -@@ -55,16 +55,14 @@ static void cedrus_h264_write_sram(struc +@@ -55,16 +55,14 @@ static void cedrus_h264_write_sram(struct cedrus_dev *dev, } static dma_addr_t cedrus_h264_mv_col_buf_addr(struct cedrus_ctx *ctx, @@ -45,7 +49,7 @@ Signed-off-by: Jernej Skrabec return addr; } -@@ -76,7 +74,6 @@ static void cedrus_fill_ref_pic(struct c +@@ -76,7 +74,6 @@ static void cedrus_fill_ref_pic(struct cedrus_ctx *ctx, struct cedrus_h264_sram_ref_pic *pic) { struct vb2_buffer *vbuf = &buf->m2m_buf.vb.vb2_buf; @@ -53,7 +57,7 @@ Signed-off-by: Jernej Skrabec pic->top_field_order_cnt = cpu_to_le32(top_field_order_cnt); pic->bottom_field_order_cnt = cpu_to_le32(bottom_field_order_cnt); -@@ -85,9 +82,9 @@ static void cedrus_fill_ref_pic(struct c +@@ -85,9 +82,9 @@ static void cedrus_fill_ref_pic(struct cedrus_ctx *ctx, pic->luma_ptr = cpu_to_le32(cedrus_buf_addr(vbuf, &ctx->dst_fmt, 0)); pic->chroma_ptr = cpu_to_le32(cedrus_buf_addr(vbuf, &ctx->dst_fmt, 1)); pic->mv_col_top_ptr = @@ -65,7 +69,7 @@ Signed-off-by: Jernej Skrabec } static void cedrus_write_frame_list(struct cedrus_ctx *ctx, -@@ -146,6 +143,28 @@ static void cedrus_write_frame_list(stru +@@ -146,6 +143,28 @@ static void cedrus_write_frame_list(struct cedrus_ctx *ctx, output_buf = vb2_to_cedrus_buffer(&run->dst->vb2_buf); output_buf->codec.h264.position = position; @@ -94,7 +98,7 @@ Signed-off-by: Jernej Skrabec if (decode->flags & V4L2_H264_DECODE_PARAM_FLAG_FIELD_PIC) output_buf->codec.h264.pic_type = CEDRUS_H264_PIC_TYPE_FIELD; else if (sps->flags & V4L2_H264_SPS_FLAG_MB_ADAPTIVE_FRAME_FIELD) -@@ -516,8 +535,6 @@ static int cedrus_h264_start(struct cedr +@@ -516,8 +535,6 @@ static int cedrus_h264_start(struct cedrus_ctx *ctx) { struct cedrus_dev *dev = ctx->dev; unsigned int pic_info_size; @@ -103,7 +107,7 @@ Signed-off-by: Jernej Skrabec int ret; /* Formula for picture buffer size is taken from CedarX source. */ -@@ -560,37 +577,6 @@ static int cedrus_h264_start(struct cedr +@@ -560,37 +577,6 @@ static int cedrus_h264_start(struct cedrus_ctx *ctx) goto err_pic_buf; } @@ -141,7 +145,7 @@ Signed-off-by: Jernej Skrabec if (ctx->src_fmt.width > 2048) { /* * Formulas for deblock and intra prediction buffer sizes -@@ -606,7 +592,7 @@ static int cedrus_h264_start(struct cedr +@@ -606,7 +592,7 @@ static int cedrus_h264_start(struct cedrus_ctx *ctx) GFP_KERNEL); if (!ctx->codec.h264.deblk_buf) { ret = -ENOMEM; @@ -150,7 +154,7 @@ Signed-off-by: Jernej Skrabec } /* -@@ -633,11 +619,6 @@ err_deblk_buf: +@@ -633,11 +619,6 @@ static int cedrus_h264_start(struct cedrus_ctx *ctx) ctx->codec.h264.deblk_buf, ctx->codec.h264.deblk_buf_dma); @@ -162,7 +166,7 @@ Signed-off-by: Jernej Skrabec err_neighbor_buf: dma_free_coherent(dev->dev, CEDRUS_NEIGHBOR_INFO_BUF_SIZE, ctx->codec.h264.neighbor_info_buf, -@@ -654,9 +635,6 @@ static void cedrus_h264_stop(struct cedr +@@ -654,9 +635,6 @@ static void cedrus_h264_stop(struct cedrus_ctx *ctx) { struct cedrus_dev *dev = ctx->dev; @@ -172,7 +176,7 @@ Signed-off-by: Jernej Skrabec dma_free_coherent(dev->dev, CEDRUS_NEIGHBOR_INFO_BUF_SIZE, ctx->codec.h264.neighbor_info_buf, ctx->codec.h264.neighbor_info_buf_dma); -@@ -681,6 +659,16 @@ static void cedrus_h264_trigger(struct c +@@ -681,6 +659,16 @@ static void cedrus_h264_trigger(struct cedrus_ctx *ctx) VE_H264_TRIGGER_TYPE_AVC_SLICE_DECODE); } @@ -189,7 +193,7 @@ Signed-off-by: Jernej Skrabec struct cedrus_dec_ops cedrus_dec_ops_h264 = { .irq_clear = cedrus_h264_irq_clear, .irq_disable = cedrus_h264_irq_disable, -@@ -689,4 +677,5 @@ struct cedrus_dec_ops cedrus_dec_ops_h26 +@@ -689,4 +677,5 @@ struct cedrus_dec_ops cedrus_dec_ops_h264 = { .start = cedrus_h264_start, .stop = cedrus_h264_stop, .trigger = cedrus_h264_trigger, diff --git a/projects/Allwinner/patches/linux/0031-WIp-10-bit-HEVC-support.patch b/projects/Allwinner/patches/linux/0030-WIp-10-bit-HEVC-support.patch similarity index 74% rename from projects/Allwinner/patches/linux/0031-WIp-10-bit-HEVC-support.patch rename to projects/Allwinner/patches/linux/0030-WIp-10-bit-HEVC-support.patch index 85477ccf2b..a1e67983a1 100644 --- a/projects/Allwinner/patches/linux/0031-WIp-10-bit-HEVC-support.patch +++ b/projects/Allwinner/patches/linux/0030-WIp-10-bit-HEVC-support.patch @@ -1,7 +1,7 @@ -From 54389b5956af51023b073a08eeb7a746a4a37119 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sun, 15 Mar 2020 21:35:39 +0100 -Subject: [PATCH 31/44] WIp: 10-bit HEVC support +Subject: [PATCH] WIp: 10-bit HEVC support Signed-off-by: Jernej Skrabec --- @@ -12,9 +12,11 @@ Signed-off-by: Jernej Skrabec .../staging/media/sunxi/cedrus/cedrus_video.h | 2 +- 5 files changed, 44 insertions(+), 8 deletions(-) +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c +index e1379cceea10..a4358d84d94d 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus.c -@@ -301,7 +301,7 @@ static int cedrus_open(struct file *file +@@ -320,7 +320,7 @@ static int cedrus_open(struct file *file) goto err_ctrls; } ctx->dst_fmt.pixelformat = V4L2_PIX_FMT_SUNXI_TILED_NV12; @@ -23,7 +25,7 @@ Signed-off-by: Jernej Skrabec ctx->src_fmt.pixelformat = V4L2_PIX_FMT_MPEG2_SLICE; /* * TILED_NV12 has more strict requirements, so copy the width and -@@ -309,7 +309,7 @@ static int cedrus_open(struct file *file +@@ -328,7 +328,7 @@ static int cedrus_open(struct file *file) */ ctx->src_fmt.width = ctx->dst_fmt.width; ctx->src_fmt.height = ctx->dst_fmt.height; @@ -32,9 +34,11 @@ Signed-off-by: Jernej Skrabec v4l2_fh_add(&ctx->fh); +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h265.c b/drivers/staging/media/sunxi/cedrus/cedrus_h265.c +index 9e21a40867d7..ab6fc857a477 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_h265.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_h265.c -@@ -532,6 +532,18 @@ static void cedrus_h265_setup(struct ced +@@ -532,6 +532,18 @@ static void cedrus_h265_setup(struct cedrus_ctx *ctx, cedrus_write(dev, VE_DEC_H265_DEC_PCM_CTRL, reg); @@ -53,9 +57,11 @@ Signed-off-by: Jernej Skrabec /* PPS. */ reg = VE_DEC_H265_DEC_PPS_CTRL0_PPS_CR_QP_OFFSET(pps->pps_cr_qp_offset) | +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_regs.h b/drivers/staging/media/sunxi/cedrus/cedrus_regs.h +index a763647133b9..9fa062d5d79e 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_regs.h +++ b/drivers/staging/media/sunxi/cedrus/cedrus_regs.h -@@ -498,6 +498,10 @@ +@@ -499,6 +499,10 @@ #define VE_DEC_H265_LOW_ADDR (VE_ENGINE_DEC_H265 + 0x80) @@ -66,9 +72,11 @@ Signed-off-by: Jernej Skrabec #define VE_DEC_H265_LOW_ADDR_PRIMARY_CHROMA(a) \ SHIFT_AND_MASK_BITS(a, 31, 24) #define VE_DEC_H265_LOW_ADDR_SECONDARY_CHROMA(a) \ +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c b/drivers/staging/media/sunxi/cedrus/cedrus_video.c +index a41365646e58..0ab747712b59 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c -@@ -93,7 +93,7 @@ static struct cedrus_format *cedrus_find +@@ -93,7 +93,7 @@ static struct cedrus_format *cedrus_find_format(u32 pixelformat, u32 directions, return &cedrus_formats[i]; } @@ -77,7 +85,7 @@ Signed-off-by: Jernej Skrabec { unsigned int width = pix_fmt->width; unsigned int height = pix_fmt->height; -@@ -147,6 +147,17 @@ void cedrus_prepare_format(struct v4l2_p +@@ -147,6 +147,17 @@ void cedrus_prepare_format(struct v4l2_pix_format *pix_fmt) break; } @@ -95,7 +103,7 @@ Signed-off-by: Jernej Skrabec pix_fmt->width = width; pix_fmt->height = height; -@@ -239,17 +250,27 @@ static int cedrus_try_fmt_vid_cap(struct +@@ -239,17 +250,27 @@ static int cedrus_try_fmt_vid_cap(struct file *file, void *priv, struct cedrus_ctx *ctx = cedrus_file2ctx(file); struct cedrus_dev *dev = ctx->dev; struct v4l2_pix_format *pix_fmt = &f->fmt.pix; @@ -124,7 +132,7 @@ Signed-off-by: Jernej Skrabec return 0; } -@@ -267,8 +288,7 @@ static int cedrus_try_fmt_vid_out(struct +@@ -267,8 +288,7 @@ static int cedrus_try_fmt_vid_out(struct file *file, void *priv, if (!fmt) return -EINVAL; @@ -134,7 +142,7 @@ Signed-off-by: Jernej Skrabec return 0; } -@@ -349,7 +369,7 @@ static int cedrus_s_fmt_vid_out(struct f +@@ -349,7 +369,7 @@ static int cedrus_s_fmt_vid_out(struct file *file, void *priv, ctx->dst_fmt.quantization = f->fmt.pix.quantization; ctx->dst_fmt.width = ctx->src_fmt.width; ctx->dst_fmt.height = ctx->src_fmt.height; @@ -143,9 +151,11 @@ Signed-off-by: Jernej Skrabec return 0; } +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.h b/drivers/staging/media/sunxi/cedrus/cedrus_video.h +index 05050c0a0921..d42e4ebf6cad 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_video.h +++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.h -@@ -26,6 +26,6 @@ extern const struct v4l2_ioctl_ops cedru +@@ -26,6 +26,6 @@ extern const struct v4l2_ioctl_ops cedrus_ioctl_ops; int cedrus_queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_queue *dst_vq); diff --git a/projects/Allwinner/patches/linux/0032-media-cedrus-add-check-for-H264-and-HEVC-limitations.patch b/projects/Allwinner/patches/linux/0031-media-cedrus-add-check-for-H264-and-HEVC-limitations.patch similarity index 80% rename from projects/Allwinner/patches/linux/0032-media-cedrus-add-check-for-H264-and-HEVC-limitations.patch rename to projects/Allwinner/patches/linux/0031-media-cedrus-add-check-for-H264-and-HEVC-limitations.patch index e16c2ce89e..e849d237ab 100644 --- a/projects/Allwinner/patches/linux/0032-media-cedrus-add-check-for-H264-and-HEVC-limitations.patch +++ b/projects/Allwinner/patches/linux/0031-media-cedrus-add-check-for-H264-and-HEVC-limitations.patch @@ -1,7 +1,7 @@ -From f26df66c4d6ea08a865a16df82af37035401254d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 21 Jul 2020 21:53:27 +0200 -Subject: [PATCH 32/44] media: cedrus: add check for H264 and HEVC limitations +Subject: [PATCH] media: cedrus: add check for H264 and HEVC limitations Signed-off-by: Jernej Skrabec --- @@ -9,6 +9,8 @@ Signed-off-by: Jernej Skrabec drivers/staging/media/sunxi/cedrus/cedrus.h | 1 + 2 files changed, 49 insertions(+), 1 deletion(-) +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c +index a4358d84d94d..857c1f28c849 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus.c @@ -28,6 +28,50 @@ @@ -62,7 +64,7 @@ Signed-off-by: Jernej Skrabec static const struct cedrus_control cedrus_controls[] = { { .cfg = { -@@ -60,6 +104,7 @@ static const struct cedrus_control cedru +@@ -60,6 +104,7 @@ static const struct cedrus_control cedrus_controls[] = { { .cfg = { .id = V4L2_CID_MPEG_VIDEO_H264_SPS, @@ -70,7 +72,7 @@ Signed-off-by: Jernej Skrabec }, .codec = CEDRUS_CODEC_H264, .required = true, -@@ -106,6 +151,7 @@ static const struct cedrus_control cedru +@@ -125,6 +170,7 @@ static const struct cedrus_control cedrus_controls[] = { { .cfg = { .id = V4L2_CID_MPEG_VIDEO_HEVC_SPS, @@ -78,7 +80,7 @@ Signed-off-by: Jernej Skrabec }, .codec = CEDRUS_CODEC_H265, .required = true, -@@ -534,7 +580,8 @@ static const struct cedrus_variant sun50 +@@ -553,7 +599,8 @@ static const struct cedrus_variant sun50i_h5_cedrus_variant = { static const struct cedrus_variant sun50i_h6_cedrus_variant = { .capabilities = CEDRUS_CAPABILITY_UNTILED | @@ -88,6 +90,8 @@ Signed-off-by: Jernej Skrabec .quirks = CEDRUS_QUIRK_NO_DMA_OFFSET, .mod_rate = 600000000, }; +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.h b/drivers/staging/media/sunxi/cedrus/cedrus.h +index dfd62942d451..2c9e14c6396f 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.h +++ b/drivers/staging/media/sunxi/cedrus/cedrus.h @@ -28,6 +28,7 @@ diff --git a/projects/Allwinner/patches/linux/0033-media-cedrus-Add-support-for-VP8-decoding.patch b/projects/Allwinner/patches/linux/0032-media-cedrus-Add-support-for-VP8-decoding.patch similarity index 95% rename from projects/Allwinner/patches/linux/0033-media-cedrus-Add-support-for-VP8-decoding.patch rename to projects/Allwinner/patches/linux/0032-media-cedrus-Add-support-for-VP8-decoding.patch index 6c4320868b..8fbc1735b2 100644 --- a/projects/Allwinner/patches/linux/0033-media-cedrus-Add-support-for-VP8-decoding.patch +++ b/projects/Allwinner/patches/linux/0032-media-cedrus-Add-support-for-VP8-decoding.patch @@ -1,7 +1,7 @@ -From 574ba48fa87225fbf3e39ffd2b11a6fb93cb6c98 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Wed, 20 May 2020 23:01:29 +0200 -Subject: [PATCH 33/44] media: cedrus: Add support for VP8 decoding +Subject: [PATCH] media: cedrus: Add support for VP8 decoding VP8 in Cedrus shares same engine as H264. @@ -25,6 +25,8 @@ Signed-off-by: Jernej Skrabec 8 files changed, 819 insertions(+), 1 deletion(-) create mode 100644 drivers/staging/media/sunxi/cedrus/cedrus_vp8.c +diff --git a/drivers/staging/media/sunxi/cedrus/Makefile b/drivers/staging/media/sunxi/cedrus/Makefile +index 1bce49d3e7e2..a647b3690bf8 100644 --- a/drivers/staging/media/sunxi/cedrus/Makefile +++ b/drivers/staging/media/sunxi/cedrus/Makefile @@ -2,4 +2,5 @@ @@ -34,9 +36,11 @@ Signed-off-by: Jernej Skrabec - cedrus_mpeg2.o cedrus_h264.o cedrus_h265.o + cedrus_mpeg2.o cedrus_h264.o cedrus_h265.o \ + cedrus_vp8.o +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c +index 857c1f28c849..cb9c19f87e8f 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus.c -@@ -195,6 +195,13 @@ static const struct cedrus_control cedru +@@ -214,6 +214,13 @@ static const struct cedrus_control cedrus_controls[] = { .codec = CEDRUS_CODEC_H265, .required = false, }, @@ -50,7 +54,7 @@ Signed-off-by: Jernej Skrabec }; #define CEDRUS_CONTROLS_COUNT ARRAY_SIZE(cedrus_controls) -@@ -446,6 +453,7 @@ static int cedrus_probe(struct platform_ +@@ -465,6 +472,7 @@ static int cedrus_probe(struct platform_device *pdev) dev->dec_ops[CEDRUS_CODEC_MPEG2] = &cedrus_dec_ops_mpeg2; dev->dec_ops[CEDRUS_CODEC_H264] = &cedrus_dec_ops_h264; dev->dec_ops[CEDRUS_CODEC_H265] = &cedrus_dec_ops_h265; @@ -58,6 +62,8 @@ Signed-off-by: Jernej Skrabec mutex_init(&dev->dev_mutex); +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.h b/drivers/staging/media/sunxi/cedrus/cedrus.h +index 2c9e14c6396f..2eeb825e5847 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.h +++ b/drivers/staging/media/sunxi/cedrus/cedrus.h @@ -36,6 +36,7 @@ enum cedrus_codec { @@ -110,6 +116,8 @@ Signed-off-by: Jernej Skrabec static inline void cedrus_write(struct cedrus_dev *dev, u32 reg, u32 val) { +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_dec.c b/drivers/staging/media/sunxi/cedrus/cedrus_dec.c +index 81050cde9ed7..842c7058eacf 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_dec.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_dec.c @@ -72,6 +72,11 @@ void cedrus_device_run(void *priv) @@ -124,9 +132,11 @@ Signed-off-by: Jernej Skrabec default: break; } +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c +index bcf050a04ffc..3ef3af5bc9ab 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c -@@ -48,6 +48,7 @@ int cedrus_engine_enable(struct cedrus_c +@@ -48,6 +48,7 @@ int cedrus_engine_enable(struct cedrus_ctx *ctx, enum cedrus_codec codec) break; case CEDRUS_CODEC_H264: @@ -134,9 +144,11 @@ Signed-off-by: Jernej Skrabec reg |= VE_MODE_DEC_H264; break; +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_regs.h b/drivers/staging/media/sunxi/cedrus/cedrus_regs.h +index 9fa062d5d79e..7ab3a2b0aa10 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_regs.h +++ b/drivers/staging/media/sunxi/cedrus/cedrus_regs.h -@@ -552,6 +552,7 @@ +@@ -553,6 +553,7 @@ #define VE_H264_SHS_QP_SCALING_MATRIX_DEFAULT BIT(24) #define VE_H264_CTRL 0x220 @@ -144,7 +156,7 @@ Signed-off-by: Jernej Skrabec #define VE_H264_CTRL_VLD_DATA_REQ_INT BIT(2) #define VE_H264_CTRL_DECODE_ERR_INT BIT(1) #define VE_H264_CTRL_SLICE_DECODE_INT BIT(0) -@@ -561,7 +562,12 @@ +@@ -562,7 +563,12 @@ VE_H264_CTRL_SLICE_DECODE_INT) #define VE_H264_TRIGGER_TYPE 0x224 @@ -157,7 +169,7 @@ Signed-off-by: Jernej Skrabec #define VE_H264_TRIGGER_TYPE_AVC_SLICE_DECODE (8 << 0) #define VE_H264_TRIGGER_TYPE_INIT_SWDEC (7 << 0) #define VE_H264_TRIGGER_TYPE_FLUSH_BITS (3 << 0) -@@ -571,6 +577,7 @@ +@@ -572,6 +578,7 @@ #define VE_H264_STATUS_DECODE_ERR_INT VE_H264_CTRL_DECODE_ERR_INT #define VE_H264_STATUS_SLICE_DECODE_INT VE_H264_CTRL_SLICE_DECODE_INT #define VE_H264_STATUS_VLD_BUSY BIT(8) @@ -165,7 +177,7 @@ Signed-off-by: Jernej Skrabec #define VE_H264_STATUS_INT_MASK VE_H264_CTRL_INT_MASK -@@ -589,10 +596,83 @@ +@@ -590,10 +597,83 @@ #define VE_H264_OUTPUT_FRAME_IDX 0x24c #define VE_H264_EXTRA_BUFFER1 0x250 #define VE_H264_EXTRA_BUFFER2 0x254 @@ -249,20 +261,22 @@ Signed-off-by: Jernej Skrabec #define VE_ISP_INPUT_SIZE 0xa00 #define VE_ISP_INPUT_STRIDE 0xa04 #define VE_ISP_CTRL 0xa08 +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c b/drivers/staging/media/sunxi/cedrus/cedrus_video.c +index 0ab747712b59..9d77b12bb6ba 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c -@@ -49,6 +49,10 @@ static struct cedrus_format cedrus_forma +@@ -48,6 +48,10 @@ static struct cedrus_format cedrus_formats[] = { + .directions = CEDRUS_DECODE_SRC, .capabilities = CEDRUS_CAPABILITY_H265_DEC, }, - { ++ { + .pixelformat = V4L2_PIX_FMT_VP8_FRAME, + .directions = CEDRUS_DECODE_SRC, + }, -+ { + { .pixelformat = V4L2_PIX_FMT_SUNXI_TILED_NV12, .directions = CEDRUS_DECODE_DST, - }, -@@ -110,6 +114,7 @@ void cedrus_prepare_format(struct v4l2_p +@@ -110,6 +114,7 @@ void cedrus_prepare_format(struct v4l2_pix_format *pix_fmt, int extended) case V4L2_PIX_FMT_MPEG2_SLICE: case V4L2_PIX_FMT_H264_SLICE: case V4L2_PIX_FMT_HEVC_SLICE: @@ -270,7 +284,7 @@ Signed-off-by: Jernej Skrabec /* Zero bytes per line for encoded source. */ bytesperline = 0; /* Choose some minimum size since this can't be 0 */ -@@ -506,6 +511,10 @@ static int cedrus_start_streaming(struct +@@ -512,6 +517,10 @@ static int cedrus_start_streaming(struct vb2_queue *vq, unsigned int count) ctx->current_codec = CEDRUS_CODEC_H265; break; @@ -281,6 +295,9 @@ Signed-off-by: Jernej Skrabec default: return -EINVAL; } +diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_vp8.c b/drivers/staging/media/sunxi/cedrus/cedrus_vp8.c +new file mode 100644 +index 000000000000..93beffd07c35 --- /dev/null +++ b/drivers/staging/media/sunxi/cedrus/cedrus_vp8.c @@ -0,0 +1,699 @@ diff --git a/projects/Allwinner/patches/linux/0034-WIP-dw-hdmi-cec-sleep-100ms-on-error.patch b/projects/Allwinner/patches/linux/0033-WIP-dw-hdmi-cec-sleep-100ms-on-error.patch similarity index 76% rename from projects/Allwinner/patches/linux/0034-WIP-dw-hdmi-cec-sleep-100ms-on-error.patch rename to projects/Allwinner/patches/linux/0033-WIP-dw-hdmi-cec-sleep-100ms-on-error.patch index 1f9d4ce0ea..1e6a46a468 100644 --- a/projects/Allwinner/patches/linux/0034-WIP-dw-hdmi-cec-sleep-100ms-on-error.patch +++ b/projects/Allwinner/patches/linux/0033-WIP-dw-hdmi-cec-sleep-100ms-on-error.patch @@ -1,12 +1,14 @@ -From f826ffb93b1ba0cfb9a5cfa3403813674331d4e0 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonas Karlman Date: Tue, 26 Feb 2019 20:45:14 +0000 -Subject: [PATCH 34/44] WIP: dw-hdmi-cec: sleep 100ms on error +Subject: [PATCH] WIP: dw-hdmi-cec: sleep 100ms on error --- drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) +diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c +index 70ab4fbdc23e..4dbc370e538f 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c @@ -4,6 +4,7 @@ @@ -17,7 +19,7 @@ Subject: [PATCH 34/44] WIP: dw-hdmi-cec: sleep 100ms on error #include #include #include -@@ -129,8 +130,15 @@ static irqreturn_t dw_hdmi_cec_hardirq(i +@@ -129,8 +130,15 @@ static irqreturn_t dw_hdmi_cec_hardirq(int irq, void *data) dw_hdmi_write(cec, stat, HDMI_IH_CEC_STAT0); @@ -35,7 +37,7 @@ Subject: [PATCH 34/44] WIP: dw-hdmi-cec: sleep 100ms on error cec->tx_done = true; ret = IRQ_WAKE_THREAD; } else if (stat & CEC_STAT_DONE) { -@@ -141,6 +149,10 @@ static irqreturn_t dw_hdmi_cec_hardirq(i +@@ -141,6 +149,10 @@ static irqreturn_t dw_hdmi_cec_hardirq(int irq, void *data) cec->tx_status = CEC_TX_STATUS_NACK; cec->tx_done = true; ret = IRQ_WAKE_THREAD; @@ -46,7 +48,7 @@ Subject: [PATCH 34/44] WIP: dw-hdmi-cec: sleep 100ms on error } if (stat & CEC_STAT_EOM) { -@@ -173,6 +185,8 @@ static irqreturn_t dw_hdmi_cec_thread(in +@@ -173,6 +185,8 @@ static irqreturn_t dw_hdmi_cec_thread(int irq, void *data) if (cec->tx_done) { cec->tx_done = false; diff --git a/projects/Allwinner/patches/linux/0035-drm-sun4i-Reimplement-plane-z-position-setting-logic.patch b/projects/Allwinner/patches/linux/0034-drm-sun4i-Reimplement-plane-z-position-setting-logic.patch similarity index 84% rename from projects/Allwinner/patches/linux/0035-drm-sun4i-Reimplement-plane-z-position-setting-logic.patch rename to projects/Allwinner/patches/linux/0034-drm-sun4i-Reimplement-plane-z-position-setting-logic.patch index 1f8eab64dd..392d513ba8 100644 --- a/projects/Allwinner/patches/linux/0035-drm-sun4i-Reimplement-plane-z-position-setting-logic.patch +++ b/projects/Allwinner/patches/linux/0034-drm-sun4i-Reimplement-plane-z-position-setting-logic.patch @@ -1,7 +1,7 @@ -From f1c04148f8cc62bf99cb06e348f04452d307ebc8 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Roman Stratiienko Date: Sat, 28 Dec 2019 22:28:17 +0200 -Subject: [PATCH 35/44] drm/sun4i: Reimplement plane z position setting logic +Subject: [PATCH] drm/sun4i: Reimplement plane z position setting logic To set blending channel order register software needs to know state and position of each channel, which impossible at plane commit stage. @@ -18,9 +18,11 @@ Signed-off-by: Jernej Skrabec drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 39 +++-------------------- 4 files changed, 57 insertions(+), 72 deletions(-) +diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c +index 5b42cf25cc86..cb9f6e8044fc 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c -@@ -250,8 +250,45 @@ int sun8i_mixer_drm_format_to_hw(u32 for +@@ -250,8 +250,45 @@ int sun8i_mixer_drm_format_to_hw(u32 format, u32 *hw_format) static void sun8i_mixer_commit(struct sunxi_engine *engine) { @@ -45,11 +47,11 @@ Signed-off-by: Jernej Skrabec + if (zpos >= 0 && zpos < channel_count) + channel_by_zpos[zpos] = i; + } - ++ + j = 0; + for (i = 0; i < channel_count; i++) { + int ch = channel_by_zpos[i]; -+ + + if (ch >= 0) { + pipe_ctl |= SUN8I_MIXER_BLEND_PIPE_CTL_EN(j); + route |= ch << SUN8I_MIXER_BLEND_ROUTE_PIPE_SHIFT(j); @@ -67,7 +69,7 @@ Signed-off-by: Jernej Skrabec regmap_write(engine->regs, SUN8I_MIXER_GLOBAL_DBUFF, SUN8I_MIXER_GLOBAL_DBUFF_ENABLE); } -@@ -489,10 +526,12 @@ static int sun8i_mixer_bind(struct devic +@@ -489,10 +526,12 @@ static int sun8i_mixer_bind(struct device *dev, struct device *master, SUN8I_MIXER_BLEND_COLOR_BLACK); plane_cnt = mixer->cfg->vi_num + mixer->cfg->ui_num; @@ -81,6 +83,8 @@ Signed-off-by: Jernej Skrabec regmap_update_bits(mixer->engine.regs, SUN8I_MIXER_BLEND_PIPE_CTL(base), SUN8I_MIXER_BLEND_PIPE_CTL_EN_MSK, 0); +diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.h b/drivers/gpu/drm/sun4i/sun8i_mixer.h +index ea4fa6fe567a..e7eebe7dd1af 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.h +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.h @@ -12,6 +12,8 @@ @@ -102,6 +106,8 @@ Signed-off-by: Jernej Skrabec }; static inline struct sun8i_mixer * +diff --git a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c +index 816ad4ce8996..9f82e7c33e90 100644 --- a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c +++ b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c @@ -24,12 +24,10 @@ @@ -119,7 +125,7 @@ Signed-off-by: Jernej Skrabec ch_base = sun8i_channel_base(mixer, channel); DRM_DEBUG_DRIVER("%sabling channel %d overlay %d\n", -@@ -44,32 +42,7 @@ static void sun8i_ui_layer_enable(struct +@@ -44,32 +42,7 @@ static void sun8i_ui_layer_enable(struct sun8i_mixer *mixer, int channel, SUN8I_MIXER_CHAN_UI_LAYER_ATTR(ch_base, overlay), SUN8I_MIXER_CHAN_UI_LAYER_ATTR_EN, val); @@ -153,7 +159,7 @@ Signed-off-by: Jernej Skrabec } static int sun8i_ui_layer_update_coord(struct sun8i_mixer *mixer, int channel, -@@ -267,11 +240,9 @@ static void sun8i_ui_layer_atomic_disabl +@@ -267,11 +240,9 @@ static void sun8i_ui_layer_atomic_disable(struct drm_plane *plane, struct drm_plane_state *old_state) { struct sun8i_ui_layer *layer = plane_to_sun8i_ui_layer(plane); @@ -166,7 +172,7 @@ Signed-off-by: Jernej Skrabec } static void sun8i_ui_layer_atomic_update(struct drm_plane *plane, -@@ -279,12 +250,11 @@ static void sun8i_ui_layer_atomic_update +@@ -279,12 +250,11 @@ static void sun8i_ui_layer_atomic_update(struct drm_plane *plane, { struct sun8i_ui_layer *layer = plane_to_sun8i_ui_layer(plane); unsigned int zpos = plane->state->normalized_zpos; @@ -180,7 +186,7 @@ Signed-off-by: Jernej Skrabec return; } -@@ -295,7 +265,7 @@ static void sun8i_ui_layer_atomic_update +@@ -295,7 +265,7 @@ static void sun8i_ui_layer_atomic_update(struct drm_plane *plane, sun8i_ui_layer_update_buffer(mixer, layer->channel, layer->overlay, plane); sun8i_ui_layer_enable(mixer, layer->channel, layer->overlay, @@ -189,6 +195,8 @@ Signed-off-by: Jernej Skrabec } static const struct drm_plane_helper_funcs sun8i_ui_layer_helper_funcs = { +diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c +index 8cc294a9969d..af1d2c564e23 100644 --- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c +++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c @@ -18,8 +18,7 @@ @@ -201,7 +209,7 @@ Signed-off-by: Jernej Skrabec { u32 val, bld_base, ch_base; -@@ -38,32 +37,7 @@ static void sun8i_vi_layer_enable(struct +@@ -38,32 +37,7 @@ static void sun8i_vi_layer_enable(struct sun8i_mixer *mixer, int channel, SUN8I_MIXER_CHAN_VI_LAYER_ATTR(ch_base, overlay), SUN8I_MIXER_CHAN_VI_LAYER_ATTR_EN, val); @@ -235,7 +243,7 @@ Signed-off-by: Jernej Skrabec } static int sun8i_vi_layer_update_coord(struct sun8i_mixer *mixer, int channel, -@@ -370,11 +344,9 @@ static void sun8i_vi_layer_atomic_disabl +@@ -370,11 +344,9 @@ static void sun8i_vi_layer_atomic_disable(struct drm_plane *plane, struct drm_plane_state *old_state) { struct sun8i_vi_layer *layer = plane_to_sun8i_vi_layer(plane); @@ -248,7 +256,7 @@ Signed-off-by: Jernej Skrabec } static void sun8i_vi_layer_atomic_update(struct drm_plane *plane, -@@ -382,12 +354,11 @@ static void sun8i_vi_layer_atomic_update +@@ -382,12 +354,11 @@ static void sun8i_vi_layer_atomic_update(struct drm_plane *plane, { struct sun8i_vi_layer *layer = plane_to_sun8i_vi_layer(plane); unsigned int zpos = plane->state->normalized_zpos; @@ -262,7 +270,7 @@ Signed-off-by: Jernej Skrabec return; } -@@ -398,7 +369,7 @@ static void sun8i_vi_layer_atomic_update +@@ -398,7 +369,7 @@ static void sun8i_vi_layer_atomic_update(struct drm_plane *plane, sun8i_vi_layer_update_buffer(mixer, layer->channel, layer->overlay, plane); sun8i_vi_layer_enable(mixer, layer->channel, layer->overlay, diff --git a/projects/Allwinner/patches/linux/0036-drm-sun4i-Don-t-use-update-regmap-variant-for-blend-.patch b/projects/Allwinner/patches/linux/0035-drm-sun4i-Don-t-use-update-regmap-variant-for-blend-.patch similarity index 74% rename from projects/Allwinner/patches/linux/0036-drm-sun4i-Don-t-use-update-regmap-variant-for-blend-.patch rename to projects/Allwinner/patches/linux/0035-drm-sun4i-Don-t-use-update-regmap-variant-for-blend-.patch index 6dbad80533..d879f2e162 100644 --- a/projects/Allwinner/patches/linux/0036-drm-sun4i-Don-t-use-update-regmap-variant-for-blend-.patch +++ b/projects/Allwinner/patches/linux/0035-drm-sun4i-Don-t-use-update-regmap-variant-for-blend-.patch @@ -1,8 +1,8 @@ -From 144ad308ded7c5617d9574e174b68cbcb622cf4c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sun, 19 Jul 2020 11:28:49 +0200 -Subject: [PATCH 36/44] drm/sun4i: Don't use update regmap variant for blend - pipe register +Subject: [PATCH] drm/sun4i: Don't use update regmap variant for blend pipe + register Readout might return invalid value, so always write it. @@ -11,9 +11,11 @@ Signed-off-by: Jernej Skrabec drivers/gpu/drm/sun4i/sun8i_mixer.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) +diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c +index cb9f6e8044fc..3f2e56bc817d 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c -@@ -282,8 +282,14 @@ static void sun8i_mixer_commit(struct su +@@ -282,8 +282,14 @@ static void sun8i_mixer_commit(struct sunxi_engine *engine) } } @@ -30,7 +32,7 @@ Signed-off-by: Jernej Skrabec regmap_write(mixer->engine.regs, SUN8I_MIXER_BLEND_ROUTE(base), route); -@@ -516,12 +522,6 @@ static int sun8i_mixer_bind(struct devic +@@ -516,12 +522,6 @@ static int sun8i_mixer_bind(struct device *dev, struct device *master, regmap_write(mixer->engine.regs, SUN8I_MIXER_BLEND_BKCOLOR(base), SUN8I_MIXER_BLEND_COLOR_BLACK); @@ -43,7 +45,7 @@ Signed-off-by: Jernej Skrabec regmap_write(mixer->engine.regs, SUN8I_MIXER_BLEND_ATTR_FCOLOR(base, 0), SUN8I_MIXER_BLEND_COLOR_BLACK); -@@ -533,9 +533,6 @@ static int sun8i_mixer_bind(struct devic +@@ -533,9 +533,6 @@ static int sun8i_mixer_bind(struct device *dev, struct device *master, mixer->channel_zpos[i] = -1; } diff --git a/projects/Allwinner/patches/linux/0037-drm-sun4i-mixer-Add-caching-support.patch b/projects/Allwinner/patches/linux/0036-drm-sun4i-mixer-Add-caching-support.patch similarity index 74% rename from projects/Allwinner/patches/linux/0037-drm-sun4i-mixer-Add-caching-support.patch rename to projects/Allwinner/patches/linux/0036-drm-sun4i-mixer-Add-caching-support.patch index fe9c05aeab..315931cdfc 100644 --- a/projects/Allwinner/patches/linux/0037-drm-sun4i-mixer-Add-caching-support.patch +++ b/projects/Allwinner/patches/linux/0036-drm-sun4i-mixer-Add-caching-support.patch @@ -1,7 +1,7 @@ -From 2e5d4ca1c07ddf06f8c3b18fd73baea7ce711169 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sun, 19 Jul 2020 11:37:41 +0200 -Subject: [PATCH 37/44] drm/sun4i: mixer: Add caching support +Subject: [PATCH] drm/sun4i: mixer: Add caching support Most registers are not safe to read out so enable cache in regmap. @@ -10,9 +10,11 @@ Signed-off-by: Jernej Skrabec drivers/gpu/drm/sun4i/sun8i_mixer.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) +diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c +index 3f2e56bc817d..ba239b20a639 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c -@@ -346,11 +346,23 @@ static const struct sunxi_engine_ops sun +@@ -346,11 +346,23 @@ static const struct sunxi_engine_ops sun8i_engine_ops = { .layers_init = sun8i_layers_init, }; diff --git a/projects/Allwinner/patches/linux/0038-mfd-Add-support-for-AC200.patch b/projects/Allwinner/patches/linux/0037-mfd-Add-support-for-AC200.patch similarity index 95% rename from projects/Allwinner/patches/linux/0038-mfd-Add-support-for-AC200.patch rename to projects/Allwinner/patches/linux/0037-mfd-Add-support-for-AC200.patch index 04dd0106f8..87028d1c18 100644 --- a/projects/Allwinner/patches/linux/0038-mfd-Add-support-for-AC200.patch +++ b/projects/Allwinner/patches/linux/0037-mfd-Add-support-for-AC200.patch @@ -1,7 +1,7 @@ -From 59adceb6f34521c0f1a229f20ee9961269daa539 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Fri, 16 Aug 2019 16:38:21 +0200 -Subject: [PATCH 38/44] mfd: Add support for AC200 +Subject: [PATCH] mfd: Add support for AC200 Signed-off-by: Jernej Skrabec --- @@ -13,6 +13,8 @@ Signed-off-by: Jernej Skrabec create mode 100644 drivers/mfd/ac200.c create mode 100644 include/linux/mfd/ac200.h +diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig +index b8847ae04d93..70a11c2f6a6e 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -178,6 +178,15 @@ config MFD_AC100 @@ -31,9 +33,11 @@ Signed-off-by: Jernej Skrabec config MFD_AXP20X tristate select MFD_CORE +diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile +index 1780019d2474..6069e8261bef 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile -@@ -143,6 +143,7 @@ obj-$(CONFIG_MFD_DA9052_SPI) += da9052-s +@@ -143,6 +143,7 @@ obj-$(CONFIG_MFD_DA9052_SPI) += da9052-spi.o obj-$(CONFIG_MFD_DA9052_I2C) += da9052-i2c.o obj-$(CONFIG_MFD_AC100) += ac100.o @@ -41,6 +45,9 @@ Signed-off-by: Jernej Skrabec obj-$(CONFIG_MFD_AXP20X) += axp20x.o obj-$(CONFIG_MFD_AXP20X_I2C) += axp20x-i2c.o obj-$(CONFIG_MFD_AXP20X_RSB) += axp20x-rsb.o +diff --git a/drivers/mfd/ac200.c b/drivers/mfd/ac200.c +new file mode 100644 +index 000000000000..3c95be216cf0 --- /dev/null +++ b/drivers/mfd/ac200.c @@ -0,0 +1,150 @@ @@ -194,6 +201,9 @@ Signed-off-by: Jernej Skrabec +MODULE_DESCRIPTION("MFD core driver for AC200"); +MODULE_AUTHOR("Jernej Skrabec "); +MODULE_LICENSE("GPL v2"); +diff --git a/include/linux/mfd/ac200.h b/include/linux/mfd/ac200.h +new file mode 100644 +index 000000000000..48a21d5c354a --- /dev/null +++ b/include/linux/mfd/ac200.h @@ -0,0 +1,209 @@ diff --git a/projects/Allwinner/patches/linux/0039-net-phy-Add-support-for-AC200-EPHY.patch b/projects/Allwinner/patches/linux/0038-net-phy-Add-support-for-AC200-EPHY.patch similarity index 94% rename from projects/Allwinner/patches/linux/0039-net-phy-Add-support-for-AC200-EPHY.patch rename to projects/Allwinner/patches/linux/0038-net-phy-Add-support-for-AC200-EPHY.patch index c5814cd7c2..84f6229a2d 100644 --- a/projects/Allwinner/patches/linux/0039-net-phy-Add-support-for-AC200-EPHY.patch +++ b/projects/Allwinner/patches/linux/0038-net-phy-Add-support-for-AC200-EPHY.patch @@ -1,7 +1,7 @@ -From cbf68fb141747879e2e6c43584c1e1e3b4d77683 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Fri, 16 Aug 2019 16:38:57 +0200 -Subject: [PATCH 39/44] net: phy: Add support for AC200 EPHY +Subject: [PATCH] net: phy: Add support for AC200 EPHY Signed-off-by: Jernej Skrabec --- @@ -11,6 +11,8 @@ Signed-off-by: Jernej Skrabec 3 files changed, 242 insertions(+) create mode 100644 drivers/net/phy/ac200.c +diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig +index 698bea312adc..782f2f8d2e4b 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig @@ -63,6 +63,13 @@ config SFP @@ -27,6 +29,8 @@ Signed-off-by: Jernej Skrabec config AMD_PHY tristate "AMD PHYs" help +diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile +index a13e402074cf..b0a6c117d57e 100644 --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile @@ -30,6 +30,7 @@ obj-$(CONFIG_SFP) += sfp.o @@ -37,6 +41,9 @@ Signed-off-by: Jernej Skrabec obj-$(CONFIG_ADIN_PHY) += adin.o obj-$(CONFIG_AMD_PHY) += amd.o aquantia-objs += aquantia_main.o +diff --git a/drivers/net/phy/ac200.c b/drivers/net/phy/ac200.c +new file mode 100644 +index 000000000000..e36af123db43 --- /dev/null +++ b/drivers/net/phy/ac200.c @@ -0,0 +1,234 @@ diff --git a/projects/Allwinner/patches/linux/0040-wip-H6-deinterlace.patch b/projects/Allwinner/patches/linux/0039-wip-H6-deinterlace.patch similarity index 97% rename from projects/Allwinner/patches/linux/0040-wip-H6-deinterlace.patch rename to projects/Allwinner/patches/linux/0039-wip-H6-deinterlace.patch index b5bb79679e..c722983d30 100644 --- a/projects/Allwinner/patches/linux/0040-wip-H6-deinterlace.patch +++ b/projects/Allwinner/patches/linux/0039-wip-H6-deinterlace.patch @@ -1,7 +1,7 @@ -From 91c70ea17b58c9205c35cd43a3dd8266bbe035b1 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Mon, 25 May 2020 19:06:07 +0200 -Subject: [PATCH 40/44] wip: H6 deinterlace +Subject: [PATCH] wip: H6 deinterlace Signed-off-by: Jernej Skrabec --- @@ -15,6 +15,8 @@ Signed-off-by: Jernej Skrabec create mode 100644 drivers/media/platform/sunxi/sun50i-di/sun50i-di.c create mode 100644 drivers/media/platform/sunxi/sun50i-di/sun50i-di.h +diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig +index 7e152bbb4fa6..dcb0fe75a879 100644 --- a/drivers/media/platform/Kconfig +++ b/drivers/media/platform/Kconfig @@ -510,6 +510,19 @@ config VIDEO_QCOM_VENUS @@ -37,6 +39,8 @@ Signed-off-by: Jernej Skrabec config VIDEO_SUN8I_DEINTERLACE tristate "Allwinner Deinterlace driver" depends on VIDEO_DEV && VIDEO_V4L2 +diff --git a/drivers/media/platform/sunxi/Makefile b/drivers/media/platform/sunxi/Makefile +index fc537c9f5ca9..b28f3b15329f 100644 --- a/drivers/media/platform/sunxi/Makefile +++ b/drivers/media/platform/sunxi/Makefile @@ -3,4 +3,5 @@ @@ -45,11 +49,17 @@ Signed-off-by: Jernej Skrabec obj-y += sun8i-di/ +obj-y += sun50i-di/ obj-y += sun8i-rotate/ +diff --git a/drivers/media/platform/sunxi/sun50i-di/Makefile b/drivers/media/platform/sunxi/sun50i-di/Makefile +new file mode 100644 +index 000000000000..225b3b808069 --- /dev/null +++ b/drivers/media/platform/sunxi/sun50i-di/Makefile @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0 +obj-$(CONFIG_VIDEO_SUN50I_DEINTERLACE) += sun50i-di.o +diff --git a/drivers/media/platform/sunxi/sun50i-di/sun50i-di.c b/drivers/media/platform/sunxi/sun50i-di/sun50i-di.c +new file mode 100644 +index 000000000000..f6b706fb1a9a --- /dev/null +++ b/drivers/media/platform/sunxi/sun50i-di/sun50i-di.c @@ -0,0 +1,1134 @@ @@ -1187,6 +1197,9 @@ Signed-off-by: Jernej Skrabec +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Jernej Skrabec "); +MODULE_DESCRIPTION("Allwinner Deinterlace driver"); +diff --git a/drivers/media/platform/sunxi/sun50i-di/sun50i-di.h b/drivers/media/platform/sunxi/sun50i-di/sun50i-di.h +new file mode 100644 +index 000000000000..8cb19955ef06 --- /dev/null +++ b/drivers/media/platform/sunxi/sun50i-di/sun50i-di.h @@ -0,0 +1,172 @@ diff --git a/projects/Allwinner/patches/linux/0041-arm64-dts-h6-deinterlace.patch b/projects/Allwinner/patches/linux/0040-arm64-dts-h6-deinterlace.patch similarity index 72% rename from projects/Allwinner/patches/linux/0041-arm64-dts-h6-deinterlace.patch rename to projects/Allwinner/patches/linux/0040-arm64-dts-h6-deinterlace.patch index 87ec6f74f5..e657b5930f 100644 --- a/projects/Allwinner/patches/linux/0041-arm64-dts-h6-deinterlace.patch +++ b/projects/Allwinner/patches/linux/0040-arm64-dts-h6-deinterlace.patch @@ -1,16 +1,18 @@ -From c009b3b707bbde30fa6ff49ca3075160524ea7b9 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Tue, 26 May 2020 20:08:27 +0200 -Subject: [PATCH 41/44] arm64: dts: h6 deinterlace +Subject: [PATCH] arm64: dts: h6 deinterlace Signed-off-by: Jernej Skrabec --- arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+) +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +index 15e794ebf377..11bfd674ea72 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi -@@ -153,6 +153,17 @@ +@@ -153,6 +153,17 @@ mixer0_out_tcon_top_mixer0: endpoint { }; }; diff --git a/projects/Allwinner/patches/linux/0042-ASoC-sun4i-i2s-Add-parenthesis-around-macro-argument.patch b/projects/Allwinner/patches/linux/0041-ASoC-sun4i-i2s-Add-parenthesis-around-macro-argument.patch similarity index 88% rename from projects/Allwinner/patches/linux/0042-ASoC-sun4i-i2s-Add-parenthesis-around-macro-argument.patch rename to projects/Allwinner/patches/linux/0041-ASoC-sun4i-i2s-Add-parenthesis-around-macro-argument.patch index 8aa7fb3a2e..3ad3cc31a7 100644 --- a/projects/Allwinner/patches/linux/0042-ASoC-sun4i-i2s-Add-parenthesis-around-macro-argument.patch +++ b/projects/Allwinner/patches/linux/0041-ASoC-sun4i-i2s-Add-parenthesis-around-macro-argument.patch @@ -1,7 +1,7 @@ -From b10b474925447933bf1d718e6d064190b15b56d9 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Thu, 14 Jan 2021 19:26:03 +0100 -Subject: [PATCH 42/44] ASoC: sun4i-i2s: Add parenthesis around macro arguments +Subject: [PATCH] ASoC: sun4i-i2s: Add parenthesis around macro arguments Several macro arguments are not put inside parenthesis, which may cause subtle issues. @@ -13,6 +13,8 @@ Signed-off-by: Jernej Skrabec sound/soc/sunxi/sun4i-i2s.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) +diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c +index 4b8ca5be0a29..fdefe8cc6365 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -116,16 +116,16 @@ diff --git a/projects/Allwinner/patches/linux/0043-WIP-I2S-multi-channel.patch b/projects/Allwinner/patches/linux/0042-WIP-I2S-multi-channel.patch similarity index 89% rename from projects/Allwinner/patches/linux/0043-WIP-I2S-multi-channel.patch rename to projects/Allwinner/patches/linux/0042-WIP-I2S-multi-channel.patch index 520eca52ee..e6b18b7cf1 100644 --- a/projects/Allwinner/patches/linux/0043-WIP-I2S-multi-channel.patch +++ b/projects/Allwinner/patches/linux/0042-WIP-I2S-multi-channel.patch @@ -1,13 +1,15 @@ -From a19b428a02224e0e01fff4738bbf0632942d18a1 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Fri, 15 Jan 2021 00:13:54 +0100 -Subject: [PATCH 43/44] WIP: I2S multi channel +Subject: [PATCH] WIP: I2S multi channel Signed-off-by: Jernej Skrabec --- sound/soc/sunxi/sun4i-i2s.c | 137 +++++++++++++++++++++++++----------- 1 file changed, 97 insertions(+), 40 deletions(-) +diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c +index fdefe8cc6365..3fdecbf4290f 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -23,7 +23,7 @@ @@ -58,7 +60,7 @@ Signed-off-by: Jernej Skrabec struct snd_dmaengine_dai_dma_data capture_dma_data; struct snd_dmaengine_dai_dma_data playback_dma_data; -@@ -445,7 +446,7 @@ static int sun8i_i2s_get_sr_wss(unsigned +@@ -445,7 +446,7 @@ static int sun8i_i2s_get_sr_wss(unsigned int width) return -EINVAL; } @@ -67,7 +69,7 @@ Signed-off-by: Jernej Skrabec unsigned int channels, unsigned int slots, unsigned int slot_width) { -@@ -464,20 +465,42 @@ static int sun4i_i2s_set_chan_cfg(const +@@ -464,20 +465,42 @@ static int sun4i_i2s_set_chan_cfg(const struct sun4i_i2s *i2s, return 0; } @@ -116,7 +118,7 @@ Signed-off-by: Jernej Skrabec regmap_update_bits(i2s->regmap, SUN8I_I2S_RX_CHAN_SEL_REG, SUN4I_I2S_CHAN_SEL_MASK, SUN4I_I2S_CHAN_SEL(channels)); -@@ -509,29 +532,47 @@ static int sun8i_i2s_set_chan_cfg(const +@@ -509,29 +532,47 @@ static int sun8i_i2s_set_chan_cfg(const struct sun4i_i2s *i2s, SUN8I_I2S_FMT0_LRCK_PERIOD_MASK, SUN8I_I2S_FMT0_LRCK_PERIOD(lrck_period)); @@ -175,7 +177,7 @@ Signed-off-by: Jernej Skrabec regmap_update_bits(i2s->regmap, SUN50I_H6_I2S_RX_CHAN_SEL_REG, SUN50I_H6_I2S_TX_CHAN_SEL_MASK, SUN50I_H6_I2S_TX_CHAN_SEL(channels)); -@@ -563,10 +604,6 @@ static int sun50i_h6_i2s_set_chan_cfg(co +@@ -563,10 +604,6 @@ static int sun50i_h6_i2s_set_chan_cfg(const struct sun4i_i2s *i2s, SUN8I_I2S_FMT0_LRCK_PERIOD_MASK, SUN8I_I2S_FMT0_LRCK_PERIOD(lrck_period)); @@ -186,7 +188,7 @@ Signed-off-by: Jernej Skrabec return 0; } -@@ -711,6 +748,7 @@ static int sun8i_i2s_set_soc_fmt(const s +@@ -711,6 +748,7 @@ static int sun8i_i2s_set_soc_fmt(const struct sun4i_i2s *i2s, { u32 mode, val; u8 offset; @@ -194,7 +196,7 @@ Signed-off-by: Jernej Skrabec /* * DAI clock polarity -@@ -778,9 +816,10 @@ static int sun8i_i2s_set_soc_fmt(const s +@@ -778,9 +816,10 @@ static int sun8i_i2s_set_soc_fmt(const struct sun4i_i2s *i2s, regmap_update_bits(i2s->regmap, SUN4I_I2S_CTRL_REG, SUN8I_I2S_CTRL_MODE_MASK, mode); @@ -208,7 +210,7 @@ Signed-off-by: Jernej Skrabec regmap_update_bits(i2s->regmap, SUN8I_I2S_RX_CHAN_SEL_REG, SUN8I_I2S_TX_CHAN_OFFSET_MASK, SUN8I_I2S_TX_CHAN_OFFSET(offset)); -@@ -818,6 +857,7 @@ static int sun50i_h6_i2s_set_soc_fmt(con +@@ -818,6 +857,7 @@ static int sun50i_h6_i2s_set_soc_fmt(const struct sun4i_i2s *i2s, { u32 mode, val; u8 offset; @@ -216,7 +218,7 @@ Signed-off-by: Jernej Skrabec /* * DAI clock polarity -@@ -885,9 +925,10 @@ static int sun50i_h6_i2s_set_soc_fmt(con +@@ -885,9 +925,10 @@ static int sun50i_h6_i2s_set_soc_fmt(const struct sun4i_i2s *i2s, regmap_update_bits(i2s->regmap, SUN4I_I2S_CTRL_REG, SUN8I_I2S_CTRL_MODE_MASK, mode); @@ -230,7 +232,7 @@ Signed-off-by: Jernej Skrabec regmap_update_bits(i2s->regmap, SUN50I_H6_I2S_RX_CHAN_SEL_REG, SUN50I_H6_I2S_TX_CHAN_SEL_OFFSET_MASK, SUN50I_H6_I2S_TX_CHAN_SEL_OFFSET(offset)); -@@ -1198,8 +1239,14 @@ static const struct reg_default sun8i_i2 +@@ -1198,8 +1239,14 @@ static const struct reg_default sun8i_i2s_reg_defaults[] = { { SUN4I_I2S_DMA_INT_CTRL_REG, 0x00000000 }, { SUN4I_I2S_CLK_DIV_REG, 0x00000000 }, { SUN8I_I2S_CHAN_CFG_REG, 0x00000000 }, @@ -247,7 +249,7 @@ Signed-off-by: Jernej Skrabec { SUN8I_I2S_RX_CHAN_SEL_REG, 0x00000000 }, { SUN8I_I2S_RX_CHAN_MAP_REG, 0x00000000 }, }; -@@ -1212,9 +1259,18 @@ static const struct reg_default sun50i_h +@@ -1212,9 +1259,18 @@ static const struct reg_default sun50i_h6_i2s_reg_defaults[] = { { SUN4I_I2S_DMA_INT_CTRL_REG, 0x00000000 }, { SUN4I_I2S_CLK_DIV_REG, 0x00000000 }, { SUN8I_I2S_CHAN_CFG_REG, 0x00000000 }, @@ -269,7 +271,7 @@ Signed-off-by: Jernej Skrabec { SUN50I_H6_I2S_RX_CHAN_SEL_REG, 0x00000000 }, { SUN50I_H6_I2S_RX_CHAN_MAP0_REG, 0x00000000 }, { SUN50I_H6_I2S_RX_CHAN_MAP1_REG, 0x00000000 }, -@@ -1287,7 +1343,7 @@ static int sun4i_i2s_runtime_resume(stru +@@ -1287,7 +1343,7 @@ static int sun4i_i2s_runtime_resume(struct device *dev) /* Enable the first output line */ regmap_update_bits(i2s->regmap, SUN4I_I2S_CTRL_REG, SUN4I_I2S_CTRL_SDO_EN_MASK, @@ -278,7 +280,7 @@ Signed-off-by: Jernej Skrabec ret = clk_prepare_enable(i2s->mod_clk); if (ret) { -@@ -1529,6 +1585,7 @@ static int sun4i_i2s_probe(struct platfo +@@ -1529,6 +1585,7 @@ static int sun4i_i2s_probe(struct platform_device *pdev) i2s->capture_dma_data.addr = res->start + SUN4I_I2S_FIFO_RX_REG; i2s->capture_dma_data.maxburst = 8; diff --git a/projects/Allwinner/patches/linux/0044-HACK-h3-h5-Add-HDMI-sound-card.patch b/projects/Allwinner/patches/linux/0043-HACK-h3-h5-Add-HDMI-sound-card.patch similarity index 76% rename from projects/Allwinner/patches/linux/0044-HACK-h3-h5-Add-HDMI-sound-card.patch rename to projects/Allwinner/patches/linux/0043-HACK-h3-h5-Add-HDMI-sound-card.patch index 8f44848145..7ea7a705bc 100644 --- a/projects/Allwinner/patches/linux/0044-HACK-h3-h5-Add-HDMI-sound-card.patch +++ b/projects/Allwinner/patches/linux/0043-HACK-h3-h5-Add-HDMI-sound-card.patch @@ -1,16 +1,18 @@ -From d0428e1d4b2a1a3d640f6052646e0f8ca7fc2d53 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sat, 16 Jan 2021 10:57:58 +0100 -Subject: [PATCH 44/44] HACK: h3/h5: Add HDMI sound card +Subject: [PATCH] HACK: h3/h5: Add HDMI sound card Signed-off-by: Jernej Skrabec --- arch/arm/boot/dts/sunxi-h3-h5.dtsi | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) +diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi +index 9be13378d4df..f6b9d8a738d0 100644 --- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi +++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi -@@ -77,6 +77,24 @@ +@@ -77,6 +77,24 @@ framebuffer-tve { }; }; @@ -35,7 +37,7 @@ Signed-off-by: Jernej Skrabec clocks { #address-cells = <1>; #size-cells = <1>; -@@ -672,7 +690,6 @@ +@@ -672,7 +690,6 @@ i2s2: i2s@1c22800 { dmas = <&dma 27>; resets = <&ccu RST_BUS_I2S2>; dma-names = "tx"; @@ -43,7 +45,7 @@ Signed-off-by: Jernej Skrabec }; codec: codec@1c22c00 { -@@ -806,6 +823,7 @@ +@@ -806,6 +823,7 @@ csi: camera@1cb0000 { }; hdmi: hdmi@1ee0000 { diff --git a/projects/Allwinner/patches/linux/0045-h3-h5-power-key-wake-up-source.patch b/projects/Allwinner/patches/linux/0044-h3-h5-power-key-wake-up-source.patch similarity index 100% rename from projects/Allwinner/patches/linux/0045-h3-h5-power-key-wake-up-source.patch rename to projects/Allwinner/patches/linux/0044-h3-h5-power-key-wake-up-source.patch diff --git a/projects/Allwinner/patches/linux/0046-drm-lima-add-governor-data-with-pre-defined-thresholds.patch b/projects/Allwinner/patches/linux/0045-drm-lima-add-governor-data-with-pre-defined-threshol.patch similarity index 80% rename from projects/Allwinner/patches/linux/0046-drm-lima-add-governor-data-with-pre-defined-thresholds.patch rename to projects/Allwinner/patches/linux/0045-drm-lima-add-governor-data-with-pre-defined-threshol.patch index c74efcec2c..91965c9fa5 100644 --- a/projects/Allwinner/patches/linux/0046-drm-lima-add-governor-data-with-pre-defined-thresholds.patch +++ b/projects/Allwinner/patches/linux/0045-drm-lima-add-governor-data-with-pre-defined-threshol.patch @@ -1,6 +1,7 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Christian Hewitt -Subject: [PATCH v2] drm/lima: add governor data with pre-defined thresholds Date: Wed, 27 Jan 2021 19:40:47 +0000 +Subject: [PATCH] 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 @@ -17,9 +18,11 @@ Reviewed-by: Qiang Yu 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 bbe02817721b..bbd9af26fb18 100644 --- a/drivers/gpu/drm/lima/lima_devfreq.c +++ b/drivers/gpu/drm/lima/lima_devfreq.c -@@ -177,8 +177,16 @@ int lima_devfreq_init(struct lima_device +@@ -177,8 +177,16 @@ int lima_devfreq_init(struct lima_device *ldev) lima_devfreq_profile.initial_freq = cur_freq; dev_pm_opp_put(opp); @@ -37,6 +40,8 @@ Reviewed-by: Qiang Yu 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 5eed2975a375..9f4d11887140 100644 --- a/drivers/gpu/drm/lima/lima_devfreq.h +++ b/drivers/gpu/drm/lima/lima_devfreq.h @@ -4,6 +4,7 @@ diff --git a/projects/Allwinner/patches/linux/0047-drm-lima-Use-delayed-timer-as-default-in-devfreq-profile.patch b/projects/Allwinner/patches/linux/0046-drm-lima-Use-delayed-timer-as-default-in-devfreq-pro.patch similarity index 74% rename from projects/Allwinner/patches/linux/0047-drm-lima-Use-delayed-timer-as-default-in-devfreq-profile.patch rename to projects/Allwinner/patches/linux/0046-drm-lima-Use-delayed-timer-as-default-in-devfreq-pro.patch index b6b0ff045d..e2404f372f 100644 --- a/projects/Allwinner/patches/linux/0047-drm-lima-Use-delayed-timer-as-default-in-devfreq-profile.patch +++ b/projects/Allwinner/patches/linux/0046-drm-lima-Use-delayed-timer-as-default-in-devfreq-pro.patch @@ -1,6 +1,7 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Lukasz Luba -Subject: [PATCH] drm/lima: Use delayed timer as default in devfreq profile Date: Wed, 27 Jan 2021 10:51:21 +0000 +Subject: [PATCH] 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 @@ -12,9 +13,11 @@ Reviewed-by: Qiang Yu 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 bbd9af26fb18..9c68243d0218 100644 --- a/drivers/gpu/drm/lima/lima_devfreq.c +++ b/drivers/gpu/drm/lima/lima_devfreq.c -@@ -86,6 +86,7 @@ static int lima_devfreq_get_dev_status(s +@@ -86,6 +86,7 @@ static int lima_devfreq_get_dev_status(struct device *dev, } static struct devfreq_dev_profile lima_devfreq_profile = { diff --git a/projects/Allwinner/patches/linux/0048-drm-panfrost-Add-governor-data-with-pre-defined-thre.patch b/projects/Allwinner/patches/linux/0047-drm-panfrost-Add-governor-data-with-pre-defined-thre.patch similarity index 85% rename from projects/Allwinner/patches/linux/0048-drm-panfrost-Add-governor-data-with-pre-defined-thre.patch rename to projects/Allwinner/patches/linux/0047-drm-panfrost-Add-governor-data-with-pre-defined-thre.patch index 38775afa97..13bd654c86 100644 --- a/projects/Allwinner/patches/linux/0048-drm-panfrost-Add-governor-data-with-pre-defined-thre.patch +++ b/projects/Allwinner/patches/linux/0047-drm-panfrost-Add-governor-data-with-pre-defined-thre.patch @@ -19,9 +19,11 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20210121170445.19761-1-lukas 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 8ab025d0035f..48a84ff5dd56 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c -@@ -134,8 +134,16 @@ int panfrost_devfreq_init(struct panfros +@@ -134,8 +134,16 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) panfrost_devfreq_profile.initial_freq = cur_freq; dev_pm_opp_put(opp); @@ -39,6 +41,8 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20210121170445.19761-1-lukas 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 @@ diff --git a/projects/Allwinner/patches/linux/0049-drm-panfrost-Use-delayed-timer-as-default-in-devfreq.patch b/projects/Allwinner/patches/linux/0048-drm-panfrost-Use-delayed-timer-as-default-in-devfreq.patch similarity index 82% rename from projects/Allwinner/patches/linux/0049-drm-panfrost-Use-delayed-timer-as-default-in-devfreq.patch rename to projects/Allwinner/patches/linux/0048-drm-panfrost-Use-delayed-timer-as-default-in-devfreq.patch index ad17f86f78..4c2ba305da 100644 --- a/projects/Allwinner/patches/linux/0049-drm-panfrost-Use-delayed-timer-as-default-in-devfreq.patch +++ b/projects/Allwinner/patches/linux/0048-drm-panfrost-Use-delayed-timer-as-default-in-devfreq.patch @@ -15,9 +15,11 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20210105164111.30122-1-lukas 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 48a84ff5dd56..826f6d964db1 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c -@@ -81,6 +81,7 @@ static int panfrost_devfreq_get_dev_stat +@@ -81,6 +81,7 @@ static int panfrost_devfreq_get_dev_status(struct device *dev, } static struct devfreq_dev_profile panfrost_devfreq_profile = { diff --git a/projects/Allwinner/patches/linux/0055-wip-h3-h5-cvbs.patch b/projects/Allwinner/patches/linux/0049-wip-h3-h5-cvbs.patch similarity index 89% rename from projects/Allwinner/patches/linux/0055-wip-h3-h5-cvbs.patch rename to projects/Allwinner/patches/linux/0049-wip-h3-h5-cvbs.patch index 1f036803eb..7667e1df77 100644 --- a/projects/Allwinner/patches/linux/0055-wip-h3-h5-cvbs.patch +++ b/projects/Allwinner/patches/linux/0049-wip-h3-h5-cvbs.patch @@ -4,34 +4,34 @@ Date: Wed, 20 Jan 2021 22:15:36 +0100 Subject: [PATCH] wip h3/h5 cvbs --- - arch/arm/boot/dts/sunxi-h3-h5.dtsi | 111 ++++++++++++++++++++- - drivers/clk/sunxi-ng/ccu-sun8i-h3.c | 14 ++- - drivers/gpu/drm/sun4i/Makefile | 2 +- - drivers/gpu/drm/sun4i/sun8i_mixer.c | 42 +++++++- - drivers/gpu/drm/sun4i/sun8i_mixer.h | 5 +- - 6 files changed, 169 insertions(+), 9 deletions(-) + arch/arm/boot/dts/sunxi-h3-h5.dtsi | 111 +++++++++++++++++++++++++++- + drivers/clk/sunxi-ng/ccu-sun8i-h3.c | 14 +++- + drivers/gpu/drm/sun4i/Makefile | 2 +- + drivers/gpu/drm/sun4i/sun8i_mixer.c | 42 ++++++++++- + drivers/gpu/drm/sun4i/sun8i_mixer.h | 5 +- + 5 files changed, 165 insertions(+), 9 deletions(-) diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi -index 22d533d18992..f18959b2e8df 100644 +index f6b9d8a738d0..c5c53e7bf3bc 100644 --- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi +++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi -@@ -101,7 +101,7 @@ osc32k: osc32k_clk { - +@@ -119,7 +119,7 @@ osc32k: osc32k_clk { + de: display-engine { compatible = "allwinner,sun8i-h3-display-engine"; - allwinner,pipelines = <&mixer0>; + allwinner,pipelines = <&mixer0>, <&mixer1>; status = "disabled"; }; - -@@ -138,11 +138,50 @@ ports { + +@@ -156,11 +156,50 @@ ports { #size-cells = <0>; - + mixer0_out: port@1 { + #address-cells = <1>; + #size-cells = <0>; reg = <1>; - + - mixer0_out_tcon0: endpoint { + mixer0_out_tcon0: endpoint@0 { + reg = <0>; @@ -76,14 +76,14 @@ index 22d533d18992..f18959b2e8df 100644 }; }; }; -@@ -171,11 +210,19 @@ ports { +@@ -189,11 +228,19 @@ ports { #size-cells = <0>; - + tcon0_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; reg = <0>; - + - tcon0_in_mixer0: endpoint { + tcon0_in_mixer0: endpoint@0 { + reg = <0>; @@ -95,12 +95,12 @@ index 22d533d18992..f18959b2e8df 100644 + remote-endpoint = <&mixer1_out_tcon0>; + }; }; - + tcon0_out: port@1 { -@@ -191,6 +238,49 @@ tcon0_out_hdmi: endpoint@1 { +@@ -209,6 +256,49 @@ tcon0_out_hdmi: endpoint@1 { }; }; - + + tcon1: lcd-controller@1c0d000 { + compatible = "allwinner,sun8i-h3-tcon-tv", + "allwinner,sun8i-a83t-tcon-tv"; @@ -147,10 +147,10 @@ index 22d533d18992..f18959b2e8df 100644 mmc0: mmc@1c0f000 { /* compatible and clocks are in per SoC .dtsi file */ reg = <0x01c0f000 0x1000>; -@@ -792,6 +882,21 @@ csi: camera@1cb0000 { +@@ -822,6 +912,21 @@ csi: camera@1cb0000 { status = "disabled"; }; - + + tve: tv-encoder@1e00000 { + compatible = "allwinner,sun8i-h3-tv-encoder", + "allwinner,sun4i-a10-tv-encoder"; @@ -167,15 +167,15 @@ index 22d533d18992..f18959b2e8df 100644 + }; + hdmi: hdmi@1ee0000 { + #sound-dai-cells = <0>; compatible = "allwinner,sun8i-h3-dw-hdmi", - "allwinner,sun8i-a83t-dw-hdmi"; diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-h3.c b/drivers/clk/sunxi-ng/ccu-sun8i-h3.c index 7e629a4493af..334b7edea3b7 100644 --- a/drivers/clk/sunxi-ng/ccu-sun8i-h3.c +++ b/drivers/clk/sunxi-ng/ccu-sun8i-h3.c @@ -456,8 +456,18 @@ static SUNXI_CCU_M_WITH_MUX_GATE(tcon_clk, "tcon", tcon_parents, CLK_SET_RATE_PARENT); - + static const char * const tve_parents[] = { "pll-de", "pll-periph1" }; -static SUNXI_CCU_M_WITH_MUX_GATE(tve_clk, "tve", tve_parents, - 0x120, 0, 4, 24, 3, BIT(31), 0); @@ -191,7 +191,7 @@ index 7e629a4493af..334b7edea3b7 100644 + &ccu_div_ops, 0), + }, +}; - + static const char * const deinterlace_parents[] = { "pll-periph0", "pll-periph1" }; static SUNXI_CCU_M_WITH_MUX_GATE(deinterlace_clk, "deinterlace", deinterlace_parents, diff --git a/drivers/gpu/drm/sun4i/Makefile b/drivers/gpu/drm/sun4i/Makefile @@ -199,22 +199,22 @@ index 0d04f2447b01..7b151994e904 100644 --- a/drivers/gpu/drm/sun4i/Makefile +++ b/drivers/gpu/drm/sun4i/Makefile @@ -16,7 +16,7 @@ sun8i-drm-hdmi-y += sun8i_hdmi_phy_clk.o - + sun8i-mixer-y += sun8i_mixer.o sun8i_ui_layer.o \ sun8i_vi_layer.o sun8i_ui_scaler.o \ - sun8i_vi_scaler.o sun8i_csc.o + sun8i_vi_scaler.o sun8i_csc.o sun4i_tv.o - + sun4i-tcon-y += sun4i_crtc.o sun4i-tcon-y += sun4i_dotclock.o diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c -index 5b42cf25cc86..35ca78a30087 100644 +index ba239b20a639..536ff2d15926 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c @@ -32,6 +32,12 @@ struct de2_fmt_info { u32 de2_fmt; }; - + +static const u32 sun8i_rgb2yuv_coef[12] = { + 0x00000107, 0x00000204, 0x00000064, 0x00004200, + 0x00001f68, 0x00001ed6, 0x000001c2, 0x00020200, @@ -224,10 +224,10 @@ index 5b42cf25cc86..35ca78a30087 100644 static const struct de2_fmt_info de2_formats[] = { { .drm_fmt = DRM_FORMAT_ARGB8888, -@@ -298,9 +304,28 @@ static struct drm_plane **sun8i_layers_init(struct drm_device *drm, +@@ -341,9 +347,28 @@ static struct drm_plane **sun8i_layers_init(struct drm_device *drm, return planes; } - + +static void sun8i_mixer_apply_color_correction(struct sunxi_engine *engine) +{ + DRM_DEBUG_DRIVER("Applying RGB to YUV color correction\n"); @@ -253,12 +253,12 @@ index 5b42cf25cc86..35ca78a30087 100644 + .apply_color_correction = sun8i_mixer_apply_color_correction, + .disable_color_correction = sun8i_mixer_disable_color_correction, }; - - static const struct regmap_config sun8i_mixer_regmap_config = { -@@ -560,6 +585,15 @@ static const struct sun8i_mixer_cfg sun8i_h3_mixer0_cfg = { + + static bool sun8i_mixer_volatile_reg(struct device *dev, unsigned int reg) +@@ -608,6 +633,15 @@ static const struct sun8i_mixer_cfg sun8i_h3_mixer0_cfg = { .vi_num = 1, }; - + +static const struct sun8i_mixer_cfg sun8i_h3_mixer1_cfg = { + .ccsc = 1, + .mod_rate = 432000000, @@ -271,7 +271,7 @@ index 5b42cf25cc86..35ca78a30087 100644 static const struct sun8i_mixer_cfg sun8i_r40_mixer0_cfg = { .ccsc = 0, .mod_rate = 297000000, -@@ -628,6 +662,10 @@ static const struct of_device_id sun8i_mixer_of_table[] = { +@@ -676,6 +710,10 @@ static const struct of_device_id sun8i_mixer_of_table[] = { .compatible = "allwinner,sun8i-h3-de2-mixer-0", .data = &sun8i_h3_mixer0_cfg, }, @@ -283,13 +283,13 @@ index 5b42cf25cc86..35ca78a30087 100644 .compatible = "allwinner,sun8i-r40-de2-mixer-0", .data = &sun8i_r40_mixer0_cfg, diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.h b/drivers/gpu/drm/sun4i/sun8i_mixer.h -index 7576b523fdbb..6593085cecf3 100644 +index e7eebe7dd1af..dc45a37ae56e 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.h +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.h @@ -120,6 +120,10 @@ /* format 20 is packed YVU444 10-bit */ /* format 21 is packed YUV444 10-bit */ - + +/* The DCSC sub-engine is used to do color space conversation */ +#define SUN8I_MIXER_DCSC_EN 0xb0000 +#define SUN8I_MIXER_DCSC_COEF_REG(x) (0xb0010 + 0x4 * (x)) @@ -302,6 +302,6 @@ index 7576b523fdbb..6593085cecf3 100644 #define SUN8I_MIXER_ASE_EN 0xa8000 #define SUN8I_MIXER_FCC_EN 0xaa000 -#define SUN8I_MIXER_DCSC_EN 0xb0000 - + #define SUN50I_MIXER_FCE_EN 0x70000 #define SUN50I_MIXER_PEAK_EN 0x70800 diff --git a/projects/Allwinner/patches/linux/0059-WIP-media-uapi-hevc-add-fields-needed-for-rkvdec.patch b/projects/Allwinner/patches/linux/0050-WIP-media-uapi-hevc-add-fields-needed-for-rkvdec.patch similarity index 98% rename from projects/Allwinner/patches/linux/0059-WIP-media-uapi-hevc-add-fields-needed-for-rkvdec.patch rename to projects/Allwinner/patches/linux/0050-WIP-media-uapi-hevc-add-fields-needed-for-rkvdec.patch index 63d1a7d76e..0b8e2c1352 100644 --- a/projects/Allwinner/patches/linux/0059-WIP-media-uapi-hevc-add-fields-needed-for-rkvdec.patch +++ b/projects/Allwinner/patches/linux/0050-WIP-media-uapi-hevc-add-fields-needed-for-rkvdec.patch @@ -11,7 +11,7 @@ Signed-off-by: Jonas Karlman 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/include/media/hevc-ctrls.h b/include/media/hevc-ctrls.h -index 6e881b7896bc..46936bae7c30 100644 +index ffc701e268eb..632f7b4357be 100644 --- a/include/media/hevc-ctrls.h +++ b/include/media/hevc-ctrls.h @@ -56,6 +56,9 @@ enum v4l2_mpeg_video_hevc_start_code { diff --git a/projects/Allwinner/patches/linux/0060-HACK-media-uapi-hevc-tiles-and-num_slices.patch b/projects/Allwinner/patches/linux/0051-HACK-media-uapi-hevc-tiles-and-num_slices.patch similarity index 96% rename from projects/Allwinner/patches/linux/0060-HACK-media-uapi-hevc-tiles-and-num_slices.patch rename to projects/Allwinner/patches/linux/0051-HACK-media-uapi-hevc-tiles-and-num_slices.patch index e24549b10c..4004a885d1 100644 --- a/projects/Allwinner/patches/linux/0060-HACK-media-uapi-hevc-tiles-and-num_slices.patch +++ b/projects/Allwinner/patches/linux/0051-HACK-media-uapi-hevc-tiles-and-num_slices.patch @@ -8,7 +8,7 @@ Subject: [PATCH] HACK: media: uapi: hevc: tiles and num_slices 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/media/hevc-ctrls.h b/include/media/hevc-ctrls.h -index 46936bae7c30..4d51c148d0ba 100644 +index 632f7b4357be..10a4296ac219 100644 --- a/include/media/hevc-ctrls.h +++ b/include/media/hevc-ctrls.h @@ -80,7 +80,8 @@ struct v4l2_ctrl_hevc_sps { diff --git a/projects/Allwinner/patches/linux/0061-WIP-drm-bridge-synopsys-Fix-CEC-not-working-after-power.patch b/projects/Allwinner/patches/linux/0052-WIP-drm-bridge-synopsys-Fix-CEC-not-working-after-power.patch similarity index 100% rename from projects/Allwinner/patches/linux/0061-WIP-drm-bridge-synopsys-Fix-CEC-not-working-after-power.patch rename to projects/Allwinner/patches/linux/0052-WIP-drm-bridge-synopsys-Fix-CEC-not-working-after-power.patch diff --git a/projects/Allwinner/patches/linux/0056-drm-sun4i-dw-hdmi-Fix-HDMI-PHY-clock-setup.patch b/projects/Allwinner/patches/linux/0056-drm-sun4i-dw-hdmi-Fix-HDMI-PHY-clock-setup.patch deleted file mode 100644 index 2fbf20dab2..0000000000 --- a/projects/Allwinner/patches/linux/0056-drm-sun4i-dw-hdmi-Fix-HDMI-PHY-clock-setup.patch +++ /dev/null @@ -1,210 +0,0 @@ -From 887d1018e2c5ab5e81edbd1318bbf4bbd2c739b0 Mon Sep 17 00:00:00 2001 -From: Jernej Skrabec -Date: Sun, 12 Sep 2021 20:15:26 +0200 -Subject: [PATCH] drm/sun4i: dw-hdmi: Fix HDMI PHY clock setup - -Recent rework which made HDMI PHY driver a platform device inadvertely -reversed clock setup order. HW is very touch about it. Proper way is to -handle controllers resets and clocks first and HDMI PHYs second. - -Move HDMI PHY reset & clocks handling to sun8i_hdmi_phy_init() which -will assure that code is executed after controllers reset & clocks are -handled. Additionally, add sun8i_hdmi_phy_deinit() which will deinit it -at controllers driver unload. - -Fixes: 9bf3797796f5 ("drm/sun4i: dw-hdmi: Make HDMI PHY into a platform device") -Signed-off-by: Jernej Skrabec ---- - drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c | 7 +- - drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h | 4 +- - drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c | 97 ++++++++++++++------------ - 3 files changed, 61 insertions(+), 47 deletions(-) - -diff --git a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c -index f75fb157f2ff..5fa5407ac583 100644 ---- a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c -+++ b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c -@@ -216,11 +216,13 @@ static int sun8i_dw_hdmi_bind(struct device *dev, struct device *master, - goto err_disable_clk_tmds; - } - -+ ret = sun8i_hdmi_phy_init(hdmi->phy); -+ if (ret) -+ return ret; -+ - drm_encoder_helper_add(encoder, &sun8i_dw_hdmi_encoder_helper_funcs); - drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS); - -- sun8i_hdmi_phy_init(hdmi->phy); -- - plat_data->mode_valid = hdmi->quirks->mode_valid; - plat_data->use_drm_infoframe = hdmi->quirks->use_drm_infoframe; - sun8i_hdmi_phy_set_ops(hdmi->phy, plat_data); -@@ -262,6 +264,7 @@ static void sun8i_dw_hdmi_unbind(struct device *dev, struct device *master, - struct sun8i_dw_hdmi *hdmi = dev_get_drvdata(dev); - - dw_hdmi_unbind(hdmi->hdmi); -+ sun8i_hdmi_phy_deinit(hdmi->phy); - clk_disable_unprepare(hdmi->clk_tmds); - reset_control_assert(hdmi->rst_ctrl); - gpiod_set_value(hdmi->ddc_en, 0); -diff --git a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h -index 74f6ed0e2570..bffe1b9cd3dc 100644 ---- a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h -+++ b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h -@@ -169,6 +169,7 @@ struct sun8i_hdmi_phy { - struct clk *clk_phy; - struct clk *clk_pll0; - struct clk *clk_pll1; -+ struct device *dev; - unsigned int rcal; - struct regmap *regs; - struct reset_control *rst_phy; -@@ -205,7 +206,8 @@ encoder_to_sun8i_dw_hdmi(struct drm_encoder *encoder) - - int sun8i_hdmi_phy_get(struct sun8i_dw_hdmi *hdmi, struct device_node *node); - --void sun8i_hdmi_phy_init(struct sun8i_hdmi_phy *phy); -+int sun8i_hdmi_phy_init(struct sun8i_hdmi_phy *phy); -+void sun8i_hdmi_phy_deinit(struct sun8i_hdmi_phy *phy); - void sun8i_hdmi_phy_set_ops(struct sun8i_hdmi_phy *phy, - struct dw_hdmi_plat_data *plat_data); - -diff --git a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c -index c9239708d398..78b152973957 100644 ---- a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c -+++ b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c -@@ -506,9 +506,60 @@ static void sun8i_hdmi_phy_init_h3(struct sun8i_hdmi_phy *phy) - phy->rcal = (val & SUN8I_HDMI_PHY_ANA_STS_RCAL_MASK) >> 2; - } - --void sun8i_hdmi_phy_init(struct sun8i_hdmi_phy *phy) -+int sun8i_hdmi_phy_init(struct sun8i_hdmi_phy *phy) - { -+ int ret; -+ -+ ret = reset_control_deassert(phy->rst_phy); -+ if (ret) { -+ dev_err(phy->dev, "Cannot deassert phy reset control: %d\n", ret); -+ return ret; -+ } -+ -+ ret = clk_prepare_enable(phy->clk_bus); -+ if (ret) { -+ dev_err(phy->dev, "Cannot enable bus clock: %d\n", ret); -+ goto err_deassert_rst_phy; -+ } -+ -+ ret = clk_prepare_enable(phy->clk_mod); -+ if (ret) { -+ dev_err(phy->dev, "Cannot enable mod clock: %d\n", ret); -+ goto err_disable_clk_bus; -+ } -+ -+ if (phy->variant->has_phy_clk) { -+ ret = sun8i_phy_clk_create(phy, phy->dev, -+ phy->variant->has_second_pll); -+ if (ret) { -+ dev_err(phy->dev, "Couldn't create the PHY clock\n"); -+ goto err_disable_clk_mod; -+ } -+ -+ clk_prepare_enable(phy->clk_phy); -+ } -+ - phy->variant->phy_init(phy); -+ -+ return 0; -+ -+err_disable_clk_mod: -+ clk_disable_unprepare(phy->clk_mod); -+err_disable_clk_bus: -+ clk_disable_unprepare(phy->clk_bus); -+err_deassert_rst_phy: -+ reset_control_assert(phy->rst_phy); -+ -+ return ret; -+} -+ -+void sun8i_hdmi_phy_deinit(struct sun8i_hdmi_phy *phy) -+{ -+ clk_disable_unprepare(phy->clk_mod); -+ clk_disable_unprepare(phy->clk_bus); -+ clk_disable_unprepare(phy->clk_phy); -+ -+ reset_control_assert(phy->rst_phy); - } - - void sun8i_hdmi_phy_set_ops(struct sun8i_hdmi_phy *phy, -@@ -638,6 +689,7 @@ static int sun8i_hdmi_phy_probe(struct platform_device *pdev) - return -ENOMEM; - - phy->variant = (struct sun8i_hdmi_phy_variant *)match->data; -+ phy->dev = dev; - - ret = of_address_to_resource(node, 0, &res); - if (ret) { -@@ -696,47 +748,10 @@ static int sun8i_hdmi_phy_probe(struct platform_device *pdev) - goto err_put_clk_pll1; - } - -- ret = reset_control_deassert(phy->rst_phy); -- if (ret) { -- dev_err(dev, "Cannot deassert phy reset control: %d\n", ret); -- goto err_put_rst_phy; -- } -- -- ret = clk_prepare_enable(phy->clk_bus); -- if (ret) { -- dev_err(dev, "Cannot enable bus clock: %d\n", ret); -- goto err_deassert_rst_phy; -- } -- -- ret = clk_prepare_enable(phy->clk_mod); -- if (ret) { -- dev_err(dev, "Cannot enable mod clock: %d\n", ret); -- goto err_disable_clk_bus; -- } -- -- if (phy->variant->has_phy_clk) { -- ret = sun8i_phy_clk_create(phy, dev, -- phy->variant->has_second_pll); -- if (ret) { -- dev_err(dev, "Couldn't create the PHY clock\n"); -- goto err_disable_clk_mod; -- } -- -- clk_prepare_enable(phy->clk_phy); -- } -- - platform_set_drvdata(pdev, phy); - - return 0; - --err_disable_clk_mod: -- clk_disable_unprepare(phy->clk_mod); --err_disable_clk_bus: -- clk_disable_unprepare(phy->clk_bus); --err_deassert_rst_phy: -- reset_control_assert(phy->rst_phy); --err_put_rst_phy: -- reset_control_put(phy->rst_phy); - err_put_clk_pll1: - clk_put(phy->clk_pll1); - err_put_clk_pll0: -@@ -753,12 +768,6 @@ static int sun8i_hdmi_phy_remove(struct platform_device *pdev) - { - struct sun8i_hdmi_phy *phy = platform_get_drvdata(pdev); - -- clk_disable_unprepare(phy->clk_mod); -- clk_disable_unprepare(phy->clk_bus); -- clk_disable_unprepare(phy->clk_phy); -- -- reset_control_assert(phy->rst_phy); -- - reset_control_put(phy->rst_phy); - - clk_put(phy->clk_pll0); --- -2.33.0 -