Patchwork ethlite mac on virtex board

login
register
mail settings
Submitter Lê Đức Tài
Date Aug. 3, 2011, 8:13 a.m.
Message ID <1312359194.13500.YahooMailRC@web77918.mail.sg1.yahoo.com>
Download mbox | patch
Permalink /patch/108040/
State New
Headers show

Comments

Lê Đức Tài - Aug. 3, 2011, 8:13 a.m.
Hi Edgar,
I have a problem with Ethernet Lite on Virtex board as following.
Could you help me?
Thank you!

[Modify device tree - linux-2.6.37]



[Error when running guest machine]

zImage starting: loaded at 0x01200000 (sp: 0x0153cfb0)
Allocating 0x4bbe68 bytes for kernel ...
gunzipping (0x00000000 <- 0x0120e000:0x013cb92a)...done 0x39b4f0 bytes
Attached initrd image at 0x013cc000-0x0153bf20
initrd head: 0x1f8b0808

Linux/PowerPC load: console=ttyS0                    
Finalizing device tree... flat tree at 0x1549300
[    0.000000] Using Xilinx Virtex440 machine description
[    0.000000] Linux version 2.6.37+ (taild@debian-ttec) (gcc version 4.3.5 
(Debian 4.3.5-4) ) #35 PREEMPT Wed Aug 3 11:30:45 ICT 2011
[    0.000000] Found initrd at 0xc13cc000:0xc153bf20
[    0.000000] Zone PFN ranges:
[    0.000000]   DMA      0x00000000 -> 0x00010000
[    0.000000]   Normal   empty
[    0.000000] Movable zone start PFN for each node
[    0.000000] early_node_map[1] active PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00010000
[    0.000000] MMU: Allocated 1088 bytes of context maps for 255 contexts
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total 
pages: 65024
[    0.000000] Kernel command line: console=ttyS0
[    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Memory: 253468k/262144k available (3520k kernel code, 8676k 
reserved, 176k data, 1151k bss, 160k init)
[    0.000000] Kernel virtual memory layout:
[    0.000000]   * 0xfffdf000..0xfffff000  : fixmap
[    0.000000]   * 0xfde00000..0xfe000000  : consistent mem
[    0.000000]   * 0xfde00000..0xfde00000  : early ioremap
[    0.000000]   * 0xd1000000..0xfde00000  : vmalloc & ioremap
[    0.000000] Preemptable hierarchical RCU implementation.
[    0.000000]     RCU-based detection of stalled CPUs is disabled.
[    0.000000]     Verbose stalled-CPUs detection is disabled.
[    0.000000] NR_IRQS:512
[    0.000000] clocksource: timebase mult[a00000] shift[22] registered
[    0.000000] Console: colour dummy device 80x25
[    0.016523] pid_max: default: 32768 minimum: 301
[    0.017972] Mount-cache hash table entries: 512
[    0.086498] NET: Registered protocol family 16
[    0.104131] PCI: Probing PCI hardware
[    0.131515] bio: create slab <bio-0> at 0
[    0.136472] XGpio: /plb@0/gpio@81460000: registered
[    0.137461] XGpio: /plb@0/gpio@81400000: registered
[    0.138130] XGpio: /plb@0/gpio@81420000: registered
[    0.138710] XGpio: /plb@0/gpio@81440000: registered
[    0.141923] vgaarb: loaded
[    0.155370] Switching to clocksource timebase
[    0.203063] NET: Registered protocol family 2
[    0.207284] IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.214170] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
[    0.214492] TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
[    0.215635] TCP: Hash tables configured (established 8192 bind 8192)
[    0.215961] TCP reno registered
[    0.216157] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.216482] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.218590] NET: Registered protocol family 1
[    0.222081] RPC: Registered udp transport module.
[    0.222205] RPC: Registered tcp transport module.
[    0.222230] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.232197] Trying to unpack rootfs image as initramfs...
[    0.250903] rootfs image is not initramfs (no cpio magic); looks like an 
initrd
[    0.270685] Freeing initrd memory: 1471k freed
[    0.302829] ROMFS MTD (C) 2007 Red Hat, Inc.
[    0.304074] msgmni has been set to 499
[    0.310585] io scheduler noop registered
[    0.310694] io scheduler deadline registered
[    0.310970] io scheduler cfq registered (default)
[    0.647100] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.661291] 83e00000.serial: ttyS0 at MMIO 0x83e01003 (irq = 20) is a 16550
[    0.674631] console [ttyS0] enabled
[    0.698182] brd: module loaded
[    0.709066] loop: module loaded
[    0.714784] of:xsysace 83600000.sysace: xsysace: error initializing device at 
0x83600000
[    0.715185] of:xsysace 83600000.sysace: could not initialize device, err=-12
[    0.715579] of:xsysace: probe of 83600000.sysace failed with error -12
[    0.716847] Xilinx SystemACE device driver, major=254
[    0.718539] of:xilinx_emaclite 81000000.ethernet: Device Tree Probing
[    0.719785] of:xilinx_emaclite 81000000.ethernet: error registering MDIO bus
[    0.720391] of:xilinx_emaclite 81000000.ethernet: MAC address is now 
02:00:00:00:00:00
[    0.723575] of:xilinx_emaclite 81000000.ethernet: Xilinx EmacLite at 
0x81000000 mapped to 0xD10A0000, irq=16
[    0.728528] mice: PS/2 mouse device common for all mice
[    0.731065] i2c /dev entries driver
[    0.732564] Device Tree Probing 'i2c'
[    0.737730] xilinx-iic #0 at 0x81600000 mapped to 0xD10C0000, irq=18
[    0.741476] TCP cubic registered
[    0.741646] NET: Registered protocol family 17
[    0.761763] RAMDISK: gzip image found at block 0
[    1.009852] VFS: Mounted root (ext2 filesystem) readonly on device 1:0.
[    1.011201] Freeing unused kernel memory: 160k init
/etc/mtab: cannot create
root:~> ### Application running ...

