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

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