Merge tag 'sunxi-dt-for-5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi...
authorArnd Bergmann <arnd@arndb.de>
Wed, 25 Mar 2020 20:42:02 +0000 (21:42 +0100)
committerArnd Bergmann <arnd@arndb.de>
Wed, 25 Mar 2020 20:42:03 +0000 (21:42 +0100)
Allwinner Device Tree Changes for v5.7

A fairly large set of changes for v5.7, including some new devices.

SoC specific changes:

  - SPI on H6 SoC enabled
  - Thermal sensor on R40 SoC enabled
  - Deinterlace core hardware on A64 SoC enabled
  - Redundant assigned-clocks properties removed
    - required clock rates are now enforced by drivers
  - LVDS panel support on A20 SoC enabled
  - PMU compatible fixed for H5 and H6 SoCs
  - Thermal trip points added for A83T and H5 SoCs
  - (Image) Rotation core hardware on A83T and A64 SoCs enabled

Device specific changes:

  - Pine64 PineTab and PinePhone added
  - Various cleanups and improvements for Pine64 PineBook
  - GPIO pin bank regulator supplies added for A64-OlinXino
  - eMMC enabled on Orange Pi 3
  - PocketBook Touch Lux 3 added
  - Linutronix Testbox v2 added
  - Ethernet enabled on Orange Pi One Plus
  - HDMI enabled on H6-based Orange Pi boards

* tag 'sunxi-dt-for-5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: (46 commits)
  arm64: dts: allwinner: a64: add node for rotation core
  ARM: dts: sun8i: a83t: Add device node for rotation core
  arm64: dts: allwinner: a64: Fix display clock register range
  ARM: dts: sunxi: Fix DE2 clocks register range
  arm64: dts: allwinner: h6: orangepi: Enable HDMI
  arm64: dts: allwinner: h6: orangepi-one-plus: Enable ethernet
  arm64: dts: allwinner: h6: Move ext. oscillator to board DTs
  arm64: dts: allwinner: Add initial support for Pine64 PinePhone
  dt-bindings: arm: sunxi: Add PinePhone 1.0 and 1.1 bindings
  arm64: dts: sun50i-a64: Add i2c2 pins
  ARM: dts: sunxi: h3/h5: add r_pwm node
  arm64: allwinner: a64: enable LCD-related hardware for Pinebook
  ARM: dts: sun8i-a83t: Add thermal trip points/cooling maps
  ARM: dts: sun8i-h3: Add thermal trip points/cooling maps
  arm64: dts: allwinner: h6: Fix PMU compatible
  arm64: dts: allwinner: h5: Fix PMU compatible
  ARM: dts: sun8i-a83t-tbs-a711: Drop superfluous dr_mode
  arm64: dts: sun50i-h5-orange-pi-pc2: Add CPUX voltage regulator
  ARM: dts: sun5i: Add PocketBook Touch Lux 3 support
  dt-bindings: arm: sunxi: Add PocketBook Touch Lux 3
  ...

Link: https://lore.kernel.org/r/20200313055459.GA19820@wens.csie.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
34 files changed:
Documentation/devicetree/bindings/arm/sunxi.yaml
Documentation/devicetree/bindings/arm/sunxi/allwinner,sun4i-a10-mbus.yaml
Documentation/devicetree/bindings/media/allwinner,sun8i-h3-deinterlace.yaml
Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml
arch/arm/boot/dts/Makefile
arch/arm/boot/dts/sun5i-a13-pocketbook-touch-lux-3.dts [new file with mode: 0644]
arch/arm/boot/dts/sun5i.dtsi
arch/arm/boot/dts/sun6i-a31.dtsi
arch/arm/boot/dts/sun7i-a20-linutronix-testbox-v2.dts [new file with mode: 0644]
arch/arm/boot/dts/sun7i-a20.dtsi
arch/arm/boot/dts/sun8i-a23-a33.dtsi
arch/arm/boot/dts/sun8i-a33.dtsi
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
arch/arm/boot/dts/sun8i-a83t.dtsi
arch/arm/boot/dts/sun8i-h3.dtsi
arch/arm/boot/dts/sun8i-r40.dtsi
arch/arm/boot/dts/sun8i-v3s.dtsi
arch/arm/boot/dts/sunxi-h3-h5.dtsi
arch/arm64/boot/dts/allwinner/Makefile
arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts [new file with mode: 0644]
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts [new file with mode: 0644]
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts [new file with mode: 0644]
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi
arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi
arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi

index 327ce67..abf2d97 100644 (file)
@@ -394,6 +394,12 @@ properties:
           - const: linksprite,pcduino3-nano
           - const: allwinner,sun7i-a20
 
+      - description: Linutronix Testbox v2
+        items:
+          - const: linutronix,testbox-v2
+          - const: lamobo,lamobo-r1
+          - const: allwinner,sun7i-a20
+
       - description: HAOYU Electronics Marsboard A10
         items:
           - const: haoyu,a10-marsboard
@@ -636,6 +642,21 @@ properties:
           - const: pine64,pinebook
           - const: allwinner,sun50i-a64
 
+      - description: Pine64 PinePhone Developer Batch (1.0)
+        items:
+          - const: pine64,pinephone-1.0
+          - const: allwinner,sun50i-a64
+
+      - description: Pine64 PinePhone Braveheart (1.1)
+        items:
+          - const: pine64,pinephone-1.1
+          - const: allwinner,sun50i-a64
+
+      - description: Pine64 PineTab
+        items:
+          - const: pine64,pinetab
+          - const: allwinner,sun50i-a64
+
       - description: Pine64 SoPine Baseboard
         items:
           - const: pine64,sopine-baseboard
@@ -647,6 +668,11 @@ properties:
           - const: pineriver,mini-xplus
           - const: allwinner,sun4i-a10
 
+      - description: PocketBook Touch Lux 3
+        items:
+          - const: pocketbook,touch-lux-3
+          - const: allwinner,sun5i-a13
+
       - description: Point of View Protab2-IPS9
         items:
           - const: pov,protab2-ips9
index 9370e64..aa0738b 100644 (file)
@@ -30,6 +30,7 @@ properties:
     enum:
       - allwinner,sun5i-a13-mbus
       - allwinner,sun8i-h3-mbus
+      - allwinner,sun50i-a64-mbus
 
   reg:
     maxItems: 1
index 2e40f70..8707df6 100644 (file)
@@ -17,7 +17,11 @@ description: |-
 
 properties:
   compatible:
-    const: allwinner,sun8i-h3-deinterlace
+    oneOf:
+      - const: allwinner,sun8i-h3-deinterlace
+      - items:
+        - const: allwinner,sun50i-a64-deinterlace
+        - const: allwinner,sun8i-h3-deinterlace
 
   reg:
     maxItems: 1
index 0565dc4..243a6b1 100644 (file)
@@ -18,9 +18,14 @@ properties:
   "#size-cells": true
 
   compatible:
-    enum:
-      - allwinner,sun6i-a31-spi
-      - allwinner,sun8i-h3-spi
+    oneOf:
+      - const: allwinner,sun6i-a31-spi
+      - const: allwinner,sun8i-h3-spi
+      - items:
+        - enum:
+          - allwinner,sun8i-r40-spi
+          - allwinner,sun50i-h6-spi
+        - const: allwinner,sun8i-h3-spi
 
   reg:
     maxItems: 1
index d6546d2..78f144e 100644 (file)
@@ -1056,6 +1056,7 @@ dtb-$(CONFIG_MACH_SUN5I) += \
        sun5i-a13-licheepi-one.dtb \
        sun5i-a13-olinuxino.dtb \
        sun5i-a13-olinuxino-micro.dtb \
+       sun5i-a13-pocketbook-touch-lux-3.dtb \
        sun5i-a13-q8-tablet.dtb \
        sun5i-a13-utoo-p66.dtb \
        sun5i-gr8-chip-pro.dtb \
@@ -1086,6 +1087,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
        sun7i-a20-i12-tvbox.dtb \
        sun7i-a20-icnova-swac.dtb \
        sun7i-a20-lamobo-r1.dtb \
+       sun7i-a20-linutronix-testbox-v2.dtb \
        sun7i-a20-m3.dtb \
        sun7i-a20-mk808c.dtb \
        sun7i-a20-olimex-som-evb.dtb \
