blob: f12941b05f65043da1288be119827e58caba6da1 [file] [log] [blame]
Marek Vasut19953732020-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 Delaunay1a4f57c2020-03-06 17:54:41 +01007#include "stm32mp15-u-boot.dtsi"
Marek Vasut92ca0f72020-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 Vasut19953732020-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 Vasut332facc2021-12-30 23:46:47 +010021 eeprom0 = &eeprom0;
Marek Vasut19953732020-01-24 18:39:16 +010022 };
23
24 config {
25 u-boot,boot-led = "heartbeat";
26 u-boot,error-led = "error";
Marek Vasut731fd502020-04-22 13:18:11 +020027 dh,som-coding-gpios = <&gpiof 12 0>, <&gpiof 13 0>, <&gpiof 15 0>;
Marek Vasut2d683652020-04-22 13:18:14 +020028 dh,ddr3-coding-gpios = <&gpioz 6 0>, <&gpioz 7 0>;
Marek Vasut19953732020-01-24 18:39:16 +010029 };
Marek Vasut19953732020-01-24 18:39:16 +010030};
31
Marek Vasut332facc2021-12-30 23:46:47 +010032&ethernet0 {
33 phy-reset-gpios = <&gpioh 3 GPIO_ACTIVE_LOW>;
34 /delete-property/ st,eth-ref-clk-sel;
35};
36
37&ethernet0_rmii_pins_a {
38 pins1 {
39 pinmux = <STM32_PINMUX('G', 13, AF11)>, /* ETH1_RMII_TXD0 */
40 <STM32_PINMUX('G', 14, AF11)>, /* ETH1_RMII_TXD1 */
41 <STM32_PINMUX('B', 11, AF11)>, /* ETH1_RMII_TX_EN */
42 <STM32_PINMUX('A', 1, AF11)>, /* ETH1_RMII_REF_CLK */
43 <STM32_PINMUX('A', 2, AF11)>, /* ETH1_MDIO */
44 <STM32_PINMUX('C', 1, AF11)>; /* ETH1_MDC */
45 };
46};
47
Marek Vasut19953732020-01-24 18:39:16 +010048&i2c4 {
Simon Glass8c103c32023-02-13 08:56:33 -070049 bootph-all;
50 bootph-pre-ram;
Marek Vasut332facc2021-12-30 23:46:47 +010051
52 eeprom0: eeprom@50 {
53 };
Marek Vasut19953732020-01-24 18:39:16 +010054};
55
56&i2c4_pins_a {
Simon Glass8c103c32023-02-13 08:56:33 -070057 bootph-all;
Marek Vasut19953732020-01-24 18:39:16 +010058 pins {
Simon Glass8c103c32023-02-13 08:56:33 -070059 bootph-all;
Marek Vasut19953732020-01-24 18:39:16 +010060 };
61};
62
Marek Vasut332facc2021-12-30 23:46:47 +010063&phy0 {
64 /delete-property/ reset-gpios;
65};
66
Marek Vasutde80a242020-03-28 02:01:58 +010067&pinctrl {
Marek Vasut69ea30e2020-12-01 11:34:48 +010068 mco2_pins_a: mco2-0 {
69 pins {
70 pinmux = <STM32_PINMUX('G', 2, AF1)>; /* MCO2 */
71 bias-disable;
72 drive-push-pull;
73 slew-rate = <2>;
74 };
75 };
76
77 mco2_sleep_pins_a: mco2-sleep-0 {
78 pins {
79 pinmux = <STM32_PINMUX('G', 2, ANALOG)>; /* MCO2 */
80 };
81 };
Marek Vasutde80a242020-03-28 02:01:58 +010082};
83
Marek Vasut19953732020-01-24 18:39:16 +010084&pmic {
Simon Glass8c103c32023-02-13 08:56:33 -070085 bootph-all;
86 bootph-pre-ram;
Marek Vasut19fbe102022-03-14 13:35:54 +010087
88 regulators {
Simon Glass8c103c32023-02-13 08:56:33 -070089 bootph-pre-ram;
Marek Vasut19fbe102022-03-14 13:35:54 +010090 };
Marek Vasut19953732020-01-24 18:39:16 +010091};
92
93&flash0 {
Simon Glass8c103c32023-02-13 08:56:33 -070094 bootph-pre-ram;
Patrick Delaunay90f992e2023-06-08 17:16:48 +020095
96 partitions {
97 compatible = "fixed-partitions";
98 #address-cells = <1>;
99 #size-cells = <1>;
100
101 partition@0 {
102 label = "fsbl1";
103 reg = <0x00000000 0x00040000>;
104 };
105 partition@40000 {
106 label = "fsbl2";
107 reg = <0x00040000 0x00040000>;
108 };
109 partition@500000 {
110 label = "uboot";
111 reg = <0x00080000 0x00160000>;
112 };
113 partition@900000 {
114 label = "env1";
115 reg = <0x001E0000 0x00010000>;
116 };
117 partition@980000 {
118 label = "env2";
119 reg = <0x001F0000 0x00010000>;
120 };
121 };
Marek Vasut19953732020-01-24 18:39:16 +0100122};
123
124&qspi {
Simon Glass8c103c32023-02-13 08:56:33 -0700125 bootph-pre-ram;
Marek Vasut19953732020-01-24 18:39:16 +0100126};
127
128&qspi_clk_pins_a {
Simon Glass8c103c32023-02-13 08:56:33 -0700129 bootph-pre-ram;
Marek Vasut19953732020-01-24 18:39:16 +0100130 pins {
Simon Glass8c103c32023-02-13 08:56:33 -0700131 bootph-pre-ram;
Marek Vasut19953732020-01-24 18:39:16 +0100132 };
133};
134
135&qspi_bk1_pins_a {
Simon Glass8c103c32023-02-13 08:56:33 -0700136 bootph-pre-ram;
Marek Vasut19953732020-01-24 18:39:16 +0100137 pins1 {
Simon Glass8c103c32023-02-13 08:56:33 -0700138 bootph-pre-ram;
Marek Vasut19953732020-01-24 18:39:16 +0100139 };
140 pins2 {
Simon Glass8c103c32023-02-13 08:56:33 -0700141 bootph-pre-ram;
Marek Vasut19953732020-01-24 18:39:16 +0100142 };
143};
144
145&qspi_bk2_pins_a {
Simon Glass8c103c32023-02-13 08:56:33 -0700146 bootph-pre-ram;
Marek Vasut19953732020-01-24 18:39:16 +0100147 pins1 {
Simon Glass8c103c32023-02-13 08:56:33 -0700148 bootph-pre-ram;
Marek Vasut19953732020-01-24 18:39:16 +0100149 };
150 pins2 {
Simon Glass8c103c32023-02-13 08:56:33 -0700151 bootph-pre-ram;
Marek Vasut19953732020-01-24 18:39:16 +0100152 };
153};
154
155&rcc {
Marek Vasutc9678852023-07-27 01:58:07 +0200156 /*
157 * Reinstate clock names from stm32mp151.dtsi, the MCO2 trick
158 * used in stm32mp15xx-dhcom-som.dtsi is not supported by the
159 * U-Boot clock framework.
160 */
161 clock-names = "hse", "hsi", "csi", "lse", "lsi";
162 clocks = <&clk_hse>, <&clk_hsi>, <&clk_csi>,
163 <&clk_lse>, <&clk_lsi>;
164
165 /* The MCO2 is already configured correctly, remove those. */
166 /delete-property/ assigned-clocks;
167 /delete-property/ assigned-clock-parents;
168 /delete-property/ assigned-clock-rates;
169
Marek Vasut19953732020-01-24 18:39:16 +0100170 st,clksrc = <
171 CLK_MPU_PLL1P
172 CLK_AXI_PLL2P
173 CLK_MCU_PLL3P
174 CLK_PLL12_HSE
175 CLK_PLL3_HSE
176 CLK_PLL4_HSE
177 CLK_RTC_LSE
178 CLK_MCO1_DISABLED
Marek Vasut69ea30e2020-12-01 11:34:48 +0100179 CLK_MCO2_PLL4P
Marek Vasut19953732020-01-24 18:39:16 +0100180 >;
181
182 st,clkdiv = <
183 1 /*MPU*/
184 0 /*AXI*/
185 0 /*MCU*/
186 1 /*APB1*/
187 1 /*APB2*/
188 1 /*APB3*/
189 1 /*APB4*/
190 2 /*APB5*/
191 23 /*RTC*/
192 0 /*MCO1*/
Marek Vasut69ea30e2020-12-01 11:34:48 +0100193 1 /*MCO2*/
Marek Vasut19953732020-01-24 18:39:16 +0100194 >;
195
196 st,pkcs = <
197 CLK_CKPER_HSE
198 CLK_FMC_ACLK
199 CLK_QSPI_ACLK
200 CLK_ETH_PLL4P
201 CLK_SDMMC12_PLL4P
202 CLK_DSI_DSIPLL
203 CLK_STGEN_HSE
204 CLK_USBPHY_HSE
205 CLK_SPI2S1_PLL3Q
206 CLK_SPI2S23_PLL3Q
207 CLK_SPI45_HSI
208 CLK_SPI6_HSI
209 CLK_I2C46_HSI
210 CLK_SDMMC3_PLL4P
211 CLK_USBO_USBPHY
212 CLK_ADC_CKPER
213 CLK_CEC_LSE
214 CLK_I2C12_HSI
215 CLK_I2C35_HSI
216 CLK_UART1_HSI
217 CLK_UART24_HSI
218 CLK_UART35_HSI
219 CLK_UART6_HSI
220 CLK_UART78_HSI
221 CLK_SPDIF_PLL4P
Antonio Borneodb0cd2d2020-01-28 10:11:01 +0100222 CLK_FDCAN_PLL4R
Marek Vasut19953732020-01-24 18:39:16 +0100223 CLK_SAI1_PLL3Q
224 CLK_SAI2_PLL3Q
225 CLK_SAI3_PLL3Q
226 CLK_SAI4_PLL3Q
227 CLK_RNG1_LSI
228 CLK_RNG2_LSI
229 CLK_LPTIM1_PCLK1
230 CLK_LPTIM23_PCLK3
231 CLK_LPTIM45_LSE
232 >;
233
Marek Vasut1587e682022-10-11 22:42:44 +0200234 /*
235 * cfg = < DIVM1 DIVN P Q R PQR(p,q,r) >;
236 * frac = < f >;
237 *
238 * PRQ(p,q,r) ... for p,q,r: 0-output disabled / 1-output enabled
239 * DIVN ... actually multiplier, but RCC_PLL1CFGR1 calls the field DIVN
240 * m ... for PLL1,2: m=2 ; for PLL3,4: m=1
241 * XTAL = 24 MHz
242 *
243 * VCO = ( XTAL / (DIVM1 + 1) ) * m * ( DIVN + 1 + ( f / 8192 ) )
244 * P = VCO / (P + 1)
245 * Q = VCO / (Q + 1)
246 * R = VCO / (R + 1)
247 */
248
Marek Vasut19953732020-01-24 18:39:16 +0100249 /* VCO = 1066.0 MHz => P = 266 (AXI), Q = 533 (GPU), R = 533 (DDR) */
250 pll2: st,pll@1 {
Patrick Delaunay8d93a972020-01-28 10:11:03 +0100251 compatible = "st,stm32mp1-pll";
252 reg = <1>;
Marek Vasut19953732020-01-24 18:39:16 +0100253 cfg = < 2 65 1 0 0 PQR(1,1,1) >;
254 frac = < 0x1400 >;
Simon Glass8c103c32023-02-13 08:56:33 -0700255 bootph-all;
Marek Vasut19953732020-01-24 18:39:16 +0100256 };
257
258 /* VCO = 417.8 MHz => P = 209, Q = 24, R = 11 */
259 pll3: st,pll@2 {
Patrick Delaunay8d93a972020-01-28 10:11:03 +0100260 compatible = "st,stm32mp1-pll";
261 reg = <2>;
Marek Vasut19953732020-01-24 18:39:16 +0100262 cfg = < 1 33 1 16 36 PQR(1,1,1) >;
263 frac = < 0x1a04 >;
Simon Glass8c103c32023-02-13 08:56:33 -0700264 bootph-all;
Marek Vasut19953732020-01-24 18:39:16 +0100265 };
266
Marek Vasut1587e682022-10-11 22:42:44 +0200267 /* VCO = 600.0 MHz => P = 100, Q = 50, R = 50 */
Marek Vasut19953732020-01-24 18:39:16 +0100268 pll4: st,pll@3 {
Patrick Delaunay8d93a972020-01-28 10:11:03 +0100269 compatible = "st,stm32mp1-pll";
270 reg = <3>;
Marek Vasut69ea30e2020-12-01 11:34:48 +0100271 cfg = < 1 49 5 11 11 PQR(1,1,1) >;
Simon Glass8c103c32023-02-13 08:56:33 -0700272 bootph-all;
Marek Vasut19953732020-01-24 18:39:16 +0100273 };
274};
275
276&sdmmc1 {
Simon Glass8c103c32023-02-13 08:56:33 -0700277 bootph-pre-ram;
Marek Vasut77d043c2021-11-13 03:29:44 +0100278 st,use-ckin;
279 st,cmd-gpios = <&gpiod 2 0>;
280 st,ck-gpios = <&gpioc 12 0>;
281 st,ckin-gpios = <&gpioe 4 0>;
Marek Vasut19953732020-01-24 18:39:16 +0100282};
283
284&sdmmc1_b4_pins_a {
Simon Glass8c103c32023-02-13 08:56:33 -0700285 bootph-pre-ram;
Patrick Delaunay1a4f57c2020-03-06 17:54:41 +0100286 pins1 {
Simon Glass8c103c32023-02-13 08:56:33 -0700287 bootph-pre-ram;
Patrick Delaunay1a4f57c2020-03-06 17:54:41 +0100288 };
289 pins2 {
Simon Glass8c103c32023-02-13 08:56:33 -0700290 bootph-pre-ram;
Marek Vasut19953732020-01-24 18:39:16 +0100291 };
292};
293
294&sdmmc1_dir_pins_a {
Simon Glass8c103c32023-02-13 08:56:33 -0700295 bootph-pre-ram;
Marek Vasut19953732020-01-24 18:39:16 +0100296 pins1 {
Simon Glass8c103c32023-02-13 08:56:33 -0700297 bootph-pre-ram;
Marek Vasut19953732020-01-24 18:39:16 +0100298 };
299 pins2 {
Simon Glass8c103c32023-02-13 08:56:33 -0700300 bootph-pre-ram;
Marek Vasut19953732020-01-24 18:39:16 +0100301 };
302};
303
304&sdmmc2 {
Simon Glass8c103c32023-02-13 08:56:33 -0700305 bootph-pre-ram;
Marek Vasut19953732020-01-24 18:39:16 +0100306};
307
308&sdmmc2_b4_pins_a {
Simon Glass8c103c32023-02-13 08:56:33 -0700309 bootph-pre-ram;
Marek Vasut19953732020-01-24 18:39:16 +0100310 pins {
Simon Glass8c103c32023-02-13 08:56:33 -0700311 bootph-pre-ram;
Marek Vasut19953732020-01-24 18:39:16 +0100312 };
313};
314
315&sdmmc2_d47_pins_a {
Simon Glass8c103c32023-02-13 08:56:33 -0700316 bootph-pre-ram;
Marek Vasut19953732020-01-24 18:39:16 +0100317 pins {
Simon Glass8c103c32023-02-13 08:56:33 -0700318 bootph-pre-ram;
Marek Vasut19953732020-01-24 18:39:16 +0100319 };
320};
321
322&uart4 {
Simon Glass8c103c32023-02-13 08:56:33 -0700323 bootph-all;
Marek Vasut19953732020-01-24 18:39:16 +0100324};
325
326&uart4_pins_a {
Simon Glass8c103c32023-02-13 08:56:33 -0700327 bootph-all;
Marek Vasut19953732020-01-24 18:39:16 +0100328 pins1 {
Simon Glass8c103c32023-02-13 08:56:33 -0700329 bootph-all;
Marek Vasut19953732020-01-24 18:39:16 +0100330 };
331 pins2 {
Simon Glass8c103c32023-02-13 08:56:33 -0700332 bootph-all;
Marek Vasut19953732020-01-24 18:39:16 +0100333 /* pull-up on rx to avoid floating level */
334 bias-pull-up;
335 };
336};
Marek Vasut19fbe102022-03-14 13:35:54 +0100337
338&reg11 {
Simon Glass8c103c32023-02-13 08:56:33 -0700339 bootph-pre-ram;
Marek Vasut19fbe102022-03-14 13:35:54 +0100340};
341
342&reg18 {
Simon Glass8c103c32023-02-13 08:56:33 -0700343 bootph-pre-ram;
Marek Vasut19fbe102022-03-14 13:35:54 +0100344};
345
346&usb33 {
Simon Glass8c103c32023-02-13 08:56:33 -0700347 bootph-pre-ram;
Marek Vasut19fbe102022-03-14 13:35:54 +0100348};
349
350&usbotg_hs_pins_a {
Simon Glass8c103c32023-02-13 08:56:33 -0700351 bootph-pre-ram;
Marek Vasut19fbe102022-03-14 13:35:54 +0100352};
353
354&usbotg_hs {
Simon Glass8c103c32023-02-13 08:56:33 -0700355 bootph-pre-ram;
Marek Vasut19fbe102022-03-14 13:35:54 +0100356};
357
358&usbphyc {
Simon Glass8c103c32023-02-13 08:56:33 -0700359 bootph-pre-ram;
Marek Vasut19fbe102022-03-14 13:35:54 +0100360};
361
362&usbphyc_port0 {
Simon Glass8c103c32023-02-13 08:56:33 -0700363 bootph-pre-ram;
Marek Vasut19fbe102022-03-14 13:35:54 +0100364};
365
366&usbphyc_port1 {
Simon Glass8c103c32023-02-13 08:56:33 -0700367 bootph-pre-ram;
Marek Vasut19fbe102022-03-14 13:35:54 +0100368};
369
370&vdd_usb {
Simon Glass8c103c32023-02-13 08:56:33 -0700371 bootph-pre-ram;
Marek Vasut19fbe102022-03-14 13:35:54 +0100372};