root:~> ifconfig eth0 10.116.17.22 netmask 255.255.255.224
root:~> ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 02:00:00:00:00:00  
          inet addr:10.116.17.22  Bcast:10.116.17.31  Mask:255.255.255.224
          UP BROADCAST RUNNING  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:16 Memory:81000000-8100ffff 

root:~> ping -c 3 10.116.17.1
PING 10.116.17.1 (10.116.17.1): 56 data bytes

--- 10.116.17.1 ping statistics ---
3 packets transmitted, 0 packets received, 100% packet loss
root:~>     
root:~> [  144.880243] NETDEV WATCHDOG: eth0 (of:xilinx_emaclite): transmit 
queue 0 timed out
[  144.881850] Oops: Exception in kernel mode, sig: 4 [#1]
[  144.882092] PREEMPT Xilinx Virtex440
[  144.882315] last sysfs file: 
[  144.882654] Modules linked in:
[  144.883024] NIP: c0223464 LR: c0223464 CTR: c01b79b4
[  144.883397] REGS: cfff5e30 TRAP: 0700   Not tainted  (2.6.37+)
[  144.883631] MSR: 00029000 <EE,ME,CE>  CR: 44000024  XER: 20000000
[  144.884286] TASK = c0373350[0] 'swapper' THREAD: c0396000
[  144.884564] GPR00: c0223464 cfff5ee0 c0373350 0000005c 00001a6c ffffffff 
c01b84c4 00004000 

[  144.885167] GPR08: c049e7bc 00000101 00003fff cfff4000 84000024 00000000 
00000000 00000000 

[  144.885708] GPR16: c0303e54 00000001 c04a2900 c04a372c 00200200 c04a352c 
00000000 cfff4000 

[  144.886181] GPR24: 00000002 ffffffff 00000000 cfff403c cf85e000 c04b0000 
c0375eec 00000000 

[  144.887928] NIP [c0223464] dev_watchdog+0x30c/0x328
[  144.888141] LR [c0223464] dev_watchdog+0x30c/0x328
[  144.888365] Call Trace:
[  144.888701] [cfff5ee0] [c0223464] dev_watchdog+0x30c/0x328 (unreliable)
[  144.889069] [cfff5f50] [c0040510] run_timer_softirq+0x11c/0x23c
[  144.889292] [cfff5fb0] [c0039af8] __do_softirq+0xb4/0x164
[  144.889492] [cfff5ff0] [c000c174] call_do_softirq+0x14/0x24
[  144.889707] [c0397e80] [c0003fcc] do_softirq+0x80/0x8c
[  144.889901] [c0397ea0] [c0039518] irq_exit+0x54/0x6c
[  144.890092] [c0397eb0] [c0009668] timer_interrupt+0xa4/0xfc
[  144.890298] [c0397ec0] [c000cdf0] ret_from_except+0x0/0x18
[  144.890525] --- Exception: 901 at ppc44x_idle+0x10/0x20
[  144.890545]     LR = cpu_idle+0xd0/0xe0
[  144.890859] [c0397f80] [c0007490] cpu_idle+0x74/0xe0 (unreliable)
[  144.891087] [c0397fa0] [c00018c8] rest_init+0x8c/0xa4
[  144.891361] [c0397fc0] [c03487d0] start_kernel+0x260/0x2b4
[  144.891667] [c0397ff0] [c0000074] _start+0x74/0xb8
[  144.891894] Instruction dump:
[  144.892201] 3bc35eec 4bfffe90 38810008 7f83e378 38a00040 4bfe89f1 7fe6fb78 
7c651b78 

[  144.892568] 3c60c032 7f84e378 3863ce4c 4808b67d <0fe00000> 38000001 981d6a04 
4bffff90 

[  144.893734] Kernel panic - not syncing: Fatal exception in interrupt
[  144.893964] Call Trace:
[  144.894070] [cfff5c80] [c00063a8] show_stack+0x48/0x168 (unreliable)
[  144.894283] [cfff5cc0] [c02ae9a4] panic+0xac/0x1e4
[  144.894445] [cfff5d10] [c0009f20] die+0x1bc/0x1d0
[  144.894604] [cfff5d30] [c000a174] _exception+0xfc/0x118
[  144.894774] [cfff5e20] [c000cda4] ret_from_except_full+0x0/0x4c
[  144.894975] --- Exception: 700 at dev_watchdog+0x30c/0x328
[  144.894988]     LR = dev_watchdog+0x30c/0x328
[  144.895266] [cfff5f50] [c0040510] run_timer_softirq+0x11c/0x23c
[  144.895456] [cfff5fb0] [c0039af8] __do_softirq+0xb4/0x164
[  144.895631] [cfff5ff0] [c000c174] call_do_softirq+0x14/0x24
[  144.895823] [c0397e80] [c0003fcc] do_softirq+0x80/0x8c
[  144.896136] [c0397ea0] [c0039518] irq_exit+0x54/0x6c
[  144.896307] [c0397eb0] [c0009668] timer_interrupt+0xa4/0xfc
[  144.896486] [c0397ec0] [c000cdf0] ret_from_except+0x0/0x18
[  144.896669] --- Exception: 901 at ppc44x_idle+0x10/0x20
[  144.896682]     LR = cpu_idle+0xd0/0xe0
[  144.896938] [c0397f80] [c0007490] cpu_idle+0x74/0xe0 (unreliable)
[  144.897137] [c0397fa0] [c00018c8] rest_init+0x8c/0xa4
[  144.897305] [c0397fc0] [c03487d0] start_kernel+0x260/0x2b4
[  144.897482] [c0397ff0] [c0000074] _start+0x74/0xb8
[  144.897929] Rebooting in 180 seconds..
Lê Đức Tài - Aug. 4, 2011, 9:31 a.m.
On Aug 08, 2011 15:13, "Lê Đức Tài" <letai_dhqg@yahoo.com.vn> wrote:
Edgar Iglesias - Aug. 5, 2011, 12:22 a.m.
On Thu, Aug 04, 2011 at 05:31:37PM +0800, Lê Đức Tài wrote:
> On Aug 08, 2011 15:13, "Lê Đức Tài" <letai_dhqg@yahoo.com.vn> wrote:
> 
> 
> 
> ________________________________
> 
> 
> >  Hi Edgar,
> >  I have a problem with Ethernet Lite on Virtex board as following.
> >  Could you help me?
> >  Thank you!
> 
> 
> ________________________________
> 
> 
> Hi,
> I have just successful configured the Ethernet Lite :).
> The reason of my bug is interrupt controller of virtex different with  
> microblaze board.