diff --git a/arch/arm/boot/dts/sun5i-a13-pocketbook-touch-lux-3.dts b/arch/arm/boot/dts/sun5i-a13-pocketbook-touch-lux-3.dts
new file mode 100644 (file)
index 0000000..e9ef97c
--- /dev/null
@@ -0,0 +1,257 @@
+// SPDX-License-Identifier: GPL-2.0 OR MIT
+/*
+ * Copyright 2019 Ondrej Jirman <megous@megous.com>
+ */
+
+/dts-v1/;
+#include "sun5i-a13.dtsi"
+#include "sunxi-common-regulators.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/pwm/pwm.h>
+
+/ {
+       model = "PocketBook Touch Lux 3";
+       compatible = "pocketbook,touch-lux-3", "allwinner,sun5i-a13";
+
+       aliases {
+               serial0 = &uart1;
+               i2c0 = &i2c0;
+               i2c1 = &i2c1;
+               i2c2 = &i2c2;
+       };
+
+       backlight {
+               compatible = "pwm-backlight";
+               pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
+               enable-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */
+               brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
+               default-brightness-level = <8>;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               power {
+                       gpios = <&pio 4 8 GPIO_ACTIVE_LOW>; /* PE8 */
+                       default-state = "on";
+               };
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               autorepeat;
+               label = "GPIO Keys";
+
+               key-right {
+                       label = "Right";
+                       linux,code = <KEY_RIGHT>;
+                       gpios = <&pio 6 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PG9 */
+               };
+
+               key-left {
+                       label = "Left";
+                       linux,code = <KEY_LEFT>;
+                       gpios = <&pio 6 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PG10 */
+               };
+       };
+
+       reg_1v8: regulator-1v8 {
+               compatible = "regulator-fixed";
+               regulator-name = "vdd-1v8-nor-ctp";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               gpio = <&pio 2 15 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+       };
+
+       reg_1v8_nor: regulator-nor {
+               compatible = "regulator-fixed";
+               regulator-name = "vdd-nor";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               gpio = <&pio 2 14 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               vin-supply = <&reg_1v8>;
+               regulator-always-on;
+       };
+
+       reg_1v8_ctp: regulator-ctp {
+               compatible = "regulator-fixed";
+               regulator-name = "vdd-ctp";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               gpio = <&pio 2 13 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               vin-supply = <&reg_1v8>;
+       };
+
+       reg_3v3_mmc0: regulator-mmc0 {
+               compatible = "regulator-fixed";
+               regulator-name = "vdd-mmc0";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               gpio = <&pio 4 4 GPIO_ACTIVE_LOW>; /* PE4 */
+               vin-supply = <&reg_vcc3v3>;
+       };
+};
+
+&cpu0 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&i2c0 {
+       status = "okay";
+
+       axp209: pmic@34 {
+               reg = <0x34>;
+               interrupts = <0>;
+       };
+};
+
+#include "axp209.dtsi"
+
+&i2c1 {
+       status = "okay";
+
+       pcf8563: rtc@51 {
+               compatible = "nxp,pcf8563";
+               reg = <0x51>;
+       };
+};
+
+&i2c2 {
+       status = "okay";
+
+       /* Touchpanel is connected here. */
+};
+
+&lradc {
+       vref-supply = <&reg_ldo2>;
+       status = "okay";
+
+       button-200 {
+               label = "Home";
+               linux,code = <KEY_HOME>;
+               channel = <0>;
+               voltage = <200000>;
+       };
+
+       button-400 {
+               label = "Menu";
+               linux,code = <KEY_MENU>;
+               channel = <0>;
+               voltage = <400000>;
+       };
+};
+
+&mmc0 {
+       vmmc-supply = <&reg_3v3_mmc0>;
+       bus-width = <4>;
+       cd-gpios = <&pio 6 0 GPIO_ACTIVE_LOW>; /* PG0 */
+       status = "okay";
+};
+
+&mmc2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc2_4bit_pc_pins>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       non-removable;
+       status = "okay";
+};
+
+&ohci0 {
+       status = "okay";
+};
+
+&otg_sram {
+       status = "okay";
+};
+
+&pwm {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pwm0_pin>;
+       status = "okay";
+};
+
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc3 {
+       regulator-always-on;
+       regulator-min-microvolt = <1200000>;
+       regulator-max-microvolt = <1200000>;
+       regulator-name = "vdd-int-pll";
+};
+
+&reg_ldo1 {
+       regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "avcc";
+};
+
+&reg_ldo3 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-wifi";
+       /* We need this otherwise the LDO3 would overload */
+       regulator-soft-start;
+       regulator-ramp-delay = <1600>;
+};
+
+&spi2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi2_pe_pins>, <&spi2_cs0_pe_pin>;
+       status = "okay";
+
+       epd_flash: flash@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "macronix,mx25u4033", "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <4000000>;
+       };
+};
+
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_pg_pins>;
+       status = "okay";
+};
+
+&usb_otg {
+       dr_mode = "peripheral";
+       status = "okay";
+};
+
+&battery_power_supply {
+       status = "okay";
+};
+
+&usb_power_supply {
+       status = "okay";
+};
+
+&usbphy {
+       usb1_vbus-supply = <&reg_ldo3>;
+       status = "okay";
+};
index 0b526e6..7f5cf02 100644 (file)
                        interconnect-names = "dma-mem";
                        status = "disabled";
 
