This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CPSW PHY KSZ8041 ALIGN/CODE ERROR

Other Parts Discussed in Thread: TPS65217

Hi,

In my board,AM335x CPSW module connects a PHY KSZ8041 ,and link up,send and receive seccessed.

but I find that sometimes the CPSW_STATS  register 【14.3.2.20.1.6   Rx Align/Code Errors (Offset = 14h) 】was updated.

Thanks in advance,

YanTCK

  • Are you operating CPSW and KSZ8041 in MII mode or RMII mode?  If RMII mode, are you using an external 50MHz clock or AM335x to source the RMII reference clock? 

    Please select the Silicon Errata link from the AM335x product folder page which is located at the following URL and read Advisory 1.0.16.

    http://www.ti.com/product/am3358

    Regards,
    Paul

  • Hi,peaves

    You got it,it is the clock.

    I disable the PLL clock ,select the chip pin ,and it works OK.

    Thank you

    YanTCK

  • Hi Yan,

    I was reading your post above; I am currently in the same problem using Micrel KSZ8081RNACA chip for ether net with two ports
    and chip seems to be not responding; I made various setting in the dtb/dbs tree or even at uboot level adjusting cpws structure, all avail.
    Following is details log from kernel and device tree settings.
    I will be grateful if you please observe and give your first hand opinion what is wrong?
    Thank you,

    CURRENTLY am335x-boneblack.dtb contents... only ether net section....

    ethernet@4a100000 {
    compatible = "ti,cpsw";
    ti,hwmods = "cpgmac0";
    clocks = <0x35 0x36>;
    clock-names = "fck", "cpts";
    cpdma_channels = <0x8>;
    ale_entries = <0x400>;
    bd_ram_size = <0x2000>;
    no_bd_ram = <0x0>;
    rx_descs = <0x40>;
    mac_control = <0x20>;
    slaves = <0x2>;
    active_slave = <0x1>;
    cpts_clock_mult = <0x80000000>;
    cpts_clock_shift = <0x1d>;
    reg = <0x4a100000 0x800 0x4a101200 0x100>;
    #address-cells = <0x1>;
    #size-cells = <0x1>;
    interrupt-parent = <0x1>;
    interrupts = <0x28 0x29 0x2a 0x2b>;
    ranges;
    syscon = <0x2f>;
    status = "okay";
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <0x37>;
    pinctrl-1 = <0x38>;

    mdio@4a101000 {
    compatible = "ti,davinci_mdio";
    #address-cells = <0x1>;
    #size-cells = <0x0>;
    ti,hwmods = "davinci_mdio";
    bus_freq = <0xf4240>;
    reg = <0x4a101000 0x100>;
    status = "okay";
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <0x39>;
    pinctrl-1 = <0x3a>;
    linux,phandle = <0x3b>;
    phandle = <0x3b>;
    };
    slave@4a100200 {
    mac-address = [00 00 00 00 00 00];
    phy_id = <0x3b 0x0>;
    phy-mode = "rmii";
    };

    slave@4a100300 {
    mac-address = [00 00 00 00 00 00];
    phy_id = <0x3b 0x3>; <-----------------------------Modification implemented here.
    phy-mode = "rmii";
    };

    cpsw-phy-sel@44e10650 {
    compatible = "ti,am3352-cpsw-phy-sel";
    reg = <0x44e10650 0x4>;
    reg-names = "rmii-sel";
    rmii-ref;
    };
    };

    KERNEL LOG

    [ 2.305710] mousedev: PS/2 mouse device common for all mice
    [ 2.311656] i2c /dev entries driver
    [ 2.320080] omap_hsmmc 48060000.mmc: Got CD GPIO
    [ 2.405224] ledtrig-cpu: registered to indicate activity on CPUs
    [ 2.415065] oprofile: using arm/armv7
    [ 2.420999] Initializing XFRM netlink socket
    [ 2.426160] NET: Registered protocol family 17
    [ 2.431077] NET: Registered protocol family 15
    [ 2.436877] Key type dns_resolver registered
    [ 2.441882] omap_voltage_late_init: Voltage driver support not added
    [ 2.448763] sr_dev_init: No voltage domain specified for smartreflex0. Cannot initialize
    [ 2.457374] sr_dev_init: No voltage domain specified for smartreflex1. Cannot initialize
    [ 2.469023] ThumbEE CPU extension supported.
    [ 2.473635] Registering SWP/SWPB emulation handler
    [ 2.478916] SmartReflex Class3 initialized
    [ 2.502332] mmc0: host does not support reading read-only switch, assuming write-enable
    [ 2.524233] mmc0: new high speed SDHC card at address b368
    [ 2.546816] mmcblk0: mmc0:b368 USD 3.71 GiB
    [ 2.562923] mmcblk0: p1 p2
    [ 2.574196] tps65217 0-0024: Read from reg 0x16 failed
    [ 2.579655] vdds_dpr: failed to enable
    [ 2.592625] tps65217 0-0024: failed to register tps65217-pmic regulator
    [ 2.600007] tps65217-pmic: probe of tps65217-pmic failed with error -121
    [ 2.619569] tps65217 0-0024: Failed to read revision register: -121
    [ 2.628282] tps65217: probe of 0-0024 failed with error -121
    [ 2.636028] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
    [ 2.658698] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz
    [ 2.744139] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
    [ 2.750608] davinci_mdio 4a101000.mdio: detected phy mask fffffff6
    [ 2.771034] libphy: 4a101000.mdio: probed
    [ 2.775601] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver unknown
    [ 2.784144] davinci_mdio 4a101000.mdio: phy[3]: device 4a101000.mdio:03, driver unknown
    [ 2.795638] cpsw-phy-sel 44e10650.cpsw-phy-sel: invalid resource
    [ 2.802240] cpsw-phy-sel: probe of 44e10650.cpsw-phy-sel failed with error -22
    [ 2.810875] cpsw 4a100000.ethernet: Detected MACID = 68:c9:0b:7c:e1:a1
    [ 2.826378] hctosys: unable to open rtc device (rtc0)
    [ 2.831761] sr_init: No PMIC hook to init smartreflex
    [ 2.837949] sr_init: platform driver register failed for SR
    [ 2.954203] EXT4-fs (mmcblk0p2): mounted filesystem without journal. Opts: (null)
    [ 2.962613] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
    [ 2.989835] devtmpfs: mounted
    [ 2.995773] Freeing unused kernel memory: 432K (c0846000 - c08b2000)
    [ 3.343312] EXT4-fs (mmcblk0p2): warning: mounting unchecked fs, running e2fsck is recommended
    [ 3.362660] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
    Starting logging: OK
    Initializing random number generator... [ 4.011504] random: dd urandom read with 11 bits of entropy available
    done.
    Starting network...
    /etc/init.d/S93-am335x-pm-firmware-load: line 4: can't create /sys/devices/ocp.2/44d00000.wkup_m3/firmware/am335x-pm-firmware.bin/loading: nonexistent y
    /etc/init.d/S93-am335x-pm-firmware-load: line 5: can't create /sys/devices/ocp.2/44d00000.wkup_m3/firmware/am335x-pm-firmware.bin/data: nonexistent diry
    /etc/init.d/S93-am335x-pm-firmware-load: line 6: can't create /sys/devices/ocp.2/44d00000.wkup_m3/firmware/am335x-pm-firmware.bin/loading: nonexistent y

    gwcs1x login: [ 8.432265] EXT4-fs error (device mmcblk0p2): ext4_mb_generate_buddy:758: group 16, block bitmap and bg descriptor inconsistent: 32251s
    [ 8.505515] EXT4-fs error (device mmcblk0p2): ext4_mb_generate_buddy:758: group 17, block bitmap and bg descriptor inconsistent: 31328 vs 31124 frees

    ETHER NET DRIVER KSZ8081 DRIVER CRASH
    =====================================
    gwcs1x login: root
    # insmod ksz8081.ko
    # ifconfig eth0 192.168.1.12 up
    [ 54.859759] net eth0: initializing cpsw version 1.12 (0)
    [ 54.944608] net eth0: phy found : id is : 0x221560
    [ 54.950098] Unable to handle kernel NULL pointer dereference at virtual address 00000084
    [ 54.958847] pgd = de530000
    [ 54.961722] [00000084] *pgd=9e50b831, *pte=00000000, *ppte=00000000
    [ 54.968509] Internal error: Oops: 17 [#1] SMP ARM
    [ 54.973477] Modules linked in: ksz8081(O)
    [ 54.977762] CPU: 0 PID: 79 Comm: ifconfig Tainted: G O 4.2.0-rc6-gec3fe91-dirty #2
    [ 54.986924] Hardware name: Generic AM33XX (Flattened Device Tree)
    [ 54.993342] task: de4e3140 ti: de490000 task.ti: de490000
    [ 54.999068] PC is at cpsw_phy_sel+0x3c/0x70
    [ 55.003501] LR is at bus_find_device+0x78/0x8c
    [ 55.008195] pc : [<c0486380>] lr : [<c03e0828>] psr: 600d0013
    [ 55.008195] sp : de491dc0 ip : de4e3160 fp : 00000000
    [ 55.020264] r10: 00000000 r9 : de511740 r8 : 00000000
    [ 55.025770] r7 : de425600 r6 : 00000006 r5 : 00000000 r4 : de14b410
    [ 55.032646] r3 : 3f6baba8 r2 : 00000000 r1 : 00000006 r0 : 00000000
    [ 55.039533] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
    [ 55.047040] Control: 10c5387d Table: 9e530019 DAC: 00000015
    [ 55.053094] Process ifconfig (pid: 79, stack limit = 0xde490218)
    [ 55.059419] Stack: (0xde491dc0 to 0xde492000)
    [ 55.064027] 1dc0: de425000 00000002 de4772f4 c0489290 00000000 00000003 00000000 c05a55a8
    [ 55.072645] 1de0: 00000000 00000000 c05a5488 c0089afc 00000000 c095ffdc c095a4ac fffffff8
    [ 55.081268] 1e00: 00000000 00000000 de491e4c de511740 0000000d c005ec78 ffffffff de425000
    [ 55.089882] 1e20: 00001043 c063d6e0 00001002 00000000 00000000 c005ecd4 00000000 de425000
    [ 55.098502] 1e40: 00000000 c063d6e0 de425030 00000000 00000000 c04fea5c c04fe9c0 de425000
    [ 55.107117] 1e60: 00001043 00000001 00001002 c04feccc de425000 00000140 00001002 00000000
    [ 55.115745] 1e80: 00000000 c04fedb0 de511740 de471a0c bea71ba0 00000000 00008914 c056bb68
    [ 55.124365] 1ea0: 00000020 de471a00 de471a0c de425000 30687465 00000000 00000000 00000000
    [ 55.132987] 1ec0: 00001043 0c01a8c0 00000001 00000000 00000000 00008914 ddab4040 bea71ba0
    [ 55.141611] 1ee0: c0959340 00008914 de490000 ddab4060 bea71ba0 c04dfb88 c04dfb18 c0175ec8
    [ 55.150228] 1f00: de0322c0 00000003 bea71ba0 c017582c c0065464 de186018 de4e3140 de4e3140
    [ 55.158849] 1f20: dfa1c590 00000000 de4ad800 c0967d48 dfa1c580 de184ec0 de491f8c c05e76f4
    [ 55.167460] 1f40: de4d0d98 c01439fc 00100073 00000000 00000000 c05e7d88 00000000 00000000
    [ 55.176072] 1f60: c5bd2670 de0322c0 de0322c0 00000000 bea71ba0 00008914 de490000 00000003
    [ 55.184689] 1f80: 000be008 c0175ec8 0009e39a 0009e39a bea71ba0 bea71d8c 00000036 c000f7c4
    [ 55.193311] 1fa0: 00000000 c000f5e0 0009e39a bea71ba0 00000003 00008914 bea71ba0 0009e39a
    [ 55.201929] 1fc0: 0009e39a bea71ba0 bea71d8c 00000036 0008b5a8 00000003 bea71eaa 000be008
    [ 55.210544] 1fe0: 000bb2d8 bea71b3c 00017c7c b6eedc26 200d0030 00000003 b7df5ffe 533f7fff
    [ 55.219186] [<c0486380>] (cpsw_phy_sel) from [<c0489290>] (cpsw_ndo_open+0x9c/0x608)
    [ 55.227362] [<c0489290>] (cpsw_ndo_open) from [<c04fea5c>] (__dev_open+0x9c/0x104)
    [ 55.235347] [<c04fea5c>] (__dev_open) from [<c04feccc>] (__dev_change_flags+0x88/0x14c)
    [ 55.243786] [<c04feccc>] (__dev_change_flags) from [<c04fedb0>] (dev_change_flags+0x18/0x48)
    [ 55.252695] [<c04fedb0>] (dev_change_flags) from [<c056bb68>] (devinet_ioctl+0x67c/0x774)
    [ 55.261327] [<c056bb68>] (devinet_ioctl) from [<c04dfb88>] (sock_ioctl+0x70/0x2cc)
    [ 55.269319] [<c04dfb88>] (sock_ioctl) from [<c017582c>] (do_vfs_ioctl+0x78/0x6b0)
    [ 55.277215] [<c017582c>] (do_vfs_ioctl) from [<c0175ec8>] (SyS_ioctl+0x64/0x74)
    [ 55.284939] [<c0175ec8>] (SyS_ioctl) from [<c000f5e0>] (ret_fast_syscall+0x0/0x54)
    [ 55.292926] Code: e59f0034 ebfd690d e1a01006 e1a02005 (e5903084)
    [ 55.299543] ---[ end trace 172496384e6a3643 ]---
    Segmentation fault
    # [ 170.943936] random: nonblocking pool is initialized
    [ 303.843925] EXT4-fs (mmcblk0p2): error count since last fsck: 273
    [ 303.850385] EXT4-fs (mmcblk0p2): initial error at time 3: ext4_mb_generate_buddy:758
    [ 303.858564] EXT4-fs (mmcblk0p2): last error at time 8: ext4_mb_generate_buddy:758

    Thank you,
    IK