Sweet. Would be nice if you could post a working example to the list as
reference. Please include patch to QEMU and patch to the dts, if
possible.

Cheers

Patch

diff --git a/arch/powerpc/boot/dts/virtex440-ml507.dts 
b/arch/powerpc/boot/dts/virtex440-ml507.dts
index 9cf6081..acc8406 100644
--- a/arch/powerpc/boot/dts/virtex440-ml507.dts
+++ b/arch/powerpc/boot/dts/virtex440-ml507.dts
@@ -155,6 +155,18 @@ 
                #size-cells = <1>;
                compatible = "xlnx,plb-v46-1.03.a", "simple-bus";
                ranges ;
+               ethernet@81000000 {
+                       compatible = "xlnx,xps-ethernetlite-1.00.a";
+                       device_type = "network";
+                       interrupt-parent = <&xps_intc_0>;
+                       interrupts = < 5 2 >;
+                       local-mac-address = [02 00 00 00 00 00];
+                       reg = <0x81000000 0x10000>;
+                       xlnx,duplex = <0x1>;
+                       xlnx,family = "spartan3adsp";
+                       xlnx,rx-ping-pong = <0x0>;
+                       xlnx,tx-ping-pong = <0x0>;
+               };
                DIP_Switches_8Bit: gpio@81460000 {
                        compatible = "xlnx,xps-gpio-1.00.a";
                        interrupt-parent = <&xps_intc_0>;


[Modify qemu - v0.15.0rc1]

diff --git a/hw/virtex_ml507.c b/hw/virtex_ml507.c
index 7bde8c7..4dea56a 100644
--- a/hw/virtex_ml507.c
+++ b/hw/virtex_ml507.c
@@ -232,6 +232,7 @@  static void virtex_init(ram_addr_t ram_size,
 
     /* 2 timers at irq 2 @ 62 Mhz.  */
     xilinx_timer_create(0x83c00000, irq[3], 2, 62 * 1000000);
+    xilinx_ethlite_create(&nd_table[0], 0x81000000, irq[5], 0, 0);
 
     if (kernel_filename) {
         uint64_t entry, low, high;