14e611897SNeil Armstrong/*
24e611897SNeil Armstrong * Copyright (c) 2016 Endless Computers, Inc.
34e611897SNeil Armstrong * Author: Carlo Caione <carlo@endlessm.com>
44e611897SNeil Armstrong *
54e611897SNeil Armstrong * This file is dual-licensed: you can use it either under the terms
64e611897SNeil Armstrong * of the GPL or the X11 license, at your option. Note that this dual
74e611897SNeil Armstrong * licensing only applies to this file, and not this project as a
84e611897SNeil Armstrong * whole.
94e611897SNeil Armstrong *
104e611897SNeil Armstrong *  a) This library is free software; you can redistribute it and/or
114e611897SNeil Armstrong *     modify it under the terms of the GNU General Public License as
124e611897SNeil Armstrong *     published by the Free Software Foundation; either version 2 of the
134e611897SNeil Armstrong *     License, or (at your option) any later version.
144e611897SNeil Armstrong *
154e611897SNeil Armstrong *     This library is distributed in the hope that it will be useful,
164e611897SNeil Armstrong *     but WITHOUT ANY WARRANTY; without even the implied warranty of
174e611897SNeil Armstrong *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
184e611897SNeil Armstrong *     GNU General Public License for more details.
194e611897SNeil Armstrong *
204e611897SNeil Armstrong * Or, alternatively,
214e611897SNeil Armstrong *
224e611897SNeil Armstrong *  b) Permission is hereby granted, free of charge, to any person
234e611897SNeil Armstrong *     obtaining a copy of this software and associated documentation
244e611897SNeil Armstrong *     files (the "Software"), to deal in the Software without
254e611897SNeil Armstrong *     restriction, including without limitation the rights to use,
264e611897SNeil Armstrong *     copy, modify, merge, publish, distribute, sublicense, and/or
274e611897SNeil Armstrong *     sell copies of the Software, and to permit persons to whom the
284e611897SNeil Armstrong *     Software is furnished to do so, subject to the following
294e611897SNeil Armstrong *     conditions:
304e611897SNeil Armstrong *
314e611897SNeil Armstrong *     The above copyright notice and this permission notice shall be
324e611897SNeil Armstrong *     included in all copies or substantial portions of the Software.
334e611897SNeil Armstrong *
344e611897SNeil Armstrong *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
354e611897SNeil Armstrong *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
364e611897SNeil Armstrong *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
374e611897SNeil Armstrong *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
384e611897SNeil Armstrong *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
394e611897SNeil Armstrong *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
404e611897SNeil Armstrong *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
414e611897SNeil Armstrong *     OTHER DEALINGS IN THE SOFTWARE.
424e611897SNeil Armstrong */
434e611897SNeil Armstrong
444e611897SNeil Armstrong/dts-v1/;
454e611897SNeil Armstrong
4682838e6fSNeil Armstrong#include <dt-bindings/input/input.h>
4782838e6fSNeil Armstrong
484e611897SNeil Armstrong#include "meson-gxm.dtsi"
494e611897SNeil Armstrong#include "meson-gx-p23x-q20x.dtsi"
504e611897SNeil Armstrong
514e611897SNeil Armstrong/ {
524e611897SNeil Armstrong	compatible = "amlogic,q200", "amlogic,s912", "amlogic,meson-gxm";
534e611897SNeil Armstrong	model = "Amlogic Meson GXM (S912) Q200 Development Board";
5482838e6fSNeil Armstrong
5582838e6fSNeil Armstrong	adc-keys {
5682838e6fSNeil Armstrong		compatible = "adc-keys";
5782838e6fSNeil Armstrong		io-channels = <&saradc 0>;
5882838e6fSNeil Armstrong		io-channel-names = "buttons";
5982838e6fSNeil Armstrong		keyup-threshold-microvolt = <1710000>;
6082838e6fSNeil Armstrong
6182838e6fSNeil Armstrong		button-function {
6282838e6fSNeil Armstrong			label = "Update";
6382838e6fSNeil Armstrong			linux,code = <KEY_VENDOR>;
6482838e6fSNeil Armstrong			press-threshold-microvolt = <10000>;
6582838e6fSNeil Armstrong		};
6682838e6fSNeil Armstrong	};
6782838e6fSNeil Armstrong
6882838e6fSNeil Armstrong	gpio-keys-polled {
6982838e6fSNeil Armstrong		compatible = "gpio-keys-polled";
7082838e6fSNeil Armstrong		#address-cells = <1>;
7182838e6fSNeil Armstrong		#size-cells = <0>;
7282838e6fSNeil Armstrong		poll-interval = <100>;
7382838e6fSNeil Armstrong
7482838e6fSNeil Armstrong		button@0 {
7582838e6fSNeil Armstrong			label = "power";
7682838e6fSNeil Armstrong			linux,code = <KEY_POWER>;
7782838e6fSNeil Armstrong			gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
7882838e6fSNeil Armstrong		};
7982838e6fSNeil Armstrong	};
8082838e6fSNeil Armstrong
8182838e6fSNeil Armstrong	vddio_ao18: regulator-vddio_ao18 {
8282838e6fSNeil Armstrong		compatible = "regulator-fixed";
8382838e6fSNeil Armstrong		regulator-name = "VDDIO_AO18";
8482838e6fSNeil Armstrong		regulator-min-microvolt = <1800000>;
8582838e6fSNeil Armstrong		regulator-max-microvolt = <1800000>;
8682838e6fSNeil Armstrong	};
874e611897SNeil Armstrong};
884e611897SNeil Armstrong
894e611897SNeil Armstrong/* Q200 has exclusive choice between internal or external PHY */
904e611897SNeil Armstrong&ethmac {
914e611897SNeil Armstrong	pinctrl-0 = <&eth_pins>;
924e611897SNeil Armstrong	pinctrl-names = "default";
934e611897SNeil Armstrong
944e611897SNeil Armstrong	/* Select external PHY by default */
954e611897SNeil Armstrong	phy-handle = <&external_phy>;
964e611897SNeil Armstrong
97093d23dbSMartin Blumenstingl	amlogic,tx-delay-ns = <2>;
98093d23dbSMartin Blumenstingl
994e611897SNeil Armstrong	/* External PHY reset is shared with internal PHY Led signals */
1004e611897SNeil Armstrong	snps,reset-gpio = <&gpio GPIOZ_14 0>;
1014e611897SNeil Armstrong	snps,reset-delays-us = <0 10000 1000000>;
1024e611897SNeil Armstrong	snps,reset-active-low;
1034e611897SNeil Armstrong
1044e611897SNeil Armstrong	/* External PHY is in RGMII */
1054e611897SNeil Armstrong	phy-mode = "rgmii";
1064e611897SNeil Armstrong};
1074e611897SNeil Armstrong
1084e611897SNeil Armstrong&external_mdio {
1094e611897SNeil Armstrong	external_phy: ethernet-phy@0 {
1104e611897SNeil Armstrong		compatible = "ethernet-phy-id001c.c916", "ethernet-phy-ieee802.3-c22";
1114e611897SNeil Armstrong		reg = <0>;
1124e611897SNeil Armstrong		max-speed = <1000>;
1134e611897SNeil Armstrong	};
1144e611897SNeil Armstrong};
11582838e6fSNeil Armstrong
11682838e6fSNeil Armstrong&saradc {
11782838e6fSNeil Armstrong	status = "okay";
11882838e6fSNeil Armstrong	vref-supply = <&vddio_ao18>;
11982838e6fSNeil Armstrong};
120