Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 1 | // 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 Delaunay | 48c5e90 | 2020-03-06 17:54:41 +0100 | [diff] [blame] | 7 | #include "stm32mp15-u-boot.dtsi" |
Marek Vasut | 272198e | 2020-04-29 15:08:38 +0200 | [diff] [blame] | 8 | #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 Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 11 | |
| 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 Vasut | 7d2757f | 2021-12-30 23:46:47 +0100 | [diff] [blame] | 21 | eeprom0 = &eeprom0; |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 22 | }; |
| 23 | |
| 24 | config { |
| 25 | u-boot,boot-led = "heartbeat"; |
| 26 | u-boot,error-led = "error"; |
Marek Vasut | 47b98ba | 2020-04-22 13:18:11 +0200 | [diff] [blame] | 27 | dh,som-coding-gpios = <&gpiof 12 0>, <&gpiof 13 0>, <&gpiof 15 0>; |
Marek Vasut | 39221b5 | 2020-04-22 13:18:14 +0200 | [diff] [blame] | 28 | dh,ddr3-coding-gpios = <&gpioz 6 0>, <&gpioz 7 0>; |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 29 | }; |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 30 | }; |
| 31 | |
Marek Vasut | 7d2757f | 2021-12-30 23:46:47 +0100 | [diff] [blame] | 32 | ðernet0 { |
| 33 | phy-reset-gpios = <&gpioh 3 GPIO_ACTIVE_LOW>; |
| 34 | /delete-property/ st,eth-ref-clk-sel; |
| 35 | }; |
| 36 | |
| 37 | ðernet0_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 Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 48 | &i2c4 { |
| 49 | u-boot,dm-pre-reloc; |
Marek Vasut | 8b64230 | 2022-03-14 13:35:54 +0100 | [diff] [blame] | 50 | u-boot,dm-spl; |
Marek Vasut | 7d2757f | 2021-12-30 23:46:47 +0100 | [diff] [blame] | 51 | |
| 52 | eeprom0: eeprom@50 { |
| 53 | }; |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 54 | }; |
| 55 | |
| 56 | &i2c4_pins_a { |
| 57 | u-boot,dm-pre-reloc; |
| 58 | pins { |
| 59 | u-boot,dm-pre-reloc; |
| 60 | }; |
| 61 | }; |
| 62 | |
Marek Vasut | 7d2757f | 2021-12-30 23:46:47 +0100 | [diff] [blame] | 63 | &phy0 { |
| 64 | /delete-property/ reset-gpios; |
| 65 | }; |
| 66 | |
Marek Vasut | 0839ea9 | 2020-03-28 02:01:58 +0100 | [diff] [blame] | 67 | &pinctrl { |
Marek Vasut | ccfcde3 | 2020-12-01 11:34:48 +0100 | [diff] [blame] | 68 | 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 Vasut | 0839ea9 | 2020-03-28 02:01:58 +0100 | [diff] [blame] | 82 | }; |
| 83 | |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 84 | &pmic { |
| 85 | u-boot,dm-pre-reloc; |
Marek Vasut | 8b64230 | 2022-03-14 13:35:54 +0100 | [diff] [blame] | 86 | u-boot,dm-spl; |
| 87 | |
| 88 | regulators { |
| 89 | u-boot,dm-spl; |
| 90 | }; |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 91 | }; |
| 92 | |
| 93 | &flash0 { |
| 94 | u-boot,dm-spl; |
| 95 | }; |
| 96 | |
| 97 | &qspi { |
| 98 | u-boot,dm-spl; |
| 99 | }; |
| 100 | |
| 101 | &qspi_clk_pins_a { |
| 102 | u-boot,dm-spl; |
| 103 | pins { |
| 104 | u-boot,dm-spl; |
| 105 | }; |
| 106 | }; |
| 107 | |
| 108 | &qspi_bk1_pins_a { |
| 109 | u-boot,dm-spl; |
| 110 | pins1 { |
| 111 | u-boot,dm-spl; |
| 112 | }; |
| 113 | pins2 { |
| 114 | u-boot,dm-spl; |
| 115 | }; |
| 116 | }; |
| 117 | |
| 118 | &qspi_bk2_pins_a { |
| 119 | u-boot,dm-spl; |
| 120 | pins1 { |
| 121 | u-boot,dm-spl; |
| 122 | }; |
| 123 | pins2 { |
| 124 | u-boot,dm-spl; |
| 125 | }; |
| 126 | }; |
| 127 | |
| 128 | &rcc { |
| 129 | st,clksrc = < |
| 130 | CLK_MPU_PLL1P |
| 131 | CLK_AXI_PLL2P |
| 132 | CLK_MCU_PLL3P |
| 133 | CLK_PLL12_HSE |
| 134 | CLK_PLL3_HSE |
| 135 | CLK_PLL4_HSE |
| 136 | CLK_RTC_LSE |
| 137 | CLK_MCO1_DISABLED |
Marek Vasut | ccfcde3 | 2020-12-01 11:34:48 +0100 | [diff] [blame] | 138 | CLK_MCO2_PLL4P |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 139 | >; |
| 140 | |
| 141 | st,clkdiv = < |
| 142 | 1 /*MPU*/ |
| 143 | 0 /*AXI*/ |
| 144 | 0 /*MCU*/ |
| 145 | 1 /*APB1*/ |
| 146 | 1 /*APB2*/ |
| 147 | 1 /*APB3*/ |
| 148 | 1 /*APB4*/ |
| 149 | 2 /*APB5*/ |
| 150 | 23 /*RTC*/ |
| 151 | 0 /*MCO1*/ |
Marek Vasut | ccfcde3 | 2020-12-01 11:34:48 +0100 | [diff] [blame] | 152 | 1 /*MCO2*/ |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 153 | >; |
| 154 | |
| 155 | st,pkcs = < |
| 156 | CLK_CKPER_HSE |
| 157 | CLK_FMC_ACLK |
| 158 | CLK_QSPI_ACLK |
| 159 | CLK_ETH_PLL4P |
| 160 | CLK_SDMMC12_PLL4P |
| 161 | CLK_DSI_DSIPLL |
| 162 | CLK_STGEN_HSE |
| 163 | CLK_USBPHY_HSE |
| 164 | CLK_SPI2S1_PLL3Q |
| 165 | CLK_SPI2S23_PLL3Q |
| 166 | CLK_SPI45_HSI |
| 167 | CLK_SPI6_HSI |
| 168 | CLK_I2C46_HSI |
| 169 | CLK_SDMMC3_PLL4P |
| 170 | CLK_USBO_USBPHY |
| 171 | CLK_ADC_CKPER |
| 172 | CLK_CEC_LSE |
| 173 | CLK_I2C12_HSI |
| 174 | CLK_I2C35_HSI |
| 175 | CLK_UART1_HSI |
| 176 | CLK_UART24_HSI |
| 177 | CLK_UART35_HSI |
| 178 | CLK_UART6_HSI |
| 179 | CLK_UART78_HSI |
| 180 | CLK_SPDIF_PLL4P |
Antonio Borneo | 84159e8 | 2020-01-28 10:11:01 +0100 | [diff] [blame] | 181 | CLK_FDCAN_PLL4R |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 182 | CLK_SAI1_PLL3Q |
| 183 | CLK_SAI2_PLL3Q |
| 184 | CLK_SAI3_PLL3Q |
| 185 | CLK_SAI4_PLL3Q |
| 186 | CLK_RNG1_LSI |
| 187 | CLK_RNG2_LSI |
| 188 | CLK_LPTIM1_PCLK1 |
| 189 | CLK_LPTIM23_PCLK3 |
| 190 | CLK_LPTIM45_LSE |
| 191 | >; |
| 192 | |
Marek Vasut | 086fa93 | 2022-10-11 22:42:44 +0200 | [diff] [blame] | 193 | /* |
| 194 | * cfg = < DIVM1 DIVN P Q R PQR(p,q,r) >; |
| 195 | * frac = < f >; |
| 196 | * |
| 197 | * PRQ(p,q,r) ... for p,q,r: 0-output disabled / 1-output enabled |
| 198 | * DIVN ... actually multiplier, but RCC_PLL1CFGR1 calls the field DIVN |
| 199 | * m ... for PLL1,2: m=2 ; for PLL3,4: m=1 |
| 200 | * XTAL = 24 MHz |
| 201 | * |
| 202 | * VCO = ( XTAL / (DIVM1 + 1) ) * m * ( DIVN + 1 + ( f / 8192 ) ) |
| 203 | * P = VCO / (P + 1) |
| 204 | * Q = VCO / (Q + 1) |
| 205 | * R = VCO / (R + 1) |
| 206 | */ |
| 207 | |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 208 | /* VCO = 1066.0 MHz => P = 266 (AXI), Q = 533 (GPU), R = 533 (DDR) */ |
| 209 | pll2: st,pll@1 { |
Patrick Delaunay | c22caac | 2020-01-28 10:11:03 +0100 | [diff] [blame] | 210 | compatible = "st,stm32mp1-pll"; |
| 211 | reg = <1>; |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 212 | cfg = < 2 65 1 0 0 PQR(1,1,1) >; |
| 213 | frac = < 0x1400 >; |
| 214 | u-boot,dm-pre-reloc; |
| 215 | }; |
| 216 | |
| 217 | /* VCO = 417.8 MHz => P = 209, Q = 24, R = 11 */ |
| 218 | pll3: st,pll@2 { |
Patrick Delaunay | c22caac | 2020-01-28 10:11:03 +0100 | [diff] [blame] | 219 | compatible = "st,stm32mp1-pll"; |
| 220 | reg = <2>; |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 221 | cfg = < 1 33 1 16 36 PQR(1,1,1) >; |
| 222 | frac = < 0x1a04 >; |
| 223 | u-boot,dm-pre-reloc; |
| 224 | }; |
| 225 | |
Marek Vasut | 086fa93 | 2022-10-11 22:42:44 +0200 | [diff] [blame] | 226 | /* VCO = 600.0 MHz => P = 100, Q = 50, R = 50 */ |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 227 | pll4: st,pll@3 { |
Patrick Delaunay | c22caac | 2020-01-28 10:11:03 +0100 | [diff] [blame] | 228 | compatible = "st,stm32mp1-pll"; |
| 229 | reg = <3>; |
Marek Vasut | ccfcde3 | 2020-12-01 11:34:48 +0100 | [diff] [blame] | 230 | cfg = < 1 49 5 11 11 PQR(1,1,1) >; |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 231 | u-boot,dm-pre-reloc; |
| 232 | }; |
| 233 | }; |
| 234 | |
| 235 | &sdmmc1 { |
| 236 | u-boot,dm-spl; |
Marek Vasut | 5f5ce60 | 2021-11-13 03:29:44 +0100 | [diff] [blame] | 237 | st,use-ckin; |
| 238 | st,cmd-gpios = <&gpiod 2 0>; |
| 239 | st,ck-gpios = <&gpioc 12 0>; |
| 240 | st,ckin-gpios = <&gpioe 4 0>; |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 241 | }; |
| 242 | |
| 243 | &sdmmc1_b4_pins_a { |
| 244 | u-boot,dm-spl; |
Patrick Delaunay | 48c5e90 | 2020-03-06 17:54:41 +0100 | [diff] [blame] | 245 | pins1 { |
| 246 | u-boot,dm-spl; |
| 247 | }; |
| 248 | pins2 { |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 249 | u-boot,dm-spl; |
| 250 | }; |
| 251 | }; |
| 252 | |
| 253 | &sdmmc1_dir_pins_a { |
| 254 | u-boot,dm-spl; |
| 255 | pins1 { |
| 256 | u-boot,dm-spl; |
| 257 | }; |
| 258 | pins2 { |
| 259 | u-boot,dm-spl; |
| 260 | }; |
| 261 | }; |
| 262 | |
| 263 | &sdmmc2 { |
| 264 | u-boot,dm-spl; |
| 265 | }; |
| 266 | |
| 267 | &sdmmc2_b4_pins_a { |
| 268 | u-boot,dm-spl; |
| 269 | pins { |
| 270 | u-boot,dm-spl; |
| 271 | }; |
| 272 | }; |
| 273 | |
| 274 | &sdmmc2_d47_pins_a { |
| 275 | u-boot,dm-spl; |
| 276 | pins { |
| 277 | u-boot,dm-spl; |
| 278 | }; |
| 279 | }; |
| 280 | |
| 281 | &uart4 { |
| 282 | u-boot,dm-pre-reloc; |
| 283 | }; |
| 284 | |
| 285 | &uart4_pins_a { |
| 286 | u-boot,dm-pre-reloc; |
| 287 | pins1 { |
| 288 | u-boot,dm-pre-reloc; |
| 289 | }; |
| 290 | pins2 { |
| 291 | u-boot,dm-pre-reloc; |
| 292 | /* pull-up on rx to avoid floating level */ |
| 293 | bias-pull-up; |
| 294 | }; |
| 295 | }; |
Marek Vasut | 8b64230 | 2022-03-14 13:35:54 +0100 | [diff] [blame] | 296 | |
| 297 | ®11 { |
| 298 | u-boot,dm-spl; |
| 299 | }; |
| 300 | |
| 301 | ®18 { |
| 302 | u-boot,dm-spl; |
| 303 | }; |
| 304 | |
| 305 | &usb33 { |
| 306 | u-boot,dm-spl; |
| 307 | }; |
| 308 | |
| 309 | &usbotg_hs_pins_a { |
| 310 | u-boot,dm-spl; |
| 311 | }; |
| 312 | |
| 313 | &usbotg_hs { |
| 314 | u-boot,dm-spl; |
| 315 | }; |
| 316 | |
| 317 | &usbphyc { |
| 318 | u-boot,dm-spl; |
| 319 | }; |
| 320 | |
| 321 | &usbphyc_port0 { |
| 322 | u-boot,dm-spl; |
| 323 | }; |
| 324 | |
| 325 | &usbphyc_port1 { |
| 326 | u-boot,dm-spl; |
| 327 | }; |
| 328 | |
| 329 | &vdd_usb { |
| 330 | u-boot,dm-spl; |
| 331 | }; |