0023-ARM-dts-mediatek-add-MT7623-basic-support.patch 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026
  1. From a4df3e7e4e906a4e9dac1f8c43f6192f22ef6242 Mon Sep 17 00:00:00 2001
  2. From: John Crispin <[email protected]>
  3. Date: Tue, 5 Jan 2016 12:16:17 +0100
  4. Subject: [PATCH 23/81] ARM: dts: mediatek: add MT7623 basic support
  5. This adds basic chip support for Mediatek MT7623.
  6. Signed-off-by: John Crispin <[email protected]>
  7. ---
  8. arch/arm/boot/dts/Makefile | 1 +
  9. arch/arm/boot/dts/mt7623-evb.dts | 459 +++++++++++++++++++++++++++++++++
  10. arch/arm/boot/dts/mt7623.dtsi | 510 +++++++++++++++++++++++++++++++++++++
  11. arch/arm/mach-mediatek/Kconfig | 4 +
  12. arch/arm/mach-mediatek/mediatek.c | 1 +
  13. 5 files changed, 975 insertions(+)
  14. create mode 100644 arch/arm/boot/dts/mt7623-evb.dts
  15. create mode 100644 arch/arm/boot/dts/mt7623.dtsi
  16. --- a/arch/arm/boot/dts/Makefile
  17. +++ b/arch/arm/boot/dts/Makefile
  18. @@ -774,6 +774,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
  19. mt6580-evbp1.dtb \
  20. mt6589-aquaris5.dtb \
  21. mt6592-evb.dtb \
  22. + mt7623-evb.dtb \
  23. mt8127-moose.dtb \
  24. mt8135-evbp1.dtb
  25. dtb-$(CONFIG_ARCH_ZX) += zx296702-ad1.dtb
  26. --- /dev/null
  27. +++ b/arch/arm/boot/dts/mt7623-evb.dts
  28. @@ -0,0 +1,459 @@
  29. +/*
  30. + * Copyright (c) 2016 MediaTek Inc.
  31. + * Author: John Crispin <[email protected]>
  32. + *
  33. + * This program is free software; you can redistribute it and/or modify
  34. + * it under the terms of the GNU General Public License version 2 as
  35. + * published by the Free Software Foundation.
  36. + *
  37. + * This program is distributed in the hope that it will be useful,
  38. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  39. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  40. + * GNU General Public License for more details.
  41. + */
  42. +
  43. +/dts-v1/;
  44. +
  45. +#include "mt7623.dtsi"
  46. +#include <dt-bindings/gpio/gpio.h>
  47. +
  48. +/ {
  49. + model = "MediaTek MT7623 evaluation board";
  50. + compatible = "mediatek,mt7623-evb", "mediatek,mt7623";
  51. +
  52. + chosen {
  53. + stdout-path = &uart2;
  54. + };
  55. +
  56. + memory {
  57. + reg = <0 0x80000000 0 0x20000000>;
  58. + };
  59. +
  60. + usb_p1_vbus: regulator@0 {
  61. + compatible = "regulator-fixed";
  62. + regulator-name = "usb_vbus";
  63. + regulator-min-microvolt = <5000000>;
  64. + regulator-max-microvolt = <5000000>;
  65. + gpio = <&pio 135 GPIO_ACTIVE_HIGH>;
  66. + enable-active-high;
  67. + };
  68. +};
  69. +
  70. +&pwrap {
  71. + pmic: mt6323 {
  72. + compatible = "mediatek,mt6323";
  73. + interrupt-parent = <&pio>;
  74. + interrupts = <150 IRQ_TYPE_LEVEL_HIGH>;
  75. + interrupt-controller;
  76. + #interrupt-cells = <2>;
  77. +
  78. + mt6323regulator: mt6323regulator{
  79. + compatible = "mediatek,mt6323-regulator";
  80. +
  81. + mt6323_vproc_reg: buck_vproc{
  82. + regulator-name = "vproc";
  83. + regulator-min-microvolt = < 700000>;
  84. + regulator-max-microvolt = <1350000>;
  85. + regulator-ramp-delay = <12500>;
  86. + regulator-always-on;
  87. + regulator-boot-on;
  88. + };
  89. +
  90. + mt6323_vsys_reg: buck_vsys{
  91. + regulator-name = "vsys";
  92. + regulator-min-microvolt = <1400000>;
  93. + regulator-max-microvolt = <2987500>;
  94. + regulator-ramp-delay = <25000>;
  95. + regulator-always-on;
  96. + regulator-boot-on;
  97. + };
  98. +
  99. + mt6323_vpa_reg: buck_vpa{
  100. + regulator-name = "vpa";
  101. + regulator-min-microvolt = < 500000>;
  102. + regulator-max-microvolt = <3650000>;
  103. + };
  104. +
  105. + mt6323_vtcxo_reg: ldo_vtcxo{
  106. + regulator-name = "vtcxo";
  107. + regulator-min-microvolt = <2800000>;
  108. + regulator-max-microvolt = <2800000>;
  109. + regulator-enable-ramp-delay = <90>;
  110. + regulator-always-on;
  111. + regulator-boot-on;
  112. + };
  113. +
  114. + mt6323_vcn28_reg: ldo_vcn28{
  115. + regulator-name = "vcn28";
  116. + regulator-min-microvolt = <2800000>;
  117. + regulator-max-microvolt = <2800000>;
  118. + regulator-enable-ramp-delay = <185>;
  119. + };
  120. +
  121. + mt6323_vcn33_bt_reg: ldo_vcn33_bt{
  122. + regulator-name = "vcn33_bt";
  123. + regulator-min-microvolt = <3300000>;
  124. + regulator-max-microvolt = <3600000>;
  125. + regulator-enable-ramp-delay = <185>;
  126. + };
  127. +
  128. + mt6323_vcn33_wifi_reg: ldo_vcn33_wifi{
  129. + regulator-name = "vcn33_wifi";
  130. + regulator-min-microvolt = <3300000>;
  131. + regulator-max-microvolt = <3600000>;
  132. + regulator-enable-ramp-delay = <185>;
  133. + };
  134. +
  135. + mt6323_va_reg: ldo_va{
  136. + regulator-name = "va";
  137. + regulator-min-microvolt = <2800000>;
  138. + regulator-max-microvolt = <2800000>;
  139. + regulator-enable-ramp-delay = <216>;
  140. + regulator-always-on;
  141. + regulator-boot-on;
  142. + };
  143. +
  144. + mt6323_vcama_reg: ldo_vcama{
  145. + regulator-name = "vcama";
  146. + regulator-min-microvolt = <1500000>;
  147. + regulator-max-microvolt = <2800000>;
  148. + regulator-enable-ramp-delay = <216>;
  149. + };
  150. +
  151. + mt6323_vio28_reg: ldo_vio28{
  152. + regulator-name = "vio28";
  153. + regulator-min-microvolt = <2800000>;
  154. + regulator-max-microvolt = <2800000>;
  155. + regulator-enable-ramp-delay = <216>;
  156. + regulator-always-on;
  157. + regulator-boot-on;
  158. + };
  159. +
  160. + mt6323_vusb_reg: ldo_vusb{
  161. + regulator-name = "vusb";
  162. + regulator-min-microvolt = <3300000>;
  163. + regulator-max-microvolt = <3300000>;
  164. + regulator-enable-ramp-delay = <216>;
  165. + regulator-boot-on;
  166. + };
  167. +
  168. + mt6323_vmc_reg: ldo_vmc{
  169. + regulator-name = "vmc";
  170. + regulator-min-microvolt = <1800000>;
  171. + regulator-max-microvolt = <3300000>;
  172. + regulator-enable-ramp-delay = <36>;
  173. + regulator-boot-on;
  174. + };
  175. +
  176. + mt6323_vmch_reg: ldo_vmch{
  177. + regulator-name = "vmch";
  178. + regulator-min-microvolt = <3000000>;
  179. + regulator-max-microvolt = <3300000>;
  180. + regulator-enable-ramp-delay = <36>;
  181. + regulator-boot-on;
  182. + };
  183. +
  184. + mt6323_vemc3v3_reg: ldo_vemc3v3{
  185. + regulator-name = "vemc3v3";
  186. + regulator-min-microvolt = <3000000>;
  187. + regulator-max-microvolt = <3300000>;
  188. + regulator-enable-ramp-delay = <36>;
  189. + regulator-boot-on;
  190. + };
  191. +
  192. + mt6323_vgp1_reg: ldo_vgp1{
  193. + regulator-name = "vgp1";
  194. + regulator-min-microvolt = <1200000>;
  195. + regulator-max-microvolt = <3300000>;
  196. + regulator-enable-ramp-delay = <216>;
  197. + };
  198. +
  199. + mt6323_vgp2_reg: ldo_vgp2{
  200. + regulator-name = "vgp2";
  201. + regulator-min-microvolt = <1200000>;
  202. + regulator-max-microvolt = <3000000>;
  203. + regulator-enable-ramp-delay = <216>;
  204. + };
  205. +
  206. + mt6323_vgp3_reg: ldo_vgp3{
  207. + regulator-name = "vgp3";
  208. + regulator-min-microvolt = <1200000>;
  209. + regulator-max-microvolt = <1800000>;
  210. + regulator-enable-ramp-delay = <216>;
  211. + };
  212. +
  213. + mt6323_vcn18_reg: ldo_vcn18{
  214. + regulator-name = "vcn18";
  215. + regulator-min-microvolt = <1800000>;
  216. + regulator-max-microvolt = <1800000>;
  217. + regulator-enable-ramp-delay = <216>;
  218. + };
  219. +
  220. + mt6323_vsim1_reg: ldo_vsim1{
  221. + regulator-name = "vsim1";
  222. + regulator-min-microvolt = <1800000>;
  223. + regulator-max-microvolt = <3000000>;
  224. + regulator-enable-ramp-delay = <216>;
  225. + };
  226. +
  227. + mt6323_vsim2_reg: ldo_vsim2{
  228. + regulator-name = "vsim2";
  229. + regulator-min-microvolt = <1800000>;
  230. + regulator-max-microvolt = <3000000>;
  231. + regulator-enable-ramp-delay = <216>;
  232. + };
  233. +
  234. + mt6323_vrtc_reg: ldo_vrtc{
  235. + regulator-name = "vrtc";
  236. + regulator-min-microvolt = <2800000>;
  237. + regulator-max-microvolt = <2800000>;
  238. + regulator-always-on;
  239. + regulator-boot-on;
  240. + };
  241. +
  242. + mt6323_vcamaf_reg: ldo_vcamaf{
  243. + regulator-name = "vcamaf";
  244. + regulator-min-microvolt = <1200000>;
  245. + regulator-max-microvolt = <3300000>;
  246. + regulator-enable-ramp-delay = <216>;
  247. + };
  248. +
  249. + mt6323_vibr_reg: ldo_vibr{
  250. + regulator-name = "vibr";
  251. + regulator-min-microvolt = <1200000>;
  252. + regulator-max-microvolt = <3300000>;
  253. + regulator-enable-ramp-delay = <36>;
  254. + };
  255. +
  256. + mt6323_vrf18_reg: ldo_vrf18{
  257. + regulator-name = "vrf18";
  258. + regulator-min-microvolt = <1825000>;
  259. + regulator-max-microvolt = <1825000>;
  260. + regulator-enable-ramp-delay = <187>;
  261. + };
  262. +
  263. + mt6323_vm_reg: ldo_vm{
  264. + regulator-name = "vm";
  265. + regulator-min-microvolt = <1200000>;
  266. + regulator-max-microvolt = <1800000>;
  267. + regulator-enable-ramp-delay = <216>;
  268. + regulator-always-on;
  269. + regulator-boot-on;
  270. + };
  271. +
  272. + mt6323_vio18_reg: ldo_vio18{
  273. + regulator-name = "vio18";
  274. + regulator-min-microvolt = <1800000>;
  275. + regulator-max-microvolt = <1800000>;
  276. + regulator-enable-ramp-delay = <216>;
  277. + regulator-always-on;
  278. + regulator-boot-on;
  279. + };
  280. +
  281. + mt6323_vcamd_reg: ldo_vcamd{
  282. + regulator-name = "vcamd";
  283. + regulator-min-microvolt = <1200000>;
  284. + regulator-max-microvolt = <1800000>;
  285. + regulator-enable-ramp-delay = <216>;
  286. + };
  287. +
  288. + mt6323_vcamio_reg: ldo_vcamio{
  289. + regulator-name = "vcamio";
  290. + regulator-min-microvolt = <1800000>;
  291. + regulator-max-microvolt = <1800000>;
  292. + regulator-enable-ramp-delay = <216>;
  293. + };
  294. + };
  295. + };
  296. +};
  297. +
  298. +&uart2 {
  299. + status = "okay";
  300. +};
  301. +
  302. +&mmc0 {
  303. + status = "okay";
  304. + pinctrl-names = "default", "state_uhs";
  305. + pinctrl-0 = <&mmc0_pins_default>;
  306. + pinctrl-1 = <&mmc0_pins_uhs>;
  307. + bus-width = <8>;
  308. + max-frequency = <50000000>;
  309. + cap-mmc-highspeed;
  310. + vmmc-supply = <&mt6323_vemc3v3_reg>;
  311. + vqmmc-supply = <&mt6323_vio18_reg>;
  312. + non-removable;
  313. +};
  314. +
  315. +&mmc1 {
  316. + status = "okay";
  317. + pinctrl-names = "default", "state_uhs";
  318. + pinctrl-0 = <&mmc1_pins_default>;
  319. + pinctrl-1 = <&mmc1_pins_uhs>;
  320. + bus-width = <4>;
  321. + max-frequency = <50000000>;
  322. + cap-sd-highspeed;
  323. + sd-uhs-sdr25;
  324. +// cd-gpios = <&pio 132 0>;
  325. + vmmc-supply = <&mt6323_vmch_reg>;
  326. + vqmmc-supply = <&mt6323_vmc_reg>;
  327. +};
  328. +
  329. +&pio {
  330. + mmc0_pins_default: mmc0default {
  331. + pins_cmd_dat {
  332. + pinmux = <MT7623_PIN_111_MSDC0_DAT7_FUNC_MSDC0_DAT7>,
  333. + <MT7623_PIN_112_MSDC0_DAT6_FUNC_MSDC0_DAT6>,
  334. + <MT7623_PIN_113_MSDC0_DAT5_FUNC_MSDC0_DAT5>,
  335. + <MT7623_PIN_114_MSDC0_DAT4_FUNC_MSDC0_DAT4>,
  336. + <MT7623_PIN_118_MSDC0_DAT3_FUNC_MSDC0_DAT3>,
  337. + <MT7623_PIN_119_MSDC0_DAT2_FUNC_MSDC0_DAT2>,
  338. + <MT7623_PIN_120_MSDC0_DAT1_FUNC_MSDC0_DAT1>,
  339. + <MT7623_PIN_121_MSDC0_DAT0_FUNC_MSDC0_DAT0>,
  340. + <MT7623_PIN_116_MSDC0_CMD_FUNC_MSDC0_CMD>;
  341. + input-enable;
  342. + bias-pull-up;
  343. + };
  344. +
  345. + pins_clk {
  346. + pinmux = <MT7623_PIN_117_MSDC0_CLK_FUNC_MSDC0_CLK>;
  347. + bias-pull-down;
  348. + };
  349. +
  350. + pins_rst {
  351. + pinmux = <MT7623_PIN_115_MSDC0_RSTB_FUNC_MSDC0_RSTB>;
  352. + bias-pull-up;
  353. + };
  354. + };
  355. +
  356. + mmc0_pins_uhs: mmc0 {
  357. + pins_cmd_dat {
  358. + pinmux = <MT7623_PIN_111_MSDC0_DAT7_FUNC_MSDC0_DAT7>,
  359. + <MT7623_PIN_112_MSDC0_DAT6_FUNC_MSDC0_DAT6>,
  360. + <MT7623_PIN_113_MSDC0_DAT5_FUNC_MSDC0_DAT5>,
  361. + <MT7623_PIN_114_MSDC0_DAT4_FUNC_MSDC0_DAT4>,
  362. + <MT7623_PIN_118_MSDC0_DAT3_FUNC_MSDC0_DAT3>,
  363. + <MT7623_PIN_119_MSDC0_DAT2_FUNC_MSDC0_DAT2>,
  364. + <MT7623_PIN_120_MSDC0_DAT1_FUNC_MSDC0_DAT1>,
  365. + <MT7623_PIN_121_MSDC0_DAT0_FUNC_MSDC0_DAT0>,
  366. + <MT7623_PIN_116_MSDC0_CMD_FUNC_MSDC0_CMD>;
  367. + input-enable;
  368. + drive-strength = <MTK_DRIVE_2mA>;
  369. + bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
  370. + };
  371. +
  372. + pins_clk {
  373. + pinmux = <MT7623_PIN_117_MSDC0_CLK_FUNC_MSDC0_CLK>;
  374. + drive-strength = <MTK_DRIVE_2mA>;
  375. + bias-pull-down = <MTK_PUPD_SET_R1R0_01>;
  376. + };
  377. +
  378. + pins_rst {
  379. + pinmux = <MT7623_PIN_115_MSDC0_RSTB_FUNC_MSDC0_RSTB>;
  380. + bias-pull-up;
  381. + };
  382. + };
  383. +
  384. + mmc1_pins_default: mmc1default {
  385. + pins_cmd_dat {
  386. + pinmux = <MT7623_PIN_107_MSDC1_DAT0_FUNC_MSDC1_DAT0>,
  387. + <MT7623_PIN_108_MSDC1_DAT1_FUNC_MSDC1_DAT1>,
  388. + <MT7623_PIN_109_MSDC1_DAT2_FUNC_MSDC1_DAT2>,
  389. + <MT7623_PIN_110_MSDC1_DAT3_FUNC_MSDC1_DAT3>,
  390. + <MT7623_PIN_105_MSDC1_CMD_FUNC_MSDC1_CMD>;
  391. + input-enable;
  392. + drive-strength = <MTK_DRIVE_4mA>;
  393. + bias-pull-up = <MTK_PUPD_SET_R1R0_10>;
  394. + };
  395. +
  396. + pins_clk {
  397. + pinmux = <MT7623_PIN_106_MSDC1_CLK_FUNC_MSDC1_CLK>;
  398. + bias-pull-down;
  399. + drive-strength = <MTK_DRIVE_4mA>;
  400. + };
  401. +
  402. +// pins_insert {
  403. +// pinmux = <MT8173_PIN_132_I2S0_DATA1_FUNC_GPIO132>;
  404. +// bias-pull-up;
  405. +// };
  406. + };
  407. +
  408. + mmc1_pins_uhs: mmc1 {
  409. + pins_cmd_dat {
  410. + pinmux = <MT7623_PIN_107_MSDC1_DAT0_FUNC_MSDC1_DAT0>,
  411. + <MT7623_PIN_108_MSDC1_DAT1_FUNC_MSDC1_DAT1>,
  412. + <MT7623_PIN_109_MSDC1_DAT2_FUNC_MSDC1_DAT2>,
  413. + <MT7623_PIN_110_MSDC1_DAT3_FUNC_MSDC1_DAT3>,
  414. + <MT7623_PIN_105_MSDC1_CMD_FUNC_MSDC1_CMD>;
  415. + input-enable;
  416. + drive-strength = <MTK_DRIVE_4mA>;
  417. + bias-pull-up = <MTK_PUPD_SET_R1R0_10>;
  418. + };
  419. +
  420. + pins_clk {
  421. + pinmux = <MT7623_PIN_106_MSDC1_CLK_FUNC_MSDC1_CLK>;
  422. + drive-strength = <MTK_DRIVE_4mA>;
  423. + bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
  424. + };
  425. + };
  426. +
  427. + eth_default: eth {
  428. + pins_eth {
  429. + pinmux = <MT7623_PIN_275_G2_MDC_FUNC_MDC>,
  430. + <MT7623_PIN_276_G2_MDIO_FUNC_MDIO>,
  431. + <MT7623_PIN_262_G2_TXEN_FUNC_G2_TXEN>,
  432. + <MT7623_PIN_263_G2_TXD3_FUNC_G2_TXD3>,
  433. + <MT7623_PIN_264_G2_TXD2_FUNC_G2_TXD2>,
  434. + <MT7623_PIN_265_G2_TXD1_FUNC_G2_TXD1>,
  435. + <MT7623_PIN_266_G2_TXD0_FUNC_G2_TXD0>,
  436. + <MT7623_PIN_267_G2_TXCLK_FUNC_G2_TXC>,
  437. + <MT7623_PIN_268_G2_RXCLK_FUNC_G2_RXC>,
  438. + <MT7623_PIN_269_G2_RXD0_FUNC_G2_RXD0>,
  439. + <MT7623_PIN_270_G2_RXD1_FUNC_G2_RXD1>,
  440. + <MT7623_PIN_271_G2_RXD2_FUNC_G2_RXD2>,
  441. + <MT7623_PIN_272_G2_RXD3_FUNC_G2_RXD3>,
  442. + <MT7623_PIN_273_ESW_INT_FUNC_ESW_INT>,
  443. + <MT7623_PIN_274_G2_RXDV_FUNC_G2_RXDV>;
  444. + };
  445. +
  446. + pins_eth_rst {
  447. + pinmux = <MT7623_PIN_15_GPIO15_FUNC_GPIO15>;
  448. + output-low;
  449. + };
  450. + };
  451. +};
  452. +
  453. +&usb1 {
  454. + vusb33-supply = <&mt6323_vusb_reg>;
  455. + vbus-supply = <&usb_p1_vbus>;
  456. +// mediatek,wakeup-src = <1>;
  457. + status = "okay";
  458. +};
  459. +
  460. +&u3phy1 {
  461. + status = "okay";
  462. +};
  463. +
  464. +&pcie {
  465. + status = "okay";
  466. +};
  467. +
  468. +&eth {
  469. + status = "okay";
  470. +};
  471. +
  472. +&gmac1 {
  473. + mac-address = [00 11 22 33 44 56];
  474. + status = "okay";
  475. +};
  476. +
  477. +&gmac2 {
  478. + mac-address = [00 11 22 33 44 55];
  479. + status = "okay";
  480. +};
  481. +
  482. +&gsw {
  483. + pinctrl-names = "default";
  484. + pinctrl-0 = <&eth_default>;
  485. + mediatek,reset-pin = <&pio 15 0>;
  486. + status = "okay";
  487. +};
  488. --- /dev/null
  489. +++ b/arch/arm/boot/dts/mt7623.dtsi
  490. @@ -0,0 +1,510 @@
  491. +/*
  492. + * Copyright (c) 2016 MediaTek Inc.
  493. + * Author: John Crispin <[email protected]>
  494. + *
  495. + * This program is free software; you can redistribute it and/or modify
  496. + * it under the terms of the GNU General Public License version 2 as
  497. + * published by the Free Software Foundation.
  498. + *
  499. + * This program is distributed in the hope that it will be useful,
  500. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  501. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  502. + * GNU General Public License for more details.
  503. + */
  504. +
  505. +#include <dt-bindings/interrupt-controller/irq.h>
  506. +#include <dt-bindings/interrupt-controller/arm-gic.h>
  507. +#include <dt-bindings/clock/mt2701-clk.h>
  508. +#include <dt-bindings/power/mt2701-power.h>
  509. +#include <dt-bindings/phy/phy.h>
  510. +#include <dt-bindings/reset-controller/mt2701-resets.h>
  511. +#include <dt-bindings/pinctrl/mt7623-pinfunc.h>
  512. +#include "skeleton64.dtsi"
  513. +
  514. +
  515. +/ {
  516. + compatible = "mediatek,mt7623";
  517. + interrupt-parent = <&sysirq>;
  518. +
  519. + cpus {
  520. + #address-cells = <1>;
  521. + #size-cells = <0>;
  522. + enable-method = "mediatek,mt6589-smp";
  523. +
  524. + cpu@0 {
  525. + device_type = "cpu";
  526. + compatible = "arm,cortex-a7";
  527. + reg = <0x0>;
  528. + };
  529. + cpu@1 {
  530. + device_type = "cpu";
  531. + compatible = "arm,cortex-a7";
  532. + reg = <0x1>;
  533. + };
  534. + cpu@2 {
  535. + device_type = "cpu";
  536. + compatible = "arm,cortex-a7";
  537. + reg = <0x2>;
  538. + };
  539. + cpu@3 {
  540. + device_type = "cpu";
  541. + compatible = "arm,cortex-a7";
  542. + reg = <0x3>;
  543. + };
  544. + };
  545. +
  546. + system_clk: dummy13m {
  547. + compatible = "fixed-clock";
  548. + clock-frequency = <13000000>;
  549. + #clock-cells = <0>;
  550. + };
  551. +
  552. + rtc_clk: dummy32k {
  553. + compatible = "fixed-clock";
  554. + clock-frequency = <32000>;
  555. + #clock-cells = <0>;
  556. + clock-output-names = "clk32k";
  557. + };
  558. +
  559. + clk26m: dummy26m {
  560. + compatible = "fixed-clock";
  561. + clock-frequency = <26000000>;
  562. + #clock-cells = <0>;
  563. + clock-output-names = "clk26m";
  564. + };
  565. +
  566. + timer {
  567. + compatible = "arm,armv7-timer";
  568. + interrupt-parent = <&gic>;
  569. + interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>,
  570. + <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>,
  571. + <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>,
  572. + <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
  573. + };
  574. +
  575. + topckgen: power-controller@10000000 {
  576. + compatible = "mediatek,mt7623-topckgen",
  577. + "mediatek,mt2701-topckgen",
  578. + "syscon";
  579. + reg = <0 0x10000000 0 0x1000>;
  580. + #clock-cells = <1>;
  581. + };
  582. +
  583. + infracfg: power-controller@10001000 {
  584. + compatible = "mediatek,mt7623-infracfg",
  585. + "mediatek,mt2701-infracfg",
  586. + "syscon";
  587. + reg = <0 0x10001000 0 0x1000>;
  588. + #clock-cells = <1>;
  589. + #reset-cells = <1>;
  590. + };
  591. +
  592. + pericfg: pericfg@10003000 {
  593. + compatible = "mediatek,mt7623-pericfg",
  594. + "mediatek,mt2701-pericfg",
  595. + "syscon";
  596. + reg = <0 0x10003000 0 0x1000>;
  597. + #clock-cells = <1>;
  598. + #reset-cells = <1>;
  599. + };
  600. +
  601. + pio: pinctrl@10005000 {
  602. + compatible = "mediatek,mt7623-pinctrl";
  603. + reg = <0 0x1000b000 0 0x1000>;
  604. + mediatek,pctl-regmap = <&syscfg_pctl_a>;
  605. + pins-are-numbered;
  606. + gpio-controller;
  607. + #gpio-cells = <2>;
  608. + interrupt-controller;
  609. + interrupt-parent = <&gic>;
  610. + #interrupt-cells = <2>;
  611. + interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>,
  612. + <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>;
  613. + };
  614. +
  615. + syscfg_pctl_a: syscfg@10005000 {
  616. + compatible = "mediatek,mt7623-pctl-a-syscfg", "syscon";
  617. + reg = <0 0x10005000 0 0x1000>;
  618. + };
  619. +
  620. + scpsys: scpsys@10006000 {
  621. + #power-domain-cells = <1>;
  622. + compatible = "mediatek,mt7623-scpsys",
  623. + "mediatek,mt2701-scpsys";
  624. + reg = <0 0x10006000 0 0x1000>;
  625. + infracfg = <&infracfg>;
  626. + clocks = <&clk26m>,
  627. + <&topckgen CLK_TOP_MM_SEL>;
  628. + clock-names = "mfg", "mm";
  629. + };
  630. +
  631. + watchdog: watchdog@10007000 {
  632. + compatible = "mediatek,mt7623-wdt",
  633. + "mediatek,mt6589-wdt";
  634. + reg = <0 0x10007000 0 0x100>;
  635. + };
  636. +
  637. + timer: timer@10008000 {
  638. + compatible = "mediatek,mt7623-timer",
  639. + "mediatek,mt6577-timer";
  640. + reg = <0 0x10008000 0 0x80>;
  641. + interrupts = <GIC_SPI 112 IRQ_TYPE_LEVEL_LOW>;
  642. + clocks = <&system_clk>, <&rtc_clk>;
  643. + clock-names = "system-clk", "rtc-clk";
  644. + };
  645. +
  646. + pwrap: pwrap@1000d000 {
  647. + compatible = "mediatek,mt7623-pwrap",
  648. + "mediatek,mt2701-pwrap";
  649. + reg = <0 0x1000d000 0 0x1000>;
  650. + reg-names = "pwrap";
  651. + interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>;
  652. + resets = <&infracfg MT2701_INFRA_PMIC_WRAP_RST>;
  653. + reset-names = "pwrap";
  654. + clocks = <&infracfg CLK_INFRA_PMICSPI>,
  655. + <&infracfg CLK_INFRA_PMICWRAP>;
  656. + clock-names = "spi", "wrap";
  657. + };
  658. +
  659. + sysirq: interrupt-controller@10200100 {
  660. + compatible = "mediatek,mt7623-sysirq",
  661. + "mediatek,mt6577-sysirq";
  662. + interrupt-controller;
  663. + #interrupt-cells = <3>;
  664. + interrupt-parent = <&gic>;
  665. + reg = <0 0x10200100 0 0x1c>;
  666. + };
  667. +
  668. + apmixedsys: apmixedsys@10209000 {
  669. + compatible = "mediatek,mt7623-apmixedsys",
  670. + "mediatek,mt2701-apmixedsys";
  671. + reg = <0 0x10209000 0 0x1000>;
  672. + #clock-cells = <1>;
  673. + };
  674. +
  675. + gic: interrupt-controller@10211000 {
  676. + compatible = "arm,cortex-a7-gic";
  677. + interrupt-controller;
  678. + #interrupt-cells = <3>;
  679. + interrupt-parent = <&gic>;
  680. + reg = <0 0x10211000 0 0x1000>,
  681. + <0 0x10212000 0 0x1000>,
  682. + <0 0x10214000 0 0x2000>,
  683. + <0 0x10216000 0 0x2000>;
  684. + };
  685. +
  686. + i2c0: i2c@11007000 {
  687. + compatible = "mediatek,mt7623-i2c",
  688. + "mediatek,mt6577-i2c";
  689. + reg = <0 0x11007000 0 0x70>,
  690. + <0 0x11000200 0 0x80>;
  691. + interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_LOW>;
  692. + clock-div = <16>;
  693. + clocks = <&pericfg CLK_PERI_I2C0>,
  694. + <&pericfg CLK_PERI_AP_DMA>;
  695. + clock-names = "main", "dma";
  696. + #address-cells = <1>;
  697. + #size-cells = <0>;
  698. + status = "disabled";
  699. + };
  700. +
  701. + i2c1: i2c@11008000 {
  702. + compatible = "mediatek,mt7623-i2c",
  703. + "mediatek,mt6577-i2c";
  704. + reg = <0 0x11008000 0 0x70>,
  705. + <0 0x11000280 0 0x80>;
  706. + interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_LOW>;
  707. + clock-div = <16>;
  708. + clocks = <&pericfg CLK_PERI_I2C1>,
  709. + <&pericfg CLK_PERI_AP_DMA>;
  710. + clock-names = "main", "dma";
  711. + #address-cells = <1>;
  712. + #size-cells = <0>;
  713. + status = "disabled";
  714. + };
  715. +
  716. + i2c2: i2c@11009000 {
  717. + compatible = "mediatek,mt7623-i2c",
  718. + "mediatek,mt6577-i2c";
  719. + reg = <0 0x11009000 0 0x70>,
  720. + <0 0x11000300 0 0x80>;
  721. + interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_LOW>;
  722. + clock-div = <16>;
  723. + clocks = <&pericfg CLK_PERI_I2C2>,
  724. + <&pericfg CLK_PERI_AP_DMA>;
  725. + clock-names = "main", "dma";
  726. + #address-cells = <1>;
  727. + #size-cells = <0>;
  728. + status = "disabled";
  729. + };
  730. +
  731. + uart0: serial@11002000 {
  732. + compatible = "mediatek,mt7623-uart",
  733. + "mediatek,mt6577-uart";
  734. + reg = <0 0x11002000 0 0x400>;
  735. + interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_LOW>;
  736. + clocks = <&pericfg CLK_PERI_UART0_SEL>,
  737. + <&pericfg CLK_PERI_UART0>;
  738. + clock-names = "baud", "bus";
  739. + status = "disabled";
  740. + };
  741. +
  742. + uart1: serial@11003000 {
  743. + compatible = "mediatek,mt7623-uart",
  744. + "mediatek,mt6577-uart";
  745. + reg = <0 0x11003000 0 0x400>;
  746. + interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_LOW>;
  747. + clocks = <&pericfg CLK_PERI_UART1_SEL>,
  748. + <&pericfg CLK_PERI_UART1>;
  749. + clock-names = "baud", "bus";
  750. + status = "disabled";
  751. + };
  752. +
  753. + uart2: serial@11004000 {
  754. + compatible = "mediatek,mt7623-uart",
  755. + "mediatek,mt6577-uart";
  756. + reg = <0 0x11004000 0 0x400>;
  757. + interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_LOW>;
  758. + clocks = <&pericfg CLK_PERI_UART2_SEL>,
  759. + <&pericfg CLK_PERI_UART2>;
  760. + clock-names = "baud", "bus";
  761. + status = "disabled";
  762. + };
  763. +
  764. + uart3: serial@11005000 {
  765. + compatible = "mediatek,mt7623-uart",
  766. + "mediatek,mt6577-uart";
  767. + reg = <0 0x11005000 0 0x400>;
  768. + interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_LOW>;
  769. + clocks = <&pericfg CLK_PERI_UART3_SEL>,
  770. + <&pericfg CLK_PERI_UART3>;
  771. + clock-names = "baud", "bus";
  772. + status = "disabled";
  773. + };
  774. +
  775. + spi: spi@1100a000 {
  776. + compatible = "mediatek,mt7623-spi", "mediatek,mt6589-spi";
  777. + reg = <0 0x1100a000 0 0x1000>;
  778. + interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_LOW>;
  779. + clocks = <&pericfg CLK_PERI_SPI0>;
  780. + clock-names = "main";
  781. +
  782. + status = "disabled";
  783. + };
  784. +
  785. + mmc0: mmc@11230000 {
  786. + compatible = "mediatek,mt7623-mmc",
  787. + "mediatek,mt8135-mmc";
  788. + reg = <0 0x11230000 0 0x1000>;
  789. + interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_LOW>;
  790. + clocks = <&pericfg CLK_PERI_MSDC30_0>,
  791. + <&topckgen CLK_TOP_MSDC30_0_SEL>;
  792. + clock-names = "source", "hclk";
  793. + status = "disabled";
  794. + };
  795. +
  796. + mmc1: mmc@11240000 {
  797. + compatible = "mediatek,mt7623-mmc",
  798. + "mediatek,mt8135-mmc";
  799. + reg = <0 0x11240000 0 0x1000>;
  800. + interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_LOW>;
  801. + clocks = <&pericfg CLK_PERI_MSDC30_1>,
  802. + <&topckgen CLK_TOP_MSDC30_1_SEL>;
  803. + clock-names = "source", "hclk";
  804. + status = "disabled";
  805. + };
  806. +
  807. + usb1: usb@1a1c0000 {
  808. + compatible = "mediatek,mt2701-xhci",
  809. + "mediatek,mt8173-xhci";
  810. + reg = <0 0x1a1c0000 0 0x1000>,
  811. + <0 0x1a1c4700 0 0x0100>;
  812. + interrupts = <GIC_SPI 196 IRQ_TYPE_LEVEL_LOW>;
  813. + clocks = <&hifsys CLK_HIFSYS_USB0PHY>,
  814. + <&topckgen CLK_TOP_ETHIF_SEL>;
  815. + clock-names = "sys_ck", "ethif";
  816. + power-domains = <&scpsys MT2701_POWER_DOMAIN_HIF>;
  817. + phys = <&phy_port0 PHY_TYPE_USB3>;
  818. + status = "disabled";
  819. + };
  820. +
  821. + u3phy1: usb-phy@1a1c4000 {
  822. + compatible = "mediatek,mt2701-u3phy",
  823. + "mediatek,mt8173-u3phy";
  824. + reg = <0 0x1a1c4000 0 0x0700>;
  825. + clocks = <&clk26m>;
  826. + clock-names = "u3phya_ref";
  827. + #phy-cells = <1>;
  828. + #address-cells = <2>;
  829. + #size-cells = <2>;
  830. + ranges;
  831. + status = "disabled";
  832. +
  833. + phy_port0: phy_port0: port@1a1c4800 {
  834. + reg = <0 0x1a1c4800 0 0x800>;
  835. + #phy-cells = <1>;
  836. + status = "okay";
  837. + };
  838. + };
  839. +
  840. + usb2: usb@1a240000 {
  841. + compatible = "mediatek,mt2701-xhci",
  842. + "mediatek,mt8173-xhci";
  843. + reg = <0 0x1a240000 0 0x1000>,
  844. + <0 0x1a244700 0 0x0100>;
  845. + interrupts = <GIC_SPI 197 IRQ_TYPE_LEVEL_LOW>;
  846. + clocks = <&hifsys CLK_HIFSYS_USB1PHY>,
  847. + <&topckgen CLK_TOP_ETHIF_SEL>;
  848. + clock-names = "sys_ck", "ethif";
  849. + power-domains = <&scpsys MT2701_POWER_DOMAIN_HIF>;
  850. + phys = <&u3phy2 0>;
  851. + status = "disabled";
  852. + };
  853. +
  854. + u3phy2: usb-phy@1a244000 {
  855. + compatible = "mediatek,mt2701-u3phy",
  856. + "mediatek,mt8173-u3phy";
  857. + reg = <0 0x1a244000 0 0x0700>,
  858. + <0 0x1a244800 0 0x0800>;
  859. + clocks = <&clk26m>;
  860. + clock-names = "u3phya_ref";
  861. + #phy-cells = <1>;
  862. + status = "disabled";
  863. + };
  864. +
  865. + hifsys: clock-controller@1a000000 {
  866. + compatible = "mediatek,mt7623-hifsys",
  867. + "mediatek,mt2701-hifsys",
  868. + "syscon";
  869. + reg = <0 0x1a000000 0 0x1000>;
  870. + #clock-cells = <1>;
  871. + #reset-cells = <1>;
  872. + };
  873. +
  874. + pcie: pcie@1a140000 {
  875. + compatible = "mediatek,mt7623-pcie";
  876. + device_type = "pci";
  877. + reg = <0 0x1a140000 0 0x8000>, /* PCI-Express registers */
  878. + <0 0x1a149000 0 0x1000>, /* PCI-Express PHY0 */
  879. + <0 0x1a14a000 0 0x1000>, /* PCI-Express PHY1 */
  880. + <0 0x1a244000 0 0x1000>; /* PCI-Express PHY2 */
  881. + reg-names = "pcie", "pcie phy0", "pcie phy1", "pcie phy2";
  882. + interrupts = <GIC_SPI 193 IRQ_TYPE_LEVEL_LOW>,
  883. + <GIC_SPI 194 IRQ_TYPE_LEVEL_LOW>,
  884. + <GIC_SPI 195 IRQ_TYPE_LEVEL_LOW>;
  885. + interrupt-names = "pcie0", "pcie1", "pcie2";
  886. + clocks = <&topckgen CLK_TOP_ETHIF_SEL>;
  887. + clock-names = "pcie";
  888. + power-domains = <&scpsys MT2701_POWER_DOMAIN_HIF>;
  889. + resets = <&hifsys MT2701_HIFSYS_PCIE0_RST>,
  890. + <&hifsys MT2701_HIFSYS_PCIE1_RST>,
  891. + <&hifsys MT2701_HIFSYS_PCIE2_RST>;
  892. + reset-names = "pcie0", "pcie1", "pcie2";
  893. +
  894. + mediatek,hifsys = <&hifsys>;
  895. +
  896. + bus-range = <0x00 0xff>;
  897. + #address-cells = <3>;
  898. + #size-cells = <2>;
  899. +
  900. + ranges = <0x81000000 0 0x1a160000 0 0x1a160000 0 0x00010000 /* io space */
  901. + 0x83000000 0 0x60000000 0 0x60000000 0 0x10000000>; /* pci memory */
  902. +
  903. + status = "disabled";
  904. +
  905. + pcie@1,0 {
  906. + device_type = "pci";
  907. + reg = <0x0800 0 0 0 0>;
  908. +
  909. + #address-cells = <3>;
  910. + #size-cells = <2>;
  911. + ranges;
  912. + };
  913. +
  914. + pcie@2,0{
  915. + device_type = "pci";
  916. + reg = <0x1000 0 0 0 0>;
  917. +
  918. + #address-cells = <3>;
  919. + #size-cells = <2>;
  920. + ranges;
  921. + };
  922. +
  923. + pcie@3,0{
  924. + device_type = "pci";
  925. + reg = <0x1800 0 0 0 0>;
  926. +
  927. + #address-cells = <3>;
  928. + #size-cells = <2>;
  929. + ranges;
  930. + };
  931. + };
  932. +
  933. + ethsys: syscon@1b000000 {
  934. + #address-cells = <1>;
  935. + #size-cells = <1>;
  936. + compatible = "mediatek,mt2701-ethsys", "syscon";
  937. + reg = <0 0x1b000000 0 0x1000>;
  938. + #clock-cells = <1>;
  939. + };
  940. +
  941. + eth: ethernet@1b100000 {
  942. + compatible = "mediatek,mt7623-eth";
  943. + reg = <0 0x1b100000 0 0x10000>;
  944. +
  945. + clocks = <&topckgen CLK_TOP_ETHIF_SEL>;
  946. + clock-names = "ethif";
  947. + interrupts = <GIC_SPI 200 IRQ_TYPE_LEVEL_LOW
  948. + GIC_SPI 199 IRQ_TYPE_LEVEL_LOW
  949. + GIC_SPI 198 IRQ_TYPE_LEVEL_LOW>;
  950. + power-domains = <&scpsys MT2701_POWER_DOMAIN_ETH>;
  951. +
  952. + mediatek,ethsys = <&ethsys>;
  953. + mediatek,switch = <&gsw>;
  954. +
  955. + #address-cells = <1>;
  956. + #size-cells = <0>;
  957. +
  958. + status = "disabled";
  959. +
  960. + gmac1: mac@0 {
  961. + compatible = "mediatek,eth-mac";
  962. + reg = <0>;
  963. +
  964. + status = "disabled";
  965. + };
  966. +
  967. + gmac2: mac@1 {
  968. + compatible = "mediatek,eth-mac";
  969. + reg = <1>;
  970. +
  971. + status = "disabled";
  972. + };
  973. +
  974. + mdio-bus {
  975. + #address-cells = <1>;
  976. + #size-cells = <0>;
  977. +
  978. + phy1f: ethernet-phy@1f {
  979. + reg = <0x1f>;
  980. + phy-mode = "rgmii";
  981. + };
  982. + };
  983. + };
  984. +
  985. + gsw: switch@1b100000 {
  986. + compatible = "mediatek,mt7623-gsw";
  987. + reg = <0 0x1b110000 0 0x300000>;
  988. + interrupt-parent = <&pio>;
  989. + interrupts = <168 IRQ_TYPE_EDGE_RISING>;
  990. + clocks = <&apmixedsys CLK_APMIXED_TRGPLL>,
  991. + <&ethsys CLK_ETHSYS_ESW>,
  992. + <&ethsys CLK_ETHSYS_GP2>,
  993. + <&ethsys CLK_ETHSYS_GP1>;
  994. + clock-names = "trgpll", "esw", "gp2", "gp1";
  995. + mt7530-supply = <&mt6323_vpa_reg>;
  996. + mediatek,pctl-regmap = <&syscfg_pctl_a>;
  997. + mediatek,ethsys = <&ethsys>;
  998. + status = "disabled";
  999. + };
  1000. +};
  1001. --- a/arch/arm/mach-mediatek/Kconfig
  1002. +++ b/arch/arm/mach-mediatek/Kconfig
  1003. @@ -21,6 +21,10 @@ config MACH_MT6592
  1004. bool "MediaTek MT6592 SoCs support"
  1005. default ARCH_MEDIATEK
  1006. +config MACH_MT7623
  1007. + bool "MediaTek MT7623 SoCs support"
  1008. + default ARCH_MEDIATEK
  1009. +
  1010. config MACH_MT8127
  1011. bool "MediaTek MT8127 SoCs support"
  1012. default ARCH_MEDIATEK
  1013. --- a/arch/arm/mach-mediatek/mediatek.c
  1014. +++ b/arch/arm/mach-mediatek/mediatek.c
  1015. @@ -46,6 +46,7 @@ static void __init mediatek_timer_init(v
  1016. static const char * const mediatek_board_dt_compat[] = {
  1017. "mediatek,mt6589",
  1018. "mediatek,mt6592",
  1019. + "mediatek,mt7623",
  1020. "mediatek,mt8127",
  1021. "mediatek,mt8135",
  1022. NULL,