-                       assigned-clocks = <&ccu CLK_DE_BE>;
-                       assigned-clock-rates = <300000000>;
-
                        ports {
                                #address-cells = <1>;
                                #size-cells = <0>;
index 7762fbd..f3425a6 100644 (file)
                                      "ram";
                        resets = <&ccu RST_AHB1_BE1>;
 
-                       assigned-clocks = <&ccu CLK_BE1>;
-                       assigned-clock-rates = <300000000>;
-
                        ports {
                                #address-cells = <1>;
                                #size-cells = <0>;
                                      "ram";
                        resets = <&ccu RST_AHB1_DRC1>;
 
-                       assigned-clocks = <&ccu CLK_IEP_DRC1>;
-                       assigned-clock-rates = <300000000>;
-
                        ports {
                                #address-cells = <1>;
                                #size-cells = <0>;
                                      "ram";
                        resets = <&ccu RST_AHB1_BE0>;
 
-                       assigned-clocks = <&ccu CLK_BE0>;
-                       assigned-clock-rates = <300000000>;
-
                        ports {
                                #address-cells = <1>;
                                #size-cells = <0>;
                                      "ram";
                        resets = <&ccu RST_AHB1_DRC0>;
 
-                       assigned-clocks = <&ccu CLK_IEP_DRC0>;
-                       assigned-clock-rates = <300000000>;
-
                        ports {
                                #address-cells = <1>;
                                #size-cells = <0>;
diff --git a/arch/arm/boot/dts/sun7i-a20-linutronix-testbox-v2.dts b/arch/arm/boot/dts/sun7i-a20-linutronix-testbox-v2.dts
new file mode 100644 (file)
index 0000000..da5a2ee
--- /dev/null
@@ -0,0 +1,47 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright 2020 Linutronix GmbH
+ * Author: Benedikt Spranger <b.spranger@linutronix.de>
+ */
+
+/dts-v1/;
+#include "sun7i-a20-lamobo-r1.dts"
+
+/ {
+       model = "Lamobo R1";
+       compatible = "linutronix,testbox-v2", "lamobo,lamobo-r1", "allwinner,sun7i-a20";
+
+       leds {
+               led-opto1 {
+                       label = "lamobo_r1:opto:powerswitch";
+                       gpios = <&pio 7 3 GPIO_ACTIVE_HIGH>;
+               };
+
+               led-opto2 {
+                       label = "lamobo_r1:opto:relay";
+                       gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>;
+               };
+       };
+};
+
+&i2c2 {
+       clock-frequency = <100000>;
+       status = "okay";
+
+       eeprom: eeprom@50 {
+               compatible = "atmel,24c08";
+               reg = <0x50>;
+               status = "okay";
+       };
+
+       atecc508a@60 {
+               compatible = "atmel,atecc508a";
+               reg = <0x60>;
+       };
+};
+
+&can0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&can_ph_pins>;
+       status = "okay";
+};
index 92b5be9..ffe1d10 100644 (file)
@@ -47,6 +47,7 @@
 #include <dt-bindings/dma/sun4i-a10.h>
 #include <dt-bindings/clock/sun7i-a20-ccu.h>
 #include <dt-bindings/reset/sun4i-a10-ccu.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
        interrupt-parent = <&gic>;
                };
 
                tcon0: lcd-controller@1c0c000 {
-                       compatible = "allwinner,sun7i-a20-tcon";
+                       compatible = "allwinner,sun7i-a20-tcon0",
+                                    "allwinner,sun7i-a20-tcon";
                        reg = <0x01c0c000 0x1000>;
                        interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
-                       resets = <&ccu RST_TCON0>;
-                       reset-names = "lcd";
+                       resets = <&ccu RST_TCON0>, <&ccu RST_LVDS>;
+                       reset-names = "lcd", "lvds";
                        clocks = <&ccu CLK_AHB_LCD0>,
                                 <&ccu CLK_TCON0_CH0>,
                                 <&ccu CLK_TCON0_CH1>;
                };
 
                tcon1: lcd-controller@1c0d000 {
-                       compatible = "allwinner,sun7i-a20-tcon";
+                       compatible = "allwinner,sun7i-a20-tcon1",
+                                    "allwinner,sun7i-a20-tcon";
                        reg = <0x01c0d000 0x1000>;
                        interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
                        resets = <&ccu RST_TCON1>;
                                function = "ir1";
                        };
 
+                       /omit-if-no-ref/
+                       lcd_lvds0_pins: lcd-lvds0-pins {
+                               pins = "PD0", "PD1", "PD2", "PD3", "PD4",
+                                      "PD5", "PD6", "PD7", "PD8", "PD9";
+                               function = "lvds0";
+                       };
+
+                       /omit-if-no-ref/
+                       lcd_lvds1_pins: lcd-lvds1-pins {
+                               pins = "PD10", "PD11", "PD12", "PD13", "PD14",
+                                      "PD15", "PD16", "PD17", "PD18", "PD19";
+                               function = "lvds1";
+                       };
+
                        /omit-if-no-ref/
                        mmc0_pins: mmc0-pins {
                                pins = "PF0", "PF1", "PF2",
index 48487f6..c1362d0 100644 (file)
                        clock-names = "ahb", "mod", "ram";
                        resets = <&ccu RST_BUS_DRC>;
 
-                       assigned-clocks = <&ccu CLK_DRC>;
-                       assigned-clock-rates = <300000000>;
-
                        ports {
                                #address-cells = <1>;
                                #size-cells = <0>;
index 1532a0e..d80c8a6 100644 (file)
                      "ram", "sat";
        resets = <&ccu RST_BUS_DE_BE>, <&ccu RST_BUS_SAT>;
        reset-names = "be", "sat";
-       assigned-clocks = <&ccu CLK_DE_BE>;
-       assigned-clock-rates = <300000000>;
 };
 
 &ccu {
index 2fd31a0..4ab4568 100644 (file)
 };
 
 &usb_otg {
-       dr_mode = "otg";
        status = "okay";
 };
 
index 74ac7ee..ff29458 100644 (file)
@@ -72,7 +72,7 @@
                        #cooling-cells = <2>;
                };
 
-               cpu@1 {
+               cpu1: cpu@1 {
                        compatible = "arm,cortex-a7";
                        device_type = "cpu";
                        clocks = <&ccu CLK_C0CPUX>;
@@ -83,7 +83,7 @@
                        #cooling-cells = <2>;
                };
 
-               cpu@2 {
+               cpu2: cpu@2 {
                        compatible = "arm,cortex-a7";
                        device_type = "cpu";
                        clocks = <&ccu CLK_C0CPUX>;
@@ -94,7 +94,7 @@
                        #cooling-cells = <2>;
                };
 
-               cpu@3 {
+               cpu3: cpu@3 {
                        compatible = "arm,cortex-a7";
                        device_type = "cpu";
                        clocks = <&ccu CLK_C0CPUX>;
                        #cooling-cells = <2>;
                };
 
-               cpu@101 {
+               cpu101: cpu@101 {
                        compatible = "arm,cortex-a7";
                        device_type = "cpu";
                        clocks = <&ccu CLK_C1CPUX>;
                        #cooling-cells = <2>;
                };
 
-               cpu@102 {
+               cpu102: cpu@102 {
                        compatible = "arm,cortex-a7";
                        device_type = "cpu";
                        clocks = <&ccu CLK_C1CPUX>;
                        #cooling-cells = <2>;
                };
 
-               cpu@103 {
+               cpu103: cpu@103 {
                        compatible = "arm,cortex-a7";
                        device_type = "cpu";
                        clocks = <&ccu CLK_C1CPUX>;
 
                display_clocks: clock@1000000 {
                        compatible = "allwinner,sun8i-a83t-de2-clk";
-                       reg = <0x01000000 0x100000>;
+                       reg = <0x01000000 0x10000>;
                        clocks = <&ccu CLK_BUS_DE>,
                                 <&ccu CLK_PLL_DE>;
                        clock-names = "bus",
                        #reset-cells = <1>;
                };
 
+               rotate: rotate@1020000 {
+                       compatible = "allwinner,sun8i-a83t-de2-rotate";
+                       reg = <0x1020000 0x10000>;
+                       interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&display_clocks CLK_BUS_ROT>,
+                                <&display_clocks CLK_ROT>;
+                       clock-names = "bus",
+                                     "mod";
+                       resets = <&display_clocks RST_ROT>;
+               };
+
                mixer0: mixer@1100000 {
                        compatible = "allwinner,sun8i-a83t-de2-mixer-0";
                        reg = <0x01100000 0x100000>;
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&ths 0>;
+
+                       trips {
+                               cpu0_hot: cpu-hot {
+                                       temperature = <80000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu0_very_hot: cpu-very-hot {
+                                       temperature = <100000>;
+                                       hysteresis = <0>;
+                                       type = "critical";
+                               };
+                       };
+
+                       cooling-maps {
+                               cpu-hot-limit {
+                                       trip = <&cpu0_hot>;
+                                       cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                                        <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                                        <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                                        <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
                };
 
                cpu1_thermal: cpu1-thermal {
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&ths 1>;
+
+                       trips {
+                               cpu1_hot: cpu-hot {
+                                       temperature = <80000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu1_very_hot: cpu-very-hot {
+                                       temperature = <100000>;
+                                       hysteresis = <0>;
+                                       type = "critical";
+                               };
+                       };
+
+                       cooling-maps {
+                               cpu-hot-limit {
+                                       trip = <&cpu1_hot>;
+                                       cooling-device = <&cpu100 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                                        <&cpu101 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                                        <&cpu102 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                                        <&cpu103 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
                };
 
                gpu_thermal: gpu-thermal {
index 20217e2..e83aa68 100644 (file)
@@ -41,6 +41,7 @@
  */
 
 #include "sunxi-h3-h5.dtsi"
+#include <dt-bindings/thermal/thermal.h>
 
 / {
        cpu0_opp_table: opp_table0 {
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&ths 0>;
+
+                       trips {
+                               cpu_hot_trip: cpu-hot {
+                                       temperature = <80000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu_very_hot_trip: cpu-very-hot {
+                                       temperature = <100000>;
+                                       hysteresis = <0>;
+                                       type = "critical";
+                               };
+                       };
+
+                       cooling-maps {
+                               cpu-hot-limit {
+                                       trip = <&cpu_hot_trip>;
+                                       cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                                        <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                                        <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                                        <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
                };
        };
 };
index 8f09a24..b2dd00a 100644 (file)
@@ -47,6 +47,7 @@
 #include <dt-bindings/clock/sun8i-tcon-top.h>
 #include <dt-bindings/reset/sun8i-r40-ccu.h>
 #include <dt-bindings/reset/sun8i-de2.h>
+#include <dt-bindings/thermal/thermal.h>
 
 / {
        #address-cells = <1>;
                status = "disabled";
        };
 
+       thermal-zones {
+               cpu_thermal: cpu0-thermal {
+                       /* milliseconds */
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&ths 0>;
+               };
+
+               gpu_thermal: gpu-thermal {
+                       /* milliseconds */
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&ths 1>;
+               };
+       };
+
        soc {
                compatible = "simple-bus";
                #address-cells = <1>;
                display_clocks: clock@1000000 {
                        compatible = "allwinner,sun8i-r40-de2-clk",
                                     "allwinner,sun8i-h3-de2-clk";
-                       reg = <0x01000000 0x100000>;
+                       reg = <0x01000000 0x10000>;
                        clocks = <&ccu CLK_BUS_DE>,
                                 <&ccu CLK_DE>;
                        clock-names = "bus",
                        clocks = <&osc24M>;
                };
 
+               ths: thermal-sensor@1c24c00 {
+                       compatible = "allwinner,sun8i-r40-ths";
+                       reg = <0x01c24c00 0x100>;
+                       clocks = <&ccu CLK_BUS_THS>, <&ccu CLK_THS>;
+                       clock-names = "bus", "mod";
+                       interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
+                       resets = <&ccu RST_BUS_THS>;
+                       /* TODO: add nvmem-cells for calibration */
+                       #thermal-sensor-cells = <1>;
+               };
+
                uart0: serial@1c28000 {
                        compatible = "snps,dw-apb-uart";
                        reg = <0x01c28000 0x400>;
index 81ea508..e531286 100644 (file)
 
                display_clocks: clock@1000000 {
                        compatible = "allwinner,sun8i-v3s-de2-clk";
-                       reg = <0x01000000 0x100000>;
+                       reg = <0x01000000 0x10000>;
                        clocks = <&ccu CLK_BUS_DE>,
                                 <&ccu CLK_DE>;
                        clock-names = "bus",
index 5e9c306..d551601 100644 (file)
 
                display_clocks: clock@1000000 {
                        /* compatible is in per SoC .dtsi file */
-                       reg = <0x01000000 0x100000>;
+                       reg = <0x01000000 0x10000>;
                        clocks = <&ccu CLK_BUS_DE>,
                                 <&ccu CLK_DE>;
                        clock-names = "bus",
                                pins = "PL0", "PL1";
                                function = "s_i2c";
                        };
+
+                       r_pwm_pin: r-pwm-pin {
+                               pins = "PL10";
+                               function = "s_pwm";
+                       };
+               };
+
+               r_pwm: pwm@1f03800 {
+                       compatible = "allwinner,sun8i-h3-pwm";
+                       reg = <0x01f03800 0x8>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&r_pwm_pin>;
+                       clocks = <&osc24M>;
+                       #pwm-cells = <3>;
+                       status = "disabled";
                };
        };
 };
index cf4f786..e4d3cd0 100644 (file)
@@ -9,6 +9,9 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-orangepi-win.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-lts.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinebook.dtb
+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinephone-1.0.dtb
+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinephone-1.1.dtb
+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus.dtb
index 6dfafa1..5fa9ca0 100644 (file)
         */
 };
 
+&pio {
+       vcc-pa-supply = <&reg_dcdc1>;
+       vcc-pb-supply = <&reg_dcdc1>;
+       vcc-pc-supply = <&reg_dcdc1>;
+       vcc-pd-supply = <&reg_dcdc1>;
+       vcc-pe-supply = <&reg_aldo1>;
+       vcc-pf-supply = <&reg_dcdc1>;
+       vcc-pg-supply = <&reg_dldo4>;
+       vcc-ph-supply = <&reg_dcdc1>;
+};
+
 &r_rsb {
        status = "okay";
 
        };
 };
 
+/* VCC-PL is powered by aldo2 but we cannot add it as the RSB */
+/* interface used to talk to the PMIC in on the PL pins */
+/* &r_pio { */
+/*     vcc-pl-supply = <&reg_aldo2>; */
+/* }; */
+
 #include "axp803.dtsi"
 
 &ac_power_supply {
index 3d894b2..64b1c54 100644 (file)
                ethernet0 = &rtl8723cs;
        };
 
-       vdd_bl: regulator@0 {
-               compatible = "regulator-fixed";
-               regulator-name = "bl-3v3";
-               regulator-min-microvolt = <3300000>;
-               regulator-max-microvolt = <3300000>;
-               gpio = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
-               enable-active-high;
-       };
-
        backlight: backlight {
                compatible = "pwm-backlight";
                pwms = <&pwm 0 50000 0>;
                brightness-levels = <0 5 10 15 20 30 40 55 70 85 100>;
                default-brightness-level = <2>;
                enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */
-               power-supply = <&vdd_bl>;
+               power-supply = <&reg_vbklt>;
        };
 
        chosen {
                stdout-path = "serial0:115200n8";
-
-               framebuffer-lcd {
-                       panel-supply = <&reg_dc1sw>;
-                       dvdd25-supply = <&reg_dldo2>;
-                       dvdd12-supply = <&reg_fldo1>;
-               };
        };
 
        gpio_keys {
                };
        };
 
-       reg_vcc3v3: vcc3v3 {
+       panel_edp: panel-edp {
+               compatible = "neweast,wjfh116008a";
+               backlight = <&backlight>;
+               power-supply = <&reg_dc1sw>;
+
+               port {
+                       panel_edp_in: endpoint {
+                               remote-endpoint = <&anx6345_out_edp>;
+                       };
+               };
+       };
+
+       reg_vbklt: vbklt {
+               compatible = "regulator-fixed";
+               regulator-name = "vbklt";
+               regulator-min-microvolt = <18000000>;
+               regulator-max-microvolt = <18000000>;
+               gpio = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
+               enable-active-high;
+       };
+
+       reg_vcc5v0: vcc5v0 {
                compatible = "regulator-fixed";
-               regulator-name = "vcc3v3";
-               regulator-min-microvolt = <3300000>;
-               regulator-max-microvolt = <3300000>;
+               regulator-name = "vcc5v0";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               gpio = <&axp_gpio 0 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
        };
 
        wifi_pwrseq: wifi_pwrseq {
 
        speaker_amp: audio-amplifier {
                compatible = "simple-audio-amplifier";
-               /*
-                * TODO This is actually a fixed regulator controlled by
-                * the GPIO line on the PMIC. This should be corrected
-                * once GPIO support is added for this PMIC.
-                */
-               VCC-supply = <&reg_ldo_io0>;
+               VCC-supply = <&reg_vcc5v0>;
                enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
                sound-name-prefix = "Speaker Amp";
        };
        status = "okay";
 };
 
+&de {
+       status = "okay";
+};
+
 &ehci0 {
        phys = <&usbphy 0>;
        phy-names = "usb";
        status = "okay";
 };
 
+&mixer0 {
+       status = "okay";
+};
+
 &mmc0 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc0_pins>;
        vmmc-supply = <&reg_dcdc1>;
-       cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
+       cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
        disable-wp;
        bus-width = <4>;
        status = "okay";
        status = "okay";
 };
 
+&pio {
+       vcc-pc-supply = <&reg_eldo1>;
+       vcc-pd-supply = <&reg_dcdc1>;
+       vcc-pe-supply = <&reg_aldo1>;
+       vcc-pg-supply = <&reg_eldo1>;
+};
+
 &pwm {
        status = "okay";
 };
 
+&r_i2c {
+       clock-frequency = <100000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&r_i2c_pl89_pins>;
+       status = "okay";
+
+       anx6345: anx6345@38 {
+               compatible = "analogix,anx6345";
+               reg = <0x38>;
+               reset-gpios = <&pio 3 24 GPIO_ACTIVE_LOW>; /* PD24 */
+               dvdd25-supply = <&reg_dldo2>;
+               dvdd12-supply = <&reg_fldo1>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       anx6345_in: port@0 {
+                               reg = <0>;
+                               anx6345_in_tcon0: endpoint {
+                                       remote-endpoint = <&tcon0_out_anx6345>;
+                               };
+                       };
+
+                       anx6345_out: port@1 {
+                               reg = <1>;
+                               anx6345_out_edp: endpoint {
+                                       remote-endpoint = <&panel_edp_in>;
+                               };
+                       };
+               };
+       };
+};
+
+&r_pio {
+       /*
+        * FIXME: We can't add that supply for now since it would
+        * create a circular dependency between pinctrl, the regulator
+        * and the RSB Bus.
+        *
+        * vcc-pl-supply = <&reg_aldo2>;
+        */
+};
+
 &r_rsb {
        status = "okay";
 
        };
 };
 
-/* The ANX6345 eDP-bridge is on r_i2c */
-&r_i2c {
-       clock-frequency = <100000>;
-       pinctrl-names = "default";
-       pinctrl-0 = <&r_i2c_pl89_pins>;
-       status = "okay";
-};
-
 #include "axp803.dtsi"
 
 &ac_power_supply {
 };
 
 &reg_aldo1 {
-       regulator-min-microvolt = <2800000>;
-       regulator-max-microvolt = <2800000>;
-       regulator-name = "vcc-csi";
+       regulator-name = "vcc-pe";
 };
 
 &reg_aldo2 {
        regulator-name = "vcc-edp";
 };
 
-&reg_dldo3 {
-       regulator-min-microvolt = <3300000>;
-       regulator-max-microvolt = <3300000>;
-       regulator-name = "avdd-csi";
-};
-
 &reg_dldo4 {
        regulator-min-microvolt = <3300000>;
        regulator-max-microvolt = <3300000>;
        regulator-name = "cpvdd";
 };
 
-&reg_eldo3 {
-       regulator-min-microvolt = <1800000>;
-       regulator-max-microvolt = <1800000>;
-       regulator-name = "vdd-1v8-csi";
-};
-
 &reg_fldo1 {
        regulator-min-microvolt = <1200000>;
        regulator-max-microvolt = <1200000>;
        regulator-name = "vdd-cpus";
 };
 
-&reg_ldo_io0 {
-       regulator-min-microvolt = <3300000>;
-       regulator-max-microvolt = <3300000>;
-       regulator-name = "vcc-usb";
-       status = "okay";
-};
-
 &reg_rtc_ldo {
        regulator-name = "vcc-rtc";
 };
 
+&simplefb_lcd {
+       panel-supply = <&reg_dc1sw>;
+       dvdd25-supply = <&reg_dldo2>;
+       dvdd12-supply = <&reg_fldo1>;
+};
+
 &simplefb_hdmi {
        vcc-hdmi-supply = <&reg_dldo1>;
 };
                        "MIC2", "Internal Microphone Right";
 };
 
+&tcon0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&lcd_rgb666_pins>;
+
+       status = "okay";
+};
+
+&tcon0_out {
+       tcon0_out_anx6345: endpoint {
+               remote-endpoint = <&anx6345_in_tcon0>;
+       };
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_pb_pins>;
 };
 
 &usbphy {
-       usb0_vbus-supply = <&reg_ldo_io0>;
-       usb1_vbus-supply = <&reg_ldo_io0>;
+       usb0_vbus-supply = <&reg_vcc5v0>;
+       usb1_vbus-supply = <&reg_vcc5v0>;
        status = "okay";
 };
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts
new file mode 100644 (file)
index 0000000..0c42272
--- /dev/null
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+// Copyright (C) 2020 Ondrej Jirman <megous@megous.com>
+
+/dts-v1/;
+
+#include "sun50i-a64-pinephone.dtsi"
+
+/ {
+       model = "Pine64 PinePhone Developer Batch (1.0)";
+       compatible = "pine64,pinephone-1.0", "allwinner,sun50i-a64";
+};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
new file mode 100644 (file)
index 0000000..06a775c
--- /dev/null
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+// Copyright (C) 2020 Ondrej Jirman <megous@megous.com>
+
+/dts-v1/;
+
+#include "sun50i-a64-pinephone.dtsi"
+
+/ {
+       model = "Pine64 PinePhone Braveheart (1.1)";
+       compatible = "pine64,pinephone-1.1", "allwinner,sun50i-a64";
+};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
new file mode 100644 (file)
index 0000000..cefda14
--- /dev/null
@@ -0,0 +1,379 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+// Copyright (C) 2019 Icenowy Zheng <icenowy@aosc.xyz>
+// Copyright (C) 2020 Martijn Braam <martijn@brixit.nl>
+// Copyright (C) 2020 Ondrej Jirman <megous@megous.com>
+
+#include "sun50i-a64.dtsi"
+#include "sun50i-a64-cpu-opp.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/pwm/pwm.h>
+
+/ {
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               blue {
+                       function = LED_FUNCTION_INDICATOR;
+                       color = <LED_COLOR_ID_BLUE>;
+                       gpios = <&pio 3 20 GPIO_ACTIVE_HIGH>; /* PD20 */
+               };
+
+               green {
+                       function = LED_FUNCTION_INDICATOR;
+                       color = <LED_COLOR_ID_GREEN>;
+                       gpios = <&pio 3 18 GPIO_ACTIVE_HIGH>; /* PD18 */
+               };
+
+               red {
+                       function = LED_FUNCTION_INDICATOR;
+                       color = <LED_COLOR_ID_RED>;
+                       gpios = <&pio 3 19 GPIO_ACTIVE_HIGH>; /* PD19 */
+               };
+       };
+
+       speaker_amp: audio-amplifier {
+               compatible = "simple-audio-amplifier";
+               enable-gpios = <&pio 2 7 GPIO_ACTIVE_HIGH>; /* PC7 */
+               sound-name-prefix = "Speaker Amp";
+       };
+
+       vibrator {
+               compatible = "gpio-vibrator";
+               enable-gpios = <&pio 3 2 GPIO_ACTIVE_HIGH>; /* PD2 */
+               vcc-supply = <&reg_dcdc1>;
+       };
+};
+
+&codec {
+       status = "okay";
+};
+
+&codec_analog {
+       cpvdd-supply = <&reg_eldo1>;
+       status = "okay";
+};
+
+&cpu0 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
+&cpu1 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
+&cpu2 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
+&cpu3 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
+&dai {
+       status = "okay";
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&i2c1 {
+       status = "okay";
+
+       /* Magnetometer */
+       lis3mdl@1e {
+               compatible = "st,lis3mdl-magn";
+               reg = <0x1e>;
+               vdd-supply = <&reg_dldo1>;
+               vddio-supply = <&reg_dldo1>;
+       };
+
+       /* Accelerometer/gyroscope */
+       mpu6050@68 {
+               compatible = "invensense,mpu6050";
+               reg = <0x68>;
+               interrupt-parent = <&pio>;
+               interrupts = <7 5 IRQ_TYPE_EDGE_RISING>; /* PH5 */
+               vdd-supply = <&reg_dldo1>;
+               vddio-supply = <&reg_dldo1>;
+       };
+};
+
+/* Connected to pogo pins (external spring based pinheader for user addons) */
+&i2c2 {
+       status = "okay";
+};
+
+&lradc {
+       vref-supply = <&reg_aldo3>;
+       status = "okay";
+
+       button-200 {
+               label = "Volume Up";
+               linux,code = <KEY_VOLUMEUP>;
+               channel = <0>;
+               voltage = <200000>;
+       };
+
+       button-400 {
+               label = "Volume Down";
+               linux,code = <KEY_VOLUMEDOWN>;
+               channel = <0>;
+               voltage = <400000>;
+       };
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins>;
+       vmmc-supply = <&reg_dcdc1>;
+       vqmmc-supply = <&reg_dcdc1>;
+       cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
+       disable-wp;
+       bus-width = <4>;
+       status = "okay";
+};
+
+&mmc2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc2_pins>;
+       vmmc-supply = <&reg_dcdc1>;
+       vqmmc-supply = <&reg_dcdc1>;
+       bus-width = <8>;
+       non-removable;
+       cap-mmc-hw-reset;
+       status = "okay";
+};
+
+&ohci0 {
+       status = "okay";
+};
+
+&ohci1 {
+       status = "okay";
+};
+
+&pio {
+       vcc-pb-supply = <&reg_dcdc1>;
+       vcc-pc-supply = <&reg_dcdc1>;
+       vcc-pd-supply = <&reg_dcdc1>;
+       vcc-pe-supply = <&reg_aldo1>;
+       vcc-pf-supply = <&reg_dcdc1>;
+       vcc-pg-supply = <&reg_dldo4>;
+       vcc-ph-supply = <&reg_dcdc1>;
+};
+
+&r_pio {
+       /*
+        * FIXME: We can't add that supply for now since it would
+        * create a circular dependency between pinctrl, the regulator
+        * and the RSB Bus.
+        *
+        * vcc-pl-supply = <&reg_aldo2>;
+        */
+};
+
+&r_rsb {
+       status = "okay";
+
+       axp803: pmic@3a3 {
+               compatible = "x-powers,axp803";
+               reg = <0x3a3>;
+               interrupt-parent = <&r_intc>;
+               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+       };
+};
+
+#include "axp803.dtsi"
+
+&ac_power_supply {
+       status = "okay";
+};
+
+&battery_power_supply {
+       status = "okay";
+};
+
+&reg_aldo1 {
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <1800000>;
+       regulator-name = "dovdd-csi";
+};
+
+&reg_aldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <1800000>;
+       regulator-name = "vcc-pl";
+};
+
+&reg_aldo3 {
+       regulator-always-on;
+       regulator-min-microvolt = <2700000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-pll-avcc";
+};
+
+&reg_dcdc1 {
+       regulator-always-on;
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-3v3";
+};
+
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1300000>;
+       regulator-name = "vdd-cpux";
+};
+
+/* DCDC3 is polyphased with DCDC2 */
+
+&reg_dcdc5 {
+       regulator-always-on;
+       regulator-min-microvolt = <1200000>;
+       regulator-max-microvolt = <1200000>;
+       regulator-name = "vcc-dram";
+};
+
+&reg_dcdc6 {
+       regulator-always-on;
+       regulator-min-microvolt = <1100000>;
+       regulator-max-microvolt = <1100000>;
+       regulator-name = "vdd-sys";
+};
+
+&reg_dldo1 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-dsi-sensor";
+};
+
+&reg_dldo2 {
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <1800000>;
+       regulator-name = "vcc-mipi-io";
+};
+
+&reg_dldo3 {
+       regulator-min-microvolt = <2800000>;
+       regulator-max-microvolt = <2800000>;
+       regulator-name = "avdd-csi";
+};
+
+&reg_dldo4 {
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-wifi-io";
+};
+
+&reg_eldo1 {
+       regulator-always-on;
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <1800000>;
+       regulator-name = "vcc-lpddr";
+};
+
+&reg_eldo3 {
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <1800000>;
+       regulator-name = "dvdd-1v8-csi";
+};
+
+&reg_fldo1 {
+       regulator-min-microvolt = <1200000>;
+       regulator-max-microvolt = <1200000>;
+       regulator-name = "vcc-1v2-hsic";
+};
+
+&reg_fldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1100000>;
+       regulator-max-microvolt = <1100000>;
+       regulator-name = "vdd-cpus";
+};
+
+&reg_ldo_io0 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-lcd-ctp-stk";
+       status = "okay";
+};
+
+&reg_ldo_io1 {
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <1800000>;
+       regulator-name = "vcc-1v8-typec";
+       status = "okay";
+};
+
+&reg_rtc_ldo {
+       regulator-name = "vcc-rtc";
+};
+
+&sound {
+       status = "okay";
+       simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>;
+       simple-audio-card,widgets = "Microphone", "Headset Microphone",
+                                   "Microphone", "Internal Microphone",
+                                   "Headphone", "Headphone Jack",
+                                   "Speaker", "Internal Earpiece",
+                                   "Speaker", "Internal Speaker";
+       simple-audio-card,routing =
+                       "Headphone Jack", "HP",
+                       "Internal Earpiece", "EARPIECE",
+                       "Internal Speaker", "Speaker Amp OUTL",
+                       "Internal Speaker", "Speaker Amp OUTR",
+                       "Speaker Amp INL", "LINEOUT",
+                       "Speaker Amp INR", "LINEOUT",
+                       "Left DAC", "AIF1 Slot 0 Left",
+                       "Right DAC", "AIF1 Slot 0 Right",
+                       "AIF1 Slot 0 Left ADC", "Left ADC",
+                       "AIF1 Slot 0 Right ADC", "Right ADC",
+                       "Internal Microphone", "MBIAS",
+                       "MIC1", "Internal Microphone",
+                       "Headset Microphone", "HBIAS",
+                       "MIC2", "Headset Microphone";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pb_pins>;
+       status = "okay";
+};
+
+/* Connected to the modem (hardware flow control can't be used) */
+&uart3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart3_pins>;
+       status = "okay";
+};
+
+&usb_otg {
+       dr_mode = "peripheral";
+       status = "okay";
+};
+
+&usb_power_supply {
+       status = "okay";
+};
+
+&usbphy {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts
new file mode 100644 (file)
index 0000000..316e8a4
--- /dev/null
@@ -0,0 +1,460 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2019 Icenowy Zheng <icenowy@aosc.xyz>
+ *
+ */
+
+/dts-v1/;
+
+#include "sun50i-a64.dtsi"
+#include "sun50i-a64-cpu-opp.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/pwm/pwm.h>
+
+/ {
+       model = "PineTab";
+       compatible = "pine64,pinetab", "allwinner,sun50i-a64";
+
+       aliases {
+               serial0 = &uart0;
+               ethernet0 = &rtl8723cs;
+       };
+
+       backlight: backlight {
+               compatible = "pwm-backlight";
+               pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
+               brightness-levels = <0 16 18 20 22 24 26 29 32 35 38 42 46 51 56 62 68 75 83 91 100>;
+               default-brightness-level = <15>;
+               enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */
+               power-supply = <&vdd_bl>;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       i2c-csi {
+               compatible = "i2c-gpio";
+               sda-gpios = <&pio 4 13 GPIO_ACTIVE_HIGH>; /* PE13 */
+               scl-gpios = <&pio 4 12 GPIO_ACTIVE_HIGH>; /* PE12 */
+               i2c-gpio,delay-us = <5>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               /* Rear camera */
+               ov5640: camera@3c {
+                       compatible = "ovti,ov5640";
+                       reg = <0x3c>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&csi_mclk_pin>;
+                       clocks = <&ccu CLK_CSI_MCLK>;
+                       clock-names = "xclk";
+
+                       AVDD-supply = <&reg_dldo3>;
+                       DOVDD-supply = <&reg_aldo1>;
+                       DVDD-supply = <&reg_eldo3>;
+                       reset-gpios = <&pio 4 14 GPIO_ACTIVE_LOW>; /* PE14 */
+                       powerdown-gpios = <&pio 4 15 GPIO_ACTIVE_HIGH>; /* PE15 */
+
+                       port {
+                               ov5640_ep: endpoint {
+                                       remote-endpoint = <&csi_ep>;
+                                       bus-width = <8>;
+                                       hsync-active = <1>; /* Active high */
+                                       vsync-active = <0>; /* Active low */
+                                       data-active = <1>;  /* Active high */
+                                       pclk-sample = <1>;  /* Rising */
+                               };
+                       };
+               };
+       };
+
+       speaker_amp: audio-amplifier {
+               compatible = "simple-audio-amplifier";
+               enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
+               sound-name-prefix = "Speaker Amp";
+       };
+
+       vdd_bl: regulator@0 {
+               compatible = "regulator-fixed";
+               regulator-name = "bl-3v3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               gpio = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
+               enable-active-high;
+       };
+
+       wifi_pwrseq: wifi_pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
+               post-power-on-delay-ms = <200>;
+       };
+};
+
+&codec {
+       status = "okay";
+};
+
+&codec_analog {
+       hpvcc-supply = <&reg_eldo1>;
+       status = "okay";
+};
+
+&cpu0 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
+&cpu1 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
+&cpu2 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
+&cpu3 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
+&csi {
+       status = "okay";
+
+       port {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               csi_ep: endpoint {
+                       remote-endpoint = <&ov5640_ep>;
+                       bus-width = <8>;
+                       hsync-active = <1>; /* Active high */
+                       vsync-active = <0>; /* Active low */
+                       data-active = <1>;  /* Active high */
+                       pclk-sample = <1>;  /* Rising */
+               };
+       };
+};
+
+&dai {
+       status = "okay";
+};
+
+&de {
+       status = "okay";
+};
+
+&dphy {
+       status = "okay";
+};
+
+&dsi {
+       vcc-dsi-supply = <&reg_dldo1>;
+       status = "okay";
+
+       panel@0 {
+               compatible = "feixin,k101-im2ba02";
+               reg = <0>;
+               avdd-supply = <&reg_dc1sw>;
+               dvdd-supply = <&reg_dc1sw>;
+               cvdd-supply = <&reg_ldo_io1>;
+               reset-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */
+               backlight = <&backlight>;
+       };
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&i2c0 {
+       status = "okay";
+
+       touchscreen@5d {
+               compatible = "goodix,gt9271";
+               reg = <0x5d>;
+               interrupt-parent = <&pio>;
+               interrupts = <7 4 IRQ_TYPE_LEVEL_HIGH>; /* PH4 */
+               irq-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
+               reset-gpios = <&pio 7 8 GPIO_ACTIVE_HIGH>; /* PH8 */
+               AVDD28-supply = <&reg_ldo_io1>;
+       };
+};
+
+&i2c0_pins {
+       bias-pull-up;
+};
+
+&i2c1 {
+       status = "okay";
+
+       /* TODO: add Bochs BMA223 accelerometer here */
+};
+
+&lradc {
+       vref-supply = <&reg_aldo3>;
+       status = "okay";
+
+       button-200 {
+               label = "Volume Up";
+               linux,code = <KEY_VOLUMEUP>;
+               channel = <0>;
+               voltage = <200000>;
+       };
+
+       button-400 {
+               label = "Volume Down";
+               linux,code = <KEY_VOLUMEDOWN>;
+               channel = <0>;
+               voltage = <400000>;
+       };
+};
+
+&mixer1 {
+       status = "okay";
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins>;
+       vmmc-supply = <&reg_dcdc1>;
+       cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
+       disable-wp;
+       bus-width = <4>;
+       status = "okay";
+};
+
+&mmc1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc1_pins>;
+       vmmc-supply = <&reg_dldo4>;
+       vqmmc-supply = <&reg_eldo1>;
+       mmc-pwrseq = <&wifi_pwrseq>;
+       bus-width = <4>;
+       non-removable;
+       status = "okay";
+
+       rtl8723cs: wifi@1 {
+               reg = <1>;
+       };
+};
+
+&mmc2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc2_pins>;
+       vmmc-supply = <&reg_dcdc1>;
+       vqmmc-supply = <&reg_dcdc1>;
+       bus-width = <8>;
+       non-removable;
+       cap-mmc-hw-reset;
+       status = "okay";
+};
+
+&ohci0 {
+       status = "okay";
+};
+
+&pwm {
+       status = "okay";
+};
+
+&r_rsb {
+       status = "okay";
+
+       axp803: pmic@3a3 {
+               compatible = "x-powers,axp803";
+               reg = <0x3a3>;
+               interrupt-parent = <&r_intc>;
+               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+               x-powers,drive-vbus-en;
+       };
+};
+
+#include "axp803.dtsi"
+
+&ac_power_supply {
+       status = "okay";
+};
+
+&battery_power_supply {
+       status = "okay";
+};
+
+&reg_aldo1 {
+       regulator-min-microvolt = <2800000>;
+       regulator-max-microvolt = <2800000>;
+       regulator-name = "dovdd-csi";
+};
+
+&reg_aldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-pl";
+};
+
+&reg_aldo3 {
+       regulator-always-on;
+       regulator-min-microvolt = <2700000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-pll-avcc";
+};
+
+&reg_dc1sw {
+       regulator-name = "vcc-lcd";
+};
+
+&reg_dcdc1 {
+       regulator-always-on;
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-3v3";
+};
+
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1300000>;
+       regulator-name = "vdd-cpux";
+};
+
+/* DCDC3 is polyphased with DCDC2 */
+
+&reg_dcdc5 {
+       regulator-always-on;
+       regulator-min-microvolt = <1200000>;
+       regulator-max-microvolt = <1200000>;
+       regulator-name = "vcc-dram";
+};
+
+&reg_dcdc6 {
+       regulator-always-on;
+       regulator-min-microvolt = <1100000>;
+       regulator-max-microvolt = <1100000>;
+       regulator-name = "vdd-sys";
+};
+
+&reg_dldo1 {
+       regulator-always-on;
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-hdmi-dsi-sensor";
+};
+
+&reg_dldo3 {
+       regulator-min-microvolt = <2800000>;
+       regulator-max-microvolt = <2800000>;
+       regulator-name = "avdd-csi";
+};
+
+&reg_dldo4 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-wifi";
+};
+
+&reg_drivevbus {
+       regulator-name = "usb0-vbus";
+       status = "okay";
+};
+
+&reg_eldo1 {
+       regulator-always-on;
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <1800000>;
+       regulator-name = "cpvdd";
+};
+
+&reg_eldo2 {
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <1800000>;
+       regulator-name = "vcca-1v8";
+};
+
+&reg_eldo3 {
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <1800000>;
+       regulator-name = "dvdd-1v8-csi";
+};
+
+&reg_fldo1 {
+       regulator-min-microvolt = <1200000>;
+       regulator-max-microvolt = <1200000>;
+       regulator-name = "vcc-1v2-hsic";
+};
+
+&reg_fldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1100000>;
+       regulator-max-microvolt = <1100000>;
+       regulator-name = "vdd-cpus";
+};
+
+&reg_ldo_io0 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-usb";
+       status = "okay";
+};
+
+&reg_ldo_io1 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-enable-ramp-delay = <3500000>;
+       regulator-name = "vcc-touchscreen";
+       status = "okay";
+};
+
+&reg_rtc_ldo {
+       regulator-name = "vcc-rtc";
+};
+
+&sound {
+       status = "okay";
+       simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>;
+       simple-audio-card,widgets = "Microphone", "Internal Microphone Left",
+                                   "Microphone", "Internal Microphone Right",
+                                   "Headphone", "Headphone Jack",
+                                   "Speaker", "Internal Speaker";
+       simple-audio-card,routing =
+                       "Left DAC", "AIF1 Slot 0 Left",
+                       "Right DAC", "AIF1 Slot 0 Right",
+                       "Speaker Amp INL", "LINEOUT",
+                       "Speaker Amp INR", "LINEOUT",
+                       "Internal Speaker", "Speaker Amp OUTL",
+                       "Internal Speaker", "Speaker Amp OUTR",
+                       "Headphone Jack", "HP",
+                       "AIF1 Slot 0 Left ADC", "Left ADC",
+                       "AIF1 Slot 0 Right ADC", "Right ADC",
+                       "Internal Microphone Left", "MBIAS",
+                       "MIC1", "Internal Microphone Left",
+                       "Internal Microphone Right", "HBIAS",
+                       "MIC2", "Internal Microphone Right";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pb_pins>;
+       status = "okay";
+};
+
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
+&usb_power_supply {
+       status = "okay";
+};
+
+&usbphy {
+       usb0_id_det-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */
+       usb0_vbus_power-supply = <&usb_power_supply>;
+       usb0_vbus-supply = <&reg_drivevbus>;
+       usb1_vbus-supply = <&reg_ldo_io0>;
+       status = "okay";
+};
index 862b47d..31143fe 100644 (file)
 
                        display_clocks: clock@0 {
                                compatible = "allwinner,sun50i-a64-de2-clk";
-                               reg = <0x0 0x100000>;
+                               reg = <0x0 0x10000>;
                                clocks = <&ccu CLK_BUS_DE>,
                                         <&ccu CLK_DE>;
                                clock-names = "bus",
                                #reset-cells = <1>;
                        };
 
