[1] Adding TxC and RxC clock skew
Please, do read the following page to get familiar with some required setups for the mv88e6190. RGMII Interface Timing Considerations | Ethernet FMC
[2] Device Tree Source
&fec {
pinctrl-names = "default";
/* pinctrl-0 = <&pinctrl_enet>; */
pinctrl-0 = <&pinctrl_enet_5>;
/*
* Instead phy-mode "rgmii" the "rgmii-id" mode is entered, because
* i.MX6 silicon has the silicon bug, and it is not able to impose
* the required delay (clock skew) on TxC and RxC rgmii lines. Given
* mode ("rgmii-id") is instructing the DSA driver to insert these
* two delays on port 0 (MAC to MAC management port) mv88e6190.
*/
phy-mode = "rgmii-id";
local-mac-address = [XX XX XX XX XX XX];
/* fsl,err006687-workaround-present; */
status = "okay";
fixed-link {
speed = <1000>;
full-duplex;
};
mdio {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
switch0: switch0@0 {
compatible = "marvell,mv88e6190";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_switch>;
reg = <0>;
dsa,member = <0 0>;
reset-gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
label = "cpu";
ethernet = <&fec>;
phy-mode = "rgmii-id";
fixed-link {
speed = <1000>;
full-duplex;
};
};
port@1 {
reg = <1>;
label = "lan1";
};
port@2 {
reg = <2>;
label = "lan2";
};
port@3 {
reg = <3>;
label = "lan3";
};
port@4 {
reg = <4>;
label = "lan4";
};
port@5 {
reg = <5>;
label = "lan5";
};
};
};
};
};
[3] Setting the kernel.org vanilla kernel to integrate the mv88e6190 switch into the kernel
Switch (and switch-ish) device support @ Networking support->Networking options
Distributed Switch Architecture @ Networking support->Networking options
Tag driver for Marvell switches using DSA headers @ Networking support->Networking options->Distributed Switch Architecture
Tag driver for Marvell switches using EtherType DSA headers @ Networking support->Networking options->Distributed Switch Architecture
Marvell 88E6xxx Ethernet switch fabric support @ Device Drivers->Network device support->Distributed Switch Architecture drivers
Switch Global 2 Registers support @ Device Drivers->Network device support->Distributed Switch Architecture drivers->Marvell 88E6xxx Ethernet switch fabric support
Freescale devices @ Device Drivers->Network device support->Ethernet driver support
FEC ethernet controller (of ColdFire and some i.MX CPUs) @ Device Drivers->Network device support->Ethernet driver support->Freescale devices
Marvell devices @ Device Drivers->Network device support->Ethernet driver support
Marvell MDIO interface support @ Device Drivers->Network device support->Ethernet driver support->Marvell devices MDIO Bus/PHY emulation with fixed speed/link PHYs @ Device
Drivers->Network device support->PHY Device support and infrastructure
[4] Configure the switch to be a bridge
ip link set eth0 up
ip link set lan1 up
ip link set lan2 up
ip link set lan3 up
ip link set lan4 up
ip link set lan5 up
ip link add name br0 type bridge
ip link set br0 up
ip link lan1 master br0
ip link lan2 master br0
ip link lan3 master br0
ip link lan4 master br0
ip link lan5 master br0
ip addr add 192.168.1.4/24 dev br0
linux中的 ip addr 和 ip link命令详解
一、ip addr命令
我是使用的linux系统是redhat7.3,其它linux的相关操作大同小异(在这里不做赘述)
1.查看
(1). ip addr 的缩写是ip a ,可以查看网卡的ip、mac等,
即使网卡处于down状态,也能显示出网卡状态,但是ifconfig查看就看不到。
(2).ip addr show device 查看指定网卡的信息
比如查看网卡接口的信息,就是ip addr show eth0
2.增加ip
ip addr add ip/netmask dev 接口
比如给eth0增加一个172.25.21.1/24 地址
ip addr add 172.25.21.1/24 dev eth0
3.删除ip
ip addr del ip/netmask dev 接口
4.清空指定网卡的所有ip
ip addr flush dev 接口
5. 给网卡起别名,起别名相当于给网卡多绑定了一个ip
用法: 比如给网卡eth0增加别名
ip addr add 172.25.21.1/32 dev eth0 label eth0:1
6.删除别名
ip addr del ip/netmask dev eth0
注意:
使用命令的方式设置别名,重启服务就没了,若要永久生效,
需要写配置文件,步骤如下:
1、确保NetworkManager服务是停止的
systemctl stop NetworkManager 关闭该服务
systemctl disable NetworkManager 开机不自启动
注意:
使用命令的方式增加或者删除ip,都是临时的,
如果重启network服务,那么操作就失效了。
想要永久生效可以修改配置文件ifcfg-eth0
二、ip link 命令
1.查看
ip link只能看链路层的状态,看不到ip地址
2.启用、禁用接口
ip link set device down 禁用指定接口
ip link set device up 启用指定接口
比如禁用eth0就是ip link set eth0 down
说明:
ip link不支持tab键补齐