2009-02-16 07:43:26     ethernet switch

Document created by Aaronwu Employee on Aug 14, 2013
Version 1Show Document
  • View in full screen mode

2009-02-16 07:43:26     ethernet switch

Daniele Pagani (ITALY)

Message: 69480   

 

Dear Sirs,

 

in our project our idea is to use a ethernet switch connected to the Blackfin.

 

The first choice is Micrel 8893, but I'm not sure that it will be totally (mdi interface,ecc...) supported.

 

So, the question is, where can I find ethernet switch yet totally supported with uclinux 2008-1.5Rc3?

 

or could somebody suggest me some products?

 

Best regards,

 

Daniele.

TranslateQuoteReplyEditDelete

 

 

2009-02-16 13:49:02     Re: ethernet switch

Mike Frysinger (UNITED STATES)

Message: 69486   

 

there were none that we tested.  you can see what drivers exist by looking in linux-2.6.x/drivers/net/ ...

QuoteReplyEditDelete

 

 

2009-02-16 20:36:34     Re: ethernet switch

Graf Yang (CHINA)

Message: 69494   

 

The uClinux SVN trunk now have driver support Micrel 8893 with SPI bus.

 

Micrel 8893 support SPI, I2C bus to access all it's internal registers. It also support MDIO bus to access it's phy registers, but it not support accessing all it's internal registers via standard MDIO bus.

QuoteReplyEditDelete

 

 

2009-02-18 05:05:01     Re: ethernet switch

Daniele Pagani (ITALY)

Message: 69549   

 

Dear sirs,

 

I'm testing driver support Micrel 8893 with uClinux SVN trunk, but it doesn't work.

 

On my board (I'm using BF537), I've connected the Micrel by SPI bus.

 

With make menuconfig, I've selected:

 

Linux Kernel Configuration-->

Networking support-->

Networking options-->

Distributed Switch Architecture support-->

MICREL KSZ8893MQL/BL ethernet switch chip support

 

But I've not found other place where I can select the Micrel support, so I think I need only this flag.

 

This is the output of my boot kernel:

 

U-Boot 1.1.6 (ADI-2008R1.5) (Dec  4 2008 - 17:52:53)rt0] -> real [ttyBF0]                             

 

CPU:   ADSP bf537-0.2 (Detected Rev: 0.2)  

Dentry cache hash table entries: 409

Board: ADI BF537 stamp board                          

       Support: http://blackfin.uclinux.org/h table entries: 2048 (order: 1, 8192 bytes)

Clock: VCO: 500 MHz, Core: 500 MHz, System: 100 MHz     

Memory available: 22512k/28672k RAM, (3352k

RAM:   32 MB034k kernel

Flash:  4 MB          

In:    serial           

Out:   serial           

Err:   serialata, 1024k dm

Net:   Blackfin EMAC                  

MAC:   06:35:03:50:A0:A4loop... 997.37 BogoMIPS

Hit any key to stop autoboot:  0                              

## Booting image at 20040000l                       

   Image Type:   Blackfin Linux Kernel Image (gzip compressed)a B SRAM: 16 KB (16 KB free)                                

   Data Size:    2837489 Bytes =  2.7 MB8 KB (41 KB free)                     

   Load Address: 00001000PDA for CPU0 reserved at

   Entry Point:  0018a234             

net_names

   Verifying Checksum ... OK        

NET: Registered p

   Uncompressing Kernel Image ... ˜€over: boot [early_BFuart0] -> real [ttyBF0]                  

Blackfin DMA Controller                     

stamp_init(

Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)         

NET: Registered protocol family 2              

Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)rder: 0, 4096 bytes)                                     

msgmn

Blackfin Scratchpad data SRAM: 4 KB       

io scheduler noop registe

Blackfin L1 Data A SRAM: 16 KB (15 KB free) anticipatory registered (default) 

NET: Registered protocol family 16

Blackfin GPIO Controller

Blackfin DMA Controller

stamp_init(): registering device resources

NET: Registered protocol family 2

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

TCP established hash table entries: 1024 (order: 1, 8192 bytes)

TCP bind hash table entries: 1024 (order: 0, 4096 bytes)

TCP: Hash tables configured (established 1024 bind 1024)

TCP reno registered

NET: Registered protocol family 1

msgmni has been set to 42

io scheduler noop registered

io scheduler anticipatory registered (default)

io scheduler cfq registered

Serial: Blackfin serial driver

bfin-uart.1: ttyBF0 at MMIO 0xffc00400 (irq = 18) is a BFIN-UART

brd: module loaded

bfin_mii_bus: probed

eth%d: Don't found any phy device at all

bfin_mac bfin_mac.0: MII Probe failed!

bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_b

ase@ffc00500, dma channel@7

 

 

 

Any suggestion?

 

Daniele.

TranslateQuoteReplyEditDelete

 

 

2009-02-18 05:18:57     Re: ethernet switch

Graf Yang (CHINA)

Message: 69551   

 

So far, Micrel 8893 is developped on BF518-EZBRD.

 

