Device-Tree for eth network based on marvell mv88e6390x crashes Xilinx's linux-kernel v5.4

1

This is my system's network topology. It relies on Xilinx's Zynq-7000 SoC.

zynq-7000    'switch0'       'switch1'
 (cpu)       mv88e6390x    mv88e6390x
-------      ---------     ---------
|     |      |       |     |       |
| gem0|------|p0  p10|-----|p10    |
|     |      |       |     |       |
|     |      ---------     ---------
|     |         |mdio_addr=2   | mdio_addr=3
|     |         |              |
|     |-------------------------
|     |    |                 
|     |    |             mv88e1510('debug_phy')
|     |    |  mdio_addr=1 --------
|     |    ---------------|      | 
|     |                   |      | 
| gem1|-------------------|      |
|     |                   |      |
|     |                   --------
-------                   

I have built a Linux kernel for it and its ethernet network defined in the devicetree (*.dts file) as follows (arch/arm/boot/dts/zynq-zed.dts gem0 and gem1):

&gem0 {
    status = "okay";
    phy-mode = "rgmii-id"; 
    phy-handle = <&phy0>;

    mdio {
        #address-cells = <1>;
        #size-cells = <0>;
    
        phy0: ethernet-phy@0 {
            compatible = "marvell";
            reg = <0>;
            device_type = "ethernet-phy";
            fixed-link {
                speed = <1000>;
                full-duplex;
            };
        };

        debug_phy: ethernet-phy@1 {
        compatible = "marvell";
        reg = <1>;
        device_type = "ethernet-phy"; 
        label = "debug-phy";
    };

        switch0: switch@2 {
            compatible = "marvell,mv88e6190";
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <2>;

            dsa,member = <0 0>;

            ports {
                #address-cells = <1>;
                #size-cells = <0>;

                switch0phy1: port@0 {
                    reg = <0>;
                    label = "uid208-cpu";
                    ethernet = <&gem0>;
                    phy-mode = "rgmii-id";
                    fixed-link {
                        speed = <1000>;
                        full-duplex;
                    };
                };


                port@1 {
                    reg = <1>;
                    label = "uid201-1A";
                };
                
                port@2 {
                    reg = <2>;
                    label = "uid202-2A-p9-1A";
                    phy-mode = "1000base-x";
                    fixed-link {
                        speed = <1000>;
                        full-duplex;
                    };
                };

                port@3 {
                    reg = <3>;
                    label = "uid203-3A-p9-2A";
                    phy-mode = "1000base-x";
                    fixed-link {
                        speed = <1000>;
                        full-duplex;
                    };
                };
                
                port@4 {
                    reg = <4>;
                    label = "uid204-4A-p9-3A";
                    phy-mode = "1000base-x";
                    fixed-link {
                        speed = <1000>;
                        full-duplex;
                    };
                };

                port@5 {
                    reg = <5>;
                    label = "uid205-5A";
                };
                
                port@6 {
                    reg = <6>;
                    label = "uid206-6A";
                };

                port@7 {
                    reg = <7>;
                    label = "uid207-7A";
                };
                
                port@8 {
                    reg = <8>;
                    label = "uid208-8A";
                };

                port@9 {
                    reg = <9>;
                    label = "uid209-9A-p9-0A";
                    phy-mode = "1000base-x";
                    fixed-link {
                        speed = <1000>;
                        full-duplex;
                    };
                };          

                switch0port10: port@10 {
                    reg = <10>;
                    label = "dsa";
                    link = <&switch1port10>; 
                    phy-mode = "1000base-x";
                    fixed-link {
                        speed = <1000>;
                        full-duplex;
                    };
                };
            };
        };

        switch1: switch@3 {
            compatible = "marvell,mv88e6190";
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <3>;

            dsa,member = <0 1>;

            ports {
                #address-cells = <1>;
                #size-cells = <0>;

                port@1 {
                    reg = <1>;
                    label = "uid211-1B";
                };

                port@2 {
                    reg = <2>;
                    label = "uid212-2B-p9-1B";
                    phy-mode = "1000base-x";
                    fixed-link {
                        speed = <1000>;
                        full-duplex;
                    };
                };

                port@3 {
                    reg = <3>;
                    label = "uid213-3B-p9-2B";
                    phy-mode = "1000base-x";
                    fixed-link {
                        speed = <1000>;
                        full-duplex;
                    };
                };

                port@4 {
                    reg = <4>;
                    label = "uid214-4B-p9-3B";
                    phy-mode = "1000base-x";
                    fixed-link {
                        speed = <1000>;
                        full-duplex;
                    };
                };

                port@5 {
                    reg = <5>;
                    label = "uid215-5B";
                };

                port@6 {
                    reg = <6>;
                    label = "uid216-6B";
                };

                port@7 {
                    reg = <7>;
                    label = "uid217-7B";
                };

                port@8 {
                    reg = <8>;
                    label = "uid218-8B";
                };

                port@9 {
                    reg = <9>;
                    label = "uid219-9B-p9-0B";
                    phy-mode = "1000base-x";
                    fixed-link {
                        speed = <1000>;
                        full-duplex;
                    };
                };

                switch1port10: port@10 {
                    reg = <10>;
                    label = "dsa";
                    link = <&switch0port10>; 
                    phy-mode = "1000base-x";
                    fixed-link {
                        speed = <1000>;
                        full-duplex;
                    };
                };
            };
            };
    };
};
&gem1 {
    status = "okay";
    phy-mode = "rgmii-id";
    phy-handle = <&debug_phy>;
};

