From 10c94060669e52f0257f46ed87a45a74584e300f Mon Sep 17 00:00:00 2001 From: August <2819763+Dangku@users.noreply.github.com> Date: Fri, 23 Feb 2024 18:47:16 +0800 Subject: [PATCH] dts: support spdif and i2s2 --- .../h618/configs/m4berry/linux-5.4/board.dts | 54 +++++++-- .../h618/configs/m4berry/uboot-board.dts | 5 +- .../h618/configs/m4zero/linux-5.4/board.dts | 112 +++++++++++------- .../chips/h618/configs/m4zero/uboot-board.dts | 1 + 4 files changed, 119 insertions(+), 53 deletions(-) diff --git a/longan/device/config/chips/h618/configs/m4berry/linux-5.4/board.dts b/longan/device/config/chips/h618/configs/m4berry/linux-5.4/board.dts index 4fe34fadab..b2215193ad 100644 --- a/longan/device/config/chips/h618/configs/m4berry/linux-5.4/board.dts +++ b/longan/device/config/chips/h618/configs/m4berry/linux-5.4/board.dts @@ -485,21 +485,35 @@ }; ahub_daudio0_pins_a: ahub_daudio0@0 { - pins = "PA6", "PA7", "PA8", "PA9"; + pins = "PI0", "PI1", "PI2"; function = "i2s0"; drive-strength = <20>; bias-disable; }; - ahub_daudio0_pins_b: ahub_daudio0_sleep@0 { - pins = "PA6", "PA7", "PA8", "PA9"; + ahub_daudio0_pins_b: ahub_daudio0@1 { + pins = "PI3"; + function = "i2s0_dout0"; + drive-strength = <20>; + bias-disable; + }; + + ahub_daudio0_pins_c: ahub_daudio0@2 { + pins = "PI4"; + function = "i2s0_din0"; + drive-strength = <20>; + bias-disable; + }; + + ahub_daudio0_pins_d: ahub_daudio0_sleep@0 { + pins = "PI0", "PI1", "PI2", "PI3", "PI4"; function = "gpio_in"; drive-strength = <20>; bias-disable; }; ahub_daudio2_pins_a: ahub_daudio2@0 { - pins = "PG11", "PG12"; + pins = "PG10", "PG11", "PG12"; function = "i2s2"; drive-strength = <20>; bias-disable; @@ -520,7 +534,7 @@ }; ahub_daudio2_pins_d: ahub_daudio2_sleep@0 { - pins = "PG11", "PG12", "PG13", "PG14"; + pins = "PG10", "PG11", "PG12", "PG13", "PG14"; function = "gpio_in"; drive-strength = <20>; bias-disable; @@ -624,6 +638,13 @@ pinctrl-names = "default", "sleep"; twi_drv_used = <1>; status = "disabled"; + + pcm5122: pcm5122@4d { + compatible = "ti,pcm5122"; + reg = <0x4d>; + #sound-dai-cells = <0>; + status = "disabled"; + }; }; &twi5 { @@ -899,7 +920,6 @@ &rfkill { compatible = "allwinner,sunxi-rfkill"; //chip_en = <&pio PC 2 GPIO_ACTIVE_HIGH>; - chip_en; power_en; pinctrl-0; pinctrl-names; @@ -1008,8 +1028,8 @@ hdmi_mode_check = <1>; fb0_format = <0>; - fb0_width = <1280>; - fb0_height = <720>; + fb0_width = <1920>; + fb0_height = <1080>; fb1_format = <0>; fb1_width = <0>; @@ -1182,6 +1202,14 @@ status = "okay"; }; +&spdif { + status = "disabled"; +}; + +&soundspdif { + status = "disabled"; +}; + /* 40pin spidifout, pin36 */ /* audio dirver module -> spdif */ &spdif_plat { @@ -1194,6 +1222,7 @@ }; &spdif_mach { + soundcard-mach,playback-only; status = "disabled"; }; @@ -1212,8 +1241,8 @@ rx_pin = <0>; /* pinctrl_used; */ /* pinctrl-names= "default","sleep"; */ - /* pinctrl-0 = <&ahub_daudio0_pins_a>; */ - /* pinctrl-1 = <&ahub_daudio0_pins_b>; */ + /* pinctrl-0 = <&ahub_daudio0_pins_a &ahub_daudio0_pins_b &ahub_daudio0_pins_c>; */ + /* pinctrl-1 = <&ahub_daudio0_pins_d>; */ status = "disabled"; }; @@ -1270,6 +1299,7 @@ }; &ahub1_mach { + soundcard-mach,playback-only; soundcard-mach,format = "i2s"; soundcard-mach,frame-master = <&ahub1_cpu>; soundcard-mach,bitclock-master = <&ahub1_cpu>; @@ -1288,6 +1318,7 @@ }; &ahub2_mach { + soundcard-mach,playback-only; soundcard-mach,format = "i2s"; soundcard-mach,frame-master = <&ahub2_cpu>; soundcard-mach,bitclock-master = <&ahub2_cpu>; @@ -1295,13 +1326,14 @@ /* soundcard-mach,bitclock-inversion; */ soundcard-mach,slot-num = <2>; soundcard-mach,slot-width = <32>; - status = "okay"; + status = "disabled"; ahub2_cpu: soundcard-mach,cpu { sound-dai = <&ahub2_plat>; soundcard-mach,pll-fs = <4>; /* pll freq = 24.576M or 22.5792M * pll-fs */ soundcard-mach,mclk-fs = <256>;/* mclk freq = pcm rate * mclk-fs */ }; ahub2_codec: soundcard-mach,codec { + sound-dai = <&pcm5122>; }; }; diff --git a/longan/device/config/chips/h618/configs/m4berry/uboot-board.dts b/longan/device/config/chips/h618/configs/m4berry/uboot-board.dts index 138d35f7de..af3af16044 100644 --- a/longan/device/config/chips/h618/configs/m4berry/uboot-board.dts +++ b/longan/device/config/chips/h618/configs/m4berry/uboot-board.dts @@ -51,6 +51,7 @@ logical_start = <40960>; /* 0x2--C 0xC--12 0x1--open*/ gpio0 = <0x54 0x2 0xc 0x1 0xffffffff 0xffffffff 0x0>; + //gpio1 = <0x54 0x2 0x2 0x1 0xffffffff 0xffffffff 0x0>; }; &target { @@ -515,8 +516,8 @@ hdmi_mode_check = <1>; fb0_format = <0>; - fb0_width = <1280>; - fb0_height = <720>; + fb0_width = <1920>; + fb0_height = <1080>; fb1_format = <0>; fb1_width = <0>; diff --git a/longan/device/config/chips/h618/configs/m4zero/linux-5.4/board.dts b/longan/device/config/chips/h618/configs/m4zero/linux-5.4/board.dts index 5857857967..d4104abece 100644 --- a/longan/device/config/chips/h618/configs/m4zero/linux-5.4/board.dts +++ b/longan/device/config/chips/h618/configs/m4zero/linux-5.4/board.dts @@ -486,21 +486,35 @@ }; ahub_daudio0_pins_a: ahub_daudio0@0 { - pins = "PA6", "PA7", "PA8", "PA9"; + pins = "PI0", "PI1", "PI2"; function = "i2s0"; drive-strength = <20>; bias-disable; }; - ahub_daudio0_pins_b: ahub_daudio0_sleep@0 { - pins = "PA6", "PA7", "PA8", "PA9"; + ahub_daudio0_pins_b: ahub_daudio0@1 { + pins = "PI3"; + function = "i2s0_dout0"; + drive-strength = <20>; + bias-disable; + }; + + ahub_daudio0_pins_c: ahub_daudio0@2 { + pins = "PI4"; + function = "i2s0_din0"; + drive-strength = <20>; + bias-disable; + }; + + ahub_daudio0_pins_d: ahub_daudio0_sleep@0 { + pins = "PI0", "PI1", "PI2", "PI3", "PI4"; function = "gpio_in"; drive-strength = <20>; bias-disable; }; ahub_daudio2_pins_a: ahub_daudio2@0 { - pins = "PG11", "PG12"; + pins = "PG10", "PG11", "PG12"; function = "i2s2"; drive-strength = <20>; bias-disable; @@ -521,7 +535,7 @@ }; ahub_daudio2_pins_d: ahub_daudio2_sleep@0 { - pins = "PG11", "PG12", "PG13", "PG14"; + pins = "PG10", "PG11", "PG12", "PG13", "PG14"; function = "gpio_in"; drive-strength = <20>; bias-disable; @@ -625,6 +639,13 @@ pinctrl-names = "default", "sleep"; twi_drv_used = <1>; status = "disabled"; + + pcm5122: pcm5122@4d { + compatible = "ti,pcm5122"; + reg = <0x4d>; + #sound-dai-cells = <0>; + status = "disabled"; + }; }; &twi5 { @@ -866,35 +887,35 @@ gpio_para { gpio_num = <28>; - gpio_pin_1 = <&pio PG 0 GPIO_ACTIVE_LOW>; - gpio_pin_2 = <&pio PG 1 GPIO_ACTIVE_LOW>; - gpio_pin_3 = <&pio PG 2 GPIO_ACTIVE_LOW>; - gpio_pin_4 = <&pio PG 3 GPIO_ACTIVE_LOW>; - gpio_pin_5 = <&pio PG 4 GPIO_ACTIVE_LOW>; - gpio_pin_6 = <&pio PG 5 GPIO_ACTIVE_LOW>; - gpio_pin_7 = <&pio PG 6 GPIO_ACTIVE_LOW>; - gpio_pin_8 = <&pio PG 7 GPIO_ACTIVE_LOW>; - gpio_pin_9 = <&pio PG 8 GPIO_ACTIVE_LOW>; - gpio_pin_10 = <&pio PG 9 GPIO_ACTIVE_LOW>; - gpio_pin_11 = <&pio PG 10 GPIO_ACTIVE_LOW>; - gpio_pin_12 = <&pio PG 11 GPIO_ACTIVE_LOW>; - gpio_pin_13 = <&pio PG 12 GPIO_ACTIVE_LOW>; - gpio_pin_14 = <&pio PG 13 GPIO_ACTIVE_LOW>; - gpio_pin_15 = <&pio PG 14 GPIO_ACTIVE_LOW>; - gpio_pin_16 = <&pio PG 15 GPIO_ACTIVE_LOW>; - gpio_pin_17 = <&pio PG 16 GPIO_ACTIVE_LOW>; - gpio_pin_18 = <&pio PG 17 GPIO_ACTIVE_LOW>; - gpio_pin_19 = <&pio PG 18 GPIO_ACTIVE_LOW>; - gpio_pin_20 = <&pio PG 19 GPIO_ACTIVE_LOW>; - gpio_pin_21 = <&pio PH 2 GPIO_ACTIVE_LOW>; - gpio_pin_22 = <&pio PH 3 GPIO_ACTIVE_LOW>; - gpio_pin_23 = <&pio PH 4 GPIO_ACTIVE_LOW>; - gpio_pin_24 = <&pio PH 5 GPIO_ACTIVE_LOW>; - gpio_pin_25 = <&pio PH 6 GPIO_ACTIVE_LOW>; - gpio_pin_26 = <&pio PH 7 GPIO_ACTIVE_LOW>; - gpio_pin_27 = <&pio PH 8 GPIO_ACTIVE_LOW>; - gpio_pin_28 = <&pio PH 9 GPIO_ACTIVE_LOW>; - //gpio_pin_29 = <&pio PC 12 GPIO_ACTIVE_LOW>; + gpio_pin_1 = <&pio PG 0 GPIO_ACTIVE_HIGH>; + gpio_pin_2 = <&pio PG 1 GPIO_ACTIVE_HIGH>; + gpio_pin_3 = <&pio PG 2 GPIO_ACTIVE_HIGH>; + gpio_pin_4 = <&pio PG 3 GPIO_ACTIVE_HIGH>; + gpio_pin_5 = <&pio PG 4 GPIO_ACTIVE_HIGH>; + gpio_pin_6 = <&pio PG 5 GPIO_ACTIVE_HIGH>; + gpio_pin_7 = <&pio PG 6 GPIO_ACTIVE_HIGH>; + gpio_pin_8 = <&pio PG 7 GPIO_ACTIVE_HIGH>; + gpio_pin_9 = <&pio PG 8 GPIO_ACTIVE_HIGH>; + gpio_pin_10 = <&pio PG 9 GPIO_ACTIVE_HIGH>; + gpio_pin_11 = <&pio PG 10 GPIO_ACTIVE_HIGH>; + gpio_pin_12 = <&pio PG 11 GPIO_ACTIVE_HIGH>; + gpio_pin_13 = <&pio PG 12 GPIO_ACTIVE_HIGH>; + gpio_pin_14 = <&pio PG 13 GPIO_ACTIVE_HIGH>; + gpio_pin_15 = <&pio PG 14 GPIO_ACTIVE_HIGH>; + gpio_pin_16 = <&pio PG 15 GPIO_ACTIVE_HIGH>; + gpio_pin_17 = <&pio PG 16 GPIO_ACTIVE_HIGH>; + gpio_pin_18 = <&pio PG 17 GPIO_ACTIVE_HIGH>; + gpio_pin_19 = <&pio PG 18 GPIO_ACTIVE_HIGH>; + gpio_pin_20 = <&pio PG 19 GPIO_ACTIVE_HIGH>; + gpio_pin_21 = <&pio PH 2 GPIO_ACTIVE_HIGH>; + gpio_pin_22 = <&pio PH 3 GPIO_ACTIVE_HIGH>; + gpio_pin_23 = <&pio PH 4 GPIO_ACTIVE_HIGH>; + gpio_pin_24 = <&pio PH 5 GPIO_ACTIVE_HIGH>; + gpio_pin_25 = <&pio PH 6 GPIO_ACTIVE_HIGH>; + gpio_pin_26 = <&pio PH 7 GPIO_ACTIVE_HIGH>; + gpio_pin_27 = <&pio PH 8 GPIO_ACTIVE_HIGH>; + gpio_pin_28 = <&pio PH 9 GPIO_ACTIVE_HIGH>; + //gpio_pin_29 = <&pio PC 12 GPIO_ACTIVE_HIGH>; //normal_led = "gpio_pin_1"; //easy_light_used = <1>; //normal_led_light = <1>; @@ -905,7 +926,6 @@ &rfkill { compatible = "allwinner,sunxi-rfkill"; //chip_en = <&pio PC 2 GPIO_ACTIVE_HIGH>; - chip_en; power_en; pinctrl-0; pinctrl-names; @@ -1014,8 +1034,8 @@ hdmi_mode_check = <1>; fb0_format = <0>; - fb0_width = <1280>; - fb0_height = <720>; + fb0_width = <1920>; + fb0_height = <1080>; fb1_format = <0>; fb1_width = <0>; @@ -1188,6 +1208,14 @@ status = "okay"; }; +&spdif { + status = "disabled"; +}; + +&soundspdif { + status = "disabled"; +}; + /* 40pin spidifout, pin36 */ /* audio dirver module -> spdif */ &spdif_plat { @@ -1200,6 +1228,7 @@ }; &spdif_mach { + soundcard-mach,playback-only; status = "disabled"; }; @@ -1218,8 +1247,8 @@ rx_pin = <0>; /* pinctrl_used; */ /* pinctrl-names= "default","sleep"; */ - /* pinctrl-0 = <&ahub_daudio0_pins_a>; */ - /* pinctrl-1 = <&ahub_daudio0_pins_b>; */ + /* pinctrl-0 = <&ahub_daudio0_pins_a &ahub_daudio0_pins_b &ahub_daudio0_pins_c>; */ + /* pinctrl-1 = <&ahub_daudio0_pins_d>; */ status = "disabled"; }; @@ -1276,6 +1305,7 @@ }; &ahub1_mach { + soundcard-mach,playback-only; soundcard-mach,format = "i2s"; soundcard-mach,frame-master = <&ahub1_cpu>; soundcard-mach,bitclock-master = <&ahub1_cpu>; @@ -1294,6 +1324,7 @@ }; &ahub2_mach { + soundcard-mach,playback-only; soundcard-mach,format = "i2s"; soundcard-mach,frame-master = <&ahub2_cpu>; soundcard-mach,bitclock-master = <&ahub2_cpu>; @@ -1301,13 +1332,14 @@ /* soundcard-mach,bitclock-inversion; */ soundcard-mach,slot-num = <2>; soundcard-mach,slot-width = <32>; - status = "okay"; + status = "disabled"; ahub2_cpu: soundcard-mach,cpu { sound-dai = <&ahub2_plat>; soundcard-mach,pll-fs = <4>; /* pll freq = 24.576M or 22.5792M * pll-fs */ soundcard-mach,mclk-fs = <256>;/* mclk freq = pcm rate * mclk-fs */ }; ahub2_codec: soundcard-mach,codec { + sound-dai = <&pcm5122>; }; }; diff --git a/longan/device/config/chips/h618/configs/m4zero/uboot-board.dts b/longan/device/config/chips/h618/configs/m4zero/uboot-board.dts index f5a053c9cb..8c8b62e365 100644 --- a/longan/device/config/chips/h618/configs/m4zero/uboot-board.dts +++ b/longan/device/config/chips/h618/configs/m4zero/uboot-board.dts @@ -51,6 +51,7 @@ logical_start = <40960>; /* 0x2--C 0xC--12 0x1--open*/ gpio0 = <0x54 0x2 0xc 0x1 0xffffffff 0xffffffff 0x0>; + //gpio1 = <0x54 0x2 0x2 0x1 0xffffffff 0xffffffff 0x0>; }; &target {