+                       rotate: rotate@20000 {
+                               compatible = "allwinner,sun50i-a64-de2-rotate",
+                                            "allwinner,sun8i-a83t-de2-rotate";
+                               reg = <0x20000 0x10000>;
+                               interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&display_clocks CLK_BUS_ROT>,
+                                        <&display_clocks CLK_ROT>;
+                               clock-names = "bus",
+                                             "mod";
+                               resets = <&display_clocks RST_ROT>;
+                       };
+
                        mixer0: mixer@100000 {
                                compatible = "allwinner,sun50i-a64-de2-mixer-0";
                                reg = <0x100000 0x100000>;
                                function = "i2c1";
                        };
 
+                       i2c2_pins: i2c2-pins {
+                               pins = "PE14", "PE15";
+                               function = "i2c2";
+                       };
+
                        /omit-if-no-ref/
                        lcd_rgb666_pins: lcd-rgb666-pins {
                                pins = "PD0", "PD1", "PD2", "PD3", "PD4",
                        interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&ccu CLK_BUS_I2C2>;
                        resets = <&ccu RST_BUS_I2C2>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&i2c2_pins>;
                        status = "disabled";
                        #address-cells = <1>;
                        #size-cells = <0>;
                };
 
-
                spi0: spi@1c68000 {
                        compatible = "allwinner,sun8i-h3-spi";
                        reg = <0x01c68000 0x1000>;
                        status = "disabled";
                };
 
