xref: /rk3399_rockchip-uboot/arch/arm/dts/stm32f746-disco.dts (revision 4eefb0070d73bdb72fcf4fa09534d91a7ebdb071)
1b1a8de7eSMichael Kurz/*
2b1a8de7eSMichael Kurz * Copyright 2016 - Michael Kurz <michi.kurz@gmail.com>
3fd198ee1SVikas Manocha * Copyright 2016 - Vikas MANOCHA <vikas.manocha@st.com>
4b1a8de7eSMichael Kurz *
5b1a8de7eSMichael Kurz * Based on:
6b1a8de7eSMichael Kurz * stm32f469-disco.dts from Linux
7b1a8de7eSMichael Kurz * Copyright 2016 - Lee Jones <lee.jones@linaro.org>
8b1a8de7eSMichael Kurz *
9b1a8de7eSMichael Kurz * This file is dual-licensed: you can use it either under the terms
10b1a8de7eSMichael Kurz * of the GPL or the X11 license, at your option. Note that this dual
11b1a8de7eSMichael Kurz * licensing only applies to this file, and not this project as a
12b1a8de7eSMichael Kurz * whole.
13b1a8de7eSMichael Kurz *
14b1a8de7eSMichael Kurz *  a) This file is free software; you can redistribute it and/or
15b1a8de7eSMichael Kurz *     modify it under the terms of the GNU General Public License as
16b1a8de7eSMichael Kurz *     published by the Free Software Foundation; either version 2 of the
17b1a8de7eSMichael Kurz *     License, or (at your option) any later version.
18b1a8de7eSMichael Kurz *
19b1a8de7eSMichael Kurz *     This file is distributed in the hope that it will be useful,
20b1a8de7eSMichael Kurz *     but WITHOUT ANY WARRANTY; without even the implied warranty of
21b1a8de7eSMichael Kurz *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22b1a8de7eSMichael Kurz *     GNU General Public License for more details.
23b1a8de7eSMichael Kurz *
24b1a8de7eSMichael Kurz * Or, alternatively,
25b1a8de7eSMichael Kurz *
26b1a8de7eSMichael Kurz *  b) Permission is hereby granted, free of charge, to any person
27b1a8de7eSMichael Kurz *     obtaining a copy of this software and associated documentation
28b1a8de7eSMichael Kurz *     files (the "Software"), to deal in the Software without
29b1a8de7eSMichael Kurz *     restriction, including without limitation the rights to use,
30b1a8de7eSMichael Kurz *     copy, modify, merge, publish, distribute, sublicense, and/or
31b1a8de7eSMichael Kurz *     sell copies of the Software, and to permit persons to whom the
32b1a8de7eSMichael Kurz *     Software is furnished to do so, subject to the following
33b1a8de7eSMichael Kurz *     conditions:
34b1a8de7eSMichael Kurz *
35b1a8de7eSMichael Kurz *     The above copyright notice and this permission notice shall be
36b1a8de7eSMichael Kurz *     included in all copies or substantial portions of the Software.
37b1a8de7eSMichael Kurz *
38b1a8de7eSMichael Kurz *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
39b1a8de7eSMichael Kurz *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
40b1a8de7eSMichael Kurz *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
41b1a8de7eSMichael Kurz *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
42b1a8de7eSMichael Kurz *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
43b1a8de7eSMichael Kurz *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
44b1a8de7eSMichael Kurz *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
45b1a8de7eSMichael Kurz *     OTHER DEALINGS IN THE SOFTWARE.
46b1a8de7eSMichael Kurz */
47b1a8de7eSMichael Kurz
48b1a8de7eSMichael Kurz/dts-v1/;
49b1a8de7eSMichael Kurz#include "stm32f746.dtsi"
506c9a1003SVikas Manocha#include <dt-bindings/memory/stm32-sdram.h>
51b1a8de7eSMichael Kurz
52b1a8de7eSMichael Kurz/ {
53b1a8de7eSMichael Kurz	model = "STMicroelectronics STM32F746-DISCO board";
54b1a8de7eSMichael Kurz	compatible = "st,stm32f746-disco", "st,stm32f746";
55b1a8de7eSMichael Kurz
56b1a8de7eSMichael Kurz	chosen {
57b1a8de7eSMichael Kurz		bootargs = "root=/dev/ram rdinit=/linuxrc";
58b1a8de7eSMichael Kurz		stdout-path = "serial0:115200n8";
59b1a8de7eSMichael Kurz	};
60b1a8de7eSMichael Kurz
61b1a8de7eSMichael Kurz	memory {
62b1a8de7eSMichael Kurz		reg = <0xC0000000 0x800000>;
63b1a8de7eSMichael Kurz	};
64b1a8de7eSMichael Kurz
65b1a8de7eSMichael Kurz	aliases {
6684bfdc17SVikas Manocha		serial0 = &usart1;
67b1a8de7eSMichael Kurz		spi0 = &qspi;
68d33a6a2fSVikas Manocha		/* Aliases for gpios so as to use sequence */
69d33a6a2fSVikas Manocha		gpio0 = &gpioa;
70d33a6a2fSVikas Manocha		gpio1 = &gpiob;
71d33a6a2fSVikas Manocha		gpio2 = &gpioc;
72d33a6a2fSVikas Manocha		gpio3 = &gpiod;
73d33a6a2fSVikas Manocha		gpio4 = &gpioe;
74d33a6a2fSVikas Manocha		gpio5 = &gpiof;
75d33a6a2fSVikas Manocha		gpio6 = &gpiog;
76d33a6a2fSVikas Manocha		gpio7 = &gpioh;
77d33a6a2fSVikas Manocha		gpio8 = &gpioi;
78d33a6a2fSVikas Manocha		gpio9 = &gpioj;
79d33a6a2fSVikas Manocha		gpio10 = &gpiok;
80b1a8de7eSMichael Kurz	};
812f80a9f7SVikas Manocha
822f80a9f7SVikas Manocha	led1 {
832f80a9f7SVikas Manocha		compatible = "st,led1";
842f80a9f7SVikas Manocha		led-gpio = <&gpioi 1 0>;
852f80a9f7SVikas Manocha	};
862f80a9f7SVikas Manocha
872f80a9f7SVikas Manocha	button1 {
882f80a9f7SVikas Manocha		compatible = "st,button1";
892f80a9f7SVikas Manocha		button-gpio = <&gpioi 11 0>;
902f80a9f7SVikas Manocha	};
91b1a8de7eSMichael Kurz};
92b1a8de7eSMichael Kurz
9384bfdc17SVikas Manocha&clk_hse {
9484bfdc17SVikas Manocha	clock-frequency = <25000000>;
9584bfdc17SVikas Manocha};
9684bfdc17SVikas Manocha
97*bd4a985fSVikas Manocha&pinctrl {
98*bd4a985fSVikas Manocha	usart1_pins_a: usart1@0	{
99*bd4a985fSVikas Manocha		pins1 {
100*bd4a985fSVikas Manocha		       pinmux = <STM32F746_PA9_FUNC_USART1_TX>;
101*bd4a985fSVikas Manocha				bias-disable;
102*bd4a985fSVikas Manocha				drive-push-pull;
103*bd4a985fSVikas Manocha				slew-rate = <2>;
104*bd4a985fSVikas Manocha		};
105*bd4a985fSVikas Manocha		pins2 {
106*bd4a985fSVikas Manocha			pinmux = <STM32F746_PB7_FUNC_USART1_RX>;
107*bd4a985fSVikas Manocha			bias-disable;
108*bd4a985fSVikas Manocha		};
109*bd4a985fSVikas Manocha	};
110*bd4a985fSVikas Manocha
111*bd4a985fSVikas Manocha	ethernet_mii: mii@0 {
112*bd4a985fSVikas Manocha	      pins {
113*bd4a985fSVikas Manocha		      pinmux = <STM32F746_PG13_FUNC_ETH_MII_TXD0_ETH_RMII_TXD0>,
114*bd4a985fSVikas Manocha			     <STM32F746_PG14_FUNC_ETH_MII_TXD1_ETH_RMII_TXD1>,
115*bd4a985fSVikas Manocha			     <STM32F746_PG11_FUNC_ETH_MII_TX_EN_ETH_RMII_TX_EN>,
116*bd4a985fSVikas Manocha			     <STM32F746_PA2_FUNC_ETH_MDIO>,
117*bd4a985fSVikas Manocha			     <STM32F746_PC1_FUNC_ETH_MDC>,
118*bd4a985fSVikas Manocha			     <STM32F746_PA1_FUNC_ETH_MII_RX_CLK_ETH_RMII_REF_CLK>,
119*bd4a985fSVikas Manocha			     <STM32F746_PA7_FUNC_ETH_MII_RX_DV_ETH_RMII_CRS_DV>,
120*bd4a985fSVikas Manocha			     <STM32F746_PC4_FUNC_ETH_MII_RXD0_ETH_RMII_RXD0>,
121*bd4a985fSVikas Manocha			     <STM32F746_PC5_FUNC_ETH_MII_RXD1_ETH_RMII_RXD1>;
122*bd4a985fSVikas Manocha		      slew-rate = <2>;
123*bd4a985fSVikas Manocha	      };
124*bd4a985fSVikas Manocha	};
125*bd4a985fSVikas Manocha
126*bd4a985fSVikas Manocha	qspi_pins: qspi@0 {
127*bd4a985fSVikas Manocha		pins {
128*bd4a985fSVikas Manocha			pinmux = <STM32F746_PB2_FUNC_QUADSPI_CLK>,
129*bd4a985fSVikas Manocha			       <STM32F746_PB6_FUNC_QUADSPI_BK1_NCS>,
130*bd4a985fSVikas Manocha			       <STM32F746_PD11_FUNC_QUADSPI_BK1_IO0>,
131*bd4a985fSVikas Manocha			       <STM32F746_PD12_FUNC_QUADSPI_BK1_IO1>,
132*bd4a985fSVikas Manocha			       <STM32F746_PD13_FUNC_QUADSPI_BK1_IO3>,
133*bd4a985fSVikas Manocha			       <STM32F746_PE2_FUNC_QUADSPI_BK1_IO2>;
134*bd4a985fSVikas Manocha			slew-rate = <2>;
135*bd4a985fSVikas Manocha		};
136*bd4a985fSVikas Manocha	};
137*bd4a985fSVikas Manocha
138*bd4a985fSVikas Manocha	fmc_pins: fmc@0 {
139*bd4a985fSVikas Manocha		pins {
140*bd4a985fSVikas Manocha			pinmux = <STM32F746_PD10_FUNC_FMC_D15>,
141*bd4a985fSVikas Manocha				 <STM32F746_PD9_FUNC_FMC_D14>,
142*bd4a985fSVikas Manocha				 <STM32F746_PD8_FUNC_FMC_D13>,
143*bd4a985fSVikas Manocha				 <STM32F746_PE15_FUNC_FMC_D12>,
144*bd4a985fSVikas Manocha				 <STM32F746_PE14_FUNC_FMC_D11>,
145*bd4a985fSVikas Manocha				 <STM32F746_PE13_FUNC_FMC_D10>,
146*bd4a985fSVikas Manocha				 <STM32F746_PE12_FUNC_FMC_D9>,
147*bd4a985fSVikas Manocha				 <STM32F746_PE11_FUNC_FMC_D8>,
148*bd4a985fSVikas Manocha				 <STM32F746_PE10_FUNC_FMC_D7>,
149*bd4a985fSVikas Manocha				 <STM32F746_PE9_FUNC_FMC_D6>,
150*bd4a985fSVikas Manocha				 <STM32F746_PE8_FUNC_FMC_D5>,
151*bd4a985fSVikas Manocha				 <STM32F746_PE7_FUNC_FMC_D4>,
152*bd4a985fSVikas Manocha				 <STM32F746_PD1_FUNC_FMC_D3>,
153*bd4a985fSVikas Manocha				 <STM32F746_PD0_FUNC_FMC_D2>,
154*bd4a985fSVikas Manocha				 <STM32F746_PD15_FUNC_FMC_D1>,
155*bd4a985fSVikas Manocha				 <STM32F746_PD14_FUNC_FMC_D0>,
156*bd4a985fSVikas Manocha
157*bd4a985fSVikas Manocha				 <STM32F746_PE1_FUNC_FMC_NBL1>,
158*bd4a985fSVikas Manocha				 <STM32F746_PE0_FUNC_FMC_NBL0>,
159*bd4a985fSVikas Manocha
160*bd4a985fSVikas Manocha				 <STM32F746_PG5_FUNC_FMC_A15_FMC_BA1>,
161*bd4a985fSVikas Manocha				 <STM32F746_PG4_FUNC_FMC_A14_FMC_BA0>,
162*bd4a985fSVikas Manocha
163*bd4a985fSVikas Manocha				 <STM32F746_PG1_FUNC_FMC_A11>,
164*bd4a985fSVikas Manocha				 <STM32F746_PG0_FUNC_FMC_A10>,
165*bd4a985fSVikas Manocha				 <STM32F746_PF15_FUNC_FMC_A9>,
166*bd4a985fSVikas Manocha				 <STM32F746_PF14_FUNC_FMC_A8>,
167*bd4a985fSVikas Manocha				 <STM32F746_PF13_FUNC_FMC_A7>,
168*bd4a985fSVikas Manocha				 <STM32F746_PF12_FUNC_FMC_A6>,
169*bd4a985fSVikas Manocha				 <STM32F746_PF5_FUNC_FMC_A5>,
170*bd4a985fSVikas Manocha				 <STM32F746_PF4_FUNC_FMC_A4>,
171*bd4a985fSVikas Manocha				 <STM32F746_PF3_FUNC_FMC_A3>,
172*bd4a985fSVikas Manocha				 <STM32F746_PF2_FUNC_FMC_A2>,
173*bd4a985fSVikas Manocha				 <STM32F746_PF1_FUNC_FMC_A1>,
174*bd4a985fSVikas Manocha				 <STM32F746_PF0_FUNC_FMC_A0>,
175*bd4a985fSVikas Manocha
176*bd4a985fSVikas Manocha				 <STM32F746_PH3_FUNC_FMC_SDNE0>,
177*bd4a985fSVikas Manocha				 <STM32F746_PH5_FUNC_FMC_SDNWE>,
178*bd4a985fSVikas Manocha				 <STM32F746_PF11_FUNC_FMC_SDNRAS>,
179*bd4a985fSVikas Manocha				 <STM32F746_PG15_FUNC_FMC_SDNCAS>,
180*bd4a985fSVikas Manocha				 <STM32F746_PC3_FUNC_FMC_SDCKE0>,
181*bd4a985fSVikas Manocha				 <STM32F746_PG8_FUNC_FMC_SDCLK>;
182*bd4a985fSVikas Manocha			  slew-rate = <2>;
183*bd4a985fSVikas Manocha		};
184*bd4a985fSVikas Manocha	};
185*bd4a985fSVikas Manocha};
186*bd4a985fSVikas Manocha
187e34e19feSVikas Manocha&usart1 {
188e34e19feSVikas Manocha	pinctrl-0 = <&usart1_pins_a>;
189e34e19feSVikas Manocha	pinctrl-names = "default";
190e34e19feSVikas Manocha	status = "okay";
191e34e19feSVikas Manocha};
192e34e19feSVikas Manocha
193fd198ee1SVikas Manocha&fmc {
194fd198ee1SVikas Manocha	pinctrl-0 = <&fmc_pins>;
195fd198ee1SVikas Manocha	pinctrl-names = "default";
196fd198ee1SVikas Manocha	status = "okay";
1976c9a1003SVikas Manocha
198bfea69adSVikas Manocha	/* Memory configuration from sdram datasheet MT48LC_4M32_B2B5-6A */
1996c9a1003SVikas Manocha	bank1: bank@0 {
200bfea69adSVikas Manocha	       st,sdram-control = /bits/ 8 <NO_COL_8 NO_ROW_12 MWIDTH_16 BANKS_4
201bfea69adSVikas Manocha	       				    CAS_3 SDCLK_2 RD_BURST_EN
202bfea69adSVikas Manocha					    RD_PIPE_DL_0>;
203bfea69adSVikas Manocha	       st,sdram-timing = /bits/ 8 <TMRD_2 TXSR_6 TRAS_4 TRC_6 TWR_2
204bfea69adSVikas Manocha	       				   TRP_2 TRCD_2>;
205bfea69adSVikas Manocha		/* refcount = (64msec/total_row_sdram)*freq - 20 */
206bfea69adSVikas Manocha	       st,sdram-refcount = < 1542 >;
2076c9a1003SVikas Manocha       };
208fd198ee1SVikas Manocha};
209fd198ee1SVikas Manocha
210b1a8de7eSMichael Kurz&mac {
211b1a8de7eSMichael Kurz	status = "okay";
212c428a958SVikas Manocha	pinctrl-0 = <&ethernet_mii>;
213b1a8de7eSMichael Kurz	phy-mode = "rmii";
214b1a8de7eSMichael Kurz	phy-handle = <&phy0>;
215b1a8de7eSMichael Kurz
216b1a8de7eSMichael Kurz	mdio0 {
217b1a8de7eSMichael Kurz		#address-cells = <1>;
218b1a8de7eSMichael Kurz		#size-cells = <0>;
219b1a8de7eSMichael Kurz		compatible = "snps,dwmac-mdio";
220b1a8de7eSMichael Kurz		phy0: ethernet-phy@0 {
221b1a8de7eSMichael Kurz			reg = <0>;
222b1a8de7eSMichael Kurz		};
223b1a8de7eSMichael Kurz	};
224b1a8de7eSMichael Kurz};
225b1a8de7eSMichael Kurz
226b1a8de7eSMichael Kurz&qspi {
227e245f1a5SVikas Manocha	pinctrl-0 = <&qspi_pins>;
228b1a8de7eSMichael Kurz	status = "okay";
229b1a8de7eSMichael Kurz
230b1a8de7eSMichael Kurz	qflash0: n25q128a {
231b1a8de7eSMichael Kurz			#address-cells = <1>;
232b1a8de7eSMichael Kurz			#size-cells = <1>;
233b1a8de7eSMichael Kurz			compatible = "micron,n25q128a13", "spi-flash";
234b1a8de7eSMichael Kurz			spi-max-frequency = <108000000>;
235b1a8de7eSMichael Kurz			spi-tx-bus-width = <1>;
236b1a8de7eSMichael Kurz			spi-rx-bus-width = <1>;
237b1a8de7eSMichael Kurz			memory-map = <0x90000000 0x1000000>;
238b1a8de7eSMichael Kurz			reg = <0>;
239b1a8de7eSMichael Kurz	};
240b1a8de7eSMichael Kurz};
241