162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * Device Tree file for Compulab SBC-A510 Single Board Computer
362306a36Sopenharmony_ci *
462306a36Sopenharmony_ci * Copyright (C) 2015, Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci * This file is dual-licensed: you can use it either under the terms
762306a36Sopenharmony_ci * of the GPL or the X11 license, at your option. Note that this dual
862306a36Sopenharmony_ci * licensing only applies to this file, and not this project as a
962306a36Sopenharmony_ci * whole.
1062306a36Sopenharmony_ci *
1162306a36Sopenharmony_ci *  a) This file is free software; you can redistribute it and/or
1262306a36Sopenharmony_ci *     modify it under the terms of the GNU General Public License as
1362306a36Sopenharmony_ci *     published by the Free Software Foundation; version 2 of the
1462306a36Sopenharmony_ci *     License.
1562306a36Sopenharmony_ci *
1662306a36Sopenharmony_ci *     This file is distributed in the hope that it will be useful,
1762306a36Sopenharmony_ci *     but WITHOUT ANY WARRANTY; without even the implied warranty of
1862306a36Sopenharmony_ci *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1962306a36Sopenharmony_ci *     GNU General Public License for more details.
2062306a36Sopenharmony_ci *
2162306a36Sopenharmony_ci * Or, alternatively,
2262306a36Sopenharmony_ci *
2362306a36Sopenharmony_ci *  b) Permission is hereby granted, free of charge, to any person
2462306a36Sopenharmony_ci *     obtaining a copy of this software and associated documentation
2562306a36Sopenharmony_ci *     files (the "Software"), to deal in the Software without
2662306a36Sopenharmony_ci *     restriction, including without limitation the rights to use,
2762306a36Sopenharmony_ci *     copy, modify, merge, publish, distribute, sublicense, and/or
2862306a36Sopenharmony_ci *     sell copies of the Software, and to permit persons to whom the
2962306a36Sopenharmony_ci *     Software is furnished to do so, subject to the following
3062306a36Sopenharmony_ci *     conditions:
3162306a36Sopenharmony_ci *
3262306a36Sopenharmony_ci *     The above copyright notice and this permission notice shall be
3362306a36Sopenharmony_ci *     included in all copies or substantial portions of the Software.
3462306a36Sopenharmony_ci *
3562306a36Sopenharmony_ci *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3662306a36Sopenharmony_ci *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
3762306a36Sopenharmony_ci *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
3862306a36Sopenharmony_ci *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
3962306a36Sopenharmony_ci *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
4062306a36Sopenharmony_ci *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
4162306a36Sopenharmony_ci *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
4262306a36Sopenharmony_ci *     OTHER DEALINGS IN THE SOFTWARE.
4362306a36Sopenharmony_ci */
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ci/*
4662306a36Sopenharmony_ci * SBC-A510 comprises a PCA9555 I2C GPIO expander its GPIO lines connected to
4762306a36Sopenharmony_ci *
4862306a36Sopenharmony_ci * 0.0 USB0 VBUS_EN (active high)
4962306a36Sopenharmony_ci * 0.1 USB0 VBUS_GOOD
5062306a36Sopenharmony_ci * 0.2 DVI transmitter TI TFP410 MSEN
5162306a36Sopenharmony_ci * 0.3 DVI transmitter TI TFP410 PD# (active low power down)
5262306a36Sopenharmony_ci * 0.4 LVDS transmitter DS90C365 PD# (active low power down)
5362306a36Sopenharmony_ci * 0.5 LCD nRST (active low reset)
5462306a36Sopenharmony_ci * 0.6 PCIe0 nRST (active low reset)
5562306a36Sopenharmony_ci * 0.7 mini-PCIe slot W_DISABLE#
5662306a36Sopenharmony_ci *
5762306a36Sopenharmony_ci * 1.0 MMC WP
5862306a36Sopenharmony_ci * 1.1 Camera Input FPC FLASH_STB and P21.5
5962306a36Sopenharmony_ci * 1.2 Camera Input FPC WE        and P21.22
6062306a36Sopenharmony_ci * 1.3 MMC VCC_EN (active high)   and P21.7
6162306a36Sopenharmony_ci * 1.4 Camera Input FPC AFTR_RST  and P21.17
6262306a36Sopenharmony_ci * 1.5 Camera Input FPC OE        and P21.19
6362306a36Sopenharmony_ci * 1.6 Camera Input FPC SNPSHT    and P21.6
6462306a36Sopenharmony_ci * 1.7 Camera Input FPC SHTR      and P21.10
6562306a36Sopenharmony_ci */
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_ci/dts-v1/;
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_ci#include "dove-cm-a510.dtsi"
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_ci/ {
7262306a36Sopenharmony_ci	model = "Compulab SBC-A510";
7362306a36Sopenharmony_ci	compatible = "compulab,sbc-a510", "compulab,cm-a510", "marvell,dove";
7462306a36Sopenharmony_ci
7562306a36Sopenharmony_ci	chosen {
7662306a36Sopenharmony_ci		stdout-path = &uart0;
7762306a36Sopenharmony_ci	};
7862306a36Sopenharmony_ci
7962306a36Sopenharmony_ci	usb0_power: regulator-2 {
8062306a36Sopenharmony_ci		compatible = "regulator-fixed";
8162306a36Sopenharmony_ci		regulator-name = "USB Power";
8262306a36Sopenharmony_ci		regulator-min-microvolt = <5000000>;
8362306a36Sopenharmony_ci		regulator-max-microvolt = <5000000>;
8462306a36Sopenharmony_ci		gpio = <&gpio_ext 0 GPIO_ACTIVE_HIGH>;
8562306a36Sopenharmony_ci	};
8662306a36Sopenharmony_ci
8762306a36Sopenharmony_ci	mmc_power: regulator-3 {
8862306a36Sopenharmony_ci		compatible = "regulator-fixed";
8962306a36Sopenharmony_ci		regulator-name = "MMC Power";
9062306a36Sopenharmony_ci		regulator-min-microvolt = <3300000>;
9162306a36Sopenharmony_ci		regulator-max-microvolt = <3300000>;
9262306a36Sopenharmony_ci		gpio = <&gpio_ext 13 GPIO_ACTIVE_HIGH>;
9362306a36Sopenharmony_ci	};
9462306a36Sopenharmony_ci};
9562306a36Sopenharmony_ci
9662306a36Sopenharmony_ci/* Ethernet0 depends on CM-A510 option E1 */
9762306a36Sopenharmony_ci&mdio { status = "disabled"; };
9862306a36Sopenharmony_ci&eth { status = "disabled"; };
9962306a36Sopenharmony_ci&ethphy { status = "disabled"; };
10062306a36Sopenharmony_ci
10162306a36Sopenharmony_ci/*
10262306a36Sopenharmony_ci * USB port 0 can be powered and monitored by I2C GPIO expander:
10362306a36Sopenharmony_ci *  VBUS_ENABLE on GPIO0, VBUS_GOOD on GPIO1
10462306a36Sopenharmony_ci */
10562306a36Sopenharmony_ci&ehci0 {
10662306a36Sopenharmony_ci	status = "okay";
10762306a36Sopenharmony_ci	vbus-supply = <&usb0_power>;
10862306a36Sopenharmony_ci};
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_ci/* USB port 1 (and ports 2, 3 if CM-A510 has U4 option) */
11162306a36Sopenharmony_ci&ehci1 { status = "okay"; };
11262306a36Sopenharmony_ci
11362306a36Sopenharmony_ci/*
11462306a36Sopenharmony_ci * I2C bus layout:
11562306a36Sopenharmony_ci * i2c0:
11662306a36Sopenharmony_ci *  - Audio Codec, 0x1a (option from CM-A510)
11762306a36Sopenharmony_ci *  - DVI transmitter TI TFP410, 0x39
11862306a36Sopenharmony_ci *  - HDMI/DVI DDC channel
11962306a36Sopenharmony_ci * i2c1:
12062306a36Sopenharmony_ci *  - GPIO expander, NXP PCA9555, 0x20
12162306a36Sopenharmony_ci *  - VGA DDC channel
12262306a36Sopenharmony_ci */
12362306a36Sopenharmony_ci&i2c {
12462306a36Sopenharmony_ci	pinctrl-0 = <&pmx_i2c1>;
12562306a36Sopenharmony_ci	pinctrl-names = "default";
12662306a36Sopenharmony_ci};
12762306a36Sopenharmony_ci
12862306a36Sopenharmony_ci&i2c0 {
12962306a36Sopenharmony_ci	/* TI TFP410 DVI transmitter */
13062306a36Sopenharmony_ci	dvi: video@39 {
13162306a36Sopenharmony_ci		compatible = "ti,tfp410";
13262306a36Sopenharmony_ci		reg = <0x39>;
13362306a36Sopenharmony_ci		powerdown-gpio = <&gpio_ext 3 GPIO_ACTIVE_LOW>;
13462306a36Sopenharmony_ci	};
13562306a36Sopenharmony_ci};
13662306a36Sopenharmony_ci
13762306a36Sopenharmony_ci&i2c1 {
13862306a36Sopenharmony_ci	status = "okay";
13962306a36Sopenharmony_ci
14062306a36Sopenharmony_ci	/* NXP PCA9555 GPIO expander */
14162306a36Sopenharmony_ci	gpio_ext: gpio@20 {
14262306a36Sopenharmony_ci		compatible = "nxp,pca9555";
14362306a36Sopenharmony_ci		reg = <0x20>;
14462306a36Sopenharmony_ci		gpio-controller;
14562306a36Sopenharmony_ci		#gpio-cells = <2>;
14662306a36Sopenharmony_ci	};
14762306a36Sopenharmony_ci};
14862306a36Sopenharmony_ci
14962306a36Sopenharmony_ci&pcie { status = "okay"; };
15062306a36Sopenharmony_ci
15162306a36Sopenharmony_ci/*
15262306a36Sopenharmony_ci * PCIe0 can be configured by Jumper E1 to be either connected to
15362306a36Sopenharmony_ci * a mini-PCIe slot or a Pericom PI7C9X111 PCIe-to-PCI bridge.
15462306a36Sopenharmony_ci */
15562306a36Sopenharmony_ci&pcie0 {
15662306a36Sopenharmony_ci	status = "okay";
15762306a36Sopenharmony_ci	pinctrl-0 = <&pmx_pcie0_clkreq>;
15862306a36Sopenharmony_ci	pinctrl-names = "default";
15962306a36Sopenharmony_ci	reset-gpios = <&gpio_ext 6 GPIO_ACTIVE_LOW>;
16062306a36Sopenharmony_ci};
16162306a36Sopenharmony_ci
16262306a36Sopenharmony_ci/* Ethernet1 depends on CM-A510 option E2 */
16362306a36Sopenharmony_ci&pcie1 { status = "disabled"; };
16462306a36Sopenharmony_ci
16562306a36Sopenharmony_ci/* SATA connector */
16662306a36Sopenharmony_ci&sata0 { status = "okay"; };
16762306a36Sopenharmony_ci
16862306a36Sopenharmony_ci/*
16962306a36Sopenharmony_ci * SDIO0 is connected to a MMC/SD/SDIO socket, I2C GPIO expander has
17062306a36Sopenharmony_ci *  VCC_MMC_ENABLE on GPIO13, MMC_WP on GPIO10
17162306a36Sopenharmony_ci */
17262306a36Sopenharmony_ci&sdio0 {
17362306a36Sopenharmony_ci	vmmc-supply = <&mmc_power>;
17462306a36Sopenharmony_ci	wp-gpios = <&gpio_ext 10 GPIO_ACTIVE_LOW>;
17562306a36Sopenharmony_ci	status = "okay";
17662306a36Sopenharmony_ci};
17762306a36Sopenharmony_ci
17862306a36Sopenharmony_ci/* UART0 on RS232 mini-connector */
17962306a36Sopenharmony_ci&uart0 { status = "okay"; };
18062306a36Sopenharmony_ci/* UART2 on pin headers */
18162306a36Sopenharmony_ci&uart2 { status = "okay"; };
182