From b5b481063f5a68ef8361ba025bf655fc451f5d93 Mon Sep 17 00:00:00 2001 From: Jun Yan Date: Fri, 13 Feb 2026 15:38:10 +0800 Subject: [PATCH 01/22] arm64: dts: amlogic: meson-gxl-s905d-phicomm-n1: add bluetooth node The Phicomm N1 uses a CY43455 (BCM43438) module with its Bluetooth interface connected to uart_A. Add the required device tree node to enable proper functionality. Signed-off-by: Jun Yan Reviewed-by: Neil Armstrong Link: https://patch.msgid.link/20260213073810.552341-1-jerrysteve1101@gmail.com Signed-off-by: Neil Armstrong --- .../dts/amlogic/meson-gxl-s905d-phicomm-n1.dts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-phicomm-n1.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-phicomm-n1.dts index 393d3cb33b9e..dea3a60e8527 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-phicomm-n1.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-phicomm-n1.dts @@ -30,6 +30,21 @@ &cvbs_vdac_port { status = "disabled"; }; +&uart_A { + status = "okay"; + pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>; + pinctrl-names = "default"; + uart-has-rtscts; + + bluetooth { + compatible = "brcm,bcm43438-bt"; + shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; + max-speed = <2000000>; + clocks = <&wifi32k>; + clock-names = "lpo"; + }; +}; + &usb { dr_mode = "host"; }; From a895042339c77859adbef957e7c0acaa8774d955 Mon Sep 17 00:00:00 2001 From: Nick Xie Date: Sat, 28 Feb 2026 14:37:47 +0800 Subject: [PATCH 02/22] arm64: dts: amlogic: meson-s4: add UART_A node Add the UART_A node and its related pinctrl definitions to the Meson S4 SoC dtsi. The pinctrl groups are split into basic tx/rx and flow control (cts/rts) to allow board-level flexibility. This interface is typically used for Bluetooth communication on boards like the Khadas VIM1S. Signed-off-by: Nick Xie Reviewed-by: Martin Blumenstingl Link: https://patch.msgid.link/20260228063750.701887-2-nick@khadas.com Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/amlogic/meson-s4.dtsi | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi index dfc0a30a6e61..4a3e9ad82d28 100644 --- a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi @@ -163,6 +163,22 @@ mux { }; }; + uart_a_pins: uart-a-pins { + mux { + groups = "uart_a_tx", + "uart_a_rx"; + function = "uart_a"; + }; + }; + + uart_a_cts_rts_pins: uart-a-cts-rts-pins { + mux { + groups = "uart_a_cts", + "uart_a_rts"; + function = "uart_a"; + }; + }; + i2c0_pins1: i2c0-pins1 { mux { groups = "i2c0_sda", @@ -814,6 +830,16 @@ mdio0: mdio { }; }; + uart_a: serial@fe078000 { + compatible = "amlogic,meson-s4-uart", + "amlogic,meson-ao-uart"; + reg = <0x0 0xfe078000 0x0 0x18>; + interrupts = ; + clocks = <&xtal>, <&clkc_periphs CLKID_UART_A>, <&xtal>; + clock-names = "xtal", "pclk", "baud"; + status = "disabled"; + }; + sdio: mmc@fe088000 { compatible = "amlogic,meson-axg-mmc"; reg = <0x0 0xfe088000 0x0 0x800>; From 75ed598cd6f014f6fbd678ddcfb2db58f088f349 Mon Sep 17 00:00:00 2001 From: Nick Xie Date: Sat, 28 Feb 2026 14:37:48 +0800 Subject: [PATCH 03/22] arm64: dts: amlogic: meson-s4-s905y4-khadas-vim1s: enable bluetooth The Khadas VIM1S board uses the Ampak AP6256 Wi-Fi/Bluetooth module. The Bluetooth controller is connected via UART_A and requires the external 32k clock (LPO). Enable the UART_A node and add the bluetooth child node to support it. Signed-off-by: Nick Xie Reviewed-by: Martin Blumenstingl Link: https://patch.msgid.link/20260228063750.701887-3-nick@khadas.com Signed-off-by: Neil Armstrong --- .../dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts b/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts index 27d0f6134ea9..d36533f5559a 100644 --- a/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts +++ b/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts @@ -254,6 +254,21 @@ &spicc0 { cs-gpios = <&gpio GPIOX_10 GPIO_ACTIVE_LOW>; }; +&uart_a { + status = "okay"; + pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>; + pinctrl-names = "default"; + uart-has-rtscts; + + bluetooth { + compatible = "brcm,bcm4345c5"; + shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; + max-speed = <2000000>; + clocks = <&sdio_32k>; + clock-names = "lpo"; + }; +}; + &uart_b { status = "okay"; }; From b6a8c516b5895d24968878546557d6c2b9e5766c Mon Sep 17 00:00:00 2001 From: Nick Xie Date: Sat, 28 Feb 2026 14:37:49 +0800 Subject: [PATCH 04/22] arm64: dts: amlogic: meson-s4-s905y4-khadas-vim1s: add PWM LED support The Khadas VIM1S board features a white LED connected to the PWM_G controller (PWM channel 0). Enable the PWM_G controller and add the pwm-leds node to support using this LED as a heartbeat indicator. Signed-off-by: Nick Xie Reviewed-by: Martin Blumenstingl Link: https://patch.msgid.link/20260228063750.701887-4-nick@khadas.com Signed-off-by: Neil Armstrong --- .../amlogic/meson-s4-s905y4-khadas-vim1s.dts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts b/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts index d36533f5559a..0bd738c1e786 100644 --- a/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts +++ b/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts @@ -6,6 +6,7 @@ /dts-v1/; #include "meson-s4.dtsi" +#include / { model = "Khadas VIM1S"; @@ -43,6 +44,18 @@ emmc_pwrseq: emmc-pwrseq { reset-gpios = <&gpio GPIOB_9 GPIO_ACTIVE_LOW>; }; + pwm-leds { + compatible = "pwm-leds"; + + led-1 { + color = ; + function = LED_FUNCTION_STATUS; + linux,default-trigger = "heartbeat"; + max-brightness = <255>; + pwms = <&pwm_gh 0 30040 0>; + }; + }; + sdio_32k: sdio-32k { compatible = "pwm-clock"; #clock-cells = <0>; @@ -196,6 +209,12 @@ &pwm_ef { pinctrl-names = "default"; }; +&pwm_gh { + status = "okay"; + pinctrl-0 = <&pwm_g_pins1>; + pinctrl-names = "default"; +}; + &pwm_ij { status = "okay"; }; From cb00d65db2fd5367c2066effc18492ddab37ca14 Mon Sep 17 00:00:00 2001 From: Nick Xie Date: Sat, 28 Feb 2026 14:37:50 +0800 Subject: [PATCH 05/22] arm64: dts: amlogic: meson-s4-s905y4-khadas-vim1s: add POWER key support Add the gpio-keys-polled node to support the Power button found on the Khadas VIM1S board. The button is connected to the GPIOD_8 pin. Use polled mode instead of gpio-keys because the GPIO interrupt controller support for Meson S4 SoC is not yet available upstream. Signed-off-by: Nick Xie Reviewed-by: Martin Blumenstingl Link: https://patch.msgid.link/20260228063750.701887-5-nick@khadas.com Signed-off-by: Neil Armstrong --- .../dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts b/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts index 0bd738c1e786..664d64a267f2 100644 --- a/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts +++ b/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts @@ -6,6 +6,7 @@ /dts-v1/; #include "meson-s4.dtsi" +#include #include / { @@ -44,6 +45,17 @@ emmc_pwrseq: emmc-pwrseq { reset-gpios = <&gpio GPIOB_9 GPIO_ACTIVE_LOW>; }; + gpio-keys-polled { + compatible = "gpio-keys-polled"; + poll-interval = <100>; + + power-button { + label = "power"; + linux,code = ; + gpios = <&gpio GPIOD_8 GPIO_ACTIVE_LOW>; + }; + }; + pwm-leds { compatible = "pwm-leds"; From 3535303d5df2be93a0a8c17621d14af39fc72e2f Mon Sep 17 00:00:00 2001 From: Ronald Claveau Date: Thu, 26 Mar 2026 10:59:12 +0100 Subject: [PATCH 06/22] arm64: dts: amlogic: t7: Add eMMC, SD card and SDIO pinctrl nodes These pinctrl nodes are required by the eMMC, SD card and SDIO drivers to configure pin muxing at runtime. - eMMC: control, 4-bit/8-bit data, data strobe and clock gate pins - SD card: data, clock, command and clock gate pins - SDIO: data, clock, command and clock gate pins Signed-off-by: Ronald Claveau Reviewed-by: Neil Armstrong Link: https://patch.msgid.link/20260326-add-emmc-t7-vim4-v5-1-d3f182b48e9d@aliel.fr Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 98 +++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi index d523cbc0ed22..4a2220e59743 100644 --- a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi @@ -252,6 +252,104 @@ gpio: bank@4000 { #gpio-cells = <2>; gpio-ranges = <&periphs_pinctrl 0 0 157>; }; + + emmc_ctrl_pins: emmc-ctrl { + mux-0 { + groups = "emmc_cmd"; + function = "emmc"; + bias-pull-up; + }; + + mux-1 { + groups = "emmc_clk"; + function = "emmc"; + bias-disable; + }; + }; + + emmc_data_4b_pins: emmc-data-4b { + mux { + groups = "emmc_nand_d0", + "emmc_nand_d1", + "emmc_nand_d2", + "emmc_nand_d3"; + function = "emmc"; + bias-pull-up; + }; + }; + + emmc_data_8b_pins: emmc-data-8b { + mux { + groups = "emmc_nand_d0", + "emmc_nand_d1", + "emmc_nand_d2", + "emmc_nand_d3", + "emmc_nand_d4", + "emmc_nand_d5", + "emmc_nand_d6", + "emmc_nand_d7"; + function = "emmc"; + bias-pull-up; + }; + }; + + emmc_ds_pins: emmc-ds { + mux { + groups = "emmc_nand_ds"; + function = "emmc"; + bias-pull-down; + }; + }; + + emmc_clk_gate_pins: emmc-clk-gate { + mux { + groups = "GPIOB_8"; + function = "gpio_periphs"; + bias-pull-down; + }; + }; + + sdcard_pins: sdcard { + mux { + groups = "sdcard_d0", + "sdcard_d1", + "sdcard_d2", + "sdcard_d3", + "sdcard_clk", + "sdcard_cmd"; + function = "sdcard"; + bias-pull-up; + }; + }; + + sdcard_clk_gate_pins: sdcard-clk-gate { + mux { + groups = "GPIOC_4"; + function = "gpio_periphs"; + bias-pull-down; + }; + }; + + sdio_pins: sdio { + mux { + groups = "sdio_d0", + "sdio_d1", + "sdio_d2", + "sdio_d3", + "sdio_clk", + "sdio_cmd"; + function = "sdio"; + bias-pull-up; + }; + }; + + sdio_clk_gate_pins: sdio-clk-gate { + mux { + groups = "GPIOX_4"; + function = "gpio_periphs"; + bias-pull-up; + }; + }; }; gpio_intc: interrupt-controller@4080 { From 2a2a7b9701a7972dc663d233c65f423088dd316b Mon Sep 17 00:00:00 2001 From: Ronald Claveau Date: Thu, 26 Mar 2026 10:59:15 +0100 Subject: [PATCH 07/22] arm64: dts: amlogic: t7: Add PWM pinctrl nodes These pinctrl nodes are required by the PWM drivers to configure pin muxing at runtime. Reviewed-by: Neil Armstrong Signed-off-by: Ronald Claveau Link: https://patch.msgid.link/20260326-add-emmc-t7-vim4-v5-4-d3f182b48e9d@aliel.fr Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 144 ++++++++++++++++++++ 1 file changed, 144 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi index 4a2220e59743..a54fa2bd5c78 100644 --- a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi @@ -309,6 +309,150 @@ mux { }; }; + pwm_a_pins: pwm-a { + mux { + groups = "pwm_a"; + function = "pwm_a"; + bias-disable; + }; + }; + + pwm_ao_a_pins: pwm-ao-a { + mux { + groups = "pwm_ao_a"; + function = "pwm_ao_a"; + bias-disable; + }; + }; + + pwm_ao_b_pins: pwm-ao-b { + mux { + groups = "pwm_ao_b"; + function = "pwm_ao_b"; + bias-disable; + }; + }; + + pwm_ao_c_d_pins: pwm-ao-c-d { + mux { + groups = "pwm_ao_c_d"; + function = "pwm_ao_c"; + bias-disable; + }; + }; + + pwm_ao_c_e_pins: pwm-ao-c-e { + mux { + groups = "pwm_ao_c_e"; + function = "pwm_ao_c"; + bias-disable; + }; + }; + + pwm_ao_c_hiz_pins: pwm-ao-c-hiz { + mux { + groups = "pwm_ao_c_hiz"; + function = "pwm_ao_c_hiz"; + bias-disable; + }; + }; + + pwm_ao_d_pins: pwm-ao-d { + mux { + groups = "pwm_ao_d"; + function = "pwm_ao_d"; + bias-disable; + }; + }; + + pwm_ao_e_pins: pwm-ao-e { + mux { + groups = "pwm_ao_e"; + function = "pwm_ao_e"; + bias-disable; + }; + }; + + pwm_ao_f_pins: pwm-ao-f { + mux { + groups = "pwm_ao_f"; + function = "pwm_ao_f"; + bias-disable; + }; + }; + + pwm_ao_g_pins: pwm-ao-g { + mux { + groups = "pwm_ao_g"; + function = "pwm_ao_g"; + bias-disable; + }; + }; + + pwm_ao_g_hiz_pins: pwm-ao-g-hiz { + mux { + groups = "pwm_ao_g_hiz"; + function = "pwm_ao_g_hiz"; + bias-disable; + }; + }; + + pwm_ao_h_pins: pwm-ao-h { + mux { + groups = "pwm_ao_h"; + function = "pwm_ao_h"; + bias-disable; + }; + }; + + pwm_b_pins: pwm-b { + mux { + groups = "pwm_b"; + function = "pwm_b"; + bias-disable; + }; + }; + + pwm_c_pins: pwm-c { + mux { + groups = "pwm_c"; + function = "pwm_c"; + bias-disable; + }; + }; + + pwm_d_pins: pwm-d { + mux { + groups = "pwm_d"; + function = "pwm_d"; + bias-disable; + }; + }; + + pwm_e_pins: pwm-e { + mux { + groups = "pwm_e"; + function = "pwm_e"; + bias-disable; + }; + }; + + pwm_f_pins: pwm-f { + mux { + groups = "pwm_f"; + function = "pwm_f"; + bias-disable; + }; + }; + + pwm_vs_pins: pwm-vs { + mux { + groups = "pwm_vs"; + function = "pwm_vs"; + bias-disable; + }; + }; + sdcard_pins: sdcard { mux { groups = "sdcard_d0", From 8c45bf9ae4efcecd2f91bc3e6f567280721fd0fd Mon Sep 17 00:00:00 2001 From: Ronald Claveau Date: Thu, 26 Mar 2026 10:59:17 +0100 Subject: [PATCH 08/22] arm64: dts: amlogic: t7: khadas-vim4: Add power regulators Add voltage regulator nodes describing the VIM4 power tree, required by peripheral nodes such as the SD card controller. Reviewed-by: Neil Armstrong Signed-off-by: Ronald Claveau Link: https://patch.msgid.link/20260326-add-emmc-t7-vim4-v5-6-d3f182b48e9d@aliel.fr [narmstrong: squashed "Remove invalid property fix" from Ronald] Signed-off-by: Neil Armstrong --- .../amlogic/amlogic-t7-a311d2-khadas-vim4.dts | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts b/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts index f4c953034be3..003b3bcdaf2b 100644 --- a/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts @@ -6,6 +6,8 @@ /dts-v1/; #include "amlogic-t7.dtsi" +#include +#include / { model = "Khadas VIM4"; @@ -47,6 +49,93 @@ xtal: xtal-clk { #clock-cells = <0>; }; + dc_in: regulator-dc-in { + compatible = "regulator-fixed"; + regulator-name = "DC_IN"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-always-on; + }; + + sd_3v3: regulator-sdcard-3v3 { + compatible = "regulator-fixed"; + regulator-name = "SD_3V3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&vddao_3v3>; + gpio = <&gpio GPIOD_11 GPIO_ACTIVE_LOW>; + regulator-boot-on; + regulator-always-on; + }; + + vcc5v: regulator-vcc-5v { + compatible = "regulator-fixed"; + regulator-name = "VCC5V"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&dc_in>; + + gpio = <&gpio GPIOH_4 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + + vcc5v0_usb: regulator-vcc-usb { + compatible = "regulator-fixed"; + regulator-name = "VCC5V0_USB"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&vcc5v>; + + gpio = <&gpio GPIOY_5 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + + vddao_1v8: regulator-vddao-1v8 { + compatible = "regulator-fixed"; + regulator-name = "VDDAO_1V8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + vin-supply = <&vddao_3v3>; + regulator-always-on; + }; + + vddao_3v3: regulator-vddao-3v3 { + compatible = "regulator-fixed"; + regulator-name = "VDDAO_3V3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&dc_in>; + regulator-always-on; + }; + + vddio_1v8: regulator-vddio-1v8 { + compatible = "regulator-fixed"; + regulator-name = "VDDIO_1V8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + vin-supply = <&vddio_3v3>; + regulator-always-on; + }; + + vddio_3v3: regulator-vddio-3v3 { + compatible = "regulator-fixed"; + regulator-name = "VDDIO_3V3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&vddao_3v3>; + regulator-always-on; + }; + + vddio_c: regulator-gpio-c { + compatible = "regulator-gpio"; + regulator-name = "VDDIO_C"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&vddio_3v3>; + gpios = <&gpio GPIOD_9 GPIO_ACTIVE_HIGH>; + states = <1800000 1 + 3300000 0>; + }; }; &uart_a { From 4badf8d60daf72964807f4d8d89ae7f41868d901 Mon Sep 17 00:00:00 2001 From: Nick Xie Date: Wed, 25 Mar 2026 15:06:17 +0800 Subject: [PATCH 09/22] arm64: dts: amlogic: meson-s4: add internal SARADC controller Add the SARADC (Successive Approximation Register ADC) controller node to the Meson S4 SoC dtsi. It uses the S4-specific compatible string with a fallback to the G12A generation, as there are no known hardware differences. Reviewed-by: Martin Blumenstingl Signed-off-by: Nick Xie Link: https://patch.msgid.link/20260325070618.81955-4-nick@khadas.com Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/amlogic/meson-s4.dtsi | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi index 4a3e9ad82d28..936a5c1353d1 100644 --- a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi @@ -77,6 +77,20 @@ pwrc: power-controller { }; }; + saradc: adc@fe026000 { + compatible = "amlogic,meson-s4-saradc", + "amlogic,meson-g12a-saradc"; + reg = <0x0 0xfe026000 0x0 0x48>; + #io-channel-cells = <1>; + interrupts = ; + clocks = <&xtal>, + <&clkc_periphs CLKID_SAR_ADC>, + <&clkc_periphs CLKID_SARADC>, + <&clkc_periphs CLKID_SARADC_SEL>; + clock-names = "clkin", "core", "adc_clk", "adc_sel"; + status = "disabled"; + }; + soc { compatible = "simple-bus"; #address-cells = <2>; From def2d2379668d5e80a41d6d2fb0972f8480d9c2f Mon Sep 17 00:00:00 2001 From: Nick Xie Date: Wed, 25 Mar 2026 15:06:18 +0800 Subject: [PATCH 10/22] arm64: dts: amlogic: meson-s4-s905y4-khadas-vim1s: add Function key support Enable the SARADC controller and add the adc-keys node to support the Function key found on the Khadas VIM1S board. Reviewed-by: Martin Blumenstingl Signed-off-by: Nick Xie Link: https://patch.msgid.link/20260325070618.81955-5-nick@khadas.com Signed-off-by: Neil Armstrong --- .../amlogic/meson-s4-s905y4-khadas-vim1s.dts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts b/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts index 664d64a267f2..792ab45c4c94 100644 --- a/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts +++ b/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts @@ -40,6 +40,20 @@ secmon_reserved: secmon@5000000 { }; }; + adc-keys { + compatible = "adc-keys"; + io-channels = <&saradc 0>; + io-channel-names = "buttons"; + keyup-threshold-microvolt = <1710000>; + poll-interval = <100>; + + button-function { + label = "Function"; + linux,code = ; + press-threshold-microvolt = <10000>; + }; + }; + emmc_pwrseq: emmc-pwrseq { compatible = "mmc-pwrseq-emmc"; reset-gpios = <&gpio GPIOB_9 GPIO_ACTIVE_LOW>; @@ -278,6 +292,11 @@ brcmf: wifi@1 { }; }; +&saradc { + status = "okay"; + vref-supply = <&vddio_ao1v8>; +}; + &spicc0 { status = "okay"; pinctrl-names = "default"; From 42379e7ee9cc648f3e5a281a3e3849c326daccc0 Mon Sep 17 00:00:00 2001 From: Nick Xie Date: Fri, 27 Mar 2026 17:30:14 +0800 Subject: [PATCH 11/22] arm64: dts: amlogic: meson-s4: add VRTC node Add the Virtual RTC (VRTC) controller node to the Meson S4 SoC dtsi. Signed-off-by: Nick Xie Reviewed-by: Neil Armstrong Link: https://patch.msgid.link/20260327093016.722095-2-nick@khadas.com Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/amlogic/meson-s4.dtsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi index 936a5c1353d1..2a6fbd530836 100644 --- a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi @@ -59,6 +59,11 @@ psci { method = "smc"; }; + vrtc: rtc@fe010288 { + compatible = "amlogic,meson-vrtc"; + reg = <0x0 0xfe010288 0x0 0x4>; + }; + xtal: xtal-clk { compatible = "fixed-clock"; clock-frequency = <24000000>; From 2e63b271fb62c7a2e9c626bda8d62130abb0e1c9 Mon Sep 17 00:00:00 2001 From: Nick Xie Date: Fri, 27 Mar 2026 17:30:15 +0800 Subject: [PATCH 12/22] arm64: dts: amlogic: meson-s4-s905y4-khadas-vim1s: enable HYM8563 RTC The Khadas VIM1S board has an on-board Haoyu Micro HYM8563 Real Time Clock (RTC) connected to the I2C1 bus. Enable the I2C1 controller and add the RTC child node to support hardware clock persistence. Signed-off-by: Nick Xie Reviewed-by: Neil Armstrong Link: https://patch.msgid.link/20260327093016.722095-3-nick@khadas.com Signed-off-by: Neil Armstrong --- .../dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts b/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts index 792ab45c4c94..7314e0ab81da 100644 --- a/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts +++ b/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts @@ -20,6 +20,8 @@ aliases { mmc0 = &emmc; /* eMMC */ mmc1 = &sd; /* SD card */ mmc2 = &sdio; /* SDIO */ + rtc0 = &rtc; + rtc1 = &vrtc; serial0 = &uart_b; }; @@ -223,6 +225,19 @@ ðmac { phy-mode = "rmii"; }; +&i2c1 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins2>; + clock-frequency = <100000>; + + rtc: rtc@51 { + compatible = "haoyu,hym8563"; + reg = <0x51>; + #clock-cells = <0>; + }; +}; + &ir { status = "okay"; pinctrl-0 = <&remote_pins>; From 217a751eec57827c28cbe5f0f7e5bf95cf98d240 Mon Sep 17 00:00:00 2001 From: Nick Xie Date: Fri, 27 Mar 2026 17:30:16 +0800 Subject: [PATCH 13/22] arm64: dts: amlogic: meson-s4-s905y4-khadas-vim1s: use rc-khadas keymap The Khadas VIM1S board has an onboard IR receiver. Configure the default keymap to "rc-khadas" to support the official Khadas IR remote control. Signed-off-by: Nick Xie Reviewed-by: Neil Armstrong Link: https://patch.msgid.link/20260327093016.722095-4-nick@khadas.com Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts b/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts index 7314e0ab81da..99d5df71b9cd 100644 --- a/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts +++ b/arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts @@ -242,6 +242,7 @@ &ir { status = "okay"; pinctrl-0 = <&remote_pins>; pinctrl-names = "default"; + linux,rc-map-name = "rc-khadas"; }; &pwm_ef { From 68de99550e9ee79f13c4cddb4c482eeb684e9249 Mon Sep 17 00:00:00 2001 From: Jian Hu Date: Thu, 26 Mar 2026 17:26:45 +0800 Subject: [PATCH 14/22] arm64: dts: amlogic: t7: Add clock controller nodes Add the required clock controller nodes for Amlogic T7 SoC family: - SCMI clock controller - PLL clock controller - Peripheral clock controller Signed-off-by: Ronald Claveau Signed-off-by: Jian Hu Link: https://patch.msgid.link/20260326092645.1053261-4-jian.hu@amlogic.com Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 125 ++++++++++++++++++++ 1 file changed, 125 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi index a54fa2bd5c78..1a00a65db0c6 100644 --- a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi @@ -6,6 +6,9 @@ #include #include #include "amlogic-t7-reset.h" +#include +#include +#include / { interrupt-parent = <&gic>; @@ -201,6 +204,34 @@ pwrc: power-controller { }; }; + sram@f7042000 { + compatible = "mmio-sram"; + reg = <0x0 0xf7042000 0x0 0x100>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x0 0xf7042000 0x100>; + + scmi_shmem: sram@0 { + compatible = "arm,scmi-shmem"; + reg = <0x0 0x100>; + }; + }; + + firmware { + scmi: scmi { + compatible = "arm,scmi-smc"; + arm,smc-id = <0x820000c1>; + shmem = <&scmi_shmem>; + #address-cells = <1>; + #size-cells = <0>; + + scmi_clk: protocol@14 { + reg = <0x14>; + #clock-cells = <1>; + }; + }; + }; + soc { compatible = "simple-bus"; #address-cells = <2>; @@ -226,6 +257,42 @@ apb4: bus@fe000000 { #size-cells = <2>; ranges = <0x0 0x0 0x0 0xfe000000 0x0 0x480000>; + clkc_periphs: clock-controller@0 { + compatible = "amlogic,t7-peripherals-clkc"; + reg = <0x0 0x0 0x0 0x1c8>; + #clock-cells = <1>; + clocks = <&xtal>, + <&scmi_clk CLKID_SYS_CLK>, + <&scmi_clk CLKID_FIXED_PLL>, + <&scmi_clk CLKID_FCLK_DIV2>, + <&scmi_clk CLKID_FCLK_DIV2P5>, + <&scmi_clk CLKID_FCLK_DIV3>, + <&scmi_clk CLKID_FCLK_DIV4>, + <&scmi_clk CLKID_FCLK_DIV5>, + <&scmi_clk CLKID_FCLK_DIV7>, + <&hifi CLKID_HIFI_PLL>, + <&gp0 CLKID_GP0_PLL>, + <&gp1 CLKID_GP1_PLL>, + <&mpll CLKID_MPLL1>, + <&mpll CLKID_MPLL2>, + <&mpll CLKID_MPLL3>; + clock-names = "xtal", + "sys", + "fix", + "fdiv2", + "fdiv2p5", + "fdiv3", + "fdiv4", + "fdiv5", + "fdiv7", + "hifi", + "gp0", + "gp1", + "mpll1", + "mpll2", + "mpll3"; + }; + reset: reset-controller@2000 { compatible = "amlogic,t7-reset"; reg = <0x0 0x2000 0x0 0x98>; @@ -513,6 +580,64 @@ uart_a: serial@78000 { status = "disabled"; }; + gp0: clock-controller@8080 { + compatible = "amlogic,t7-gp0-pll"; + reg = <0x0 0x8080 0x0 0x20>; + clocks = <&scmi_clk CLKID_TOP_PLL_OSC>; + clock-names = "in0"; + #clock-cells = <1>; + }; + + gp1: clock-controller@80c0 { + compatible = "amlogic,t7-gp1-pll"; + reg = <0x0 0x80c0 0x0 0x14>; + clocks = <&scmi_clk CLKID_TOP_PLL_OSC>; + clock-names = "in0"; + #clock-cells = <1>; + }; + + hifi: clock-controller@8100 { + compatible = "amlogic,t7-hifi-pll"; + reg = <0x0 0x8100 0x0 0x20>; + clocks = <&scmi_clk CLKID_TOP_PLL_OSC>; + clock-names = "in0"; + #clock-cells = <1>; + }; + + pcie: clock-controller@8140 { + compatible = "amlogic,t7-pcie-pll"; + reg = <0x0 0x8140 0x0 0x1c>; + clocks = <&scmi_clk CLKID_PCIE_OSC>; + clock-names = "in0"; + #clock-cells = <1>; + }; + + mpll: clock-controller@8180 { + compatible = "amlogic,t7-mpll"; + reg = <0x0 0x8180 0x0 0x28>; + clocks = <&scmi_clk CLKID_FIXED_PLL_DCO>; + clock-names = "in0"; + #clock-cells = <1>; + }; + + hdmi: clock-controller@81c0 { + compatible = "amlogic,t7-hdmi-pll"; + reg = <0x0 0x81c0 0x0 0x20>; + clocks = <&scmi_clk CLKID_HDMI_PLL_OSC>; + clock-names = "in0"; + #clock-cells = <1>; + }; + + mclk: clock-controller@8300 { + compatible = "amlogic,t7-mclk-pll"; + reg = <0x0 0x8300 0x0 0x18>; + clocks = <&scmi_clk CLKID_MCLK_PLL_OSC>, + <&xtal>, + <&scmi_clk CLKID_FCLK_50M>; + clock-names = "in0", "in1", "in2"; + #clock-cells = <1>; + }; + sec_ao: ao-secure@10220 { compatible = "amlogic,t7-ao-secure", "amlogic,meson-gx-ao-secure", From bd3454d5087d63dd68145d00bc3034b99e087782 Mon Sep 17 00:00:00 2001 From: Ronald Claveau Date: Thu, 26 Mar 2026 10:59:14 +0100 Subject: [PATCH 15/22] arm64: dts: amlogic: t7: Add MMC controller nodes Add device tree nodes for the three MMC controllers available on the Amlogic T7 SoC, using amlogic,meson-axg-mmc as fallback compatible. All nodes are disabled by default and should be enabled in the board-specific DTS file. Signed-off-by: Ronald Claveau Reviewed-by: Neil Armstrong Link: https://patch.msgid.link/20260326-add-emmc-t7-vim4-v5-3-d3f182b48e9d@aliel.fr Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 39 +++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi index 1a00a65db0c6..d45f360e3d67 100644 --- a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi @@ -645,6 +645,45 @@ sec_ao: ao-secure@10220 { reg = <0x0 0x10220 0x0 0x140>; amlogic,has-chip-id; }; + + sd_emmc_a: mmc@88000 { + compatible = "amlogic,t7-mmc", "amlogic,meson-axg-mmc"; + reg = <0x0 0x88000 0x0 0x800>; + interrupts = ; + clocks = <&clkc_periphs CLKID_SYS_SD_EMMC_A>, + <&clkc_periphs CLKID_SD_EMMC_A>, + <&scmi_clk CLKID_FCLK_DIV2>; + clock-names = "core", "clkin0", "clkin1"; + assigned-clocks = <&clkc_periphs CLKID_SD_EMMC_A_SEL>; + assigned-clock-parents = <&xtal>; + status = "disabled"; + }; + + sd_emmc_b: mmc@8a000 { + compatible = "amlogic,t7-mmc", "amlogic,meson-axg-mmc"; + reg = <0x0 0x8a000 0x0 0x800>; + interrupts = ; + clocks = <&clkc_periphs CLKID_SYS_SD_EMMC_B>, + <&clkc_periphs CLKID_SD_EMMC_B>, + <&scmi_clk CLKID_FCLK_DIV2>; + clock-names = "core", "clkin0", "clkin1"; + assigned-clocks = <&clkc_periphs CLKID_SD_EMMC_B_SEL>; + assigned-clock-parents = <&xtal>; + status = "disabled"; + }; + + sd_emmc_c: mmc@8c000 { + compatible = "amlogic,t7-mmc", "amlogic,meson-axg-mmc"; + reg = <0x0 0x8c000 0x0 0x800>; + interrupts = ; + clocks = <&clkc_periphs CLKID_SYS_SD_EMMC_C>, + <&clkc_periphs CLKID_SD_EMMC_C>, + <&scmi_clk CLKID_FCLK_DIV2>; + clock-names = "core", "clkin0", "clkin1"; + assigned-clocks = <&clkc_periphs CLKID_SD_EMMC_C_SEL>; + assigned-clock-parents = <&xtal>; + status = "disabled"; + }; }; }; From 97f08cef69118bff9b7901bb1c804e7e326b31bf Mon Sep 17 00:00:00 2001 From: Ronald Claveau Date: Thu, 26 Mar 2026 10:59:16 +0100 Subject: [PATCH 16/22] arm64: dts: amlogic: t7: Add PWM controller nodes Add device tree nodes for the seven PWM controllers available on the Amlogic T7 SoC, using amlogic,meson-s4-pwm as fallback compatible. All nodes are disabled by default and should be enabled in the board-specific DTS file. Co-developed-by: Nick Xie Signed-off-by: Nick Xie Reviewed-by: Neil Armstrong Signed-off-by: Ronald Claveau Link: https://patch.msgid.link/20260326-add-emmc-t7-vim4-v5-5-d3f182b48e9d@aliel.fr Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 63 +++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi index d45f360e3d67..fc23f409fe1d 100644 --- a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi @@ -646,6 +646,69 @@ sec_ao: ao-secure@10220 { amlogic,has-chip-id; }; + pwm_ao_ef: pwm@30000 { + compatible = "amlogic,t7-pwm", "amlogic,meson-s4-pwm"; + reg = <0x0 0x30000 0x0 0x24>; + clocks = <&clkc_periphs CLKID_PWM_AO_E>, + <&clkc_periphs CLKID_PWM_AO_F>; + #pwm-cells = <3>; + status = "disabled"; + }; + + pwm_ao_gh: pwm@32000 { + compatible = "amlogic,t7-pwm", "amlogic,meson-s4-pwm"; + reg = <0x0 0x32000 0x0 0x24>; + clocks = <&clkc_periphs CLKID_PWM_AO_G>, + <&clkc_periphs CLKID_PWM_AO_H>; + #pwm-cells = <3>; + status = "disabled"; + }; + + pwm_ab: pwm@58000 { + compatible = "amlogic,t7-pwm", "amlogic,meson-s4-pwm"; + reg = <0x0 0x58000 0x0 0x24>; + clocks = <&clkc_periphs CLKID_PWM_A>, + <&clkc_periphs CLKID_PWM_B>; + #pwm-cells = <3>; + status = "disabled"; + }; + + pwm_cd: pwm@5a000 { + compatible = "amlogic,t7-pwm", "amlogic,meson-s4-pwm"; + reg = <0x0 0x5a000 0x0 0x24>; + clocks = <&clkc_periphs CLKID_PWM_C>, + <&clkc_periphs CLKID_PWM_D>; + #pwm-cells = <3>; + status = "disabled"; + }; + + pwm_ef: pwm@5c000 { + compatible = "amlogic,t7-pwm", "amlogic,meson-s4-pwm"; + reg = <0x0 0x5c000 0x0 0x24>; + clocks = <&clkc_periphs CLKID_PWM_E>, + <&clkc_periphs CLKID_PWM_F>; + #pwm-cells = <3>; + status = "disabled"; + }; + + pwm_ao_ab: pwm@5e000 { + compatible = "amlogic,t7-pwm", "amlogic,meson-s4-pwm"; + reg = <0x0 0x5e000 0x0 0x24>; + clocks = <&clkc_periphs CLKID_PWM_AO_A>, + <&clkc_periphs CLKID_PWM_AO_B>; + #pwm-cells = <3>; + status = "disabled"; + }; + + pwm_ao_cd: pwm@60000 { + compatible = "amlogic,t7-pwm", "amlogic,meson-s4-pwm"; + reg = <0x0 0x60000 0x0 0x24>; + clocks = <&clkc_periphs CLKID_PWM_AO_C>, + <&clkc_periphs CLKID_PWM_AO_D>; + #pwm-cells = <3>; + status = "disabled"; + }; + sd_emmc_a: mmc@88000 { compatible = "amlogic,t7-mmc", "amlogic,meson-axg-mmc"; reg = <0x0 0x88000 0x0 0x800>; From 4d2663f85f8dd31eb0b6b02b3cdd2ac0e21b5d51 Mon Sep 17 00:00:00 2001 From: Ronald Claveau Date: Thu, 26 Mar 2026 10:59:18 +0100 Subject: [PATCH 17/22] arm64: dts: amlogic: t7: khadas-vim4: Add SDIO power sequence and WiFi clock Add the SDIO power sequence node using mmc-pwrseq-simple and a 32.768kHz PWM-based clock required by the Wi-Fi module. Reviewed-by: Neil Armstrong Signed-off-by: Ronald Claveau Link: https://patch.msgid.link/20260326-add-emmc-t7-vim4-v5-7-d3f182b48e9d@aliel.fr Signed-off-by: Neil Armstrong --- .../amlogic/amlogic-t7-a311d2-khadas-vim4.dts | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts b/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts index 003b3bcdaf2b..994d04f3f5f0 100644 --- a/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts @@ -68,6 +68,15 @@ sd_3v3: regulator-sdcard-3v3 { regulator-always-on; }; + sdio_pwrseq: sdio-pwrseq { + compatible = "mmc-pwrseq-simple"; + reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>; + post-power-on-delay-ms = <500>; + power-off-delay-us = <200000>; + clocks = <&wifi32k>; + clock-names = "ext_clock"; + }; + vcc5v: regulator-vcc-5v { compatible = "regulator-fixed"; regulator-name = "VCC5V"; @@ -136,6 +145,19 @@ vddio_c: regulator-gpio-c { states = <1800000 1 3300000 0>; }; + + wifi32k: wifi32k { + compatible = "pwm-clock"; + #clock-cells = <0>; + clock-frequency = <32768>; + pwms = <&pwm_ab 0 30518 0>; + }; +}; + +&pwm_ab { + status = "okay"; + pinctrl-0 = <&pwm_a_pins>; + pinctrl-names = "default"; }; &uart_a { From 003080cf2c4a3f5a101296ab969bd5d92076b18b Mon Sep 17 00:00:00 2001 From: Ronald Claveau Date: Thu, 26 Mar 2026 10:59:20 +0100 Subject: [PATCH 18/22] arm64: dts: amlogic: t7: khadas-vim4: Add MMC nodes Enable and configure the three MMC controllers for the Khadas VIM4 board: - sd_emmc_a: SDIO interface for the BCM43752 Wi-Fi module - sd_emmc_b: SD card slot - sd_emmc_c: eMMC storage Reviewed-by: Neil Armstrong Signed-off-by: Ronald Claveau Link: https://patch.msgid.link/20260326-add-emmc-t7-vim4-v5-9-d3f182b48e9d@aliel.fr Signed-off-by: Neil Armstrong --- .../amlogic/amlogic-t7-a311d2-khadas-vim4.dts | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts b/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts index 994d04f3f5f0..69d6118ba57e 100644 --- a/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts @@ -15,6 +15,9 @@ / { aliases { serial0 = &uart_a; + mmc0 = &sd_emmc_c; + mmc1 = &sd_emmc_b; + mmc2 = &sd_emmc_a; }; memory@0 { @@ -160,6 +163,91 @@ &pwm_ab { pinctrl-names = "default"; }; +/* SDIO */ +&sd_emmc_a { + status = "okay"; + pinctrl-0 = <&sdio_pins>; + pinctrl-1 = <&sdio_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; + #address-cells = <1>; + #size-cells = <0>; + + bus-width = <4>; + cap-sd-highspeed; + sd-uhs-sdr12; + sd-uhs-sdr25; + sd-uhs-sdr50; + sd-uhs-sdr104; + cap-sdio-irq; + max-frequency = <200000000>; + non-removable; + disable-wp; + no-mmc; + no-sd; + + power-domains = <&pwrc PWRC_T7_SDIO_A_ID>; + + keep-power-in-suspend; + + mmc-pwrseq = <&sdio_pwrseq>; + + vmmc-supply = <&vddao_3v3>; + vqmmc-supply = <&vddao_1v8>; + + brcmf: wifi@1 { + reg = <1>; + compatible = "brcm,bcm43752-fmac", "brcm,bcm4329-fmac"; + }; +}; + +/* SD card */ +&sd_emmc_b { + status = "okay"; + pinctrl-0 = <&sdcard_pins>; + pinctrl-1 = <&sdcard_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; + + bus-width = <4>; + cap-sd-highspeed; + sd-uhs-sdr12; + sd-uhs-sdr25; + sd-uhs-sdr50; + sd-uhs-sdr104; + max-frequency = <200000000>; + disable-wp; + no-sdio; + no-mmc; + + power-domains = <&pwrc PWRC_T7_SDIO_B_ID>; + + cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>; + vmmc-supply = <&sd_3v3>; + vqmmc-supply = <&vddio_c>; +}; + +/* eMMC */ +&sd_emmc_c { + status = "okay"; + pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>; + pinctrl-1 = <&emmc_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; + + bus-width = <8>; + cap-mmc-highspeed; + mmc-ddr-1_8v; + mmc-hs200-1_8v; + max-frequency = <200000000>; + disable-wp; + non-removable; + no-sdio; + no-sd; + + power-domains = <&pwrc PWRC_T7_EMMC_ID>; + + vmmc-supply = <&vddio_3v3>; + vqmmc-supply = <&vddio_1v8>; +}; + &uart_a { status = "okay"; clocks = <&xtal>, <&xtal>, <&xtal>; From caaf6ccaec2744aa7ec82f78b05b316d9a8d1857 Mon Sep 17 00:00:00 2001 From: Ronald Claveau Date: Tue, 31 Mar 2026 16:24:05 +0200 Subject: [PATCH 19/22] arm64: dts: amlogic: t7: Fix missing required reset property CHECK_DTBS shows missing reset required property in T7 DTBS. A new CHECK_DTBS with this patch does not show this anymore. Signed-off-by: Ronald Claveau Link: https://patch.msgid.link/20260331-fix-aml-t7-null-reset-v1-2-eb95b625234c@aliel.fr Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi index fc23f409fe1d..62f6b9baad28 100644 --- a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi @@ -717,6 +717,7 @@ sd_emmc_a: mmc@88000 { <&clkc_periphs CLKID_SD_EMMC_A>, <&scmi_clk CLKID_FCLK_DIV2>; clock-names = "core", "clkin0", "clkin1"; + resets = <&reset RESET_SD_EMMC_A>; assigned-clocks = <&clkc_periphs CLKID_SD_EMMC_A_SEL>; assigned-clock-parents = <&xtal>; status = "disabled"; @@ -730,6 +731,7 @@ sd_emmc_b: mmc@8a000 { <&clkc_periphs CLKID_SD_EMMC_B>, <&scmi_clk CLKID_FCLK_DIV2>; clock-names = "core", "clkin0", "clkin1"; + resets = <&reset RESET_SD_EMMC_B>; assigned-clocks = <&clkc_periphs CLKID_SD_EMMC_B_SEL>; assigned-clock-parents = <&xtal>; status = "disabled"; @@ -743,6 +745,7 @@ sd_emmc_c: mmc@8c000 { <&clkc_periphs CLKID_SD_EMMC_C>, <&scmi_clk CLKID_FCLK_DIV2>; clock-names = "core", "clkin0", "clkin1"; + resets = <&reset RESET_SD_EMMC_C>; assigned-clocks = <&clkc_periphs CLKID_SD_EMMC_C_SEL>; assigned-clock-parents = <&xtal>; status = "disabled"; From a63d58bd2ddcdcf592167b5de836de6674698c1f Mon Sep 17 00:00:00 2001 From: Ronald Claveau Date: Wed, 13 May 2026 12:43:54 +0200 Subject: [PATCH 20/22] arm64: dts: amlogic: t7: khadas-vim4: reorder root node Move the xtal-clk node to restore alphabetical ordering. Signed-off-by: Ronald Claveau Reviewed-by: Neil Armstrong Link: https://patch.msgid.link/20260513-add-kvim4-sysled-v2-2-3ec9779e8875@aliel.fr Signed-off-by: Neil Armstrong --- .../dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts b/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts index 69d6118ba57e..fd1b983354a0 100644 --- a/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts @@ -45,13 +45,6 @@ secmon_reserved_bl32: secmon@5300000 { }; }; - xtal: xtal-clk { - compatible = "fixed-clock"; - clock-frequency = <24000000>; - clock-output-names = "xtal"; - #clock-cells = <0>; - }; - dc_in: regulator-dc-in { compatible = "regulator-fixed"; regulator-name = "DC_IN"; @@ -155,6 +148,13 @@ wifi32k: wifi32k { clock-frequency = <32768>; pwms = <&pwm_ab 0 30518 0>; }; + + xtal: xtal-clk { + compatible = "fixed-clock"; + clock-frequency = <24000000>; + clock-output-names = "xtal"; + #clock-cells = <0>; + }; }; &pwm_ab { From 61ba02ca4758e7978dc8caf5e1fff3a9f5921a60 Mon Sep 17 00:00:00 2001 From: Ronald Claveau Date: Wed, 13 May 2026 12:43:55 +0200 Subject: [PATCH 21/22] arm64: dts: amlogic: t7: khadas-vim4: add PWM-driven status LED The VIM4 board exposes a status LED wired to the PWM_AO_C_D output. Enable the pwm_ao_cd controller with its pinmux, and declare a pwm-leds node with a heartbeat trigger. Signed-off-by: Ronald Claveau Link: https://patch.msgid.link/20260513-add-kvim4-sysled-v2-3-3ec9779e8875@aliel.fr Signed-off-by: Neil Armstrong --- .../amlogic/amlogic-t7-a311d2-khadas-vim4.dts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts b/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts index fd1b983354a0..c41525a34b72 100644 --- a/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts @@ -53,6 +53,16 @@ dc_in: regulator-dc-in { regulator-always-on; }; + pwm-leds { + compatible = "pwm-leds"; + + status { + linux,default-trigger="heartbeat"; + max-brightness = <255>; + pwms = <&pwm_ao_cd 0 30040 0>; + }; + }; + sd_3v3: regulator-sdcard-3v3 { compatible = "regulator-fixed"; regulator-name = "SD_3V3"; @@ -163,6 +173,12 @@ &pwm_ab { pinctrl-names = "default"; }; +&pwm_ao_cd { + status = "okay"; + pinctrl-0 = <&pwm_ao_c_d_pins>; + pinctrl-names = "default"; +}; + /* SDIO */ &sd_emmc_a { status = "okay"; From eec0722a5cac08ba995847c8eb63118cc708560b Mon Sep 17 00:00:00 2001 From: Ronald Claveau Date: Sat, 16 May 2026 19:17:06 +0200 Subject: [PATCH 22/22] arm64: dts: amlogic: t7: Add i2c pinctrl node Add the T7 pinctrl used by the Khadas VIM4 for MCU communication. Reviewed-by: Neil Armstrong Signed-off-by: Ronald Claveau Link: https://patch.msgid.link/20260516-add-mcu-fan-khadas-vim4-v6-6-cccc9b61f465@aliel.fr Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi index 62f6b9baad28..cc371fcd1896 100644 --- a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi @@ -376,6 +376,16 @@ mux { }; }; + i2c0_ao_d_pins: i2c0-ao-d { + mux { + groups = "i2c0_ao_sck_d", + "i2c0_ao_sda_d"; + function = "i2c0_ao"; + bias-disable; + drive-strength-microamp = <3000>; + }; + }; + pwm_a_pins: pwm-a { mux { groups = "pwm_a";