|
| 1 | +/* |
| 2 | + * Copyright (c) 2025 Dejiang He < [email protected]> |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: Apache-2.0 |
| 5 | + */ |
| 6 | + |
| 7 | +/dts-v1/; |
| 8 | +#include <st/h7/stm32h750Xb.dtsi> |
| 9 | +#include <st/h7/stm32h750xbhx-pinctrl.dtsi> |
| 10 | +#include <zephyr/dt-bindings/input/input-event-codes.h> |
| 11 | +#include <zephyr/dt-bindings/gpio/gpio.h> |
| 12 | +#include <zephyr/dt-bindings/memory-attr/memory-attr.h> |
| 13 | + |
| 14 | +/ { |
| 15 | + model = "Ruiside Electronic ART-Pi board"; |
| 16 | + compatible = "ruiside,art-pi"; |
| 17 | + |
| 18 | + chosen { |
| 19 | + zephyr,console = &uart4; |
| 20 | + zephyr,shell-uart = &uart4; |
| 21 | + zephyr,uart-mcumgr = &uart4; |
| 22 | + zephyr,sram = &sram0; |
| 23 | + zephyr,flash = &flash0; |
| 24 | + zephyr,flash-controller = &w25q64_qspi; |
| 25 | + zephyr,display = <dc; |
| 26 | + zephyr,code-partition = &slot0_partition; |
| 27 | + zephyr,touch = >911; |
| 28 | + }; |
| 29 | + |
| 30 | + sdram1: memory@c0000000 { |
| 31 | + compatible = "zephyr,memory-region","mmio-sram"; |
| 32 | + device_type = "memory"; |
| 33 | + reg = <0xC0000000 0x00600000>; /* Use 6 MB MAX 32MB */ |
| 34 | + zephyr,memory-region = "SDRAM1"; |
| 35 | + zephyr,memory-attr = <(DT_MEM_ARM(ATTR_MPU_RAM))>; |
| 36 | + }; |
| 37 | + |
| 38 | + ext_memory: memory@90000000 { |
| 39 | + compatible = "zephyr,memory-region"; |
| 40 | + reg = <0x90000000 DT_SIZE_M(8)>; /* 8MB QSPI Flash */ |
| 41 | + zephyr,memory-region = "EXTMEM"; |
| 42 | + zephyr,memory-attr = <DT_MEM_ARM_MPU_FLASH>; |
| 43 | + }; |
| 44 | + |
| 45 | + leds { |
| 46 | + compatible = "gpio-leds"; |
| 47 | + |
| 48 | + red_led: led_1 { |
| 49 | + gpios = <&gpioc 15 GPIO_ACTIVE_LOW>; |
| 50 | + label = "USER LED1"; |
| 51 | + }; |
| 52 | + |
| 53 | + blue_led: led_2 { |
| 54 | + gpios = <&gpioi 8 GPIO_ACTIVE_LOW>; |
| 55 | + label = "USER LED2"; |
| 56 | + }; |
| 57 | + }; |
| 58 | + |
| 59 | + gpio_keys { |
| 60 | + compatible = "gpio-keys"; |
| 61 | + |
| 62 | + user_button: button { |
| 63 | + label = "User"; |
| 64 | + gpios = <&gpioh 4 GPIO_ACTIVE_HIGH>; |
| 65 | + zephyr,code = <INPUT_KEY_0>; |
| 66 | + }; |
| 67 | + }; |
| 68 | + |
| 69 | + aliases { |
| 70 | + led0 = &red_led; |
| 71 | + led1 = &blue_led; |
| 72 | + sw0 = &user_button; |
| 73 | + }; |
| 74 | +}; |
| 75 | + |
| 76 | +&clk_hse { |
| 77 | + clock-frequency = <DT_FREQ_M(25)>; |
| 78 | + status = "okay"; |
| 79 | +}; |
| 80 | + |
| 81 | +&clk_hsi48 { |
| 82 | + status = "okay"; |
| 83 | +}; |
| 84 | + |
| 85 | +&pll { |
| 86 | + div-m = <5>; /* 25/5 */ |
| 87 | + mul-n = <192>; /* 5*192=960 */ |
| 88 | + div-p = <2>; /* 960/2=480MHz */ |
| 89 | + div-q = <4>; /* 960/4=240MHz */ |
| 90 | + div-r = <4>; /* 960/4=240MHz */ |
| 91 | + clocks = <&clk_hse>; |
| 92 | + status = "okay"; |
| 93 | +}; |
| 94 | + |
| 95 | +&pll2 { |
| 96 | + div-m = <5>; /* 25/5 */ |
| 97 | + mul-n = <160>; /* 5*160=800 */ |
| 98 | + div-p = <4>; /* 800/4=200MHz */ |
| 99 | + div-q = <4>; /* 800/4=200MHz */ |
| 100 | + div-r = <4>; /* 800/4=200MHz */ |
| 101 | + clocks = <&clk_hse>; |
| 102 | + status = "okay"; |
| 103 | +}; |
| 104 | + |
| 105 | +&pll3 { |
| 106 | + div-m = <5>; /* 25/5 */ |
| 107 | + mul-n = <100>; /* 5*100=500 */ |
| 108 | + div-p = <2>; /* 500/2=250MHz */ |
| 109 | + div-q = <20>; /* 500/20=25MHz */ |
| 110 | + div-r = <20>; /* 500/20=25MHz */ |
| 111 | + clocks = <&clk_hse>; |
| 112 | + status = "okay"; |
| 113 | +}; |
| 114 | + |
| 115 | +&rcc { |
| 116 | + clocks = <&pll>; /* 25/5*192/2 = 480 */ |
| 117 | + clock-frequency = <DT_FREQ_M(480)>; |
| 118 | + d1cpre = <1>; /* 480/1 = 480MHz CPU Clocks */ |
| 119 | + hpre = <2>; /* 480/2 = 240MHz */ |
| 120 | + d1ppre = <2>; /* 240/2 = 120MHz APB3 Clocks */ |
| 121 | + d2ppre1 = <2>; /* 240/2 = 120MHz APB1 Clocks */ |
| 122 | + d2ppre2 = <2>; /* 240/2 = 120MHz APB2 Clocks */ |
| 123 | + d3ppre = <2>; /* 240/2 = 120MHz APB4 Clocks */ |
| 124 | +}; |
| 125 | + |
| 126 | +&flash0 { |
| 127 | + partitions { |
| 128 | + compatible = "fixed-partitions"; |
| 129 | + #address-cells = <1>; |
| 130 | + #size-cells = <1>; |
| 131 | + |
| 132 | + /* Flash has 128KB sector size */ |
| 133 | + boot_partition: partition@0 { |
| 134 | + label = "mcuboot"; |
| 135 | + reg = <0x00000000 DT_SIZE_K(128)>; |
| 136 | + }; |
| 137 | + }; |
| 138 | +}; |
| 139 | + |
| 140 | +&uart4 { |
| 141 | + pinctrl-0 = <&uart4_tx_pa0 &uart4_rx_pi9>; |
| 142 | + pinctrl-names = "default"; |
| 143 | + current-speed = <115200>; |
| 144 | + status = "okay"; |
| 145 | + label = "debug"; |
| 146 | +}; |
| 147 | + |
| 148 | +&uart5 { |
| 149 | + pinctrl-0 = <&uart5_tx_pb13 &uart5_rx_pb12>; |
| 150 | + pinctrl-names = "default"; |
| 151 | + current-speed = <115200>; |
| 152 | + status = "okay"; |
| 153 | + label = "rs485"; |
| 154 | +}; |
| 155 | + |
| 156 | +&usart6 { |
| 157 | + pinctrl-0 = <&usart6_tx_pc6 &usart6_rx_pc7>; |
| 158 | + pinctrl-names = "default"; |
| 159 | + current-speed = <115200>; |
| 160 | + status = "okay"; |
| 161 | + label = "rs232"; |
| 162 | +}; |
| 163 | + |
| 164 | +&sdmmc1 { |
| 165 | + status = "okay"; |
| 166 | + pinctrl-names = "default"; |
| 167 | + pinctrl-0 = <&sdmmc1_d0_pc8 &sdmmc1_d1_pc9 &sdmmc1_d2_pc10 |
| 168 | + &sdmmc1_d3_pc11 &sdmmc1_ck_pc12 &sdmmc1_cmd_pd2>; |
| 169 | + clocks = <&rcc STM32_CLOCK(AHB3, 16)>, |
| 170 | + <&rcc STM32_SRC_PLL2_R SDMMC_SEL(0)>; |
| 171 | + bus-width = <4>; |
| 172 | + cd-gpios = <&gpiod 5 (GPIO_PULL_UP|GPIO_ACTIVE_HIGH)>; |
| 173 | + disk-name = "SD"; |
| 174 | + resets; |
| 175 | + reset-names = "sdmmc1_reset"; |
| 176 | + clk-div = <4>; |
| 177 | +}; |
| 178 | + |
| 179 | +<dc { |
| 180 | + pinctrl-0 = <<dc_r0_pi15 <dc_r1_pj0 <dc_r2_pj1 <dc_r3_pj2 |
| 181 | + <dc_r4_pj3 <dc_r5_pj4 <dc_r6_pj5 <dc_r7_pj6 |
| 182 | + <dc_g0_pj7 <dc_g1_pj8 <dc_g2_pj9 <dc_g3_pj10 |
| 183 | + <dc_g4_pj11 <dc_g5_pk0 <dc_g6_pk1 <dc_g7_pk2 |
| 184 | + <dc_b0_pj12 <dc_b1_pj13 <dc_b2_pj14 <dc_b3_pj15 |
| 185 | + <dc_b4_pk3 <dc_b5_pk4 <dc_b6_pk5 <dc_b7_pk6 |
| 186 | + <dc_hsync_pi12 <dc_vsync_pi13 <dc_de_pk7 <dc_clk_pi14>; |
| 187 | + pinctrl-names = "default"; |
| 188 | + bl-ctrl-gpios = <&gpiod 4 GPIO_ACTIVE_HIGH>; |
| 189 | + ext-sdram = <&sdram1>; |
| 190 | + status = "okay"; |
| 191 | + clocks = <&rcc STM32_CLOCK(APB3, 3)>,<&rcc STM32_SRC_PLL3_R NO_SEL>; |
| 192 | + width = <800>; |
| 193 | + height = <480>; |
| 194 | + pixel-format = <PANEL_PIXEL_FORMAT_RGB_565>; |
| 195 | + def-back-color-red = <0X00>; |
| 196 | + def-back-color-green = <0X00>; |
| 197 | + def-back-color-blue = <0X00>; |
| 198 | + |
| 199 | + display-timings { |
| 200 | + compatible = "zephyr,panel-timing"; |
| 201 | + de-active = <1>; |
| 202 | + pixelclk-active = <1>; |
| 203 | + hsync-active = <0>; |
| 204 | + vsync-active = <0>; |
| 205 | + hsync-len = <4>; |
| 206 | + hback-porch = <8>; |
| 207 | + hfront-porch = <8>; |
| 208 | + vsync-len = <4>; |
| 209 | + vback-porch = <8>; |
| 210 | + vfront-porch = <8>; |
| 211 | + }; |
| 212 | +}; |
| 213 | + |
| 214 | +&i2c1 { |
| 215 | + status = "okay"; |
| 216 | + clock-frequency = <100000>; |
| 217 | + pinctrl-names = "default"; |
| 218 | + pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>; |
| 219 | + |
| 220 | + gt911: touchscreen@5d { |
| 221 | + compatible = "goodix,gt911"; |
| 222 | + reg = <0x5d>; |
| 223 | + alt-addr = <0x14>; |
| 224 | + irq-gpios = <&gpiog 12 GPIO_ACTIVE_HIGH>; |
| 225 | + reset-gpios = <&gpiod 3 GPIO_ACTIVE_LOW>; |
| 226 | + status = "okay"; |
| 227 | + }; |
| 228 | +}; |
| 229 | + |
| 230 | +&quadspi { |
| 231 | + pinctrl-0 = <&quadspi_bk1_io0_pf8 &quadspi_bk1_io1_pf9 &quadspi_bk1_io2_pf7 |
| 232 | + &quadspi_bk1_io3_pf6 &quadspi_clk_pf10 &quadspi_bk1_ncs_pg6>; |
| 233 | + pinctrl-names = "default"; |
| 234 | + status = "okay"; |
| 235 | + |
| 236 | + w25q64_qspi: qspi-nor-flash@0 { |
| 237 | + compatible = "st,stm32-qspi-nor"; |
| 238 | + reg = <0>; |
| 239 | + size = <DT_SIZE_M(64)>; /* 64Mbit */ |
| 240 | + qspi-max-frequency = <100000000>; |
| 241 | + cs-high-time = <2>; |
| 242 | + status = "okay"; |
| 243 | + spi-bus-width = <4>; |
| 244 | + writeoc = "PP_1_4_4"; |
| 245 | + reset-cmd; |
| 246 | + reset-cmd-wait = <2000>; |
| 247 | + |
| 248 | + partitions { |
| 249 | + compatible = "fixed-partitions"; |
| 250 | + #address-cells = <1>; |
| 251 | + #size-cells = <1>; |
| 252 | + |
| 253 | + slot0_partition: partition@0 { |
| 254 | + label = "image-0"; |
| 255 | + reg = <0x00000000 DT_SIZE_K(2048)>; /* 2MB */ |
| 256 | + }; |
| 257 | + |
| 258 | + slot1_partition: partition@200000 { |
| 259 | + label = "image-1"; |
| 260 | + reg = <0x00200000 DT_SIZE_K(2048)>; /* 2MB */ |
| 261 | + }; |
| 262 | + |
| 263 | + storage_partition: partition@400000 { |
| 264 | + label = "storage"; |
| 265 | + reg = <0x00400000 DT_SIZE_K(4096)>; /* 4MB */ |
| 266 | + }; |
| 267 | + }; |
| 268 | + }; |
| 269 | +}; |
| 270 | + |
| 271 | +&spi1 { |
| 272 | + pinctrl-0 = <&spi1_sck_pa5 &spi1_miso_pg9 &spi1_mosi_pb5>; |
| 273 | + cs-gpios = <&gpioa 4 GPIO_ACTIVE_LOW>; |
| 274 | + pinctrl-names = "default"; |
| 275 | + status = "okay"; |
| 276 | + |
| 277 | + w25q128_spi: spi-nor-flash@0 { |
| 278 | + compatible = "jedec,spi-nor"; |
| 279 | + reg = <0>; |
| 280 | + spi-max-frequency = <40000000>; |
| 281 | + size = <DT_SIZE_M(128)>; /* 128Mbit */ |
| 282 | + status = "okay"; |
| 283 | + jedec-id = [ef 40 18]; |
| 284 | + has-dpd; |
| 285 | + t-enter-dpd = <3500>; |
| 286 | + t-exit-dpd = <3500>; |
| 287 | + |
| 288 | + partitions { |
| 289 | + compatible = "fixed-partitions"; |
| 290 | + #address-cells = <1>; |
| 291 | + #size-cells = <1>; |
| 292 | + |
| 293 | + spi_storage_partition: partition@0 { |
| 294 | + label = "storage_spi"; |
| 295 | + reg = <0x00000000 DT_SIZE_M(16)>; /* 16MB */ |
| 296 | + }; |
| 297 | + }; |
| 298 | + }; |
| 299 | +}; |
| 300 | + |
| 301 | +&fmc { |
| 302 | + pinctrl-0 = <&fmc_nbl0_pe0 &fmc_nbl1_pe1 &fmc_sdclk_pg8 &fmc_sdnwe_ph5 |
| 303 | + &fmc_sdcke0_pc3 &fmc_sdne0_pc2 &fmc_sdnras_pf11 &fmc_sdncas_pg15 |
| 304 | + &fmc_a0_pf0 &fmc_a1_pf1 &fmc_a2_pf2 &fmc_a3_pf3 &fmc_a4_pf4 |
| 305 | + &fmc_a5_pf5 &fmc_a6_pf12 &fmc_a7_pf13 &fmc_a8_pf14 &fmc_a9_pf15 |
| 306 | + &fmc_a10_pg0 &fmc_a11_pg1 &fmc_a12_pg2 &fmc_a14_pg4 &fmc_a15_pg5 |
| 307 | + &fmc_d0_pd14 &fmc_d1_pd15 &fmc_d2_pd0 &fmc_d3_pd1 &fmc_d4_pe7 |
| 308 | + &fmc_d5_pe8 &fmc_d6_pe9 &fmc_d7_pe10 &fmc_d8_pe11 &fmc_d9_pe12 |
| 309 | + &fmc_d10_pe13 &fmc_d11_pe14 &fmc_d12_pe15 &fmc_d13_pd8 &fmc_d14_pd9 |
| 310 | + &fmc_d15_pd10>; |
| 311 | + pinctrl-names = "default"; |
| 312 | + status = "okay"; |
| 313 | + |
| 314 | + sdram { |
| 315 | + status = "okay"; |
| 316 | + power-up-delay = <100>; |
| 317 | + num-auto-refresh = <8>; |
| 318 | + mode-register = <0x230>; |
| 319 | + refresh-rate = <0x395>; |
| 320 | + |
| 321 | + bank@0 { |
| 322 | + reg = <0>; |
| 323 | + st,sdram-control = <STM32_FMC_SDRAM_NC_9 |
| 324 | + STM32_FMC_SDRAM_NR_13 |
| 325 | + STM32_FMC_SDRAM_MWID_16 |
| 326 | + STM32_FMC_SDRAM_NB_4 |
| 327 | + STM32_FMC_SDRAM_CAS_3 |
| 328 | + STM32_FMC_SDRAM_SDCLK_PERIOD_2 |
| 329 | + STM32_FMC_SDRAM_RBURST_ENABLE |
| 330 | + STM32_FMC_SDRAM_RPIPE_1>; |
| 331 | + st,sdram-timing = <2 9 6 8 2 2 3>; |
| 332 | + }; |
| 333 | + }; |
| 334 | +}; |
| 335 | + |
| 336 | +zephyr_udc0: &usbotg_fs { |
| 337 | + pinctrl-0 = <&usb_otg_fs_dm_pa11 &usb_otg_fs_dp_pa12>; |
| 338 | + pinctrl-names = "default"; |
| 339 | + clocks = <&rcc STM32_CLOCK(AHB1, 27)>, |
| 340 | + <&rcc STM32_SRC_HSI48 USB_SEL(3)>; |
| 341 | + maximum-speed = "full-speed"; |
| 342 | + ram-size = <1280>; |
| 343 | + num-bidir-endpoints = <8>; |
| 344 | + status = "okay"; |
| 345 | +}; |
| 346 | + |
| 347 | +&mac { |
| 348 | + status = "okay"; |
| 349 | + phy-connection-type = "rmii"; |
| 350 | + phy-handle = <ð_phy>; |
| 351 | + local-mac-address = [00 80 E1 2A 75 01]; |
| 352 | + pinctrl-0 = <ð_ref_clk_pa1 |
| 353 | + ð_crs_dv_pa7 |
| 354 | + ð_rxd0_pc4 |
| 355 | + ð_rxd1_pc5 |
| 356 | + ð_tx_en_pg11 |
| 357 | + ð_txd0_pg13 |
| 358 | + ð_txd1_pg14>; |
| 359 | + pinctrl-names = "default"; |
| 360 | +}; |
| 361 | + |
| 362 | +&mdio { |
| 363 | + status = "okay"; |
| 364 | + pinctrl-0 = <ð_mdio_pa2 ð_mdc_pc1>; |
| 365 | + pinctrl-names = "default"; |
| 366 | + |
| 367 | + eth_phy: ethernet-phy@0 { |
| 368 | + compatible = "ethernet-phy"; |
| 369 | + reg = <0>; |
| 370 | + default-speeds = "10BASE Full-Duplex","100BASE Full-Duplex"; |
| 371 | + }; |
| 372 | +}; |
| 373 | + |
| 374 | +&rng { |
| 375 | + status = "okay"; |
| 376 | +}; |
0 commit comments