Use the new kmod-phy-realtek driver for kernel 6.18 on Gemtek W1700K. The driver selection is gated using `KERNEL_PATCHVER` to avoid build failures on 6.12. The device tree selection is also gated by `KERNEL_PATCHVER` to select the appropriate device tree per kernel version. Once kernel 6.18 is tested stable for airoha these changes can be simplified and the obsolete properties removed. Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me> Link: https://github.com/openwrt/openwrt/pull/21019 Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
422 lines
7.2 KiB
Plaintext
422 lines
7.2 KiB
Plaintext
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
|
|
|
/dts-v1/;
|
|
|
|
#include <dt-bindings/leds/common.h>
|
|
#include <dt-bindings/gpio/gpio.h>
|
|
#include <dt-bindings/input/input.h>
|
|
#include <dt-bindings/phy/phy.h>
|
|
#include "an7581.dtsi"
|
|
#include "an7581-npu-mt7996.dtsi"
|
|
|
|
/ {
|
|
model = "Gemtek W1700K (OpenWrt U-Boot layout)";
|
|
compatible = "gemtek,w1700k-ubi", "airoha,an7581", "airoha,en7581";
|
|
|
|
aliases {
|
|
serial0 = &uart1;
|
|
led-boot = &led_status_red;
|
|
led-failsafe = &led_status_blue;
|
|
led-upgrade = &led_status_blue;
|
|
led-running = &led_status_green;
|
|
};
|
|
|
|
chosen {
|
|
rootdisk = <&ubi_rootfs>;
|
|
bootargs = "console=ttyS0,115200 earlycon ubi.block=0,fit root=/dev/fit0 rootwait";
|
|
stdout-path = "serial0:115200n8";
|
|
};
|
|
|
|
keys {
|
|
compatible = "gpio-keys";
|
|
|
|
key-restart {
|
|
label = "reset";
|
|
gpios = <&en7581_pinctrl 0 GPIO_ACTIVE_LOW>;
|
|
linux,code = <KEY_RESTART>;
|
|
};
|
|
};
|
|
|
|
leds {
|
|
compatible = "gpio-leds";
|
|
|
|
led_status_green: led-0 {
|
|
color = <LED_COLOR_ID_GREEN>;
|
|
function = LED_FUNCTION_STATUS;
|
|
gpios = <&en7581_pinctrl 17 GPIO_ACTIVE_LOW>;
|
|
};
|
|
|
|
led_status_blue: led-1 {
|
|
color = <LED_COLOR_ID_BLUE>;
|
|
function = LED_FUNCTION_STATUS;
|
|
gpios = <&en7581_pinctrl 19 GPIO_ACTIVE_LOW>;
|
|
};
|
|
|
|
led_status_red: led-2 {
|
|
color = <LED_COLOR_ID_RED>;
|
|
function = LED_FUNCTION_STATUS;
|
|
gpios = <&en7581_pinctrl 29 GPIO_ACTIVE_LOW>;
|
|
};
|
|
|
|
led_status_white: led-3 {
|
|
color = <LED_COLOR_ID_WHITE>;
|
|
function = LED_FUNCTION_STATUS;
|
|
gpios = <&en7581_pinctrl 20 GPIO_ACTIVE_LOW>;
|
|
};
|
|
|
|
led-4 {
|
|
color = <LED_COLOR_ID_GREEN>;
|
|
function = LED_FUNCTION_LAN;
|
|
function-enumerator = <3>;
|
|
gpios = <&en7581_pinctrl 9 GPIO_ACTIVE_LOW>;
|
|
};
|
|
|
|
led-5 {
|
|
color = <LED_COLOR_ID_YELLOW>;
|
|
function = LED_FUNCTION_LAN;
|
|
function-enumerator = <3>;
|
|
gpios = <&en7581_pinctrl 10 GPIO_ACTIVE_LOW>;
|
|
};
|
|
|
|
led-6 {
|
|
color = <LED_COLOR_ID_GREEN>;
|
|
function = LED_FUNCTION_LAN;
|
|
function-enumerator = <4>;
|
|
gpios = <&en7581_pinctrl 27 GPIO_ACTIVE_LOW>;
|
|
};
|
|
|
|
led-7 {
|
|
color = <LED_COLOR_ID_YELLOW>;
|
|
function = LED_FUNCTION_LAN;
|
|
function-enumerator = <4>;
|
|
gpios = <&en7581_pinctrl 28 GPIO_ACTIVE_LOW>;
|
|
};
|
|
};
|
|
};
|
|
|
|
&en7581_pinctrl {
|
|
gpio-ranges = <&en7581_pinctrl 0 13 47>;
|
|
|
|
mdio_pins: mdio-pins {
|
|
mux {
|
|
function = "mdio";
|
|
groups = "mdio";
|
|
};
|
|
|
|
conf {
|
|
pins = "gpio2";
|
|
output-high;
|
|
};
|
|
};
|
|
|
|
pcie0_rst_pins: pcie0-rst-pins {
|
|
conf {
|
|
pins = "pcie_reset0";
|
|
drive-open-drain = <1>;
|
|
};
|
|
};
|
|
|
|
pcie2_rst_pins: pcie2-rst-pins {
|
|
conf {
|
|
pins = "pcie_reset2";
|
|
drive-open-drain = <1>;
|
|
};
|
|
};
|
|
|
|
/* W1700K does not use the built-in LED controller. Instead, it uses GPIO.
|
|
* The driver fails to probe without gswpX_led0_pins defined, so put a dummy
|
|
* here.
|
|
*/
|
|
|
|
gswp1_led0_pins: gswp1-led0-pins {
|
|
mux {
|
|
function = "phy1_led0";
|
|
pins = "gpio33";
|
|
};
|
|
};
|
|
|
|
gswp2_led0_pins: gswp2-led0-pins {
|
|
mux {
|
|
function = "phy2_led0";
|
|
pins = "gpio34";
|
|
};
|
|
};
|
|
|
|
uart2_pins: uart2-pins {
|
|
mux {
|
|
function = "uart";
|
|
groups = "uart2";
|
|
};
|
|
};
|
|
|
|
hsuart_pins: hsuart-pins {
|
|
mux {
|
|
function = "uart";
|
|
groups = "hsuart";
|
|
};
|
|
};
|
|
};
|
|
|
|
&snfi {
|
|
status = "okay";
|
|
};
|
|
|
|
&spi_nand {
|
|
#address-cells = <1>;
|
|
#size-cells = <1>;
|
|
partitions {
|
|
compatible = "fixed-partitions";
|
|
#address-cells = <1>;
|
|
#size-cells = <1>;
|
|
|
|
partition@0 {
|
|
label = "vendor";
|
|
reg = <0x00000000 0x00600000>;
|
|
read-only;
|
|
};
|
|
|
|
partition@600000 {
|
|
label = "chainloader";
|
|
reg = <0x00600000 0x00100000>;
|
|
read-only;
|
|
};
|
|
|
|
partition@700000 {
|
|
label = "ubi";
|
|
reg = <0x00700000 0x1b700000>;
|
|
compatible = "linux,ubi";
|
|
|
|
volumes {
|
|
ubi-volume-ubootenv {
|
|
volname = "ubootenv";
|
|
nvmem-layout {
|
|
compatible = "u-boot,env-redundant-bool";
|
|
};
|
|
};
|
|
|
|
ubi-volume-ubootenv2 {
|
|
volname = "ubootenv2";
|
|
nvmem-layout {
|
|
compatible = "u-boot,env-redundant-bool";
|
|
};
|
|
};
|
|
|
|
ubi_rootfs: ubi-volume-fit {
|
|
volname = "fit";
|
|
};
|
|
|
|
ubi_factory: ubi-volume-factory {
|
|
volname = "factory";
|
|
};
|
|
};
|
|
};
|
|
|
|
/* reserved for bad block table */
|
|
reserved_bmt@1be00000 {
|
|
label = "reserved_bmt";
|
|
reg = <0x1be00000 0x04200000>;
|
|
read-only;
|
|
};
|
|
};
|
|
};
|
|
|
|
&ubi_factory {
|
|
nvmem-layout {
|
|
compatible = "fixed-layout";
|
|
#address-cells = <1>;
|
|
#size-cells = <1>;
|
|
|
|
eeprom: eeprom@0 {
|
|
reg = <0x0 0x1e00>;
|
|
};
|
|
|
|
wan_mac: macaddr@5000 {
|
|
reg = <0x5000 0x6>;
|
|
};
|
|
|
|
lan_mac: macaddr@6000 {
|
|
compatible = "mac-base";
|
|
reg = <0x6000 0x6>;
|
|
#nvmem-cell-cells = <1>;
|
|
};
|
|
};
|
|
};
|
|
|
|
&i2c0 {
|
|
status = "okay";
|
|
|
|
hwmon@2e {
|
|
compatible = "nuvoton,nct7802";
|
|
reg = <0x2e>;
|
|
};
|
|
};
|
|
|
|
&pcie0 {
|
|
status = "okay";
|
|
|
|
airoha,x2-mode;
|
|
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&pcie0_rst_pins>;
|
|
pcie@0,0 {
|
|
reg = <0x0000 0 0 0 0>;
|
|
device_type = "pci";
|
|
#address-cells = <3>;
|
|
#size-cells = <2>;
|
|
|
|
mt7996@0,0 {
|
|
reg = <0x0000 0 0 0 0>;
|
|
#address-cells = <1>;
|
|
#size-cells = <0>;
|
|
nvmem-cells = <&eeprom>;
|
|
nvmem-cell-names = "eeprom";
|
|
airoha,npu = <&npu>;
|
|
airoha,eth = <ð>;
|
|
|
|
band@0 {
|
|
/* 2.4 GHz */
|
|
reg = <0>;
|
|
nvmem-cells = <&lan_mac 1>;
|
|
nvmem-cell-names = "mac-address";
|
|
};
|
|
|
|
band@1 {
|
|
/* 5 GHz */
|
|
reg = <1>;
|
|
nvmem-cells = <&lan_mac 2>;
|
|
nvmem-cell-names = "mac-address";
|
|
};
|
|
|
|
band@2 {
|
|
/* 6 GHz */
|
|
reg = <2>;
|
|
nvmem-cells = <&lan_mac 3>;
|
|
nvmem-cell-names = "mac-address";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
&pcie2 {
|
|
status = "okay";
|
|
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&pcie2_rst_pins>;
|
|
};
|
|
|
|
&npu {
|
|
status = "okay";
|
|
};
|
|
|
|
ð {
|
|
status = "okay";
|
|
};
|
|
|
|
&gdm1 {
|
|
status = "okay";
|
|
|
|
nvmem-cells = <&lan_mac 0>;
|
|
nvmem-cell-names = "mac-address";
|
|
};
|
|
|
|
&pon_pcs {
|
|
status = "okay";
|
|
};
|
|
|
|
&gdm2 {
|
|
status = "okay";
|
|
|
|
managed = "in-band-status";
|
|
phy-handle = <&phy8>;
|
|
phy-mode = "usxgmii";
|
|
|
|
nvmem-cells = <&wan_mac 0>;
|
|
nvmem-cell-names = "mac-address";
|
|
openwrt,netdev-name = "wan";
|
|
};
|
|
|
|
ð_pcs {
|
|
status = "okay";
|
|
};
|
|
|
|
&gdm4 {
|
|
status = "okay";
|
|
|
|
managed = "in-band-status";
|
|
phy-handle = <&phy5>;
|
|
phy-mode = "usxgmii";
|
|
|
|
nvmem-cells = <&lan_mac 0>;
|
|
nvmem-cell-names = "mac-address";
|
|
openwrt,netdev-name = "lan2";
|
|
};
|
|
|
|
&switch {
|
|
status = "okay";
|
|
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&mdio_pins>;
|
|
|
|
mdio {
|
|
phy5: ethernet-phy@5 {
|
|
compatible = "ethernet-phy-ieee802.3-c45";
|
|
reg = <5>;
|
|
reset-gpios = <&en7581_pinctrl 46 GPIO_ACTIVE_LOW>;
|
|
reset-assert-us = <200000>;
|
|
reset-deassert-us = <200000>;
|
|
// interrupt-parent = <&en7581_pinctrl>;
|
|
// interrupts = <22 IRQ_TYPE_LEVEL_LOW>;
|
|
realtek,pnswap-tx;
|
|
realtek,pnswap-rx;
|
|
};
|
|
|
|
phy8: ethernet-phy@8 {
|
|
compatible = "ethernet-phy-ieee802.3-c45";
|
|
reg = <8>;
|
|
reset-gpios = <&en7581_pinctrl 31 GPIO_ACTIVE_LOW>;
|
|
reset-assert-us = <200000>;
|
|
reset-deassert-us = <200000>;
|
|
// interrupt-parent = <&en7581_pinctrl>;
|
|
// interrupts = <23 IRQ_TYPE_LEVEL_LOW>;
|
|
realtek,pnswap-tx;
|
|
realtek,pnswap-rx;
|
|
};
|
|
};
|
|
};
|
|
|
|
&gsw_phy1 {
|
|
status = "okay";
|
|
interrupts = <1>;
|
|
pinctrl-names = "gbe-led";
|
|
pinctrl-0 = <&gswp1_led0_pins>;
|
|
};
|
|
|
|
&gsw_port1 {
|
|
status = "okay";
|
|
label = "lan3";
|
|
};
|
|
|
|
&gsw_phy2 {
|
|
status = "okay";
|
|
interrupts = <2>;
|
|
pinctrl-names = "gbe-led";
|
|
pinctrl-0 = <&gswp2_led0_pins>;
|
|
};
|
|
|
|
&gsw_port2 {
|
|
status = "okay";
|
|
label = "lan4";
|
|
};
|
|
|
|
&uart2 {
|
|
status = "okay";
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&uart2_pins>;
|
|
};
|
|
|
|
&hsuart3 {
|
|
status = "okay";
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&hsuart_pins>;
|
|
};
|