world leader in high performance signal processing
Trace: » dsa_for_ksz8893m

Introduction

DSA means “Distributed Switch Architecture”.

On BF518-EZBRD board there is a switch chip (Micrel Ksz8893m). It has three MACs and 2 PHYs, the MAC0 is connected to the blackfin on-chip mac port, MAC1+PHY1 and MAC2+PHY2 are connected to two ethernet connectors. With the DSA driver, we can get additional two ethernet devices.

This section will talk about how to configure the DSA driver and how to use them.

Configure the kernel

To configure the kernel with DSA support, select

Networking support  --->
  Networking options  --->
    Distributed Switch Architecture support  --->
      [*] MICREL KSZ8893MQL/BL ethernet switch chip support

and select,

Device Drivers  --->
  Network device support  --->
    Ethernet (10 or 100Mbit)  --->
      -*-   Generic Media Independent Interface device support
      <*> Blackfin on-chip MAC support

Check the DSA driver is installed

When kernel booting, you will see the MII_BUS, SPI, and DSA driver messages like,

bfin_mii_bus: probed
bfin_mac: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:03, irq=-1, mdc_clk=2500000Hz(mdc_div=15)@sclk=80MHz)
bfin_mac bfin_mac.0: Blackfin on-chip Ethernet MAC driver, Version 1.1
bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_base@ffc00500, dma channel@7
Distributed Switch Architecture driver version 0.1
eth0: detected a KSZ8893M switch
dsa slave smi: probed

How to use DSA driver

After kernel booting finished, you will have 3 ethernet devices eth0, eth1 and eth2.

root:/> ifconfig eth0 0.0.0.0 up
root:/> Trying 100/FULL
PHY: 0:03 - Link is Up - 100/Full
root:/> ifconfig -a
eth0      Link encap:Ethernet  HWaddr 0A:39:0E:5C:AC:8E
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth1      Link encap:Ethernet  HWaddr 0A:39:0E:5C:AC:8E
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth2      Link encap:Ethernet  HWaddr 0A:39:0E:5C:AC:8E
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

root:/> ifconfig eth1 10.0.0.1
root:/> eth1: link up, 100 Mb/s, full duplex
root:/> ifconfig eth1 20.0.0.2

The eth0 is master device, it can't transive packet to outside in logical. eth1 and eth2 is slave devices, you can use it as normal ethernet devices.

The eth1 and eth2 devices also support vlan(8021Q).