From 3fa57cb0178d3cdb7fd4abc03aebef818eaadd21 Mon Sep 17 00:00:00 2001 From: Martin Blumenstingl Date: Sat, 29 Mar 2025 19:58:49 +0100 Subject: [PATCH 1/6] ARM: dts: amlogic: meson8: enable UART RX and TX pull up by default Some boards have noise on the UART RX line when the UART pins are not connected to another device (such as an USB UART adapter). This can be addressed by using a pull up resistor. Not all boards may provide such a pull up resistor on the PCB so enable the SoC's pull-up on the UART RX and TX pads by default. This matches the default (from u-boot or SoC hardware) state for the pinmux configuration on these pads. Signed-off-by: Martin Blumenstingl Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20250329185855.854186-2-martin.blumenstingl@googlemail.com Signed-off-by: Neil Armstrong --- arch/arm/boot/dts/amlogic/meson8.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/amlogic/meson8.dtsi b/arch/arm/boot/dts/amlogic/meson8.dtsi index 847f7b1f1e96..7fe0c7d3ee6e 100644 --- a/arch/arm/boot/dts/amlogic/meson8.dtsi +++ b/arch/arm/boot/dts/amlogic/meson8.dtsi @@ -398,7 +398,7 @@ uart_ao_a_pins: uart_ao_a { mux { groups = "uart_tx_ao_a", "uart_rx_ao_a"; function = "uart_ao"; - bias-disable; + bias-pull-up; }; }; @@ -567,7 +567,7 @@ mux { groups = "uart_tx_a1", "uart_rx_a1"; function = "uart_a"; - bias-disable; + bias-pull-up; }; }; From 7db1068a5eedc419347a30dc81a25e3342fbbc10 Mon Sep 17 00:00:00 2001 From: Martin Blumenstingl Date: Sat, 29 Mar 2025 19:58:50 +0100 Subject: [PATCH 2/6] ARM: dts: amlogic: meson8b: enable UART RX and TX pull up by default Some boards have noise on the UART RX line when the UART pins are not connected to another device (such as an USB UART adapter). This can be addressed by using a pull up resistor. Not all boards may provide such a pull up resistor on the PCB so enable the SoC's pull-up on the UART RX and TX pads by default. This matches the default (from u-boot or SoC hardware) state for the pinmux configuration on these pads. Signed-off-by: Martin Blumenstingl Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20250329185855.854186-3-martin.blumenstingl@googlemail.com Signed-off-by: Neil Armstrong --- arch/arm/boot/dts/amlogic/meson8b.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/amlogic/meson8b.dtsi b/arch/arm/boot/dts/amlogic/meson8b.dtsi index 0876611ce26a..faf09f77c605 100644 --- a/arch/arm/boot/dts/amlogic/meson8b.dtsi +++ b/arch/arm/boot/dts/amlogic/meson8b.dtsi @@ -368,7 +368,7 @@ uart_ao_a_pins: uart_ao_a { mux { groups = "uart_tx_ao_a", "uart_rx_ao_a"; function = "uart_ao"; - bias-disable; + bias-pull-up; }; }; @@ -521,7 +521,7 @@ mux { groups = "uart_tx_b0", "uart_rx_b0"; function = "uart_b"; - bias-disable; + bias-pull-up; }; }; From 40f983aa2d809b4934a260c76b82e9ff19c09a88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Neusch=C3=A4fer?= Date: Mon, 28 Apr 2025 12:44:28 +0200 Subject: [PATCH 3/6] dt-bindings: vendor-prefixes: Add TC Unterhaltungselektronik AG MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TC Unterhaltungselektronik is the company behind Fernsehfee branded set-top boxes. Acked-by: Krzysztof Kozlowski Signed-off-by: J. Neuschäfer Link: https://lore.kernel.org/r/20250428-fernsehfee-v2-1-293b98a43a91@posteo.net Signed-off-by: Neil Armstrong --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index 86f6a19b28ae..c61c5e11ff54 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -1494,6 +1494,8 @@ patternProperties: description: Toby Churchill Ltd. "^tcs,.*": description: Shenzhen City Tang Cheng Technology Co., Ltd. + "^tcu,.*": + description: TC Unterhaltungselektronik AG "^tdo,.*": description: Shangai Top Display Optoelectronics Co., Ltd "^team-source-display,.*": From eb7af1268e0042e83607918229cd62c3669cdcb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Neusch=C3=A4fer?= Date: Mon, 28 Apr 2025 12:44:29 +0200 Subject: [PATCH 4/6] dt-bindings: arm: amlogic: Add TCU Fernsehfee 3.0 board MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fernsehfee ("TV fairy") 3.0 is a set-top box with HDMI input and output ports. It originally ran Android 4.4 and a Linux 3.10 kernel. https://fernsehfee.de/ (German) https://telefairy.com/ (English) Acked-by: Krzysztof Kozlowski Reviewed-by: Martin Blumenstingl Signed-off-by: J. Neuschäfer Link: https://lore.kernel.org/r/20250428-fernsehfee-v2-2-293b98a43a91@posteo.net Signed-off-by: Neil Armstrong --- Documentation/devicetree/bindings/arm/amlogic.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/arm/amlogic.yaml b/Documentation/devicetree/bindings/arm/amlogic.yaml index 0647851ae1f5..f6f045528da3 100644 --- a/Documentation/devicetree/bindings/arm/amlogic.yaml +++ b/Documentation/devicetree/bindings/arm/amlogic.yaml @@ -27,6 +27,7 @@ properties: items: - enum: - minix,neo-x8 + - tcu,fernsehfee3 - const: amlogic,meson8 - description: Boards with the Amlogic Meson8m2 SoC From dac928757928a8ea06eaf5694d5deae53a21616f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Neusch=C3=A4fer?= Date: Mon, 28 Apr 2025 12:44:30 +0200 Subject: [PATCH 5/6] ARM: dts: amlogic: Add TCU Fernsehfee 3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fernsehfee[1] ("TV fairy") 3.0 is a set-top box with HDMI input and output ports. It originally ran Android 4.4 and a Linux 3.10 kernel. The following features are tested and known to work: - Ethernet - Power LED (switching between green and red) - Power button - eMMC - SD Card - USB - Wifi The following features are untested or not working: - HDMI input and output - Infrared remote control input and output [1]: https://fernsehfee.de/ (German), https://telefairy.com/ (English) Reviewed-by: Neil Armstrong Signed-off-by: J. Neuschäfer Reviewed-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20250428-fernsehfee-v2-3-293b98a43a91@posteo.net Signed-off-by: Neil Armstrong --- arch/arm/boot/dts/amlogic/Makefile | 1 + .../boot/dts/amlogic/meson8-fernsehfee3.dts | 215 ++++++++++++++++++ arch/arm/boot/dts/amlogic/meson8.dtsi | 18 ++ 3 files changed, 234 insertions(+) create mode 100644 arch/arm/boot/dts/amlogic/meson8-fernsehfee3.dts diff --git a/arch/arm/boot/dts/amlogic/Makefile b/arch/arm/boot/dts/amlogic/Makefile index 504c533b1173..3c8a1e88b386 100644 --- a/arch/arm/boot/dts/amlogic/Makefile +++ b/arch/arm/boot/dts/amlogic/Makefile @@ -1,6 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 dtb-$(CONFIG_MACH_MESON8) += \ meson8-minix-neo-x8.dtb \ + meson8-fernsehfee3.dtb \ meson8b-ec100.dtb \ meson8b-mxq.dtb \ meson8b-odroidc1.dtb \ diff --git a/arch/arm/boot/dts/amlogic/meson8-fernsehfee3.dts b/arch/arm/boot/dts/amlogic/meson8-fernsehfee3.dts new file mode 100644 index 000000000000..3f9e2e5d8d5b --- /dev/null +++ b/arch/arm/boot/dts/amlogic/meson8-fernsehfee3.dts @@ -0,0 +1,215 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT +// Copyright (C) 2025 J. Neuschäfer + +/dts-v1/; + +#include +#include +#include + +#include "meson8.dtsi" + +/ { + model = "Fernsehfee 3.0"; + compatible = "tcu,fernsehfee3", "amlogic,meson8"; + + aliases { + serial0 = &uart_AO; + gpiochip0 = &gpio; + gpiochip1 = &gpio_ao; + i2c0 = &i2c_AO; + i2c1 = &i2c_B; + mmc0 = &sdhc; + mmc1 = &sdio; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x40000000>; /* 1 GiB */ + }; + + gpio-keys { + compatible = "gpio-keys-polled"; + poll-interval = <100>; + + power-button { + label = "Power button"; + linux,code = ; + gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + /* + * The power LED can be turned red, otherwise it is green. + */ + gpios = <&gpio_ao GPIO_TEST_N GPIO_ACTIVE_LOW>; + function = LED_FUNCTION_POWER; + color = ; + }; + }; + + vcc_5v: regulator-5v { + /* 5V rail, always on as long as the system is running */ + compatible = "regulator-fixed"; + regulator-name = "5V"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-always-on; + }; + + vcc_3v3: regulator-3v3 { + /* Chipown AP2420 step-down converter */ + compatible = "regulator-fixed"; + regulator-name = "3.3V"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&vcc_5v>; + }; + + wifi_3v3: regulator-wifi { + compatible = "regulator-fixed"; + regulator-name = "3.3V-WIFI"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&vcc_3v3>; + gpio = <&gpio GPIOX_11 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; +}; + +ðmac { + status = "okay"; + pinctrl-0 = <ð_pins>; + pinctrl-names = "default"; + phy-handle = <ð_phy0>; + phy-mode = "rmii"; + + mdio { + compatible = "snps,dwmac-mdio"; + #address-cells = <1>; + #size-cells = <0>; + + eth_phy0: ethernet-phy@0 { + /* IC Plus IP101A (0x02430c54) */ + reg = <0>; + + reset-assert-us = <10000>; + reset-deassert-us = <10000>; + reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&i2c_AO { + status = "okay"; + pinctrl-0 = <&i2c_ao_pins>; + pinctrl-names = "default"; + + pmic@32 { + compatible = "ricoh,rn5t618"; + reg = <0x32>; + system-power-controller; + }; + + eeprom@50 { + /* Fairchild FM24C08A */ + compatible = "atmel,24c08"; + reg = <0x50>; + pagesize = <16>; + wp-gpios = <&gpio GPIOH_3 GPIO_ACTIVE_HIGH>; + num-addresses = <4>; + }; +}; + +&i2c_B { + status = "okay"; + pinctrl-0 = <&i2c_b_pins>; + pinctrl-names = "default"; + + /* TODO: SiI9293 HDMI receiver @ 0x39 */ +}; + +&sdhc { + status = "okay"; + pinctrl-0 = <&sdxc_c_pins>; + pinctrl-names = "default"; + + /* eMMC */ + bus-width = <8>; + max-frequency = <100000000>; + + disable-wp; + cap-mmc-highspeed; + mmc-hs200-1_8v; + no-sdio; + + vmmc-supply = <&vcc_3v3>; + vqmmc-supply = <&vcc_3v3>; +}; + +&sdio { + status = "okay"; + pinctrl-0 = <&sd_b_pins>; + + /* SD card */ + slot@1 { + compatible = "mmc-slot"; + reg = <1>; + status = "okay"; + + bus-width = <4>; + cap-mmc-highspeed; + cap-sd-highspeed; + disable-wp; + + cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>; + + vmmc-supply = <&vcc_3v3>; + }; +}; + +&uart_AO { + status = "okay"; + pinctrl-0 = <&uart_ao_a_pins>; + pinctrl-names = "default"; +}; + +&usb0 { + status = "okay"; +}; + +&usb0_phy { + status = "okay"; +}; + +&usb1 { + status = "okay"; + dr_mode = "host"; + #address-cells = <1>; + #size-cells = <0>; + + wifi: wifi@1 { + /* Realtek RTL8188 2.4GHz WiFi module */ + compatible = "usbbda,179"; + reg = <1>; + vdd-supply = <&wifi_3v3>; + }; +}; + +&usb1_phy { + status = "okay"; +}; + +&ir_receiver { + status = "okay"; + pinctrl-0 = <&ir_recv_pins>; + pinctrl-names = "default"; +}; diff --git a/arch/arm/boot/dts/amlogic/meson8.dtsi b/arch/arm/boot/dts/amlogic/meson8.dtsi index 7fe0c7d3ee6e..b9d9e5b3bce3 100644 --- a/arch/arm/boot/dts/amlogic/meson8.dtsi +++ b/arch/arm/boot/dts/amlogic/meson8.dtsi @@ -481,6 +481,14 @@ gpio: bank@80 { gpio-ranges = <&pinctrl_cbus 0 0 120>; }; + i2c_b_pins: i2c-b { + mux { + groups = "i2c_sda_b", "i2c_sck_b"; + function = "i2c_b"; + bias-disable; + }; + }; + sd_a_pins: sd-a { mux { groups = "sd_d0_a", "sd_d1_a", "sd_d2_a", @@ -526,6 +534,16 @@ mux { }; }; + sdxc_c_pins: sdxc-c { + mux { + groups = "sdxc_d0_c", "sdxc_d13_c", + "sdxc_clk_c", "sdxc_cmd_c", + "sdxc_d47_c"; + function = "sdxc_c"; + bias-pull-up; + }; + }; + spdif_out_pins: spdif-out { mux { groups = "spdif_out"; From 2c1879a440315e0b292bbff0fa63a73bd8a52e34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Neusch=C3=A4fer?= Date: Mon, 28 Apr 2025 12:44:31 +0200 Subject: [PATCH 6/6] ARM: dts: amlogic: meson8-fernsehfee3: Describe regulators MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fernsehfee3 board uses a Ricoh RN5T618 PMIC to generate various voltages. Board schematics are not available, but the regulator voltages found in /sys/kernel/debug/regulator/regulator_summary match those in meson8m2-mxiii-plus.dts: DCDC1 0 0 0 unknown 1100mV 0mA 0mV 0mV DCDC2 0 0 0 unknown 1150mV 0mA 0mV 0mV DCDC3 0 0 0 unknown 1500mV 0mA 0mV 0mV LDO1 0 0 0 unknown 2900mV 0mA 0mV 0mV LDO2 0 0 0 unknown 1800mV 0mA 0mV 0mV LDO3 0 0 0 unknown 1800mV 0mA 0mV 0mV LDO4 0 0 0 unknown 2850mV 0mA 0mV 0mV LDO5 0 0 0 unknown 1800mV 0mA 0mV 0mV LDORTC1 0 0 0 unknown 2700mV 0mA 0mV 0mV LDORTC2 0 0 0 unknown 900mV 0mA 0mV 0mV This patch takes the following approach: - Copy RN5T618 regulator nodes from meson8m2-mxiii-plus.dts - Remove some of the regulator names, which do not seem to apply - Verify regulator supply relations by starting without any relations (and without regulator-always-on) and seeing what breaks when the kernel turns off "unused" regulators. This results in the following observations: - When LDO1 is turned off, the board resets - When DCDC1, DCDC2, DCDC3, LDO2, or LDO5 are turned off, the board (as observed through the serial port) stops running, so these must stay on at all times. - LDO4 (VCC2V8) appears to be unused on this board. - LDO3 (VCC1V8_USB) must stay on in order for USB to work, both the external USB ports and the internal USB wifi module. The cpu-supply and mali-supply relations are also copied from meson8m2-mxiii-plus.dts Signed-off-by: J. Neuschäfer Reviewed-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20250428-fernsehfee-v2-4-293b98a43a91@posteo.net Signed-off-by: Neil Armstrong --- .../boot/dts/amlogic/meson8-fernsehfee3.dts | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/arch/arm/boot/dts/amlogic/meson8-fernsehfee3.dts b/arch/arm/boot/dts/amlogic/meson8-fernsehfee3.dts index 3f9e2e5d8d5b..4e52447d51bd 100644 --- a/arch/arm/boot/dts/amlogic/meson8-fernsehfee3.dts +++ b/arch/arm/boot/dts/amlogic/meson8-fernsehfee3.dts @@ -85,6 +85,10 @@ wifi_3v3: regulator-wifi { }; }; +&cpu0 { + cpu-supply = <&vcck>; +}; + ðmac { status = "okay"; pinctrl-0 = <ð_pins>; @@ -117,6 +121,87 @@ pmic@32 { compatible = "ricoh,rn5t618"; reg = <0x32>; system-power-controller; + + regulators { + vcck: DCDC1 { + regulator-name = "VCCK"; + regulator-min-microvolt = <825000>; + regulator-max-microvolt = <1150000>; + regulator-boot-on; + regulator-always-on; + }; + + vddee: DCDC2 { + /* the output is also used as VDDAO */ + regulator-name = "VDD_EE"; + regulator-min-microvolt = <950000>; + regulator-max-microvolt = <1150000>; + regulator-boot-on; + regulator-always-on; + }; + + DCDC3 { + regulator-name = "VDD_DDR"; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + regulator-boot-on; + regulator-always-on; + }; + + LDO1 { + regulator-name = "VDDIO_AO28"; + regulator-min-microvolt = <2900000>; + regulator-max-microvolt = <2900000>; + regulator-boot-on; + regulator-always-on; + }; + + LDO2 { + regulator-name = "VDDIO_AO18"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; + }; + + vcc1v8_usb: LDO3 { + regulator-name = "VCC1V8_USB"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + }; + + LDO4 { + /* This one appears to be unused */ + regulator-name = "VCC2V8"; + regulator-min-microvolt = <2850000>; + regulator-max-microvolt = <2850000>; + }; + + LDO5 { + regulator-name = "AVDD1V8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; + }; + + LDORTC1 { + regulator-name = "VDD_LDO"; + regulator-min-microvolt = <2700000>; + regulator-max-microvolt = <2700000>; + regulator-boot-on; + regulator-always-on; + }; + + LDORTC2 { + regulator-name = "RTC_0V9"; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <900000>; + regulator-boot-on; + regulator-always-on; + }; + }; }; eeprom@50 { @@ -137,6 +222,10 @@ &i2c_B { /* TODO: SiI9293 HDMI receiver @ 0x39 */ }; +&mali { + mali-supply = <&vddee>; +}; + &sdhc { status = "okay"; pinctrl-0 = <&sdxc_c_pins>; @@ -188,6 +277,7 @@ &usb0 { &usb0_phy { status = "okay"; + phy-supply = <&vcc1v8_usb>; }; &usb1 { @@ -206,6 +296,7 @@ wifi: wifi@1 { &usb1_phy { status = "okay"; + phy-supply = <&vcc1v8_usb>; }; &ir_receiver {