+               mbus: dram-controller@1c62000 {
+                       compatible = "allwinner,sun50i-a64-mbus";
+                       reg = <0x01c62000 0x1000>;
+                       clocks = <&ccu 112>;
+                       dma-ranges = <0x00000000 0x40000000 0xc0000000>;
+                       #interconnect-cells = <1>;
+               };
+
                csi: csi@1cb0000 {
                        compatible = "allwinner,sun50i-a64-csi";
                        reg = <0x01cb0000 0x1000>;
                        #phy-cells = <0>;
                };
 
+               deinterlace: deinterlace@1e00000 {
+                       compatible = "allwinner,sun50i-a64-deinterlace",
+                                    "allwinner,sun8i-h3-deinterlace";
+                       reg = <0x01e00000 0x20000>;
+                       clocks = <&ccu CLK_BUS_DEINTERLACE>,
+                                <&ccu CLK_DEINTERLACE>,
+                                <&ccu CLK_DRAM_DEINTERLACE>;
+                       clock-names = "bus", "mod", "ram";
+                       resets = <&ccu RST_BUS_DEINTERLACE>;
+                       interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>;
+                       interconnects = <&mbus 9>;
+                       interconnect-names = "dma-mem";
+               };
+
                hdmi: hdmi@1ee0000 {
                        compatible = "allwinner,sun50i-a64-dw-hdmi",
                                     "allwinner,sun8i-a83t-dw-hdmi";
index 70b5f09..7d7aad1 100644 (file)
@@ -61,6 +61,7 @@
                        label = "sw4";
                        linux,code = <BTN_0>;
                        gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
+                       wakeup-source;
                };
        };
 
        status = "okay";
 };
 