When Linux starts it crashes and I get this startup log:

Starting kernel ...
...
[    1.781124] libphy: Fixed MDIO Bus: probed
[    1.785977] CAN device driver interface
[    1.791099] libphy: MACB_mii_bus: probed
[    1.830217] mv88e6085 e000b000.ethernet-ffffffff:02: switch 0xa10 detected: Marvell 88E6390X, revision 1
[   20.610623] libphy: mv88e6xxx SMI: probed
[   21.870637] mv88e6085 e000b000.ethernet-ffffffff:03: switch 0xa10 detected: Marvell 88E6390X, revision 1
[   40.660628] libphy: mv88e6xxx SMI: probed
[   40.665129] 8<--- cut here ---
[   40.668195] Unable to handle kernel NULL pointer dereference at virtual address 00000004
[   40.676313] pgd = (ptrval)
[   40.679023] [00000004] *pgd=00000000
[   40.682616] Internal error: Oops - BUG: 17 [#1] PREEMPT SMP ARM
[   40.688541] Modules linked in:
[   40.691606] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.4.0-MESC #6
[   40.697872] Hardware name: Xilinx Zynq Platform
[   40.702413] PC is at dsa_unregister_switch+0x10/0x74
[   40.707389] LR is at atomic_cmpxchg_relaxed+0xc/0x28
[   40.712359] pc : [<c05ab9cc>]    lr : [<c014d814>]    psr: 600a0013
[   40.718628] sp : df443d38  ip : 00000000  fp : 00000000
[   40.723851] r10: df5c8000  r9 : dfbe9544  r8 : df5cc000
[   40.729076] r7 : 00000000  r6 : 00000000  r5 : 00000000  r4 : df430040
[   40.735606] r3 : 84bd7c9b  r2 : 84bd7c9b  r1 : 00000000  r0 : 00000001
[   40.742144] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[   40.749288] Control: 18c5387d  Table: 1eca004a  DAC: 00000051
[   40.755040] Process swapper/0 (pid: 1, stack limit = 0x(ptrval))
[   40.761047] Stack: (0xdf443d38 to 0xdf444000)
[   40.765404] 3d20:                                                       df430040 c091d718
[   40.773595] 3d40: 00000000 c042c980 dec76800 c042572c dec76800 c03cb4a4 dec76800 df481030
[   40.781789] 3d60: c091b230 dec73878 df5cc000 c03ca1e8 dec76800 dec76844 c0903c48 c03c7108
[   40.789982] 3d80: dec73ac4 c0425030 a00a0013 dec73a50 dec73ac4 84bd7c9b dec76800 dec76800
[   40.798176] 3da0: dec73a54 dec73ac4 df5cc000 c0425674 dec73800 c0425024 df5cc000 df5c8000
[   40.806370] 3dc0: ffffffed df5c8500 df5cc000 c043ac2c 00000009 df443e08 c0903c48 c05eb2fc
[   40.814564] 3de0: df477810 dfbe9544 c04375cc 00000001 c0903c48 00000002 dec09240 dec09200
[   40.822757] 3e00: dec091c0 00000000 00000000 c0703595 dec13000 84bd7c9b 00000000 00000000
[   40.830951] 3e20: df477810 c091d85c 00000000 c091d85c 00000000 fffffdfb 00000000 c03cc6d0
[   40.839145] 3e40: df477810 c09482a0 00000000 c03cad04 df477810 c091d85c c091d85c c03cb2fc
[   40.847339] 3e60: c092b340 c092b340 c082c83c c03cb110 c091d85c df477810 84bd7c9b 00000000
[   40.855533] 3e80: df477810 c091d85c c03cb2fc c092b340 c092b340 c03cb2e4 00000000 df477810
[   40.863728] 3ea0: c091d85c c03cb3a8 df477810 c0903c48 c091d85c c03c93b8 c092b340 df4bff58
[   40.871921] 3ec0: df497834 84bd7c9b df4bff6c c091d85c 00000000 dec12780 c09182c0 c03ca2d4
[   40.880115] 3ee0: c0715044 c0715045 00000000 c091d85c c0903c48 c081c028 00000000 c03cba60
[   40.888309] 3f00: 00000006 c0903c48 c081c028 c01026e0 00000000 df443f18 00000000 c0800500
[   40.896502] 3f20: c07880fc 000000ac 00000006 00000006 00000000 c090b3e0 00000000 cccccccd
[   40.904696] 3f40: 00000000 00000000 c092b340 84bd7c9b 00000000 00000006 c082c830 84bd7c9b
[   40.912890] 3f60: 00000006 c082c834 000000ac c0835470 c092b340 c0800e38 00000006 00000006
[   40.921083] 3f80: 00000000 c0800508 00000000 c05e8294 00000000 00000000 00000000 00000000
[   40.929277] 3fa0: 00000000 c05e829c 00000000 c01010e8 00000000 00000000 00000000 00000000
[   40.937470] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   40.945664] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[   40.953876] [<c05ab9cc>] (dsa_unregister_switch) from [<c042c980>] (mv88e6xxx_remove+0x1c/0x6c)
[   40.962602] [<c042c980>] (mv88e6xxx_remove) from [<c042572c>] (mdio_remove+0x1c/0x38)
[   40.970457] [<c042572c>] (mdio_remove) from [<c03cb4a4>] (device_release_driver_internal+0xf0/0x194)
[   40.979612] [<c03cb4a4>] (device_release_driver_internal) from [<c03ca1e8>] (bus_remove_device+0xcc/0xdc)
[   40.989201] [<c03ca1e8>] (bus_remove_device) from [<c03c7108>] (device_del+0x170/0x288)
[   40.997227] [<c03c7108>] (device_del) from [<c0425674>] (mdio_device_remove+0xc/0x18)
[   41.005073] [<c0425674>] (mdio_device_remove) from [<c0425024>] (mdiobus_unregister+0x50/0x84)
[   41.013714] [<c0425024>] (mdiobus_unregister) from [<c043ac2c>] (macb_probe+0x88c/0xa68)
[   41.021834] [<c043ac2c>] (macb_probe) from [<c03cc6d0>] (platform_drv_probe+0x48/0x98)
[   41.029771] [<c03cc6d0>] (platform_drv_probe) from [<c03cad04>] (really_probe+0x140/0x2f8)
[   41.038060] [<c03cad04>] (really_probe) from [<c03cb110>] (driver_probe_device+0x10c/0x154)
[   41.046427] [<c03cb110>] (driver_probe_device) from [<c03cb2e4>] (device_driver_attach+0x44/0x5c)
[   41.055316] [<c03cb2e4>] (device_driver_attach) from [<c03cb3a8>] (__driver_attach+0xac/0xb8)
[   41.063856] [<c03cb3a8>] (__driver_attach) from [<c03c93b8>] (bus_for_each_dev+0x64/0xa0)
[   41.072049] [<c03c93b8>] (bus_for_each_dev) from [<c03ca2d4>] (bus_add_driver+0xdc/0x1bc)
[   41.080244] [<c03ca2d4>] (bus_add_driver) from [<c03cba60>] (driver_register+0xb0/0xf8)
[   41.088266] [<c03cba60>] (driver_register) from [<c01026e0>] (do_one_initcall+0x74/0x164)
[   41.096469] [<c01026e0>] (do_one_initcall) from [<c0800e38>] (kernel_init_freeable+0x108/0x1d8)
[   41.105192] [<c0800e38>] (kernel_init_freeable) from [<c05e829c>] (kernel_init+0x8/0x110)
[   41.113391] [<c05e829c>] (kernel_init) from [<c01010e8>] (ret_from_fork+0x14/0x2c)
[   41.120968] Exception stack(0xdf443fb0 to 0xdf443ff8)
[   41.126025] 3fa0:                                     00000000 00000000 00000000 00000000
[   41.134220] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   41.142413] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[   41.149041] Code: e92d4070 e1a05000 e59f005c eb00fe3e (e9950030)
[   41.155231] ---[ end trace cd979b1341b3aaf9 ]---
[   41.159878] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[   41.167553] CPU0: stopping
[   41.170269] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G      D           5.4.0-MESC #6
[   41.177934] Hardware name: Xilinx Zynq Platform
[   41.182488] [<c010e2a8>] (unwind_backtrace) from [<c010a2d8>] (show_stack+0x10/0x14)
[   41.190259] [<c010a2d8>] (show_stack) from [<c05d44bc>] (dump_stack+0xb4/0xd4)
[   41.197502] [<c05d44bc>] (dump_stack) from [<c010c878>] (ipi_cpu_stop+0x3c/0x98)
[   41.204914] [<c010c878>] (ipi_cpu_stop) from [<c010d0d8>] (handle_IPI+0x6c/0x90)
[   41.212326] [<c010d0d8>] (handle_IPI) from [<c031954c>] (gic_handle_irq+0x84/0x90)
[   41.219911] [<c031954c>] (gic_handle_irq) from [<c0101a8c>] (__irq_svc+0x6c/0xa8)
[   41.227402] Exception stack(0xc0901f18 to 0xc0901f60)
[   41.232457] 1f00:                                                       00000000 dfbcc8b4
[   41.240647] 1f20: 00000000 c01164a0 00000000 00000000 c0900000 00000001 c0903c68 c083c500
[   41.248841] 1f40: c0901f70 c082ca3c 00000008 c0901f68 c0107850 c0107854 600a0013 ffffffff
[   41.257042] [<c0101a8c>] (__irq_svc) from [<c0107854>] (arch_cpu_idle+0x2c/0x38)
[   41.264463] [<c0107854>] (arch_cpu_idle) from [<c013ee98>] (do_idle+0xfc/0x260)
[   41.271794] [<c013ee98>] (do_idle) from [<c013f158>] (cpu_startup_entry+0x18/0x20)
[   41.279379] [<c013f158>] (cpu_startup_entry) from [<c0800c9c>] (start_kernel+0x380/0x414)
[   41.287571] [<c0800c9c>] (start_kernel) from [<00000000>] (0x0)
[   41.293503] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]---

Commenting 'gem0' and 'gem1' fixes the crash without setting-up the network.

What should be fixed in my dts/dtsi?

linux-kernel
embedded-linux
xilinx
device-tree
dsa
asked on Stack Overflow Oct 11, 2020 by Michael Alayev • edited Oct 18, 2020 by Michael Alayev

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0