]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ARM: meson: Sync Amlogic DT from Linux 5.14
authorNeil Armstrong <narmstrong@baylibre.com>
Fri, 17 Sep 2021 07:37:00 +0000 (09:37 +0200)
committerNeil Armstrong <narmstrong@baylibre.com>
Thu, 7 Oct 2021 08:14:50 +0000 (10:14 +0200)
Import Amlogic DT changes from Linux commit 7d2a07b76933 ("Linux 5.14"),
dt-bindings clock changes and new meson-g12b-gsking-x.dts,
meson-sm1-bananapi-m5 & odroid-hc4 boards.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
34 files changed:
arch/arm/dts/Makefile
arch/arm/dts/meson-axg-s400.dts
arch/arm/dts/meson-axg.dtsi
arch/arm/dts/meson-g12-common.dtsi
arch/arm/dts/meson-g12a-sei510.dts
arch/arm/dts/meson-g12b-gsking-x.dts [new file with mode: 0644]
arch/arm/dts/meson-g12b-gtking-pro.dts
arch/arm/dts/meson-g12b-gtking.dts
arch/arm/dts/meson-g12b-odroid-n2-plus.dts
arch/arm/dts/meson-g12b-odroid-n2.dtsi
arch/arm/dts/meson-g12b-w400.dtsi
arch/arm/dts/meson-g12b.dtsi
arch/arm/dts/meson-gx-libretech-pc.dtsi
arch/arm/dts/meson-gx-p23x-q20x.dtsi
arch/arm/dts/meson-gx.dtsi
arch/arm/dts/meson-gxbb-nanopi-k2.dts
arch/arm/dts/meson-gxbb-odroidc2.dts
arch/arm/dts/meson-gxl-s805x-libretech-ac.dts
arch/arm/dts/meson-gxl-s905x-khadas-vim.dts
arch/arm/dts/meson-gxl-s905x-libretech-cc-v2.dts
arch/arm/dts/meson-gxl-s905x-libretech-cc.dts
arch/arm/dts/meson-gxm-khadas-vim2.dts
arch/arm/dts/meson-gxm-wetek-core2.dts
arch/arm/dts/meson-gxm.dtsi
arch/arm/dts/meson-khadas-vim3.dtsi
arch/arm/dts/meson-sm1-bananapi-m5.dts [new file with mode: 0644]
arch/arm/dts/meson-sm1-khadas-vim3l.dts
arch/arm/dts/meson-sm1-odroid-c4.dts
arch/arm/dts/meson-sm1-odroid-hc4.dts [new file with mode: 0644]
arch/arm/dts/meson-sm1-odroid.dtsi [new file with mode: 0644]
arch/arm/dts/meson-sm1-sei610.dts
arch/arm/dts/meson-sm1.dtsi
include/dt-bindings/clock/axg-clkc.h
include/dt-bindings/clock/g12a-clkc.h

index 9438bf735aad414a1e0fc1b2f88a2d5a4e4d9d47..7c251853eab6f311d54260224fbbfe804ff48d75 100644 (file)
@@ -177,11 +177,14 @@ dtb-$(CONFIG_ARCH_MESON) += \
        meson-g12a-sei510.dtb \
        meson-g12b-gtking.dtb \
        meson-g12b-gtking-pro.dtb \
+       meson-g12b-gsking-x.dtb \
        meson-g12b-odroid-n2.dtb \
        meson-g12b-odroid-n2-plus.dtb \
        meson-g12b-a311d-khadas-vim3.dtb \
+       meson-sm1-bananapi-m5.dtb \
        meson-sm1-khadas-vim3l.dtb \
        meson-sm1-odroid-c4.dtb \
+       meson-sm1-odroid-hc4.dtb \
        meson-sm1-sei610.dtb
 dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \
        tegra20-medcom-wide.dtb \
index cb1360ae1211e27b7783eac19ad00244f121e12f..359589d1dfa935686d0397b002069bf54ddc89b8 100644 (file)
        status = "okay";
 };
 
+&pcieA {
+       reset-gpios = <&gpio GPIOX_19 GPIO_ACTIVE_LOW>;
+       status = "okay";
+};
+
+&pcieB {
+       reset-gpios = <&gpio GPIOZ_10 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
+       status = "okay";
+};
+
 &pwm_ab {
        status = "okay";
        pinctrl-0 = <&pwm_a_x20_pins>;
        pinctrl-0 = <&uart_ao_a_pins>;
        pinctrl-names = "default";
 };
+
+&usb {
+       status = "okay";
+       dr_mode = "otg";
+       vbus-supply = <&usb_pwr>;
+};
index b9efc8469265d871d244c2cb2a89be88152d0bf2..3f5254eeb47b1e0c00fbe62c0630b2906abb04d8 100644 (file)
@@ -12,6 +12,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/reset/amlogic,meson-axg-audio-arb.h>
 #include <dt-bindings/reset/amlogic,meson-axg-reset.h>
+#include <dt-bindings/power/meson-axg-power.h>
 
 / {
        compatible = "amlogic,meson-axg";
                #size-cells = <2>;
                ranges;
 
+               pcieA: pcie@f9800000 {
+                       compatible = "amlogic,axg-pcie", "snps,dw-pcie";
+                       reg = <0x0 0xf9800000 0x0 0x400000>,
+                             <0x0 0xff646000 0x0 0x2000>,
+                             <0x0 0xf9f00000 0x0 0x100000>;
+                       reg-names = "elbi", "cfg", "config";
+                       interrupts = <GIC_SPI 177 IRQ_TYPE_EDGE_RISING>;
+                       #interrupt-cells = <1>;
+                       interrupt-map-mask = <0 0 0 0>;
+                       interrupt-map = <0 0 0 0 &gic GIC_SPI 179 IRQ_TYPE_EDGE_RISING>;
+                       bus-range = <0x0 0xff>;
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+                       device_type = "pci";
+                       ranges = <0x82000000 0 0xf9c00000 0x0 0xf9c00000 0 0x00300000>;
+
+                       clocks = <&clkc CLKID_USB>, <&clkc CLKID_PCIE_A>, <&clkc CLKID_PCIE_CML_EN0>;
+                       clock-names = "general", "pclk", "port";
+                       resets = <&reset RESET_PCIE_A>, <&reset RESET_PCIE_APB>;
+                       reset-names = "port", "apb";
+                       num-lanes = <1>;
+                       phys = <&pcie_phy>;
+                       phy-names = "pcie";
+                       status = "disabled";
+               };
+
+               pcieB: pcie@fa000000 {
+                       compatible = "amlogic,axg-pcie", "snps,dw-pcie";
+                       reg = <0x0 0xfa000000 0x0 0x400000>,
+                             <0x0 0xff648000 0x0 0x2000>,
+                             <0x0 0xfa400000 0x0 0x100000>;
+                       reg-names = "elbi", "cfg", "config";
+                       interrupts = <GIC_SPI 167 IRQ_TYPE_EDGE_RISING>;
+                       #interrupt-cells = <1>;
+                       interrupt-map-mask = <0 0 0 0>;
+                       interrupt-map = <0 0 0 0 &gic GIC_SPI 169 IRQ_TYPE_EDGE_RISING>;
+                       bus-range = <0x0 0xff>;
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+                       device_type = "pci";
+                       ranges = <0x82000000 0 0xfa500000 0x0 0xfa500000 0 0x00300000>;
+
+                       clocks = <&clkc CLKID_USB>, <&clkc CLKID_PCIE_B>, <&clkc CLKID_PCIE_CML_EN1>;
+                       clock-names = "general", "pclk", "port";
+                       resets = <&reset RESET_PCIE_B>, <&reset RESET_PCIE_APB>;
+                       reset-names = "port", "apb";
+                       num-lanes = <1>;
+                       phys = <&pcie_phy>;
+                       phy-names = "pcie";
+                       status = "disabled";
+               };
+
+               usb: usb@ffe09080 {
+                       compatible = "amlogic,meson-axg-usb-ctrl";
+                       reg = <0x0 0xffe09080 0x0 0x20>;
+                       interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges;
+
+                       clocks = <&clkc CLKID_USB>, <&clkc CLKID_USB1_DDR_BRIDGE>;
+                       clock-names = "usb_ctrl", "ddr";
+                       resets = <&reset RESET_USB_OTG>;
+
+                       dr_mode = "otg";
+
+                       phys = <&usb2_phy1>;
+                       phy-names = "usb2-phy1";
+
+                       dwc2: usb@ff400000 {
+                               compatible = "amlogic,meson-g12a-usb", "snps,dwc2";
+                               reg = <0x0 0xff400000 0x0 0x40000>;
+                               interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clkc CLKID_USB1>;
+                               clock-names = "otg";
+                               phys = <&usb2_phy1>;
+                               dr_mode = "peripheral";
+                               g-rx-fifo-size = <192>;
+                               g-np-tx-fifo-size = <128>;
+                               g-tx-fifo-size = <128 128 16 16 16>;
+                       };
+
+                       dwc3: usb@ff500000 {
+                               compatible = "snps,dwc3";
+                               reg = <0x0 0xff500000 0x0 0x100000>;
+                               interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
+                               dr_mode = "host";
+                               maximum-speed = "high-speed";
+                               snps,dis_u2_susphy_quirk;
+                       };
+               };
+
                ethmac: ethernet@ff3f0000 {
                        compatible = "amlogic,meson-axg-dwmac",
                                     "snps,dwmac-3.70a",
                                      "timing-adjustment";
                        rx-fifo-depth = <4096>;
                        tx-fifo-depth = <2048>;
+                       power-domains = <&pwrc PWRC_AXG_ETHERNET_MEM_ID>;
                        status = "disabled";
                };
 
+               pcie_phy: phy@ff644000 {
+                       compatible = "amlogic,axg-pcie-phy";
+                       reg = <0x0 0xff644000 0x0 0x1c>;
+                       resets = <&reset RESET_PCIE_PHY>;
+                       phys = <&mipi_pcie_analog_dphy>;
+                       phy-names = "analog";
+                       #phy-cells = <0>;
+               };
+
                pdm: audio-controller@ff632000 {
                        compatible = "amlogic,axg-pdm";
                        reg = <0x0 0xff632000 0x0 0x34>;
                                        clocks = <&xtal>;
                                        clock-names = "xtal";
                                };
+
+                               pwrc: power-controller {
+                                       compatible = "amlogic,meson-axg-pwrc";
+                                       #power-domain-cells = <1>;
+                                       amlogic,ao-sysctrl = <&sysctrl_AO>;
+                                       resets = <&reset RESET_VIU>,
+                                                <&reset RESET_VENC>,
+                                                <&reset RESET_VCBUS>,
+                                                <&reset RESET_VENCL>,
+                                                <&reset RESET_VID_LOCK>;
+                                       reset-names = "viu", "venc", "vcbus",
+                                                     "vencl", "vid_lock";
+                                       clocks = <&clkc CLKID_VPU>,
+                                                <&clkc CLKID_VAPB>;
+                                       clock-names = "vpu", "vapb";
+                                       /*
+                                        * VPU clocking is provided by two identical clock paths
+                                        * VPU_0 and VPU_1 muxed to a single clock by a glitch
+                                        * free mux to safely change frequency while running.
+                                        * Same for VAPB but with a final gate after the glitch free mux.
+                                        */
+                                       assigned-clocks = <&clkc CLKID_VPU_0_SEL>,
+                                                         <&clkc CLKID_VPU_0>,
+                                                         <&clkc CLKID_VPU>, /* Glitch free mux */
+                                                         <&clkc CLKID_VAPB_0_SEL>,
+                                                         <&clkc CLKID_VAPB_0>,
+                                                         <&clkc CLKID_VAPB_SEL>; /* Glitch free mux */
+                                       assigned-clock-parents = <&clkc CLKID_FCLK_DIV4>,
+                                                                <0>, /* Do Nothing */
+                                                                <&clkc CLKID_VPU_0>,
+                                                                <&clkc CLKID_FCLK_DIV4>,
+                                                                <0>, /* Do Nothing */
+                                                                <&clkc CLKID_VAPB_0>;
+                                       assigned-clock-rates = <0>, /* Do Nothing */
+                                                              <250000000>,
+                                                              <0>, /* Do Nothing */
+                                                              <0>, /* Do Nothing */
+                                                              <250000000>,
+                                                              <0>; /* Do Nothing */
+                               };
+
+                               mipi_pcie_analog_dphy: phy {
+                                       compatible = "amlogic,axg-mipi-pcie-analog-phy";
+                                       #phy-cells = <0>;
+                                       status = "disabled";
+                               };
                        };
                };
 
                        #mbox-cells = <1>;
                };
 
