0023-riscv-dts-starfive-Add-StarFive-JH7110-VisionFive-2-.patch 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. From 76bc84c399f11c7d6a37fe68cbd5f182e4c18369 Mon Sep 17 00:00:00 2001
  2. From: Emil Renner Berthing <[email protected]>
  3. Date: Sat, 1 Apr 2023 19:19:33 +0800
  4. Subject: [PATCH 023/122] riscv: dts: starfive: Add StarFive JH7110 VisionFive
  5. 2 board device tree
  6. Add a minimal device tree for StarFive JH7110 VisionFive 2 board
  7. which has version A and version B. Support booting and basic
  8. clock/reset/pinctrl/uart drivers.
  9. Tested-by: Tommaso Merciai <[email protected]>
  10. Reviewed-by: Conor Dooley <[email protected]>
  11. Acked-by: Conor Dooley <[email protected]>
  12. Signed-off-by: Emil Renner Berthing <[email protected]>
  13. Co-developed-by: Jianlong Huang <[email protected]>
  14. Signed-off-by: Jianlong Huang <[email protected]>
  15. Co-developed-by: Hal Feng <[email protected]>
  16. Signed-off-by: Hal Feng <[email protected]>
  17. Reviewed-by: Emil Renner Berthing <[email protected]>
  18. Signed-off-by: Conor Dooley <[email protected]>
  19. ---
  20. arch/riscv/boot/dts/starfive/Makefile | 6 +-
  21. .../jh7110-starfive-visionfive-2-v1.2a.dts | 13 ++
  22. .../jh7110-starfive-visionfive-2-v1.3b.dts | 13 ++
  23. .../jh7110-starfive-visionfive-2.dtsi | 215 ++++++++++++++++++
  24. 4 files changed, 246 insertions(+), 1 deletion(-)
  25. create mode 100644 arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2-v1.2a.dts
  26. create mode 100644 arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2-v1.3b.dts
  27. create mode 100644 arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
  28. --- a/arch/riscv/boot/dts/starfive/Makefile
  29. +++ b/arch/riscv/boot/dts/starfive/Makefile
  30. @@ -1,2 +1,6 @@
  31. # SPDX-License-Identifier: GPL-2.0
  32. -dtb-$(CONFIG_SOC_STARFIVE) += jh7100-beaglev-starlight.dtb
  33. +dtb-$(CONFIG_ARCH_STARFIVE) += jh7100-beaglev-starlight.dtb
  34. +dtb-$(CONFIG_ARCH_STARFIVE) += jh7100-starfive-visionfive-v1.dtb
  35. +
  36. +dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-v1.2a.dtb
  37. +dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-v1.3b.dtb
  38. --- /dev/null
  39. +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2-v1.2a.dts
  40. @@ -0,0 +1,13 @@
  41. +// SPDX-License-Identifier: GPL-2.0 OR MIT
  42. +/*
  43. + * Copyright (C) 2022 StarFive Technology Co., Ltd.
  44. + * Copyright (C) 2022 Emil Renner Berthing <[email protected]>
  45. + */
  46. +
  47. +/dts-v1/;
  48. +#include "jh7110-starfive-visionfive-2.dtsi"
  49. +
  50. +/ {
  51. + model = "StarFive VisionFive 2 v1.2A";
  52. + compatible = "starfive,visionfive-2-v1.2a", "starfive,jh7110";
  53. +};
  54. --- /dev/null
  55. +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2-v1.3b.dts
  56. @@ -0,0 +1,13 @@
  57. +// SPDX-License-Identifier: GPL-2.0 OR MIT
  58. +/*
  59. + * Copyright (C) 2022 StarFive Technology Co., Ltd.
  60. + * Copyright (C) 2022 Emil Renner Berthing <[email protected]>
  61. + */
  62. +
  63. +/dts-v1/;
  64. +#include "jh7110-starfive-visionfive-2.dtsi"
  65. +
  66. +/ {
  67. + model = "StarFive VisionFive 2 v1.3B";
  68. + compatible = "starfive,visionfive-2-v1.3b", "starfive,jh7110";
  69. +};
  70. --- /dev/null
  71. +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
  72. @@ -0,0 +1,215 @@
  73. +// SPDX-License-Identifier: GPL-2.0 OR MIT
  74. +/*
  75. + * Copyright (C) 2022 StarFive Technology Co., Ltd.
  76. + * Copyright (C) 2022 Emil Renner Berthing <[email protected]>
  77. + */
  78. +
  79. +/dts-v1/;
  80. +#include "jh7110.dtsi"
  81. +#include "jh7110-pinfunc.h"
  82. +#include <dt-bindings/gpio/gpio.h>
  83. +
  84. +/ {
  85. + aliases {
  86. + i2c0 = &i2c0;
  87. + i2c2 = &i2c2;
  88. + i2c5 = &i2c5;
  89. + i2c6 = &i2c6;
  90. + serial0 = &uart0;
  91. + };
  92. +
  93. + chosen {
  94. + stdout-path = "serial0:115200n8";
  95. + };
  96. +
  97. + cpus {
  98. + timebase-frequency = <4000000>;
  99. + };
  100. +
  101. + memory@40000000 {
  102. + device_type = "memory";
  103. + reg = <0x0 0x40000000 0x1 0x0>;
  104. + };
  105. +
  106. + gpio-restart {
  107. + compatible = "gpio-restart";
  108. + gpios = <&sysgpio 35 GPIO_ACTIVE_HIGH>;
  109. + priority = <224>;
  110. + };
  111. +};
  112. +
  113. +&gmac0_rgmii_rxin {
  114. + clock-frequency = <125000000>;
  115. +};
  116. +
  117. +&gmac0_rmii_refin {
  118. + clock-frequency = <50000000>;
  119. +};
  120. +
  121. +&gmac1_rgmii_rxin {
  122. + clock-frequency = <125000000>;
  123. +};
  124. +
  125. +&gmac1_rmii_refin {
  126. + clock-frequency = <50000000>;
  127. +};
  128. +
  129. +&i2srx_bclk_ext {
  130. + clock-frequency = <12288000>;
  131. +};
  132. +
  133. +&i2srx_lrck_ext {
  134. + clock-frequency = <192000>;
  135. +};
  136. +
  137. +&i2stx_bclk_ext {
  138. + clock-frequency = <12288000>;
  139. +};
  140. +
  141. +&i2stx_lrck_ext {
  142. + clock-frequency = <192000>;
  143. +};
  144. +
  145. +&mclk_ext {
  146. + clock-frequency = <12288000>;
  147. +};
  148. +
  149. +&osc {
  150. + clock-frequency = <24000000>;
  151. +};
  152. +
  153. +&rtc_osc {
  154. + clock-frequency = <32768>;
  155. +};
  156. +
  157. +&tdm_ext {
  158. + clock-frequency = <49152000>;
  159. +};
  160. +
  161. +&i2c0 {
  162. + clock-frequency = <100000>;
  163. + i2c-sda-hold-time-ns = <300>;
  164. + i2c-sda-falling-time-ns = <510>;
  165. + i2c-scl-falling-time-ns = <510>;
  166. + pinctrl-names = "default";
  167. + pinctrl-0 = <&i2c0_pins>;
  168. + status = "okay";
  169. +};
  170. +
  171. +&i2c2 {
  172. + clock-frequency = <100000>;
  173. + i2c-sda-hold-time-ns = <300>;
  174. + i2c-sda-falling-time-ns = <510>;
  175. + i2c-scl-falling-time-ns = <510>;
  176. + pinctrl-names = "default";
  177. + pinctrl-0 = <&i2c2_pins>;
  178. + status = "okay";
  179. +};
  180. +
  181. +&i2c5 {
  182. + clock-frequency = <100000>;
  183. + i2c-sda-hold-time-ns = <300>;
  184. + i2c-sda-falling-time-ns = <510>;
  185. + i2c-scl-falling-time-ns = <510>;
  186. + pinctrl-names = "default";
  187. + pinctrl-0 = <&i2c5_pins>;
  188. + status = "okay";
  189. +};
  190. +
  191. +&i2c6 {
  192. + clock-frequency = <100000>;
  193. + i2c-sda-hold-time-ns = <300>;
  194. + i2c-sda-falling-time-ns = <510>;
  195. + i2c-scl-falling-time-ns = <510>;
  196. + pinctrl-names = "default";
  197. + pinctrl-0 = <&i2c6_pins>;
  198. + status = "okay";
  199. +};
  200. +
  201. +&sysgpio {
  202. + i2c0_pins: i2c0-0 {
  203. + i2c-pins {
  204. + pinmux = <GPIOMUX(57, GPOUT_LOW,
  205. + GPOEN_SYS_I2C0_CLK,
  206. + GPI_SYS_I2C0_CLK)>,
  207. + <GPIOMUX(58, GPOUT_LOW,
  208. + GPOEN_SYS_I2C0_DATA,
  209. + GPI_SYS_I2C0_DATA)>;
  210. + bias-disable; /* external pull-up */
  211. + input-enable;
  212. + input-schmitt-enable;
  213. + };
  214. + };
  215. +
  216. + i2c2_pins: i2c2-0 {
  217. + i2c-pins {
  218. + pinmux = <GPIOMUX(3, GPOUT_LOW,
  219. + GPOEN_SYS_I2C2_CLK,
  220. + GPI_SYS_I2C2_CLK)>,
  221. + <GPIOMUX(2, GPOUT_LOW,
  222. + GPOEN_SYS_I2C2_DATA,
  223. + GPI_SYS_I2C2_DATA)>;
  224. + bias-disable; /* external pull-up */
  225. + input-enable;
  226. + input-schmitt-enable;
  227. + };
  228. + };
  229. +
  230. + i2c5_pins: i2c5-0 {
  231. + i2c-pins {
  232. + pinmux = <GPIOMUX(19, GPOUT_LOW,
  233. + GPOEN_SYS_I2C5_CLK,
  234. + GPI_SYS_I2C5_CLK)>,
  235. + <GPIOMUX(20, GPOUT_LOW,
  236. + GPOEN_SYS_I2C5_DATA,
  237. + GPI_SYS_I2C5_DATA)>;
  238. + bias-disable; /* external pull-up */
  239. + input-enable;
  240. + input-schmitt-enable;
  241. + };
  242. + };
  243. +
  244. + i2c6_pins: i2c6-0 {
  245. + i2c-pins {
  246. + pinmux = <GPIOMUX(16, GPOUT_LOW,
  247. + GPOEN_SYS_I2C6_CLK,
  248. + GPI_SYS_I2C6_CLK)>,
  249. + <GPIOMUX(17, GPOUT_LOW,
  250. + GPOEN_SYS_I2C6_DATA,
  251. + GPI_SYS_I2C6_DATA)>;
  252. + bias-disable; /* external pull-up */
  253. + input-enable;
  254. + input-schmitt-enable;
  255. + };
  256. + };
  257. +
  258. + uart0_pins: uart0-0 {
  259. + tx-pins {
  260. + pinmux = <GPIOMUX(5, GPOUT_SYS_UART0_TX,
  261. + GPOEN_ENABLE,
  262. + GPI_NONE)>;
  263. + bias-disable;
  264. + drive-strength = <12>;
  265. + input-disable;
  266. + input-schmitt-disable;
  267. + slew-rate = <0>;
  268. + };
  269. +
  270. + rx-pins {
  271. + pinmux = <GPIOMUX(6, GPOUT_LOW,
  272. + GPOEN_DISABLE,
  273. + GPI_SYS_UART0_RX)>;
  274. + bias-disable; /* external pull-up */
  275. + drive-strength = <2>;
  276. + input-enable;
  277. + input-schmitt-enable;
  278. + slew-rate = <0>;
  279. + };
  280. + };
  281. +};
  282. +
  283. +&uart0 {
  284. + pinctrl-names = "default";
  285. + pinctrl-0 = <&uart0_pins>;
  286. + status = "okay";
  287. +};