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 | b0a2a49 | 2020-07-31 01:34:50 +0200 | [diff] [blame] | 21 | ethernet1 = &ksz8851; |
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"; |
| 27 | st,fastboot-gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; |
| 28 | st,stm32prog-gpios = <&gpioa 14 GPIO_ACTIVE_LOW>; |
Marek Vasut | 47b98ba | 2020-04-22 13:18:11 +0200 | [diff] [blame] | 29 | 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] | 30 | dh,ddr3-coding-gpios = <&gpioz 6 0>, <&gpioz 7 0>; |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 31 | }; |
| 32 | |
| 33 | led { |
| 34 | red { |
| 35 | label = "error"; |
| 36 | gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; |
| 37 | default-state = "off"; |
| 38 | status = "okay"; |
| 39 | }; |
| 40 | |
| 41 | blue { |
| 42 | default-state = "on"; |
| 43 | }; |
| 44 | }; |
Marek Vasut | 0839ea9 | 2020-03-28 02:01:58 +0100 | [diff] [blame] | 45 | |
| 46 | /* This is actually on FMC2, but we do not have bus driver for that */ |
| 47 | ksz8851: ks8851mll@64000000 { |
| 48 | compatible = "micrel,ks8851-mll"; |
| 49 | reg = <0x64000000 0x20000>; |
| 50 | }; |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 51 | }; |
| 52 | |
Marek Vasut | 8759f3f | 2020-04-27 12:26:43 +0200 | [diff] [blame] | 53 | &gpiof { |
| 54 | snor-nwp { |
| 55 | gpio-hog; |
| 56 | gpios = <7 0>; |
| 57 | output-high; |
| 58 | line-name = "spi-nor-nwp"; |
| 59 | }; |
| 60 | }; |
| 61 | |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 62 | &i2c4 { |
| 63 | u-boot,dm-pre-reloc; |
| 64 | }; |
| 65 | |
| 66 | &i2c4_pins_a { |
| 67 | u-boot,dm-pre-reloc; |
| 68 | pins { |
| 69 | u-boot,dm-pre-reloc; |
| 70 | }; |
| 71 | }; |
| 72 | |
Marek Vasut | 0839ea9 | 2020-03-28 02:01:58 +0100 | [diff] [blame] | 73 | &pinctrl { |
| 74 | /* These should bound to FMC2 bus driver, but we do not have one */ |
Marek Vasut | ccfcde3 | 2020-12-01 11:34:48 +0100 | [diff] [blame] | 75 | pinctrl-0 = <&fmc_pins_b &mco2_pins_a>; |
| 76 | pinctrl-1 = <&fmc_sleep_pins_b &mco2_sleep_pins_a>; |
Marek Vasut | 0839ea9 | 2020-03-28 02:01:58 +0100 | [diff] [blame] | 77 | pinctrl-names = "default", "sleep"; |
| 78 | |
| 79 | fmc_pins_b: fmc-0 { |
| 80 | pins1 { |
| 81 | pinmux = <STM32_PINMUX('D', 4, AF12)>, /* FMC_NOE */ |
| 82 | <STM32_PINMUX('D', 5, AF12)>, /* FMC_NWE */ |
| 83 | <STM32_PINMUX('B', 7, AF12)>, /* FMC_NL */ |
| 84 | <STM32_PINMUX('D', 14, AF12)>, /* FMC_D0 */ |
| 85 | <STM32_PINMUX('D', 15, AF12)>, /* FMC_D1 */ |
| 86 | <STM32_PINMUX('D', 0, AF12)>, /* FMC_D2 */ |
| 87 | <STM32_PINMUX('D', 1, AF12)>, /* FMC_D3 */ |
| 88 | <STM32_PINMUX('E', 7, AF12)>, /* FMC_D4 */ |
| 89 | <STM32_PINMUX('E', 8, AF12)>, /* FMC_D5 */ |
| 90 | <STM32_PINMUX('E', 9, AF12)>, /* FMC_D6 */ |
| 91 | <STM32_PINMUX('E', 10, AF12)>, /* FMC_D7 */ |
| 92 | <STM32_PINMUX('E', 11, AF12)>, /* FMC_D8 */ |
| 93 | <STM32_PINMUX('E', 12, AF12)>, /* FMC_D9 */ |
| 94 | <STM32_PINMUX('E', 13, AF12)>, /* FMC_D10 */ |
| 95 | <STM32_PINMUX('E', 14, AF12)>, /* FMC_D11 */ |
| 96 | <STM32_PINMUX('E', 15, AF12)>, /* FMC_D12 */ |
| 97 | <STM32_PINMUX('D', 8, AF12)>, /* FMC_D13 */ |
| 98 | <STM32_PINMUX('D', 9, AF12)>, /* FMC_D14 */ |
| 99 | <STM32_PINMUX('D', 10, AF12)>, /* FMC_D15 */ |
| 100 | <STM32_PINMUX('G', 9, AF12)>, /* FMC_NE2_FMC_NCE */ |
| 101 | <STM32_PINMUX('G', 12, AF12)>; /* FMC_NE4 */ |
| 102 | bias-disable; |
| 103 | drive-push-pull; |
| 104 | slew-rate = <3>; |
| 105 | }; |
| 106 | }; |
| 107 | |
| 108 | fmc_sleep_pins_b: fmc-sleep-0 { |
| 109 | pins { |
| 110 | pinmux = <STM32_PINMUX('D', 4, ANALOG)>, /* FMC_NOE */ |
| 111 | <STM32_PINMUX('D', 5, ANALOG)>, /* FMC_NWE */ |
| 112 | <STM32_PINMUX('B', 7, ANALOG)>, /* FMC_NL */ |
| 113 | <STM32_PINMUX('D', 14, ANALOG)>, /* FMC_D0 */ |
| 114 | <STM32_PINMUX('D', 15, ANALOG)>, /* FMC_D1 */ |
| 115 | <STM32_PINMUX('D', 0, ANALOG)>, /* FMC_D2 */ |
| 116 | <STM32_PINMUX('D', 1, ANALOG)>, /* FMC_D3 */ |
| 117 | <STM32_PINMUX('E', 7, ANALOG)>, /* FMC_D4 */ |
| 118 | <STM32_PINMUX('E', 8, ANALOG)>, /* FMC_D5 */ |
| 119 | <STM32_PINMUX('E', 9, ANALOG)>, /* FMC_D6 */ |
| 120 | <STM32_PINMUX('E', 10, ANALOG)>, /* FMC_D7 */ |
| 121 | <STM32_PINMUX('E', 11, ANALOG)>, /* FMC_D8 */ |
| 122 | <STM32_PINMUX('E', 12, ANALOG)>, /* FMC_D9 */ |
| 123 | <STM32_PINMUX('E', 13, ANALOG)>, /* FMC_D10 */ |
| 124 | <STM32_PINMUX('E', 14, ANALOG)>, /* FMC_D11 */ |
| 125 | <STM32_PINMUX('E', 15, ANALOG)>, /* FMC_D12 */ |
| 126 | <STM32_PINMUX('D', 8, ANALOG)>, /* FMC_D13 */ |
| 127 | <STM32_PINMUX('D', 9, ANALOG)>, /* FMC_D14 */ |
| 128 | <STM32_PINMUX('D', 10, ANALOG)>, /* FMC_D15 */ |
| 129 | <STM32_PINMUX('G', 9, ANALOG)>, /* FMC_NE2_FMC_NCE */ |
| 130 | <STM32_PINMUX('G', 12, ANALOG)>; /* FMC_NE4 */ |
| 131 | }; |
| 132 | }; |
Marek Vasut | ccfcde3 | 2020-12-01 11:34:48 +0100 | [diff] [blame] | 133 | |
| 134 | mco2_pins_a: mco2-0 { |
| 135 | pins { |
| 136 | pinmux = <STM32_PINMUX('G', 2, AF1)>; /* MCO2 */ |
| 137 | bias-disable; |
| 138 | drive-push-pull; |
| 139 | slew-rate = <2>; |
| 140 | }; |
| 141 | }; |
| 142 | |
| 143 | mco2_sleep_pins_a: mco2-sleep-0 { |
| 144 | pins { |
| 145 | pinmux = <STM32_PINMUX('G', 2, ANALOG)>; /* MCO2 */ |
| 146 | }; |
| 147 | }; |
Marek Vasut | 0839ea9 | 2020-03-28 02:01:58 +0100 | [diff] [blame] | 148 | }; |
| 149 | |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 150 | &pmic { |
| 151 | u-boot,dm-pre-reloc; |
| 152 | }; |
| 153 | |
| 154 | &flash0 { |
| 155 | u-boot,dm-spl; |
| 156 | }; |
| 157 | |
| 158 | &qspi { |
| 159 | u-boot,dm-spl; |
| 160 | }; |
| 161 | |
| 162 | &qspi_clk_pins_a { |
| 163 | u-boot,dm-spl; |
| 164 | pins { |
| 165 | u-boot,dm-spl; |
| 166 | }; |
| 167 | }; |
| 168 | |
| 169 | &qspi_bk1_pins_a { |
| 170 | u-boot,dm-spl; |
| 171 | pins1 { |
| 172 | u-boot,dm-spl; |
| 173 | }; |
| 174 | pins2 { |
| 175 | u-boot,dm-spl; |
| 176 | }; |
| 177 | }; |
| 178 | |
| 179 | &qspi_bk2_pins_a { |
| 180 | u-boot,dm-spl; |
| 181 | pins1 { |
| 182 | u-boot,dm-spl; |
| 183 | }; |
| 184 | pins2 { |
| 185 | u-boot,dm-spl; |
| 186 | }; |
| 187 | }; |
| 188 | |
| 189 | &rcc { |
| 190 | st,clksrc = < |
| 191 | CLK_MPU_PLL1P |
| 192 | CLK_AXI_PLL2P |
| 193 | CLK_MCU_PLL3P |
| 194 | CLK_PLL12_HSE |
| 195 | CLK_PLL3_HSE |
| 196 | CLK_PLL4_HSE |
| 197 | CLK_RTC_LSE |
| 198 | CLK_MCO1_DISABLED |
Marek Vasut | ccfcde3 | 2020-12-01 11:34:48 +0100 | [diff] [blame] | 199 | CLK_MCO2_PLL4P |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 200 | >; |
| 201 | |
| 202 | st,clkdiv = < |
| 203 | 1 /*MPU*/ |
| 204 | 0 /*AXI*/ |
| 205 | 0 /*MCU*/ |
| 206 | 1 /*APB1*/ |
| 207 | 1 /*APB2*/ |
| 208 | 1 /*APB3*/ |
| 209 | 1 /*APB4*/ |
| 210 | 2 /*APB5*/ |
| 211 | 23 /*RTC*/ |
| 212 | 0 /*MCO1*/ |
Marek Vasut | ccfcde3 | 2020-12-01 11:34:48 +0100 | [diff] [blame] | 213 | 1 /*MCO2*/ |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 214 | >; |
| 215 | |
| 216 | st,pkcs = < |
| 217 | CLK_CKPER_HSE |
| 218 | CLK_FMC_ACLK |
| 219 | CLK_QSPI_ACLK |
| 220 | CLK_ETH_PLL4P |
| 221 | CLK_SDMMC12_PLL4P |
| 222 | CLK_DSI_DSIPLL |
| 223 | CLK_STGEN_HSE |
| 224 | CLK_USBPHY_HSE |
| 225 | CLK_SPI2S1_PLL3Q |
| 226 | CLK_SPI2S23_PLL3Q |
| 227 | CLK_SPI45_HSI |
| 228 | CLK_SPI6_HSI |
| 229 | CLK_I2C46_HSI |
| 230 | CLK_SDMMC3_PLL4P |
| 231 | CLK_USBO_USBPHY |
| 232 | CLK_ADC_CKPER |
| 233 | CLK_CEC_LSE |
| 234 | CLK_I2C12_HSI |
| 235 | CLK_I2C35_HSI |
| 236 | CLK_UART1_HSI |
| 237 | CLK_UART24_HSI |
| 238 | CLK_UART35_HSI |
| 239 | CLK_UART6_HSI |
| 240 | CLK_UART78_HSI |
| 241 | CLK_SPDIF_PLL4P |
Antonio Borneo | 84159e8 | 2020-01-28 10:11:01 +0100 | [diff] [blame] | 242 | CLK_FDCAN_PLL4R |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 243 | CLK_SAI1_PLL3Q |
| 244 | CLK_SAI2_PLL3Q |
| 245 | CLK_SAI3_PLL3Q |
| 246 | CLK_SAI4_PLL3Q |
| 247 | CLK_RNG1_LSI |
| 248 | CLK_RNG2_LSI |
| 249 | CLK_LPTIM1_PCLK1 |
| 250 | CLK_LPTIM23_PCLK3 |
| 251 | CLK_LPTIM45_LSE |
| 252 | >; |
| 253 | |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 254 | /* VCO = 1066.0 MHz => P = 266 (AXI), Q = 533 (GPU), R = 533 (DDR) */ |
| 255 | pll2: st,pll@1 { |
Patrick Delaunay | c22caac | 2020-01-28 10:11:03 +0100 | [diff] [blame] | 256 | compatible = "st,stm32mp1-pll"; |
| 257 | reg = <1>; |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 258 | cfg = < 2 65 1 0 0 PQR(1,1,1) >; |
| 259 | frac = < 0x1400 >; |
| 260 | u-boot,dm-pre-reloc; |
| 261 | }; |
| 262 | |
| 263 | /* VCO = 417.8 MHz => P = 209, Q = 24, R = 11 */ |
| 264 | pll3: st,pll@2 { |
Patrick Delaunay | c22caac | 2020-01-28 10:11:03 +0100 | [diff] [blame] | 265 | compatible = "st,stm32mp1-pll"; |
| 266 | reg = <2>; |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 267 | cfg = < 1 33 1 16 36 PQR(1,1,1) >; |
| 268 | frac = < 0x1a04 >; |
| 269 | u-boot,dm-pre-reloc; |
| 270 | }; |
| 271 | |
| 272 | /* VCO = 600.0 MHz => P = 50, Q = 50, R = 50 */ |
| 273 | pll4: st,pll@3 { |
Patrick Delaunay | c22caac | 2020-01-28 10:11:03 +0100 | [diff] [blame] | 274 | compatible = "st,stm32mp1-pll"; |
| 275 | reg = <3>; |
Marek Vasut | ccfcde3 | 2020-12-01 11:34:48 +0100 | [diff] [blame] | 276 | cfg = < 1 49 5 11 11 PQR(1,1,1) >; |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 277 | u-boot,dm-pre-reloc; |
| 278 | }; |
| 279 | }; |
| 280 | |
| 281 | &sdmmc1 { |
| 282 | u-boot,dm-spl; |
| 283 | }; |
| 284 | |
| 285 | &sdmmc1_b4_pins_a { |
| 286 | u-boot,dm-spl; |
Patrick Delaunay | 48c5e90 | 2020-03-06 17:54:41 +0100 | [diff] [blame] | 287 | pins1 { |
| 288 | u-boot,dm-spl; |
| 289 | }; |
| 290 | pins2 { |
Marek Vasut | 5ff0529 | 2020-01-24 18:39:16 +0100 | [diff] [blame] | 291 | u-boot,dm-spl; |
| 292 | }; |
| 293 | }; |
| 294 | |
| 295 | &sdmmc1_dir_pins_a { |
| 296 | u-boot,dm-spl; |
| 297 | pins1 { |
| 298 | u-boot,dm-spl; |
| 299 | }; |
| 300 | pins2 { |
| 301 | u-boot,dm-spl; |
| 302 | }; |
| 303 | }; |
| 304 | |
| 305 | &sdmmc2 { |
| 306 | u-boot,dm-spl; |
| 307 | }; |
| 308 | |
| 309 | &sdmmc2_b4_pins_a { |
| 310 | u-boot,dm-spl; |
| 311 | pins { |
| 312 | u-boot,dm-spl; |
| 313 | }; |
| 314 | }; |
| 315 | |
| 316 | &sdmmc2_d47_pins_a { |
| 317 | u-boot,dm-spl; |
| 318 | pins { |
| 319 | u-boot,dm-spl; |
| 320 | }; |
| 321 | }; |
| 322 | |
| 323 | &uart4 { |
| 324 | u-boot,dm-pre-reloc; |
| 325 | }; |
| 326 | |
| 327 | &uart4_pins_a { |
| 328 | u-boot,dm-pre-reloc; |
| 329 | pins1 { |
| 330 | u-boot,dm-pre-reloc; |
| 331 | }; |
| 332 | pins2 { |
| 333 | u-boot,dm-pre-reloc; |
| 334 | /* pull-up on rx to avoid floating level */ |
| 335 | bias-pull-up; |
| 336 | }; |
| 337 | }; |