+               mipi_dphy: phy@ff640000 {
+                       compatible = "amlogic,axg-mipi-dphy";
+                       reg = <0x0 0xff640000 0x0 0x100>;
+                       clocks = <&clkc CLKID_MIPI_DSI_PHY>;
+                       clock-names = "pclk";
+                       resets = <&reset RESET_MIPI_PHY>;
+                       reset-names = "phy";
+                       phys = <&mipi_pcie_analog_dphy>;
+                       phy-names = "analog";
+                       #phy-cells = <0>;
+                       status = "disabled";
+               };
+
                audio: bus@ff642000 {
                        compatible = "simple-bus";
                        reg = <0x0 0xff642000 0x0 0x2000>;
                        };
                };
 
+               ge2d: ge2d@ff940000 {
+                       compatible = "amlogic,axg-ge2d";
+                       reg = <0x0 0xff940000 0x0 0x10000>;
+                       interrupts = <GIC_SPI 150 IRQ_TYPE_EDGE_RISING>;
+                       clocks = <&clkc CLKID_VAPB>;
+                       resets = <&reset RESET_GE2D>;
+               };
+
                gic: interrupt-controller@ffc01000 {
                        compatible = "arm,gic-400";
                        reg = <0x0 0xffc01000 0 0x1000>,
                                status = "disabled";
                                clocks = <&xtal>, <&clkc CLKID_UART0>, <&xtal>;
                                clock-names = "xtal", "pclk", "baud";
+                               fifo-size = <128>;
                        };
                };
 
                                clock-names = "core", "clkin0", "clkin1";
                                resets = <&reset RESET_SD_EMMC_C>;
                        };
+
+                       usb2_phy1: phy@9020 {
+                               compatible = "amlogic,meson-gxl-usb2-phy";
+                               #phy-cells = <0>;
+                               reg = <0x0 0x9020 0x0 0x20>;
+                               clocks = <&clkc CLKID_USB>;
+                               clock-names = "phy";
+                               resets = <&reset RESET_USB_OTG>;
+                               reset-names = "phy";
+                       };
                };
 
                sram: sram@fffc0000 {
index 1e83ec5b8c91a13018b3fc7a1651eca7f75290f7..00c6f53290d438b016af013082d1fd6707ecedaa 100644 (file)
        #address-cells = <2>;
        #size-cells = <2>;
 
+       aliases {
+               mmc0 = &sd_emmc_b; /* SD card */
+               mmc1 = &sd_emmc_c; /* eMMC */
+               mmc2 = &sd_emmc_a; /* SDIO */
+       };
+
        chosen {
                #address-cells = <2>;
                #size-cells = <2>;
 
                pcie: pcie@fc000000 {
                        compatible = "amlogic,g12a-pcie", "snps,dw-pcie";
-                       reg = <0x0 0xfc000000 0x0 0x400000
-                              0x0 0xff648000 0x0 0x2000
-                              0x0 0xfc400000 0x0 0x200000>;
+                       reg = <0x0 0xfc000000 0x0 0x400000>,
+                             <0x0 0xff648000 0x0 0x2000>,
+                             <0x0 0xfc400000 0x0 0x200000>;
                        reg-names = "elbi", "cfg", "config";
                        interrupts = <GIC_SPI 221 IRQ_TYPE_LEVEL_HIGH>;
                        #interrupt-cells = <1>;
                        #address-cells = <3>;
                        #size-cells = <2>;
                        device_type = "pci";
-                       ranges = <0x81000000 0 0 0x0 0xfc600000 0 0x00100000
-                                 0x82000000 0 0xfc700000 0x0 0xfc700000 0 0x1900000>;
+                       ranges = <0x81000000 0 0 0x0 0xfc600000 0 0x00100000>,
+                                <0x82000000 0 0xfc700000 0x0 0xfc700000 0 0x1900000>;
 
                        clocks = <&clkc CLKID_PCIE_PHY
                                  &clkc CLKID_PCIE_COMB
                };
 
                ethmac: ethernet@ff3f0000 {
-                       compatible = "amlogic,meson-axg-dwmac",
+                       compatible = "amlogic,meson-g12a-dwmac",
                                     "snps,dwmac-3.70a",
                                     "snps,dwmac";
                        reg = <0x0 0xff3f0000 0x0 0x10000>,
                                hwrng: rng@218 {
                                        compatible = "amlogic,meson-rng";
                                        reg = <0x0 0x218 0x0 0x4>;
+                                       clocks = <&clkc CLKID_RNG0>;
+                                       clock-names = "core";
                                };
                        };
 
                                };
                        };
 
-                       vrtc: rtc@0a8 {
+                       vrtc: rtc@a8 {
                                compatible = "amlogic,meson-vrtc";
                                reg = <0x0 0x000a8 0x0 0x4>;
                        };
                                amlogic,channel-interrupts = <64 65 66 67 68 69 70 71>;
                        };
 
+                       watchdog: watchdog@f0d0 {
+                               compatible = "amlogic,meson-gxbb-wdt";
+                               reg = <0x0 0xf0d0 0x0 0x10>;
+                               clocks = <&xtal>;
+                       };
+
                        spicc0: spi@13000 {
                                compatible = "amlogic,meson-g12a-spicc";
                                reg = <0x0 0x13000 0x0 0x44>;
                                clocks = <&xtal>, <&clkc CLKID_UART0>, <&xtal>;
                                clock-names = "xtal", "pclk", "baud";
                                status = "disabled";
+                               fifo-size = <128>;
                        };
                };
 
                                interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
                                dr_mode = "host";
                                snps,dis_u2_susphy_quirk;
-                               snps,quirk-frame-length-adjustment;
+                               snps,quirk-frame-length-adjustment = <0x20>;
                                snps,parkmode-disable-ss-quirk;
                        };
                };
