xref: /freebsd-src/sys/contrib/device-tree/src/arm/st/stm32f746-disco.dts (revision aa1a8ff2d6dbc51ef058f46f3db5a8bb77967145)
1f126890aSEmmanuel Vadot/*
2f126890aSEmmanuel Vadot * Copyright 2017 - Vikas MANOCHA <vikas.manocha@st.com>
3f126890aSEmmanuel Vadot *
4f126890aSEmmanuel Vadot * This file is dual-licensed: you can use it either under the terms
5f126890aSEmmanuel Vadot * of the GPL or the X11 license, at your option. Note that this dual
6f126890aSEmmanuel Vadot * licensing only applies to this file, and not this project as a
7f126890aSEmmanuel Vadot * whole.
8f126890aSEmmanuel Vadot *
9f126890aSEmmanuel Vadot *  a) This file is free software; you can redistribute it and/or
10f126890aSEmmanuel Vadot *     modify it under the terms of the GNU General Public License as
11f126890aSEmmanuel Vadot *     published by the Free Software Foundation; either version 2 of the
12f126890aSEmmanuel Vadot *     License, or (at your option) any later version.
13f126890aSEmmanuel Vadot *
14f126890aSEmmanuel Vadot *     This file is distributed in the hope that it will be useful,
15f126890aSEmmanuel Vadot *     but WITHOUT ANY WARRANTY; without even the implied warranty of
16f126890aSEmmanuel Vadot *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17f126890aSEmmanuel Vadot *     GNU General Public License for more details.
18f126890aSEmmanuel Vadot *
19f126890aSEmmanuel Vadot * Or, alternatively,
20f126890aSEmmanuel Vadot *
21f126890aSEmmanuel Vadot *  b) Permission is hereby granted, free of charge, to any person
22f126890aSEmmanuel Vadot *     obtaining a copy of this software and associated documentation
23f126890aSEmmanuel Vadot *     files (the "Software"), to deal in the Software without
24f126890aSEmmanuel Vadot *     restriction, including without limitation the rights to use,
25f126890aSEmmanuel Vadot *     copy, modify, merge, publish, distribute, sublicense, and/or
26f126890aSEmmanuel Vadot *     sell copies of the Software, and to permit persons to whom the
27f126890aSEmmanuel Vadot *     Software is furnished to do so, subject to the following
28f126890aSEmmanuel Vadot *     conditions:
29f126890aSEmmanuel Vadot *
30f126890aSEmmanuel Vadot *     The above copyright notice and this permission notice shall be
31f126890aSEmmanuel Vadot *     included in all copies or substantial portions of the Software.
32f126890aSEmmanuel Vadot *
33f126890aSEmmanuel Vadot *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34f126890aSEmmanuel Vadot *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35f126890aSEmmanuel Vadot *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36f126890aSEmmanuel Vadot *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37f126890aSEmmanuel Vadot *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38f126890aSEmmanuel Vadot *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39f126890aSEmmanuel Vadot *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40f126890aSEmmanuel Vadot *     OTHER DEALINGS IN THE SOFTWARE.
41f126890aSEmmanuel Vadot */
42f126890aSEmmanuel Vadot
43f126890aSEmmanuel Vadot/dts-v1/;
44f126890aSEmmanuel Vadot#include "stm32f746.dtsi"
45f126890aSEmmanuel Vadot#include "stm32f746-pinctrl.dtsi"
46f126890aSEmmanuel Vadot#include <dt-bindings/gpio/gpio.h>
47*aa1a8ff2SEmmanuel Vadot#include <dt-bindings/input/input.h>
48*aa1a8ff2SEmmanuel Vadot#include <dt-bindings/interrupt-controller/irq.h>
49f126890aSEmmanuel Vadot
50f126890aSEmmanuel Vadot/ {
51f126890aSEmmanuel Vadot	model = "STMicroelectronics STM32F746-DISCO board";
52f126890aSEmmanuel Vadot	compatible = "st,stm32f746-disco", "st,stm32f746";
53f126890aSEmmanuel Vadot
54f126890aSEmmanuel Vadot	chosen {
55f126890aSEmmanuel Vadot		bootargs = "root=/dev/ram";
56f126890aSEmmanuel Vadot		stdout-path = "serial0:115200n8";
57f126890aSEmmanuel Vadot	};
58f126890aSEmmanuel Vadot
59f126890aSEmmanuel Vadot	memory@c0000000 {
60f126890aSEmmanuel Vadot		device_type = "memory";
61f126890aSEmmanuel Vadot		reg = <0xC0000000 0x800000>;
62f126890aSEmmanuel Vadot	};
63f126890aSEmmanuel Vadot
64*aa1a8ff2SEmmanuel Vadot	reserved-memory {
65*aa1a8ff2SEmmanuel Vadot		#address-cells = <1>;
66*aa1a8ff2SEmmanuel Vadot		#size-cells = <1>;
67*aa1a8ff2SEmmanuel Vadot		ranges;
68*aa1a8ff2SEmmanuel Vadot
69*aa1a8ff2SEmmanuel Vadot		linux,cma {
70*aa1a8ff2SEmmanuel Vadot			compatible = "shared-dma-pool";
71*aa1a8ff2SEmmanuel Vadot			no-map;
72*aa1a8ff2SEmmanuel Vadot			size = <0x80000>;
73*aa1a8ff2SEmmanuel Vadot			linux,dma-default;
74*aa1a8ff2SEmmanuel Vadot		};
75*aa1a8ff2SEmmanuel Vadot	};
76*aa1a8ff2SEmmanuel Vadot
77f126890aSEmmanuel Vadot	aliases {
78f126890aSEmmanuel Vadot		serial0 = &usart1;
79f126890aSEmmanuel Vadot	};
80f126890aSEmmanuel Vadot
81f126890aSEmmanuel Vadot	usbotg_hs_phy: usb-phy {
82f126890aSEmmanuel Vadot		#phy-cells = <0>;
83f126890aSEmmanuel Vadot		compatible = "usb-nop-xceiv";
84f126890aSEmmanuel Vadot		clocks = <&rcc 0 STM32F7_AHB1_CLOCK(OTGHSULPI)>;
85f126890aSEmmanuel Vadot		clock-names = "main_clk";
86f126890aSEmmanuel Vadot	};
87f126890aSEmmanuel Vadot
88f126890aSEmmanuel Vadot	/* This turns on vbus for otg fs for host mode (dwc2) */
89f126890aSEmmanuel Vadot	vcc5v_otg_fs: vcc5v-otg-fs-regulator {
90f126890aSEmmanuel Vadot		compatible = "regulator-fixed";
91f126890aSEmmanuel Vadot		gpio = <&gpiod 5 0>;
92f126890aSEmmanuel Vadot		regulator-name = "vcc5_host1";
93f126890aSEmmanuel Vadot		regulator-always-on;
94f126890aSEmmanuel Vadot	};
95f126890aSEmmanuel Vadot
96*aa1a8ff2SEmmanuel Vadot	vcc_3v3: vcc-3v3 {
97f126890aSEmmanuel Vadot		compatible = "regulator-fixed";
98*aa1a8ff2SEmmanuel Vadot		regulator-name = "vcc_3v3";
99f126890aSEmmanuel Vadot		regulator-min-microvolt = <3300000>;
100f126890aSEmmanuel Vadot		regulator-max-microvolt = <3300000>;
101f126890aSEmmanuel Vadot	};
102*aa1a8ff2SEmmanuel Vadot
103*aa1a8ff2SEmmanuel Vadot	backlight: backlight {
104*aa1a8ff2SEmmanuel Vadot		compatible = "gpio-backlight";
105*aa1a8ff2SEmmanuel Vadot		gpios = <&gpiok 3 GPIO_ACTIVE_HIGH>;
106*aa1a8ff2SEmmanuel Vadot		status = "okay";
107*aa1a8ff2SEmmanuel Vadot	};
108*aa1a8ff2SEmmanuel Vadot
109*aa1a8ff2SEmmanuel Vadot	panel_rgb: panel-rgb {
110*aa1a8ff2SEmmanuel Vadot		compatible = "rocktech,rk043fn48h";
111*aa1a8ff2SEmmanuel Vadot		power-supply = <&vcc_3v3>;
112*aa1a8ff2SEmmanuel Vadot		backlight = <&backlight>;
113*aa1a8ff2SEmmanuel Vadot		enable-gpios = <&gpioi 12 GPIO_ACTIVE_HIGH>;
114*aa1a8ff2SEmmanuel Vadot		status = "okay";
115*aa1a8ff2SEmmanuel Vadot		port {
116*aa1a8ff2SEmmanuel Vadot			panel_in_rgb: endpoint {
117*aa1a8ff2SEmmanuel Vadot				remote-endpoint = <&ltdc_out_rgb>;
118*aa1a8ff2SEmmanuel Vadot			};
119*aa1a8ff2SEmmanuel Vadot		};
120*aa1a8ff2SEmmanuel Vadot	};
121f126890aSEmmanuel Vadot};
122f126890aSEmmanuel Vadot
123f126890aSEmmanuel Vadot&clk_hse {
124f126890aSEmmanuel Vadot	clock-frequency = <25000000>;
125f126890aSEmmanuel Vadot};
126f126890aSEmmanuel Vadot
127f126890aSEmmanuel Vadot&i2c1 {
128f126890aSEmmanuel Vadot	pinctrl-0 = <&i2c1_pins_b>;
129f126890aSEmmanuel Vadot	pinctrl-names = "default";
130f126890aSEmmanuel Vadot	i2c-scl-rising-time-ns = <185>;
131f126890aSEmmanuel Vadot	i2c-scl-falling-time-ns = <20>;
132f126890aSEmmanuel Vadot	status = "okay";
133f126890aSEmmanuel Vadot};
134f126890aSEmmanuel Vadot
135*aa1a8ff2SEmmanuel Vadot&i2c3 {
136*aa1a8ff2SEmmanuel Vadot	pinctrl-0 = <&i2c3_pins_a>;
137*aa1a8ff2SEmmanuel Vadot	pinctrl-names = "default";
138*aa1a8ff2SEmmanuel Vadot	clock-frequency = <400000>;
139*aa1a8ff2SEmmanuel Vadot	status = "okay";
140*aa1a8ff2SEmmanuel Vadot
141*aa1a8ff2SEmmanuel Vadot	touchscreen@38 {
142*aa1a8ff2SEmmanuel Vadot		compatible = "edt,edt-ft5306";
143*aa1a8ff2SEmmanuel Vadot		reg = <0x38>;
144*aa1a8ff2SEmmanuel Vadot		interrupt-parent = <&gpioi>;
145*aa1a8ff2SEmmanuel Vadot		interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
146*aa1a8ff2SEmmanuel Vadot		touchscreen-size-x = <480>;
147*aa1a8ff2SEmmanuel Vadot		touchscreen-size-y = <272>;
148*aa1a8ff2SEmmanuel Vadot	};
149*aa1a8ff2SEmmanuel Vadot};
150*aa1a8ff2SEmmanuel Vadot
151*aa1a8ff2SEmmanuel Vadot&ltdc {
152*aa1a8ff2SEmmanuel Vadot	pinctrl-0 = <&ltdc_pins_a>;
153*aa1a8ff2SEmmanuel Vadot	pinctrl-names = "default";
154*aa1a8ff2SEmmanuel Vadot	status = "okay";
155*aa1a8ff2SEmmanuel Vadot
156*aa1a8ff2SEmmanuel Vadot	port {
157*aa1a8ff2SEmmanuel Vadot		ltdc_out_rgb: endpoint {
158*aa1a8ff2SEmmanuel Vadot			remote-endpoint = <&panel_in_rgb>;
159*aa1a8ff2SEmmanuel Vadot		};
160*aa1a8ff2SEmmanuel Vadot	};
161*aa1a8ff2SEmmanuel Vadot};
162*aa1a8ff2SEmmanuel Vadot
163f126890aSEmmanuel Vadot&sdio1 {
164f126890aSEmmanuel Vadot	status = "okay";
165*aa1a8ff2SEmmanuel Vadot	vmmc-supply = <&vcc_3v3>;
166f126890aSEmmanuel Vadot	cd-gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
167f126890aSEmmanuel Vadot	pinctrl-names = "default", "opendrain";
168f126890aSEmmanuel Vadot	pinctrl-0 = <&sdio_pins_a>;
169f126890aSEmmanuel Vadot	pinctrl-1 = <&sdio_pins_od_a>;
170f126890aSEmmanuel Vadot	bus-width = <4>;
171f126890aSEmmanuel Vadot};
172f126890aSEmmanuel Vadot
173f126890aSEmmanuel Vadot&timers5 {
174f126890aSEmmanuel Vadot	/* Override timer5 to act as clockevent */
175f126890aSEmmanuel Vadot	compatible = "st,stm32-timer";
176f126890aSEmmanuel Vadot	interrupts = <50>;
177f126890aSEmmanuel Vadot	status = "okay";
178f126890aSEmmanuel Vadot	/delete-property/#address-cells;
179f126890aSEmmanuel Vadot	/delete-property/#size-cells;
180f126890aSEmmanuel Vadot	/delete-property/clock-names;
181f126890aSEmmanuel Vadot	/delete-node/pwm;
182f126890aSEmmanuel Vadot	/delete-node/timer@4;
183f126890aSEmmanuel Vadot};
184f126890aSEmmanuel Vadot
185f126890aSEmmanuel Vadot&usart1 {
186f126890aSEmmanuel Vadot	pinctrl-0 = <&usart1_pins_b>;
187f126890aSEmmanuel Vadot	pinctrl-names = "default";
188f126890aSEmmanuel Vadot	status = "okay";
189f126890aSEmmanuel Vadot};
190f126890aSEmmanuel Vadot
191f126890aSEmmanuel Vadot&usbotg_fs {
192f126890aSEmmanuel Vadot	dr_mode = "host";
193f126890aSEmmanuel Vadot	pinctrl-0 = <&usbotg_fs_pins_a>;
194f126890aSEmmanuel Vadot	pinctrl-names = "default";
195f126890aSEmmanuel Vadot	status = "okay";
196f126890aSEmmanuel Vadot};
197f126890aSEmmanuel Vadot
198f126890aSEmmanuel Vadot&usbotg_hs {
199f126890aSEmmanuel Vadot	dr_mode = "host";
200f126890aSEmmanuel Vadot	phys = <&usbotg_hs_phy>;
201f126890aSEmmanuel Vadot	phy-names = "usb2-phy";
202f126890aSEmmanuel Vadot	pinctrl-0 = <&usbotg_hs_pins_b>;
203f126890aSEmmanuel Vadot	pinctrl-names = "default";
204f126890aSEmmanuel Vadot	status = "okay";
205f126890aSEmmanuel Vadot};
206