0025-riscv-dts-starfive-Add-common-DT-for-JH7100-based-bo.patch 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. From 2101233d71b74e33de33e4cc292c6a8cf5da9d42 Mon Sep 17 00:00:00 2001
  2. From: Cristian Ciocaltea <[email protected]>
  3. Date: Tue, 18 Oct 2022 00:05:41 +0300
  4. Subject: [PATCH 025/122] riscv: dts: starfive: Add common DT for JH7100 based
  5. boards
  6. In preparation for adding initial device tree support for the StarFive
  7. VisionFive board, which is similar with BeagleV Starlight, move most
  8. of the content from jh7100-beaglev-starlight.dts to a new file, to be
  9. shared between the two boards.
  10. Signed-off-by: Cristian Ciocaltea <[email protected]>
  11. Reviewed-by: Conor Dooley <[email protected]>
  12. Reviewed-by: Matthias Brugger <[email protected]>
  13. Signed-off-by: Conor Dooley <[email protected]>
  14. ---
  15. .../dts/starfive/jh7100-beaglev-starlight.dts | 153 +----------------
  16. .../boot/dts/starfive/jh7100-common.dtsi | 161 ++++++++++++++++++
  17. 2 files changed, 162 insertions(+), 152 deletions(-)
  18. create mode 100644 arch/riscv/boot/dts/starfive/jh7100-common.dtsi
  19. --- a/arch/riscv/boot/dts/starfive/jh7100-beaglev-starlight.dts
  20. +++ b/arch/riscv/boot/dts/starfive/jh7100-beaglev-starlight.dts
  21. @@ -5,160 +5,9 @@
  22. */
  23. /dts-v1/;
  24. -#include "jh7100.dtsi"
  25. -#include <dt-bindings/gpio/gpio.h>
  26. -#include <dt-bindings/leds/common.h>
  27. -#include <dt-bindings/pinctrl/pinctrl-starfive-jh7100.h>
  28. +#include "jh7100-common.dtsi"
  29. / {
  30. model = "BeagleV Starlight Beta";
  31. compatible = "beagle,beaglev-starlight-jh7100-r0", "starfive,jh7100";
  32. -
  33. - aliases {
  34. - serial0 = &uart3;
  35. - };
  36. -
  37. - chosen {
  38. - stdout-path = "serial0:115200n8";
  39. - };
  40. -
  41. - cpus {
  42. - timebase-frequency = <6250000>;
  43. - };
  44. -
  45. - memory@80000000 {
  46. - device_type = "memory";
  47. - reg = <0x0 0x80000000 0x2 0x0>;
  48. - };
  49. -
  50. - leds {
  51. - compatible = "gpio-leds";
  52. -
  53. - led-ack {
  54. - gpios = <&gpio 43 GPIO_ACTIVE_HIGH>;
  55. - color = <LED_COLOR_ID_GREEN>;
  56. - function = LED_FUNCTION_HEARTBEAT;
  57. - linux,default-trigger = "heartbeat";
  58. - label = "ack";
  59. - };
  60. - };
  61. -};
  62. -
  63. -&gpio {
  64. - i2c0_pins: i2c0-0 {
  65. - i2c-pins {
  66. - pinmux = <GPIOMUX(62, GPO_LOW,
  67. - GPO_I2C0_PAD_SCK_OEN,
  68. - GPI_I2C0_PAD_SCK_IN)>,
  69. - <GPIOMUX(61, GPO_LOW,
  70. - GPO_I2C0_PAD_SDA_OEN,
  71. - GPI_I2C0_PAD_SDA_IN)>;
  72. - bias-disable; /* external pull-up */
  73. - input-enable;
  74. - input-schmitt-enable;
  75. - };
  76. - };
  77. -
  78. - i2c1_pins: i2c1-0 {
  79. - i2c-pins {
  80. - pinmux = <GPIOMUX(47, GPO_LOW,
  81. - GPO_I2C1_PAD_SCK_OEN,
  82. - GPI_I2C1_PAD_SCK_IN)>,
  83. - <GPIOMUX(48, GPO_LOW,
  84. - GPO_I2C1_PAD_SDA_OEN,
  85. - GPI_I2C1_PAD_SDA_IN)>;
  86. - bias-pull-up;
  87. - input-enable;
  88. - input-schmitt-enable;
  89. - };
  90. - };
  91. -
  92. - i2c2_pins: i2c2-0 {
  93. - i2c-pins {
  94. - pinmux = <GPIOMUX(60, GPO_LOW,
  95. - GPO_I2C2_PAD_SCK_OEN,
  96. - GPI_I2C2_PAD_SCK_IN)>,
  97. - <GPIOMUX(59, GPO_LOW,
  98. - GPO_I2C2_PAD_SDA_OEN,
  99. - GPI_I2C2_PAD_SDA_IN)>;
  100. - bias-disable; /* external pull-up */
  101. - input-enable;
  102. - input-schmitt-enable;
  103. - };
  104. - };
  105. -
  106. - uart3_pins: uart3-0 {
  107. - rx-pins {
  108. - pinmux = <GPIOMUX(13, GPO_LOW, GPO_DISABLE,
  109. - GPI_UART3_PAD_SIN)>;
  110. - bias-pull-up;
  111. - drive-strength = <14>;
  112. - input-enable;
  113. - input-schmitt-enable;
  114. - slew-rate = <0>;
  115. - };
  116. - tx-pins {
  117. - pinmux = <GPIOMUX(14, GPO_UART3_PAD_SOUT,
  118. - GPO_ENABLE, GPI_NONE)>;
  119. - bias-disable;
  120. - drive-strength = <35>;
  121. - input-disable;
  122. - input-schmitt-disable;
  123. - slew-rate = <0>;
  124. - };
  125. - };
  126. -};
  127. -
  128. -&i2c0 {
  129. - clock-frequency = <100000>;
  130. - i2c-sda-hold-time-ns = <300>;
  131. - i2c-sda-falling-time-ns = <500>;
  132. - i2c-scl-falling-time-ns = <500>;
  133. - pinctrl-names = "default";
  134. - pinctrl-0 = <&i2c0_pins>;
  135. - status = "okay";
  136. -
  137. - pmic@5e {
  138. - compatible = "ti,tps65086";
  139. - reg = <0x5e>;
  140. - gpio-controller;
  141. - #gpio-cells = <2>;
  142. -
  143. - regulators {
  144. - };
  145. - };
  146. -};
  147. -
  148. -&i2c1 {
  149. - clock-frequency = <400000>;
  150. - i2c-sda-hold-time-ns = <300>;
  151. - i2c-sda-falling-time-ns = <100>;
  152. - i2c-scl-falling-time-ns = <100>;
  153. - pinctrl-names = "default";
  154. - pinctrl-0 = <&i2c1_pins>;
  155. - status = "okay";
  156. -};
  157. -
  158. -&i2c2 {
  159. - clock-frequency = <100000>;
  160. - i2c-sda-hold-time-ns = <300>;
  161. - i2c-sda-falling-time-ns = <500>;
  162. - i2c-scl-falling-time-ns = <500>;
  163. - pinctrl-names = "default";
  164. - pinctrl-0 = <&i2c2_pins>;
  165. - status = "okay";
  166. -};
  167. -
  168. -&osc_sys {
  169. - clock-frequency = <25000000>;
  170. -};
  171. -
  172. -&osc_aud {
  173. - clock-frequency = <27000000>;
  174. -};
  175. -
  176. -&uart3 {
  177. - pinctrl-names = "default";
  178. - pinctrl-0 = <&uart3_pins>;
  179. - status = "okay";
  180. };
  181. --- /dev/null
  182. +++ b/arch/riscv/boot/dts/starfive/jh7100-common.dtsi
  183. @@ -0,0 +1,161 @@
  184. +// SPDX-License-Identifier: GPL-2.0 OR MIT
  185. +/*
  186. + * Copyright (C) 2021 StarFive Technology Co., Ltd.
  187. + * Copyright (C) 2021 Emil Renner Berthing <[email protected]>
  188. + */
  189. +
  190. +/dts-v1/;
  191. +#include "jh7100.dtsi"
  192. +#include <dt-bindings/gpio/gpio.h>
  193. +#include <dt-bindings/leds/common.h>
  194. +#include <dt-bindings/pinctrl/pinctrl-starfive-jh7100.h>
  195. +
  196. +/ {
  197. + aliases {
  198. + serial0 = &uart3;
  199. + };
  200. +
  201. + chosen {
  202. + stdout-path = "serial0:115200n8";
  203. + };
  204. +
  205. + cpus {
  206. + timebase-frequency = <6250000>;
  207. + };
  208. +
  209. + memory@80000000 {
  210. + device_type = "memory";
  211. + reg = <0x0 0x80000000 0x2 0x0>;
  212. + };
  213. +
  214. + leds {
  215. + compatible = "gpio-leds";
  216. +
  217. + led-ack {
  218. + gpios = <&gpio 43 GPIO_ACTIVE_HIGH>;
  219. + color = <LED_COLOR_ID_GREEN>;
  220. + function = LED_FUNCTION_HEARTBEAT;
  221. + linux,default-trigger = "heartbeat";
  222. + label = "ack";
  223. + };
  224. + };
  225. +};
  226. +
  227. +&gpio {
  228. + i2c0_pins: i2c0-0 {
  229. + i2c-pins {
  230. + pinmux = <GPIOMUX(62, GPO_LOW,
  231. + GPO_I2C0_PAD_SCK_OEN,
  232. + GPI_I2C0_PAD_SCK_IN)>,
  233. + <GPIOMUX(61, GPO_LOW,
  234. + GPO_I2C0_PAD_SDA_OEN,
  235. + GPI_I2C0_PAD_SDA_IN)>;
  236. + bias-disable; /* external pull-up */
  237. + input-enable;
  238. + input-schmitt-enable;
  239. + };
  240. + };
  241. +
  242. + i2c1_pins: i2c1-0 {
  243. + i2c-pins {
  244. + pinmux = <GPIOMUX(47, GPO_LOW,
  245. + GPO_I2C1_PAD_SCK_OEN,
  246. + GPI_I2C1_PAD_SCK_IN)>,
  247. + <GPIOMUX(48, GPO_LOW,
  248. + GPO_I2C1_PAD_SDA_OEN,
  249. + GPI_I2C1_PAD_SDA_IN)>;
  250. + bias-pull-up;
  251. + input-enable;
  252. + input-schmitt-enable;
  253. + };
  254. + };
  255. +
  256. + i2c2_pins: i2c2-0 {
  257. + i2c-pins {
  258. + pinmux = <GPIOMUX(60, GPO_LOW,
  259. + GPO_I2C2_PAD_SCK_OEN,
  260. + GPI_I2C2_PAD_SCK_IN)>,
  261. + <GPIOMUX(59, GPO_LOW,
  262. + GPO_I2C2_PAD_SDA_OEN,
  263. + GPI_I2C2_PAD_SDA_IN)>;
  264. + bias-disable; /* external pull-up */
  265. + input-enable;
  266. + input-schmitt-enable;
  267. + };
  268. + };
  269. +
  270. + uart3_pins: uart3-0 {
  271. + rx-pins {
  272. + pinmux = <GPIOMUX(13, GPO_LOW, GPO_DISABLE,
  273. + GPI_UART3_PAD_SIN)>;
  274. + bias-pull-up;
  275. + drive-strength = <14>;
  276. + input-enable;
  277. + input-schmitt-enable;
  278. + slew-rate = <0>;
  279. + };
  280. + tx-pins {
  281. + pinmux = <GPIOMUX(14, GPO_UART3_PAD_SOUT,
  282. + GPO_ENABLE, GPI_NONE)>;
  283. + bias-disable;
  284. + drive-strength = <35>;
  285. + input-disable;
  286. + input-schmitt-disable;
  287. + slew-rate = <0>;
  288. + };
  289. + };
  290. +};
  291. +
  292. +&i2c0 {
  293. + clock-frequency = <100000>;
  294. + i2c-sda-hold-time-ns = <300>;
  295. + i2c-sda-falling-time-ns = <500>;
  296. + i2c-scl-falling-time-ns = <500>;
  297. + pinctrl-names = "default";
  298. + pinctrl-0 = <&i2c0_pins>;
  299. + status = "okay";
  300. +
  301. + pmic@5e {
  302. + compatible = "ti,tps65086";
  303. + reg = <0x5e>;
  304. + gpio-controller;
  305. + #gpio-cells = <2>;
  306. +
  307. + regulators {
  308. + };
  309. + };
  310. +};
  311. +
  312. +&i2c1 {
  313. + clock-frequency = <400000>;
  314. + i2c-sda-hold-time-ns = <300>;
  315. + i2c-sda-falling-time-ns = <100>;
  316. + i2c-scl-falling-time-ns = <100>;
  317. + pinctrl-names = "default";
  318. + pinctrl-0 = <&i2c1_pins>;
  319. + status = "okay";
  320. +};
  321. +
  322. +&i2c2 {
  323. + clock-frequency = <100000>;
  324. + i2c-sda-hold-time-ns = <300>;
  325. + i2c-sda-falling-time-ns = <500>;
  326. + i2c-scl-falling-time-ns = <500>;
  327. + pinctrl-names = "default";
  328. + pinctrl-0 = <&i2c2_pins>;
  329. + status = "okay";
  330. +};
  331. +
  332. +&osc_sys {
  333. + clock-frequency = <25000000>;
  334. +};
  335. +
  336. +&osc_aud {
  337. + clock-frequency = <27000000>;
  338. +};
  339. +
  340. +&uart3 {
  341. + pinctrl-names = "default";
  342. + pinctrl-0 = <&uart3_pins>;
  343. + status = "okay";
  344. +};