From af693431a542fff95824e77e405c6d0e6ad03d33 Mon Sep 17 00:00:00 2001 From: Klaus Goger Date: Fri, 19 Aug 2016 23:11:00 +0200 Subject: ARM: dts: sun9i: Add a dts for the armadillo board Armadillo is a A80 based Qseven module with up to 4GB DDR3, eMMC, SPI NR Flash, HDMI, LVDS, eDP, DSI, CSI, 5 USB Host ports, 1 USB 3.0 OTG port, USB to SATA bridge, Gigabit Ethernet and an Offload STM32 Cortex-M0 processor providng CAN, RTC and fan controller functionality. For more details see https://www.theobroma-systems.com/a80-q7/ Signed-off-by: Klaus Goger --- arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/sun9i-a80-armadillo.dts | 465 ++++++++++++++++++++++++++++++ arch/arm/boot/dts/sun9i-a80.dtsi | 11 +- 3 files changed, 474 insertions(+), 3 deletions(-) create mode 100644 arch/arm/boot/dts/sun9i-a80-armadillo.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index faacd52370d2..dfd781c4262d 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -794,6 +794,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \ sun8i-h3-orangepi-plus.dtb \ sun8i-r16-parrot.dtb dtb-$(CONFIG_MACH_SUN9I) += \ + sun9i-a80-armadillo.dtb \ sun9i-a80-optimus.dtb \ sun9i-a80-cubieboard4.dtb dtb-$(CONFIG_ARCH_TANGO) += \ diff --git a/arch/arm/boot/dts/sun9i-a80-armadillo.dts b/arch/arm/boot/dts/sun9i-a80-armadillo.dts new file mode 100644 index 000000000000..cd3e5bcd09e2 --- /dev/null +++ b/arch/arm/boot/dts/sun9i-a80-armadillo.dts @@ -0,0 +1,465 @@ +/* + * Copyright 2016 Klaus Goger + * based on sun9i-a80-cubieboard4.dts + * Copyright 2015 Tyler Baker + * + * Klaus Goger + * Philipp Tomsich + * Tyler Baker + * Chen-Yu Tsai + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/dts-v1/; +#include "sun9i-a80.dtsi" + +#include +#include + +/ { + model = "Theobroma Systems A80 Armadillo"; + compatible = "tsd,a80-armadillo", "allwinner,sun9i-a80"; + + aliases { + serial4 = &uart4; + serial5 = &uart5; + }; + + chosen { + stdout-path = "serial4:115200n8"; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&led_pins_armadillo>; + + module_led { + label = "module_led"; + gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */ + linux,default-trigger = "heartbeat"; + }; + sd_card_led { + label = "sd_card_led"; + gpios = <&pio 7 13 GPIO_ACTIVE_HIGH>; /* PH13 */ + linux,default-trigger = "mmc1"; + }; + }; + usb-hub { + compatible = "smsc,usb3503"; + }; + + /* Redefines mmc0 under new name so that the sd card is probed after the emmc */ + soc { + sdcard: sdcard@01c0f000 { + compatible = "allwinner,sun9i-a80-mmc"; + reg = <0x01c0f000 0x1000>; + #address-cells = <1>; + #size-cells = <0>; + clocks = <&mmc_config_clk 0>, + <&mmc0_clk 0>, + <&mmc0_clk 1>, + <&mmc0_clk 2>; + clock-names = "ahb", + "mmc", + "output", + "sample"; + resets = <&mmc_config_clk 0>; + reset-names = "ahb"; + interrupts = ; + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins>, <&mmc0_cd_pin_armadillo>; + vmmc-supply = <®_dcdc1>; + bus-width = <4>; + cd-gpios = <&pio 7 15 GPIO_ACTIVE_LOW>; /* PH15 */ + broken-cd; + status = "okay"; + }; + }; +}; + +&gmac { + pinctrl-names = "default"; + pinctrl-0 = <&gmac_pins_rgmii_a>; + phy-mode = "rgmii"; + snps,reset-gpio = <&pio 0 14 GPIO_ACTIVE_LOW>; + snps,reset-active-low; + snps,reset-delays-us = <0 50000 1000000>; + txc-skew-ps = <1800>; + rxc-skew-ps = <1800>; + status = "okay"; +}; + +&mmc2 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_8bit_pins>; + vmmc-supply = <®_dcdc1>; + bus-width = <8>; + non-removable; + cap-mmc-hw-reset; + status = "okay"; +}; + +&mmc2_8bit_pins { + /* Increase drive strength for DDR modes */ + allwinner,drive = ; +}; + +&pio { + led_pins_armadillo: led-pins@0 { + allwinner,pins = "PD23","PH13"; + allwinner,function = "gpio_out"; + allwinner,drive = ; + allwinner,pull = ; + }; + + mmc0_cd_pin_armadillo: mmc0_cd_pin@0 { + allwinner,pins = "PH15"; + allwinner,function = "gpio_in"; + allwinner,pull = ; + }; +}; + +&r_rsb { + status = "okay"; + + axp809: pmic@3a3 { + reg = <0x3a3>; + interrupt-parent = <&nmi_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + + regulators { + reg_aldo1: aldo1 { + /* + * TODO: This should be handled by the + * USB PHY driver. + */ + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc33-usbh"; + }; + + reg_aldo2: aldo2 { + /* unused */ + }; + + aldo3 { + /* unused */ + }; + + reg_dc5ldo: dc5ldo { + regulator-always-on; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <1100000>; + regulator-name = "vdd-cpus-09"; + }; + + reg_dcdc1: dcdc1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-3v3"; + }; + + reg_dcdc2: dcdc2 { + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <1100000>; + regulator-name = "vdd-gpu"; + }; + + reg_dcdc3: dcdc3 { + regulator-always-on; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <1100000>; + regulator-name = "vdd-cpua"; + }; + + reg_dcdc4: dcdc4 { + regulator-always-on; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <1100000>; + regulator-name = "vdd-sys"; + }; + + reg_dcdc5: dcdc5 { + regulator-always-on; + regulator-min-microvolt = <1425000>; + regulator-max-microvolt = <1575000>; + regulator-name = "vcc-dram"; + }; + + reg_dldo1: dldo1 { + /* unused */ + }; + + reg_dldo2: dldo2 { + /* unused */ + }; + + reg_eldo1: eldo1 { + /* unused */ + }; + + reg_eldo2: eldo2 { + /* unused */ + }; + + reg_eldo3: eldo3 { + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcc-1v8_standby"; + }; + + reg_ldo_io0: ldo_io0 { + /* unused */ + }; + + reg_ldo_io1: ldo_io1 { + /* unused */ + }; + + reg_rtc_ldo: rtc_ldo { + regulator-name = "vcc-rtc-vdd1v8-io"; + }; + sw { + /* unused */ + }; + }; + }; + axp806: pmic@745 { + compatible = "x-powers,axp806"; + reg = <0x745>; + interrupt-parent = <&nmi_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + interrupt-controller; + #interrupt-cells = <1>; + bldoin-supply = <®_dcdce>; + + regulators { + reg_s_aldo1: aldo1 { + regulator-always-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-name = "avcc"; + }; + + aldo2 { + /* + * unused, but use a different name to + * avoid name clash with axp809's aldo's + */ + regulator-name = "s_aldo2"; + }; + + aldo3 { + /* + * unused, but use a different name to + * avoid name clash with axp809's aldo's + */ + regulator-name = "s_aldo3"; + }; + + reg_bldo1: bldo1 { + regulator-always-on; + regulator-min-microvolt = <1620000>; + regulator-max-microvolt = <1980000>; + regulator-name = "vcc18-efuse-adc-display-csi"; + }; + + reg_bldo2: bldo2 { + regulator-always-on; + regulator-min-microvolt = <1620000>; + regulator-max-microvolt = <1980000>; + regulator-name = + "vdd18-drampll-vcc18-pll-cpvdd"; + }; + + bldo3 { + /* unused */ + }; + + reg_bldo4: bldo4 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-name = "vcc12-hsic"; + }; + + reg_cldo1: cldo1 { + /* + * This was 3V in the original design, but + * 3.3V is the recommended supply voltage + * for the Ethernet PHY. + */ + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-gmac-phy"; + }; + + reg_cldo2: cldo2 { + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-name = "afvcc-cam"; + }; + + reg_cldo3: cldo3 { + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-name = "vcc-io-wifi-codec-io2"; + }; + + reg_dcdca: dcdca { + regulator-always-on; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <1100000>; + regulator-name = "vdd-cpub"; + }; + + reg_dcdcd: dcdcd { + regulator-always-on; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <1100000>; + regulator-name = "vdd-vpu"; + }; + + reg_dcdce: dcdce { + regulator-always-on; + regulator-min-microvolt = <2100000>; + regulator-max-microvolt = <2100000>; + regulator-name = "vcc-bldo-codec-ldoin"; + }; + + sw { + /* + * unused, but use a different name to + * avoid name clash with axp809's sw + */ + regulator-name = "s_sw"; + }; + }; + }; +}; + +#include "axp809.dtsi" + +&uart4 { + pinctrl-names = "default"; + pinctrl-0 = <&uart4_pins_a>; + status = "okay"; +}; + +&uart5 { + pinctrl-names = "default"; + pinctrl-0 = <&uart5_pins_a>; + status = "okay"; +}; + +&i2c3 { + pinctrl-names="default"; + pinctrl-0 = <&i2c3_pins_a>; + status = "okay"; + + rtc_twi: rtc@6f { + compatible = "isil,isl1208"; + reg = <0x6f>; + }; + fan: fan@18 { + compatible = "ti,amc6821"; + reg = <0x18>; + }; +}; + +&ehci0 { + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +&ehci2 { + status = "okay"; +}; + +&usbphy1 { + status = "okay"; +}; + +&usbphy2 { + phy-supply = <®_bldo4>; + status = "okay"; +}; + +&usbphy3 { + status = "okay"; +}; + +&cpu0 { + cpu-supply = <®_dcdc3>; +}; + +&cpu1 { + cpu-supply = <®_dcdc3>; +}; + +&cpu2 { + cpu-supply = <®_dcdc3>; +}; + +&cpu3 { + cpu-supply = <®_dcdc3>; +}; + +&cpu4 { + cpu-supply = <®_dcdca>; +}; + +&cpu5 { + cpu-supply = <®_dcdca>; +}; + +&cpu6 { + cpu-supply = <®_dcdca>; +}; + +&cpu7 { + cpu-supply = <®_dcdca>; +}; diff --git a/arch/arm/boot/dts/sun9i-a80.dtsi b/arch/arm/boot/dts/sun9i-a80.dtsi index 5d7a21545152..2457563a04c5 100644 --- a/arch/arm/boot/dts/sun9i-a80.dtsi +++ b/arch/arm/boot/dts/sun9i-a80.dtsi @@ -878,7 +878,7 @@ /* * data lines in RGMII mode use DDR mode * and need a higher signal drive strength - * / + */ allwinner,drive = ; allwinner,pull = ; }; @@ -934,23 +934,27 @@ opp-shared; opp@1800000000 { opp-hz = /bits/ 64 <1800000000>; - opp-microvolt = <1020000>; + opp-microvolt = <980000>; clock-latency-ns = <140000>; + turbo-mode; }; opp@1608000000 { opp-hz = /bits/ 64 <1608000000>; opp-microvolt = <960000>; clock-latency-ns = <140000>; + turbo-mode; }; opp@1416000000 { opp-hz = /bits/ 64 <1416000000>; opp-microvolt = <940000>; clock-latency-ns = <140000>; + turbo-mode; }; opp@1320000000 { opp-hz = /bits/ 64 <1320000000>; opp-microvolt = <920000>; clock-latency-ns = <140000>; + turbo-mode; }; opp@1200000000 { opp-hz = /bits/ 64 <1200000000>; @@ -975,8 +979,9 @@ opp-shared; opp@1440000000 { opp-hz = /bits/ 64 <1440000000>; - opp-microvolt = <1060000>; + opp-microvolt = <1100000>; clock-latency-ns = <200000>; + turbo-mode; }; opp@1200000000 { opp-hz = /bits/ 64 <1200000000>; -- cgit v1.2.3