hiveap-330.dts 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. /*
  2. * Aerohive HiveAP-330 Device Tree Source
  3. *
  4. * Copyright (C) 2017 Chris Blake <[email protected]>
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation; either version 2 of the License, or (at your
  9. * option) any later version.
  10. */
  11. #include <dt-bindings/leds/common.h>
  12. #include <dt-bindings/input/input.h>
  13. #include <dt-bindings/gpio/gpio.h>
  14. /include/ "fsl/p1020si-pre.dtsi"
  15. / {
  16. model = "Aerohive HiveAP-330";
  17. compatible = "aerohive,hiveap-330";
  18. aliases {
  19. led-boot = &led_power_green;
  20. led-failsafe = &led_fault_red;
  21. led-running = &led_power_green;
  22. led-upgrade = &led_fault_red;
  23. label-mac-device = &enet0;
  24. spi0 = &spi0;
  25. };
  26. chosen {
  27. /*
  28. * not yet implemented.
  29. * stdout-path = &serial0 ":9600n8";
  30. * <https://www.spinics.net/lists/devicetree-compiler/msg02487.html>
  31. *
  32. * this should work... but it doesn't because CONFIG_CMDLINE in our
  33. * OpenWrt's target config sets "console=ttyS0,115200"
  34. * stdout-path = "/soc@ffe00000/serial@4500:9600n8";
  35. */
  36. bootargs = "console=ttyS0,9600n8";
  37. };
  38. cpus {
  39. PowerPC,P1020@0 {
  40. i-cache-sets = <0x80>;
  41. i-cache-size = <0x8000>;
  42. i-cache-block-size = <0x20>;
  43. d-cache-sets = <0x80>;
  44. d-cache-size = <0x8000>;
  45. d-cache-block-size = <0x20>;
  46. status = "okay";
  47. clock-frequency = <533333328>; /* 533.33 MHz */
  48. bus-frequency = <266666664>; /* 266.66 MHz */
  49. timebase-frequency = <33333333>; /* 33.33 MHz */
  50. };
  51. PowerPC,P1020@1 {
  52. i-cache-sets = <0x80>;
  53. i-cache-size = <0x8000>;
  54. i-cache-block-size = <0x20>;
  55. d-cache-sets = <0x80>;
  56. d-cache-size = <0x8000>;
  57. d-cache-block-size = <0x20>;
  58. cpu-release-addr = <0x00 0xffff240>;
  59. enable-method = "spin-table";
  60. status = "disabled";
  61. clock-frequency = <533333328>;
  62. bus-frequency = <266666664>;
  63. timebase-frequency = <33333333>;
  64. };
  65. };
  66. memory {
  67. #address-cells = <2>;
  68. #size-cells = <2>;
  69. reg = <0x00 0x00 0x00 0x10000000>;
  70. device_type = "memory";
  71. };
  72. /*
  73. * Usually, u-boot provided /memreserve/ properties by adding them during boot.
  74. * these have been converted to reserved-memory entries.
  75. */
  76. reserved-memory {
  77. #address-cells = <2>;
  78. #size-cells = <2>;
  79. ranges;
  80. /*
  81. * /memreserve/ 0x0000000000ffa000 0x0000000000004000;
  82. * The kernel complains when booting:
  83. *
  84. * | OF: fdt: Reserved memory: failed to reserve memory for node
  85. * 'firmware@ffa000': base 0x00ffa000, size 0 MiB
  86. *
  87. * But this likely uboot's bootargs + modified DTB. And if so, we don't care.
  88. * This is because we rely on our own dtb that's in the simpleImage.
  89. *
  90. * Note: This is backed up by u-boot. just before the kernel executes
  91. * it prints this final line:
  92. * | Loading Device Tree to 00ff9000, end 00fff1c4 ... OK
  93. *
  94. * firmware@ffa000 {
  95. * reg = <0x0 0xffa000 0x0 0x4000>;
  96. * no-map;
  97. * };
  98. */
  99. // /memreserve/ 0x000000000fe2f000 0x0000000000000021;
  100. firmware@fe2f000 {
  101. reg = <0x0 0xfe2f000 0x0 0x21>;
  102. no-map;
  103. };
  104. /*
  105. * /memreserve/ 0x000000000ffff000 0x0000000000001000;
  106. * that's the spin-table - see second CPU core binding.
  107. */
  108. firmware@ffff000 {
  109. reg = <0x0 0xffff000 0x0 0x1000>;
  110. no-map;
  111. };
  112. };
  113. board_lbc: lbc: localbus@ffe05000 {
  114. bus-frequency = <16666666>; /* 16.66 MHz */
  115. reg = <0 0xffe05000 0 0x1000>;
  116. ranges = <0x0 0x0 0x0 0xec000000 0x4000000>;
  117. nor@0 {
  118. #address-cells = <1>;
  119. #size-cells = <1>;
  120. compatible = "cfi-flash";
  121. reg = <0x0 0x0 0x4000000>;
  122. bank-width = <2>;
  123. device-width = <1>;
  124. partitions {
  125. compatible = "fixed-partitions";
  126. #address-cells = <1>;
  127. #size-cells = <1>;
  128. firmware@0 {
  129. reg = <0x0 0x3f00000>;
  130. label = "firmware";
  131. /*
  132. * This unknown/invalid compatible prevents
  133. * openwrt's mtdsplit_fit to go off a tangent if it
  134. * finds a magic value inside the uncompressed kernel
  135. * at a blocksized aligned place.
  136. */
  137. compatible = "areohive,hiveap-330-image";
  138. };
  139. partition@0 {
  140. reg = <0x0 0x40000>;
  141. label = "dtb";
  142. };
  143. partition@40000 {
  144. compatible = "openwrt,uimage", "denx,uimage";
  145. reg = <0x40000 0x3ec0000>;
  146. label = "kernel";
  147. };
  148. partition@3f00000 {
  149. reg = <0x3f00000 0x20000>;
  150. label = "hw-info";
  151. read-only;
  152. nvmem-layout {
  153. compatible = "fixed-layout";
  154. #address-cells = <1>;
  155. #size-cells = <1>;
  156. macaddr_hwinfo_0: macaddr@0 {
  157. compatible = "mac-base";
  158. reg = <0x0 0x6>;
  159. #nvmem-cell-cells = <1>;
  160. };
  161. };
  162. };
  163. partition@3f20000 {
  164. reg = <0x3f20000 0x20000>;
  165. label = "boot-info";
  166. read-only;
  167. };
  168. partition@3f40000 {
  169. reg = <0x3f40000 0x20000>;
  170. label = "boot-info-backup";
  171. read-only;
  172. };
  173. partition@3f60000 {
  174. reg = <0x3f60000 0x20000>;
  175. label = "u-boot-env";
  176. };
  177. partition@3f80000 {
  178. reg = <0x3f80000 0x80000>;
  179. label = "u-boot";
  180. read-only;
  181. };
  182. };
  183. };
  184. };
  185. board_soc: soc: soc@ffe00000 {
  186. ranges = <0x0 0x0 0xffe00000 0x100000>;
  187. bus-frequency = <266666664>;
  188. spi0: spi@7000 {
  189. #address-cells = <1>;
  190. #size-cells = <0>;
  191. temperature-sensor@1 {
  192. compatible = "ti,tmp125";
  193. reg = <1>;
  194. spi-max-frequency = <5000000>;
  195. };
  196. };
  197. i2c@3100 {
  198. tpm@29 {
  199. compatible = "atmel,at97sc3204t";
  200. reg = <0x29>;
  201. };
  202. lp5521@32 {
  203. compatible = "national,lp5521";
  204. reg = <0x32>;
  205. clock-mode = /bits/ 8 <2>;
  206. #address-cells = <1>;
  207. #size-cells = <0>;
  208. #if 1
  209. led_fault_red: led@0 {
  210. reg = <0>;
  211. chan-name = "fault:red";
  212. led-cur = /bits/ 8 <0x2f>;
  213. max-cur = /bits/ 8 <0x5f>;
  214. color = <LED_COLOR_ID_RED>;
  215. function = LED_FUNCTION_FAULT;
  216. };
  217. led_power_green: led@1 {
  218. reg = <1>;
  219. chan-name = "power:green";
  220. led-cur = /bits/ 8 <0x2f>;
  221. max-cur = /bits/ 8 <0x5f>;
  222. color = <LED_COLOR_ID_GREEN>;
  223. function = LED_FUNCTION_POWER;
  224. };
  225. led@2{
  226. reg = <2>;
  227. chan-name = "blue";
  228. led-cur = /bits/ 8 <0x2f>;
  229. max-cur = /bits/ 8 <0x5f>;
  230. color = <LED_COLOR_ID_BLUE>;
  231. };
  232. #else
  233. /*
  234. * openwrt isn't ready to handle multi-intensity leds yet
  235. * # echo 255 255 255 > /sys/class/leds/tricolor/multi_intensity
  236. * # echo 255 > /sys/class/leds/tricolor/brightness
  237. */
  238. rgbled-0 {
  239. function = LED_FUNCTION_POWER;
  240. color = <LED_COLOR_ID_RGB>;
  241. #address-cells = <1>;
  242. #size-cells = <0>;
  243. led@0 {
  244. reg = <0>;
  245. chan-name = "tricolor";
  246. led-cur = /bits/ 8 <0x2f>;
  247. max-cur = /bits/ 8 <0x5f>;
  248. color = <LED_COLOR_ID_RED>;
  249. };
  250. led@1 {
  251. reg = <1>;
  252. chan-name = "tricolor";
  253. led-cur = /bits/ 8 <0x2f>;
  254. max-cur = /bits/ 8 <0x5f>;
  255. color = <LED_COLOR_ID_GREEN>;
  256. };
  257. led@2{
  258. reg = <2>;
  259. chan-name = "tricolor";
  260. led-cur = /bits/ 8 <0x2f>;
  261. max-cur = /bits/ 8 <0x5f>;
  262. color = <LED_COLOR_ID_BLUE>;
  263. };
  264. };
  265. #endif
  266. };
  267. eeprom@51 {
  268. /*
  269. * 1Kbit I2C/SMBus EEPROM with SHA-1 Engine
  270. * Aerohive calls it "dallas".
  271. */
  272. compatible = "adi,ds28cn01";
  273. reg = <0x51>;
  274. read-only;
  275. };
  276. };
  277. mdio@24000 {
  278. phy0: ethernet-phy@0 {
  279. /* interrupts = <3 1 0 0>; */
  280. reg = <0x1>;
  281. };
  282. phy1: ethernet-phy@1 {
  283. /* interrupts = <2 1 0 0>; */
  284. reg = <0x2>;
  285. };
  286. };
  287. mdio@25000 {
  288. status = "disabled";
  289. };
  290. mdio@26000 {
  291. status = "disabled";
  292. };
  293. enet0: ethernet@b0000 {
  294. rx-stash-idx = <0x00>;
  295. rx-stash-len = <0x60>;
  296. bd-stash;
  297. status = "okay";
  298. phy-handle = <&phy0>;
  299. phy-connection-type = "rgmii-id";
  300. nvmem-cells = <&macaddr_hwinfo_0 0>;
  301. nvmem-cell-names = "mac-address";
  302. };
  303. enet1: ethernet@b1000 {
  304. status = "disabled";
  305. };
  306. enet2: ethernet@b2000 {
  307. rx-stash-idx = <0x00>;
  308. rx-stash-len = <0x60>;
  309. bd-stash;
  310. status = "okay";
  311. phy-handle = <&phy1>;
  312. phy-connection-type = "rgmii-id";
  313. nvmem-cells = <&macaddr_hwinfo_0 1>;
  314. nvmem-cell-names = "mac-address";
  315. };
  316. gpio0: gpio-controller@fc00 {
  317. };
  318. usb@22000 {
  319. phy_type = "ulpi";
  320. dr_mode = "host";
  321. };
  322. usb@23000 {
  323. status = "disabled";
  324. };
  325. };
  326. pci0: pcie@ffe09000 {
  327. reg = <0x0 0xffe09000 0x0 0x1000>;
  328. ranges = <0x2000000 0x0 0xa0000000 0x0 0xa0000000 0x0 0x20000000>,
  329. <0x1000000 0x0 0x00000000 0x0 0xffc30000 0x0 0x10000>;
  330. pcie@0 {
  331. ranges = <0x2000000 0x0 0xa0000000 0x2000000 0x0 0xa0000000 0x0 0x20000000>,
  332. <0x1000000 0x0 0x00000000 0x1000000 0x0 0x00000000 0x0 0x00100000>;
  333. };
  334. };
  335. pci1: pcie@ffe0a000 {
  336. reg = <0x0 0xffe0a000 0x0 0x1000>;
  337. ranges = <0x2000000 0x0 0xc0000000 0x0 0xc0000000 0x0 0x20000000>,
  338. <0x1000000 0x0 0x00000000 0x0 0xffc20000 0x0 0x10000>;
  339. pcie@0 {
  340. ranges = <0x2000000 0x0 0xc0000000 0x2000000 0x0 0xc0000000 0x0 0x20000000>,
  341. <0x1000000 0x0 0x00000000 0x1000000 0x0 0x00000000 0x0 0x00100000>;
  342. };
  343. };
  344. buttons {
  345. compatible = "gpio-keys";
  346. reset {
  347. label = "Reset button";
  348. gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
  349. linux,code = <KEY_RESTART>;
  350. };
  351. };
  352. };
  353. /include/ "fsl/p1020si-post.dtsi"
  354. &serial0 {
  355. clock-frequency = <266666664>;
  356. };
  357. &serial1 {
  358. clock-frequency = <266666664>;
  359. };
  360. /*
  361. * For the OpenWrt 22.03 release, since Linux 5.10.138 now uses
  362. * aliases to determine PCI domain numbers, drop aliases so as not to
  363. * change the sysfs path of our wireless netdevs.
  364. */
  365. / {
  366. aliases {
  367. /delete-property/ pci0;
  368. /delete-property/ pci1;
  369. };
  370. };