+&cpu0 {
+       cpu-supply = <&reg_vdd_cpux>;
+};
+
 &de {
        status = "okay";
 };
        status = "okay";
 };
 
+&r_i2c {
+       status = "okay";
+
+       reg_vdd_cpux: regulator@65 {
+               compatible = "silergy,sy8106a";
+               reg = <0x65>;
+               regulator-name = "vdd-cpux";
+               silergy,fixed-microvolt = <1100000>;
+               regulator-min-microvolt = <1000000>;
+               regulator-max-microvolt = <1400000>;
+               regulator-ramp-delay = <200>;
+               regulator-boot-on;
+               regulator-always-on;
+       };
+};
+
 &spi0  {
        status = "okay";
 
index 9893aa6..4462a68 100644 (file)
@@ -38,8 +38,7 @@
        };
 
        pmu {
-               compatible = "arm,cortex-a53-pmu",
-                            "arm,armv8-pmuv3";
+               compatible = "arm,cortex-a53-pmu";
                interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>,
                             <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>,
                             <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>,
index df6d872..8f09d20 100644 (file)
                };
        };
 
+       ext_osc32k: ext_osc32k_clk {
+               #clock-cells = <0>;
+               compatible = "fixed-clock";
+               clock-frequency = <32768>;
+               clock-output-names = "ext_osc32k";
+       };
+
        leds {
                compatible = "gpio-leds";
 
        vcc-pm-supply = <&reg_aldo1>;
 };
 
