rzg2l-smarc-som.dtsi 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. /*
  3. * Device Tree Source for the RZ/{G2L,V2L} SMARC SOM common parts
  4. *
  5. * Copyright (C) 2021 Renesas Electronics Corp.
  6. */
  7. #include <dt-bindings/gpio/gpio.h>
  8. #include <dt-bindings/interrupt-controller/irqc-rzg2l.h>
  9. #include <dt-bindings/pinctrl/rzg2l-pinctrl.h>
  10. /* SW1[2] should be at position 2/OFF to enable 64 GB eMMC */
  11. #define EMMC 1
  12. /*
  13. * To enable uSD card on CN3,
  14. * SW1[2] should be at position 3/ON.
  15. * Disable eMMC by setting "#define EMMC 0" above.
  16. */
  17. #define SDHI (!EMMC)
  18. / {
  19. aliases {
  20. ethernet0 = &eth0;
  21. ethernet1 = &eth1;
  22. };
  23. chosen {
  24. bootargs = "ignore_loglevel rw root=/dev/nfs ip=on";
  25. };
  26. memory@48000000 {
  27. device_type = "memory";
  28. /* first 128MB is reserved for secure area. */
  29. reg = <0x0 0x48000000 0x0 0x78000000>;
  30. };
  31. reg_1p8v: regulator-1p8v {
  32. compatible = "regulator-fixed";
  33. regulator-name = "fixed-1.8V";
  34. regulator-min-microvolt = <1800000>;
  35. regulator-max-microvolt = <1800000>;
  36. regulator-boot-on;
  37. regulator-always-on;
  38. };
  39. reg_3p3v: regulator-3p3v {
  40. compatible = "regulator-fixed";
  41. regulator-name = "fixed-3.3V";
  42. regulator-min-microvolt = <3300000>;
  43. regulator-max-microvolt = <3300000>;
  44. regulator-boot-on;
  45. regulator-always-on;
  46. };
  47. reg_1p1v: regulator-vdd-core {
  48. compatible = "regulator-fixed";
  49. regulator-name = "fixed-1.1V";
  50. regulator-min-microvolt = <1100000>;
  51. regulator-max-microvolt = <1100000>;
  52. regulator-boot-on;
  53. regulator-always-on;
  54. };
  55. vccq_sdhi0: regulator-vccq-sdhi0 {
  56. compatible = "regulator-gpio";
  57. regulator-name = "SDHI0 VccQ";
  58. regulator-min-microvolt = <1800000>;
  59. regulator-max-microvolt = <3300000>;
  60. states = <3300000 1>, <1800000 0>;
  61. regulator-boot-on;
  62. gpios = <&pinctrl RZG2L_GPIO(39, 0) GPIO_ACTIVE_HIGH>;
  63. regulator-always-on;
  64. };
  65. };
  66. &adc {
  67. pinctrl-0 = <&adc_pins>;
  68. pinctrl-names = "default";
  69. status = "okay";
  70. /delete-node/ channel@6;
  71. /delete-node/ channel@7;
  72. };
  73. &eth0 {
  74. pinctrl-0 = <&eth0_pins>;
  75. pinctrl-names = "default";
  76. phy-handle = <&phy0>;
  77. phy-mode = "rgmii-id";
  78. status = "okay";
  79. phy0: ethernet-phy@7 {
  80. compatible = "ethernet-phy-id0022.1640",
  81. "ethernet-phy-ieee802.3-c22";
  82. reg = <7>;
  83. interrupt-parent = <&irqc>;
  84. interrupts = <RZG2L_IRQ2 IRQ_TYPE_LEVEL_LOW>;
  85. rxc-skew-psec = <2400>;
  86. txc-skew-psec = <2400>;
  87. rxdv-skew-psec = <0>;
  88. txen-skew-psec = <0>;
  89. rxd0-skew-psec = <0>;
  90. rxd1-skew-psec = <0>;
  91. rxd2-skew-psec = <0>;
  92. rxd3-skew-psec = <0>;
  93. txd0-skew-psec = <0>;
  94. txd1-skew-psec = <0>;
  95. txd2-skew-psec = <0>;
  96. txd3-skew-psec = <0>;
  97. };
  98. };
  99. &eth1 {
  100. pinctrl-0 = <&eth1_pins>;
  101. pinctrl-names = "default";
  102. phy-handle = <&phy1>;
  103. phy-mode = "rgmii-id";
  104. status = "okay";
  105. phy1: ethernet-phy@7 {
  106. compatible = "ethernet-phy-id0022.1640",
  107. "ethernet-phy-ieee802.3-c22";
  108. reg = <7>;
  109. interrupt-parent = <&irqc>;
  110. interrupts = <RZG2L_IRQ3 IRQ_TYPE_LEVEL_LOW>;
  111. rxc-skew-psec = <2400>;
  112. txc-skew-psec = <2400>;
  113. rxdv-skew-psec = <0>;
  114. txen-skew-psec = <0>;
  115. rxd0-skew-psec = <0>;
  116. rxd1-skew-psec = <0>;
  117. rxd2-skew-psec = <0>;
  118. rxd3-skew-psec = <0>;
  119. txd0-skew-psec = <0>;
  120. txd1-skew-psec = <0>;
  121. txd2-skew-psec = <0>;
  122. txd3-skew-psec = <0>;
  123. };
  124. };
  125. &extal_clk {
  126. clock-frequency = <24000000>;
  127. };
  128. &gpu {
  129. mali-supply = <&reg_1p1v>;
  130. };
  131. &ostm1 {
  132. status = "okay";
  133. };
  134. &ostm2 {
  135. status = "okay";
  136. };
  137. &pinctrl {
  138. adc_pins: adc {
  139. pinmux = <RZG2L_PORT_PINMUX(9, 0, 2)>; /* ADC_TRG */
  140. };
  141. eth0_pins: eth0 {
  142. pinmux = <RZG2L_PORT_PINMUX(28, 1, 1)>, /* ET0_LINKSTA */
  143. <RZG2L_PORT_PINMUX(27, 1, 1)>, /* ET0_MDC */
  144. <RZG2L_PORT_PINMUX(28, 0, 1)>, /* ET0_MDIO */
  145. <RZG2L_PORT_PINMUX(20, 0, 1)>, /* ET0_TXC */
  146. <RZG2L_PORT_PINMUX(20, 1, 1)>, /* ET0_TX_CTL */
  147. <RZG2L_PORT_PINMUX(20, 2, 1)>, /* ET0_TXD0 */
  148. <RZG2L_PORT_PINMUX(21, 0, 1)>, /* ET0_TXD1 */
  149. <RZG2L_PORT_PINMUX(21, 1, 1)>, /* ET0_TXD2 */
  150. <RZG2L_PORT_PINMUX(22, 0, 1)>, /* ET0_TXD3 */
  151. <RZG2L_PORT_PINMUX(24, 0, 1)>, /* ET0_RXC */
  152. <RZG2L_PORT_PINMUX(24, 1, 1)>, /* ET0_RX_CTL */
  153. <RZG2L_PORT_PINMUX(25, 0, 1)>, /* ET0_RXD0 */
  154. <RZG2L_PORT_PINMUX(25, 1, 1)>, /* ET0_RXD1 */
  155. <RZG2L_PORT_PINMUX(26, 0, 1)>, /* ET0_RXD2 */
  156. <RZG2L_PORT_PINMUX(26, 1, 1)>, /* ET0_RXD3 */
  157. <RZG2L_PORT_PINMUX(1, 0, 1)>; /* IRQ2 */
  158. };
  159. eth1_pins: eth1 {
  160. pinmux = <RZG2L_PORT_PINMUX(37, 2, 1)>, /* ET1_LINKSTA */
  161. <RZG2L_PORT_PINMUX(37, 0, 1)>, /* ET1_MDC */
  162. <RZG2L_PORT_PINMUX(37, 1, 1)>, /* ET1_MDIO */
  163. <RZG2L_PORT_PINMUX(29, 0, 1)>, /* ET1_TXC */
  164. <RZG2L_PORT_PINMUX(29, 1, 1)>, /* ET1_TX_CTL */
  165. <RZG2L_PORT_PINMUX(30, 0, 1)>, /* ET1_TXD0 */
  166. <RZG2L_PORT_PINMUX(30, 1, 1)>, /* ET1_TXD1 */
  167. <RZG2L_PORT_PINMUX(31, 0, 1)>, /* ET1_TXD2 */
  168. <RZG2L_PORT_PINMUX(31, 1, 1)>, /* ET1_TXD3 */
  169. <RZG2L_PORT_PINMUX(33, 1, 1)>, /* ET1_RXC */
  170. <RZG2L_PORT_PINMUX(34, 0, 1)>, /* ET1_RX_CTL */
  171. <RZG2L_PORT_PINMUX(34, 1, 1)>, /* ET1_RXD0 */
  172. <RZG2L_PORT_PINMUX(35, 0, 1)>, /* ET1_RXD1 */
  173. <RZG2L_PORT_PINMUX(35, 1, 1)>, /* ET1_RXD2 */
  174. <RZG2L_PORT_PINMUX(36, 0, 1)>, /* ET1_RXD3 */
  175. <RZG2L_PORT_PINMUX(1, 1, 1)>; /* IRQ3 */
  176. };
  177. gpio-sd0-pwr-en-hog {
  178. gpio-hog;
  179. gpios = <RZG2L_GPIO(4, 1) GPIO_ACTIVE_HIGH>;
  180. output-high;
  181. line-name = "gpio_sd0_pwr_en";
  182. };
  183. qspi0_pins: qspi0 {
  184. qspi0-data {
  185. pins = "QSPI0_IO0", "QSPI0_IO1", "QSPI0_IO2", "QSPI0_IO3";
  186. power-source = <1800>;
  187. };
  188. qspi0-ctrl {
  189. pins = "QSPI0_SPCLK", "QSPI0_SSL", "QSPI_RESET#";
  190. power-source = <1800>;
  191. };
  192. };
  193. /*
  194. * SD0 device selection is XOR between GPIO_SD0_DEV_SEL and SW1[2]
  195. * The below switch logic can be used to select the device between
  196. * eMMC and microSD, after setting GPIO_SD0_DEV_SEL to high in DT.
  197. * SW1[2] should be at position 2/OFF to enable 64 GB eMMC
  198. * SW1[2] should be at position 3/ON to enable uSD card CN3
  199. */
  200. sd0-dev-sel-hog {
  201. gpio-hog;
  202. gpios = <RZG2L_GPIO(41, 1) GPIO_ACTIVE_HIGH>;
  203. output-high;
  204. line-name = "sd0_dev_sel";
  205. };
  206. sdhi0_emmc_pins: sd0emmc {
  207. sd0_emmc_data {
  208. pins = "SD0_DATA0", "SD0_DATA1", "SD0_DATA2", "SD0_DATA3",
  209. "SD0_DATA4", "SD0_DATA5", "SD0_DATA6", "SD0_DATA7";
  210. power-source = <1800>;
  211. };
  212. sd0_emmc_ctrl {
  213. pins = "SD0_CLK", "SD0_CMD";
  214. power-source = <1800>;
  215. };
  216. sd0_emmc_rst {
  217. pins = "SD0_RST#";
  218. power-source = <1800>;
  219. };
  220. };
  221. sdhi0_pins: sd0 {
  222. sd0_data {
  223. pins = "SD0_DATA0", "SD0_DATA1", "SD0_DATA2", "SD0_DATA3";
  224. power-source = <3300>;
  225. };
  226. sd0_ctrl {
  227. pins = "SD0_CLK", "SD0_CMD";
  228. power-source = <3300>;
  229. };
  230. sd0_mux {
  231. pinmux = <RZG2L_PORT_PINMUX(47, 0, 2)>; /* SD0_CD */
  232. };
  233. };
  234. sdhi0_pins_uhs: sd0_uhs {
  235. sd0_data_uhs {
  236. pins = "SD0_DATA0", "SD0_DATA1", "SD0_DATA2", "SD0_DATA3";
  237. power-source = <1800>;
  238. };
  239. sd0_ctrl_uhs {
  240. pins = "SD0_CLK", "SD0_CMD";
  241. power-source = <1800>;
  242. };
  243. sd0_mux_uhs {
  244. pinmux = <RZG2L_PORT_PINMUX(47, 0, 2)>; /* SD0_CD */
  245. };
  246. };
  247. };
  248. &sbc {
  249. pinctrl-0 = <&qspi0_pins>;
  250. pinctrl-names = "default";
  251. status = "okay";
  252. flash@0 {
  253. compatible = "micron,mt25qu512a", "jedec,spi-nor";
  254. reg = <0>;
  255. m25p,fast-read;
  256. spi-max-frequency = <50000000>;
  257. spi-rx-bus-width = <4>;
  258. partitions {
  259. compatible = "fixed-partitions";
  260. #address-cells = <1>;
  261. #size-cells = <1>;
  262. boot@0 {
  263. reg = <0x00000000 0x2000000>;
  264. read-only;
  265. };
  266. user@2000000 {
  267. reg = <0x2000000 0x2000000>;
  268. };
  269. };
  270. };
  271. };
  272. #if SDHI
  273. &sdhi0 {
  274. pinctrl-0 = <&sdhi0_pins>;
  275. pinctrl-1 = <&sdhi0_pins_uhs>;
  276. pinctrl-names = "default", "state_uhs";
  277. vmmc-supply = <&reg_3p3v>;
  278. vqmmc-supply = <&vccq_sdhi0>;
  279. bus-width = <4>;
  280. sd-uhs-sdr50;
  281. sd-uhs-sdr104;
  282. status = "okay";
  283. };
  284. #endif
  285. #if EMMC
  286. &sdhi0 {
  287. pinctrl-0 = <&sdhi0_emmc_pins>;
  288. pinctrl-1 = <&sdhi0_emmc_pins>;
  289. pinctrl-names = "default", "state_uhs";
  290. vmmc-supply = <&reg_3p3v>;
  291. vqmmc-supply = <&reg_1p8v>;
  292. bus-width = <8>;
  293. mmc-hs200-1_8v;
  294. non-removable;
  295. fixed-emmc-driver-type = <1>;
  296. status = "okay";
  297. };
  298. #endif
  299. &wdt0 {
  300. status = "okay";
  301. timeout-sec = <60>;
  302. };
  303. &wdt1 {
  304. status = "okay";
  305. timeout-sec = <60>;
  306. };
  307. &wdt2 {
  308. status = "okay";
  309. timeout-sec = <60>;
  310. };