0064-dts.patch 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. --- a/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
  2. +++ b/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
  3. @@ -21,6 +21,10 @@
  4. stdout-path = "serial2:115200n8";
  5. };
  6. + memory {
  7. + reg = <0 0x80000000 0 0x20000000>;
  8. + };
  9. +
  10. cpus {
  11. cpu@0 {
  12. proc-supply = <&mt6323_vproc_reg>;
  13. @@ -84,6 +88,10 @@
  14. memory@80000000 {
  15. reg = <0 0x80000000 0 0x40000000>;
  16. };
  17. +
  18. + mt7530: switch@0 {
  19. + compatible = "mediatek,mt7530";
  20. + };
  21. };
  22. &cir {
  23. @@ -111,11 +119,24 @@
  24. };
  25. };
  26. + gmac1: mac@1 {
  27. + compatible = "mediatek,eth-mac";
  28. + reg = <1>;
  29. + phy-mode = "rgmii";
  30. +
  31. + fixed-link {
  32. + speed = <1000>;
  33. + full-duplex;
  34. + pause;
  35. + };
  36. + };
  37. +
  38. mdio: mdio-bus {
  39. #address-cells = <1>;
  40. #size-cells = <0>;
  41. -
  42. - switch@0 {
  43. + };
  44. +};
  45. + &mt7530 {
  46. compatible = "mediatek,mt7530";
  47. #address-cells = <1>;
  48. #size-cells = <0>;
  49. @@ -125,6 +146,8 @@
  50. core-supply = <&mt6323_vpa_reg>;
  51. io-supply = <&mt6323_vemc3v3_reg>;
  52. + dsa,mii-bus = <&mdio>;
  53. +
  54. ports {
  55. #address-cells = <1>;
  56. #size-cells = <0>;
  57. @@ -133,29 +156,46 @@
  58. port@0 {
  59. reg = <0>;
  60. label = "wan";
  61. + cpu = <&cpu_port1>;
  62. };
  63. port@1 {
  64. reg = <1>;
  65. label = "lan0";
  66. + cpu = <&cpu_port0>;
  67. };
  68. port@2 {
  69. reg = <2>;
  70. label = "lan1";
  71. + cpu = <&cpu_port0>;
  72. };
  73. port@3 {
  74. reg = <3>;
  75. label = "lan2";
  76. + cpu = <&cpu_port0>;
  77. };
  78. port@4 {
  79. reg = <4>;
  80. label = "lan3";
  81. + cpu = <&cpu_port0>;
  82. };
  83. - port@6 {
  84. + cpu_port1: port@5 {
  85. + reg = <5>;
  86. + label = "cpu";
  87. + ethernet = <&gmac1>;
  88. + phy-mode = "rgmii";
  89. +
  90. + fixed-link {
  91. + speed = <1000>;
  92. + full-duplex;
  93. + };
  94. + };
  95. +
  96. + cpu_port0: port@6 {
  97. reg = <6>;
  98. label = "cpu";
  99. ethernet = <&gmac0>;
  100. @@ -168,8 +208,6 @@
  101. };
  102. };
  103. };
  104. - };
  105. -};
  106. &i2c0 {
  107. pinctrl-names = "default";
  108. --- a/arch/arm/boot/dts/Makefile
  109. +++ b/arch/arm/boot/dts/Makefile
  110. @@ -1061,6 +1061,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
  111. mt6580-evbp1.dtb \
  112. mt6589-aquaris5.dtb \
  113. mt6592-evb.dtb \
  114. + mt7623a-rfb-emmc.dtb \
  115. mt7623n-rfb-nand.dtb \
  116. mt7623n-bananapi-bpi-r2.dtb \
  117. mt8127-moose.dtb \
  118. --- /dev/null
  119. +++ b/arch/arm/boot/dts/mt7623a-rfb-emmc.dts
  120. @@ -0,0 +1,449 @@
  121. +/*
  122. + * Copyright 2017 Sean Wang <[email protected]>
  123. + *
  124. + * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  125. + */
  126. +
  127. +/dts-v1/;
  128. +#include <dt-bindings/input/input.h>
  129. +#include "mt7623.dtsi"
  130. +#include "mt6323.dtsi"
  131. +
  132. +/ {
  133. + model = "MediaTek MT7623N NAND reference board";
  134. + compatible = "mediatek,mt7623a-rfb-emmc", "mediatek,mt7623";
  135. +
  136. + aliases {
  137. + serial2 = &uart2;
  138. + };
  139. +
  140. + chosen {
  141. + bootargs = "earlyprintk block2mtd.block2mtd=/dev/mmcblk0,65536,eMMC,5 mtdparts=eMMC:256k(mbr)ro,512k(uboot)ro,256k(config)ro,256k(factory)ro,32M(kernel),32M(recovery),1024M(rootfs),2048M(usrdata),-(bmtpool) rootfstype=squashfs,jffs2";
  142. +
  143. + stdout-path = "serial2:115200n8";
  144. + };
  145. +
  146. + memory {
  147. + reg = <0 0x80000000 0 0x20000000>;
  148. + };
  149. +
  150. + cpus {
  151. + cpu@0 {
  152. + proc-supply = <&mt6323_vproc_reg>;
  153. + };
  154. +
  155. + cpu@1 {
  156. + proc-supply = <&mt6323_vproc_reg>;
  157. + };
  158. +
  159. + cpu@2 {
  160. + proc-supply = <&mt6323_vproc_reg>;
  161. + };
  162. +
  163. + cpu@3 {
  164. + proc-supply = <&mt6323_vproc_reg>;
  165. + };
  166. + };
  167. +
  168. + memory@80000000 {
  169. + reg = <0 0x80000000 0 0x40000000>;
  170. + };
  171. +
  172. + mt7530: switch@0 {
  173. + compatible = "mediatek,mt7530";
  174. + #address-cells = <1>;
  175. + #size-cells = <0>;
  176. + };
  177. +};
  178. +
  179. +&crypto {
  180. + status = "okay";
  181. +};
  182. +
  183. +&eth {
  184. + status = "okay";
  185. +
  186. + gmac0: mac@0 {
  187. + compatible = "mediatek,eth-mac";
  188. + reg = <0>;
  189. + phy-mode = "trgmii";
  190. +
  191. + fixed-link {
  192. + speed = <1000>;
  193. + full-duplex;
  194. + pause;
  195. + };
  196. + };
  197. +
  198. + gmac1: mac@1 {
  199. + compatible = "mediatek,eth-mac";
  200. + reg = <1>;
  201. + phy-mode = "rgmiii-rxid";
  202. + phy-handle = <&phy5>;
  203. + };
  204. +
  205. + mdio: mdio-bus {
  206. + #address-cells = <1>;
  207. + #size-cells = <0>;
  208. + phy5: ethernet-phy@5 {
  209. + reg = <5>;
  210. + phy-mode = "rgmii-rxid";
  211. + };
  212. + };
  213. +};
  214. +
  215. +&mt7530 {
  216. + compatible = "mediatek,mt7530";
  217. + #address-cells = <1>;
  218. + #size-cells = <0>;
  219. + reg = <0>;
  220. + pinctrl-names = "default";
  221. + mediatek,mcm;
  222. + resets = <&ethsys 2>;
  223. + reset-names = "mcm";
  224. + core-supply = <&mt6323_vpa_reg>;
  225. + io-supply = <&mt6323_vemc3v3_reg>;
  226. +
  227. + dsa,mii-bus = <&mdio>;
  228. +
  229. + ports {
  230. + #address-cells = <1>;
  231. + #size-cells = <0>;
  232. + reg = <0>;
  233. +
  234. + port@0 {
  235. + reg = <0>;
  236. + label = "lan0";
  237. + cpu = <&cpu_port0>;
  238. + };
  239. +
  240. + port@1 {
  241. + reg = <1>;
  242. + label = "lan1";
  243. + cpu = <&cpu_port0>;
  244. + };
  245. +
  246. + port@2 {
  247. + reg = <2>;
  248. + label = "lan2";
  249. + cpu = <&cpu_port0>;
  250. + };
  251. +
  252. + port@3 {
  253. + reg = <3>;
  254. + label = "lan3";
  255. + cpu = <&cpu_port0>;
  256. + };
  257. +
  258. + cpu_port0: port@6 {
  259. + reg = <6>;
  260. + label = "cpu";
  261. + ethernet = <&gmac0>;
  262. + phy-mode = "trgmii";
  263. +
  264. + fixed-link {
  265. + speed = <1000>;
  266. + full-duplex;
  267. + };
  268. + };
  269. + };
  270. +};
  271. +
  272. +&i2c0 {
  273. + pinctrl-names = "default";
  274. + pinctrl-0 = <&i2c0_pins_a>;
  275. + status = "okay";
  276. +};
  277. +
  278. +&i2c1 {
  279. + pinctrl-names = "default";
  280. + pinctrl-0 = <&i2c1_pins_a>;
  281. + status = "okay";
  282. +};
  283. +
  284. +&mmc0 {
  285. + pinctrl-names = "default", "state_uhs";
  286. + pinctrl-0 = <&mmc0_pins_default>;
  287. + pinctrl-1 = <&mmc0_pins_uhs>;
  288. + status = "okay";
  289. + bus-width = <8>;
  290. + max-frequency = <50000000>;
  291. + cap-mmc-highspeed;
  292. + vmmc-supply = <&mt6323_vemc3v3_reg>;
  293. + vqmmc-supply = <&mt6323_vio18_reg>;
  294. + non-removable;
  295. +};
  296. +
  297. +&mmc1 {
  298. + pinctrl-names = "default", "state_uhs";
  299. + pinctrl-0 = <&mmc1_pins_default>;
  300. + pinctrl-1 = <&mmc1_pins_uhs>;
  301. + status = "okay";
  302. + bus-width = <4>;
  303. + max-frequency = <50000000>;
  304. + cap-sd-highspeed;
  305. + cd-gpios = <&pio 261 0>;
  306. + vmmc-supply = <&mt6323_vmch_reg>;
  307. + vqmmc-supply = <&mt6323_vio18_reg>;
  308. +};
  309. +
  310. +&pio {
  311. + cir_pins_a:cir@0 {
  312. + pins_cir {
  313. + pinmux = <MT7623_PIN_46_IR_FUNC_IR>;
  314. + bias-disable;
  315. + };
  316. + };
  317. +
  318. + i2c0_pins_a: i2c@0 {
  319. + pins_i2c0 {
  320. + pinmux = <MT7623_PIN_75_SDA0_FUNC_SDA0>,
  321. + <MT7623_PIN_76_SCL0_FUNC_SCL0>;
  322. + bias-disable;
  323. + };
  324. + };
  325. +
  326. + i2c1_pins_a: i2c@1 {
  327. + pin_i2c1 {
  328. + pinmux = <MT7623_PIN_57_SDA1_FUNC_SDA1>,
  329. + <MT7623_PIN_58_SCL1_FUNC_SCL1>;
  330. + bias-disable;
  331. + };
  332. + };
  333. +
  334. + i2s0_pins_a: i2s@0 {
  335. + pin_i2s0 {
  336. + pinmux = <MT7623_PIN_49_I2S0_DATA_FUNC_I2S0_DATA>,
  337. + <MT7623_PIN_72_I2S0_DATA_IN_FUNC_I2S0_DATA_IN>,
  338. + <MT7623_PIN_73_I2S0_LRCK_FUNC_I2S0_LRCK>,
  339. + <MT7623_PIN_74_I2S0_BCK_FUNC_I2S0_BCK>,
  340. + <MT7623_PIN_126_I2S0_MCLK_FUNC_I2S0_MCLK>;
  341. + drive-strength = <MTK_DRIVE_12mA>;
  342. + bias-pull-down;
  343. + };
  344. + };
  345. +
  346. + i2s1_pins_a: i2s@1 {
  347. + pin_i2s1 {
  348. + pinmux = <MT7623_PIN_33_I2S1_DATA_FUNC_I2S1_DATA>,
  349. + <MT7623_PIN_34_I2S1_DATA_IN_FUNC_I2S1_DATA_IN>,
  350. + <MT7623_PIN_35_I2S1_BCK_FUNC_I2S1_BCK>,
  351. + <MT7623_PIN_36_I2S1_LRCK_FUNC_I2S1_LRCK>,
  352. + <MT7623_PIN_37_I2S1_MCLK_FUNC_I2S1_MCLK>;
  353. + drive-strength = <MTK_DRIVE_12mA>;
  354. + bias-pull-down;
  355. + };
  356. + };
  357. +
  358. + mmc0_pins_default: mmc0default {
  359. + pins_cmd_dat {
  360. + pinmux = <MT7623_PIN_111_MSDC0_DAT7_FUNC_MSDC0_DAT7>,
  361. + <MT7623_PIN_112_MSDC0_DAT6_FUNC_MSDC0_DAT6>,
  362. + <MT7623_PIN_113_MSDC0_DAT5_FUNC_MSDC0_DAT5>,
  363. + <MT7623_PIN_114_MSDC0_DAT4_FUNC_MSDC0_DAT4>,
  364. + <MT7623_PIN_118_MSDC0_DAT3_FUNC_MSDC0_DAT3>,
  365. + <MT7623_PIN_119_MSDC0_DAT2_FUNC_MSDC0_DAT2>,
  366. + <MT7623_PIN_120_MSDC0_DAT1_FUNC_MSDC0_DAT1>,
  367. + <MT7623_PIN_121_MSDC0_DAT0_FUNC_MSDC0_DAT0>,
  368. + <MT7623_PIN_116_MSDC0_CMD_FUNC_MSDC0_CMD>;
  369. + input-enable;
  370. + bias-pull-up;
  371. + };
  372. +
  373. + pins_clk {
  374. + pinmux = <MT7623_PIN_117_MSDC0_CLK_FUNC_MSDC0_CLK>;
  375. + bias-pull-down;
  376. + };
  377. +
  378. + pins_rst {
  379. + pinmux = <MT7623_PIN_115_MSDC0_RSTB_FUNC_MSDC0_RSTB>;
  380. + bias-pull-up;
  381. + };
  382. + };
  383. +
  384. + mmc0_pins_uhs: mmc0 {
  385. + pins_cmd_dat {
  386. + pinmux = <MT7623_PIN_111_MSDC0_DAT7_FUNC_MSDC0_DAT7>,
  387. + <MT7623_PIN_112_MSDC0_DAT6_FUNC_MSDC0_DAT6>,
  388. + <MT7623_PIN_113_MSDC0_DAT5_FUNC_MSDC0_DAT5>,
  389. + <MT7623_PIN_114_MSDC0_DAT4_FUNC_MSDC0_DAT4>,
  390. + <MT7623_PIN_118_MSDC0_DAT3_FUNC_MSDC0_DAT3>,
  391. + <MT7623_PIN_119_MSDC0_DAT2_FUNC_MSDC0_DAT2>,
  392. + <MT7623_PIN_120_MSDC0_DAT1_FUNC_MSDC0_DAT1>,
  393. + <MT7623_PIN_121_MSDC0_DAT0_FUNC_MSDC0_DAT0>,
  394. + <MT7623_PIN_116_MSDC0_CMD_FUNC_MSDC0_CMD>;
  395. + input-enable;
  396. + drive-strength = <MTK_DRIVE_2mA>;
  397. + bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
  398. + };
  399. +
  400. + pins_clk {
  401. + pinmux = <MT7623_PIN_117_MSDC0_CLK_FUNC_MSDC0_CLK>;
  402. + drive-strength = <MTK_DRIVE_2mA>;
  403. + bias-pull-down = <MTK_PUPD_SET_R1R0_01>;
  404. + };
  405. +
  406. + pins_rst {
  407. + pinmux = <MT7623_PIN_115_MSDC0_RSTB_FUNC_MSDC0_RSTB>;
  408. + bias-pull-up;
  409. + };
  410. + };
  411. +
  412. + mmc1_pins_default: mmc1default {
  413. + pins_cmd_dat {
  414. + pinmux = <MT7623_PIN_107_MSDC1_DAT0_FUNC_MSDC1_DAT0>,
  415. + <MT7623_PIN_108_MSDC1_DAT1_FUNC_MSDC1_DAT1>,
  416. + <MT7623_PIN_109_MSDC1_DAT2_FUNC_MSDC1_DAT2>,
  417. + <MT7623_PIN_110_MSDC1_DAT3_FUNC_MSDC1_DAT3>,
  418. + <MT7623_PIN_105_MSDC1_CMD_FUNC_MSDC1_CMD>;
  419. + input-enable;
  420. + drive-strength = <MTK_DRIVE_4mA>;
  421. + bias-pull-up = <MTK_PUPD_SET_R1R0_10>;
  422. + };
  423. +
  424. + pins_clk {
  425. + pinmux = <MT7623_PIN_106_MSDC1_CLK_FUNC_MSDC1_CLK>;
  426. + bias-pull-down;
  427. + drive-strength = <MTK_DRIVE_4mA>;
  428. + };
  429. +
  430. + pins_wp {
  431. + pinmux = <MT7623_PIN_29_EINT7_FUNC_MSDC1_WP>;
  432. + input-enable;
  433. + bias-pull-up;
  434. + };
  435. +
  436. + pins_insert {
  437. + pinmux = <MT7623_PIN_261_MSDC1_INS_FUNC_GPIO261>;
  438. + bias-pull-up;
  439. + };
  440. + };
  441. +
  442. + mmc1_pins_uhs: mmc1 {
  443. + pins_cmd_dat {
  444. + pinmux = <MT7623_PIN_107_MSDC1_DAT0_FUNC_MSDC1_DAT0>,
  445. + <MT7623_PIN_108_MSDC1_DAT1_FUNC_MSDC1_DAT1>,
  446. + <MT7623_PIN_109_MSDC1_DAT2_FUNC_MSDC1_DAT2>,
  447. + <MT7623_PIN_110_MSDC1_DAT3_FUNC_MSDC1_DAT3>,
  448. + <MT7623_PIN_105_MSDC1_CMD_FUNC_MSDC1_CMD>;
  449. + input-enable;
  450. + drive-strength = <MTK_DRIVE_4mA>;
  451. + bias-pull-up = <MTK_PUPD_SET_R1R0_10>;
  452. + };
  453. +
  454. + pins_clk {
  455. + pinmux = <MT7623_PIN_106_MSDC1_CLK_FUNC_MSDC1_CLK>;
  456. + drive-strength = <MTK_DRIVE_4mA>;
  457. + bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
  458. + };
  459. + };
  460. +
  461. + pwm_pins_a: pwm@0 {
  462. + pins_pwm {
  463. + pinmux = <MT7623_PIN_203_PWM0_FUNC_PWM0>,
  464. + <MT7623_PIN_204_PWM1_FUNC_PWM1>,
  465. + <MT7623_PIN_205_PWM2_FUNC_PWM2>,
  466. + <MT7623_PIN_206_PWM3_FUNC_PWM3>,
  467. + <MT7623_PIN_207_PWM4_FUNC_PWM4>;
  468. + };
  469. + };
  470. +
  471. + spi0_pins_a: spi@0 {
  472. + pins_spi {
  473. + pinmux = <MT7623_PIN_53_SPI0_CSN_FUNC_SPI0_CS>,
  474. + <MT7623_PIN_54_SPI0_CK_FUNC_SPI0_CK>,
  475. + <MT7623_PIN_55_SPI0_MI_FUNC_SPI0_MI>,
  476. + <MT7623_PIN_56_SPI0_MO_FUNC_SPI0_MO>;
  477. + bias-disable;
  478. + };
  479. + };
  480. +
  481. + uart0_pins_a: uart@0 {
  482. + pins_dat {
  483. + pinmux = <MT7623_PIN_79_URXD0_FUNC_URXD0>,
  484. + <MT7623_PIN_80_UTXD0_FUNC_UTXD0>;
  485. + };
  486. + };
  487. +
  488. + uart1_pins_a: uart@1 {
  489. + pins_dat {
  490. + pinmux = <MT7623_PIN_81_URXD1_FUNC_URXD1>,
  491. + <MT7623_PIN_82_UTXD1_FUNC_UTXD1>;
  492. + };
  493. + };
  494. +};
  495. +
  496. +&pwm {
  497. + pinctrl-names = "default";
  498. + pinctrl-0 = <&pwm_pins_a>;
  499. + status = "okay";
  500. +};
  501. +
  502. +&pwrap {
  503. + mt6323 {
  504. + mt6323led: led {
  505. + compatible = "mediatek,mt6323-led";
  506. + #address-cells = <1>;
  507. + #size-cells = <0>;
  508. +
  509. + led@0 {
  510. + reg = <0>;
  511. + label = "bpi-r2:isink:green";
  512. + default-state = "off";
  513. + };
  514. +
  515. + led@1 {
  516. + reg = <1>;
  517. + label = "bpi-r2:isink:red";
  518. + default-state = "off";
  519. + };
  520. +
  521. + led@2 {
  522. + reg = <2>;
  523. + label = "bpi-r2:isink:blue";
  524. + default-state = "off";
  525. + };
  526. + };
  527. + };
  528. +};
  529. +
  530. +&spi0 {
  531. + pinctrl-names = "default";
  532. + pinctrl-0 = <&spi0_pins_a>;
  533. + status = "okay";
  534. +};
  535. +
  536. +&uart0 {
  537. + pinctrl-names = "default";
  538. + pinctrl-0 = <&uart0_pins_a>;
  539. + status = "disabled";
  540. +};
  541. +
  542. +&uart1 {
  543. + pinctrl-names = "default";
  544. + pinctrl-0 = <&uart1_pins_a>;
  545. + status = "disabled";
  546. +};
  547. +
  548. +&uart2 {
  549. + status = "okay";
  550. +};
  551. +
  552. +&usb1 {
  553. + vusb33-supply = <&mt6323_vusb_reg>;
  554. + status = "okay";
  555. +};
  556. +
  557. +&usb2 {
  558. + vusb33-supply = <&mt6323_vusb_reg>;
  559. + status = "okay";
  560. +};
  561. +
  562. +&u3phy1 {
  563. + status = "okay";
  564. +};
  565. +
  566. +&u3phy2 {
  567. + status = "okay";
  568. +};
  569. +
  570. --- a/arch/arm/boot/dts/mt7623.dtsi
  571. +++ b/arch/arm/boot/dts/mt7623.dtsi
  572. @@ -322,6 +322,7 @@
  573. "syscon";
  574. reg = <0 0x10209000 0 0x1000>;
  575. #clock-cells = <1>;
  576. + #reset-cells = <1>;
  577. };
  578. rng: rng@1020f000 {