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. crypto@8e3a000 {
  55. status = "okay";
  56. };
  57. watchdog@b017000 {
  58. status = "okay";
  59. };
  60. };
  61. keys {
  62. compatible = "gpio-keys";
  63. reset {
  64. label = "reset";
  65. gpios = <&tlmm 5 GPIO_ACTIVE_LOW>;
  66. linux,code = <KEY_RESTART>;
  67. };
  68. mode {
  69. label = "mode";
  70. gpios = <&tlmm 4 GPIO_ACTIVE_LOW>;
  71. linux,code = <KEY_RFKILL>;
  72. };
  73. led {
  74. label = "led";
  75. gpios = <&tlmm 42 GPIO_ACTIVE_LOW>;
  76. linux,code = <KEY_WPS_BUTTON>;
  77. };
  78. };
  79. leds {
  80. compatible = "gpio-leds";
  81. led_status_blue: status-blue {
  82. function = LED_FUNCTION_STATUS;
  83. color = <LED_COLOR_ID_BLUE>;
  84. gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>;
  85. };
  86. led_status_red: status-red {
  87. function = LED_FUNCTION_STATUS;
  88. color = <LED_COLOR_ID_RED>;
  89. gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>;
  90. panic-indicator;
  91. };
  92. led_status_green: status-green {
  93. function = LED_FUNCTION_STATUS;
  94. color = <LED_COLOR_ID_GREEN>;
  95. gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>;
  96. };
  97. wlan {
  98. function = LED_FUNCTION_WLAN;
  99. color = <LED_COLOR_ID_GREEN>;
  100. gpios = <&tlmm 23 GPIO_ACTIVE_HIGH>;
  101. };
  102. ethernet {
  103. label = "green:ethernet";
  104. gpios = <&tlmm 22 GPIO_ACTIVE_HIGH>;
  105. };
  106. wan {
  107. function = LED_FUNCTION_WAN;
  108. color = <LED_COLOR_ID_GREEN>;
  109. gpios = <&tlmm 28 GPIO_ACTIVE_HIGH>;
  110. };
  111. lan1 {
  112. label = "green:lan1";
  113. gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>;
  114. };
  115. lan2 {
  116. label = "green:lan2";
  117. gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>;
  118. };
  119. lan3 {
  120. label = "green:lan3";
  121. gpios = <&tlmm 31 GPIO_ACTIVE_HIGH>;
  122. };
  123. lan4 {
  124. label = "green:lan4";
  125. gpios = <&tlmm 32 GPIO_ACTIVE_HIGH>;
  126. };
  127. poe {
  128. label = "red:poe";
  129. gpios = <&tlmm 36 GPIO_ACTIVE_HIGH>;
  130. };
  131. };
  132. };
  133. &tlmm {
  134. serial_pins: serial_pinmux {
  135. mux {
  136. pins = "gpio16", "gpio17";
  137. function = "blsp_uart0";
  138. bias-disable;
  139. };
  140. };
  141. spi_0_pins: spi_0_pinmux {
  142. pin {
  143. function = "blsp_spi0";
  144. pins = "gpio13", "gpio14", "gpio15";
  145. drive-strength = <12>;
  146. bias-disable;
  147. };
  148. pin_cs {
  149. function = "gpio";
  150. pins = "gpio12";
  151. drive-strength = <2>;
  152. bias-disable;
  153. output-high;
  154. };
  155. };
  156. nand_pins: nand_pins {
  157. pullups {
  158. pins = "gpio53", "gpio58", "gpio59";
  159. function = "qpic";
  160. bias-pull-up;
  161. };
  162. pulldowns {
  163. pins = "gpio55", "gpio56", "gpio57", "gpio60",
  164. "gpio62", "gpio63", "gpio64", "gpio65",
  165. "gpio66", "gpio67", "gpio68", "gpio69";
  166. function = "qpic";
  167. bias-pull-down;
  168. };
  169. };
  170. enable-usb-power {
  171. gpio-hog;
  172. gpios = <44 GPIO_ACTIVE_HIGH>;
  173. output-high;
  174. line-name = "enable USB power";
  175. };
  176. };
  177. &blsp_dma {
  178. status = "okay";
  179. };
  180. &blsp1_spi1 {
  181. status = "okay";
  182. pinctrl-0 = <&spi_0_pins>;
  183. pinctrl-names = "default";
  184. cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>;
  185. flash@0 {
  186. reg = <0>;
  187. compatible = "jedec,spi-nor";
  188. spi-max-frequency = <40000000>;
  189. partitions {
  190. compatible = "fixed-partitions";
  191. #address-cells = <1>;
  192. #size-cells = <1>;
  193. partition@0 {
  194. label = "Qualcomm";
  195. reg = <0x0 0x80000>;
  196. read-only;
  197. };
  198. partition@80000 {
  199. compatible = "mikrotik,routerboot-partitions";
  200. #address-cells = <1>;
  201. #size-cells = <1>;
  202. label = "RouterBoot";
  203. reg = <0x80000 0x80000>;
  204. hard_config {
  205. read-only;
  206. size = <0x2000>;
  207. };
  208. dtb_config {
  209. read-only;
  210. };
  211. soft_config {
  212. };
  213. };
  214. };
  215. };
  216. };
  217. &qpic_bam {
  218. status = "okay";
  219. };
  220. &nand {
  221. status = "okay";
  222. pinctrl-0 = <&nand_pins>;
  223. pinctrl-names = "default";
  224. nand@0 {
  225. partitions {
  226. compatible = "fixed-partitions";
  227. #address-cells = <1>;
  228. #size-cells = <1>;
  229. partition@0 {
  230. label = "kernel";
  231. reg = <0x0 0xa00000>;
  232. };
  233. partition@a00000 {
  234. label = "ubi";
  235. reg = <0xa00000 0x7600000>;
  236. };
  237. };
  238. };
  239. };
  240. &blsp1_uart1 {
  241. status = "okay";
  242. pinctrl-0 = <&serial_pins>;
  243. pinctrl-names = "default";
  244. };
  245. &cryptobam {
  246. status = "okay";
  247. };
  248. &usb2 {
  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. };