+&rtc {
+       clocks = <&ext_osc32k>;
+};
+
 &spdif {
        status = "okay";
 };
index c311eee..47f5796 100644 (file)
                };
        };
 
+       ext_osc32k: ext_osc32k_clk {
+               #clock-cells = <0>;
+               compatible = "fixed-clock";
+               clock-frequency = <32768>;
+               clock-output-names = "ext_osc32k";
+       };
+
        leds {
                compatible = "gpio-leds";
 
        };
 };
 
+&mmc2 {
+       vmmc-supply = <&reg_cldo1>;
+       vqmmc-supply = <&reg_bldo2>;
+       cap-mmc-hw-reset;
+       non-removable;
+       bus-width = <8>;
+       status = "okay";
+};
+
 &ohci0 {
        status = "okay";
 };
        status = "okay";
 };
 
+&rtc {
+       clocks = <&ext_osc32k>;
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_ph_pins>;
index 83aab73..fceb298 100644 (file)
@@ -7,4 +7,37 @@
 / {
        model = "OrangePi One Plus";
        compatible = "xunlong,orangepi-one-plus", "allwinner,sun50i-h6";
+
+       aliases {
+               ethernet0 = &emac;
+       };
+
+       reg_gmac_3v3: gmac-3v3 {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc-gmac-3v3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               startup-delay-us = <100000>;
+               enable-active-high;
+               gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */
+               vin-supply = <&reg_aldo2>;
+       };
+};
+
+&emac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ext_rgmii_pins>;
+       phy-mode = "rgmii";
+       phy-handle = <&ext_rgmii_phy>;
+       phy-supply = <&reg_gmac_3v3>;
+       allwinner,rx-delay-ps = <200>;
+       allwinner,tx-delay-ps = <200>;
+       status = "okay";
+};
+
+&mdio {
+       ext_rgmii_phy: ethernet-phy@1 {
+               compatible = "ethernet-phy-ieee802.3-c22";
+               reg = <1>;
+       };
 };
