diff --git a/config/boards/bestv-r3300-l.csc b/config/boards/bestv-r3300-l.csc new file mode 100644 index 000000000..b28f330ba --- /dev/null +++ b/config/boards/bestv-r3300-l.csc @@ -0,0 +1,49 @@ +# Amlogic S905L-B 1GB RAM 8GB eMMC microSD FE USB2 RTL8189FTV WiFi +BOARD_NAME="BesTV R3300-L" +BOARDFAMILY="meson-gxl" +BOARD_MAINTAINER="retro98boy" +BOOTCONFIG="bestv-r3300-l_defconfig" +KERNEL_TARGET="current,edge" +KERNEL_TEST_TARGET="current" +FULL_DESKTOP="yes" +SERIALCON="ttyAML0" +BOOT_LOGO="desktop" +BOOT_FDT_FILE="amlogic/meson-gxl-s905x-bestv-r3300-l.dtb" +PACKAGE_LIST_BOARD="alsa-ucm-conf" # Contain ALSA UCM top-level configuration file + +BOOTBRANCH_BOARD="tag:v2025.04" +BOOTPATCHDIR="v2025.04" # This has a patch that adds support for BesTV R3300-L. + +function post_family_config__use_repacked_fip() { + declare -g UBOOT_TARGET_MAP="u-boot.bin" + unset write_uboot_platform + + function write_uboot_platform() { + dd if="$1/u-boot.bin" of="$2" bs=512 seek=1 conv=fsync,notrunc 2>&1 + } +} + +function post_uboot_custom_postprocess__repack_vendor_fip_with_mainline_uboot() { + gxlimg_repack_fip_with_new_uboot "${SRC}/cache/sources/amlogic-fip-blobs/bestv-r3300-l/bootloader.PARTITION" gxl +} + +function post_family_tweaks_bsp__bestv-r3300-l() { + display_alert "${BOARD}" "Installing ALSA UCM configuration files" "info" + + # Use ALSA UCM via GUI: Install a desktop environment such as GNOME, PipeWire, and WirePlumber. + + # Use ALSA UCM via CLI: + # alsactl init && alsaucm set _verb "HiFi" set _enadev "HDMI" + # or + # alsactl init && alsaucm set _verb "HiFi" set _enadev "Lineout" + # playback: aplay -D plughw:S905XP212,0 /usr/share/sounds/alsa/Front_Center.wav + + install -Dm644 "${SRC}/packages/bsp/S905X-P212/S905X-P212-HiFi.conf" "${destination}/usr/share/alsa/ucm2/Amlogic/gx-sound-card/S905X-P212-HiFi.conf" + install -Dm644 "${SRC}/packages/bsp/S905X-P212/S905X-P212.conf" "${destination}/usr/share/alsa/ucm2/Amlogic/gx-sound-card/S905X-P212.conf" + + if [ ! -d "${destination}/usr/share/alsa/ucm2/conf.d/gx-sound-card" ]; then + mkdir -p "${destination}/usr/share/alsa/ucm2/conf.d/gx-sound-card" + fi + ln -sfv /usr/share/alsa/ucm2/Amlogic/gx-sound-card/S905X-P212.conf \ + "${destination}/usr/share/alsa/ucm2/conf.d/gx-sound-card/S905X-P212.conf" +} diff --git a/packages/bsp/S905X-P212/S905X-P212-HiFi.conf b/packages/bsp/S905X-P212/S905X-P212-HiFi.conf new file mode 100644 index 000000000..ca4326a3b --- /dev/null +++ b/packages/bsp/S905X-P212/S905X-P212-HiFi.conf @@ -0,0 +1,42 @@ +SectionVerb { + Value { + TQ "HiFi" + } +} + +SectionDevice."HDMI" { + Comment "HDMI" + + Value { + PlaybackPriority 200 + PlaybackPCM "hw:${CardId},0" + } + + EnableSequence [ + cset "name='AIU HDMI CTRL SRC' 'I2S'" + ] + + DisableSequence [ + cset "name='AIU HDMI CTRL SRC' 'DISABLED'" + ] +} + +SectionDevice."Lineout" { + Comment "Lineout" + + Value { + PlaybackPriority 100 + PlaybackPCM "hw:${CardId},0" + PlaybackMixerElem "ACODEC" + } + + EnableSequence [ + cset "name='AIU ACODEC SRC' 'I2S'" + cset "name='AIU ACODEC OUT EN Switch' on" + ] + + DisableSequence [ + cset "name='AIU ACODEC SRC' 'DISABLED'" + cset "name='AIU ACODEC OUT EN Switch' off" + ] +} diff --git a/packages/bsp/S905X-P212/S905X-P212.conf b/packages/bsp/S905X-P212/S905X-P212.conf new file mode 100644 index 000000000..1637a8526 --- /dev/null +++ b/packages/bsp/S905X-P212/S905X-P212.conf @@ -0,0 +1,25 @@ +Syntax 4 + +Comment "S905X P212 Sound" + +SectionUseCase."HiFi" { + File "/Amlogic/gx-sound-card/S905X-P212-HiFi.conf" + Comment "Play HiFi quality music" +} + +BootSequence [ + # Reset to default + cset "name='ACODEC Playback Volume' 255" + cset "name='ACODEC Left DAC Sel' 'Left'" + cset "name='ACODEC Mute Ramp Switch' off" + cset "name='ACODEC Playback Channel Mode' 'Stereo'" + cset "name='ACODEC Ramp Rate' 'Fast'" + cset "name='ACODEC Right DAC Sel' 'Right'" + cset "name='ACODEC Unmute Ramp Switch' off" + cset "name='ACODEC Volume Ramp Switch' off" + cset "name='AIU ACODEC I2S Lane Select' 0" + cset "name='AIU ACODEC OUT EN Switch' off" + cset "name='AIU ACODEC SRC' 'DISABLED'" + cset "name='AIU HDMI CTRL SRC' 'DISABLED'" + cset "name='AIU SPDIF SRC SEL' 'SPDIF'" +] diff --git a/patch/kernel/archive/meson64-6.12/dt/meson-gxl-s905x-bestv-r3300-l.dts b/patch/kernel/archive/meson64-6.12/dt/meson-gxl-s905x-bestv-r3300-l.dts new file mode 100644 index 000000000..8f706faf4 --- /dev/null +++ b/patch/kernel/archive/meson64-6.12/dt/meson-gxl-s905x-bestv-r3300-l.dts @@ -0,0 +1,231 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2025 retro98boy + */ + +/dts-v1/; + +#include "meson-gxl-s905x-p212.dtsi" +#include +#include +#include + +/ { + compatible = "bestv,r3300-l", "amlogic,s905x", "amlogic,meson-gxl"; + model = "BesTV R3300-L"; + + aliases { + rtc1 = &vrtc; + }; + + memory@0 { + reg = <0x0 0x0 0x0 0x40000000>; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + poll-interval = <100>; + + rst-btn { + label = "rst-btn"; + linux,code = ; + gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + /* + * The power LED on the device is always on, defaulting to red. + * Pulling GPIODV_24 high changes it to green, indicating that the kernel has started. + */ + pwr-led-green { + function = LED_FUNCTION_POWER; + color = ; + gpios = <&gpio GPIODV_24 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + /* + * GPIOAO_4 is used to turn on the WLAN LED, defaulting to red, + * and GPIODV_27 is used to change the color of the WLAN LED. + */ + wlan-led-red { + function = LED_FUNCTION_WLAN; + color = ; + gpios = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + /* + * modprobe ledtrig-netdev + * echo netdev > /sys/class/leds/green\:wlan/trigger + * echo wlan0 > /sys/class/leds/green\:wlan/device_name + * + * echo 1 > /sys/class/leds/green\:wlan/link + * or + * echo 1 > /sys/class/leds/green\:wlan/rx + */ + wlan-led-green { + function = LED_FUNCTION_WLAN; + color = ; + gpios = <&gpio GPIODV_27 GPIO_ACTIVE_HIGH>; + default-state = "off"; + linux,default-trigger = "netdev"; + }; + }; + + dio2128: analog-amplifier { + compatible = "simple-audio-amplifier"; + sound-name-prefix = "AU2"; + VCC-supply = <&hdmi_5v>; + enable-gpios = <&gpio GPIOH_5 GPIO_ACTIVE_HIGH>; + }; + + cvbs-connector { + compatible = "composite-video-connector"; + + port { + cvbs_connector_in: endpoint { + remote-endpoint = <&cvbs_vdac_out>; + }; + }; + }; + + hdmi-connector { + compatible = "hdmi-connector"; + type = "a"; + + port { + hdmi_connector_in: endpoint { + remote-endpoint = <&hdmi_tx_tmds_out>; + }; + }; + }; + + sound { + compatible = "amlogic,gx-sound-card"; + model = "S905X-P212"; + audio-aux-devs = <&dio2128>; + audio-widgets = "Line", "Lineout"; + audio-routing = "AU2 INL", "ACODEC LOLN", + "AU2 INR", "ACODEC LORN", + "Lineout", "AU2 OUTL", + "Lineout", "AU2 OUTR"; + clocks = <&clkc CLKID_MPLL0>, + <&clkc CLKID_MPLL1>, + <&clkc CLKID_MPLL2>; + + assigned-clocks = <&clkc CLKID_MPLL0>, + <&clkc CLKID_MPLL1>, + <&clkc CLKID_MPLL2>; + assigned-clock-parents = <0>, <0>, <0>; + assigned-clock-rates = <294912000>, + <270950400>, + <393216000>; + dai-link-0 { + sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>; + }; + + dai-link-1 { + sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>; + dai-format = "i2s"; + mclk-fs = <256>; + + codec-0 { + sound-dai = <&aiu AIU_HDMI CTRL_I2S>; + }; + + codec-1 { + sound-dai = <&aiu AIU_ACODEC CTRL_I2S>; + }; + }; + + dai-link-2 { + sound-dai = <&aiu AIU_HDMI CTRL_OUT>; + + codec-0 { + sound-dai = <&hdmi_tx>; + }; + }; + + dai-link-3 { + sound-dai = <&aiu AIU_ACODEC CTRL_OUT>; + + codec-0 { + sound-dai = <&acodec>; + }; + }; + }; +}; + +&acodec { + AVDD-supply = <&vddio_ao18>; + status = "okay"; +}; + +&aiu { + status = "okay"; +}; + +&brcmf { + /delete-property/ compatible; +}; + +&cec_AO { + status = "okay"; + pinctrl-0 = <&ao_cec_pins>; + pinctrl-names = "default"; + hdmi-phandle = <&hdmi_tx>; +}; + +&cvbs_vdac_port { + cvbs_vdac_out: endpoint { + remote-endpoint = <&cvbs_connector_in>; + }; +}; + +&emmc_pwrseq { + reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>; /* not sure */ +}; + +&hdmi_5v { + /delete-property/ gpio; + /delete-property/ enable-active-high; +}; + +&hdmi_tx { + status = "okay"; + pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>; + pinctrl-names = "default"; + hdmi-supply = <&hdmi_5v>; +}; + +&hdmi_tx_tmds_port { + hdmi_tx_tmds_out: endpoint { + remote-endpoint = <&hdmi_connector_in>; + }; +}; + +&sd_emmc_b { + max-frequency = <200000000>; + sd-uhs-sdr12; + sd-uhs-sdr25; + sd-uhs-sdr50; + sd-uhs-sdr104; + sd-uhs-ddr50; +}; + +&sd_emmc_c { + mmc-hs400-1_8v; +}; + +&uart_A { + status = "disabled"; + /delete-node/ bluetooth; +}; + +&usb { + dr_mode = "otg"; +}; diff --git a/patch/kernel/archive/meson64-6.18/dt/meson-gxl-s905x-bestv-r3300-l.dts b/patch/kernel/archive/meson64-6.18/dt/meson-gxl-s905x-bestv-r3300-l.dts new file mode 100644 index 000000000..d67705806 --- /dev/null +++ b/patch/kernel/archive/meson64-6.18/dt/meson-gxl-s905x-bestv-r3300-l.dts @@ -0,0 +1,227 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2025 retro98boy + */ + +/dts-v1/; + +#include "meson-gxl-s905x-p212.dtsi" +#include +#include +#include + +/ { + compatible = "bestv,r3300-l", "amlogic,s905x", "amlogic,meson-gxl"; + model = "BesTV R3300-L"; + + aliases { + rtc1 = &vrtc; + }; + + memory@0 { + reg = <0x0 0x0 0x0 0x40000000>; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + poll-interval = <100>; + + rst-btn { + label = "rst-btn"; + linux,code = ; + gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + /* + * The power LED on the device is always on, defaulting to red. + * Pulling GPIODV_24 high changes it to green, indicating that the kernel has started. + */ + pwr-led-green { + function = LED_FUNCTION_POWER; + color = ; + gpios = <&gpio GPIODV_24 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + /* + * GPIOAO_4 is used to turn on the WLAN LED, defaulting to red, + * and GPIODV_27 is used to change the color of the WLAN LED. + */ + wlan-led-red { + function = LED_FUNCTION_WLAN; + color = ; + gpios = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + /* + * modprobe ledtrig-netdev + * echo netdev > /sys/class/leds/green\:wlan/trigger + * echo wlan0 > /sys/class/leds/green\:wlan/device_name + * + * echo 1 > /sys/class/leds/green\:wlan/link + * or + * echo 1 > /sys/class/leds/green\:wlan/rx + */ + wlan-led-green { + function = LED_FUNCTION_WLAN; + color = ; + gpios = <&gpio GPIODV_27 GPIO_ACTIVE_HIGH>; + default-state = "off"; + linux,default-trigger = "netdev"; + }; + }; + + dio2128: analog-amplifier { + compatible = "simple-audio-amplifier"; + sound-name-prefix = "AU2"; + VCC-supply = <&hdmi_5v>; + enable-gpios = <&gpio GPIOH_5 GPIO_ACTIVE_HIGH>; + }; + + cvbs-connector { + compatible = "composite-video-connector"; + + port { + cvbs_connector_in: endpoint { + remote-endpoint = <&cvbs_vdac_out>; + }; + }; + }; + + hdmi-connector { + compatible = "hdmi-connector"; + type = "a"; + + port { + hdmi_connector_in: endpoint { + remote-endpoint = <&hdmi_tx_tmds_out>; + }; + }; + }; + + sound { + compatible = "amlogic,gx-sound-card"; + model = "S905X-P212"; + audio-aux-devs = <&dio2128>; + audio-widgets = "Line", "Lineout"; + audio-routing = "AU2 INL", "ACODEC LOLN", + "AU2 INR", "ACODEC LORN", + "Lineout", "AU2 OUTL", + "Lineout", "AU2 OUTR"; + clocks = <&clkc CLKID_MPLL0>, + <&clkc CLKID_MPLL1>, + <&clkc CLKID_MPLL2>; + + assigned-clocks = <&clkc CLKID_MPLL0>, + <&clkc CLKID_MPLL1>, + <&clkc CLKID_MPLL2>; + assigned-clock-parents = <0>, <0>, <0>; + assigned-clock-rates = <294912000>, + <270950400>, + <393216000>; + dai-link-0 { + sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>; + }; + + dai-link-1 { + sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>; + dai-format = "i2s"; + mclk-fs = <256>; + + codec-0 { + sound-dai = <&aiu AIU_HDMI CTRL_I2S>; + }; + + codec-1 { + sound-dai = <&aiu AIU_ACODEC CTRL_I2S>; + }; + }; + + dai-link-2 { + sound-dai = <&aiu AIU_HDMI CTRL_OUT>; + + codec-0 { + sound-dai = <&hdmi_tx>; + }; + }; + + dai-link-3 { + sound-dai = <&aiu AIU_ACODEC CTRL_OUT>; + + codec-0 { + sound-dai = <&acodec>; + }; + }; + }; +}; + +&acodec { + AVDD-supply = <&vddio_ao18>; + status = "okay"; +}; + +&aiu { + status = "okay"; +}; + +&cec_AO { + status = "okay"; + pinctrl-0 = <&ao_cec_pins>; + pinctrl-names = "default"; + hdmi-phandle = <&hdmi_tx>; +}; + +&cvbs_vdac_port { + cvbs_vdac_out: endpoint { + remote-endpoint = <&cvbs_connector_in>; + }; +}; + +&emmc_pwrseq { + reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>; /* not sure */ +}; + +&hdmi_5v { + /delete-property/ gpio; + /delete-property/ enable-active-high; +}; + +&hdmi_tx { + status = "okay"; + pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>; + pinctrl-names = "default"; + hdmi-supply = <&hdmi_5v>; +}; + +&hdmi_tx_tmds_port { + hdmi_tx_tmds_out: endpoint { + remote-endpoint = <&hdmi_connector_in>; + }; +}; + +&sd_emmc_b { + max-frequency = <200000000>; + sd-uhs-sdr12; + sd-uhs-sdr25; + sd-uhs-sdr50; + sd-uhs-sdr104; + sd-uhs-ddr50; +}; + +&sd_emmc_c { + mmc-hs400-1_8v; +}; + +&uart_A { + status = "disabled"; + /delete-node/ bluetooth; +}; + +&usb { + dr_mode = "otg"; +}; diff --git a/patch/u-boot/v2025.04/board_bestv-r3300-l/add-board-bestv-r3300-l.patch b/patch/u-boot/v2025.04/board_bestv-r3300-l/add-board-bestv-r3300-l.patch new file mode 100644 index 000000000..939f0cabe --- /dev/null +++ b/patch/u-boot/v2025.04/board_bestv-r3300-l/add-board-bestv-r3300-l.patch @@ -0,0 +1,314 @@ +diff --git a/arch/arm/dts/meson-gxl-s905x-bestv-r3300-l-u-boot.dtsi b/arch/arm/dts/meson-gxl-s905x-bestv-r3300-l-u-boot.dtsi +new file mode 100644 +index 00000000..39270ea7 +--- /dev/null ++++ b/arch/arm/dts/meson-gxl-s905x-bestv-r3300-l-u-boot.dtsi +@@ -0,0 +1,7 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (c) 2019 BayLibre, SAS. ++ * Author: Neil Armstrong ++ */ ++ ++#include "meson-gxl-u-boot.dtsi" +diff --git a/configs/bestv-r3300-l_defconfig b/configs/bestv-r3300-l_defconfig +new file mode 100644 +index 00000000..8b6e9cec +--- /dev/null ++++ b/configs/bestv-r3300-l_defconfig +@@ -0,0 +1,56 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_MESON=y ++CONFIG_TEXT_BASE=0x01000000 ++CONFIG_NR_DRAM_BANKS=1 ++CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y ++CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x20000000 ++CONFIG_ENV_SIZE=0x2000 ++CONFIG_DM_GPIO=y ++CONFIG_DEFAULT_DEVICE_TREE="amlogic/meson-gxl-s905x-bestv-r3300-l" ++CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_DM_RESET=y ++CONFIG_MESON_GXL=y ++CONFIG_SYS_LOAD_ADDR=0x1000000 ++CONFIG_DEBUG_UART_BASE=0xc81004c0 ++CONFIG_DEBUG_UART_CLOCK=24000000 ++CONFIG_IDENT_STRING=" r3300-l" ++CONFIG_DEBUG_UART=y ++CONFIG_REMAKE_ELF=y ++CONFIG_FIT=y ++CONFIG_FIT_SIGNATURE=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_LEGACY_IMAGE_FORMAT=y ++CONFIG_OF_BOARD_SETUP=y ++CONFIG_CONSOLE_MUX=y ++# CONFIG_DISPLAY_CPUINFO is not set ++CONFIG_MISC_INIT_R=y ++CONFIG_SYS_MAXARGS=32 ++# CONFIG_CMD_BDI is not set ++# CONFIG_CMD_IMI is not set ++CONFIG_CMD_GPIO=y ++# CONFIG_CMD_LOADS is not set ++CONFIG_CMD_MMC=y ++CONFIG_CMD_USB=y ++# CONFIG_CMD_SETEXPR is not set ++CONFIG_CMD_REGULATOR=y ++CONFIG_OF_CONTROL=y ++CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_MMC_MESON_GX=y ++CONFIG_PHY_MESON_GXL=y ++CONFIG_DM_MDIO=y ++CONFIG_DM_MDIO_MUX=y ++CONFIG_ETH_DESIGNWARE_MESON8B=y ++CONFIG_MDIO_MUX_MESON_GXL=y ++CONFIG_MESON_GXL_USB_PHY=y ++CONFIG_PINCTRL=y ++CONFIG_PINCTRL_MESON_GXL=y ++CONFIG_DM_REGULATOR=y ++CONFIG_DM_REGULATOR_FIXED=y ++CONFIG_DEBUG_UART_ANNOUNCE=y ++CONFIG_DEBUG_UART_SKIP_INIT=y ++CONFIG_MESON_SERIAL=y ++CONFIG_USB=y ++CONFIG_USB_XHCI_HCD=y ++CONFIG_USB_XHCI_DWC3=y ++CONFIG_USB_DWC3=y ++CONFIG_USB_DWC3_MESON_GXL=y +diff --git a/dts/upstream/src/arm64/amlogic/meson-gxl-s905x-bestv-r3300-l.dts b/dts/upstream/src/arm64/amlogic/meson-gxl-s905x-bestv-r3300-l.dts +new file mode 100644 +index 00000000..0b46edbe +--- /dev/null ++++ b/dts/upstream/src/arm64/amlogic/meson-gxl-s905x-bestv-r3300-l.dts +@@ -0,0 +1,233 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (c) 2025 retro98boy ++ */ ++ ++/dts-v1/; ++ ++#include "meson-gxl-s905x-p212.dtsi" ++#include ++#include ++#include ++ ++/ { ++ compatible = "bestv,r3300-l", "amlogic,s905x", "amlogic,meson-gxl"; ++ model = "BesTV R3300-L"; ++ ++ /* ++ aliases { ++ rtc1 = &vrtc; ++ }; ++ */ ++ ++ memory@0 { ++ reg = <0x0 0x0 0x0 0x40000000>; ++ }; ++ ++ gpio-keys-polled { ++ compatible = "gpio-keys-polled"; ++ poll-interval = <100>; ++ ++ rst-btn { ++ label = "rst-btn"; ++ linux,code = ; ++ gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ gpio-leds { ++ compatible = "gpio-leds"; ++ ++ /* ++ * The power LED on the device is always on, defaulting to red. ++ * Pulling GPIODV_24 high changes it to green, indicating that the kernel has started. ++ */ ++ pwr-led-green { ++ function = LED_FUNCTION_POWER; ++ color = ; ++ gpios = <&gpio GPIODV_24 GPIO_ACTIVE_HIGH>; ++ default-state = "on"; ++ }; ++ ++ /* ++ * GPIOAO_4 is used to turn on the WLAN LED, defaulting to red, ++ * and GPIODV_27 is used to change the color of the WLAN LED. ++ */ ++ wlan-led-red { ++ function = LED_FUNCTION_WLAN; ++ color = ; ++ gpios = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_HIGH>; ++ default-state = "on"; ++ }; ++ ++ /* ++ * modprobe ledtrig-netdev ++ * echo netdev > /sys/class/leds/green\:wlan/trigger ++ * echo wlan0 > /sys/class/leds/green\:wlan/device_name ++ * ++ * echo 1 > /sys/class/leds/green\:wlan/link ++ * or ++ * echo 1 > /sys/class/leds/green\:wlan/rx ++ */ ++ wlan-led-green { ++ function = LED_FUNCTION_WLAN; ++ color = ; ++ gpios = <&gpio GPIODV_27 GPIO_ACTIVE_HIGH>; ++ default-state = "off"; ++ linux,default-trigger = "netdev"; ++ }; ++ }; ++ ++ dio2128: analog-amplifier { ++ compatible = "simple-audio-amplifier"; ++ sound-name-prefix = "AU2"; ++ VCC-supply = <&hdmi_5v>; ++ enable-gpios = <&gpio GPIOH_5 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ cvbs-connector { ++ compatible = "composite-video-connector"; ++ ++ port { ++ cvbs_connector_in: endpoint { ++ remote-endpoint = <&cvbs_vdac_out>; ++ }; ++ }; ++ }; ++ ++ hdmi-connector { ++ compatible = "hdmi-connector"; ++ type = "a"; ++ ++ port { ++ hdmi_connector_in: endpoint { ++ remote-endpoint = <&hdmi_tx_tmds_out>; ++ }; ++ }; ++ }; ++ ++ sound { ++ compatible = "amlogic,gx-sound-card"; ++ model = "S905X-P212"; ++ audio-aux-devs = <&dio2128>; ++ audio-widgets = "Line", "Lineout"; ++ audio-routing = "AU2 INL", "ACODEC LOLN", ++ "AU2 INR", "ACODEC LORN", ++ "Lineout", "AU2 OUTL", ++ "Lineout", "AU2 OUTR"; ++ clocks = <&clkc CLKID_MPLL0>, ++ <&clkc CLKID_MPLL1>, ++ <&clkc CLKID_MPLL2>; ++ ++ assigned-clocks = <&clkc CLKID_MPLL0>, ++ <&clkc CLKID_MPLL1>, ++ <&clkc CLKID_MPLL2>; ++ assigned-clock-parents = <0>, <0>, <0>; ++ assigned-clock-rates = <294912000>, ++ <270950400>, ++ <393216000>; ++ dai-link-0 { ++ sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>; ++ }; ++ ++ dai-link-1 { ++ sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>; ++ dai-format = "i2s"; ++ mclk-fs = <256>; ++ ++ codec-0 { ++ sound-dai = <&aiu AIU_HDMI CTRL_I2S>; ++ }; ++ ++ codec-1 { ++ sound-dai = <&aiu AIU_ACODEC CTRL_I2S>; ++ }; ++ }; ++ ++ dai-link-2 { ++ sound-dai = <&aiu AIU_HDMI CTRL_OUT>; ++ ++ codec-0 { ++ sound-dai = <&hdmi_tx>; ++ }; ++ }; ++ ++ dai-link-3 { ++ sound-dai = <&aiu AIU_ACODEC CTRL_OUT>; ++ ++ codec-0 { ++ sound-dai = <&acodec>; ++ }; ++ }; ++ }; ++}; ++ ++&acodec { ++ AVDD-supply = <&vddio_ao18>; ++ status = "okay"; ++}; ++ ++&aiu { ++ status = "okay"; ++}; ++ ++&brcmf { ++ /delete-property/ compatible; ++}; ++ ++&cec_AO { ++ status = "okay"; ++ pinctrl-0 = <&ao_cec_pins>; ++ pinctrl-names = "default"; ++ hdmi-phandle = <&hdmi_tx>; ++}; ++ ++&cvbs_vdac_port { ++ cvbs_vdac_out: endpoint { ++ remote-endpoint = <&cvbs_connector_in>; ++ }; ++}; ++ ++&emmc_pwrseq { ++ reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>; /* not sure */ ++}; ++ ++&hdmi_5v { ++ /delete-property/ gpio; ++ /delete-property/ enable-active-high; ++}; ++ ++&hdmi_tx { ++ status = "okay"; ++ pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>; ++ pinctrl-names = "default"; ++ hdmi-supply = <&hdmi_5v>; ++}; ++ ++&hdmi_tx_tmds_port { ++ hdmi_tx_tmds_out: endpoint { ++ remote-endpoint = <&hdmi_connector_in>; ++ }; ++}; ++ ++&sd_emmc_b { ++ max-frequency = <200000000>; ++ sd-uhs-sdr12; ++ sd-uhs-sdr25; ++ sd-uhs-sdr50; ++ sd-uhs-sdr104; ++ sd-uhs-ddr50; ++}; ++ ++&sd_emmc_c { ++ mmc-hs400-1_8v; ++}; ++ ++&uart_A { ++ status = "disabled"; ++ /delete-node/ bluetooth; ++}; ++ ++&usb { ++ dr_mode = "otg"; ++};