blob: dd67e960a641c388ec6f465ad0890c0fe15ca997 [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 Vasut01711442024-10-05 03:15:50 +020011#include "stm32mp15xx-dhsom-u-boot.dtsi"
Marek Vasut5ff05292020-01-24 18:39:16 +010012
13/ {
14 aliases {
15 i2c1 = &i2c2;
16 i2c3 = &i2c4;
17 i2c4 = &i2c5;
18 mmc0 = &sdmmc1;
19 mmc1 = &sdmmc2;
20 spi0 = &qspi;
21 usb0 = &usbotg_hs;
Marek Vasut7d2757f2021-12-30 23:46:47 +010022 eeprom0 = &eeprom0;
Marek Vasut5ff05292020-01-24 18:39:16 +010023 };
24
25 config {
26 u-boot,boot-led = "heartbeat";
27 u-boot,error-led = "error";
Marek Vasut47b98ba2020-04-22 13:18:11 +020028 dh,som-coding-gpios = <&gpiof 12 0>, <&gpiof 13 0>, <&gpiof 15 0>;
Marek Vasut39221b52020-04-22 13:18:14 +020029 dh,ddr3-coding-gpios = <&gpioz 6 0>, <&gpioz 7 0>;
Marek Vasut35516542024-06-06 15:01:48 +020030 dh,mac-coding-gpios = <&gpioc 3 0>;
Marek Vasut5ff05292020-01-24 18:39:16 +010031 };
Marek Vasut5ff05292020-01-24 18:39:16 +010032};
33
Marek Vasut7d2757f2021-12-30 23:46:47 +010034&ethernet0 {
35 phy-reset-gpios = <&gpioh 3 GPIO_ACTIVE_LOW>;
36 /delete-property/ st,eth-ref-clk-sel;
37};
38
39&ethernet0_rmii_pins_a {
40 pins1 {
41 pinmux = <STM32_PINMUX('G', 13, AF11)>, /* ETH1_RMII_TXD0 */
42 <STM32_PINMUX('G', 14, AF11)>, /* ETH1_RMII_TXD1 */
43 <STM32_PINMUX('B', 11, AF11)>, /* ETH1_RMII_TX_EN */
44 <STM32_PINMUX('A', 1, AF11)>, /* ETH1_RMII_REF_CLK */
45 <STM32_PINMUX('A', 2, AF11)>, /* ETH1_MDIO */
46 <STM32_PINMUX('C', 1, AF11)>; /* ETH1_MDC */
47 };
48};
49
Marek Vasut5ff05292020-01-24 18:39:16 +010050&i2c4 {
Simon Glassd3a98cb2023-02-13 08:56:33 -070051 bootph-all;
52 bootph-pre-ram;
Marek Vasut7d2757f2021-12-30 23:46:47 +010053
54 eeprom0: eeprom@50 {
55 };
Marek Vasut5ff05292020-01-24 18:39:16 +010056};
57
58&i2c4_pins_a {
Simon Glassd3a98cb2023-02-13 08:56:33 -070059 bootph-all;
Marek Vasut5ff05292020-01-24 18:39:16 +010060 pins {
Simon Glassd3a98cb2023-02-13 08:56:33 -070061 bootph-all;
Marek Vasut5ff05292020-01-24 18:39:16 +010062 };
63};
64
Marek Vasut7d2757f2021-12-30 23:46:47 +010065&phy0 {
66 /delete-property/ reset-gpios;
67};
68
Marek Vasut0839ea92020-03-28 02:01:58 +010069&pinctrl {
Marek Vasutccfcde32020-12-01 11:34:48 +010070 mco2_pins_a: mco2-0 {
71 pins {
72 pinmux = <STM32_PINMUX('G', 2, AF1)>; /* MCO2 */
73 bias-disable;
74 drive-push-pull;
75 slew-rate = <2>;
76 };
77 };
78
79 mco2_sleep_pins_a: mco2-sleep-0 {
80 pins {
81 pinmux = <STM32_PINMUX('G', 2, ANALOG)>; /* MCO2 */
82 };
83 };
Marek Vasut0839ea92020-03-28 02:01:58 +010084};
85
Marek Vasut5ff05292020-01-24 18:39:16 +010086&pmic {
Simon Glassd3a98cb2023-02-13 08:56:33 -070087 bootph-all;
88 bootph-pre-ram;
Marek Vasut8b642302022-03-14 13:35:54 +010089
90 regulators {
Simon Glassd3a98cb2023-02-13 08:56:33 -070091 bootph-pre-ram;
Marek Vasut8b642302022-03-14 13:35:54 +010092 };
Marek Vasut5ff05292020-01-24 18:39:16 +010093};
94
95&flash0 {
Simon Glassd3a98cb2023-02-13 08:56:33 -070096 bootph-pre-ram;
Patrick Delaunayf172bcb2023-06-08 17:16:48 +020097
98 partitions {
99 compatible = "fixed-partitions";
100 #address-cells = <1>;
101 #size-cells = <1>;
102
103 partition@0 {
104 label = "fsbl1";
105 reg = <0x00000000 0x00040000>;
106 };
107 partition@40000 {
108 label = "fsbl2";
109 reg = <0x00040000 0x00040000>;
110 };
Patrice Chotard29c1e7b2024-03-08 14:50:09 +0100111 partition@80000 {
Patrick Delaunayf172bcb2023-06-08 17:16:48 +0200112 label = "uboot";
113 reg = <0x00080000 0x00160000>;
114 };
Patrice Chotard29c1e7b2024-03-08 14:50:09 +0100115 partition@1e0000 {
Patrick Delaunayf172bcb2023-06-08 17:16:48 +0200116 label = "env1";
117 reg = <0x001E0000 0x00010000>;
118 };
Patrice Chotard29c1e7b2024-03-08 14:50:09 +0100119 partition@1f0000 {
Patrick Delaunayf172bcb2023-06-08 17:16:48 +0200120 label = "env2";
121 reg = <0x001F0000 0x00010000>;
122 };
123 };
Marek Vasut5ff05292020-01-24 18:39:16 +0100124};
125
126&qspi {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700127 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100128};
129
130&qspi_clk_pins_a {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700131 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100132 pins {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700133 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100134 };
135};
136
137&qspi_bk1_pins_a {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700138 bootph-pre-ram;
Marek Vasut3f3375c2023-10-10 01:15:51 +0200139 pins {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700140 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100141 };
Marek Vasut5ff05292020-01-24 18:39:16 +0100142};
143
Marek Vasut3f3375c2023-10-10 01:15:51 +0200144&qspi_cs1_pins_a {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700145 bootph-pre-ram;
Marek Vasut3f3375c2023-10-10 01:15:51 +0200146 pins {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700147 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100148 };
149};
150
151&rcc {
Marek Vasutb30b1592023-07-27 01:58:07 +0200152 /*
153 * Reinstate clock names from stm32mp151.dtsi, the MCO2 trick
154 * used in stm32mp15xx-dhcom-som.dtsi is not supported by the
155 * U-Boot clock framework.
156 */
157 clock-names = "hse", "hsi", "csi", "lse", "lsi";
158 clocks = <&clk_hse>, <&clk_hsi>, <&clk_csi>,
159 <&clk_lse>, <&clk_lsi>;
160
161 /* The MCO2 is already configured correctly, remove those. */
162 /delete-property/ assigned-clocks;
163 /delete-property/ assigned-clock-parents;
164 /delete-property/ assigned-clock-rates;
165
Marek Vasut5ff05292020-01-24 18:39:16 +0100166 st,clksrc = <
167 CLK_MPU_PLL1P
168 CLK_AXI_PLL2P
169 CLK_MCU_PLL3P
170 CLK_PLL12_HSE
171 CLK_PLL3_HSE
172 CLK_PLL4_HSE
173 CLK_RTC_LSE
174 CLK_MCO1_DISABLED
Marek Vasutccfcde32020-12-01 11:34:48 +0100175 CLK_MCO2_PLL4P
Marek Vasut5ff05292020-01-24 18:39:16 +0100176 >;
177
178 st,clkdiv = <
179 1 /*MPU*/
180 0 /*AXI*/
181 0 /*MCU*/
182 1 /*APB1*/
183 1 /*APB2*/
184 1 /*APB3*/
185 1 /*APB4*/
186 2 /*APB5*/
187 23 /*RTC*/
188 0 /*MCO1*/
Marek Vasutccfcde32020-12-01 11:34:48 +0100189 1 /*MCO2*/
Marek Vasut5ff05292020-01-24 18:39:16 +0100190 >;
191
192 st,pkcs = <
193 CLK_CKPER_HSE
194 CLK_FMC_ACLK
195 CLK_QSPI_ACLK
196 CLK_ETH_PLL4P
197 CLK_SDMMC12_PLL4P
198 CLK_DSI_DSIPLL
199 CLK_STGEN_HSE
200 CLK_USBPHY_HSE
201 CLK_SPI2S1_PLL3Q
202 CLK_SPI2S23_PLL3Q
203 CLK_SPI45_HSI
204 CLK_SPI6_HSI
205 CLK_I2C46_HSI
206 CLK_SDMMC3_PLL4P
207 CLK_USBO_USBPHY
208 CLK_ADC_CKPER
209 CLK_CEC_LSE
210 CLK_I2C12_HSI
211 CLK_I2C35_HSI
212 CLK_UART1_HSI
213 CLK_UART24_HSI
214 CLK_UART35_HSI
215 CLK_UART6_HSI
216 CLK_UART78_HSI
217 CLK_SPDIF_PLL4P
Antonio Borneo84159e82020-01-28 10:11:01 +0100218 CLK_FDCAN_PLL4R
Marek Vasut5ff05292020-01-24 18:39:16 +0100219 CLK_SAI1_PLL3Q
220 CLK_SAI2_PLL3Q
221 CLK_SAI3_PLL3Q
222 CLK_SAI4_PLL3Q
223 CLK_RNG1_LSI
224 CLK_RNG2_LSI
225 CLK_LPTIM1_PCLK1
226 CLK_LPTIM23_PCLK3
227 CLK_LPTIM45_LSE
228 >;
229
Marek Vasut086fa932022-10-11 22:42:44 +0200230 /*
231 * cfg = < DIVM1 DIVN P Q R PQR(p,q,r) >;
232 * frac = < f >;
233 *
234 * PRQ(p,q,r) ... for p,q,r: 0-output disabled / 1-output enabled
235 * DIVN ... actually multiplier, but RCC_PLL1CFGR1 calls the field DIVN
236 * m ... for PLL1,2: m=2 ; for PLL3,4: m=1
237 * XTAL = 24 MHz
238 *
239 * VCO = ( XTAL / (DIVM1 + 1) ) * m * ( DIVN + 1 + ( f / 8192 ) )
240 * P = VCO / (P + 1)
241 * Q = VCO / (Q + 1)
242 * R = VCO / (R + 1)
243 */
244
Marek Vasut5ff05292020-01-24 18:39:16 +0100245 /* VCO = 1066.0 MHz => P = 266 (AXI), Q = 533 (GPU), R = 533 (DDR) */
246 pll2: st,pll@1 {
Patrick Delaunayc22caac2020-01-28 10:11:03 +0100247 compatible = "st,stm32mp1-pll";
248 reg = <1>;
Marek Vasut5ff05292020-01-24 18:39:16 +0100249 cfg = < 2 65 1 0 0 PQR(1,1,1) >;
250 frac = < 0x1400 >;
Simon Glassd3a98cb2023-02-13 08:56:33 -0700251 bootph-all;
Marek Vasut5ff05292020-01-24 18:39:16 +0100252 };
253
254 /* VCO = 417.8 MHz => P = 209, Q = 24, R = 11 */
255 pll3: st,pll@2 {
Patrick Delaunayc22caac2020-01-28 10:11:03 +0100256 compatible = "st,stm32mp1-pll";
257 reg = <2>;
Marek Vasut5ff05292020-01-24 18:39:16 +0100258 cfg = < 1 33 1 16 36 PQR(1,1,1) >;
259 frac = < 0x1a04 >;
Simon Glassd3a98cb2023-02-13 08:56:33 -0700260 bootph-all;
Marek Vasut5ff05292020-01-24 18:39:16 +0100261 };
262
Marek Vasut086fa932022-10-11 22:42:44 +0200263 /* VCO = 600.0 MHz => P = 100, Q = 50, R = 50 */
Marek Vasut5ff05292020-01-24 18:39:16 +0100264 pll4: st,pll@3 {
Patrick Delaunayc22caac2020-01-28 10:11:03 +0100265 compatible = "st,stm32mp1-pll";
266 reg = <3>;
Marek Vasutccfcde32020-12-01 11:34:48 +0100267 cfg = < 1 49 5 11 11 PQR(1,1,1) >;
Simon Glassd3a98cb2023-02-13 08:56:33 -0700268 bootph-all;
Marek Vasut5ff05292020-01-24 18:39:16 +0100269 };
270};
271
272&sdmmc1 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700273 bootph-pre-ram;
Marek Vasut5f5ce602021-11-13 03:29:44 +0100274 st,use-ckin;
275 st,cmd-gpios = <&gpiod 2 0>;
276 st,ck-gpios = <&gpioc 12 0>;
277 st,ckin-gpios = <&gpioe 4 0>;
Marek Vasut5ff05292020-01-24 18:39:16 +0100278};
279
280&sdmmc1_b4_pins_a {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700281 bootph-pre-ram;
Patrick Delaunay48c5e902020-03-06 17:54:41 +0100282 pins1 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700283 bootph-pre-ram;
Patrick Delaunay48c5e902020-03-06 17:54:41 +0100284 };
285 pins2 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700286 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100287 };
288};
289
290&sdmmc1_dir_pins_a {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700291 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100292 pins1 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700293 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100294 };
295 pins2 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700296 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100297 };
298};
299
300&sdmmc2 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700301 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100302};
303
304&sdmmc2_b4_pins_a {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700305 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100306 pins {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700307 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100308 };
309};
310
311&sdmmc2_d47_pins_a {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700312 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100313 pins {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700314 bootph-pre-ram;
Marek Vasut5ff05292020-01-24 18:39:16 +0100315 };
316};
317
318&uart4 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700319 bootph-all;
Marek Vasut5ff05292020-01-24 18:39:16 +0100320};
321
322&uart4_pins_a {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700323 bootph-all;
Marek Vasut5ff05292020-01-24 18:39:16 +0100324 pins1 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700325 bootph-all;
Marek Vasut5ff05292020-01-24 18:39:16 +0100326 };
327 pins2 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700328 bootph-all;
Marek Vasut5ff05292020-01-24 18:39:16 +0100329 /* pull-up on rx to avoid floating level */
330 bias-pull-up;
331 };
332};
Marek Vasut8b642302022-03-14 13:35:54 +0100333
334&reg11 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700335 bootph-pre-ram;
Marek Vasut8b642302022-03-14 13:35:54 +0100336};
337
338&reg18 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700339 bootph-pre-ram;
Marek Vasut8b642302022-03-14 13:35:54 +0100340};
341
342&usb33 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700343 bootph-pre-ram;
Marek Vasut8b642302022-03-14 13:35:54 +0100344};
345
346&usbotg_hs_pins_a {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700347 bootph-pre-ram;
Marek Vasut8b642302022-03-14 13:35:54 +0100348};
349
350&usbotg_hs {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700351 bootph-pre-ram;
Marek Vasut8b642302022-03-14 13:35:54 +0100352};
353
354&usbphyc {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700355 bootph-pre-ram;
Marek Vasut8b642302022-03-14 13:35:54 +0100356};
357
358&usbphyc_port0 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700359 bootph-pre-ram;
Marek Vasut8b642302022-03-14 13:35:54 +0100360};
361
362&usbphyc_port1 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700363 bootph-pre-ram;
Marek Vasut8b642302022-03-14 13:35:54 +0100364};
365
366&vdd_usb {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700367 bootph-pre-ram;
Marek Vasut8b642302022-03-14 13:35:54 +0100368};