You need connect the mdio bus between blackfin builtin MAC and 8893 port-3.

 

The SPI chip_select pin is 1 for BF518-EZBRD, which you can find in arch/blackfin/mach-bf518/boards/ezbrd.c

 

And there are some other board defines for this driver in this file.

QuoteReplyEditDelete

 

 

2009-02-18 08:41:52     Re: ethernet switch

Daniele Pagani (ITALY)

Message: 69558   

 

Well,

 

I've connected mdio bus and I've change stamp.c in order to reflect hardware configuration.

 

I use the SPI only for the Micrel, so I think to set low the spi chip select pin on the micrel.

 

Anyway, during the boot, I see:

 

bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_b

ase@ffc00500, dma channel@7

i2c /dev entries driver

TCP cubic registered

NET: Registered protocol family 17

 

Distributed Switch Architecture driver version 0.1

dsa: probe of dsa.0 failed with error -22

 

Could be useful this information?

 

Best regards,

 

Daniele.

 

 

 

 

TranslateQuoteReplyEditDelete

 

 

2009-02-19 21:17:41     Re: ethernet switch

Graf Yang (CHINA)

Message: 69661   

 

Can you see the followed messages during kernel booting?

 

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

 

 

 

QuoteReplyEditDelete

 

 

2009-02-20 05:59:29     Re: ethernet switch

Daniele Pagani (ITALY)

Message: 69688   

 

I've done 2 tests with same Image:

 

1) my board:

 

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

 

--> the boot is stopped here,

 

2) stamp board

 

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

dsa: probe of dsa.0 failed with error -22

...

 

the boot is ok, but I've not connect the micrel to this board, so this is ok for me

 

So, I don't understand why on my board the boot is stopped after spi check, or perhaps, the problem is the line "after"

 

rtc-bfin rtc-bfin: setting system clock to 1970-01-01

 

So, I need to do some additional tests.

 

Thank you very much,

 

Daniele.

 

 

 

 

TranslateQuoteReplyEditDelete

 

 

2009-02-20 08:37:38     Re: ethernet switch

Daniele Pagani (ITALY)

Message: 69692   

 

Ok, now I've:

 

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

 

and when I connect RJ45 on port I've:

 

PHY: 0:03 - Link is Up - 100/Full

 

But, if I try a ping, then it doesn't find any.

 

Any idea?

 

Whay can I use in order to test Micrel?

 

Best regards,

 

Daniele.

TranslateQuoteReplyEditDelete

 

 

2009-02-22 21:15:47     Re: ethernet switch

Graf Yang (CHINA)

Message: 69730   

 

Please see the following page:

 

https://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:dsa_for_ksz8893m#how_to_use_dsa_driver

 

"PHY: 0:03 - Link is Up - 100/Full" means port3 has good connection with blackfin built-in mac.

 

 

 

When you connect RJ45 on port, if you can see:

 

eth1: link up, 100Mb/s, full duplex

 

or

 

eth2: link up, 100Mb/s, full duplex

 

then the connections are OK. You can ifconfig eth1/2, and ping out.

QuoteReplyEditDelete

 

 

2009-02-23 10:53:23     Re: ethernet switch

Daniele Pagani (ITALY)

Message: 69757   

 

Dear Sir,

 

I've read the document and it is very clear.

 

I'm in the same situation with Bf537 and Micrel.

 

Anyway, I've yet a doubt.

 

That is, do I need to change the routing tables? And/Or do I need to enable ip_forward?

 

Best regards,

 

Daniele.

TranslateQuoteReplyEditDelete

 

 

2009-02-23 11:24:35     Re: ethernet switch

Mike Frysinger (UNITED STATES)

Message: 69758   

 

it's a hardware switch.  software NAT has no bearing at all.

QuoteReplyEditDelete

 

 

2009-02-23 20:34:50     Re: ethernet switch

Graf Yang (CHINA)

Message: 69780   

 

It is simulating two ethernet card devices.

 

When you assign an IP address to the ethx, kernel will setting the corresponding route table for you.

QuoteReplyEditDelete

 

 

2009-02-25 07:37:37     Re: ethernet switch

Daniele Pagani (ITALY)

Message: 69881   

 

Dear Sir,

 

I've done a lot of test with Micrel's driver.

 

At the moment I've this situation:

 

********** dmesg **************

 

bfin_mii_bus: probed

bfin_mac: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:03, irq=-1, mdc_

clk=2500000Hz(mdc_div=19)@sclk=100MHz)

bfin_mac bfin_mac.0: Blackfin on-chip Ethernet MAC driver, Version 1.1

bfin-spi bfin-spi.0: chipselect 1 already in use

bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_b

ase@ffc00500, dma channel@7

i2c /dev entries driver

i2c-bfin-twi i2c-bfin-twi.0: Blackfin BF5xx on-chip I2C TWI Contoller, regs_base

@ffc01400

TCP cubic registered

NET: Registered protocol family 17

Distributed Switch Architecture driver version 0.1

eth0: detected a KSZ8893M switch

 

dsa slave smi: probed

 