index b00d0468c7534ab49ad346d303b43e182176a3c4..81269ccc24968d51ac73f4b7e7ac967b40fae810 100644 (file)
 
        sound {
                compatible = "amlogic,axg-sound-card";
-               model = "G12A-SEI510";
+               model = "SEI510";
                audio-aux-devs = <&tdmout_a>, <&tdmout_b>,
                                 <&tdmin_a>, <&tdmin_b>;
                audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 0",
diff --git a/arch/arm/dts/meson-g12b-gsking-x.dts b/arch/arm/dts/meson-g12b-gsking-x.dts
new file mode 100644 (file)
index 0000000..6c7bfac
--- /dev/null
@@ -0,0 +1,133 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre, SAS
+ * Author: Neil Armstrong <narmstrong@baylibre.com>
+ * Copyright (c) 2019 Christian Hewitt <christianshewitt@gmail.com>
+ */
+
+/dts-v1/;
+
+#include "meson-g12b-w400.dtsi"
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
+
+/ {
+       compatible = "azw,gsking-x", "amlogic,s922x", "amlogic,g12b";
+       model = "Beelink GS-King X";
+
+       aliases {
+               rtc0 = &rtc;
+               rtc1 = &vrtc;
+       };
+
+       gpio-keys-polled {
+               compatible = "gpio-keys-polled";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               poll-interval = <100>;
+
+               power-button {
+                       label = "power";
+                       linux,code = <KEY_POWER>;
+                       gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       sound {
+               compatible = "amlogic,axg-sound-card";
+               model = "GSKING-X";
+               audio-aux-devs = <&tdmout_a>;
+               audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 1",
+                               "TDMOUT_A IN 1", "FRDDR_B OUT 1",
+                               "TDMOUT_A IN 2", "FRDDR_C OUT 1",
+                               "TDM_A Playback", "TDMOUT_A OUT";
+
+               assigned-clocks = <&clkc CLKID_MPLL2>,
+                                 <&clkc CLKID_MPLL0>,
+                                 <&clkc CLKID_MPLL1>;
+               assigned-clock-parents = <0>, <0>, <0>;
+               assigned-clock-rates = <294912000>,
+                                      <270950400>,
+                                      <393216000>;
+               status = "okay";
+
+               dai-link-0 {
+                       sound-dai = <&frddr_a>;
+               };
+
+               dai-link-1 {
+                       sound-dai = <&frddr_b>;
+               };
+
+               dai-link-2 {
+                       sound-dai = <&frddr_c>;
+               };
+
+               /* 8ch hdmi interface */
+               dai-link-3 {
+                       sound-dai = <&tdmif_a>;
+                       dai-format = "i2s";
+                       dai-tdm-slot-tx-mask-0 = <1 1>;
+                       dai-tdm-slot-tx-mask-1 = <1 1>;
+                       dai-tdm-slot-tx-mask-2 = <1 1>;
+                       dai-tdm-slot-tx-mask-3 = <1 1>;
+                       mclk-fs = <256>;
+
+                       codec {
+                               sound-dai = <&tohdmitx TOHDMITX_I2S_IN_A>;
+                       };
+               };
+
+               dai-link-4 {
+                       sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
+
+                       codec {
+                               sound-dai = <&hdmi_tx>;
+                       };
+               };
+       };
+};
+
+&arb {
+       status = "okay";
+};
+
+&clkc_audio {
+       status = "okay";
+};
+
+&frddr_a {
+       status = "okay";
+};
+
+&frddr_b {
+       status = "okay";
+};
+
+&frddr_c {
+       status = "okay";
+};
+
+&i2c3 {
+       status = "okay";
+       pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
+       pinctrl-names = "default";
+
+       rtc: rtc@51 {
+               compatible = "nxp,pcf8563";
+               reg = <0x51>;
+               wakeup-source;
+       };
+};
+
+&tdmif_a {
+       status = "okay";
+};
+
+&tdmout_a {
+       status = "okay";
+};
+
+&tohdmitx {
+       status = "okay";
+};
index f0c56a16af3d61d290c10189419c7c1074629733..707daf92787bae1c19637bb90dcdb5d92d361ad7 100644 (file)
 #include <dt-bindings/sound/meson-g12a-tohdmitx.h>
 
 / {
-       compatible = "azw,gtking", "amlogic,g12b";
+       compatible = "azw,gtking", "amlogic,s922x", "amlogic,g12b";
        model = "Beelink GT-King Pro";
 
+       aliases {
+               rtc0 = &rtc;
+               rtc1 = &vrtc;
+       };
+
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
                #address-cells = <1>;
@@ -30,7 +35,7 @@
        leds {
                compatible = "gpio-leds";
 
-               white {
+               led-white {
                        label = "power:white";
                        gpios = <&gpio_ao GPIOAO_11 GPIO_ACTIVE_HIGH>;
                        default-state = "on";
@@ -39,7 +44,7 @@
 
        sound {
                compatible = "amlogic,axg-sound-card";
-               model = "G12B-GTKING-PRO";
+               model = "GTKING-PRO";
                audio-aux-devs = <&tdmout_b>;
                audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
                                "TDMOUT_B IN 1", "FRDDR_B OUT 1",
        status = "okay";
 };
 
+&i2c3 {
+       status = "okay";
+       pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
+       pinctrl-names = "default";
+
+       rtc: rtc@51 {
+               compatible = "nxp,pcf8563";
+               reg = <0x51>;
+               wakeup-source;
+       };
+};
+
 &tdmif_b {
        status = "okay";
 };
index eeb7bc5539ef1bf237b7c7c86ab86eea2338e5c0..5d96c14490504cc79c41a421adbd79338d17e813 100644 (file)
 #include <dt-bindings/sound/meson-g12a-tohdmitx.h>
 
 / {
-       compatible = "azw,gtking", "amlogic,g12b";
+       compatible = "azw,gtking", "amlogic,s922x", "amlogic,g12b";
        model = "Beelink GT-King";
 
+       aliases {
+               rtc0 = &rtc;
+               rtc1 = &vrtc;
+       };
+
        spdif_dit: audio-codec-1 {
                #sound-dai-cells = <0>;
                compatible = "linux,spdif-dit";
@@ -23,7 +28,7 @@
 
        sound {
                compatible = "amlogic,axg-sound-card";
-               model = "G12B-GTKING";
+               model = "GTKING";
                audio-aux-devs = <&tdmout_b>;
                audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
                                "TDMOUT_B IN 1", "FRDDR_B OUT 1",
        status = "okay";
 };
 
+
+&i2c3 {
+       status = "okay";
+       pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
+       pinctrl-names = "default";
+
+       rtc: rtc@51 {
+               compatible = "nxp,pcf8563";
+               reg = <0x51>;
+               wakeup-source;
+       };
+};
+
 &spdifout {
        pinctrl-0 = <&spdif_out_h_pins>;
        pinctrl-names = "default";
index 5de2815ba99de9627aa7c7954df376c1c74fd9d3..ce1198ad34e425ea9077dea51a263dfd9238b63f 100644 (file)
@@ -19,7 +19,7 @@
        regulator-min-microvolt = <680000>;
        regulator-max-microvolt = <1040000>;
 
-       pwms = <&pwm_AO_cd 1 1500 0>;
+       pwms = <&pwm_ab 0 1500 0>;
 };
 
 &vddcpu_b {
index 6982632ae6461a0030a077f461a13457b96f9a4f..344573e157a7bf016544ccb94413ef436d563b25 100644 (file)
@@ -13,6 +13,8 @@
        aliases {
                serial0 = &uart_AO;
                ethernet0 = &ethmac;
+               rtc0 = &rtc;
+               rtc1 = &vrtc;
        };
 
        dioo2133: audio-amplifier-0 {
@@ -40,7 +42,7 @@
        leds {
                compatible = "gpio-leds";
 
-               blue {
+               led-blue {
                        label = "n2:blue";
                        gpios = <&gpio_ao GPIOAO_11 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "heartbeat";
 
        sound {
                compatible = "amlogic,axg-sound-card";
-               model = "G12B-ODROID-N2";
+               model = "ODROID-N2";
                audio-widgets = "Line", "Lineout";
                audio-aux-devs = <&tdmout_b>, <&tdmout_c>, <&tdmin_a>,
                                 <&tdmin_b>, <&tdmin_c>, <&tdmin_lb>,
 
 &ext_mdio {
        external_phy: ethernet-phy@0 {
-               /* Realtek RTL8211F (0x001cc916) */     
+               /* Realtek RTL8211F (0x001cc916) */
                reg = <0>;
                max-speed = <1000>;
 
                reset-assert-us = <10000>;
-               reset-deassert-us = <30000>;
+               reset-deassert-us = <80000>;
                reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
 
                interrupt-parent = <&gpio_intc>;
 };
 
 &gpio {
+       gpio-line-names =
+               /* GPIOZ */
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "",
+               /* GPIOH */
+               "", "", "", "", "", "", "", "",
+               "",
+               /* BOOT */
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "",
+               /* GPIOC */
+               "", "", "", "", "", "", "", "",
+               /* GPIOA */
+               "PIN_44", /* GPIOA_0 */
+               "PIN_46", /* GPIOA_1 */
+               "PIN_45", /* GPIOA_2 */
+               "PIN_47", /* GPIOA_3 */
+               "PIN_26", /* GPIOA_4 */
+               "", "", "", "", "", "",
+               "PIN_42", /* GPIOA_11 */
+               "PIN_32", /* GPIOA_12 */
+               "PIN_7",  /* GPIOA_13 */
+               "PIN_27", /* GPIOA_14 */
+               "PIN_28", /* GPIOA_15 */
+               /* GPIOX */
+               "PIN_16", /* GPIOX_0 */
+               "PIN_18", /* GPIOX_1 */
+               "PIN_22", /* GPIOX_2 */
+               "PIN_11", /* GPIOX_3 */
+               "PIN_13", /* GPIOX_4 */
+               "PIN_33", /* GPIOX_5 */
+               "PIN_35", /* GPIOX_6 */
+               "PIN_15", /* GPIOX_7 */
+               "PIN_19", /* GPIOX_8 */
+               "PIN_21", /* GPIOX_9 */
+               "PIN_24", /* GPIOX_10 */
+               "PIN_23", /* GPIOX_11 */
+               "PIN_8",  /* GPIOX_12 */
+               "PIN_10", /* GPIOX_13 */
+               "PIN_29", /* GPIOX_14 */
+               "PIN_31", /* GPIOX_15 */
+               "PIN_12", /* GPIOX_16 */
+               "PIN_3",  /* GPIOX_17 */
+               "PIN_5",  /* GPIOX_18 */
+               "PIN_36"; /* GPIOX_19 */
        /*
         * WARNING: The USB Hub on the Odroid-N2 needs a reset signal
         * to be turned high in order to be detected by the USB Controller
         * This signal should be handled by a USB specific power sequence
         * in order to reset the Hub when USB bus is powered down.
         */
-       usb-hub {
+       hog-0 {
                gpio-hog;
                gpios = <GPIOH_4 GPIO_ACTIVE_HIGH>;
                output-high;
        linux,rc-map-name = "rc-odroid";
 };
 
+&i2c3 {
+       status = "okay";
+       pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
+       pinctrl-names = "default";
+
+       rtc: rtc@51 {
+               compatible = "nxp,pcf8563";
+               reg = <0x51>;
+               wakeup-source;
+       };
+};
+
 &pwm_ab {
        pinctrl-0 = <&pwm_a_e_pins>;
        pinctrl-names = "default";
        status = "okay";
 };
 
+&saradc {
+       status = "okay";
+       vref-supply = <&vddao_1v8>;
+};
+
 /* SD card */
 &sd_emmc_b {
        status = "okay";
index 2802ddbb83ac78776101bc6dffe257cfb96330cb..feb088504740002490658a94bdea8744e45091c5 100644 (file)
                max-speed = <1000>;
 
                reset-assert-us = <10000>;
-               reset-deassert-us = <30000>;
+               reset-deassert-us = <80000>;
                reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
 
                interrupt-parent = <&gpio_intc>;
index 9b8548e5f6e51194bff5929281f15491df42b69a..ee8fcae9f9f00aa833f3e67288859bbe6b6ddcfb 100644 (file)
                };
        };
 };
+
+&mali {
+       dma-coherent;
+};
index c2480bab8d3374f13a90368d9671044d0da1d229..2d7032f41e4b585c3d7aa25af77fc21648fc3730 100644 (file)
 
        sound {
                compatible = "amlogic,gx-sound-card";
-               model = "GXL-LIBRETECH-S9XX-PC";
+               model = "LIBRETECH-PC";
                audio-aux-devs = <&dio2133>;
                audio-widgets = "Speaker", "7J4-14 LEFT",
                                "Speaker", "7J4-11 RIGHT";
index 6b57e15aade35999cc1f427dfa0f8d8baa89886e..dafc841f7c163d513eed2b5afab8122fbce79718 100644 (file)
 
        sound {
                compatible = "amlogic,gx-sound-card";
-               model = "GX-P230-Q200";
+               model = "P230-Q200";
                audio-aux-devs = <&dio2133>;
                audio-widgets = "Line", "Lineout";
                audio-routing = "AU2 INL", "ACODEC LOLP",
index 0edd137151f89eb6ba63695d28abdfaf18cf6434..6b457b2c30a4bc23ff9143a96845c7a2b4d6c330 100644 (file)
        #address-cells = <2>;
        #size-cells = <2>;
 
+       aliases {
+               mmc0 = &sd_emmc_b; /* SD card */
+               mmc1 = &sd_emmc_c; /* eMMC */
+               mmc2 = &sd_emmc_a; /* SDIO */
+       };
+
        reserved-memory {
                #address-cells = <2>;
                #size-cells = <2>;
                                reg = <0x0 0x84c0 0x0 0x18>;
                                interrupts = <GIC_SPI 26 IRQ_TYPE_EDGE_RISING>;
                                status = "disabled";
+                               fifo-size = <128>;
                        };
 
                        uart_B: serial@84dc {
index 7be3e354093bfad3f8ac298889379ce32d072810..7273eed5292c84db786cff066c85c106db39cd3c 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "meson-gxbb.dtsi"
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/sound/meson-aiu.h>
 
 / {
        compatible = "friendlyarm,nanopi-k2", "amlogic,meson-gxbb";
                        };
                };
        };
+
+       sound {
+               compatible = "amlogic,gx-sound-card";
+               model = "NANOPI-K2";
+               assigned-clocks = <&clkc CLKID_MPLL0>,
+                                 <&clkc CLKID_MPLL1>,
+                                 <&clkc CLKID_MPLL2>;
+               assigned-clock-parents = <0>, <0>, <0>;
+               assigned-clock-rates = <294912000>,
+                                      <270950400>,
+                                      <393216000>;
+               status = "okay";
+
+               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>;
+                       };
+               };
+
+               dai-link-2 {
+                       sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
+
+                       codec-0 {
+                               sound-dai = <&hdmi_tx>;
+                       };
+               };
+       };
+};
+
+&aiu {
+       status = "okay";
 };
 
 &cec_AO {
                        reg = <0>;
 
                        reset-assert-us = <10000>;
-                       reset-deassert-us = <30000>;
+                       reset-deassert-us = <80000>;
                        reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
 
                        interrupt-parent = <&gpio_intc>;
index 70fcfb7b0683d43a9397301eb4403a155066b826..201596247fd93945eea04aa1346187613e584eb9 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "meson-gxbb.dtsi"
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/sound/meson-aiu.h>
 
 / {
        compatible = "hardkernel,odroid-c2", "amlogic,meson-gxbb";
                        };
                };
        };
+
+       sound {
+               compatible = "amlogic,gx-sound-card";
+               model = "ODROID-C2";
+               assigned-clocks = <&clkc CLKID_MPLL0>,
+                                 <&clkc CLKID_MPLL1>,
+                                 <&clkc CLKID_MPLL2>;
+               assigned-clock-parents = <0>, <0>, <0>;
+               assigned-clock-rates = <294912000>,
+                                      <270950400>,
+                                      <393216000>;
+               status = "okay";
+
+               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>;
+                       };
+               };
+
+               dai-link-2 {
+                       sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
+
+                       codec-0 {
+                               sound-dai = <&hdmi_tx>;
+                       };
+               };
+       };
+};
+
+&aiu {
+       status = "okay";
 };
 
 &cec_AO {
                        reg = <0>;
 
                        reset-assert-us = <10000>;
-                       reset-deassert-us = <30000>;
+                       reset-deassert-us = <80000>;
                        reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
 
                        interrupt-parent = <&gpio_intc>;
         * This signal should be handled by a USB specific power sequence
         * in order to reset the Hub when USB bus is powered down.
         */
-       usb-hub {
+       hog-0 {
                gpio-hog;
                gpios = <GPIOAO_4 GPIO_ACTIVE_HIGH>;
                output-high;
index 9e43f4dca90dd92637527b70c7bc9c9daa87b05b..2d769203f67180629a7aaff9ab90f2c535da9261 100644 (file)
 
        sound {
                compatible = "amlogic,gx-sound-card";
-               model = "GXL-LIBRETECH-S805X-AC";
+               model = "LIBRETECH-AC";
                audio-widgets = "Speaker", "9J5-3 LEFT",
                                "Speaker", "9J5-2 RIGHT";
                audio-routing = "9J5-3 LEFT", "ACODEC LOLN",
index 8bcdffdf55d084d1e7bb7c86b60995e167f79e59..60feac0179c0308341c38a29d6b374480d4bd184 100644 (file)
@@ -5,9 +5,9 @@
 
 /dts-v1/;
 
-#include <dt-bindings/input/input.h>
-
 #include "meson-gxl-s905x-p212.dtsi"
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/sound/meson-aiu.h>
 
 / {
        compatible = "khadas,vim", "amlogic,s905x", "amlogic,meson-gxl";
                };
        };
 
-       pwmleds {
+       led-controller {
                compatible = "pwm-leds";
 
-               power {
+               led-1 {
                        label = "vim:red:power";
                        pwms = <&pwm_AO_ab 1 7812500 0>;
                        max-brightness = <255>;
                        };
                };
        };
+
+       sound {
+               compatible = "amlogic,gx-sound-card";
+               model = "KHADAS-VIM";
+               assigned-clocks = <&clkc CLKID_MPLL0>,
+                                 <&clkc CLKID_MPLL1>,
+                                 <&clkc CLKID_MPLL2>;
+               assigned-clock-parents = <0>, <0>, <0>;
+               assigned-clock-rates = <294912000>,
+                                      <270950400>,
+                                      <393216000>;
+               status = "okay";
+
+               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>;
+                       };
+               };
+
+               dai-link-2 {
+                       sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
+
+                       codec-0 {
+                               sound-dai = <&hdmi_tx>;
+                       };
+               };
+       };
+};
+
+&aiu {
+       status = "okay";
 };
 
 &cec_AO {
        pinctrl-names = "default";
 
        rtc: rtc@51 {
-               /* has to be enabled manually when a battery is connected: */
-               status = "disabled";
+               status = "okay";
                compatible = "haoyu,hym8563";
                reg = <0x51>;
                #clock-cells = <0>;
index 675eaa87963efbbe2b898a8cc6fb10d4569ca2da..93d8f8aff70d99fa8e269d4252e39919d96d0feb 100644 (file)
@@ -84,7 +84,6 @@
                regulator-always-on;
        };
 
-
        vcck: regulator-vcck {
                compatible = "regulator-fixed";
                regulator-name = "VCCK";
                regulator-always-on;
        };
 
-
        vddio_card: regulator-vddio-card {
                compatible = "regulator-gpio";
                regulator-name = "VDDIO_CARD";
 
        sound {
                compatible = "amlogic,gx-sound-card";
-               model = "GXL-LIBRETECH-S905X-CC-V2";
+               model = "LIBRETECH-CC-V2";
                assigned-clocks = <&clkc CLKID_MPLL0>,
                                  <&clkc CLKID_MPLL1>,
                                  <&clkc CLKID_MPLL2>;
        };
 };
 
-
 &aiu {
        status = "okay";
 };
        hdmi-phandle = <&hdmi_tx>;
 };
 
-
 &ethmac {
        status = "okay";
 };
index 5ae7bb6209cbef94ae32d80b3050df96b1b32591..82bfabfbd39ca87f6d7bbd509e7cee31371551f2 100644 (file)
 
        sound {
                compatible = "amlogic,gx-sound-card";
-               model = "GXL-LIBRETECH-S905X-CC";
+               model = "LIBRETECH-CC";
                audio-aux-devs = <&dio2133>;
                audio-widgets = "Line", "Lineout";
                audio-routing = "AU2 INL", "ACODEC LOLN",
index bff8ec2c1c70ce1d13367533c8390ed3c13c99c3..18a4b7a6c5df5b835ea7b62c322c3fe76a58a065 100644 (file)
@@ -7,9 +7,9 @@
 
 /dts-v1/;
 
-#include <dt-bindings/input/input.h>
-
 #include "meson-gxm.dtsi"
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/sound/meson-aiu.h>
 
 / {
        compatible = "khadas,vim2", "amlogic,s912", "amlogic,meson-gxm";
                };
        };
 
-       pwmleds {
+       led-controller {
                compatible = "pwm-leds";
 
-               power {
+               led-1 {
                        label = "vim:red:power";
                        pwms = <&pwm_AO_ab 1 7812500 0>;
                        max-brightness = <255>;
                clock-frequency = <32768>;
                pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
        };
+
+       sound {
+               compatible = "amlogic,gx-sound-card";
+               model = "KHADAS-VIM2";
+               assigned-clocks = <&clkc CLKID_MPLL0>,
+                                 <&clkc CLKID_MPLL1>,
+                                 <&clkc CLKID_MPLL2>;
+               assigned-clock-parents = <0>, <0>, <0>;
+               assigned-clock-rates = <294912000>,
+                                      <270950400>,
+                                      <393216000>;
+               status = "okay";
+
+               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>;
+                       };
+               };
+
+               dai-link-2 {
+                       sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
+
+                       codec-0 {
+                               sound-dai = <&hdmi_tx>;
+                       };
+               };
+       };
+};
+
+&aiu {
+       status = "okay";
 };
 
 &cec_AO {
        hdmi-phandle = <&hdmi_tx>;
 };
 
-
 &cpu_cooling_maps {
        map0 {
                cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
                reg = <0>;
 
                reset-assert-us = <10000>;
-               reset-deassert-us = <30000>;
+               reset-deassert-us = <80000>;
                reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
 
                interrupt-parent = <&gpio_intc>;
        pinctrl-names = "default";
 
        rtc: rtc@51 {
-               /* has to be enabled manually when a battery is connected: */
-               status = "disabled";
+               status = "okay";
                compatible = "haoyu,hym8563";
                reg = <0x51>;
                #clock-cells = <0>;
                #size-cells = <1>;
                compatible = "winbond,w25q16", "jedec,spi-nor";
                reg = <0>;
-               spi-max-frequency = <3000000>;
+               spi-max-frequency = <104000000>;
        };
 };
 
index ec794c134c158d9df29d51821d0563ed52335940..1e7f77f9b533d53073129ae804ecd7d0c71d500c 100644 (file)
@@ -22,7 +22,7 @@
        leds {
                compatible = "gpio-leds";
 
-               blue {
+               led-blue {
                        color = <LED_COLOR_ID_BLUE>;
                        function = LED_FUNCTION_STATUS;
                        gpios = <&gpio GPIODV_24 GPIO_ACTIVE_HIGH>;
index fe4145112295cb720377264fe1bb836da08e034c..411cc312fc62bdf929b6992f2c3687c7dffda397 100644 (file)
                        };
                };
 
+               cpu0: cpu@0 {
+                       capacity-dmips-mhz = <1024>;
+               };
+
+               cpu1: cpu@1 {
+                       capacity-dmips-mhz = <1024>;
+               };
+
+               cpu2: cpu@2 {
+                       capacity-dmips-mhz = <1024>;
+               };
+
+               cpu3: cpu@3 {
+                       capacity-dmips-mhz = <1024>;
+               };
+
                cpu4: cpu@100 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a53";
                        reg = <0x0 0x100>;
                        enable-method = "psci";
+                       capacity-dmips-mhz = <1024>;
                        next-level-cache = <&l2>;
                        clocks = <&scpi_dvfs 1>;
                        #cooling-cells = <2>;
@@ -57,6 +74,7 @@
                        compatible = "arm,cortex-a53";
                        reg = <0x0 0x101>;
                        enable-method = "psci";
+                       capacity-dmips-mhz = <1024>;
                        next-level-cache = <&l2>;
                        clocks = <&scpi_dvfs 1>;
                        #cooling-cells = <2>;
@@ -67,6 +85,7 @@
                        compatible = "arm,cortex-a53";
                        reg = <0x0 0x102>;
                        enable-method = "psci";
+                       capacity-dmips-mhz = <1024>;
                        next-level-cache = <&l2>;
                        clocks = <&scpi_dvfs 1>;
                        #cooling-cells = <2>;
@@ -77,6 +96,7 @@
                        compatible = "arm,cortex-a53";
                        reg = <0x0 0x103>;
                        enable-method = "psci";
+                       capacity-dmips-mhz = <1024>;
                        next-level-cache = <&l2>;
                        clocks = <&scpi_dvfs 1>;
                        #cooling-cells = <2>;
index 7b46555ac55a1afc35aee0b5e6971312b320ba06..3cf4ecb6d52e3c1af37feff8377e64131df90102 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/gpio/meson-g12a-gpio.h>
 #include <dt-bindings/sound/meson-g12a-tohdmitx.h>
 
@@ -13,6 +14,8 @@
        aliases {
                serial0 = &uart_AO;
                ethernet0 = &ethmac;
+               rtc0 = &rtc;
+               rtc1 = &vrtc;
        };
 
        chosen {
                compatible = "gpio-leds";
 
                led-white {
-                       label = "vim3:white:sys";
+                       color = <LED_COLOR_ID_WHITE>;
+                       function = LED_FUNCTION_STATUS;
                        gpios = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "heartbeat";
                };
 
                led-red {
-                       label = "vim3:red";
+                       color = <LED_COLOR_ID_RED>;
+                       function = LED_FUNCTION_STATUS;
                        gpios = <&gpio_expander 5 GPIO_ACTIVE_HIGH>;
                };
        };
 
        sound {
                compatible = "amlogic,axg-sound-card";
-               model = "G12B-KHADAS-VIM3";
-               audio-aux-devs = <&tdmout_a>;
+               model = "KHADAS-VIM3";
+               audio-aux-devs = <&tdmin_a>, <&tdmout_a>;
                audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 0",
                                "TDMOUT_A IN 1", "FRDDR_B OUT 0",
                                "TDMOUT_A IN 2", "FRDDR_C OUT 0",
-                               "TDM_A Playback", "TDMOUT_A OUT";
+                               "TDM_A Playback", "TDMOUT_A OUT",
+                               "TDMIN_A IN 0", "TDM_A Capture",
+                               "TDMIN_A IN 3", "TDM_A Loopback",
+                               "TODDR_A IN 0", "TDMIN_A OUT",
+                               "TODDR_B IN 0", "TDMIN_A OUT",
+                               "TODDR_C IN 0", "TDMIN_A OUT";
 
                assigned-clocks = <&clkc CLKID_MPLL2>,
                                  <&clkc CLKID_MPLL0>,
                        sound-dai = <&frddr_c>;
                };
 
-               /* 8ch hdmi interface */
                dai-link-3 {
+                       sound-dai = <&toddr_a>;
+               };
+
+               dai-link-4 {
+                       sound-dai = <&toddr_b>;
+               };
+
+               dai-link-5 {
+                       sound-dai = <&toddr_c>;
+               };
+
+               /* 8ch hdmi interface */
+               dai-link-6 {
                        sound-dai = <&tdmif_a>;
                        dai-format = "i2s";
                        dai-tdm-slot-tx-mask-0 = <1 1>;
                };
 
                /* hdmi glue */
-               dai-link-4 {
+               dai-link-7 {
                        sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
 
                        codec {
 };
 
 &ethmac {
-        pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
-        pinctrl-names = "default";
-        status = "okay";
-        phy-mode = "rgmii";
-        phy-handle = <&external_phy>;
-        amlogic,tx-delay-ns = <2>;
+       pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
+       pinctrl-names = "default";
+       status = "okay";
+       phy-mode = "rgmii";
+       phy-handle = <&external_phy>;
+       amlogic,tx-delay-ns = <2>;
 };
 
 &frddr_a {
                #gpio-cells = <2>;
        };
 
-       rtc@51 {
+       rtc: rtc@51 {
                compatible = "haoyu,hym8563";
                reg = <0x51>;
                #clock-cells = <0>;
 };
 
 &pwm_ef {
-        status = "okay";
-        pinctrl-0 = <&pwm_e_pins>;
-        pinctrl-names = "default";
+       status = "okay";
+       pinctrl-0 = <&pwm_e_pins>;
+       pinctrl-names = "default";
 };
 
 &saradc {
        };
 };
 
-
 &tdmif_a {
        status = "okay";
 };
 
+&tdmin_a {
+       status = "okay";
+};
+
 &tdmout_a {
        status = "okay";
 };
 
+&toddr_a {
+       status = "okay";
+};
+
+&toddr_b {
+       status = "okay";
+};
+
+&toddr_c {
+       status = "okay";
+};
+
 &tohdmitx {
        status = "okay";
 };
diff --git a/arch/arm/dts/meson-sm1-bananapi-m5.dts b/arch/arm/dts/meson-sm1-bananapi-m5.dts
new file mode 100644 (file)
index 0000000..effaa13
--- /dev/null
@@ -0,0 +1,646 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2021 BayLibre SAS
+ * Author: Neil Armstrong <narmstrong@baylibre.com>
+ */
+
+/dts-v1/;
+
+#include "meson-sm1.dtsi"
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/input/linux-event-codes.h>
+#include <dt-bindings/gpio/meson-g12a-gpio.h>
+#include <dt-bindings/sound/meson-g12a-toacodec.h>
+#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
+
+/ {
+       compatible = "bananapi,bpi-m5", "amlogic,sm1";
+       model = "Banana Pi BPI-M5";
+
+       adc_keys {
+               compatible = "adc-keys";
+               io-channels = <&saradc 2>;
+               io-channel-names = "buttons";
+               keyup-threshold-microvolt = <1800000>;
+
+               key {
+                       label = "SW3";
+                       linux,code = <BTN_3>;
+                       press-threshold-microvolt = <1700000>;
+               };
+       };
+
+       aliases {
+               serial0 = &uart_AO;
+               ethernet0 = &ethmac;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       /* TOFIX: handle CVBS_DET on SARADC channel 0 */
+       cvbs-connector {
+               compatible = "composite-video-connector";
+
+               port {
+                       cvbs_connector_in: endpoint {
+                               remote-endpoint = <&cvbs_vdac_out>;
+                       };
+               };
+       };
+
+       emmc_pwrseq: emmc-pwrseq {
+               compatible = "mmc-pwrseq-emmc";
+               reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               key {
+                       label = "SW1";
+                       linux,code = <BTN_1>;
+                       gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>;
+                       interrupt-parent = <&gpio_intc>;
+                       interrupts = <3 IRQ_TYPE_EDGE_BOTH>;
+               };
+       };
+
+       hdmi-connector {
+               compatible = "hdmi-connector";
+               type = "a";
+
+               port {
+                       hdmi_connector_in: endpoint {
+                               remote-endpoint = <&hdmi_tx_tmds_out>;
+                       };
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               green {
+                       color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_STATUS;
+                       gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
+               };
+
+               blue {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_STATUS;
+                       gpios = <&gpio_ao GPIOAO_11 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "heartbeat";
+               };
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x0 0x0 0x40000000>;
+       };
+
+       emmc_1v8: regulator-emmc_1v8 {
+               compatible = "regulator-fixed";
+               regulator-name = "EMMC_1V8";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               vin-supply = <&vddao_3v3>;
+               regulator-always-on;
+       };
+
+       dc_in: regulator-dc_in {
+               compatible = "regulator-fixed";
+               regulator-name = "DC_IN";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               regulator-always-on;
+       };
+
+       vddio_c: regulator-vddio_c {
+               compatible = "regulator-gpio";
+               regulator-name = "VDDIO_C";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <3300000>;
+
+               enable-gpio = <&gpio GPIOE_2 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               regulator-always-on;
+
+               gpios = <&gpio_ao GPIOAO_6 GPIO_OPEN_DRAIN>;
+               gpios-states = <1>;
+
+               states = <1800000 0>,
+                        <3300000 1>;
+       };
+
+       tflash_vdd: regulator-tflash_vdd {
+               compatible = "regulator-fixed";
+               regulator-name = "TFLASH_VDD";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&dc_in>;
+               gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
+               enable-active-high;
+               regulator-always-on;
+       };
+
+       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;
+       };
+
+       vddcpu: regulator-vddcpu {
+               /*
+                * SY8120B1ABC DC/DC Regulator.
+                */
+               compatible = "pwm-regulator";
+
+               regulator-name = "VDDCPU";
+               regulator-min-microvolt = <690000>;
+               regulator-max-microvolt = <1050000>;
+
+               vin-supply = <&dc_in>;
+
+               pwms = <&pwm_AO_cd 1 1250 0>;
+               pwm-dutycycle-range = <100 0>;
+
+               regulator-boot-on;
+               regulator-always-on;
+       };
+
+       /* USB Hub Power Enable */
+       vl_pwr_en: regulator-vl_pwr_en {
+               compatible = "regulator-fixed";
+               regulator-name = "VL_PWR_EN";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               vin-supply = <&dc_in>;
+
+               gpio = <&gpio GPIOH_6 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+       };
+
+       sound {
+               compatible = "amlogic,axg-sound-card";
+               model = "BPI-M5";
+               audio-widgets = "Line", "Lineout";
+               audio-aux-devs = <&tdmout_b>, <&tdmout_c>,
+                                <&tdmin_a>, <&tdmin_b>, <&tdmin_c>;
+               audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
+                               "TDMOUT_B IN 1", "FRDDR_B OUT 1",
+                               "TDMOUT_B IN 2", "FRDDR_C OUT 1",
+                               "TDM_B Playback", "TDMOUT_B OUT",
+                               "TDMOUT_C IN 0", "FRDDR_A OUT 2",
+                               "TDMOUT_C IN 1", "FRDDR_B OUT 2",
+                               "TDMOUT_C IN 2", "FRDDR_C OUT 2",
+                               "TDM_C Playback", "TDMOUT_C OUT",
+                               "TDMIN_A IN 4", "TDM_B Loopback",
+                               "TDMIN_B IN 4", "TDM_B Loopback",
+                               "TDMIN_C IN 4", "TDM_B Loopback",
+                               "TDMIN_A IN 5", "TDM_C Loopback",
+                               "TDMIN_B IN 5", "TDM_C Loopback",
+                               "TDMIN_C IN 5", "TDM_C Loopback",
+                               "TODDR_A IN 0", "TDMIN_A OUT",
+                               "TODDR_B IN 0", "TDMIN_A OUT",
+                               "TODDR_C IN 0", "TDMIN_A OUT",
+                               "TODDR_A IN 1", "TDMIN_B OUT",
+                               "TODDR_B IN 1", "TDMIN_B OUT",
+                               "TODDR_C IN 1", "TDMIN_B OUT",
+                               "TODDR_A IN 2", "TDMIN_C OUT",
+                               "TODDR_B IN 2", "TDMIN_C OUT",
+                               "TODDR_C IN 2", "TDMIN_C OUT",
+                               "Lineout", "ACODEC LOLP",
+                               "Lineout", "ACODEC LORP";
+
+               assigned-clocks = <&clkc CLKID_MPLL2>,
+                                 <&clkc CLKID_MPLL0>,
+                                 <&clkc CLKID_MPLL1>;
+               assigned-clock-parents = <0>, <0>, <0>;
+               assigned-clock-rates = <294912000>,
+                                      <270950400>,
+                                      <393216000>;
+               status = "okay";
+
+               dai-link-0 {
+                       sound-dai = <&frddr_a>;
+               };
+
+               dai-link-1 {
+                       sound-dai = <&frddr_b>;
+               };
+
+               dai-link-2 {
+                       sound-dai = <&frddr_c>;
+               };
+
+               dai-link-3 {
+                       sound-dai = <&toddr_a>;
+               };
+
+               dai-link-4 {
+                       sound-dai = <&toddr_b>;
+               };
+
+               dai-link-5 {
+                       sound-dai = <&toddr_c>;
+               };
+
+               /* 8ch hdmi interface */
+               dai-link-6 {
+                       sound-dai = <&tdmif_b>;
+                       dai-format = "i2s";
+                       dai-tdm-slot-tx-mask-0 = <1 1>;
+                       dai-tdm-slot-tx-mask-1 = <1 1>;
+                       dai-tdm-slot-tx-mask-2 = <1 1>;
+                       dai-tdm-slot-tx-mask-3 = <1 1>;
+                       mclk-fs = <256>;
+
+                       codec-0 {
+                               sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
+                       };
+
+                       codec-1 {
+                               sound-dai = <&toacodec TOACODEC_IN_B>;
+                       };
+               };
+
+               /* i2s jack output interface */
+               dai-link-7 {
+                       sound-dai = <&tdmif_c>;
+                       dai-format = "i2s";
+                       dai-tdm-slot-tx-mask-0 = <1 1>;
+                       mclk-fs = <256>;
+
+                       codec-0 {
+                               sound-dai = <&tohdmitx TOHDMITX_I2S_IN_C>;
+                       };
+
+                       codec-1 {
+                               sound-dai = <&toacodec TOACODEC_IN_C>;
+                       };
+               };
+
+               /* hdmi glue */
+               dai-link-8 {
+                       sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
+
+                       codec {
+                               sound-dai = <&hdmi_tx>;
+                       };
+               };
+
+               /* acodec glue */
+               dai-link-9 {
+                       sound-dai = <&toacodec TOACODEC_OUT>;
+
+                       codec {
+                               sound-dai = <&acodec>;
+                       };
+               };
+       };
+};
+
+&acodec {
+       AVDD-supply = <&vddao_1v8>;
+       status = "okay";
+};
+
+&arb {
+       status = "okay";
+};
+
+&clkc_audio {
+       status = "okay";
+};
+
+&cpu0 {
+       cpu-supply = <&vddcpu>;
+       operating-points-v2 = <&cpu_opp_table>;
+       clocks = <&clkc CLKID_CPU_CLK>;
+       clock-latency = <50000>;
+};
+
+&cpu1 {
+       cpu-supply = <&vddcpu>;
+       operating-points-v2 = <&cpu_opp_table>;
+       clocks = <&clkc CLKID_CPU1_CLK>;
+       clock-latency = <50000>;
+};
+
+&cpu2 {
+       cpu-supply = <&vddcpu>;
+       operating-points-v2 = <&cpu_opp_table>;
+       clocks = <&clkc CLKID_CPU2_CLK>;
+       clock-latency = <50000>;
+};
+
+&cpu3 {
+       cpu-supply = <&vddcpu>;
+       operating-points-v2 = <&cpu_opp_table>;
+       clocks = <&clkc CLKID_CPU3_CLK>;
+       clock-latency = <50000>;
+};
+
+&cvbs_vdac_port {
+       cvbs_vdac_out: endpoint {
+               remote-endpoint = <&cvbs_connector_in>;
+       };
+};
+
+&ext_mdio {
+       external_phy: ethernet-phy@0 {
+               /* Realtek RTL8211F (0x001cc916) */
+               reg = <0>;
+               max-speed = <1000>;
+
+               interrupt-parent = <&gpio_intc>;
+               /* MAC_INTR on GPIOZ_14 */
+               interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
+       };
+};
+
+&ethmac {
+       pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
+       pinctrl-names = "default";
+       status = "okay";
+       phy-mode = "rgmii-txid";
+       phy-handle = <&external_phy>;
+};
+
+&frddr_a {
+       status = "okay";
+};
+
+&frddr_b {
+       status = "okay";
+};
+
+&frddr_c {
+       status = "okay";
+};
+
+&gpio {
+       gpio-line-names =
+               /* GPIOZ */
+               "ETH_MDIO", /* GPIOZ_0 */
+               "ETH_MDC", /* GPIOZ_1 */
+               "ETH_RXCLK", /* GPIOZ_2 */
+               "ETH_RX_DV", /* GPIOZ_3 */
+               "ETH_RXD0", /* GPIOZ_4 */
+               "ETH_RXD1", /* GPIOZ_5 */
+               "ETH_RXD2", /* GPIOZ_6 */
+               "ETH_RXD3", /* GPIOZ_7 */
+               "ETH_TXCLK", /* GPIOZ_8 */
+               "ETH_TXEN", /* GPIOZ_9 */
+               "ETH_TXD0", /* GPIOZ_10 */
+               "ETH_TXD1", /* GPIOZ_11 */
+               "ETH_TXD2", /* GPIOZ_12 */
+               "ETH_TXD3", /* GPIOZ_13 */
+               "ETH_INTR", /* GPIOZ_14 */
+               "ETH_NRST", /* GPIOZ_15 */
+               /* GPIOH */
+               "HDMI_SDA", /* GPIOH_0 */
+               "HDMI_SCL", /* GPIOH_1 */
+               "HDMI_HPD", /* GPIOH_2 */
+               "HDMI_CEC", /* GPIOH_3 */
+               "VL-RST_N", /* GPIOH_4 */
+               "CON1-P36", /* GPIOH_5 */
+               "VL-PWREN", /* GPIOH_6 */
+               "WiFi_3V3_1V8", /* GPIOH_7 */
+               "TFLASH_VDD_EN", /* GPIOH_8 */
+               /* BOOT */
+               "eMMC_D0", /* BOOT_0 */
+               "eMMC_D1", /* BOOT_1 */
+               "eMMC_D2", /* BOOT_2 */
+               "eMMC_D3", /* BOOT_3 */
+               "eMMC_D4", /* BOOT_4 */
+               "eMMC_D5", /* BOOT_5 */
+               "eMMC_D6", /* BOOT_6 */
+               "eMMC_D7", /* BOOT_7 */
+               "eMMC_CLK", /* BOOT_8 */
+               "",
+               "eMMC_CMD", /* BOOT_10 */
+               "",
+               "eMMC_RST#", /* BOOT_12 */
+               "eMMC_DS", /* BOOT_13 */
+               /* GPIOC */
+               "SD_D0_B", /* GPIOC_0 */
+               "SD_D1_B", /* GPIOC_1 */
+               "SD_D2_B", /* GPIOC_2 */
+               "SD_D3_B", /* GPIOC_3 */
+               "SD_CLK_B", /* GPIOC_4 */
+               "SD_CMD_B", /* GPIOC_5 */
+               "CARD_EN_DET", /* GPIOC_6 */
+               "",
+               /* GPIOA */
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "",
+               "CON1-P27", /* GPIOA_14 */
+               "CON1-P28", /* GPIOA_15 */
+               /* GPIOX */
+               "CON1-P16", /* GPIOX_0 */
+               "CON1-P18", /* GPIOX_1 */
+               "CON1-P22", /* GPIOX_2 */
+               "CON1-P11", /* GPIOX_3 */
+               "CON1-P13", /* GPIOX_4 */
+               "CON1-P07", /* GPIOX_5 */
+               "CON1-P33", /* GPIOX_6 */
+               "CON1-P15", /* GPIOX_7 */
+               "CON1-P19", /* GPIOX_8 */
+               "CON1-P21", /* GPIOX_9 */
+               "CON1-P24", /* GPIOX_10 */
+               "CON1-P23", /* GPIOX_11 */
+               "CON1-P08", /* GPIOX_12 */
+               "CON1-P10", /* GPIOX_13 */
+               "CON1-P29", /* GPIOX_14 */
+               "CON1-P31", /* GPIOX_15 */
+               "CON1-P26", /* GPIOX_16 */
+               "CON1-P03", /* GPIOX_17 */
+               "CON1-P05", /* GPIOX_18 */
+               "CON1-P32"; /* GPIOX_19 */
+
+       /*
+        * WARNING: The USB Hub on the BPI-M5 needs a reset signal
+        * to be turned high in order to be detected by the USB Controller
+        * This signal should be handled by a USB specific power sequence
+        * in order to reset the Hub when USB bus is powered down.
+        */
+       usb-hub {
+               gpio-hog;
+               gpios = <GPIOH_4 GPIO_ACTIVE_HIGH>;
+               output-high;
+               line-name = "usb-hub-reset";
+       };
+};
+
+&gpio_ao {
+       gpio-line-names =
+               /* GPIOAO */
+               "DEBUG TX", /* GPIOAO_0 */
+               "DEBUG RX", /* GPIOAO_1 */
+               "SYS_LED2", /* GPIOAO_2 */
+               "UPDATE_KEY", /* GPIOAO_3 */
+               "CON1-P40", /* GPIOAO_4 */
+               "IR_IN", /* GPIOAO_5 */
+               "TF_3V3N_1V8_EN", /* GPIOAO_6 */
+               "CON1-P35", /* GPIOAO_7 */
+               "CON1-P12", /* GPIOAO_8 */
+               "CON1-P37", /* GPIOAO_9 */
+               "CON1-P38", /* GPIOAO_10 */
+               "SYS_LED", /* GPIOAO_11 */
+               /* GPIOE */
+               "VDDEE_PWM", /* GPIOE_0 */
+               "VDDCPU_PWM", /* GPIOE_1 */
+               "TF_PWR_EN"; /* GPIOE_2 */
+};
+
+&hdmi_tx {
+       status = "okay";
+       pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
+       pinctrl-names = "default";
+       hdmi-supply = <&dc_in>;
+};
+
+&hdmi_tx_tmds_port {
+       hdmi_tx_tmds_out: endpoint {
+               remote-endpoint = <&hdmi_connector_in>;
+       };
+};
+
+&ir {
+       status = "okay";
+       pinctrl-0 = <&remote_input_ao_pins>;
+       pinctrl-names = "default";
+};
+
+&pwm_AO_cd {
+       pinctrl-0 = <&pwm_ao_d_e_pins>;
+       pinctrl-names = "default";
+       clocks = <&xtal>;
+       clock-names = "clkin1";
+       status = "okay";
+};
+
+&saradc {
+       status = "okay";
+       vref-supply = <&vddao_1v8>;
+};
+
+/* SD card */
+&sd_emmc_b {
+       status = "okay";
+       pinctrl-0 = <&sdcard_c_pins>;
+       pinctrl-1 = <&sdcard_clk_gate_c_pins>;
+       pinctrl-names = "default", "clk-gate";
+
+       bus-width = <4>;
+       cap-sd-highspeed;
+       max-frequency = <50000000>;
+       disable-wp;
+
+       /* TOFIX: SD card is barely usable in SDR modes */
+
+       cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
+       vmmc-supply = <&tflash_vdd>;
+       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;
+
+       mmc-pwrseq = <&emmc_pwrseq>;
+       vmmc-supply = <&vddao_3v3>;
+       vqmmc-supply = <&emmc_1v8>;
+};
+
+&tdmif_b {
+       status = "okay";
+};
+
+&tdmif_c {
+       status = "okay";
+};
+
+&tdmin_a {
+       status = "okay";
+};
+
+&tdmin_b {
+       status = "okay";
+};
+
+&tdmin_c {
+       status = "okay";
+};
+
+&tdmout_b {
+       status = "okay";
+};
+
+&tdmout_c {
+       status = "okay";
+};
+
+&toacodec {
+       status = "okay";
+};
+
+&tohdmitx {
+       status = "okay";
+};
+
+&toddr_a {
+       status = "okay";
+};
+
+&toddr_b {
+       status = "okay";
+};
+
+&toddr_c {
+       status = "okay";
+};
+
+&uart_AO {
+       status = "okay";
+       pinctrl-0 = <&uart_ao_a_pins>;
+       pinctrl-names = "default";
+};
+
+&usb {
+       status = "okay";
+};
+
+&usb2_phy0 {
+       phy-supply = <&dc_in>;
+};
+
+&usb2_phy1 {
+       /* Enable the hub which is connected to this port */
+       phy-supply = <&vl_pwr_en>;
+};
index 4b517ca72059772cd7ffaa700a233848f16cda85..f2c098143594413619df877f861ce2bb86cdaf21 100644 (file)
                regulator-boot-on;
                regulator-always-on;
        };
+
+       sound {
+               model = "G12B-KHADAS-VIM3L";
+               audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 0",
+                               "TDMOUT_A IN 1", "FRDDR_B OUT 0",
+                               "TDMOUT_A IN 2", "FRDDR_C OUT 0",
+                               "TDM_A Playback", "TDMOUT_A OUT",
+                               "TDMIN_A IN 0", "TDM_A Capture",
+                               "TDMIN_A IN 13", "TDM_A Loopback",
+                               "TODDR_A IN 0", "TDMIN_A OUT",
+                               "TODDR_B IN 0", "TDMIN_A OUT",
+                               "TODDR_C IN 0", "TDMIN_A OUT";
+       };
 };
 
 &cpu0 {
        status = "okay";
 };
 
-&sd_emmc_a {
-       sd-uhs-sdr50;
-};
-
 &usb {
        phys = <&usb2_phy0>, <&usb2_phy1>;
        phy-names = "usb2-phy0", "usb2-phy1";
 };
  */
 
+&sd_emmc_a {
+       sd-uhs-sdr50;
+};
index cf5a98f0e47c8e4bb1a12ce142a76cf0d889fe79..8c30ce63686e33aba6a44d43d54ec5d2263167e5 100644 (file)
@@ -5,34 +5,12 @@
 
 /dts-v1/;
 
-#include "meson-sm1.dtsi"
-#include <dt-bindings/gpio/meson-g12a-gpio.h>
-#include <dt-bindings/leds/common.h>
-#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
+#include "meson-sm1-odroid.dtsi"
 
 / {
        compatible = "hardkernel,odroid-c4", "amlogic,sm1";
        model = "Hardkernel ODROID-C4";
 
-       aliases {
-               serial0 = &uart_AO;
-               ethernet0 = &ethmac;
-       };
-
-       chosen {
-               stdout-path = "serial0:115200n8";
-       };
-
-       memory@0 {
-               device_type = "memory";
-               reg = <0x0 0x0 0x0 0x40000000>;
-       };
-
-       emmc_pwrseq: emmc-pwrseq {
-               compatible = "mmc-pwrseq-emmc";
-               reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
-       };
-
        leds {
                compatible = "gpio-leds";
 
                };
        };
 
-       tflash_vdd: regulator-tflash_vdd {
-               compatible = "regulator-fixed";
-
-               regulator-name = "TFLASH_VDD";
-               regulator-min-microvolt = <3300000>;
-               regulator-max-microvolt = <3300000>;
-
-               gpio = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>;
-               enable-active-high;
-               regulator-always-on;
-       };
-
-       tf_io: gpio-regulator-tf_io {
-               compatible = "regulator-gpio";
-
-               regulator-name = "TF_IO";
-               regulator-min-microvolt = <1800000>;
-               regulator-max-microvolt = <3300000>;
-
-               gpios = <&gpio_ao GPIOAO_6 GPIO_ACTIVE_HIGH>;
-               gpios-states = <0>;
-
-               states = <3300000 0>,
-                        <1800000 1>;
-       };
-
-       flash_1v8: regulator-flash_1v8 {
-               compatible = "regulator-fixed";
-               regulator-name = "FLASH_1V8";
-               regulator-min-microvolt = <1800000>;
-               regulator-max-microvolt = <1800000>;
-               vin-supply = <&vcc_3v3>;
-               regulator-always-on;
-       };
-
-       main_12v: regulator-main_12v {
-               compatible = "regulator-fixed";
-               regulator-name = "12V";
-               regulator-min-microvolt = <12000000>;
-               regulator-max-microvolt = <12000000>;
-               regulator-always-on;
-       };
-
-       vcc_5v: regulator-vcc_5v {
-               compatible = "regulator-fixed";
-               regulator-name = "5V";
-               regulator-min-microvolt = <5000000>;
-               regulator-max-microvolt = <5000000>;
-               regulator-always-on;
-               vin-supply = <&main_12v>;
-       };
-
-       vcc_1v8: regulator-vcc_1v8 {
-               compatible = "regulator-fixed";
-               regulator-name = "VCC_1V8";
-               regulator-min-microvolt = <1800000>;
-               regulator-max-microvolt = <1800000>;
-               vin-supply = <&vcc_3v3>;
-               regulator-always-on;
-       };
-
-       vcc_3v3: regulator-vcc_3v3 {
-               compatible = "regulator-fixed";
-               regulator-name = "VCC_3V3";
-               regulator-min-microvolt = <3300000>;
-               regulator-max-microvolt = <3300000>;
-               vin-supply = <&vddao_3v3>;
-               regulator-always-on;
-               /* FIXME: actually controlled by VDDCPU_B_EN */
-       };
-
-       vddcpu: regulator-vddcpu {
-               /*
-                * MP8756GD Regulator.
-                */
-               compatible = "pwm-regulator";
-
-               regulator-name = "VDDCPU";
-               regulator-min-microvolt = <721000>;
-               regulator-max-microvolt = <1022000>;
-
-               vin-supply = <&main_12v>;
-
-               pwms = <&pwm_AO_cd 1 1250 0>;
-               pwm-dutycycle-range = <100 0>;
-
-               regulator-boot-on;
-               regulator-always-on;
-       };
-
-       hub_5v: regulator-hub_5v {
-               compatible = "regulator-fixed";
-               regulator-name = "HUB_5V";
-               regulator-min-microvolt = <5000000>;
-               regulator-max-microvolt = <5000000>;
-               vin-supply = <&vcc_5v>;
-
-               /* Connected to the Hub CHIPENABLE, LOW sets low power state */
-               gpio = <&gpio GPIOH_4 GPIO_ACTIVE_HIGH>;
-               enable-active-high;
-       };
-
-       usb_pwr_en: regulator-usb_pwr_en {
-               compatible = "regulator-fixed";
-               regulator-name = "USB_PWR_EN";
-               regulator-min-microvolt = <5000000>;
-               regulator-max-microvolt = <5000000>;
-               vin-supply = <&vcc_5v>;
-
-               /* Connected to the microUSB port power enable */
-               gpio = <&gpio_ao GPIOAO_2 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 = <&main_12v>;
-               regulator-always-on;
-       };
-
-       hdmi-connector {
-               compatible = "hdmi-connector";
-               type = "a";
-
-               port {
-                       hdmi_connector_in: endpoint {
-                               remote-endpoint = <&hdmi_tx_tmds_out>;
-                       };
-               };
-       };
-
        sound {
-               compatible = "amlogic,axg-sound-card";
-               model = "SM1-ODROID-C4";
-               audio-aux-devs = <&tdmout_b>;
-               audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
-                               "TDMOUT_B IN 1", "FRDDR_B OUT 1",
-                               "TDMOUT_B IN 2", "FRDDR_C OUT 1",
-                               "TDM_B Playback", "TDMOUT_B OUT";
-
-               assigned-clocks = <&clkc CLKID_MPLL2>,
-                                 <&clkc CLKID_MPLL0>,
-                                 <&clkc CLKID_MPLL1>;
-               assigned-clock-parents = <0>, <0>, <0>;
-               assigned-clock-rates = <294912000>,
-                                      <270950400>,
-                                      <393216000>;
-               status = "okay";
-
-               dai-link-0 {
-                       sound-dai = <&frddr_a>;
-               };
-
-               dai-link-1 {
-                       sound-dai = <&frddr_b>;
-               };
-
-               dai-link-2 {
-                       sound-dai = <&frddr_c>;
-               };
-
-               /* 8ch hdmi interface */
-               dai-link-3 {
-                       sound-dai = <&tdmif_b>;
-                       dai-format = "i2s";
-                       dai-tdm-slot-tx-mask-0 = <1 1>;
-                       dai-tdm-slot-tx-mask-1 = <1 1>;
-                       dai-tdm-slot-tx-mask-2 = <1 1>;
-                       dai-tdm-slot-tx-mask-3 = <1 1>;
-                       mclk-fs = <256>;
-
-                       codec {
-                               sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
-                       };
-               };
-
-               /* hdmi glue */
-               dai-link-4 {
-                       sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
-
-                       codec {
-                               sound-dai = <&hdmi_tx>;
-                       };
-               };
-       };
-};
-
-&arb {
-       status = "okay";
-};
-
-&clkc_audio {
-       status = "okay";
-};
-
-&cpu0 {
-       cpu-supply = <&vddcpu>;
-       operating-points-v2 = <&cpu_opp_table>;
-       clocks = <&clkc CLKID_CPU_CLK>;
-       clock-latency = <50000>;
-};
-
-&cpu1 {
-       cpu-supply = <&vddcpu>;
-       operating-points-v2 = <&cpu_opp_table>;
-       clocks = <&clkc CLKID_CPU1_CLK>;
-       clock-latency = <50000>;
-};
-
-&cpu2 {
-       cpu-supply = <&vddcpu>;
-       operating-points-v2 = <&cpu_opp_table>;
-       clocks = <&clkc CLKID_CPU2_CLK>;
-       clock-latency = <50000>;
-};
-
-&cpu3 {
-       cpu-supply = <&vddcpu>;
-       operating-points-v2 = <&cpu_opp_table>;
-       clocks = <&clkc CLKID_CPU3_CLK>;
-       clock-latency = <50000>;
-};
-
-&ext_mdio {
-       external_phy: ethernet-phy@0 {
-               /* Realtek RTL8211F (0x001cc916) */
-               reg = <0>;
-               max-speed = <1000>;
-
-               interrupt-parent = <&gpio_intc>;
-               /* MAC_INTR on GPIOZ_14 */
-               interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
+               model = "ODROID-C4";
        };
 };
 
-&ethmac {
-       pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
-       pinctrl-names = "default";
-       status = "okay";
-       phy-mode = "rgmii";
-       phy-handle = <&external_phy>;
-       amlogic,tx-delay-ns = <2>;
-};
-
-&frddr_a {
-       status = "okay";
-};
-
-&frddr_b {
-       status = "okay";
-};
-
-&frddr_c {
-       status = "okay";
-};
-
 &gpio {
-       gpio-line-names =
-               /* GPIOZ */
-               "", "", "", "", "", "", "", "",
-               "", "", "", "", "", "", "", "",
-               /* GPIOH */
-               "", "", "", "", "",
-               "PIN_36", /* GPIOH_5 */
-               "PIN_26", /* GPIOH_6 */
-               "PIN_32", /* GPIOH_7 */
-               "",
-               /* BOOT */
-               "", "", "", "", "", "", "", "",
-               "", "", "", "", "", "", "", "",
-               /* GPIOC */
-               "", "", "", "", "", "", "", "",
-               /* GPIOA */
-               "", "", "", "", "", "", "", "",
-               "", "", "", "", "", "",
-               "PIN_27", /* GPIOA_14 */
-               "PIN_28", /* GPIOA_15 */
-               /* GPIOX */
-               "PIN_16", /* GPIOX_0 */
-               "PIN_18", /* GPIOX_1 */
-               "PIN_22", /* GPIOX_2 */
-               "PIN_11", /* GPIOX_3 */
-               "PIN_13", /* GPIOX_4 */
-               "PIN_7",  /* GPIOX_5 */
-               "PIN_33", /* GPIOX_6 */
-               "PIN_15", /* GPIOX_7 */
-               "PIN_19", /* GPIOX_8 */
-               "PIN_21", /* GPIOX_9 */
-               "PIN_24", /* GPIOX_10 */
-               "PIN_23", /* GPIOX_11 */
-               "PIN_8",  /* GPIOX_12 */
-               "PIN_10", /* GPIOX_13 */
-               "PIN_29", /* GPIOX_14 */
-               "PIN_31", /* GPIOX_15 */
-               "PIN_12", /* GPIOX_16 */
-               "PIN_3",  /* GPIOX_17 */
-               "PIN_5",  /* GPIOX_18 */
-               "PIN_35"; /* GPIOX_19 */
-
        /*
         * WARNING: The USB Hub on the Odroid-C4 needs a reset signal
         * to be turned high in order to be detected by the USB Controller
         * This signal should be handled by a USB specific power sequence
         * in order to reset the Hub when USB bus is powered down.
         */
-       usb-hub {
+       hog-0 {
                gpio-hog;
                gpios = <GPIOH_4 GPIO_ACTIVE_HIGH>;
                output-high;
        };
 };
 
-&gpio_ao {
-       gpio-line-names =
-               /* GPIOAO */
-               "", "", "", "",
-               "PIN_47", /* GPIOAO_4 */
-               "", "",
-               "PIN_45", /* GPIOAO_7 */
-               "PIN_46", /* GPIOAO_8 */
-               "PIN_44", /* GPIOAO_9 */
-               "PIN_42", /* GPIOAO_10 */
-               "",
-               /* GPIOE */
-               "", "", "";
-};
-
-&hdmi_tx {
-       status = "okay";
-       pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
-       pinctrl-names = "default";
-       hdmi-supply = <&vcc_5v>;
-};
-
-&hdmi_tx_tmds_port {
-       hdmi_tx_tmds_out: endpoint {
-               remote-endpoint = <&hdmi_connector_in>;
-       };
-};
-
 &ir {
-       status = "okay";
-       pinctrl-0 = <&remote_input_ao_pins>;
-       pinctrl-names = "default";
        linux,rc-map-name = "rc-odroid";
 };
-
-&pwm_AO_cd {
-       pinctrl-0 = <&pwm_ao_d_e_pins>;
-       pinctrl-names = "default";
-       clocks = <&xtal>;
-       clock-names = "clkin1";
-       status = "okay";
-};
-
-&saradc {
-       status = "okay";
-};
-
-/* SD card */
-&sd_emmc_b {
-       status = "okay";
-       pinctrl-0 = <&sdcard_c_pins>;
-       pinctrl-1 = <&sdcard_clk_gate_c_pins>;
-       pinctrl-names = "default", "clk-gate";
-
-       bus-width = <4>;
-       cap-sd-highspeed;
-       max-frequency = <200000000>;
-       sd-uhs-sdr12;
-       sd-uhs-sdr25;
-       sd-uhs-sdr50;
-       sd-uhs-sdr104;
-       disable-wp;
-
-       cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
-       vmmc-supply = <&tflash_vdd>;
-       vqmmc-supply = <&tf_io>;
-};
-
-/* 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;
-
-       mmc-pwrseq = <&emmc_pwrseq>;
-       vmmc-supply = <&vcc_3v3>;
-       vqmmc-supply = <&flash_1v8>;
-};
-
-&tdmif_b {
-       status = "okay";
-};
-
-&tdmout_b {
-       status = "okay";
-};
-
-&tohdmitx {
-       status = "okay";
-};
-
-&uart_AO {
-       status = "okay";
-       pinctrl-0 = <&uart_ao_a_pins>;
-       pinctrl-names = "default";
-};
-
-&usb {
-       status = "okay";
-       vbus-supply = <&usb_pwr_en>;
-};
-
-&usb2_phy0 {
-       phy-supply = <&vcc_5v>;
-};
-
-&usb2_phy1 {
-       /* Enable the hub which is connected to this port */
-       phy-supply = <&hub_5v>;
-};
diff --git a/arch/arm/dts/meson-sm1-odroid-hc4.dts b/arch/arm/dts/meson-sm1-odroid-hc4.dts
new file mode 100644 (file)
index 0000000..f3f9532
--- /dev/null
@@ -0,0 +1,140 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2020 Dongjin Kim <tobetter@gmail.com>
+ */
+
+/dts-v1/;
+
+#include "meson-sm1-odroid.dtsi"
+
+/ {
+       compatible = "hardkernel,odroid-hc4", "amlogic,sm1";
+       model = "Hardkernel ODROID-HC4";
+
+       aliases {
+               rtc0 = &rtc;
+               rtc1 = &vrtc;
+       };
+
+       fan0: pwm-fan {
+               compatible = "pwm-fan";
+               #cooling-cells = <2>;
+               cooling-min-state = <0>;
+               cooling-max-state = <3>;
+               cooling-levels = <0 120 170 220>;
+               pwms = <&pwm_cd 1 40000 0>;
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               led-blue {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_STATUS;
+                       gpios = <&gpio_ao GPIOAO_11 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "heartbeat";
+                       panic-indicator;
+               };
+
+               led-red {
+                       color = <LED_COLOR_ID_RED>;
+                       function = LED_FUNCTION_POWER;
+                       gpios = <&gpio_ao GPIOAO_7 GPIO_ACTIVE_HIGH>;
+                       default-state = "on";
+               };
+       };
+
+       /* Powers the SATA Disk 0 regulator, which is enabled when a disk load is detected */
+       p12v_0: regulator-p12v_0 {
+               compatible = "regulator-fixed";
+               regulator-name = "P12V_0";
+               regulator-min-microvolt = <12000000>;
+               regulator-max-microvolt = <12000000>;
+               vin-supply = <&main_12v>;
+
+               gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
+               enable-active-high;
+               regulator-always-on;
+       };
+
+       /* Powers the SATA Disk 1 regulator, which is enabled when a disk load is detected */
+       p12v_1: regulator-p12v_1 {
+               compatible = "regulator-fixed";
+               regulator-name = "P12V_1";
+               regulator-min-microvolt = <12000000>;
+               regulator-max-microvolt = <12000000>;
+               vin-supply = <&main_12v>;
+
+               gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
+               enable-active-high;
+               regulator-always-on;
+       };
+
+       sound {
+               model = "ODROID-HC4";
+       };
+};
+
+&cpu_thermal {
+       cooling-maps {
+               map {
+                       trip = <&cpu_passive>;
+                       cooling-device = <&fan0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+               };
+       };
+};
+
+&ir {
+       linux,rc-map-name = "rc-odroid";
+};
+
+&i2c2 {
+       status = "okay";
+       pinctrl-0 = <&i2c2_sda_x_pins>, <&i2c2_sck_x_pins>;
+       pinctrl-names = "default";
+
+       rtc: rtc@51 {
+               status = "okay";
+               compatible = "nxp,pcf8563";
+               reg = <0x51>;
+               wakeup-source;
+       };
+};
+
+&pcie {
+       status = "okay";
+       reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>;
+};
+
+&pwm_cd {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&pwm_d_x6_pins>;
+};
+
+&sd_emmc_c {
+       status = "disabled";
+};
+
+&spifc {
+       status = "okay";
+       pinctrl-0 = <&nor_pins>;
+       pinctrl-names = "default";
+
+       spi-flash@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <104000000>;
+       };
+};
+
+&usb {
+       phys = <&usb2_phy1>;
+       phy-names = "usb2-phy1";
+};
+
+&usb2_phy0 {
+       status = "disabled";
+};
diff --git a/arch/arm/dts/meson-sm1-odroid.dtsi b/arch/arm/dts/meson-sm1-odroid.dtsi
new file mode 100644 (file)
index 0000000..fd0ad85
--- /dev/null
@@ -0,0 +1,449 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2020 Dongjin Kim <tobetter@gmail.com>
+ */
+
+#include "meson-sm1.dtsi"
+#include <dt-bindings/gpio/meson-g12a-gpio.h>
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
+
+/ {
+       aliases {
+               serial0 = &uart_AO;
+               ethernet0 = &ethmac;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x0 0x0 0x40000000>;
+       };
+
+       emmc_pwrseq: emmc-pwrseq {
+               compatible = "mmc-pwrseq-emmc";
+               reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
+       };
+
+       tflash_vdd: regulator-tflash_vdd {
+               compatible = "regulator-fixed";
+
+               regulator-name = "TFLASH_VDD";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+
+               gpio = <&gpio_ao GPIOAO_3 GPIO_OPEN_DRAIN>;
+               enable-active-high;
+               regulator-always-on;
+       };
+
+       tf_io: gpio-regulator-tf_io {
+               compatible = "regulator-gpio";
+
+               regulator-name = "TF_IO";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&vcc_5v>;
+
+               enable-gpio = <&gpio GPIOE_2 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               regulator-always-on;
+
+               gpios = <&gpio_ao GPIOAO_6 GPIO_OPEN_SOURCE>;
+               gpios-states = <0>;
+
+               states = <3300000 0>,
+                        <1800000 1>;
+       };
+
+       flash_1v8: regulator-flash_1v8 {
+               compatible = "regulator-fixed";
+               regulator-name = "FLASH_1V8";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               vin-supply = <&vcc_3v3>;
+               regulator-always-on;
+       };
+
+       main_12v: regulator-main_12v {
+               compatible = "regulator-fixed";
+               regulator-name = "12V";
+               regulator-min-microvolt = <12000000>;
+               regulator-max-microvolt = <12000000>;
+               regulator-always-on;
+       };
+
+       vcc_5v: regulator-vcc_5v {
+               compatible = "regulator-fixed";
+               regulator-name = "5V";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               regulator-always-on;
+               vin-supply = <&main_12v>;
+               gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
+               enable-active-high;
+       };
+
+       vcc_1v8: regulator-vcc_1v8 {
+               compatible = "regulator-fixed";
+               regulator-name = "VCC_1V8";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               vin-supply = <&vcc_3v3>;
+               regulator-always-on;
+       };
+
+       vcc_3v3: regulator-vcc_3v3 {
+               compatible = "regulator-fixed";
+               regulator-name = "VCC_3V3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&vddao_3v3>;
+               regulator-always-on;
+               /* FIXME: actually controlled by VDDCPU_B_EN */
+       };
+
+       vddcpu: regulator-vddcpu {
+               /*
+                * MP8756GD Regulator.
+                */
+               compatible = "pwm-regulator";
+
+               regulator-name = "VDDCPU";
+               regulator-min-microvolt = <721000>;
+               regulator-max-microvolt = <1022000>;
+
+               vin-supply = <&main_12v>;
+
+               pwms = <&pwm_AO_cd 1 1250 0>;
+               pwm-dutycycle-range = <100 0>;
+
+               regulator-boot-on;
+               regulator-always-on;
+       };
+
+       usb_pwr_en: regulator-usb_pwr_en {
+               compatible = "regulator-fixed";
+               regulator-name = "USB_PWR_EN";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               vin-supply = <&vcc_5v>;
+
+               /* Connected to the microUSB port power enable */
+               gpio = <&gpio_ao GPIOAO_2 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 = <&main_12v>;
+               regulator-always-on;
+       };
+
+       hdmi-connector {
+               compatible = "hdmi-connector";
+               type = "a";
+
+               port {
+                       hdmi_connector_in: endpoint {
+                               remote-endpoint = <&hdmi_tx_tmds_out>;
+                       };
+               };
+       };
+
+       sound {
+               compatible = "amlogic,axg-sound-card";
+               audio-aux-devs = <&tdmout_b>;
+               audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
+                               "TDMOUT_B IN 1", "FRDDR_B OUT 1",
+                               "TDMOUT_B IN 2", "FRDDR_C OUT 1",
+                               "TDM_B Playback", "TDMOUT_B OUT";
+
+               assigned-clocks = <&clkc CLKID_MPLL2>,
+                                 <&clkc CLKID_MPLL0>,
+                                 <&clkc CLKID_MPLL1>;
+               assigned-clock-parents = <0>, <0>, <0>;
+               assigned-clock-rates = <294912000>,
+                                      <270950400>,
+                                      <393216000>;
+               status = "okay";
+
+               dai-link-0 {
+                       sound-dai = <&frddr_a>;
+               };
+
+               dai-link-1 {
+                       sound-dai = <&frddr_b>;
+               };
+
+               dai-link-2 {
+                       sound-dai = <&frddr_c>;
+               };
+
+               /* 8ch hdmi interface */
+               dai-link-3 {
+                       sound-dai = <&tdmif_b>;
+                       dai-format = "i2s";
+                       dai-tdm-slot-tx-mask-0 = <1 1>;
+                       dai-tdm-slot-tx-mask-1 = <1 1>;
+                       dai-tdm-slot-tx-mask-2 = <1 1>;
+                       dai-tdm-slot-tx-mask-3 = <1 1>;
+                       mclk-fs = <256>;
+
+                       codec {
+                               sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
+                       };
+               };
+
+               /* hdmi glue */
+               dai-link-4 {
+                       sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
+
+                       codec {
+                               sound-dai = <&hdmi_tx>;
+                       };
+               };
+       };
+};
+
+&arb {
+       status = "okay";
+};
+
+&clkc_audio {
+       status = "okay";
+};
+
+&cpu0 {
+       cpu-supply = <&vddcpu>;
+       operating-points-v2 = <&cpu_opp_table>;
+       clocks = <&clkc CLKID_CPU_CLK>;
+       clock-latency = <50000>;
+};
+
+&cpu1 {
+       cpu-supply = <&vddcpu>;
+       operating-points-v2 = <&cpu_opp_table>;
+       clocks = <&clkc CLKID_CPU1_CLK>;
+       clock-latency = <50000>;
+};
+
+&cpu2 {
+       cpu-supply = <&vddcpu>;
+       operating-points-v2 = <&cpu_opp_table>;
+       clocks = <&clkc CLKID_CPU2_CLK>;
+       clock-latency = <50000>;
+};
+
+&cpu3 {
+       cpu-supply = <&vddcpu>;
+       operating-points-v2 = <&cpu_opp_table>;
+       clocks = <&clkc CLKID_CPU3_CLK>;
+       clock-latency = <50000>;
+};
+
+&ext_mdio {
+       external_phy: ethernet-phy@0 {
+               /* Realtek RTL8211F (0x001cc916) */
+               reg = <0>;
+               max-speed = <1000>;
+
+               interrupt-parent = <&gpio_intc>;
+               /* MAC_INTR on GPIOZ_14 */
+               interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
+       };
+};
+
+&ethmac {
+       pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
+       pinctrl-names = "default";
+       status = "okay";
+       phy-mode = "rgmii";
+       phy-handle = <&external_phy>;
+       amlogic,tx-delay-ns = <2>;
+};
+
+&frddr_a {
+       status = "okay";
+};
+
+&frddr_b {
+       status = "okay";
+};
+
+&frddr_c {
+       status = "okay";
+};
+
+&gpio {
+       gpio-line-names =
+               /* GPIOZ */
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "",
+               /* GPIOH */
+               "", "", "", "", "",
+               "PIN_36", /* GPIOH_5 */
+               "PIN_26", /* GPIOH_6 */
+               "PIN_32", /* GPIOH_7 */
+               "",
+               /* BOOT */
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "",
+               /* GPIOC */
+               "", "", "", "", "", "", "", "",
+               /* GPIOA */
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "",
+               "PIN_27", /* GPIOA_14 */
+               "PIN_28", /* GPIOA_15 */
+               /* GPIOX */
+               "PIN_16", /* GPIOX_0 */
+               "PIN_18", /* GPIOX_1 */
+               "PIN_22", /* GPIOX_2 */
+               "PIN_11", /* GPIOX_3 */
+               "PIN_13", /* GPIOX_4 */
+               "PIN_7",  /* GPIOX_5 */
+               "PIN_33", /* GPIOX_6 */
+               "PIN_15", /* GPIOX_7 */
+               "PIN_19", /* GPIOX_8 */
+               "PIN_21", /* GPIOX_9 */
+               "PIN_24", /* GPIOX_10 */
+               "PIN_23", /* GPIOX_11 */
+               "PIN_8",  /* GPIOX_12 */
+               "PIN_10", /* GPIOX_13 */
+               "PIN_29", /* GPIOX_14 */
+               "PIN_31", /* GPIOX_15 */
+               "PIN_12", /* GPIOX_16 */
+               "PIN_3",  /* GPIOX_17 */
+               "PIN_5",  /* GPIOX_18 */
+               "PIN_35"; /* GPIOX_19 */
+};
+
+&gpio_ao {
+       gpio-line-names =
+               /* GPIOAO */
+               "", "", "", "",
+               "PIN_47", /* GPIOAO_4 */
+               "", "",
+               "PIN_45", /* GPIOAO_7 */
+               "PIN_46", /* GPIOAO_8 */
+               "PIN_44", /* GPIOAO_9 */
+               "PIN_42", /* GPIOAO_10 */
+               "",
+               /* GPIOE */
+               "", "", "";
+};
+
+&hdmi_tx {
+       status = "okay";
+       pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
+       pinctrl-names = "default";
+       hdmi-supply = <&vcc_5v>;
+};
+
+&hdmi_tx_tmds_port {
+       hdmi_tx_tmds_out: endpoint {
+               remote-endpoint = <&hdmi_connector_in>;
+       };
+};
+
+&ir {
+       status = "okay";
+       pinctrl-0 = <&remote_input_ao_pins>;
+       pinctrl-names = "default";
+};
+
+&pwm_AO_cd {
+       pinctrl-0 = <&pwm_ao_d_e_pins>;
+       pinctrl-names = "default";
+       clocks = <&xtal>;
+       clock-names = "clkin1";
+       status = "okay";
+};
+
+&saradc {
+       status = "okay";
+};
+
+/* SD card */
+&sd_emmc_b {
+       status = "okay";
+       pinctrl-0 = <&sdcard_c_pins>;
+       pinctrl-1 = <&sdcard_clk_gate_c_pins>;
+       pinctrl-names = "default", "clk-gate";
+
+       bus-width = <4>;
+       cap-sd-highspeed;
+       max-frequency = <200000000>;
+       sd-uhs-sdr12;
+       sd-uhs-sdr25;
+       sd-uhs-sdr50;
+       sd-uhs-sdr104;
+       disable-wp;
+
+       cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
+       vmmc-supply = <&tflash_vdd>;
+       vqmmc-supply = <&tf_io>;
+};
+
+/* 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;
+
+       mmc-pwrseq = <&emmc_pwrseq>;
+       vmmc-supply = <&vcc_3v3>;
+       vqmmc-supply = <&flash_1v8>;
+};
+
+&tdmif_b {
+       status = "okay";
+};
+
+&tdmout_b {
+       status = "okay";
+};
+
+&tohdmitx {
+       status = "okay";
+};
+
+&uart_AO {
+       status = "okay";
+       pinctrl-0 = <&uart_ao_a_pins>;
+       pinctrl-names = "default";
+};
+
+&usb {
+       status = "okay";
+       vbus-supply = <&usb_pwr_en>;
+};
+
+&usb2_phy0 {
+       phy-supply = <&vcc_5v>;
+};
+
index 5ab139a34c0186dd522b063000ef7f90e315a9c5..2194a778973f16b4e68e965cd60f8df0e204175d 100644 (file)
                };
        };
 
-       leds {
+       led-controller-1 {
                compatible = "gpio-leds";
 
-               led-bluetooth {
+               led-1 {
                        label = "sei610:blue:bt";
                        gpios = <&gpio GPIOC_7 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
                        default-state = "off";
                };
        };
 
-       pwmleds {
+       led-controller-2 {
                compatible = "pwm-leds";
 
-               power {
+               led-2 {
                        label = "sei610:red:power";
                        pwms = <&pwm_AO_ab 0 30518 0>;
                        max-brightness = <255>;
 
        sound {
                compatible = "amlogic,axg-sound-card";
-               model = "SM1-SEI610";
+               model = "SEI610";
                audio-aux-devs = <&tdmout_a>, <&tdmout_b>,
                                 <&tdmin_a>, <&tdmin_b>;
                audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 0",
index 71317f5aada1d7da57f9f24625fd4122eb004c0f..3d8b1f4f2001b2e92c0a4ea1c73a3b789443fc51 100644 (file)
                        opp-microvolt = <790000>;
                };
 
-               opp-1512000000 {
+               opp-1500000000 {
                        opp-hz = /bits/ 64 <1500000000>;
                        opp-microvolt = <800000>;
                };
                        status = "disabled";
                };
 
+               toacodec: audio-controller@740 {
+                       compatible = "amlogic,sm1-toacodec",
+                                    "amlogic,g12a-toacodec";
+                       reg = <0x0 0x740 0x0 0x4>;
+                       #sound-dai-cells = <1>;
+                       sound-name-prefix = "TOACODEC";
+                       resets = <&clkc_audio AUD_RESET_TOACODEC>;
+                       status = "disabled";
+               };
+
                tohdmitx: audio-controller@744 {
                        compatible = "amlogic,sm1-tohdmitx",
                                     "amlogic,g12a-tohdmitx";
index fd1f938c38d191b9c56fcc9004a981936a69c476..93752ea107e3ef294be98d792428948e1e9889b0 100644 (file)
 #define CLKID_HIFI_PLL                         69
 #define CLKID_PCIE_CML_EN0                     79
 #define CLKID_PCIE_CML_EN1                     80
-#define CLKID_MIPI_ENABLE                      81
 #define CLKID_GEN_CLK                          84
+#define CLKID_VPU_0_SEL                                92
+#define CLKID_VPU_0                            93
+#define CLKID_VPU_1_SEL                                95
+#define CLKID_VPU_1                            96
+#define CLKID_VPU                              97
+#define CLKID_VAPB_0_SEL                       99
+#define CLKID_VAPB_0                           100
+#define CLKID_VAPB_1_SEL                       102
+#define CLKID_VAPB_1                           103
+#define CLKID_VAPB_SEL                         104
+#define CLKID_VAPB                             105
+#define CLKID_VCLK                             106
+#define CLKID_VCLK2                            107
+#define CLKID_VCLK_DIV1                                122
+#define CLKID_VCLK_DIV2                                123
+#define CLKID_VCLK_DIV4                                124
+#define CLKID_VCLK_DIV6                                125
+#define CLKID_VCLK_DIV12                       126
+#define CLKID_VCLK2_DIV1                       127
+#define CLKID_VCLK2_DIV2                       128
+#define CLKID_VCLK2_DIV4                       129
+#define CLKID_VCLK2_DIV6                       130
+#define CLKID_VCLK2_DIV12                      131
+#define CLKID_CTS_ENCL                         133
+#define CLKID_VDIN_MEAS                                136
 
 #endif /* __AXG_CLKC_H */
index 40d49940d8a8dfb1b55aa9a56b8d674ac16d1a30..a93b58c5e18ecdb86a0098cf37485fa62df7933a 100644 (file)
 #define CLKID_SPICC1_SCLK                      261
 #define CLKID_NNA_AXI_CLK                      264
 #define CLKID_NNA_CORE_CLK                     267
+#define CLKID_MIPI_DSI_PXCLK_SEL               269
+#define CLKID_MIPI_DSI_PXCLK                   270
 
 #endif /* __G12A_CLKC_H */