Skip to content

Commit

Permalink
mediatek: add Airoha AN8855 gigabit switch driver
Browse files Browse the repository at this point in the history
  • Loading branch information
dimfishr committed Oct 15, 2024
1 parent 484ea6a commit 66c5aae
Show file tree
Hide file tree
Showing 16 changed files with 4,546 additions and 2 deletions.
17 changes: 17 additions & 0 deletions package/kernel/linux/modules/netdevices.mk
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,23 @@ endef

$(eval $(call KernelPackage,dsa-tag-dsa))

define KernelPackage/dsa-an8855
SUBMENU:=$(NETWORK_DEVICES_MENU)
TITLE:=Airoha AN8855 DSA switch
DEPENDS:=+kmod-dsa
KCONFIG:=CONFIG_NET_DSA_AN8855 \
CONFIG_NET_DSA_TAG_AIROHA
FILES:=$(LINUX_DIR)/drivers/net/dsa/airoha/an8855/an8855-dsa.ko \
$(LINUX_DIR)/net/dsa/tag_arht.ko
AUTOLOAD:=$(call AutoLoad,41,an8855-dsa,1)
endef

define KernelPackage/dsa-an8855/description
Kernel modules for Airoha AN8855 DSA switch
endef

$(eval $(call KernelPackage,dsa-an8855))

define KernelPackage/dsa-mv88e6xxx
SUBMENU:=$(NETWORK_DEVICES_MENU)
TITLE:=Marvell MV88E6XXX DSA Switch
Expand Down
50 changes: 50 additions & 0 deletions target/linux/mediatek/dts/mt7981b-xiaomi-mi-router-common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,16 @@
interrupt-parent = <&pio>;
interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
};

switch2: switch@1 {
compatible = "airoha,an8855";
reg = <1>;
reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
interrupt-controller;
#interrupt-cells = <1>;
interrupt-parent = <&pio>;
interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
};
};

&switch {
Expand Down Expand Up @@ -124,6 +134,46 @@
};
};

&switch2 {
ports {
#address-cells = <1>;
#size-cells = <0>;

port@0 {
reg = <0>;
label = "wan";
};

port@1 {
reg = <1>;
label = "lan2";
};

port@2 {
reg = <2>;
label = "lan3";
};

port@3 {
reg = <3>;
label = "lan4";
};

port@5 {
reg = <5>;
label = "cpu";
ethernet = <&gmac0>;
phy-mode = "2500base-x";

fixed-link {
speed = <2500>;
full-duplex;
pause;
};
};
};
};

&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_flash_pins>;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

config NET_DSA_AN8855
tristate "Airoha AN8855 Ethernet switch support"
depends on NET_DSA
select NET_DSA_TAG_AIROHA
help
AN8855 support 2.5G speed and managed by SMI interface.
This enables support for the Airoha AN8855 Ethernet switch
chip.
To compile this driver as a module, choose M here.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#
# Makefile for Airoha AN8855 gigabit switch
#
obj-$(CONFIG_NET_DSA_AN8855) += an8855-dsa.o
an8855-dsa-objs := an8855.o an8855_nl.o an8855_phy.o
Loading

0 comments on commit 66c5aae

Please sign in to comment.