********** http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:dsa_for_ksz8893m **************

 

root:/bin> ./ifconfig eth0 0.0.0.0 up

root:/bin> Trying 100/FULL

PHY: 0:03 - Link is Up - 100/Full

 

root:/bin> ./ifconfig eth1 192.168.1.67 up

root:/bin> eth1: link up, 100 Mb/s, full duplex

 

******** check routing ********

root:/bin> route

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.1.0     *               255.255.255.0   U     0      0        0 eth1

root:/bin>

 

********** check with ifconfig *************

root:/bin> ./ifconfig -a eth0

eth0      Link encap:Ethernet  HWaddr 26:0A:38:05:AC:20

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:3 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:126 (126.0 B)

 

eth1      Link encap:Ethernet  HWaddr 26:0A:38:05:AC:20

          inet addr:192.168.1.67  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:3 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:0 (0.0 B)  TX bytes:126 (126.0 B)

 

eth2      Link encap:Ethernet  HWaddr 26:0A:38:05:AC:20

          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:2 errors:0 dropped:0 overruns:0 frame:0

          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:224 (224.0 B)  TX bytes:224 (224.0 B)

 

********* try to ping my pc on network  NOT OK********

root:/bin> ping 192.168.1.15

PING 192.168.1.15 (192.168.1.15): 56 data bytes

^C

--- 192.168.1.15 ping statistics ---

3 packets transmitted, 0 packets received, 100% packet loss

 

 

******* try to use ethtool OK***********

root:/bin> ethtool eth0

Settings for eth0:

        Supported ports: [ TP AUI BNC MII FIBRE ]

        Supported link modes:   10baseT/Half 10baseT/Full

                                100baseT/Half 100baseT/Full

        Supports auto-negotiation: Yes

        Advertised link modes:  10baseT/Half 10baseT/Full

                                100baseT/Half 100baseT/Full

        Advertised auto-negotiation: Yes

        Speed: 100Mb/s

        Duplex: Full

        Port: MII

        PHYAD: 3

        Transceiver: external

        Auto-negotiation: off

        Link detected: yes

 

root:/bin> ethtool eth1

Settings for eth1:

        Supported ports: [ TP AUI BNC MII FIBRE ]

        Supported link modes:   10baseT/Half 10baseT/Full

                                100baseT/Half 100baseT/Full

        Supports auto-negotiation: Yes

        Advertised link modes:  10baseT/Half 10baseT/Full

                                100baseT/Half 100baseT/Full

        Advertised auto-negotiation: Yes

        Speed: 100Mb/s

        Duplex: Full

        Port: MII

        PHYAD: 1

        Transceiver: external

        Auto-negotiation: on

        Link detected: yes

 

**************** try to check with traceroute NOT OK *************

 

root:/bin> traceroute 192.168.1.15

traceroute to 192.168.1.15 (192.168.1.15), 30 hops max, 38 byte packets

1  192.168.1.67 (192.168.1.67)  3004.000 ms !H  3004.000 ms !H  3004.000 ms !H

root:/bin>

 

**************** try to ping my ethernet micrel port eth1 OK*************

 

root:/bin> ping 192.168.1.67

PING 192.168.1.67 (192.168.1.67): 56 data bytes

64 bytes from 192.168.1.67: seq=0 ttl=64 time=0.000 ms

64 bytes from 192.168.1.67: seq=1 ttl=64 time=0.000 ms

64 bytes from 192.168.1.67: seq=2 ttl=64 time=0.000 ms

^C

--- 192.168.1.67 ping statistics ---

3 packets transmitted, 3 packets received, 0% packet loss

round-trip min/avg/max = 0.000/0.000/0.000 ms

 

When I use ethtool I can change sucessfully the speed and so on.

 

Then, I've checked electrical signal con rj45 connector and so on.

 

The next step is to check all registry of Micrel. Does I need to set some registers?

 

Best regards,

 

Daniele.

TranslateQuoteReplyEditDelete

 

 

2009-02-25 14:31:22     Re: ethernet switch

Mike Frysinger (UNITED STATES)

Message: 69905   

 

well, if you read the output you posted, this seems like something you should fix:

bfin-spi bfin-spi.0: chipselect 1 already in use

QuoteReplyEditDelete

 

 

2009-02-25 16:06:43     Re: ethernet switch

Daniele Pagani (ITALY)

Message: 69909   

 

OK, I've already adjust it.

 

The SPI is used by the driver, so now the dmesg is ok.

 

Anyway the problem is not that one.

 

How can I dump the register from Micrel? I've tried with ethtool but the command is not supported.

 

Best regards,

 

Daniele.

TranslateQuoteReplyEditDelete

 

 

2009-02-25 16:17:40     Re: ethernet switch

Mike Frysinger (UNITED STATES)

Message: 69910   

 

mmm you'd probably have to do it manually as i dont think the framework will allow spidev to bang on the cs while another driver (the dsa code in this case) has it allocated

 

in other words, add some spi code to read/dump the phy registers to the dsa driver for the micrel part

Attachments

    Outcomes