petalinux 2015.2.1 GEM驅動問題

kernel oops

使能了雙網口,GEM1的設備樹沒有配置phy node導致的

macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 145 (00:0a:02:f2:ab:aa)
macb e000b000.ethernet eth0: attached PHY driver [Atheros 8031 ethernet] (mii_bus:phy_addr=e000b000.etherne:01, irq=-1)
Unable to handle kernel NULL pointer dereference at virtual address 00000028
pgd = 40004000
[00000028] *pgd=00000000
Internal error: Oops - BUG: 17 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 1 PID: 1 Comm: swapper/0 Not tainted 3.19.0-xilinx #3
Hardware name: Xilinx Zynq Platform
task: 7d82c9c0 ti: 7d84e000 task.ti: 7d84e000
PC is at mutex_lock+0x10/0x4c
LR is at mdiobus_read+0x1c/0x44
pc : [<404893a4>]    lr : [<402d1944>]    psr: 600d0013
sp : 7d84fd80  ip : 7d84fdd0  fp : 7d9a0500
r10: 7d80d300  r9 : 00000000  r8 : 7d84fdac
r7 : 403a34a8  r6 : 00000002  r5 : 00000028  r4 : 00000028
r3 : 00000000  r2 : 00000002  r1 : 403a34a8  r0 : 00000028
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 18c5387d  Table: 3dbb004a  DAC: 00000015
Process swapper/0 (pid: 1, stack limit = 0x7d84e238)
Stack: (0x7d84fd80 to 0x7d850000)
fd80: 00000000 402d1944 00000000 7d9a0500 00000000 403a34a8 00000000 402d1688
fda0: 00000004 7d9a0000 7d8d2a10 00000000 00000000 00000000 00000000 00000000
fdc0: 00000000 00000000 00000000 00000000 7d9a0000 7d9a0500 00000000 7d9a0000
fde0: 7d80dc80 7d80dc80 00000000 7d80d300 7d9a0500 402d6ce4 7d8d2a00 7d80dc80
fe00: 7d80dc80 403a34a8 00000001 7d9a0000 7d8d2a10 7d8d2a00 7d80dc80 40671b88
fe20: 00000080 7d9a0000 7d9a0520 401060a0 00000000 00000001 00000008 7d9a0500
fe40: 7d8d0300 00000001 00000000 7d9a0520 406cd400 ffffffed 7d8d2a10 406bac38
fe60: 406bac38 00000000 406cd400 40683e94 00000000 40274e10 7d8d2a10 406f4ddc
fe80: 406bac38 402739c8 7d8d2a10 7d8d2a44 406bac38 406abb98 406996e0 40273bb4
fea0: 00000000 406bac38 40273b4c 402722ec 7d80fb5c 7d8b4334 406bac38 00000000
fec0: 7d9d6f00 4027328c 405d13e8 405d13e9 00000000 406bac38 4067150c 00000000
fee0: 406996e0 402740b8 00000000 406bac24 4067150c 40274e88 7db92880 4067150c
ff00: 00000000 400088e0 7d875180 40490c58 406d3f38 40683e70 00000000 400fe5e4
ff20: 405a9292 7d875400 4069d2b8 60000013 000000b4 7ffffe16 00000000 40035990
ff40: 000000b5 00000006 00000006 000000b4 4069d2a0 00000006 000000b5 00000006
ff60: 000000b5 4068ac8c 40683e8c 406cd400 406cd400 40657d3c 00000006 00000006
ff80: 406574fc 7d84e000 00000000 40483968 00000000 00000000 00000000 00000000
ffa0: 00000000 40483970 00000000 4000dd40 00000000 00000000 00000000 00000000
ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 ffffffff ffffffff
[<404893a4>] (mutex_lock) from [<402d1944>] (mdiobus_read+0x1c/0x44)
[<402d1944>] (mdiobus_read) from [<402d1688>] (get_phy_device+0x130/0x198)
[<402d1688>] (get_phy_device) from [<402d6ce4>] (macb_mii_init+0x1c8/0x308)
[<402d6ce4>] (macb_mii_init) from [<40671b88>] (macb_probe+0x664/0x7d0)
[<40671b88>] (macb_probe) from [<40274e10>] (platform_drv_probe+0x48/0x98)
[<40274e10>] (platform_drv_probe) from [<402739c8>] (driver_probe_device+0x8c/0x1cc)
[<402739c8>] (driver_probe_device) from [<40273bb4>] (__driver_attach+0x68/0x8c)
[<40273bb4>] (__driver_attach) from [<402722ec>] (bus_for_each_dev+0x6c/0x90)
[<402722ec>] (bus_for_each_dev) from [<4027328c>] (bus_add_driver+0xdc/0x1c4)
[<4027328c>] (bus_add_driver) from [<402740b8>] (driver_register+0x8c/0xd0)
[<402740b8>] (driver_register) from [<40274e88>] (__platform_driver_probe+0x20/0x94)
[<40274e88>] (__platform_driver_probe) from [<400088e0>] (do_one_initcall+0x100/0x180)
[<400088e0>] (do_one_initcall) from [<40657d3c>] (kernel_init_freeable+0x110/0x1d4)
[<40657d3c>] (kernel_init_freeable) from [<40483970>] (kernel_init+0x8/0xe4)
[<40483970>] (kernel_init) from [<4000dd40>] (ret_from_fork+0x14/0x34)
Code: e92d4010 e1a04000 f57ff05b f590f000 (e1903f9f) 
---[ end trace b13f75501ad3b839 ]---
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

