qcom-ipq4019-hap-ac3.dts 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
  2. /* Copyright (c) 2021, Robert Marko <[email protected]> */
  3. #include "qcom-ipq4019.dtsi"
  4. #include <dt-bindings/gpio/gpio.h>
  5. #include <dt-bindings/input/input.h>
  6. #include <dt-bindings/leds/common.h>
  7. #include <dt-bindings/soc/qcom,tcsr.h>
  8. / {
  9. model = "MikroTik hAP ac3";
  10. compatible = "mikrotik,hap-ac3";
  11. memory {
  12. device_type = "memory";
  13. reg = <0x80000000 0x10000000>;
  14. };
  15. chosen {
  16. stdout-path = "serial0:115200n8";
  17. };
  18. aliases {
  19. led-boot = &led_status_blue;
  20. led-failsafe = &led_status_red;
  21. led-running = &led_status_blue;
  22. led-upgrade = &led_status_red;
  23. };
  24. soc {
  25. rng@22000 {
  26. status = "okay";
  27. };
  28. counter@4a1000 {
  29. compatible = "qcom,qca-gcnt";
  30. reg = <0x4a1000 0x4>;
  31. };
  32. tcsr@1949000 {
  33. compatible = "qcom,tcsr";
  34. reg = <0x1949000 0x100>;
  35. qcom,wifi_glb_cfg = <TCSR_WIFI_GLB_CFG>;
  36. };
  37. tcsr@194b000 {
  38. /* select hostmode */
  39. compatible = "qcom,tcsr";
  40. reg = <0x194b000 0x100>;
  41. qcom,usb-hsphy-mode-select = <TCSR_USB_HSPHY_HOST_MODE>;
  42. status = "okay";
  43. };
  44. ess_tcsr@1953000 {
  45. compatible = "qcom,tcsr";
  46. reg = <0x1953000 0x1000>;
  47. qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
  48. };
  49. tcsr@1957000 {
  50. compatible = "qcom,tcsr";
  51. reg = <0x1957000 0x100>;
  52. qcom,wifi_noc_memtype_m0_m2 = <TCSR_WIFI_NOC_MEMTYPE_M0_M2>;
  53. };
  54. usb2: usb2@60f8800 {
  55. status = "okay";
  56. };
  57. crypto@8e3a000 {
  58. status = "okay";
  59. };
  60. watchdog@b017000 {
  61. status = "okay";
  62. };
  63. };
  64. keys {
  65. compatible = "gpio-keys";
  66. reset {
  67. label = "reset";
  68. gpios = <&tlmm 5 GPIO_ACTIVE_LOW>;
  69. linux,code = <KEY_RESTART>;
  70. };
  71. mode {
  72. label = "mode";
  73. gpios = <&tlmm 4 GPIO_ACTIVE_LOW>;
  74. linux,code = <KEY_RFKILL>;
  75. };
  76. led {
  77. label = "led";
  78. gpios = <&tlmm 42 GPIO_ACTIVE_LOW>;
  79. linux,code = <KEY_WPS_BUTTON>;
  80. };
  81. };
  82. leds {
  83. compatible = "gpio-leds";
  84. led_status_blue: status-blue {
  85. function = LED_FUNCTION_STATUS;
  86. color = <LED_COLOR_ID_BLUE>;
  87. gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>;
  88. };
  89. led_status_red: status-red {
  90. function = LED_FUNCTION_STATUS;
  91. color = <LED_COLOR_ID_RED>;
  92. gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>;
  93. panic-indicator;
  94. };
  95. led_status_green: status-green {
  96. function = LED_FUNCTION_STATUS;
  97. color = <LED_COLOR_ID_GREEN>;
  98. gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>;
  99. };
  100. wlan {
  101. function = LED_FUNCTION_WLAN;
  102. color = <LED_COLOR_ID_GREEN>;
  103. gpios = <&tlmm 23 GPIO_ACTIVE_HIGH>;
  104. };
  105. ethernet {
  106. label = "green:ethernet";
  107. gpios = <&tlmm 22 GPIO_ACTIVE_HIGH>;
  108. };
  109. wan {
  110. function = LED_FUNCTION_WAN;
  111. color = <LED_COLOR_ID_GREEN>;
  112. gpios = <&tlmm 28 GPIO_ACTIVE_HIGH>;
  113. };
  114. lan1 {
  115. label = "green:lan1";
  116. gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>;
  117. };
  118. lan2 {
  119. label = "green:lan2";
  120. gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>;
  121. };
  122. lan3 {
  123. label = "green:lan3";
  124. gpios = <&tlmm 31 GPIO_ACTIVE_HIGH>;
  125. };
  126. lan4 {
  127. label = "green:lan4";
  128. gpios = <&tlmm 32 GPIO_ACTIVE_HIGH>;
  129. };
  130. poe {
  131. label = "red:poe";
  132. gpios = <&tlmm 36 GPIO_ACTIVE_HIGH>;
  133. };
  134. };
  135. };
  136. &tlmm {
  137. serial_pins: serial_pinmux {
  138. mux {
  139. pins = "gpio16", "gpio17";
  140. function = "blsp_uart0";
  141. bias-disable;
  142. };
  143. };
  144. spi_0_pins: spi_0_pinmux {
  145. pin {
  146. function = "blsp_spi0";
  147. pins = "gpio13", "gpio14", "gpio15";
  148. drive-strength = <12>;
  149. bias-disable;
  150. };
  151. pin_cs {
  152. function = "gpio";
  153. pins = "gpio12";
  154. drive-strength = <2>;
  155. bias-disable;
  156. output-high;
  157. };
  158. };
  159. nand_pins: nand_pins {
  160. pullups {
  161. pins = "gpio53", "gpio58", "gpio59";
  162. function = "qpic";
  163. bias-pull-up;
  164. };
  165. pulldowns {
  166. pins = "gpio55", "gpio56", "gpio57", "gpio60",
  167. "gpio62", "gpio63", "gpio64", "gpio65",
  168. "gpio66", "gpio67", "gpio68", "gpio69";
  169. function = "qpic";
  170. bias-pull-down;
  171. };
  172. };
  173. enable-usb-power {
  174. gpio-hog;
  175. gpios = <44 GPIO_ACTIVE_HIGH>;
  176. output-high;
  177. line-name = "enable USB power";
  178. };
  179. };
  180. &blsp_dma {
  181. status = "okay";
  182. };
  183. &blsp1_spi1 {
  184. status = "okay";
  185. pinctrl-0 = <&spi_0_pins>;
  186. pinctrl-names = "default";
  187. cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>;
  188. flash@0 {
  189. reg = <0>;
  190. compatible = "jedec,spi-nor";
  191. spi-max-frequency = <40000000>;
  192. partitions {
  193. compatible = "fixed-partitions";
  194. #address-cells = <1>;
  195. #size-cells = <1>;
  196. partition@0 {
  197. label = "Qualcomm";
  198. reg = <0x0 0x80000>;
  199. read-only;
  200. };
  201. partition@80000 {
  202. compatible = "mikrotik,routerboot-partitions";
  203. #address-cells = <1>;
  204. #size-cells = <1>;
  205. label = "RouterBoot";
  206. reg = <0x80000 0x80000>;
  207. hard_config {
  208. read-only;
  209. size = <0x2000>;
  210. };
  211. dtb_config {
  212. read-only;
  213. };
  214. soft_config {
  215. };
  216. };
  217. };
  218. };
  219. };
  220. &qpic_bam {
  221. status = "okay";
  222. };
  223. &nand {
  224. status = "okay";
  225. pinctrl-0 = <&nand_pins>;
  226. pinctrl-names = "default";
  227. nand@0 {
  228. partitions {
  229. compatible = "fixed-partitions";
  230. #address-cells = <1>;
  231. #size-cells = <1>;
  232. partition@0 {
  233. label = "kernel";
  234. reg = <0x0 0xa00000>;
  235. };
  236. partition@a00000 {
  237. label = "ubi";
  238. reg = <0xa00000 0x7600000>;
  239. };
  240. };
  241. };
  242. };
  243. &blsp1_uart1 {
  244. status = "okay";
  245. pinctrl-0 = <&serial_pins>;
  246. pinctrl-names = "default";
  247. };
  248. &cryptobam {
  249. status = "okay";
  250. };
  251. &usb2_hs_phy {
  252. status = "okay";
  253. };
  254. &mdio {
  255. status = "okay";
  256. };
  257. &gmac {
  258. status = "okay";
  259. };
  260. &switch {
  261. status = "okay";
  262. };
  263. &swport1 {
  264. status = "okay";
  265. label = "lan4";
  266. };
  267. &swport2 {
  268. status = "okay";
  269. label = "lan3";
  270. };
  271. &swport3 {
  272. status = "okay";
  273. label = "lan2";
  274. };
  275. &swport4 {
  276. status = "okay";
  277. label = "lan1";
  278. };
  279. &swport5 {
  280. status = "okay";
  281. };
  282. &wifi0 {
  283. status = "okay";
  284. qcom,ath10k-calibration-variant = "MikroTik-hAP-ac3";
  285. };
  286. &wifi1 {
  287. status = "okay";
  288. qcom,ath10k-calibration-variant = "MikroTik-hAP-ac3";
  289. };