index 37f4c57..9287976 100644 (file)
                stdout-path = "serial0:115200n8";
        };
 
+       connector {
+               compatible = "hdmi-connector";
+               type = "a";
+               ddc-en-gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>; /* PH2 */
+
+               port {
+                       hdmi_con_in: endpoint {
+                               remote-endpoint = <&hdmi_out_con>;
+                       };
+               };
+       };
+
+       ext_osc32k: ext_osc32k_clk {
+               #clock-cells = <0>;
+               compatible = "fixed-clock";
+               clock-frequency = <32768>;
+               clock-output-names = "ext_osc32k";
+       };
+
        leds {
                compatible = "gpio-leds";
 
        };
 };
 
+&de {
+       status = "okay";
+};
+
 &ehci0 {
        status = "okay";
 };
        status = "okay";
 };
 
+&hdmi {
+       status = "okay";
+};
+
+&hdmi_out {
+       hdmi_out_con: endpoint {
+               remote-endpoint = <&hdmi_con_in>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_cldo1>;
        cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
        status = "okay";
 };
 
+&rtc {
+       clocks = <&ext_osc32k>;
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_ph_pins>;
index d1c2aa5..b0642d8 100644 (file)
        aliases {
                ethernet0 = &emac;
                serial0 = &uart0;
+               spi0 = &spi0;
        };
 
        chosen {
                stdout-path = "serial0:115200n8";
        };
 
+       ext_osc32k: ext_osc32k_clk {
+               #clock-cells = <0>;
+               compatible = "fixed-clock";
+               clock-frequency = <32768>;
+               clock-output-names = "ext_osc32k";
+       };
+
        hdmi_connector: connector {
                compatible = "hdmi-connector";
                type = "a";
        vcc-pm-supply = <&reg_aldo1>;
 };
 
+&rtc {
+       clocks = <&ext_osc32k>;
+};
+
+/*
+ * The CS pin is shared with the MMC2 CMD pin, so we cannot have the SPI
+ * flash and eMMC at the same time, as one of them would fail probing.
+ * Disable SPI0 in here, to prefer the more useful eMMC. U-Boot can
+ * fix this up in no eMMC is connected.
+ */
+&spi0 {
+       pinctrl-0 = <&spi0_pins>, <&spi0_cs_pin>;
+       pinctrl-names = "default";
+       status = "disabled";
+
+       flash@0 {
+               compatible = "winbond,w25q128", "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <4000000>;
+       };
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_ph_pins>;
index 3329283..b9ab7d8 100644 (file)
                clock-output-names = "osc24M";
        };
 
-       ext_osc32k: ext_osc32k_clk {
-               #clock-cells = <0>;
-               compatible = "fixed-clock";
-               clock-frequency = <32768>;
-               clock-output-names = "ext_osc32k";
-       };
-
        pmu {
-               compatible = "arm,cortex-a53-pmu",
-                            "arm,armv8-pmuv3";
+               compatible = "arm,cortex-a53-pmu";
                interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>,
                             <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>,
                             <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>,
                                bias-pull-up;
                        };
 
+                       /omit-if-no-ref/
+                       spi0_pins: spi0-pins {
+                               pins = "PC0", "PC2", "PC3";
+                               function = "spi0";
+                       };
+
+                       /* pin shared with MMC2-CMD (eMMC) */
+                       /omit-if-no-ref/
+                       spi0_cs_pin: spi0-cs-pin {
+                               pins = "PC5";
+                               function = "spi0";
+                       };
+
+                       /omit-if-no-ref/
+                       spi1_pins: spi1-pins {
+                               pins = "PH4", "PH5", "PH6";
+                               function = "spi1";
+                       };
+
+                       /omit-if-no-ref/
+                       spi1_cs_pin: spi1-cs-pin {
+                               pins = "PH3";
+                               function = "spi1";
+                       };
+
                        spdif_tx_pin: spdif-tx-pin {
                                pins = "PH7";
                                function = "spdif";
                        #size-cells = <0>;
                };
 
+               spi0: spi@5010000 {
+                       compatible = "allwinner,sun50i-h6-spi",
+                                    "allwinner,sun8i-h3-spi";
+                       reg = <0x05010000 0x1000>;
+                       interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_SPI0>, <&ccu CLK_SPI0>;
+                       clock-names = "ahb", "mod";
+                       dmas = <&dma 22>, <&dma 22>;
+                       dma-names = "rx", "tx";
+                       resets = <&ccu RST_BUS_SPI0>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               spi1: spi@5011000 {
+                       compatible = "allwinner,sun50i-h6-spi",
+                                    "allwinner,sun8i-h3-spi";
+                       reg = <0x05011000 0x1000>;
+                       interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_SPI1>, <&ccu CLK_SPI1>;
+                       clock-names = "ahb", "mod";
+                       dmas = <&dma 23>, <&dma 23>;
+                       dma-names = "rx", "tx";
+                       resets = <&ccu RST_BUS_SPI1>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
                emac: ethernet@5020000 {
                        compatible = "allwinner,sun50i-h6-emac",
                                     "allwinner,sun50i-a64-emac";
                        interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>;
                        clock-output-names = "osc32k", "osc32k-out", "iosc";
-                       clocks = <&ext_osc32k>;
                        #clock-cells = <1>;
                };