blob: d7b78cdcfa9294b821abdb43dc31250b4983c554 [file] [log] [blame]
Marek Vasut5ff05292020-01-24 18:39:16 +01001// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
2/*
3 * Copyright (C) 2019 Marek Vasut <marex@denx.de>
4 */
5
6#include <dt-bindings/clock/stm32mp1-clksrc.h>
Patrick Delaunay48c5e902020-03-06 17:54:41 +01007#include "stm32mp15-u-boot.dtsi"
Marek Vasut272198e2020-04-29 15:08:38 +02008#include "stm32mp15-ddr3-dhsom-2x1Gb-1066-binG.dtsi"
9#include "stm32mp15-ddr3-dhsom-2x2Gb-1066-binG.dtsi"
10#include "stm32mp15-ddr3-dhsom-2x4Gb-1066-binG.dtsi"
Marek Vasut5ff05292020-01-24 18:39:16 +010011
12/ {
13 aliases {
14 i2c1 = &i2c2;
15 i2c3 = &i2c4;
16 i2c4 = &i2c5;
17 mmc0 = &sdmmc1;
18 mmc1 = &sdmmc2;
19 spi0 = &qspi;
20 usb0 = &usbotg_hs;
Marek Vasut7d2757f2021-12-30 23:46:47 +010021 eeprom0 = &eeprom0;
Marek Vasut5ff05292020-01-24 18:39:16 +010022 };
23
24 config {
25 u-boot,boot-led = "heartbeat";
26 u-boot,error-led = "error";
Marek Vasut47b98ba2020-04-22 13:18:11 +020027 dh,som-coding-gpios = <&gpiof 12 0>, <&gpiof 13 0>, <&gpiof 15 0>;
Marek Vasut39221b52020-04-22 13:18:14 +020028 dh,ddr3-coding-gpios = <&gpioz 6 0>, <&gpioz 7 0>;
Marek Vasut35516542024-06-06 15:01:48 +020029 dh,mac-coding-gpios = <&gpioc 3 0>;
Marek Vasut5ff05292020-01-24 18:39:16 +010030 };
Marek Vasut5ff05292020-01-24 18:39:16 +010031};
32
Marek Vasut7d2757f2021-12-30 23:46:47 +010033&ethernet0 {
34 phy-reset-gpios = <&gpioh 3 GPIO_ACTIVE_LOW>;
35 /delete-property/ st,eth-ref-clk-sel;
36};
37
38&ethernet0_rmii_pins_a {
39 pins1 {
40 pinmux = <STM32_PINMUX('G', 13, AF11)>, /* ETH1_RMII_TXD0 */
41 <STM32_PINMUX('G', 14, AF11)>, /* ETH1_RMII_TXD1 */
42 <STM32_PINMUX('B', 11, AF11)>, /* ETH1_RMII_TX_EN */
43 <STM32_PINMUX('A', 1, AF11)>, /* ETH1_RMII_REF_CLK */
44 <STM32_PINMUX('A', 2, AF11)>, /* ETH1_MDIO */
45 <STM32_PINMUX('C', 1, AF11)>; /* ETH1_MDC */
46 };
47};
48
Marek Vasut5ff05292020-01-24 18:39:16 +010049&i2c4 {
Simon Glassd3a98cb2023-02-13 08:56:33 -070050 bootph-all;
51 bootph-pre-ram;
Marek Vasut7d2757f2021-12-30 23:46:47 +010052
53 eeprom0: eeprom@50 {
54 };
Marek Vasut5ff05292020-01-24 18:39:16 +010055};
56
57&i2c4_pins_a {
Simon Glassd3a98cb2023-02-13 08:56:33 -070058 bootph-all;
Marek Vasut5ff05292020-01-24 18:39:16 +010059 pins {
Simon Glassd3a98cb2023-02-13 08:56:33 -070060 bootph-all;
Marek Vasut5ff05292020-01-24 18:39:16 +010061 };
62};
63
Marek Vasut7d2757f2021-12-30 23:46:47 +010064&phy0 {
65 /delete-property/ reset-gpios;
66};
67
Marek Vasut0839ea92020-03-28 02:01:58 +010068&pinctrl {
Marek Vasutccfcde32020-12-01 11:34:48 +010069 mco2_pins_a: mco2-0 {
70 pins {
71 pinmux = <STM32_PINMUX('G', 2, AF1)>; /* MCO2 */
72 bias-disable;
73 drive-push-pull;
74 slew-rate = <2>;
75 };
76 };
77
78 mco2_sleep_pins_a: mco2-sleep-0 {
79 pins {
80 pinmux = <STM32_PINMUX('G', 2, ANALOG)>; /* MCO2 */
81 };
82 };
Marek Vasut0839ea92020-03-28 02:01:58 +010083};
84
Marek Vasut5ff05292020-01-24 18:39:16 +010085&pmic {
Simon Glassd3a98cb2023-02-13 08:56:33 -070086 bootph-all;
87 bootph-pre-ram;
Marek Vasut8b642302022-03-14 13:35:54 +010088
89 regulators {
Simon Glassd3a98cb2023-02-13 08:56:33 -070090 bootph-pre-ram;
Marek Vasut8b642302022-03-14 13:35:54 +010091 };
Marek Vasut5ff05292020-01-24 18:39:16 +010092};
93
94&flash0 {
Simon Glassd3a98cb2023-02-13 08:56:33 -070095 bootph-pre-ram;
Patrick Delaunayf172bcb2023-06-08 17:16:48 +020096
97 partitions {
98 compatible = "fixed-partitions";
99 #address-cells = <1>;
100 #size-cells = <1>;
101
102 partition@0 {
103 label = "fsbl1";
104 reg = <0x00000000 0x00040000>;
105 };
106 partition@40000 {
107 label = "fsbl2";
108 reg = <0x00040000 0x00040000>;
109 };
Patrice Chotard29c1e7b2024-03-08 14:50:09 +0100110 partition@80000 {
Patrick Delaunayf172bcb2023-06-08 17:16:48 +0200111 label = "uboot";
112 reg = <0x00080000 0x00160000>;
113 };
Patrice Chotard29c1e7b2024-03-08 14:50:09 +0100114 partition@1e0000 {
Patrick Delaunayf172bcb2023-06-08 17:16:48 +0200115 label = "env1";
116 reg = <0x001E0000 0x00010000>;
117 };
Patrice Chotard29c1e7b2024-03-08 14:50:09 +0100118 partition@1f0000 {
Patrick Delaunayf172bcb2023-06-08 17:16:48 +0200119 label = "env2";
120 reg = <0x001F0000 0x00010000>;
121 };
122 };
Marek Vasut5ff05292020-01-24 18:39:16 +0100123};
124
125&qspi {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700126 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100127};
128
129&qspi_clk_pins_a {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700130 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100131 pins {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700132 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100133 };
134};
135
136&qspi_bk1_pins_a {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700137 bootph-pre-ram;
Marek Vasut3f3375c2023-10-10 01:15:51 +0200138 pins {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700139 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100140 };
Marek Vasut5ff05292020-01-24 18:39:16 +0100141};
142
Marek Vasut3f3375c2023-10-10 01:15:51 +0200143&qspi_cs1_pins_a {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700144 bootph-pre-ram;
Marek Vasut3f3375c2023-10-10 01:15:51 +0200145 pins {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700146 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100147 };
148};
149
150&rcc {
Marek Vasutb30b1592023-07-27 01:58:07 +0200151 /*
152 * Reinstate clock names from stm32mp151.dtsi, the MCO2 trick
153 * used in stm32mp15xx-dhcom-som.dtsi is not supported by the
154 * U-Boot clock framework.
155 */
156 clock-names = "hse", "hsi", "csi", "lse", "lsi";
157 clocks = <&clk_hse>, <&clk_hsi>, <&clk_csi>,
158 <&clk_lse>, <&clk_lsi>;
159
160 /* The MCO2 is already configured correctly, remove those. */
161 /delete-property/ assigned-clocks;
162 /delete-property/ assigned-clock-parents;
163 /delete-property/ assigned-clock-rates;
164
Marek Vasut5ff05292020-01-24 18:39:16 +0100165 st,clksrc = <
166 CLK_MPU_PLL1P
167 CLK_AXI_PLL2P
168 CLK_MCU_PLL3P
169 CLK_PLL12_HSE
170 CLK_PLL3_HSE
171 CLK_PLL4_HSE
172 CLK_RTC_LSE
173 CLK_MCO1_DISABLED
Marek Vasutccfcde32020-12-01 11:34:48 +0100174 CLK_MCO2_PLL4P
Marek Vasut5ff05292020-01-24 18:39:16 +0100175 >;
176
177 st,clkdiv = <
178 1 /*MPU*/
179 0 /*AXI*/
180 0 /*MCU*/
181 1 /*APB1*/
182 1 /*APB2*/
183 1 /*APB3*/
184 1 /*APB4*/
185 2 /*APB5*/
186 23 /*RTC*/
187 0 /*MCO1*/
Marek Vasutccfcde32020-12-01 11:34:48 +0100188 1 /*MCO2*/
Marek Vasut5ff05292020-01-24 18:39:16 +0100189 >;
190
191 st,pkcs = <
192 CLK_CKPER_HSE
193 CLK_FMC_ACLK
194 CLK_QSPI_ACLK
195 CLK_ETH_PLL4P
196 CLK_SDMMC12_PLL4P
197 CLK_DSI_DSIPLL
198 CLK_STGEN_HSE
199 CLK_USBPHY_HSE
200 CLK_SPI2S1_PLL3Q
201 CLK_SPI2S23_PLL3Q
202 CLK_SPI45_HSI
203 CLK_SPI6_HSI
204 CLK_I2C46_HSI
205 CLK_SDMMC3_PLL4P
206 CLK_USBO_USBPHY
207 CLK_ADC_CKPER
208 CLK_CEC_LSE
209 CLK_I2C12_HSI
210 CLK_I2C35_HSI
211 CLK_UART1_HSI
212 CLK_UART24_HSI
213 CLK_UART35_HSI
214 CLK_UART6_HSI
215 CLK_UART78_HSI
216 CLK_SPDIF_PLL4P
Antonio Borneo84159e82020-01-28 10:11:01 +0100217 CLK_FDCAN_PLL4R
Marek Vasut5ff05292020-01-24 18:39:16 +0100218 CLK_SAI1_PLL3Q
219 CLK_SAI2_PLL3Q
220 CLK_SAI3_PLL3Q
221 CLK_SAI4_PLL3Q
222 CLK_RNG1_LSI
223 CLK_RNG2_LSI
224 CLK_LPTIM1_PCLK1
225 CLK_LPTIM23_PCLK3
226 CLK_LPTIM45_LSE
227 >;
228
Marek Vasut086fa932022-10-11 22:42:44 +0200229 /*
230 * cfg = < DIVM1 DIVN P Q R PQR(p,q,r) >;
231 * frac = < f >;
232 *
233 * PRQ(p,q,r) ... for p,q,r: 0-output disabled / 1-output enabled
234 * DIVN ... actually multiplier, but RCC_PLL1CFGR1 calls the field DIVN
235 * m ... for PLL1,2: m=2 ; for PLL3,4: m=1
236 * XTAL = 24 MHz
237 *
238 * VCO = ( XTAL / (DIVM1 + 1) ) * m * ( DIVN + 1 + ( f / 8192 ) )
239 * P = VCO / (P + 1)
240 * Q = VCO / (Q + 1)
241 * R = VCO / (R + 1)
242 */
243
Marek Vasut5ff05292020-01-24 18:39:16 +0100244 /* VCO = 1066.0 MHz => P = 266 (AXI), Q = 533 (GPU), R = 533 (DDR) */
245 pll2: st,pll@1 {
Patrick Delaunayc22caac2020-01-28 10:11:03 +0100246 compatible = "st,stm32mp1-pll";
247 reg = <1>;
Marek Vasut5ff05292020-01-24 18:39:16 +0100248 cfg = < 2 65 1 0 0 PQR(1,1,1) >;
249 frac = < 0x1400 >;
Simon Glassd3a98cb2023-02-13 08:56:33 -0700250 bootph-all;
Marek Vasut5ff05292020-01-24 18:39:16 +0100251 };
252
253 /* VCO = 417.8 MHz => P = 209, Q = 24, R = 11 */
254 pll3: st,pll@2 {
Patrick Delaunayc22caac2020-01-28 10:11:03 +0100255 compatible = "st,stm32mp1-pll";
256 reg = <2>;
Marek Vasut5ff05292020-01-24 18:39:16 +0100257 cfg = < 1 33 1 16 36 PQR(1,1,1) >;
258 frac = < 0x1a04 >;
Simon Glassd3a98cb2023-02-13 08:56:33 -0700259 bootph-all;
Marek Vasut5ff05292020-01-24 18:39:16 +0100260 };
261
Marek Vasut086fa932022-10-11 22:42:44 +0200262 /* VCO = 600.0 MHz => P = 100, Q = 50, R = 50 */
Marek Vasut5ff05292020-01-24 18:39:16 +0100263 pll4: st,pll@3 {
Patrick Delaunayc22caac2020-01-28 10:11:03 +0100264 compatible = "st,stm32mp1-pll";
265 reg = <3>;
Marek Vasutccfcde32020-12-01 11:34:48 +0100266 cfg = < 1 49 5 11 11 PQR(1,1,1) >;
Simon Glassd3a98cb2023-02-13 08:56:33 -0700267 bootph-all;
Marek Vasut5ff05292020-01-24 18:39:16 +0100268 };
269};
270
271&sdmmc1 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700272 bootph-pre-ram;
Marek Vasut5f5ce602021-11-13 03:29:44 +0100273 st,use-ckin;
274 st,cmd-gpios = <&gpiod 2 0>;
275 st,ck-gpios = <&gpioc 12 0>;
276 st,ckin-gpios = <&gpioe 4 0>;
Marek Vasut5ff05292020-01-24 18:39:16 +0100277};
278
279&sdmmc1_b4_pins_a {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700280 bootph-pre-ram;
Patrick Delaunay48c5e902020-03-06 17:54:41 +0100281 pins1 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700282 bootph-pre-ram;
Patrick Delaunay48c5e902020-03-06 17:54:41 +0100283 };
284 pins2 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700285 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100286 };
287};
288
289&sdmmc1_dir_pins_a {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700290 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100291 pins1 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700292 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100293 };
294 pins2 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700295 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100296 };
297};
298
299&sdmmc2 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700300 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100301};
302
303&sdmmc2_b4_pins_a {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700304 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100305 pins {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700306 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100307 };
308};
309
310&sdmmc2_d47_pins_a {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700311 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100312 pins {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700313 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100314 };
315};
316
317&uart4 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700318 bootph-all;
Marek Vasut5ff05292020-01-24 18:39:16 +0100319};
320
321&uart4_pins_a {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700322 bootph-all;
Marek Vasut5ff05292020-01-24 18:39:16 +0100323 pins1 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700324 bootph-all;
Marek Vasut5ff05292020-01-24 18:39:16 +0100325 };
326 pins2 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700327 bootph-all;
Marek Vasut5ff05292020-01-24 18:39:16 +0100328 /* pull-up on rx to avoid floating level */
329 bias-pull-up;
330 };
331};
Marek Vasut8b642302022-03-14 13:35:54 +0100332
333&reg11 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700334 bootph-pre-ram;
Marek Vasut8b642302022-03-14 13:35:54 +0100335};
336
337&reg18 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700338 bootph-pre-ram;
Marek Vasut8b642302022-03-14 13:35:54 +0100339};
340
341&usb33 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700342 bootph-pre-ram;
Marek Vasut8b642302022-03-14 13:35:54 +0100343};
344
345&usbotg_hs_pins_a {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700346 bootph-pre-ram;
Marek Vasut8b642302022-03-14 13:35:54 +0100347};
348
349&usbotg_hs {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700350 bootph-pre-ram;
Marek Vasut8b642302022-03-14 13:35:54 +0100351};
352
353&usbphyc {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700354 bootph-pre-ram;
Marek Vasut8b642302022-03-14 13:35:54 +0100355};
356
357&usbphyc_port0 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700358 bootph-pre-ram;
Marek Vasut8b642302022-03-14 13:35:54 +0100359};
360
361&usbphyc_port1 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700362 bootph-pre-ram;
Marek Vasut8b642302022-03-14 13:35:54 +0100363};
364
365&vdd_usb {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700366 bootph-pre-ram;
Marek Vasut8b642302022-03-14 13:35:54 +0100367};