032-v6.6-0016-ARM-dts-BCM5301X-Add-DT-for-Asus-RT-AC3100.patch 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  1. From 2900083269f7c0f0ff430bffc6ced2038aed9b6b Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= <[email protected]>
  3. Date: Thu, 3 Aug 2023 10:14:54 +0300
  4. Subject: [PATCH] ARM: dts: BCM5301X: Add DT for ASUS RT-AC3100
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ASUS RT-AC3100 is ASUS RT-AC88U without the external switch. Move the
  9. shared bindings to bcm47094-asus-rt-ac3100.dtsi.
  10. Remove the fixed-link node on port@7 as commit ba4aebce23b2 ("ARM: dts:
  11. BCM5301X: Describe switch ports in the main DTS") states it's not
  12. necessary.
  13. Replace the copyright notice with an author notice.
  14. Rename the model name from Asus to ASUS on bcm47094-asus-rt-ac88u.dts.
  15. Signed-off-by: Arınç ÜNAL <[email protected]>
  16. Reviewed-by: Linus Walleij <[email protected]>
  17. Link: https://lore.kernel.org/r/[email protected]
  18. Signed-off-by: Florian Fainelli <[email protected]>
  19. ---
  20. arch/arm/boot/dts/Makefile | 1 +
  21. .../dts/bcm47094-asus-rt-ac3100.dts | 23 +++
  22. .../dts/bcm47094-asus-rt-ac3100.dtsi | 163 ++++++++++++++++++
  23. .../dts/bcm47094-asus-rt-ac88u.dts | 155 +----------------
  24. 4 files changed, 190 insertions(+), 152 deletions(-)
  25. create mode 100644 arch/arm/boot/dts/bcm47094-asus-rt-ac3100.dts
  26. create mode 100644 arch/arm/boot/dts/bcm47094-asus-rt-ac3100.dtsi
  27. --- a/arch/arm/boot/dts/Makefile
  28. +++ b/arch/arm/boot/dts/Makefile
  29. @@ -127,6 +127,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
  30. bcm4709-netgear-r7000.dtb \
  31. bcm4709-netgear-r8000.dtb \
  32. bcm4709-tplink-archer-c9-v1.dtb \
  33. + bcm47094-asus-rt-ac3100.dtb \
  34. bcm47094-asus-rt-ac88u.dtb \
  35. bcm47094-dlink-dir-885l.dtb \
  36. bcm47094-dlink-dir-890l.dtb \
  37. --- /dev/null
  38. +++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac3100.dts
  39. @@ -0,0 +1,23 @@
  40. +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
  41. +/*
  42. + * Author: Arınç ÜNAL <[email protected]>
  43. + */
  44. +
  45. +/dts-v1/;
  46. +
  47. +#include "bcm47094-asus-rt-ac3100.dtsi"
  48. +
  49. +/ {
  50. + compatible = "asus,rt-ac3100", "brcm,bcm47094", "brcm,bcm4708";
  51. + model = "ASUS RT-AC3100";
  52. +
  53. + nvram@1c080000 {
  54. + et0macaddr: et0macaddr {
  55. + };
  56. + };
  57. +};
  58. +
  59. +&gmac0 {
  60. + nvmem-cells = <&et0macaddr>;
  61. + nvmem-cell-names = "mac-address";
  62. +};
  63. --- /dev/null
  64. +++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac3100.dtsi
  65. @@ -0,0 +1,163 @@
  66. +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
  67. +/*
  68. + * Author: Arınç ÜNAL <[email protected]>
  69. + */
  70. +
  71. +#include "bcm47094.dtsi"
  72. +#include "bcm5301x-nand-cs0-bch8.dtsi"
  73. +
  74. +/ {
  75. + chosen {
  76. + bootargs = "earlycon";
  77. + };
  78. +
  79. + memory@0 {
  80. + device_type = "memory";
  81. + reg = <0x00000000 0x08000000>,
  82. + <0x88000000 0x18000000>;
  83. + };
  84. +
  85. + nvram@1c080000 {
  86. + compatible = "brcm,nvram";
  87. + reg = <0x1c080000 0x00180000>;
  88. + };
  89. +
  90. + leds {
  91. + compatible = "gpio-leds";
  92. +
  93. + led-power {
  94. + label = "white:power";
  95. + gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>;
  96. + linux,default-trigger = "default-on";
  97. + };
  98. +
  99. + led-wan-red {
  100. + label = "red:wan";
  101. + gpios = <&chipcommon 5 GPIO_ACTIVE_HIGH>;
  102. + };
  103. +
  104. + led-lan {
  105. + label = "white:lan";
  106. + gpios = <&chipcommon 21 GPIO_ACTIVE_LOW>;
  107. + };
  108. +
  109. + led-usb2 {
  110. + label = "white:usb2";
  111. + gpios = <&chipcommon 16 GPIO_ACTIVE_LOW>;
  112. + trigger-sources = <&ehci_port2>;
  113. + linux,default-trigger = "usbport";
  114. + };
  115. +
  116. + led-usb3 {
  117. + label = "white:usb3";
  118. + gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
  119. + trigger-sources = <&ehci_port1>, <&xhci_port1>;
  120. + linux,default-trigger = "usbport";
  121. + };
  122. +
  123. + led-wps {
  124. + label = "white:wps";
  125. + gpios = <&chipcommon 19 GPIO_ACTIVE_LOW>;
  126. + };
  127. + };
  128. +
  129. + gpio-keys {
  130. + compatible = "gpio-keys";
  131. +
  132. + button-wps {
  133. + label = "WPS";
  134. + linux,code = <KEY_WPS_BUTTON>;
  135. + gpios = <&chipcommon 20 GPIO_ACTIVE_LOW>;
  136. + };
  137. +
  138. + button-reset {
  139. + label = "Reset";
  140. + linux,code = <KEY_RESTART>;
  141. + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
  142. + };
  143. +
  144. + button-wifi {
  145. + label = "Wi-Fi";
  146. + linux,code = <KEY_RFKILL>;
  147. + gpios = <&chipcommon 18 GPIO_ACTIVE_LOW>;
  148. + };
  149. +
  150. + button-led {
  151. + label = "Backlight";
  152. + linux,code = <KEY_BRIGHTNESS_ZERO>;
  153. + gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>;
  154. + };
  155. + };
  156. +};
  157. +
  158. +&srab {
  159. + compatible = "brcm,bcm53012-srab", "brcm,bcm5301x-srab";
  160. + status = "okay";
  161. +
  162. + ports {
  163. + port@0 {
  164. + label = "lan4";
  165. + };
  166. +
  167. + port@1 {
  168. + label = "lan3";
  169. + };
  170. +
  171. + port@2 {
  172. + label = "lan2";
  173. + };
  174. +
  175. + port@3 {
  176. + label = "lan1";
  177. + };
  178. +
  179. + port@4 {
  180. + label = "wan";
  181. + };
  182. +
  183. + port@5 {
  184. + label = "cpu";
  185. + };
  186. +
  187. + port@7 {
  188. + label = "cpu";
  189. + };
  190. +
  191. + port@8 {
  192. + label = "cpu";
  193. + };
  194. + };
  195. +};
  196. +
  197. +&usb2 {
  198. + vcc-gpio = <&chipcommon 9 GPIO_ACTIVE_HIGH>;
  199. +};
  200. +
  201. +&usb3_phy {
  202. + status = "okay";
  203. +};
  204. +
  205. +&nandcs {
  206. + partitions {
  207. + compatible = "fixed-partitions";
  208. + #address-cells = <1>;
  209. + #size-cells = <1>;
  210. +
  211. + partition@0 {
  212. + label = "boot";
  213. + reg = <0x00000000 0x00080000>;
  214. + read-only;
  215. + };
  216. +
  217. + partition@80000 {
  218. + label = "nvram";
  219. + reg = <0x00080000 0x00180000>;
  220. + };
  221. +
  222. + partition@200000 {
  223. + label = "firmware";
  224. + reg = <0x00200000 0x07e00000>;
  225. + compatible = "brcm,trx";
  226. + };
  227. + };
  228. +};
  229. --- a/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts
  230. +++ b/arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts
  231. @@ -1,102 +1,21 @@
  232. // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
  233. /*
  234. - * Copyright (C) 2021-2022 Arınç ÜNAL <[email protected]>
  235. + * Author: Arınç ÜNAL <[email protected]>
  236. */
  237. /dts-v1/;
  238. -#include "bcm47094.dtsi"
  239. -#include "bcm5301x-nand-cs0-bch8.dtsi"
  240. +#include "bcm47094-asus-rt-ac3100.dtsi"
  241. / {
  242. compatible = "asus,rt-ac88u", "brcm,bcm47094", "brcm,bcm4708";
  243. - model = "Asus RT-AC88U";
  244. -
  245. - chosen {
  246. - bootargs = "earlycon";
  247. - };
  248. -
  249. - memory@0 {
  250. - device_type = "memory";
  251. - reg = <0x00000000 0x08000000>,
  252. - <0x88000000 0x18000000>;
  253. - };
  254. + model = "ASUS RT-AC88U";
  255. nvram@1c080000 {
  256. - compatible = "brcm,nvram";
  257. - reg = <0x1c080000 0x00180000>;
  258. -
  259. et1macaddr: et1macaddr {
  260. };
  261. };
  262. - leds {
  263. - compatible = "gpio-leds";
  264. -
  265. - led-power {
  266. - label = "white:power";
  267. - gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>;
  268. - linux,default-trigger = "default-on";
  269. - };
  270. -
  271. - led-wan-red {
  272. - label = "red:wan";
  273. - gpios = <&chipcommon 5 GPIO_ACTIVE_HIGH>;
  274. - };
  275. -
  276. - led-lan {
  277. - label = "white:lan";
  278. - gpios = <&chipcommon 21 GPIO_ACTIVE_LOW>;
  279. - };
  280. -
  281. - led-usb2 {
  282. - label = "white:usb2";
  283. - gpios = <&chipcommon 16 GPIO_ACTIVE_LOW>;
  284. - trigger-sources = <&ehci_port2>;
  285. - linux,default-trigger = "usbport";
  286. - };
  287. -
  288. - led-usb3 {
  289. - label = "white:usb3";
  290. - gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
  291. - trigger-sources = <&ehci_port1>, <&xhci_port1>;
  292. - linux,default-trigger = "usbport";
  293. - };
  294. -
  295. - led-wps {
  296. - label = "white:wps";
  297. - gpios = <&chipcommon 19 GPIO_ACTIVE_LOW>;
  298. - };
  299. - };
  300. -
  301. - gpio-keys {
  302. - compatible = "gpio-keys";
  303. -
  304. - button-wps {
  305. - label = "WPS";
  306. - linux,code = <KEY_WPS_BUTTON>;
  307. - gpios = <&chipcommon 20 GPIO_ACTIVE_LOW>;
  308. - };
  309. -
  310. - button-reset {
  311. - label = "Reset";
  312. - linux,code = <KEY_RESTART>;
  313. - gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
  314. - };
  315. -
  316. - button-wifi {
  317. - label = "Wi-Fi";
  318. - linux,code = <KEY_RFKILL>;
  319. - gpios = <&chipcommon 18 GPIO_ACTIVE_LOW>;
  320. - };
  321. -
  322. - button-led {
  323. - label = "Backlight";
  324. - linux,code = <KEY_BRIGHTNESS_ZERO>;
  325. - gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>;
  326. - };
  327. - };
  328. -
  329. switch {
  330. compatible = "realtek,rtl8365mb";
  331. /* 7 = MDIO (has input reads), 6 = MDC (clock, output only) */
  332. @@ -175,31 +94,9 @@
  333. };
  334. &srab {
  335. - compatible = "brcm,bcm53012-srab", "brcm,bcm5301x-srab";
  336. - status = "okay";
  337. dsa,member = <0 0>;
  338. ports {
  339. - port@0 {
  340. - label = "lan4";
  341. - };
  342. -
  343. - port@1 {
  344. - label = "lan3";
  345. - };
  346. -
  347. - port@2 {
  348. - label = "lan2";
  349. - };
  350. -
  351. - port@3 {
  352. - label = "lan1";
  353. - };
  354. -
  355. - port@4 {
  356. - label = "wan";
  357. - };
  358. -
  359. sw0_p5: port@5 {
  360. /delete-property/ethernet;
  361. @@ -212,19 +109,6 @@
  362. pause;
  363. };
  364. };
  365. -
  366. - port@7 {
  367. - label = "cpu";
  368. -
  369. - fixed-link {
  370. - speed = <1000>;
  371. - full-duplex;
  372. - };
  373. - };
  374. -
  375. - port@8 {
  376. - label = "cpu";
  377. - };
  378. };
  379. };
  380. @@ -236,36 +120,3 @@
  381. nvmem-cells = <&et1macaddr>;
  382. nvmem-cell-names = "mac-address";
  383. };
  384. -
  385. -&usb2 {
  386. - vcc-gpio = <&chipcommon 9 GPIO_ACTIVE_HIGH>;
  387. -};
  388. -
  389. -&usb3_phy {
  390. - status = "okay";
  391. -};
  392. -
  393. -&nandcs {
  394. - partitions {
  395. - compatible = "fixed-partitions";
  396. - #address-cells = <1>;
  397. - #size-cells = <1>;
  398. -
  399. - partition@0 {
  400. - label = "boot";
  401. - reg = <0x00000000 0x00080000>;
  402. - read-only;
  403. - };
  404. -
  405. - partition@80000 {
  406. - label = "nvram";
  407. - reg = <0x00080000 0x00180000>;
  408. - };
  409. -
  410. - partition@200000 {
  411. - label = "firmware";
  412. - reg = <0x00200000 0x07e00000>;
  413. - compatible = "brcm,trx";
  414. - };
  415. - };
  416. -};