forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/drivers/staging/mt7621-dts/mt7621.dtsi
....@@ -1,4 +1,5 @@
11 #include <dt-bindings/interrupt-controller/mips-gic.h>
2
+#include <dt-bindings/gpio/gpio.h>
23
34 / {
45 #address-cells = <1>;
....@@ -40,6 +41,30 @@
4041
4142 /* This is normally 1/4 of cpuclock */
4243 clock-frequency = <220000000>;
44
+ };
45
+
46
+ mmc_clock: mmc_clock@0 {
47
+ #clock-cells = <0>;
48
+ compatible = "fixed-clock";
49
+ clock-frequency = <48000000>;
50
+ };
51
+
52
+ mmc_fixed_3v3: fixedregulator@0 {
53
+ compatible = "regulator-fixed";
54
+ regulator-name = "mmc_power";
55
+ regulator-min-microvolt = <3300000>;
56
+ regulator-max-microvolt = <3300000>;
57
+ enable-active-high;
58
+ regulator-always-on;
59
+ };
60
+
61
+ mmc_fixed_1v8_io: fixedregulator@1 {
62
+ compatible = "regulator-fixed";
63
+ regulator-name = "mmc_io";
64
+ regulator-min-microvolt = <1800000>;
65
+ regulator-max-microvolt = <1800000>;
66
+ enable-active-high;
67
+ regulator-always-on;
4368 };
4469
4570 palmbus: palmbus@1E000000 {
....@@ -113,7 +138,7 @@
113138
114139 memc: memc@5000 {
115140 compatible = "mtk,mt7621-memc";
116
- reg = <0x300 0x100>;
141
+ reg = <0x5000 0x1000>;
117142 };
118143
119144 cpc: cpc@1fbf0000 {
....@@ -202,84 +227,84 @@
202227 state_default: pinctrl0 {
203228 };
204229
205
- i2c_pins: i2c {
206
- i2c {
207
- group = "i2c";
230
+ i2c_pins: i2c0 {
231
+ i2c0 {
232
+ groups = "i2c";
208233 function = "i2c";
209234 };
210235 };
211236
212
- spi_pins: spi {
213
- spi {
214
- group = "spi";
237
+ spi_pins: spi0 {
238
+ spi0 {
239
+ groups = "spi";
215240 function = "spi";
216241 };
217242 };
218243
219244 uart1_pins: uart1 {
220245 uart1 {
221
- group = "uart1";
246
+ groups = "uart1";
222247 function = "uart1";
223248 };
224249 };
225250
226251 uart2_pins: uart2 {
227252 uart2 {
228
- group = "uart2";
253
+ groups = "uart2";
229254 function = "uart2";
230255 };
231256 };
232257
233258 uart3_pins: uart3 {
234259 uart3 {
235
- group = "uart3";
260
+ groups = "uart3";
236261 function = "uart3";
237262 };
238263 };
239264
240265 rgmii1_pins: rgmii1 {
241266 rgmii1 {
242
- group = "rgmii1";
267
+ groups = "rgmii1";
243268 function = "rgmii1";
244269 };
245270 };
246271
247272 rgmii2_pins: rgmii2 {
248273 rgmii2 {
249
- group = "rgmii2";
274
+ groups = "rgmii2";
250275 function = "rgmii2";
251276 };
252277 };
253278
254
- mdio_pins: mdio {
255
- mdio {
256
- group = "mdio";
279
+ mdio_pins: mdio0 {
280
+ mdio0 {
281
+ groups = "mdio";
257282 function = "mdio";
258283 };
259284 };
260285
261
- pcie_pins: pcie {
262
- pcie {
263
- group = "pcie";
264
- function = "pcie rst";
286
+ pcie_pins: pcie0 {
287
+ pcie0 {
288
+ groups = "pcie";
289
+ function = "gpio";
265290 };
266291 };
267292
268
- nand_pins: nand {
293
+ nand_pins: nand0 {
269294 spi-nand {
270
- group = "spi";
295
+ groups = "spi";
271296 function = "nand1";
272297 };
273298
274299 sdhci-nand {
275
- group = "sdhci";
300
+ groups = "sdhci";
276301 function = "nand2";
277302 };
278303 };
279304
280
- sdhci_pins: sdhci {
281
- sdhci {
282
- group = "sdhci";
305
+ sdhci_pins: sdhci0 {
306
+ sdhci0 {
307
+ groups = "sdhci";
283308 function = "sdhci";
284309 };
285310 };
....@@ -298,8 +323,23 @@
298323 sdhci: sdhci@1E130000 {
299324 status = "disabled";
300325
301
- compatible = "ralink,mt7620-sdhci";
326
+ compatible = "mediatek,mt7620-mmc";
302327 reg = <0x1E130000 0x4000>;
328
+
329
+ bus-width = <4>;
330
+ max-frequency = <48000000>;
331
+ cap-sd-highspeed;
332
+ cap-mmc-highspeed;
333
+ vmmc-supply = <&mmc_fixed_3v3>;
334
+ vqmmc-supply = <&mmc_fixed_1v8_io>;
335
+ disable-wp;
336
+
337
+ pinctrl-names = "default", "state_uhs";
338
+ pinctrl-0 = <&sdhci_pins>;
339
+ pinctrl-1 = <&sdhci_pins>;
340
+
341
+ clocks = <&mmc_clock &mmc_clock>;
342
+ clock-names = "source", "hclk";
303343
304344 interrupt-parent = <&gic>;
305345 interrupts = <GIC_SHARED 20 IRQ_TYPE_LEVEL_HIGH>;
....@@ -372,15 +412,88 @@
372412
373413 mediatek,ethsys = <&ethsys>;
374414
375
- mediatek,switch = <&gsw>;
415
+ pinctrl-names = "default";
416
+ pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>, <&rgmii2_pins>;
417
+
418
+ gmac0: mac@0 {
419
+ compatible = "mediatek,eth-mac";
420
+ reg = <0>;
421
+ phy-mode = "rgmii";
422
+
423
+ fixed-link {
424
+ speed = <1000>;
425
+ full-duplex;
426
+ pause;
427
+ };
428
+ };
429
+
430
+ gmac1: mac@1 {
431
+ compatible = "mediatek,eth-mac";
432
+ reg = <1>;
433
+ status = "off";
434
+ phy-mode = "rgmii-rxid";
435
+ };
376436
377437 mdio-bus {
378438 #address-cells = <1>;
379439 #size-cells = <0>;
380440
381
- phy1f: ethernet-phy@1f {
382
- reg = <0x1f>;
383
- phy-mode = "rgmii";
441
+ switch0: switch0@0 {
442
+ compatible = "mediatek,mt7621";
443
+ #address-cells = <1>;
444
+ #size-cells = <0>;
445
+ reg = <0>;
446
+ mediatek,mcm;
447
+ resets = <&rstctrl 2>;
448
+ reset-names = "mcm";
449
+
450
+ ports {
451
+ #address-cells = <1>;
452
+ #size-cells = <0>;
453
+ reg = <0>;
454
+
455
+ port@0 {
456
+ status = "off";
457
+ reg = <0>;
458
+ label = "lan0";
459
+ };
460
+
461
+ port@1 {
462
+ status = "off";
463
+ reg = <1>;
464
+ label = "lan1";
465
+ };
466
+
467
+ port@2 {
468
+ status = "off";
469
+ reg = <2>;
470
+ label = "lan2";
471
+ };
472
+
473
+ port@3 {
474
+ status = "off";
475
+ reg = <3>;
476
+ label = "lan3";
477
+ };
478
+
479
+ port@4 {
480
+ status = "off";
481
+ reg = <4>;
482
+ label = "lan4";
483
+ };
484
+
485
+ port@6 {
486
+ reg = <6>;
487
+ label = "cpu";
488
+ ethernet = <&gmac0>;
489
+ phy-mode = "trgmii";
490
+
491
+ fixed-link {
492
+ speed = <1000>;
493
+ full-duplex;
494
+ };
495
+ };
496
+ };
384497 };
385498 };
386499 };
....@@ -398,7 +511,6 @@
398511 0x1e142000 0x100 /* pcie port 0 RC control registers */
399512 0x1e143000 0x100 /* pcie port 1 RC control registers */
400513 0x1e144000 0x100>; /* pcie port 2 RC control registers */
401
-
402514 #address-cells = <3>;
403515 #size-cells = <2>;
404516
....@@ -413,11 +525,10 @@
413525 0x01000000 0 0x00000000 0x1e160000 0 0x00010000 /* io space */
414526 >;
415527
416
- #interrupt-cells = <1>;
417
- interrupt-map-mask = <0xF0000 0 0 1>;
418
- interrupt-map = <0x10000 0 0 1 &gic GIC_SHARED 4 IRQ_TYPE_LEVEL_HIGH>,
419
- <0x20000 0 0 1 &gic GIC_SHARED 24 IRQ_TYPE_LEVEL_HIGH>,
420
- <0x30000 0 0 1 &gic GIC_SHARED 25 IRQ_TYPE_LEVEL_HIGH>;
528
+ interrupt-parent = <&gic>;
529
+ interrupts = <GIC_SHARED 4 IRQ_TYPE_LEVEL_HIGH
530
+ GIC_SHARED 24 IRQ_TYPE_LEVEL_HIGH
531
+ GIC_SHARED 25 IRQ_TYPE_LEVEL_HIGH>;
421532
422533 status = "disabled";
423534
....@@ -425,6 +536,10 @@
425536 reset-names = "pcie0", "pcie1", "pcie2";
426537 clocks = <&clkctrl 24 &clkctrl 25 &clkctrl 26>;
427538 clock-names = "pcie0", "pcie1", "pcie2";
539
+ phys = <&pcie0_phy 1>, <&pcie2_phy 0>;
540
+ phy-names = "pcie-phy0", "pcie-phy2";
541
+
542
+ reset-gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
428543
429544 pcie@0,0 {
430545 reg = <0x0000 0 0 0 0>;
....@@ -450,4 +565,16 @@
450565 bus-range = <0x00 0xff>;
451566 };
452567 };
568
+
569
+ pcie0_phy: pcie-phy@1e149000 {
570
+ compatible = "mediatek,mt7621-pci-phy";
571
+ reg = <0x1e149000 0x0700>;
572
+ #phy-cells = <1>;
573
+ };
574
+
575
+ pcie2_phy: pcie-phy@1e14a000 {
576
+ compatible = "mediatek,mt7621-pci-phy";
577
+ reg = <0x1e14a000 0x0700>;
578
+ #phy-cells = <1>;
579
+ };
453580 };