From 09854a637db47a4bf619eadeac497bdabc34e2e7 Mon Sep 17 00:00:00 2001 From: Michael Klein Date: Wed, 4 Nov 2020 22:03:26 +0100 Subject: [PATCH] Allwinner: H2+: add support for H2+ boards --- projects/Allwinner/devices/H2-plus/options | 50 +++++++++++++++++ .../linux/16-H3-add-HDMI-sound-nodes.patch | 56 +++++++++++++++++++ ...rsion-to-correct-multi-channel-audio.patch | 24 ++++++++ ...bian-add-bananapim2-zero-z1-HDMI-out.patch | 52 +++++++++++++++++ 4 files changed, 182 insertions(+) create mode 100644 projects/Allwinner/devices/H2-plus/options create mode 100644 projects/Allwinner/devices/H2-plus/patches/linux/16-H3-add-HDMI-sound-nodes.patch create mode 100644 projects/Allwinner/devices/H2-plus/patches/linux/17-Add-frame-inversion-to-correct-multi-channel-audio.patch create mode 100644 projects/Allwinner/devices/H2-plus/patches/linux/50-armbian-add-bananapim2-zero-z1-HDMI-out.patch diff --git a/projects/Allwinner/devices/H2-plus/options b/projects/Allwinner/devices/H2-plus/options new file mode 100644 index 0000000000..0b2e10dbb4 --- /dev/null +++ b/projects/Allwinner/devices/H2-plus/options @@ -0,0 +1,50 @@ +################################################################################ +# setup system defaults +################################################################################ + + # The TARGET_CPU variable controls which processor should be targeted for + # generated code. + case $TARGET_ARCH in + arm) + # TARGET_CPU: + # arm2 arm250 arm3 arm6 arm60 arm600 arm610 arm620 arm7 arm7m arm7d + # arm7dm arm7di arm7dmi arm70 arm700 arm700i arm710 arm710c + # arm7100 arm720 arm7500 arm7500fe arm7tdmi arm7tdmi-s arm710t + # arm720t arm740t strongarm strongarm110 strongarm1100 + # strongarm1110 arm8 arm810 arm9 arm9e arm920 arm920t arm922t + # arm946e-s arm966e-s arm968e-s arm926ej-s arm940t arm9tdmi + # arm10tdmi arm1020t arm1026ej-s arm10e arm1020e arm1022e + # arm1136j-s arm1136jf-s mpcore mpcorenovfp arm1156t2-s + # arm1176jz-s arm1176jzf-s cortex-a8 cortex-a9 cortex-r4 + # cortex-r4f cortex-m3 cortex-m1 xscale iwmmxt iwmmxt2 ep9312. + TARGET_CPU="cortex-a7" + + # TARGET_FLOAT: + # Specifies which floating-point ABI to use. Permissible values are: + # soft hard + TARGET_FLOAT="hard" + + # TARGET_FPU: + # This specifies what floating point hardware (or hardware emulation) is + # available on the target. Permissible names are: + # fpa fpe2 fpe3 maverick vfp vfpv3 vfpv3-fp16 vfpv3-d16 vfpv3-d16-fp16 + # vfpv3xd vfpv3xd-fp16 neon neon-fp16 vfpv4 vfpv4-d16 fpv4-sp-d16 + # neon-vfpv4. + TARGET_FPU="neon-vfpv4" + ;; + esac + + # Kernel target + KERNEL_TARGET="zImage" + + # OpenGL-ES implementation to use (no / bcm2835-driver / gpu-viv-bin-mx6q) + OPENGLES="mesa" + + # Mali GPU family + MALI_FAMILY="400" + + # KODI Player implementation to use (default / bcm2835-driver / libfslvpuwrap) + KODIPLAYER_DRIVER="$OPENGLES" + + # set the addon project + ADDON_PROJECT="ARMv7" diff --git a/projects/Allwinner/devices/H2-plus/patches/linux/16-H3-add-HDMI-sound-nodes.patch b/projects/Allwinner/devices/H2-plus/patches/linux/16-H3-add-HDMI-sound-nodes.patch new file mode 100644 index 0000000000..1515ba3355 --- /dev/null +++ b/projects/Allwinner/devices/H2-plus/patches/linux/16-H3-add-HDMI-sound-nodes.patch @@ -0,0 +1,56 @@ +diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi +index 8aa2befc..d3d70eac 100644 +--- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi ++++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi +@@ -53,6 +53,23 @@ + #address-cells = <1>; + #size-cells = <1>; + ++ sound_hdmi: sound { ++ compatible = "simple-audio-card"; ++ simple-audio-card,format = "i2s"; ++ simple-audio-card,name = "allwinner-hdmi"; ++ simple-audio-card,mclk-fs = <128>; ++ ++ simple-audio-card,codec { ++ sound-dai = <&hdmi>; ++ }; ++ ++ simple-audio-card,cpu { ++ sound-dai = <&i2s2>; ++ dai-tdm-slot-num = <2>; ++ dai-tdm-slot-width = <32>; ++ }; ++ }; ++ + clocks { + #address-cells = <1>; + #size-cells = <1>; +@@ -631,6 +648,19 @@ + status = "disabled"; + }; + ++ i2s2: i2s@1c22800 { ++ #sound-dai-cells = <0>; ++ compatible = "allwinner,sun8i-h3-i2s"; ++ reg = <0x01c22800 0x400>; ++ interrupts = ; ++ clocks = <&ccu CLK_BUS_I2S2>, <&ccu CLK_I2S2>; ++ clock-names = "apb", "mod"; ++ dmas = <&dma 27>; ++ resets = <&ccu RST_BUS_I2S2>; ++ dma-names = "tx"; ++ allwinner,playback-channels = <8>; ++ }; ++ + codec: codec@1c22c00 { + #sound-dai-cells = <0>; + compatible = "allwinner,sun8i-h3-codec"; +@@ -110,6 +126,7 @@ + }; + + hdmi: hdmi@1ee0000 { ++ #sound-dai-cells = <0>; + compatible = "allwinner,sun8i-h3-dw-hdmi", + "allwinner,sun8i-a83t-dw-hdmi"; + reg = <0x01ee0000 0x10000>; diff --git a/projects/Allwinner/devices/H2-plus/patches/linux/17-Add-frame-inversion-to-correct-multi-channel-audio.patch b/projects/Allwinner/devices/H2-plus/patches/linux/17-Add-frame-inversion-to-correct-multi-channel-audio.patch new file mode 100644 index 0000000000..21e13cbfd7 --- /dev/null +++ b/projects/Allwinner/devices/H2-plus/patches/linux/17-Add-frame-inversion-to-correct-multi-channel-audio.patch @@ -0,0 +1,24 @@ +From 51dcda7a261bcadca0a8f5e6fe6241ec266438d0 Mon Sep 17 00:00:00 2001 +From: Marcus Cooper +Date: Thu, 2 Jan 2020 19:03:35 +0100 +Subject: [PATCH] Add frame inversion to correct multi-channel audio + +--- + arch/arm/boot/dts/sunxi-h3-h5.dtsi | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi +index 8644435e66d3..7375a9479e84 100644 +--- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi ++++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi +@@ -82,6 +82,7 @@ + simple-audio-card,format = "i2s"; + simple-audio-card,name = "allwinner-hdmi"; + simple-audio-card,mclk-fs = <128>; ++ simple-audio-card,frame-inversion; + + simple-audio-card,codec { + sound-dai = <&hdmi>; +-- +2.24.1 + diff --git a/projects/Allwinner/devices/H2-plus/patches/linux/50-armbian-add-bananapim2-zero-z1-HDMI-out.patch b/projects/Allwinner/devices/H2-plus/patches/linux/50-armbian-add-bananapim2-zero-z1-HDMI-out.patch new file mode 100644 index 0000000000..0ef48b0586 --- /dev/null +++ b/projects/Allwinner/devices/H2-plus/patches/linux/50-armbian-add-bananapim2-zero-z1-HDMI-out.patch @@ -0,0 +1,52 @@ +commit 9702424ea23471e3bdbe6a150e28a1ecdf837d2c +Author: PJBrs +Date: Fri Feb 21 08:56:04 2020 +0100 + + ARM: dts: sunxi: h2-plus-bananapi-m2-zero: Add HDMI out + + Add HDMI out, including the display engine, to the BananaPi + M2 Zero. + +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 38e8da594e44..9051a1097258 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 @@ + stdout-path = "serial0:115200n8"; + }; + ++ connector { ++ compatible = "hdmi-connector"; ++ type = "a"; ++ ++ port { ++ hdmi_con_in: endpoint { ++ remote-endpoint = <&hdmi_out_con>; ++ }; ++ }; ++ }; ++ + leds { + compatible = "gpio-leds"; + +@@ -140,6 +151,20 @@ + }; + }; + ++&de { ++ status = "okay"; ++}; ++ ++&hdmi { ++ status = "okay"; ++}; ++ ++&hdmi_out { ++ hdmi_out_con: endpoint { ++ remote-endpoint = <&hdmi_con_in>; ++ }; ++}; ++ + &ohci0 { + status = "okay"; + };