Hello.
I am working with imx233 EVK and the ENC28J60 ethernet chip which is connected via SPI.
After doing tests with iperf, I get a maximum of 2Mbps transmission.
10Mbps:
[ID] Interval Transfer Bandwidth Jitter Lost / Total Datagrams
[3] 0.0-30.2 sec 7.68 MBytes 2.13 Mbits / sec 12.578 ms 25128/30604 (82%)
[4] Local 10.5.0.61 port 12345 connected with 10.200.100.10 port 55178
2Mbps:
[ID] Interval Transfer Bandwidth Jitter Lost / Total Datagrams
[3] 0.0-30.0 sec 7.12 MBytes 1.99 Mbits / sec 1.668 ms 24/5104 (0.47%)
1Mpbs:
[ID] Interval Transfer Bandwidth Jitter Lost / Total Datagrams
[4] 0.0-30.0 sec 3.58 MBytes 1.00 Mbits / sec 0.600 ms 0/2553 (0%)
The test is with UDP packets.
I have seen the SPI bus runs at 6 MHz, should not be able to transmit to 6Mbps?. The chip is the only ethernet device linked to SPI. Is it possible to see actual speed that is being transmitted by SPI?
Thank you.
Hi Toni,
assume you run Linux on the imx233.
I have seen the SPI bus runs at 6 MHz, should not be able to transmit to 6Mbps?
No, running this Ethernet interface leads to a lot of additional SPI protocol overhead plus the UDP protocol overhead.
If you need more speed you could try this:
BR Stefan
Hello Stefan.
Thank for your answer
assume you run Linux on the imx233.
Yes, linux 2.6.31
- increase SPI clock speed
If increase SPI clock speed above 6Mhz, imx233 stops working.
- check for Kernel parameter ENC28J60_WRITEVERIFY and try to disable it
Is disable: # CONFIG_ENC28J60_WRITEVERIFY is not set
switch to Micrel KS8852
Change de ethernet card is de last option, if is not possible increase transmission rate.
Any other option?
In this post describe the same problem:
http://www.microchip.com/forums/m634249.aspx
Said it may violate the setup and activation times of CS (see http://ww1.microchip.com/downloads/en/DeviceDoc/39662e.pdf 16-6). Someone has changed the spi driver to resolve this problem.
I change mxs_spi.c to add delay:
static inline void mxs_spi_enable(struct mxs_spi *ss)
{
ndelay(50);
__raw_writel(BM_SSP_CTRL0_LOCK_CS, ss->regs + HW_SSP_CTRL0_SET);
__raw_writel(BM_SSP_CTRL0_IGNORE_CRC, ss->regs + HW_SSP_CTRL0_CLR);
}
static inline void mxs_spi_disable(struct mxs_spi *ss)
{
ndelay(50);
__raw_writel(BM_SSP_CTRL0_LOCK_CS, ss->regs + HW_SSP_CTRL0_CLR);
__raw_writel(BM_SSP_CTRL0_IGNORE_CRC, ss->regs + HW_SSP_CTRL0_SET);
}
But not work
Thanks.