10a072362SAndreas Färber/*
20a072362SAndreas Färber * Copyright (c) 2016-2017 Andreas Färber
30a072362SAndreas Färber *
40a072362SAndreas Färber * Based on nexbox-a1:
50a072362SAndreas Färber *
60a072362SAndreas Färber * Copyright (c) 2016 BayLibre, SAS.
70a072362SAndreas Färber * Author: Neil Armstrong <narmstrong@baylibre.com>
80a072362SAndreas Färber *
90a072362SAndreas Färber * Copyright (c) 2016 Endless Computers, Inc.
100a072362SAndreas Färber * Author: Carlo Caione <carlo@endlessm.com>
110a072362SAndreas Färber *
120a072362SAndreas Färber * This file is dual-licensed: you can use it either under the terms
130a072362SAndreas Färber * of the GPL or the X11 license, at your option. Note that this dual
140a072362SAndreas Färber * licensing only applies to this file, and not this project as a
150a072362SAndreas Färber * whole.
160a072362SAndreas Färber *
170a072362SAndreas Färber *  a) This library is free software; you can redistribute it and/or
180a072362SAndreas Färber *     modify it under the terms of the GNU General Public License as
190a072362SAndreas Färber *     published by the Free Software Foundation; either version 2 of the
200a072362SAndreas Färber *     License, or (at your option) any later version.
210a072362SAndreas Färber *
220a072362SAndreas Färber *     This library is distributed in the hope that it will be useful,
230a072362SAndreas Färber *     but WITHOUT ANY WARRANTY; without even the implied warranty of
240a072362SAndreas Färber *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
250a072362SAndreas Färber *     GNU General Public License for more details.
260a072362SAndreas Färber *
270a072362SAndreas Färber * Or, alternatively,
280a072362SAndreas Färber *
290a072362SAndreas Färber *  b) Permission is hereby granted, free of charge, to any person
300a072362SAndreas Färber *     obtaining a copy of this software and associated documentation
310a072362SAndreas Färber *     files (the "Software"), to deal in the Software without
320a072362SAndreas Färber *     restriction, including without limitation the rights to use,
330a072362SAndreas Färber *     copy, modify, merge, publish, distribute, sublicense, and/or
340a072362SAndreas Färber *     sell copies of the Software, and to permit persons to whom the
350a072362SAndreas Färber *     Software is furnished to do so, subject to the following
360a072362SAndreas Färber *     conditions:
370a072362SAndreas Färber *
380a072362SAndreas Färber *     The above copyright notice and this permission notice shall be
390a072362SAndreas Färber *     included in all copies or substantial portions of the Software.
400a072362SAndreas Färber *
410a072362SAndreas Färber *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
420a072362SAndreas Färber *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
430a072362SAndreas Färber *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
440a072362SAndreas Färber *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
450a072362SAndreas Färber *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
460a072362SAndreas Färber *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
470a072362SAndreas Färber *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
480a072362SAndreas Färber *     OTHER DEALINGS IN THE SOFTWARE.
490a072362SAndreas Färber */
500a072362SAndreas Färber
510a072362SAndreas Färber/dts-v1/;
520a072362SAndreas Färber
530a072362SAndreas Färber#include "meson-gxm.dtsi"
540a072362SAndreas Färber
550a072362SAndreas Färber/ {
560a072362SAndreas Färber	compatible = "kingnovel,r-box-pro", "amlogic,s912", "amlogic,meson-gxm";
570a072362SAndreas Färber	model = "R-Box Pro";
580a072362SAndreas Färber
590a072362SAndreas Färber	aliases {
600a072362SAndreas Färber		serial0 = &uart_AO;
61059a58fcSJorge Ramirez-Ortiz		ethernet0 = &ethmac;
620a072362SAndreas Färber	};
630a072362SAndreas Färber
640a072362SAndreas Färber	chosen {
650a072362SAndreas Färber		stdout-path = "serial0:115200n8";
660a072362SAndreas Färber	};
670a072362SAndreas Färber
680a072362SAndreas Färber	memory@0 {
690a072362SAndreas Färber		device_type = "memory";
700a072362SAndreas Färber		reg = <0x0 0x0 0x0 0x80000000>; /* 2 GiB or 3 GiB */
710a072362SAndreas Färber	};
720a072362SAndreas Färber
730a072362SAndreas Färber	leds {
740a072362SAndreas Färber		compatible = "gpio-leds";
750a072362SAndreas Färber
760a072362SAndreas Färber		blue {
770a072362SAndreas Färber			label = "rbox-pro:blue:on";
780a072362SAndreas Färber			gpios = <&gpio_ao GPIOAO_9 GPIO_ACTIVE_HIGH>;
790a072362SAndreas Färber			default-state = "on";
800a072362SAndreas Färber		};
810a072362SAndreas Färber
820a072362SAndreas Färber		red {
830a072362SAndreas Färber			label = "rbox-pro:red:standby";
840a072362SAndreas Färber			gpios = <&gpio GPIODV_28 GPIO_ACTIVE_HIGH>;
850a072362SAndreas Färber			default-state = "off";
860a072362SAndreas Färber			retain-state-suspended;
870a072362SAndreas Färber			panic-indicator;
880a072362SAndreas Färber		};
890a072362SAndreas Färber	};
900a072362SAndreas Färber
910a072362SAndreas Färber	vddio_boot: regulator-vddio-boot {
920a072362SAndreas Färber		compatible = "regulator-fixed";
930a072362SAndreas Färber		regulator-name = "VDDIO_BOOT";
940a072362SAndreas Färber		regulator-min-microvolt = <1800000>;
950a072362SAndreas Färber		regulator-max-microvolt = <1800000>;
960a072362SAndreas Färber	};
970a072362SAndreas Färber
980a072362SAndreas Färber	vddao_3v3: regulator-vddao-3v3 {
990a072362SAndreas Färber		compatible = "regulator-fixed";
1000a072362SAndreas Färber		regulator-name = "VDDAO_3V3";
1010a072362SAndreas Färber		regulator-min-microvolt = <3300000>;
1020a072362SAndreas Färber		regulator-max-microvolt = <3300000>;
1030a072362SAndreas Färber	};
1040a072362SAndreas Färber
1050a072362SAndreas Färber	vcc_3v3: regulator-vcc-3v3 {
1060a072362SAndreas Färber		compatible = "regulator-fixed";
1070a072362SAndreas Färber		regulator-name = "VCC_3V3";
1080a072362SAndreas Färber		regulator-min-microvolt = <3300000>;
1090a072362SAndreas Färber		regulator-max-microvolt = <3300000>;
1100a072362SAndreas Färber	};
1110a072362SAndreas Färber
1120a072362SAndreas Färber	emmc_pwrseq: emmc-pwrseq {
1130a072362SAndreas Färber		compatible = "mmc-pwrseq-emmc";
1140a072362SAndreas Färber		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
1150a072362SAndreas Färber	};
1160a072362SAndreas Färber
1170a072362SAndreas Färber	wifi32k: wifi32k {
1180a072362SAndreas Färber		compatible = "pwm-clock";
1190a072362SAndreas Färber		#clock-cells = <0>;
1200a072362SAndreas Färber		clock-frequency = <32768>;
1210a072362SAndreas Färber		pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
1220a072362SAndreas Färber	};
1230a072362SAndreas Färber
1240a072362SAndreas Färber	sdio_pwrseq: sdio-pwrseq {
1250a072362SAndreas Färber		compatible = "mmc-pwrseq-simple";
1260a072362SAndreas Färber		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
1270a072362SAndreas Färber		clocks = <&wifi32k>;
1280a072362SAndreas Färber		clock-names = "ext_clock";
1290a072362SAndreas Färber	};
1300a072362SAndreas Färber};
1310a072362SAndreas Färber
1320a072362SAndreas Färber&ethmac {
1330a072362SAndreas Färber	status = "okay";
1340a072362SAndreas Färber
1350a072362SAndreas Färber	pinctrl-0 = <&eth_pins>;
1360a072362SAndreas Färber	pinctrl-names = "default";
1370a072362SAndreas Färber
1380a072362SAndreas Färber	/* Select external PHY by default */
1390a072362SAndreas Färber	phy-handle = <&external_phy>;
1400a072362SAndreas Färber
1410a072362SAndreas Färber	snps,reset-gpio = <&gpio GPIOZ_14 0>;
1420a072362SAndreas Färber	snps,reset-delays-us = <0 10000 1000000>;
1430a072362SAndreas Färber	snps,reset-active-low;
1440a072362SAndreas Färber
1450a072362SAndreas Färber	amlogic,tx-delay-ns = <2>;
1460a072362SAndreas Färber
1470a072362SAndreas Färber	/* External PHY is in RGMII */
1480a072362SAndreas Färber	phy-mode = "rgmii";
1490a072362SAndreas Färber};
1500a072362SAndreas Färber
1510a072362SAndreas Färber&external_mdio {
1520a072362SAndreas Färber	external_phy: ethernet-phy@0 {
1530a072362SAndreas Färber		compatible = "ethernet-phy-id001c.c916", "ethernet-phy-ieee802.3-c22";
1540a072362SAndreas Färber		reg = <0>;
1550a072362SAndreas Färber		max-speed = <1000>;
1560a072362SAndreas Färber	};
1570a072362SAndreas Färber};
1580a072362SAndreas Färber
1590a072362SAndreas Färber&ir {
1600a072362SAndreas Färber	status = "okay";
1610a072362SAndreas Färber	pinctrl-0 = <&remote_input_ao_pins>;
1620a072362SAndreas Färber	pinctrl-names = "default";
1630a072362SAndreas Färber};
1640a072362SAndreas Färber
1650a072362SAndreas Färber&pwm_ef {
1660a072362SAndreas Färber	status = "okay";
1670a072362SAndreas Färber	pinctrl-0 = <&pwm_e_pins>;
1680a072362SAndreas Färber	pinctrl-names = "default";
1690a072362SAndreas Färber	clocks = <&clkc CLKID_FCLK_DIV4>;
1700a072362SAndreas Färber	clock-names = "clkin0";
1710a072362SAndreas Färber};
1720a072362SAndreas Färber
1730a072362SAndreas Färber/* Wireless SDIO Module */
1740a072362SAndreas Färber&sd_emmc_a {
1750a072362SAndreas Färber	status = "okay";
1760a072362SAndreas Färber	pinctrl-0 = <&sdio_pins>;
1770a072362SAndreas Färber	pinctrl-names = "default";
1780a072362SAndreas Färber	#address-cells = <1>;
1790a072362SAndreas Färber	#size-cells = <0>;
1800a072362SAndreas Färber
1810a072362SAndreas Färber	bus-width = <4>;
1820a072362SAndreas Färber	cap-sd-highspeed;
1830a072362SAndreas Färber	max-frequency = <100000000>;
1840a072362SAndreas Färber
1850a072362SAndreas Färber	non-removable;
1860a072362SAndreas Färber	disable-wp;
1870a072362SAndreas Färber
1880a072362SAndreas Färber	mmc-pwrseq = <&sdio_pwrseq>;
1890a072362SAndreas Färber
1900a072362SAndreas Färber	vmmc-supply = <&vddao_3v3>;
1910a072362SAndreas Färber	vqmmc-supply = <&vddio_boot>;
1920a072362SAndreas Färber
1930a072362SAndreas Färber	brcmf: brcmf@1 {
1940a072362SAndreas Färber		reg = <1>;
1950a072362SAndreas Färber		compatible = "brcm,bcm4329-fmac";
1960a072362SAndreas Färber	};
1970a072362SAndreas Färber};
1980a072362SAndreas Färber
1990a072362SAndreas Färber/* SD card */
2000a072362SAndreas Färber&sd_emmc_b {
2010a072362SAndreas Färber	status = "okay";
2020a072362SAndreas Färber	pinctrl-0 = <&sdcard_pins>;
2030a072362SAndreas Färber	pinctrl-names = "default";
2040a072362SAndreas Färber
2050a072362SAndreas Färber	bus-width = <4>;
2060a072362SAndreas Färber	cap-sd-highspeed;
2070a072362SAndreas Färber	max-frequency = <100000000>;
2080a072362SAndreas Färber	disable-wp;
2090a072362SAndreas Färber
2100a072362SAndreas Färber	cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
2110a072362SAndreas Färber	cd-inverted;
2120a072362SAndreas Färber
2130a072362SAndreas Färber	vmmc-supply = <&vddao_3v3>;
2140a072362SAndreas Färber	vqmmc-supply = <&vddio_boot>;
2150a072362SAndreas Färber};
2160a072362SAndreas Färber
2170a072362SAndreas Färber/* eMMC */
2180a072362SAndreas Färber&sd_emmc_c {
2190a072362SAndreas Färber	status = "okay";
220ab36be66SNeil Armstrong	pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
2210a072362SAndreas Färber	pinctrl-names = "default";
2220a072362SAndreas Färber
2230a072362SAndreas Färber	bus-width = <8>;
2240a072362SAndreas Färber	cap-mmc-highspeed;
2250a072362SAndreas Färber	max-frequency = <200000000>;
2260a072362SAndreas Färber	non-removable;
2270a072362SAndreas Färber	disable-wp;
2280a072362SAndreas Färber	mmc-ddr-1_8v;
2290a072362SAndreas Färber	mmc-hs200-1_8v;
2300a072362SAndreas Färber
2310a072362SAndreas Färber	mmc-pwrseq = <&emmc_pwrseq>;
2320a072362SAndreas Färber	vmmc-supply = <&vcc_3v3>;
2330a072362SAndreas Färber	vqmmc-supply = <&vddio_boot>;
2340a072362SAndreas Färber};
2350a072362SAndreas Färber
2360a072362SAndreas Färber&uart_AO {
2370a072362SAndreas Färber	status = "okay";
2380a072362SAndreas Färber	pinctrl-0 = <&uart_ao_a_pins>;
2390a072362SAndreas Färber	pinctrl-names = "default";
2400a072362SAndreas Färber};
241