CPU0: stopping
CPU: 0 PID: 0 Comm: swapper/0 Tainted: G      D        3.19.0-xilinx #3
Hardware name: Xilinx Zynq Platform
[<400147f0>] (unwind_backtrace) from [<40010d54>] (show_stack+0x10/0x14)
[<40010d54>] (show_stack) from [<40486d38>] (dump_stack+0x80/0xcc)
[<40486d38>] (dump_stack) from [<400131c8>] (ipi_cpu_stop+0x3c/0x6c)
[<400131c8>] (ipi_cpu_stop) from [<400137b0>] (handle_IPI+0x64/0x84)
[<400137b0>] (handle_IPI) from [<400085cc>] (gic_handle_irq+0x54/0x5c)
[<400085cc>] (gic_handle_irq) from [<40011700>] (__irq_svc+0x40/0x74)
Exception stack(0x4068ff60 to 0x4068ffa8)
ff60: ffffffed 00000000 00000000 4001c9c0 4068e000 00000000 00000000 4068ffb0
ff80: 4048def0 7ffffdc0 00000000 ffffffed 00000001 4068ffa8 4000e7d4 4000e7d8
ffa0: 600d0013 ffffffff
[<40011700>] (__irq_svc) from [<4000e7d8>] (arch_cpu_idle+0x2c/0x38)
[<4000e7d8>] (arch_cpu_idle) from [<40048c94>] (cpu_startup_entry+0xcc/0x1e8)
[<40048c94>] (cpu_startup_entry) from [<40657bcc>] (start_kernel+0x324/0x384)
[<40657bcc>] (start_kernel) from [<00008074>] (0x8074)
---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

link up但是ping不通

設備樹配phy node配置錯誤,

[email protected] {
        compatible = "xlnx,ps7-ethernet-1.00.a";
        reg = <0xe000b000 0x1000>;
        status = "okay";
        interrupts = <0x0 0x16 0x4>;
        clocks = <0x1 0x1e 0x1 0x1e 0x1 0xd>;
        clock-names = "pclk", "hclk", "tx_clk";
        #address-cells = <0x1>;
        #size-cells = <0x0>;
        phy-mode = "rgmii-id";
        xlnx,ptp-enet-clock = <0x69f6bcb>;
        local-mac-address = [00 0a 35 00 1e 53];
        xlnx,has-mdio = <0x1>;
        phy-handle = <0x4>;

        mdio {
                #address-cells = <0x1>;
                #size-cells = <0x0>;

                [email protected]1 {
                        compatible = "atheros, at803x";
                        device_type = "ethernet-phy";
                        reg = <0x1>;
                        reset-gpio = <0x5 0x2f 0x0>;
                        linux,phandle = <0x4>;
                        phandle = <0x4>;
                };

                [email protected]3 {
                        compatible = "atheros, at803x";
                        device_type = "ethernet-phy";
                        reg = <0x3>;
                        linux,phandle = <0x6>;
                        phandle = <0x6>;
                };
        };
};

fixed phy

ti-linux-kernel的cpsw驅動不支持fixed-link
I.MX6 PHY fixup 調用流程 hacking

ping不通

內核打印,FPGA時鐘設置不對。

xemacps e000c000.ethernet: Set clk to 0 Hz
xemacps e000c000.ethernet: link up (1000/FULL)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章