| b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-or-later OR MIT | 
 | 2 |  | 
 | 3 | #include "mt7621.dtsi" | 
 | 4 |  | 
 | 5 | #include <dt-bindings/gpio/gpio.h> | 
 | 6 | #include <dt-bindings/input/input.h> | 
 | 7 |  | 
 | 8 | / { | 
 | 9 | 	compatible = "totolink,x5000r", "mediatek,mt7621-soc"; | 
 | 10 | 	model = "TOTOLINK X5000R"; | 
 | 11 |  | 
 | 12 | 	aliases { | 
 | 13 | 		led-boot = &led_sys; | 
 | 14 | 		led-failsafe = &led_sys; | 
 | 15 | 		led-running = &led_sys; | 
 | 16 | 		led-upgrade = &led_sys; | 
 | 17 | 		label-mac-device = &gmac0; | 
 | 18 | 		serial0 = &uartlite; | 
 | 19 | 	}; | 
 | 20 |  | 
 | 21 | 	chosen { | 
 | 22 | 		stdout-path = "serial0:115200n8"; | 
 | 23 | 		bootargs = "console=ttyS0,115200n8"; | 
 | 24 | 	}; | 
 | 25 |  | 
 | 26 | 	leds { | 
 | 27 | 		compatible = "gpio-leds"; | 
 | 28 |  | 
 | 29 | 		led_sys: sys { | 
 | 30 | 			label = "blue:sys"; | 
 | 31 | 			gpios = <&gpio 18 GPIO_ACTIVE_LOW>; | 
 | 32 | 		}; | 
 | 33 | 	}; | 
 | 34 |  | 
 | 35 | 	keys { | 
 | 36 | 		compatible = "gpio-keys"; | 
 | 37 |  | 
 | 38 | 		reset { | 
 | 39 | 			label = "reset"; | 
 | 40 | 			gpios = <&gpio 4 GPIO_ACTIVE_LOW>; | 
 | 41 | 			debounce-interval = <60>; | 
 | 42 | 			linux,code = <KEY_RESTART>; | 
 | 43 | 		}; | 
 | 44 | 	}; | 
 | 45 | }; | 
 | 46 |  | 
 | 47 | &spi0 { | 
 | 48 | 	status = "okay"; | 
 | 49 |  | 
 | 50 | 	flash@0 { | 
 | 51 | 		compatible = "jedec,spi-nor"; | 
 | 52 | 		reg = <0>; | 
 | 53 | 		spi-max-frequency = <50000000>; | 
 | 54 | 		m25p,fast-read; | 
 | 55 |  | 
 | 56 | 		partitions { | 
 | 57 | 			compatible = "fixed-partitions"; | 
 | 58 | 			#address-cells = <1>; | 
 | 59 | 			#size-cells = <1>; | 
 | 60 |  | 
 | 61 | 			partition@0 { | 
 | 62 | 				label = "u-boot"; | 
 | 63 | 				reg = <0x0 0x30000>; | 
 | 64 | 				read-only; | 
 | 65 | 			}; | 
 | 66 |  | 
 | 67 | 			partition@30000 { | 
 | 68 | 				label = "u-boot-env"; | 
 | 69 | 				reg = <0x30000 0x10000>; | 
 | 70 | 				read-only; | 
 | 71 | 			}; | 
 | 72 |  | 
 | 73 | 			factory: partition@40000 { | 
 | 74 | 				label = "factory"; | 
 | 75 | 				reg = <0x40000 0x10000>; | 
 | 76 | 				read-only; | 
 | 77 | 			}; | 
 | 78 |  | 
 | 79 | 			partition@50000 { | 
 | 80 | 				compatible = "denx,uimage"; | 
 | 81 | 				label = "firmware"; | 
 | 82 | 				reg = <0x50000 0xfb0000>; | 
 | 83 | 			}; | 
 | 84 | 		}; | 
 | 85 | 	}; | 
 | 86 | }; | 
 | 87 |  | 
 | 88 | &pcie { | 
 | 89 | 	status = "okay"; | 
 | 90 | }; | 
 | 91 |  | 
 | 92 | &pcie1 { | 
 | 93 | 	wifi@0,0 { | 
 | 94 | 		compatible = "mediatek,mt76"; | 
 | 95 | 		reg = <0x0000 0 0 0 0>; | 
 | 96 | 		mediatek,mtd-eeprom = <&factory 0x0000>; | 
 | 97 | 	}; | 
 | 98 | }; | 
 | 99 |  | 
 | 100 | &gmac0 { | 
 | 101 | 	mtd-mac-address = <&factory 0xe000>; | 
 | 102 | }; | 
 | 103 |  | 
 | 104 | &switch0 { | 
 | 105 | 	ports { | 
 | 106 | 		port@0 { | 
 | 107 | 			status = "okay"; | 
 | 108 | 			label = "lan1"; | 
 | 109 | 		}; | 
 | 110 |  | 
 | 111 | 		port@1 { | 
 | 112 | 			status = "okay"; | 
 | 113 | 			label = "lan2"; | 
 | 114 | 		}; | 
 | 115 |  | 
 | 116 | 		port@2 { | 
 | 117 | 			status = "okay"; | 
 | 118 | 			label = "lan3"; | 
 | 119 | 		}; | 
 | 120 |  | 
 | 121 | 		port@3 { | 
 | 122 | 			status = "okay"; | 
 | 123 | 			label = "lan4"; | 
 | 124 | 		}; | 
 | 125 |  | 
 | 126 | 		port@4 { | 
 | 127 | 			status = "okay"; | 
 | 128 | 			label = "wan"; | 
 | 129 | 			mtd-mac-address = <&factory 0xe006>; | 
 | 130 | 		}; | 
 | 131 | 	}; | 
 | 132 | }; | 
 | 133 |  | 
 | 134 | &state_default { | 
 | 135 | 	gpio { | 
 | 136 | 		groups = "i2c", "wdt"; | 
 | 137 | 		function = "gpio"; | 
 | 138 | 	}; | 
 | 139 | }; |