/dts/arm/st/g4/stm32g4.dtsi

https://github.com/methodpark/zephyr · Device Tree · 488 lines · 420 code · 60 blank · 8 comment · 0 complexity · 881cbbddc642c7b2ac05148cd7ff052a MD5 · raw file

  1. /*
  2. * Copyright (c) 2019 Richard Osterloh <richard.osterloh@gmail.com>
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #include <arm/armv7-m.dtsi>
  7. #include <dt-bindings/clock/stm32_clock.h>
  8. #include <dt-bindings/i2c/i2c.h>
  9. #include <dt-bindings/gpio/gpio.h>
  10. / {
  11. chosen {
  12. zephyr,entropy = &rng;
  13. zephyr,flash-controller = &flash;
  14. };
  15. cpus {
  16. #address-cells = <1>;
  17. #size-cells = <0>;
  18. cpu@0 {
  19. device_type = "cpu";
  20. compatible = "arm,cortex-m4f";
  21. reg = <0>;
  22. };
  23. };
  24. sram0: memory@20000000 {
  25. compatible = "mmio-sram";
  26. };
  27. soc {
  28. /*
  29. * Both adc instances cannot be used in parallel right now.
  30. */
  31. adc1: adc@50000000 {
  32. compatible = "st,stm32-adc";
  33. reg = <0x50000000 0x100>;
  34. clocks = <&rcc STM32_CLOCK_BUS_AHB2 0x00002000>;
  35. interrupts = <18 0>;
  36. status = "disabled";
  37. label = "ADC_1";
  38. #io-channel-cells = <1>;
  39. };
  40. adc2: adc@50000100 {
  41. compatible = "st,stm32-adc";
  42. reg = <0x50000100 0x100>;
  43. clocks = <&rcc STM32_CLOCK_BUS_AHB2 0x00002000>;
  44. interrupts = <18 0>;
  45. status = "disabled";
  46. label = "ADC_2";
  47. #io-channel-cells = <1>;
  48. };
  49. flash: flash-controller@40022000 {
  50. compatible = "st,stm32-flash-controller", "st,stm32g4-flash-controller";
  51. label = "FLASH_CTRL";
  52. reg = <0x40022000 0x400>;
  53. interrupts = <3 0>;
  54. #address-cells = <1>;
  55. #size-cells = <1>;
  56. flash0: flash@8000000 {
  57. compatible = "soc-nv-flash";
  58. label = "FLASH_STM32";
  59. write-block-size = <8>;
  60. erase-block-size = <2048>;
  61. };
  62. };
  63. rcc: rcc@40021000 {
  64. compatible = "st,stm32-rcc";
  65. #clock-cells = <2>;
  66. reg = <0x40021000 0x400>;
  67. label = "STM32_CLK_RCC";
  68. };
  69. pinctrl: pin-controller@48000000 {
  70. compatible = "st,stm32-pinmux";
  71. #address-cells = <1>;
  72. #size-cells = <1>;
  73. reg = <0x48000000 0x2000>;
  74. gpioa: gpio@48000000 {
  75. compatible = "st,stm32-gpio";
  76. gpio-controller;
  77. #gpio-cells = <2>;
  78. reg = <0x48000000 0x400>;
  79. clocks = <&rcc STM32_CLOCK_BUS_AHB2 0x00000001>;
  80. label = "GPIOA";
  81. };
  82. gpiob: gpio@48000400 {
  83. compatible = "st,stm32-gpio";
  84. gpio-controller;
  85. #gpio-cells = <2>;
  86. reg = <0x48000400 0x400>;
  87. clocks = <&rcc STM32_CLOCK_BUS_AHB2 0x00000002>;
  88. label = "GPIOB";
  89. };
  90. gpioc: gpio@48000800 {
  91. compatible = "st,stm32-gpio";
  92. gpio-controller;
  93. #gpio-cells = <2>;
  94. reg = <0x48000800 0x400>;
  95. clocks = <&rcc STM32_CLOCK_BUS_AHB2 0x00000004>;
  96. label = "GPIOC";
  97. };
  98. gpiod: gpio@48000c00 {
  99. compatible = "st,stm32-gpio";
  100. gpio-controller;
  101. #gpio-cells = <2>;
  102. reg = <0x48000c00 0x400>;
  103. clocks = <&rcc STM32_CLOCK_BUS_AHB2 0x00000008>;
  104. label = "GPIOD";
  105. };
  106. gpioe: gpio@48001000 {
  107. compatible = "st,stm32-gpio";
  108. gpio-controller;
  109. #gpio-cells = <2>;
  110. reg = <0x48001000 0x400>;
  111. clocks = <&rcc STM32_CLOCK_BUS_AHB2 0x00000010>;
  112. label = "GPIOE";
  113. };
  114. gpiof: gpio@48001400 {
  115. compatible = "st,stm32-gpio";
  116. gpio-controller;
  117. #gpio-cells = <2>;
  118. reg = <0x48001400 0x400>;
  119. clocks = <&rcc STM32_CLOCK_BUS_AHB2 0x00000020>;
  120. label = "GPIOF";
  121. };
  122. gpiog: gpio@48001800 {
  123. compatible = "st,stm32-gpio";
  124. gpio-controller;
  125. #gpio-cells = <2>;
  126. reg = <0x48001800 0x400>;
  127. clocks = <&rcc STM32_CLOCK_BUS_AHB2 0x00000040>;
  128. label = "GPIOG";
  129. };
  130. };
  131. usart1: serial@40013800 {
  132. compatible = "st,stm32-usart", "st,stm32-uart";
  133. reg = <0x40013800 0x400>;
  134. clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00004000>;
  135. interrupts = <37 0>;
  136. status = "disabled";
  137. label = "UART_1";
  138. };
  139. usart2: serial@40004400 {
  140. compatible = "st,stm32-usart", "st,stm32-uart";
  141. reg = <0x40004400 0x400>;
  142. clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00020000>;
  143. interrupts = <38 0>;
  144. status = "disabled";
  145. label = "UART_2";
  146. };
  147. usart3: serial@40004800 {
  148. compatible = "st,stm32-usart", "st,stm32-uart";
  149. reg = <0x40004800 0x400>;
  150. clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00040000>;
  151. interrupts = <39 0>;
  152. status = "disabled";
  153. label = "UART_3";
  154. };
  155. uart4: serial@40004c00 {
  156. compatible = "st,stm32-uart";
  157. reg = <0x40004c00 0x400>;
  158. clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00080000>;
  159. interrupts = <52 0>;
  160. status = "disabled";
  161. label = "UART_4";
  162. };
  163. lpuart1: serial@40008000 {
  164. compatible = "st,stm32-lpuart", "st,stm32-uart";
  165. reg = <0x40008000 0x400>;
  166. clocks = <&rcc STM32_CLOCK_BUS_APB1_2 0x00000001>;
  167. interrupts = <91 0>;
  168. status = "disabled";
  169. label = "LPUART_1";
  170. };
  171. iwdg: watchdog@40003000 {
  172. compatible = "st,stm32-watchdog";
  173. reg = <0x40003000 0x400>;
  174. label = "IWDG";
  175. status = "disabled";
  176. };
  177. wwdg: watchdog@40002c00 {
  178. compatible = "st,stm32-window-watchdog";
  179. reg = <0x40002C00 0x400>;
  180. clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00000800>;
  181. label = "WWDG";
  182. interrupts = <0 7>;
  183. status = "disabled";
  184. };
  185. i2c1: i2c@40005400 {
  186. compatible = "st,stm32-i2c-v2";
  187. clock-frequency = <I2C_BITRATE_STANDARD>;
  188. #address-cells = <1>;
  189. #size-cells = <0>;
  190. reg = <0x40005400 0x400>;
  191. clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00200000>;
  192. interrupts = <31 0>, <32 0>;
  193. interrupt-names = "event", "error";
  194. status = "disabled";
  195. label= "I2C_1";
  196. };
  197. i2c2: i2c@40005800 {
  198. compatible = "st,stm32-i2c-v2";
  199. clock-frequency = <I2C_BITRATE_STANDARD>;
  200. #address-cells = <1>;
  201. #size-cells = <0>;
  202. reg = <0x40005800 0x400>;
  203. clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00400000>;
  204. interrupts = <33 0>, <34 0>;
  205. interrupt-names = "event", "error";
  206. status = "disabled";
  207. label= "I2C_2";
  208. };
  209. i2c3: i2c@40007800 {
  210. compatible = "st,stm32-i2c-v2";
  211. clock-frequency = <I2C_BITRATE_STANDARD>;
  212. #address-cells = <1>;
  213. #size-cells = <0>;
  214. reg = <0x40007800 0x400>;
  215. clocks = <&rcc STM32_CLOCK_BUS_APB1 0x40000000>;
  216. interrupts = <92 0>, <93 0>;
  217. interrupt-names = "event", "error";
  218. status = "disabled";
  219. label= "I2C_3";
  220. };
  221. spi1: spi@40013000 {
  222. compatible = "st,stm32-spi-fifo", "st,stm32-spi";
  223. #address-cells = <1>;
  224. #size-cells = <0>;
  225. reg = <0x40013000 0x400>;
  226. interrupts = <35 5>;
  227. clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00001000>;
  228. status = "disabled";
  229. label = "SPI_1";
  230. };
  231. spi2: spi@40003800 {
  232. compatible = "st,stm32-spi-fifo", "st,stm32-spi";
  233. #address-cells = <1>;
  234. #size-cells = <0>;
  235. reg = <0x40003800 0x400>;
  236. clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00004000>;
  237. interrupts = <36 5>;
  238. status = "disabled";
  239. label = "SPI_2";
  240. };
  241. spi3: spi@40003c00 {
  242. compatible = "st,stm32-spi-fifo", "st,stm32-spi";
  243. #address-cells = <1>;
  244. #size-cells = <0>;
  245. reg = <0x40003c00 0x400>;
  246. clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00008000>;
  247. interrupts = <51 5>;
  248. status = "disabled";
  249. label = "SPI_3";
  250. };
  251. timers1: timers@40012c00 {
  252. compatible = "st,stm32-timers";
  253. reg = <0x40012c00 0x400>;
  254. clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00000800>;
  255. status = "disabled";
  256. label = "TIMERS_1";
  257. pwm {
  258. compatible = "st,stm32-pwm";
  259. status = "disabled";
  260. st,prescaler = <10000>;
  261. label = "PWM_1";
  262. #pwm-cells = <2>;
  263. };
  264. };
  265. timers2: timers@40000000 {
  266. compatible = "st,stm32-timers";
  267. reg = <0x40000000 0x400>;
  268. clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00000001>;
  269. status = "disabled";
  270. label = "TIMERS_2";
  271. pwm {
  272. compatible = "st,stm32-pwm";
  273. status = "disabled";
  274. st,prescaler = <0>;
  275. label = "PWM_2";
  276. #pwm-cells = <2>;
  277. };
  278. };
  279. timers3: timers@40000400 {
  280. compatible = "st,stm32-timers";
  281. reg = <0x40000400 0x400>;
  282. clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00000002>;
  283. status = "disabled";
  284. label = "TIMERS_3";
  285. pwm {
  286. compatible = "st,stm32-pwm";
  287. status = "disabled";
  288. st,prescaler = <10000>;
  289. label = "PWM_3";
  290. #pwm-cells = <2>;
  291. };
  292. };
  293. timers4: timers@40000800 {
  294. compatible = "st,stm32-timers";
  295. reg = <0x40000800 0x400>;
  296. clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00000004>;
  297. status = "disabled";
  298. label = "TIMERS_4";
  299. pwm {
  300. compatible = "st,stm32-pwm";
  301. status = "disabled";
  302. st,prescaler = <10000>;
  303. label = "PWM_4";
  304. #pwm-cells = <2>;
  305. };
  306. };
  307. timers6: timers@40001000 {
  308. compatible = "st,stm32-timers";
  309. reg = <0x40001000 0x400>;
  310. clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00000010>;
  311. status = "disabled";
  312. label = "TIMERS_6";
  313. pwm {
  314. compatible = "st,stm32-pwm";
  315. status = "disabled";
  316. st,prescaler = <10000>;
  317. label = "PWM_6";
  318. #pwm-cells = <2>;
  319. };
  320. };
  321. timers7: timers@40001400 {
  322. compatible = "st,stm32-timers";
  323. reg = <0x40001400 0x400>;
  324. clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00000020>;
  325. status = "disabled";
  326. label = "TIMERS_7";
  327. pwm {
  328. compatible = "st,stm32-pwm";
  329. status = "disabled";
  330. st,prescaler = <10000>;
  331. label = "PWM_7";
  332. #pwm-cells = <2>;
  333. };
  334. };
  335. timers8: timers@40013400 {
  336. compatible = "st,stm32-timers";
  337. reg = <0x40013400 0x400>;
  338. clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00004000>;
  339. status = "disabled";
  340. label = "TIMERS_8";
  341. pwm {
  342. compatible = "st,stm32-pwm";
  343. status = "disabled";
  344. st,prescaler = <10000>;
  345. label = "PWM_8";
  346. #pwm-cells = <2>;
  347. };
  348. };
  349. timers15: timers@40014000 {
  350. compatible = "st,stm32-timers";
  351. reg = <0x40014000 0x400>;
  352. clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00010000>;
  353. status = "disabled";
  354. label = "TIMERS_15";
  355. pwm {
  356. compatible = "st,stm32-pwm";
  357. status = "disabled";
  358. st,prescaler = <10000>;
  359. label = "PWM_15";
  360. #pwm-cells = <2>;
  361. };
  362. };
  363. timers16: timers@40014400 {
  364. compatible = "st,stm32-timers";
  365. reg = <0x40014400 0x400>;
  366. clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00020000>;
  367. status = "disabled";
  368. label = "TIMERS_16";
  369. pwm {
  370. compatible = "st,stm32-pwm";
  371. status = "disabled";
  372. st,prescaler = <10000>;
  373. label = "PWM_16";
  374. #pwm-cells = <2>;
  375. };
  376. };
  377. timers17: timers@40014800 {
  378. compatible = "st,stm32-timers";
  379. reg = <0x40014800 0x400>;
  380. clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00040000>;
  381. status = "disabled";
  382. label = "TIMERS_17";
  383. pwm {
  384. compatible = "st,stm32-pwm";
  385. status = "disabled";
  386. st,prescaler = <10000>;
  387. label = "PWM_17";
  388. #pwm-cells = <2>;
  389. };
  390. };
  391. rtc: rtc@40002800 {
  392. compatible = "st,stm32-rtc";
  393. reg = <0x40002800 0x400>;
  394. interrupts = <41 0>;
  395. clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>;
  396. prescaler = <32768>;
  397. status = "disabled";
  398. label = "RTC_0";
  399. };
  400. rng: rng@50060800 {
  401. compatible = "st,stm32-rng";
  402. reg = <0x50060800 0x400>;
  403. clocks = <&rcc STM32_CLOCK_BUS_AHB2 0x04000000>;
  404. status = "disabled";
  405. label = "RNG";
  406. };
  407. usb: usb@40005c00 {
  408. compatible = "st,stm32-usb";
  409. reg = <0x40005c00 0x400>;
  410. interrupts = <20 0>, <19 0>;
  411. interrupt-names = "usb", "usbhp";
  412. num-bidir-endpoints = <8>;
  413. ram-size = <1024>;
  414. phys = <&usb_fs_phy>;
  415. clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00800000>;
  416. status = "disabled";
  417. label= "USB";
  418. };
  419. };
  420. usb_fs_phy: usbphy {
  421. compatible = "usb-nop-xceiv";
  422. #phy-cells = <0>;
  423. label = "USB_FS_PHY";
  424. };
  425. };
  426. &nvic {
  427. arm,num-irq-priority-bits = <4>;
  428. };