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