mt7988a-bananapi-bpi-r4.dtsi 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. // SPDX-License-Identifier: (GPL-2.0 OR MIT)
  2. /*
  3. * Copyright (C) 2022 MediaTek Inc.
  4. * Author: Sam.Shih <[email protected]>
  5. */
  6. /dts-v1/;
  7. #include "mt7988a.dtsi"
  8. #include <dt-bindings/gpio/gpio.h>
  9. #include <dt-bindings/input/input.h>
  10. #include <dt-bindings/leds/common.h>
  11. #include <dt-bindings/regulator/richtek,rt5190a-regulator.h>
  12. / {
  13. model = "Bananapi BPI-R4";
  14. compatible = "bananapi,bpi-r4",
  15. "mediatek,mt7988a";
  16. aliases {
  17. ethernet0 = &gmac0;
  18. ethernet1 = &gmac1;
  19. led-boot = &led_green;
  20. led-failsafe = &led_green;
  21. led-running = &led_green;
  22. led-upgrade = &led_green;
  23. serial0 = &uart0;
  24. };
  25. chosen {
  26. stdout-path = &uart0;
  27. bootargs = "console=ttyS0,115200n1 loglevel=8 pci=pcie_bus_perf ubi.block=0,fit root=/dev/fit0";
  28. rootdisk-spim-nand = <&ubi_rootfs>;
  29. };
  30. memory {
  31. reg = <0x00 0x40000000 0x00 0x10000000>;
  32. };
  33. /* SFP1 cage (WAN) */
  34. sfp1: sfp1 {
  35. compatible = "sff,sfp";
  36. i2c-bus = <&i2c_sfp1>;
  37. los-gpios = <&pio 54 GPIO_ACTIVE_HIGH>;
  38. mod-def0-gpios = <&pio 82 GPIO_ACTIVE_LOW>;
  39. tx-disable-gpios = <&pio 70 GPIO_ACTIVE_HIGH>;
  40. tx-fault-gpios = <&pio 69 GPIO_ACTIVE_HIGH>;
  41. rate-select0-gpios = <&pio 21 GPIO_ACTIVE_LOW>;
  42. maximum-power-milliwatt = <3000>;
  43. };
  44. gpio-keys {
  45. compatible = "gpio-keys";
  46. wps {
  47. label = "WPS";
  48. linux,code = <KEY_RESTART>;
  49. gpios = <&pio 14 GPIO_ACTIVE_LOW>;
  50. };
  51. };
  52. gpio-leds {
  53. compatible = "gpio-leds";
  54. led_green: led-green {
  55. function = LED_FUNCTION_STATUS;
  56. color = <LED_COLOR_ID_GREEN>;
  57. gpios = <&pio 79 GPIO_ACTIVE_HIGH>;
  58. default-state = "on";
  59. };
  60. led_blue: led-blue {
  61. function = LED_FUNCTION_WPS;
  62. color = <LED_COLOR_ID_BLUE>;
  63. gpios = <&pio 63 GPIO_ACTIVE_HIGH>;
  64. default-state = "off";
  65. };
  66. };
  67. };
  68. &eth {
  69. status = "okay";
  70. };
  71. &gmac0 {
  72. status = "okay";
  73. };
  74. &gmac2 {
  75. sfp = <&sfp1>;
  76. managed = "in-band-status";
  77. phy-mode = "usxgmii";
  78. status = "okay";
  79. };
  80. &switch {
  81. status = "okay";
  82. };
  83. &gsw_phy0 {
  84. pinctrl-names = "gbe-led";
  85. pinctrl-0 = <&gbe0_led0_pins>;
  86. };
  87. &gsw_port0 {
  88. label = "wan";
  89. };
  90. &gsw_phy0_led0 {
  91. status = "okay";
  92. color = <LED_COLOR_ID_GREEN>;
  93. };
  94. &gsw_phy1 {
  95. pinctrl-names = "gbe-led";
  96. pinctrl-0 = <&gbe1_led0_pins>;
  97. };
  98. &gsw_phy1_led0 {
  99. status = "okay";
  100. color = <LED_COLOR_ID_GREEN>;
  101. };
  102. &gsw_phy2 {
  103. pinctrl-names = "gbe-led";
  104. pinctrl-0 = <&gbe2_led0_pins>;
  105. };
  106. &gsw_phy2_led0 {
  107. status = "okay";
  108. color = <LED_COLOR_ID_GREEN>;
  109. };
  110. &gsw_phy3 {
  111. pinctrl-names = "gbe-led";
  112. pinctrl-0 = <&gbe3_led0_pins>;
  113. };
  114. &gsw_phy3_led0 {
  115. status = "okay";
  116. color = <LED_COLOR_ID_GREEN>;
  117. };
  118. &cpu0 {
  119. proc-supply = <&rt5190_buck3>;
  120. };
  121. &cpu1 {
  122. proc-supply = <&rt5190_buck3>;
  123. };
  124. &cpu2 {
  125. proc-supply = <&rt5190_buck3>;
  126. };
  127. &cpu3 {
  128. proc-supply = <&rt5190_buck3>;
  129. };
  130. &cci {
  131. proc-supply = <&rt5190_buck3>;
  132. };
  133. &i2c0 {
  134. pinctrl-names = "default";
  135. pinctrl-0 = <&i2c0_pins>;
  136. status = "okay";
  137. rt5190a_64: rt5190a@64 {
  138. compatible = "richtek,rt5190a";
  139. reg = <0x64>;
  140. vin2-supply = <&rt5190_buck1>;
  141. vin3-supply = <&rt5190_buck1>;
  142. vin4-supply = <&rt5190_buck1>;
  143. regulators {
  144. rt5190_buck1: buck1 {
  145. regulator-name = "rt5190a-buck1";
  146. regulator-min-microvolt = <5090000>;
  147. regulator-max-microvolt = <5090000>;
  148. regulator-allowed-modes =
  149. <RT5190A_OPMODE_AUTO RT5190A_OPMODE_FPWM>;
  150. regulator-boot-on;
  151. regulator-always-on;
  152. };
  153. buck2 {
  154. regulator-name = "vcore";
  155. regulator-min-microvolt = <600000>;
  156. regulator-max-microvolt = <1400000>;
  157. regulator-boot-on;
  158. regulator-always-on;
  159. };
  160. rt5190_buck3: buck3 {
  161. regulator-name = "vproc";
  162. regulator-min-microvolt = <600000>;
  163. regulator-max-microvolt = <1400000>;
  164. regulator-boot-on;
  165. };
  166. buck4 {
  167. regulator-name = "rt5190a-buck4";
  168. regulator-min-microvolt = <850000>;
  169. regulator-max-microvolt = <850000>;
  170. regulator-allowed-modes =
  171. <RT5190A_OPMODE_AUTO RT5190A_OPMODE_FPWM>;
  172. regulator-boot-on;
  173. regulator-always-on;
  174. };
  175. ldo {
  176. regulator-name = "rt5190a-ldo";
  177. regulator-min-microvolt = <1200000>;
  178. regulator-max-microvolt = <1200000>;
  179. regulator-boot-on;
  180. regulator-always-on;
  181. };
  182. };
  183. };
  184. };
  185. &i2c2 {
  186. pinctrl-names = "default";
  187. pinctrl-0 = <&i2c2_1_pins>;
  188. status = "okay";
  189. pca9545: i2c-switch@70 {
  190. reg = <0x70>;
  191. compatible = "nxp,pca9545";
  192. reset-gpios = <&pio 5 GPIO_ACTIVE_LOW>;
  193. #address-cells = <1>;
  194. #size-cells = <0>;
  195. i2c_rtc: i2c@0 { //eeprom,rtc,ngff
  196. #address-cells = <1>;
  197. #size-cells = <0>;
  198. reg = <0>;
  199. eeprom@50 {
  200. compatible = "atmel,24c02";
  201. reg = <0x50>;
  202. address-bits = <8>;
  203. page-size = <8>;
  204. size = <256>;
  205. };
  206. eeprom@57 {
  207. compatible = "atmel,24c02";
  208. reg = <0x57>;
  209. address-bits = <8>;
  210. page-size = <8>;
  211. size = <256>;
  212. };
  213. pcf8563: rtc@51 {
  214. compatible = "nxp,pcf8563";
  215. reg = <0x51>;
  216. status = "disabled";
  217. };
  218. };
  219. i2c_sfp1: i2c@1 {
  220. #address-cells = <1>;
  221. #size-cells = <0>;
  222. reg = <1>;
  223. };
  224. i2c_wifi: i2c@3 {
  225. #address-cells = <1>;
  226. #size-cells = <0>;
  227. reg = <3>;
  228. };
  229. };
  230. };
  231. /* mPCIe SIM2 */
  232. &pcie0 {
  233. pinctrl-names = "default";
  234. pinctrl-0 = <&pcie0_pins>;
  235. status = "okay";
  236. };
  237. /* mPCIe SIM3 */
  238. &pcie1 {
  239. pinctrl-names = "default";
  240. pinctrl-0 = <&pcie1_pins>;
  241. status = "okay";
  242. };
  243. /* M.2 key-B SIM1 */
  244. &pcie2 {
  245. pinctrl-names = "default";
  246. pinctrl-0 = <&pcie2_pins>;
  247. status = "okay";
  248. };
  249. /* M.2 key-M SSD */
  250. &pcie3 {
  251. pinctrl-names = "default";
  252. pinctrl-0 = <&pcie3_pins>;
  253. status = "okay";
  254. };
  255. &ssusb1 {
  256. status = "okay";
  257. };
  258. &tphy {
  259. status = "okay";
  260. };
  261. &spi0 {
  262. pinctrl-names = "default";
  263. pinctrl-0 = <&spi0_flash_pins>;
  264. status = "okay";
  265. spi_nand: spi_nand@0 {
  266. compatible = "spi-nand";
  267. reg = <0>;
  268. spi-max-frequency = <52000000>;
  269. spi-tx-buswidth = <4>;
  270. spi-rx-buswidth = <4>;
  271. };
  272. };
  273. &spi_nand {
  274. partitions {
  275. compatible = "fixed-partitions";
  276. #address-cells = <1>;
  277. #size-cells = <1>;
  278. partition@0 {
  279. label = "bl2";
  280. reg = <0x0 0x200000>;
  281. read-only;
  282. };
  283. partition@200000 {
  284. label = "ubi";
  285. reg = <0x200000 0x7e00000>;
  286. compatible = "linux,ubi";
  287. volumes {
  288. ubi-volume-ubootenv {
  289. volname = "ubootenv";
  290. nvmem-layout {
  291. compatible = "u-boot,env-redundant-bool-layout";
  292. };
  293. };
  294. ubi-volume-ubootenv2 {
  295. volname = "ubootenv2";
  296. nvmem-layout {
  297. compatible = "u-boot,env-redundant-bool-layout";
  298. };
  299. };
  300. ubi_rootfs: ubi-volume-fit {
  301. volname = "fit";
  302. };
  303. };
  304. };
  305. };
  306. };
  307. &uart0 {
  308. status = "okay";
  309. };
  310. &uart1 {
  311. status = "okay";
  312. pinctrl-names = "default";
  313. pinctrl-0 = <&uart1_2_lite_pins>;
  314. };
  315. &uart2 {
  316. status = "okay";
  317. pinctrl-names = "default";
  318. pinctrl-0 = <&uart2_3_pins>;
  319. };
  320. &watchdog {
  321. status = "okay";
  322. };
  323. &xphy {
  324. status = "okay";
  325. };