Skip to content

Commit

Permalink
linux: devicetree: Early experimental support for Ethernet switching …
Browse files Browse the repository at this point in the history
…with DSA
  • Loading branch information
CFSworks committed Mar 18, 2024
1 parent 77d8863 commit 647b965
Show file tree
Hide file tree
Showing 5 changed files with 1,673 additions and 4 deletions.
3 changes: 0 additions & 3 deletions tp2bmc/board/tp2bmc/boot.scr
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,4 @@ load ${devtype} ${devnum}:${distro_bootpart} ${loadaddr} /boot/zImage
load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} /boot/${fdt_filename}
fdt addr ${fdt_addr_r}

# Our build of Linux doesn't yet know how to manage the switch, so:
run ethsw_do_reset

bootz ${loadaddr} - ${fdt_addr_r}
7 changes: 6 additions & 1 deletion tp2bmc/board/tp2bmc/linux_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_INET_IPCOMP=y
CONFIG_INET_UDP_DIAG=y
CONFIG_IPV6_TUNNEL=y
CONFIG_BRIDGE=y
CONFIG_NET_DSA=y
CONFIG_NET_DSA_TAG_RTL4_A=y
CONFIG_NETLINK_DIAG=y
CONFIG_UEVENT_HELPER=y
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
Expand All @@ -66,6 +69,9 @@ CONFIG_EEPROM_AT24=y
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
CONFIG_NETDEVICES=y
CONFIG_NET_DSA_REALTEK=y
# CONFIG_NET_DSA_REALTEK_MDIO is not set
CONFIG_NET_DSA_REALTEK_RTL8365MB=y
# CONFIG_NET_VENDOR_ALACRITECH is not set
# CONFIG_NET_VENDOR_ALLWINNER is not set
# CONFIG_NET_VENDOR_AMAZON is not set
Expand Down Expand Up @@ -114,7 +120,6 @@ CONFIG_STMMAC_ETH=y
# CONFIG_NET_VENDOR_WANGXUN is not set
# CONFIG_NET_VENDOR_WIZNET is not set
# CONFIG_NET_VENDOR_XILINX is not set
CONFIG_REALTEK_PHY=y
# CONFIG_USB_NET_DRIVERS is not set
# CONFIG_WLAN is not set
CONFIG_INPUT_EVDEV=y
Expand Down
84 changes: 84 additions & 0 deletions tp2bmc/board/tp2bmc/sun8i-t113s-turing-pi2.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,90 @@

pagesize = <16>;
};

ethernet-switch@5c {
compatible = "realtek,rtl8365mb";
reg = <0x5c>;

reset-gpios = <&pio 6 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;

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

ethernet-port@0 {
reg = <0>;
label = "node1";
phy-handle = <&ethphy0>;
phy-mode = "internal";
};
ethernet-port@1 {
reg = <1>;
label = "node2";
phy-handle = <&ethphy1>;
phy-mode = "internal";
};
ethernet-port@2 {
reg = <2>;
label = "node3";
phy-handle = <&ethphy2>;
phy-mode = "internal";
};
ethernet-port@3 {
reg = <3>;
label = "node4";
phy-handle = <&ethphy3>;
phy-mode = "internal";
};
ethernet-port@4 {
reg = <4>;
label = "cpu";
ethernet = <&emac>;
phy-handle = <&ethphy4>;
phy-mode = "internal";
};
ethernet-port@5 {
reg = <5>;
label = "ge0";
phy-handle = <&ethphy5>;
phy-mode = "internal";
};
ethernet-port@6 {
reg = <6>;
label = "ge1";
phy-handle = <&ethphy6>;
phy-mode = "internal";
};
};

mdio {
compatible = "realtek,smi-mdio";
#address-cells = <1>;
#size-cells = <0>;

ethphy0: ethernet-phy@0 {
reg = <0>;
};
ethphy1: ethernet-phy@1 {
reg = <1>;
};
ethphy2: ethernet-phy@2 {
reg = <2>;
};
ethphy3: ethernet-phy@3 {
reg = <3>;
};
ethphy4: ethernet-phy@4 {
reg = <4>;
};
ethphy5: ethernet-phy@5 {
reg = <5>;
};
ethphy6: ethernet-phy@6 {
reg = <6>;
};
};
};
};

&emac {
Expand Down
Loading

0 comments on commit 647b965

Please sign in to comment.