2009-04-27 09:01:40 Enc28j60
Jan Pohanka (CZECH REPUBLIC)
Message: 73286
Hello,
I'm trying to connect the network with enc28j60 and included linux driver. It correctly detects the chip and registers eth0 interface. But after the setup the network (ifconfig...) it seems no packet are transfered. Even when I try ping 192.168.1.3 (PC) there is no traffic on SPI bus. Could you please give me a hint, where could be the problem?
greetings Jan
QuoteReplyEditDelete
2009-04-27 09:27:17 Re: Enc28j60
Robin Getz (UNITED STATES)
Message: 73287
Jan:
Can you post the output of dmesg?
Thanks
-Robin
QuoteReplyEditDelete
2009-04-28 05:14:00 Re: Enc28j60
Jan Pohanka (CZECH REPUBLIC)
Message: 73350
Of course
root: /> dmesg
Linux version 2.6.28.9-ADI-2009R1-pre-svn6270 (honza@jules) (gcc version 4.1.2 (
ADI svn)) #49 Mon Apr 27 12:51:08 CEST 2009
console [early_BFuart0] enabled
early printk enabled on early_BFuart0
Board Memory: 32MB
Kernel Managed Memory: 32MB
Memory map:
fixedcode = 0x00000400-0x00000490
text = 0x00001000-0x00103cd0
rodata = 0x00103cd0-0x0015176c
bss = 0x00151770-0x0015f294
data = 0x0015f2a0-0x0016e000
stack = 0x0016c000-0x0016e000
init = 0x0016e000-0x005f2000
available = 0x005f2000-0x01eff000
DMA Zone = 0x01f00000-0x02000000
Hardware Trace Active and Enabled
Boot Mode: 6
Reset caused by Software reset
Blackfin support (C) 2004-2009 Analog Devices, Inc.
Compiled for ADSP-BF532 Rev 0.5
Blackfin Linux support by blackfin.uclinux.org/
Processor Speed: 400 MHz core clock and 133 MHz System Clock
boot memmap: 00000000005f2000 - 0000000001eff000 (usable)
On node 0 totalpages: 7935
free_area_init_node: node 0, pgdat 0016ab5c, node_mem_map 005f7000
DMA zone: 62 pages used for memmap
DMA zone: 0 pages reserved
DMA zone: 7873 pages, LIFO batch:0
Normal zone: 0 pages used for memmap
Movable zone: 0 pages used for memmap
NOMPU: setting up cplb tables
Instruction Cache Enabled for CPU0
Data Cache Enabled for CPU0 (write-back)
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 7873
Kernel command line: root=/dev/mtdblock0 rw clkin_hz=20000000 earlyprintk=serial
,uart0,230400 console=ttyBF0,230400
Configuring Blackfin Priority Driven Interrupts
PID hash table entries: 128 (order: 7, 512 bytes)
console handover: boot [early_BFuart0] -> real [ttyBF0]
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Kernel managed physical pages: 7935
Memory available: 25352k/32768k RAM, (4624k init code, 1035k kernel code, 425k d
ata, 1024k dma, 304k reserved)
Calibrating delay loop... 796.67 BogoMIPS (lpj=1593344)
Security Framework initialized
Mount-cache hash table entries: 512
Blackfin Scratchpad data SRAM: 4 KB
Blackfin L1 Instruction SRAM: 32 KB (21 KB free)
PDA for CPU0 reserved at 00151fe4
net_namespace: 288 bytes
NET: Registered protocol family 16
Blackfin GPIO Controller
Blackfin DMA Controller
visor1_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
Setting up Blackfin MMR debugfs
msgmni has been set to 49
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler cfq registered
PPI: ADSP PPI Frame Capture Driver IRQ:15
timer_initialize: module loaded
simple-gpio: now handling 16 GPIOs: 0 - 15
Serial: Blackfin serial driver
bfin-uart.1: ttyBF0 at MMIO 0xffc00400 (irq = 21) is a BFIN-UART
m25p80 spi0.2: m25p32 (4096 Kbytes)
Creating 3 MTD partitions on "m25p80":
0x00000000-0x00030000 : "bootloader(spi)"
0x00030000-0x003a0000 : "linux kernel(spi)"
0x003a0000-0x00400000 : "file system(spi)"
bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_b
ase@ffc00500, dma channel@5
bfin-wdt: initialized: timeout=20 sec (nowayout=0)
TCP cubic registered
NET: Registered protocol family 17
Freeing unused kernel memory: 4624k freed
dma_alloc_init: dma_page @ 0x0016e000 - 256 pages at 0x01f00000
enc28j60 spi0.5: enc28j60 Ethernet driver 1.01 loaded
net eth0: enc28j60 driver registered
net eth0: link down
net eth0: normal mode
net eth0: multicast mode
net eth0: multicast mode
net eth0: multicast mode
net eth0: multicast mode
root: />
Here is ifconfig
root: /> ifconfig
eth0 Link encap:Ethernet HWaddr CE:8F:1E:67:62:19
inet addr:192.168.1.3 Bcast:192.168.1.255 Mask:255.255.255.0
UP 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:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:37
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)
Jan
QuoteReplyEditDelete
2009-04-28 10:36:36 Re: Enc28j60
Robin Getz (UNITED STATES)
Message: 73375
Jan:
So - at least the driver is loading properly. (I assume that is the correct ethernet MAC?)
Does the Blackfin find itself?
ping 127.0.0.1
ping 192.168.1.3
ping 192.168.1.xxx (something else on the same subnet?)
-Robin
QuoteReplyEditDelete
2009-04-28 10:53:13 Re: Enc28j60
Michael Hennerich (GERMANY)
Message: 73376
Jan,
I tried the driver on my side. It works well.
Are you sur that you configured and wired the interrupt line correctly?
See my ouput below:
-Michael
Linux version 2.6.28.9-ADI-2009R1-pre-svn6277 (michael@mhenneri-D02) (gcc version 4.1.2 (ADI svn)) #1634 Tue A9
console [early_BFuart0] enabled
early printk enabled on early_BFuart0
Warning: limiting memory to 56MB due to hardware anomaly 05000263
Board Memory: 64MB
Kernel Managed Memory: 64MB
Memory map:
fixedcode = 0x00000400-0x00000490
text = 0x00001000-0x001289d0
rodata = 0x001289d0-0x00187a94
bss = 0x00187aa0-0x001982bc
data = 0x001982bc-0x001ac000
stack = 0x001aa000-0x001ac000
init = 0x001ac000-0x006d6000
available = 0x006d6000-0x037ff000
DMA Zone = 0x03f00000-0x04000000
Hardware Trace Active and Enabled
Boot Mode: 0
Blackfin support (C) 2004-2009 Analog Devices, Inc.
Compiled for ADSP-BF537 Rev 0.2
Warning: Compiled for Rev 2, but running on Rev 3
Blackfin Linux support by blackfin.uclinux.org/
Processor Speed: 500 MHz core clock and 125 MHz System Clock
NOMPU: setting up cplb tables
Instruction Cache Enabled for CPU0
Data Cache Enabled for CPU0 (write-back)
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 14223
Kernel command line: root=/dev/mtdblock0 rw clkin_hz=25000000 earlyprintk=serial,uart0,57600 console=ttyBF0,57f
Configuring Blackfin Priority Driven Interrupts
PID hash table entries: 256 (order: 8, 1024 bytes)
Console: colour dummy device 80x25
console handover: boot [early_BFuart0] -> real [ttyBF0]
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory available: 49756k/65536k RAM, (5288k init code, 1182k kernel code, 526k data, 1024k dma, 7760k reserved)
Calibrating delay loop... 997.37 BogoMIPS (lpj=1994752)
Security Framework initialized
Mount-cache hash table entries: 512
Blackfin Scratchpad data SRAM: 4 KB
Blackfin L1 Data A SRAM: 16 KB (15 KB free)
Blackfin L1 Data B SRAM: 16 KB (16 KB free)
Blackfin L1 Instruction SRAM: 48 KB (37 KB free)
PDA for CPU0 reserved at 00188b88
net_namespace: 288 bytes
NET: Registered protocol family 16
Blackfin GPIO Controller
Blackfin DMA Controller
stamp_init(): registering device resources
SCSI subsystem initialized
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
msgmni has been set to 97
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
bfin_mac: attached PHY driver [SMSC LAN83C185] (mii_bus:phy_addr=0:01, irq=-1, mdc_clk=2500000Hz(mdc_div=24)@s)
bfin_mac bfin_mac.0: Blackfin on-chip Ethernet MAC driver, Version 1.1
enc28j60 spi0.0: enc28j60 Ethernet driver 1.01 loaded
net eth1: enc28j60 driver registered
bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_base@ffc00500, dma channel@7
rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0
bfin-wdt: initialized: timeout=20 sec (nowayout=0)
TCP cubic registered
NET: Registered protocol family 17
rtc-bfin rtc-bfin: setting system clock to 1970-01-03 15:59:24 UTC (230364)
IP-Config: Gateway not on directly connected network.
Freeing unused kernel memory: 5288k freed
dma_alloc_init: dma_page @ 0x006d3000 - 256 pages at 0x03f00000
_____________________________________
a8888b. / Welcome to the uClinux distribution \
d888888b. / _ _ \
8P"YP"Y88 / | | |_| __ __ (TM) |
8|o||o|88 _____/ | | _ ____ _ _ \ \/ / |
8' .88 \ | | | | _ \| | | | \ / |
8`._.' Y8. \ | |__ | | | | | |_| | / \ |
d/ `8b. \ \____||_|_| |_|\____|/_/\_\ |
dP . Y8b. \ For embedded processors including |
d8:' " `::88b \ the Analog Devices Blackfin /
d8" 'Y88b \___________________________________/
:8P ' :888
8a. : _a88P For further information, check out:
._/"Yaa_: .| 88P| - blackfin.uclinux.org/
\ YP" `| 8P `. - docs.blackfin.uclinux.org/
/ \.___.d| .' - www.uclinux.org/
`--..__)8888P`._.' jgs/a:f - www.analog.com/blackfin
Have a lot of fun...
BusyBox v1.13.3 (2009-04-21 11:20:06 CEST) built-in shell (msh)
Enter 'help' for a list of built-in commands.
root:/>
root:/> PHY: 0:01 - Link is Up - 100/Full
root:/> ifconfig eth1 192.168.1.44
net eth1: link down
net eth1: normal mode
net eth1: multicast mode
net eth1: multicast mode
root:/> net eth1: link up - Half duplex
root:/> ifconfig
eth0 Link encap:Ethernet HWaddr 00:00:00:00:47:00
inet addr:10.44.2.37 Bcast:10.44.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:36 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:3095 (3.0 KiB) TX bytes:0 (0.0 B)
eth1 Link encap:Ethernet HWaddr 06:B7:AB:39:6D:EE
inet addr:192.168.1.44 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: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)
Interrupt:56
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:/> ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: seq=0 ttl=64 time=4.000 ms
64 bytes from 192.168.1.1: seq=1 ttl=64 time=0.000 ms
64 bytes from 192.168.1.1: seq=2 ttl=64 time=0.000 ms
64 bytes from 192.168.1.1: seq=3 ttl=64 time=0.000 ms
^C
--- 192.168.1.1 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.000/1.000/4.000 ms
root:/>
root:/> cat /proc/interrupts
6: 40315 CORE Blackfin Core Timer
10: 1 INTN rtc-bfin
17: 6 INTN BFIN_SPI_DMA
18: 0 INTN BFIN_UART_RX
19: 77 INTN BFIN_UART_TX
24: 376 INTN EMAC_RX
56: 9 GPIO enc28j60
NMI: 0 CORE Non Maskable Interrupt
Err: 0
root:/>
QuoteReplyEditDelete
2009-04-28 11:12:25 Re: Enc28j60
Jan Pohanka (CZECH REPUBLIC)
Message: 73380
Hello,
thanks for responses. Ping to localhost works fine but anything on the same subnet gives no response. I have a logic analyzer on spi bus and I see the traffic while setting up the eth, but nothing happens there when I ping other places. It seems strange to me.
I hope the interrupt is set up correctly. I'm using PF4 - so IRQ_PF4.
Jan
root: /> ifconfig eth0
eth0 Link encap:Ethernet HWaddr CE:8F:1E:67:62:19
inet addr:192.168.1.3 Bcast:192.168.1.255 Mask:255.255.255.0
UP 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:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:37
root: /> ifconfig eth0 down
net eth0: multicast mode
root: /> ifconfig eth0 up
net eth0: link down
net eth0: normal mode
net eth0: multicast mode
net eth0: multicast mode
root: /> ping -c 3 192.168.1.3
PING 192.168.1.3 (192.168.1.3): 56 data bytes
64 bytes from 192.168.1.3: icmp_seq=0 ttl=64 time=0.0 ms
64 bytes from 192.168.1.3: icmp_seq=1 ttl=64 time=0.0 ms
64 bytes from 192.168.1.3: icmp_seq=2 ttl=64 time=0.0 ms
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.0/0.0/0.0 ms
root: /> ping -c 3 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.0 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.0 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.0 ms
--- 127.0.0.1 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.0/0.0/0.0 ms
root: /> ping -c 3 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
--- 192.168.1.1 ping statistics ---
3 packets transmitted, 0 packets received, 100% packet loss
root: /> cat /proc/interrupts
6: 5317002 CORE Blackfin Core Timer
21: 0 INTN BFIN_UART_RX
22: 5992 INTN BFIN_UART_TX
37: 0 GPIO enc28j60
NMI: 0 CORE Non Maskable Interrupt
Err: 0
root: />
QuoteReplyEditDelete
2009-04-28 11:22:10 Re: Enc28j60
Michael Hennerich (GERMANY)
Message: 73383 >root: /> cat /proc/interrupts
> 37: 0 GPIO enc28j60
You don't receive interrupts - this explains the behavior you're experiencing!
Double check the /INT routing.
And by the way - do you have a pull up on ENC28J60 /INT???
This is an open drain output and requires a e.g. 10K resistor to VDD.
-Michael
QuoteReplyEditDelete
2009-04-28 11:27:26 Re: Enc28j60
Jan Pohanka (CZECH REPUBLIC)
Message: 73384
Thank you for advice. I will try it.
QuoteReplyEditDelete
2009-04-28 11:51:30 Re: Enc28j60
Jan Pohanka (CZECH REPUBLIC)
Message: 73386
I tried the /INT wiring and it's ok, pullup is also there. Unfortunetely I can't see any level changes directly on /INT pin of the enc28j60 chip, still HI there...
QuoteReplyEditDelete
2010-06-09 02:16:45 Re: Enc28j60
Davide Rizzo (ITALY)
Message: 90201
Hi Jan,
Did you solve the problem ? I have exactly the same problem with ENC28J60, using a different processor.