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.

AM3358: Ethernet PHY not detected with KSZ8863RLL Switch

Part Number: AM3358

Hello,

We are using ksz8863rll ethernet switch with AM3358 Processor in our custom board. It is connected with CPU in rmii mode. We have used MDIO bus for communication between ksz8863rll and am3358 for configuration. We are able to detect eth0 and got the ip but phy is not detected. We are getting below error:

  

Below is the dts file of our board:

mdio_pins_default: mdio_pins_default {
	pinctrl-single,pins = <
		AM33XX_IOPAD(0x94c, PIN_OUTPUT_PULLUP | MUX_MODE0) /* (R19) mdio_clk.mdio_clk */
		AM33XX_IOPAD(0x948, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* (P17) mdio_data.mdio_data */
	>;
};

phy_rmii_pins_default: phy_rmii_pins_default {
    pinctrl-single,pins = <
        AM33XX_IOPAD(0x90c, PIN_INPUT_PULLDOWN | MUX_MODE1) /* (J18) gmii1_crs.rmii1_crs_dv */
        AM33XX_IOPAD(0x910, PIN_INPUT_PULLDOWN | MUX_MODE1) /* (K19) gmii1_rxer.rmii1_rxer */
        AM33XX_IOPAD(0x914, PIN_OUTPUT | MUX_MODE1) /* (K17) gmii1_txen.rmii1_txen */
        AM33XX_IOPAD(0x928, PIN_OUTPUT | MUX_MODE1) /* (L18) gmii1_txd0.rmii1_txd0 */
        AM33XX_IOPAD(0x924, PIN_OUTPUT | MUX_MODE1) /* (M18) gmii1_txd1.rmii1_txd1 */
        AM33XX_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE1) /* (P18) gmii1_rxd0.rmii1_rxd0 */
        AM33XX_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE1) /* (P19) gmii1_rxd1.rmii1_rxd1 */
        AM33XX_IOPAD(0x944, PIN_INPUT_PULLDOWN | MUX_MODE0) /* (K18) rmii1_refclk.rmii1_refclk */
    >;
};
  
eth_gpio: eth_gpio {
    pinctrl-single,pins = <
      AM33XX_IOPAD(0x934, PIN_OUTPUT_PULLUP | MUX_MODE7) /* (N17) gmii1_rxd3.gpio2[18] <ETHERNET_RESET> */
      AM33XX_IOPAD(0x9b4, PIN_INPUT | MUX_MODE7) /* (B15) xdma_event_intr1.gpio0[20] <INTR_ETH>*/
    >;
};
  
&mac {
    pinctrl-names = "default";
    pinctrl-0 = <&phy_rmii_pins_default>;
    vmmc-supply = <&switch_vmmc>;
    phy-mode = "rmii";
    status = "okay";
    slaves = <1>;
    
    fixed-link {
        speed = <100>;
        full-duplex;
    };
};

&davinci_mdio {
    vmmc-supply = <&switch_vmmc>;
    pinctrl-names = "default";
    pinctrl-0 = <&mdio_pins_default &eth_gpio>;
    status = "okay";
    reset-gpios = <&gpio2 18 GPIO_ACTIVE_HIGH>; //gpio2_18
    interrupt-parent = <&gpio0>;
    interrupts = <20 IRQ_TYPE_LEVEL_LOW>; //gpio0_20
    
    ksz8863: ksz8863@0 {
        vmmc-supply = <&switch_vmmc>;
        compatible = "microchip,ksz8863";
        reg = <0>;
        phy-mode = "rmii";

 

        status = "okay";
        ports {
            #address-cells = <1>;
            #size-cells = <0>;
            port@0 {
                reg = <0>;
                label = "lan1";
            };
            port@1 {
                reg = <1>;
                label = "lan2";
            };
            port@3 {
                reg = <2>;
                label = "cpu";
                ethernet = <&mac>;
                fixed-link {
                    speed = <100>;
                    full-duplex;
                };
            };
        };
    };
};

&cpsw_emac0 {
    status = "okay";
    phy-handle = <&ksz8863>, <0>;
    phy-mode = "rmii";
};

switch_vmmc: fixedregulator@3 {
    compatible = "regulator-fixed";
    regulator-name = "sw-ksz8863";
    regulator-min-microvolt = <3300000>;
    regulator-max-microvolt = <3300000>;
    startup-delay-us = <70000>;
    regulator-always-on;
};

Below is dmesg logs of kernel bootup:

root@am335x-evm:~# dmesg
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.19.94-gebb98fec06 (oe-user@oe-host) (gcc version 8.3.0 (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36))) #1 PREEMPT Wed Aug 25 05:42:07 UTC 2021
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: TI AM335x EVM-SK
[    0.000000] Memory policy: Data cache writeback
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 48 MiB at 0xbd000000
[    0.000000] On node 0 totalpages: 262144
[    0.000000]   Normal zone: 1728 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 196608 pages, LIFO batch:63
[    0.000000]   HighMem zone: 65536 pages, LIFO batch:15
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] AM335X ES2.1 (neon)
[    0.000000] random: get_random_bytes called from start_kernel+0xa4/0x434 with crng_init=0
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 260416
[    0.000000] Kernel command line: console=ttyO0,115200n8 root=PARTUUID=a6eb9bf4-02 rw rootfstype=ext4 rootwait
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 975348K/1048576K available (9216K kernel code, 307K rwdata, 2724K rodata, 1024K init, 252K bss, 24076K reserved, 49152K cma-reserved, 212992K highmem)
[    0.000000] Virtual kernel memory layout:
                   vector  : 0xffff0000 - 0xffff1000   (   4 kB)
                   fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
                   vmalloc : 0xf0800000 - 0xff800000   ( 240 MB)
                   lowmem  : 0xc0000000 - 0xf0000000   ( 768 MB)
                   pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
                   modules : 0xbf000000 - 0xbfe00000   (  14 MB)
                     .text : 0x(ptrval) - 0x(ptrval)   (10208 kB)
                     .init : 0x(ptrval) - 0x(ptrval)   (1024 kB)
                     .data : 0x(ptrval) - 0x(ptrval)   ( 308 kB)
                      .bss : 0x(ptrval) - 0x(ptrval)   ( 253 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000]  Tasks RCU enabled.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] IRQ: Found an INTC at 0x(ptrval) (revision 5.0) with 128 interrupts
[    0.000000] OMAP clockevent source: timer2 at 24000000 Hz
[    0.000033] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000084] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000112] OMAP clocksource: timer1 at 24000000 Hz
[    0.000537] timer_probe: no matching timers found
[    0.000916] Console: colour dummy device 80x30
[    0.000975] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
[    0.000994] This ensures that you still see kernel messages. Please
[    0.001011] update your kernel commandline.
[    0.001122] Calibrating delay loop... 298.59 BogoMIPS (lpj=1492992)
[    0.067516] pid_max: default: 32768 minimum: 301
[    0.068020] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.068069] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.069873] CPU: Testing write buffer coherency: ok
[    0.069997] CPU0: Spectre v2: using BPIALL workaround
[    0.071885] Setting up static identity map for 0x80100000 - 0x80100060
[    0.072262] rcu: Hierarchical SRCU implementation.
[    0.073121] EFI services will not be available.
[    0.076869] devtmpfs: initialized
[    0.097961] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[    0.098825] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.098881] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.106257] pinctrl core: initialized pinctrl subsystem
[    0.108114] DMI not present or invalid.
[    0.109086] NET: Registered protocol family 16
[    0.114491] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.165096] l4_wkup_cm:clk:0010:0: failed to disable
[    0.226912] cpuidle: using governor ladder
[    0.227001] cpuidle: using governor menu
[    0.239559] gpio gpiochip0: (gpio-0-31): added GPIO chardev (254:0)
[    0.239788] gpiochip_setup_dev: registered GPIOs 0 to 31 on device: gpiochip0 (gpio-0-31)
[    0.239877] OMAP GPIO hardware version 0.1
[    0.241648] gpio gpiochip1: (gpio-32-63): added GPIO chardev (254:1)
[    0.241857] gpiochip_setup_dev: registered GPIOs 32 to 63 on device: gpiochip1 (gpio-32-63)
[    0.243562] gpio gpiochip2: (gpio-64-95): added GPIO chardev (254:2)
[    0.243755] gpiochip_setup_dev: registered GPIOs 64 to 95 on device: gpiochip2 (gpio-64-95)
[    0.245375] gpio gpiochip3: (gpio-96-127): added GPIO chardev (254:3)
[    0.245577] gpiochip_setup_dev: registered GPIOs 96 to 127 on device: gpiochip3 (gpio-96-127)
[    0.263424] No ATAGs?
[    0.263448] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.300522] edma 49000000.edma: TI EDMA DMA engine driver
[    0.301900] of_get_named_gpiod_flags: can't parse 'gpio' property of node '/fixedregulator0[0]'
[    0.308451] SCSI subsystem initialized
[    0.309605] media: Linux media interface: v0.10
[    0.309722] videodev: Linux video capture interface: v2.00
[    0.309973] pps_core: LinuxPPS API ver. 1 registered
[    0.309999] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.310063] PTP clock support registered
[    0.310156] EDAC MC: Ver: 3.0.0
[    0.312449] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400
[    0.313721] Advanced Linux Sound Architecture Driver Initialized.
[    0.316316] clocksource: Switched to clocksource timer1
[    0.338337] NET: Registered protocol family 2
[    0.340184] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
[    0.340272] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[    0.340496] TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
[    0.340713] TCP: Hash tables configured (established 8192 bind 8192)
[    0.341007] UDP hash table entries: 512 (order: 1, 8192 bytes)
[    0.341086] UDP-Lite hash table entries: 512 (order: 1, 8192 bytes)
[    0.341470] NET: Registered protocol family 1
[    0.342707] RPC: Registered named UNIX socket transport module.
[    0.342742] RPC: Registered udp transport module.
[    0.342761] RPC: Registered tcp transport module.
[    0.342780] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.342814] PCI: CLS 0 bytes, default 64
[    0.344700] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
[    0.348094] Initialise system trusted keyrings
[    0.348587] workingset: timestamp_bits=14 max_order=18 bucket_order=4
[    0.361445] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.363179] NFS: Registering the id_resolver key type
[    0.363262] Key type id_resolver registered
[    0.363284] Key type id_legacy registered
[    0.363390] ntfs: driver 2.1.32 [Flags: R/O].
[    0.369224] Key type asymmetric registered
[    0.369267] Asymmetric key parser 'x509' registered
[    0.369435] bounce: pool size: 64 pages
[    0.369574] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)
[    0.369605] io scheduler noop registered
[    0.369626] io scheduler deadline registered
[    0.370225] io scheduler cfq registered (default)
[    0.370257] io scheduler mq-deadline registered
[    0.370280] io scheduler kyber registered
[    0.374812] pinctrl-single 44e10800.pinmux: 142 pins, size 568
[    0.511256] Serial: 8250/16550 driver, 10 ports, IRQ sharing enabled
[    0.520894] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 30, base_baud = 3000000) is a 8250
[    1.144905] console [ttyS0] enabled
[    1.151005] 48024000.serial: ttyS2 at MMIO 0x48024000 (irq = 31, base_baud = 3000000) is a 8250
[    1.161068] pinctrl-single 44e10800.pinmux: pin PIN58 already requested by 44e10800.pinmux; cannot claim for 481a8000.serial
[    1.172533] pinctrl-single 44e10800.pinmux: pin-58 (481a8000.serial) status -22
[    1.180006] pinctrl-single 44e10800.pinmux: could not request pin 58 (PIN58) from group uart4grp  on device pinctrl-single
[    1.191171] omap8250 481a8000.serial: Error applying setting, reverse things back
[    1.198783] omap8250: probe of 481a8000.serial failed with error -22
[    1.208697] omap_rng 48310000.rng: Random Number Generator ver. 20
[    1.216549] random: fast init done
[    1.220432] random: crng init done
[    1.255131] brd: module loaded
[    1.275097] loop: module loaded
[    1.287306] mdio_bus fixed-0: GPIO lookup for consumer reset
[    1.287336] mdio_bus fixed-0: using lookup tables for GPIO lookup
[    1.287356] mdio_bus fixed-0: No GPIO consumer reset found
[    1.287418] libphy: Fixed MDIO Bus: probed
[    1.313680] pinctrl-single 44e10800.pinmux: pin PIN77 already requested by 44e10800.pinmux; cannot claim for 4a101000.mdio
[    1.324942] pinctrl-single 44e10800.pinmux: pin-77 (4a101000.mdio) status -22
[    1.332195] pinctrl-single 44e10800.pinmux: could not request pin 77 (PIN77) from group eth_gpio  on device pinctrl-single
[    1.343347] davinci_mdio 4a101000.mdio: Error applying setting, reverse things back
[    1.351156] davinci_mdio: probe of 4a101000.mdio failed with error -22
[    1.359261] of_get_named_gpiod_flags: can't parse 'link-gpios' property of node '/ocp/ethernet@4a100000/slave@4a100200/fixed-link[0]'
[    1.360160] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/ocp/ethernet@4a100000/slave@4a100200[0]'
[    1.360648] cpsw 4a100000.ethernet: No slave[1] phy_id, phy-handle, or fixed-link property
[    1.369254] cpsw 4a100000.ethernet: Detected MACID = 98:5d:ad:e8:d3:a4
[    1.376078] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4
[    1.382694] cpsw 4a100000.ethernet: ALE Table size 1024
[    1.388207] cpsw 4a100000.ethernet: cpts: overflow check period 500 (jiffies)
[    1.398868] i2c /dev entries driver
[    1.407306] cpuidle: enable-method property 'ti,am3352' found operations
[    1.415020] sdhci: Secure Digital Host Controller Interface driver
[    1.421446] sdhci: Copyright(c) Pierre Ossman
[    1.427442] omap_hsmmc 48060000.mmc: GPIO lookup for consumer cd
[    1.427466] omap_hsmmc 48060000.mmc: using device tree for GPIO lookup
[    1.427526] of_get_named_gpiod_flags: can't parse 'cd-gpios' property of node '/ocp/mmc@48060000[0]'
[    1.427566] of_get_named_gpiod_flags: can't parse 'cd-gpio' property of node '/ocp/mmc@48060000[0]'
[    1.427591] omap_hsmmc 48060000.mmc: using lookup tables for GPIO lookup
[    1.427612] omap_hsmmc 48060000.mmc: No GPIO consumer cd found
[    1.427637] omap_hsmmc 48060000.mmc: GPIO lookup for consumer wp
[    1.427653] omap_hsmmc 48060000.mmc: using device tree for GPIO lookup
[    1.427691] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/ocp/mmc@48060000[0]'
[    1.427727] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/ocp/mmc@48060000[0]'
[    1.427747] omap_hsmmc 48060000.mmc: using lookup tables for GPIO lookup
[    1.427764] omap_hsmmc 48060000.mmc: No GPIO consumer wp found
[    1.429412] omap_hsmmc 481d8000.mmc: GPIO lookup for consumer cd
[    1.429435] omap_hsmmc 481d8000.mmc: using device tree for GPIO lookup
[    1.429490] of_get_named_gpiod_flags: can't parse 'cd-gpios' property of node '/ocp/mmc@481d8000[0]'
[    1.429530] of_get_named_gpiod_flags: can't parse 'cd-gpio' property of node '/ocp/mmc@481d8000[0]'
[    1.429553] omap_hsmmc 481d8000.mmc: using lookup tables for GPIO lookup
[    1.429571] omap_hsmmc 481d8000.mmc: No GPIO consumer cd found
[    1.429594] omap_hsmmc 481d8000.mmc: GPIO lookup for consumer wp
[    1.429611] omap_hsmmc 481d8000.mmc: using device tree for GPIO lookup
[    1.429649] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/ocp/mmc@481d8000[0]'
[    1.429686] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/ocp/mmc@481d8000[0]'
[    1.429706] omap_hsmmc 481d8000.mmc: using lookup tables for GPIO lookup
[    1.429723] omap_hsmmc 481d8000.mmc: No GPIO consumer wp found
[    1.430760] pinctrl-single 44e10800.pinmux: pin PIN57 already requested by 44e10800.pinmux; cannot claim for 47810000.mmc
[    1.441932] pinctrl-single 44e10800.pinmux: pin-57 (47810000.mmc) status -22
[    1.449087] pinctrl-single 44e10800.pinmux: could not request pin 57 (PIN57) from group pinmux_mmc3_pins  on device pinctrl-single
[    1.460939] omap_hsmmc 47810000.mmc: Error applying setting, reverse things back
[    1.468449] omap_hsmmc: probe of 47810000.mmc failed with error -22
[    1.475068] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.482500] ledtrig-cpu: registered to indicate activity on CPUs
[    1.497940] NET: Registered protocol family 10
[    1.505200] Segment Routing with IPv6
[    1.509389] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    1.517170] NET: Registered protocol family 17
[    1.522209] Key type dns_resolver registered
[    1.527238] omap_voltage_late_init: Voltage driver support not added
[    1.535566] Loading compiled-in X.509 certificates
[    1.586739] tps65910 0-002d: No interrupt support, no core IRQ
[    1.593026] tps65910-gpio tps65910-gpio: ti,en-gpio-sleep not specified
[    1.593078] gpiochip_find_base: found new base at 506
[    1.593542] gpio gpiochip4: (tps65910): added GPIO chardev (254:4)
[    1.593747] gpiochip_setup_dev: registered GPIOs 506 to 511 on device: gpiochip4 (tps65910)
[    1.597004] vrtc: supplied by vbat
[    1.604977] vio: supplied by vbat
[    1.610507] vdd1: supplied by vbat
[    1.616530] vdd2: supplied by vbat
[    1.624120] vdig1: supplied by vbat
[    1.629713] vdig2: supplied by vbat
[    1.635248] vpll: supplied by vbat
[    1.640775] vdac: supplied by vbat
[    1.646234] vaux1: supplied by vbat
[    1.651835] vaux2: supplied by vbat
[    1.657416] vaux33: supplied by vbat
[    1.663062] vmmc: supplied by vbat
[    1.668648] vbb: supplied by vbat
[    1.674799] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[    1.682979] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 100 kHz
[    1.689435] cpu cpu0: Linked as a consumer to regulator.4
[    1.695027] cpu cpu0: Dropping the link to regulator.4
[    1.700820] cpu cpu0: Linked as a consumer to regulator.4
[    1.706989] cpufreq: cpufreq_online: CPU0: Running at unlisted freq: 600000 KHz
[    1.714409] cpu cpu0: dev_pm_opp_set_rate: failed to find current OPP for freq 600000000 (-34)
[    1.723516] cpufreq: cpufreq_online: CPU0: Unlisted initial frequency changed to: 300000 KHz
[    1.735191] omap_hsmmc 48060000.mmc: GPIO lookup for consumer cd
[    1.735237] omap_hsmmc 48060000.mmc: using device tree for GPIO lookup
[    1.735346] of_get_named_gpiod_flags: can't parse 'cd-gpios' property of node '/ocp/mmc@48060000[0]'
[    1.735424] of_get_named_gpiod_flags: can't parse 'cd-gpio' property of node '/ocp/mmc@48060000[0]'
[    1.735470] omap_hsmmc 48060000.mmc: using lookup tables for GPIO lookup
[    1.735508] omap_hsmmc 48060000.mmc: No GPIO consumer cd found
[    1.735557] omap_hsmmc 48060000.mmc: GPIO lookup for consumer wp
[    1.735588] omap_hsmmc 48060000.mmc: using device tree for GPIO lookup
[    1.735663] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/ocp/mmc@48060000[0]'
[    1.735735] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/ocp/mmc@48060000[0]'
[    1.735773] omap_hsmmc 48060000.mmc: using lookup tables for GPIO lookup
[    1.735807] omap_hsmmc 48060000.mmc: No GPIO consumer wp found
[    1.737576] omap_hsmmc 48060000.mmc: Linked as a consumer to regulator.14
[    1.772127] omap_hsmmc 481d8000.mmc: GPIO lookup for consumer cd
[    1.772174] omap_hsmmc 481d8000.mmc: using device tree for GPIO lookup
[    1.772279] of_get_named_gpiod_flags: can't parse 'cd-gpios' property of node '/ocp/mmc@481d8000[0]'
[    1.772358] of_get_named_gpiod_flags: can't parse 'cd-gpio' property of node '/ocp/mmc@481d8000[0]'
[    1.772403] omap_hsmmc 481d8000.mmc: using lookup tables for GPIO lookup
[    1.772441] omap_hsmmc 481d8000.mmc: No GPIO consumer cd found
[    1.772488] omap_hsmmc 481d8000.mmc: GPIO lookup for consumer wp
[    1.772519] omap_hsmmc 481d8000.mmc: using device tree for GPIO lookup
[    1.772594] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/ocp/mmc@481d8000[0]'
[    1.772667] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/ocp/mmc@481d8000[0]'
[    1.772706] omap_hsmmc 481d8000.mmc: using lookup tables for GPIO lookup
[    1.772740] omap_hsmmc 481d8000.mmc: No GPIO consumer wp found
[    1.774076] omap_hsmmc 481d8000.mmc: Linked as a consumer to regulator.14
[    1.809291] of_get_named_gpiod_flags: parsed 'gpios' property of node '/gpio_buttons0/switch1[0]' - status (0)
[    1.809525] gpio gpiochip2: Persistence not supported for GPIO 4
[    1.810144] of_get_named_gpiod_flags: parsed 'gpios' property of node '/gpio_buttons0/switch2[0]' - status (0)
[    1.810214] gpio gpiochip2: Persistence not supported for GPIO 19
[    1.811372] input: gpio_buttons0 as /devices/platform/gpio_buttons0/input/input0
[    1.821348] hctosys: unable to open rtc device (rtc0)
[    1.829186] ALSA device list:
[    1.832485]   No soundcards found.
[    1.840481] Waiting for root device PARTUUID=a6eb9bf4-02...
[    1.851689] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.865280] mmc0: new high speed SDHC card at address e624
[    1.875079] mmcblk0: mmc0:e624 SC16G 14.8 GiB 
[    1.885706] mmc1: new high speed MMC card at address 0001
[    1.892088]  mmcblk0: p1 p2 p3
[    1.904549] mmcblk1: mmc1:0001 W62704 3.56 GiB 
[    1.912009] mmcblk1boot0: mmc1:0001 W62704 partition 1 2.00 MiB
[    1.920540] mmcblk1boot1: mmc1:0001 W62704 partition 2 2.00 MiB
[    1.927596] mmcblk1rpmb: mmc1:0001 W62704 partition 3 512 KiB, chardev (244:0)
[    2.017151] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    2.025576] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    2.054283] devtmpfs: mounted
[    2.065337] Freeing unused kernel memory: 1024K
[    2.073040] Run /sbin/init as init process
[    2.525262] systemd[1]: System time before build time, advancing clock.
[    2.637086] systemd[1]: systemd 239 running in system mode. (+PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN
2 -IDN -PCRE2 default-hierarchy=hybrid)
[    2.661623] systemd[1]: Detected architecture arm.
[    2.781061] systemd[1]: Set hostname to <am335x-evm>.
[    3.825638] systemd[1]: File /lib/systemd/system/systemd-journald.service:36 configures an IP firewall (IPAddressDeny=any), but the local system does not support BPF/cgroup based firewalling.
[    3.843447] systemd[1]: Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loaded unit using IP firewalling.)
[    5.481993] systemd[1]: Reached target Remote File Systems.
[    5.521134] systemd[1]: Listening on udev Control Socket.
[    5.621830] systemd[1]: Created slice system-getty.slice.
[    5.660847] systemd[1]: Listening on Journal Socket (/dev/log).
[    5.699084] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[    7.655865] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    7.686212] systemd[1]: Listening on Process Core Dump Socket.
[    7.949026] systemd[1]: Mounted Temporary Directory (/tmp).
[    8.058562] systemd[1]: Started Apply Kernel Variables.
[    8.081011] systemd[1]: Mounted Kernel Configuration File System.
[    8.140175] systemd[1]: Mounted Kernel Debug File System.
[    8.200280] systemd[1]: Mounted POSIX Message Queue File System.
[    8.307598] systemd[1]: Started Remount Root and Kernel File Systems.
[    8.462512] systemd[1]: Starting Create Static Device Nodes in /dev...
[    9.007549] systemd[1]: Started Create Static Device Nodes in /dev.
[    9.040406] systemd[1]: Reached target Local File Systems (Pre).
[   11.146146] systemd-journald[74]: Received request to flush runtime journal from PID 1
[   29.390293] net eth0: initializing cpsw version 1.12 (0)
[   29.457978] Generic PHY fixed-0:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=fixed-0:00, irq=POLL)
[   29.530910] libphy: PHY  not found
[   29.534465] net eth0: phy "" not found on slave 1, err -19
[   29.668951] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   30.566921] cpsw 4a100000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
[   30.575025] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   31.846895] vdd2: disabling
root@am335x-evm:~# 
root@am335x-evm:~# 
root@am335x-evm:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 98:5D:AD:E8:D3:A4  
          inet6 addr: fe80::9a5d:adff:fee8:d3a4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:4728 (4.6 KiB)
          Interrupt:49 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  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)

root@am335x-evm:~# ifconfig eth0 169.254.149.23 netmask 255.255.255.0 up
root@am335x-evm:~# dmesg | eth
-sh: eth: command not found
root@am335x-evm:~# dmesg | grep eth                                                                                                                                                                         
[    1.332195] pinctrl-single 44e10800.pinmux: could not request pin 77 (PIN77) from group eth_gpio  on device pinctrl-single
[    1.359261] of_get_named_gpiod_flags: can't parse 'link-gpios' property of node '/ocp/ethernet@4a100000/slave@4a100200/fixed-link[0]'
[    1.360160] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/ocp/ethernet@4a100000/slave@4a100200[0]'
[    1.360648] cpsw 4a100000.ethernet: No slave[1] phy_id, phy-handle, or fixed-link property
[    1.369254] cpsw 4a100000.ethernet: Detected MACID = 98:5d:ad:e8:d3:a4
[    1.376078] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4
[    1.382694] cpsw 4a100000.ethernet: ALE Table size 1024
[    1.388207] cpsw 4a100000.ethernet: cpts: overflow check period 500 (jiffies)
[    1.407306] cpuidle: enable-method property 'ti,am3352' found operations
[   29.390293] net eth0: initializing cpsw version 1.12 (0)
[   29.534465] net eth0: phy "" not found on slave 1, err -19
[   29.668951] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   30.566921] cpsw 4a100000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
[   30.575025] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
root@am335x-evm:~# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 98:5D:AD:E8:D3:A4  
          inet addr:169.254.149.23  Bcast:169.254.149.255  Mask:255.255.255.0
          inet6 addr: fe80::9a5d:adff:fee8:d3a4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:6010 (5.8 KiB)
          Interrupt:49 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  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)

sit0      Link encap:IPv6-in-IPv4  
          NOARP  MTU:1480  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)

root@am335x-evm:~# ping 169.254.149.23
PING 169.254.149.23 (169.254.149.23): 56 data bytes
64 bytes from 169.254.149.23: seq=0 ttl=64 time=1.264 ms
64 bytes from 169.254.149.23: seq=1 ttl=64 time=1.062 ms
64 bytes from 169.254.149.23: seq=2 ttl=64 time=0.591 ms
64 bytes from 169.254.149.23: seq=3 ttl=64 time=0.582 ms
64 bytes from 169.254.149.23: seq=4 ttl=64 time=0.581 ms
64 bytes from 169.254.149.23: seq=5 ttl=64 time=0.563 ms
64 bytes from 169.254.149.23: seq=6 ttl=64 time=0.548 ms
^C
--- 169.254.149.23 ping statistics ---
7 packets transmitted, 7 packets received, 0% packet loss
round-trip min/avg/max = 0.548/0.741/1.264 ms
root@am335x-evm:~# ping 169.254.149.22
PING 169.254.149.22 (169.254.149.22): 56 data bytes

Please guide me if anything is missing or required to add.

Thankyou

  • Hi,

    TI doesn't officially support external switches. These are few observations I can make based on similar e2e posts, please bear in mind TI's experience here is limited. Sitara processors to my knowledge has not implemented an external switch on the CPSW port.

    - I don't believe that the CPSW node should have a PHY address associated with it, this should be moved to the switch definition

    - The CPSW node should have a "fixed link" in the cpsw_emac node like the switch definition does.

    - I am missing the switching driver being initialized, this might be related to the switch not having the mdio addresses.

    Could explain how the DTS for the switch is setup here? Is this based on an example from the switch vendor?

    Best Regards,

    Schuyler

  • Thanks for the quick response.

    Yes, DTS is taken from the switch vendor example given in the below link-

    https://github.com/Microchip-Ethernet/EVB-KSZ9477/blob/master/KSZ/linux-drivers/ksz8863/linux-4.19/arch/arm/boot/dts/at91-sama5d3_xplained_ung8087.dts

    The example is given for SPI, so we take the reference of it to use it with MDIO.

    ksz8863: ksz8863@0 {
    compatible = "microchip,ksz8863";
    reg = <0>;
    phy-mode = "rmii";

    spi-max-frequency = <12000000>;
    spi-cpha;
    spi-cpol;
    status = "disabled";
    ports {
    #address-cells = <1>;
    #size-cells = <0>;
    port@0 {
    reg = <0>;
    label = "lan1";
    };
    port@1 {
    reg = <1>;
    label = "lan2";
    };
    port@2 {
    reg = <2>;
    label = "cpu";
    ethernet = <&macb1>;
    fixed-link {
    speed = <100>;
    full-duplex;
    };
    };
    };

  • Hi ,

    We are able get mdio clk but not getting any data on mdio data pin.
    And still get phy not detected issue.

    We have tried the changes you mentioned but didn't get any luck.

    Thanks

  • Hi  ,

    [    1.642694] libphy: Fixed MDIO Bus: probed
    [    1.721368] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 500000
    [    1.729034] libphy: 4a101000.mdio: probed
    [    1.733173] mdio_bus 4a101000.mdio: mdio has invalid PHY address
    [    1.739252] mdio_bus 4a101000.mdio: scan phy mdio at address 0
    [    1.745523] mdio_bus 4a101000.mdio: scan phy mdio at address 1
    [    1.753719] mdio_bus 4a101000.mdio: scan phy mdio at address 2
    [    1.761782] mdio_bus 4a101000.mdio: scan phy mdio at address 3
    [    1.769521] mdio_bus 4a101000.mdio: scan phy mdio at address 4
    [    1.776062] mdio_bus 4a101000.mdio: scan phy mdio at address 5
    [    1.782480] mdio_bus 4a101000.mdio: scan phy mdio at address 6
    [    1.788654] mdio_bus 4a101000.mdio: scan phy mdio at address 7
    [    1.795012] mdio_bus 4a101000.mdio: scan phy mdio at address 8
    [    1.801188] mdio_bus 4a101000.mdio: scan phy mdio at address 9
    [    1.807497] mdio_bus 4a101000.mdio: scan phy mdio at address 10
    [    1.813910] mdio_bus 4a101000.mdio: scan phy mdio at address 11
    [    1.820199] mdio_bus 4a101000.mdio: scan phy mdio at address 12
    [    1.826525] mdio_bus 4a101000.mdio: scan phy mdio at address 13
    [    1.832869] mdio_bus 4a101000.mdio: scan phy mdio at address 14
    [    1.839145] mdio_bus 4a101000.mdio: scan phy mdio at address 15
    [    1.845479] mdio_bus 4a101000.mdio: scan phy mdio at address 16
    [    1.851813] mdio_bus 4a101000.mdio: scan phy mdio at address 17
    [    1.858085] mdio_bus 4a101000.mdio: scan phy mdio at address 18
    [    1.864420] mdio_bus 4a101000.mdio: scan phy mdio at address 19
    [    1.870693] mdio_bus 4a101000.mdio: scan phy mdio at address 20
    [    1.877030] mdio_bus 4a101000.mdio: scan phy mdio at address 21
    [    1.883370] mdio_bus 4a101000.mdio: scan phy mdio at address 22
    [    1.889648] mdio_bus 4a101000.mdio: scan phy mdio at address 23
    [    1.895985] mdio_bus 4a101000.mdio: scan phy mdio at address 24
    [    1.902321] mdio_bus 4a101000.mdio: scan phy mdio at address 25
    [    1.908598] mdio_bus 4a101000.mdio: scan phy mdio at address 26
    [    1.914936] mdio_bus 4a101000.mdio: scan phy mdio at address 27
    [    1.921266] mdio_bus 4a101000.mdio: scan phy mdio at address 28
    [    1.927529] mdio_bus 4a101000.mdio: scan phy mdio at address 29
    [    1.933869] mdio_bus 4a101000.mdio: scan phy mdio at address 30
    [    1.940146] mdio_bus 4a101000.mdio: scan phy mdio at address 31
    [    1.946488] davinci_mdio 4a101000.mdio: phy[1]: device 4a101000.mdio:01, driver Micrel KSZ886X Switch
    [    1.955845] davinci_mdio 4a101000.mdio: phy[2]: device 4a101000.mdio:02, driver Micrel KSZ886X Switch
    [    1.965191] davinci_mdio 4a101000.mdio: phy[3]: device 4a101000.mdio:03, driver Micrel KSZ886X Switch
    [    1.976764] cpsw 4a100000.ethernet: No slave[1] phy_id, phy-handle, or fixed-link property
    [    1.985311] cpsw 4a100000.ethernet: Detected MACID = 98:5d:ad:e8:d9:93
    [    1.992224] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4
    [    1.998641] cpsw 4a100000.ethernet: ALE Table size 1024
    [    2.004073] cpsw 4a100000.ethernet: cpts: overflow check period 500 (jiffies)
    [    2.016008] i2c /dev entries driver
    [    2.025822] cpuidle: enable-method property 'ti,am3352' found operations
    [   34.083483] net eth0: initializing cpsw version 1.12 (0)
    [   34.302732] Micrel KSZ886X Switch 4a101000.mdio:01: attached PHY driver [Micrel KSZ886X Switch] (mii_bus:phy_addr=4a101000.mdio:01, irq=POLL)
    [   34.412085] libphy: PHY  not found
    [   34.451912] net eth0: phy "" not found on slave 1, err -19
    [   34.593648] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
    [   36.483322] cpsw 4a100000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
    [   36.521993] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

    Please find the above logs, We are able to detect the Generic PHY, but KSZ8863 PHY is not detecting,

    Getting error ,

    libphy: PHY not found error
    And not able to Ping.
    Please let me know us if any missing point.
  • Hi  ,

    Please find below observations:

    1. Able to get PHY (KSZ8863) interface (over mdio) and attached to Ethernet

    2. Able to detect link status after PHY configurations with BMRC register as 0x1100

    3. Now, not able to ping the device
    Please find below details and attached logs:

    1. Able to get PHY interface and attach to Ethernet

    [ 34.301602] net eth0: phy "4a101000.mdio:01" found on slave 0
    [ 34.307483] #### phy_attached_print PHY driver [Micrel KSZ8863 Switch]####
    [ 34.461613] Micrel KSZ8863 Switch 4a101000.mdio:01: attached PHY driver [Micrel KSZ8863 Switch] (mii_bus:phy_addr=4a101000.mdio:01, irq=POLL)

    2. Able to detect link status after PHY configurations with BMRC register configuration as 0x1100

    root@am335x-evm:~# phytool read eth0/1/0x0
    0000
    root@am335x-evm:~# phytool write eth0/1/0 0x1100
    root@am335x-evm:~# phytool read eth0/1/0x0
    0x1100
    root@am335x-evm:~# phytool read eth0/1/0x1
    0x780c
    root@am335x-evm:~# phytool read eth0/1/0x0
    0x2104
    root@am335x-evm:~#

    root@am335x-evm:~# [ 568.082766] #### phy_link_change ####
    [ 568.101624] cpsw 4a100000.ethernet eth0: Link is Up - 10Mbps/Half - flow control off
    [ 568.109617] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
    root@am335x-evm:~#
    root@am335x-evm:~# ethtool eth0

    Settings for eth0:
    Supported ports: [ TP MII ]
    Supported link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Supported pause frame use: Symmetric Receive-only
    Supports auto-negotiation: Yes
    Supported FEC modes: Not reported
    Advertised link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Advertised pause frame use: No
    Advertised auto-negotiation: Yes
    Advertised FEC modes: Not reported
    Speed: 10Mb/s
    Duplex: Half
    Port: MII
    PHYAD: 1
    Transceiver: internal
    Auto-negotiation: on
    Supports Wake-on: d
    Wake-on: d
    Current message level: 0x00000000 (0)
    Link detected: yes
    root@am335x-evm:~#

    root@am335x-evm:~# ifconfig eth0 10.126.212.60 netmask 255.255.254.0 up

    root@am335x-evm:~# ifconfig
    eth0 Link encap:Ethernet HWaddr 2C:AB:33:74:5B:80
    inet addr:10.126.212.60 Bcast:10.126.213.255 Mask:255.255.254.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:49

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:65536 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)

    3. Now, not able to ping device
    root@am335x-evm:~# ping 10.126.212.64

    PING 10.126.212.64 (10.126.212.64): 56 data bytes
    --- 10.126.212.64 ping statistics ---

    8 packets transmitted, 0 packets received, 100% packet loss
    root@am335x-evm:~#

    The only issue left is not able to ping, Please help me out,

    Below is the DTS file currently configured-

    AM335x-evse.dts:

    &mac {
      pinctrl-names = "default";
      pinctrl-0 = <&phy_rmii_pins_default>;
      status = "okay";
      slave = <1>;
    };

    &davinci_mdio {
      pinctrl-names = "default";
      pinctrl-0 = <&mdio_pins_default>;
      status = "okay";
    };

    &cpsw_emac0 {
      status = "okay";
      phy_id = <&davinci_mdio>, <0x1>;
      phy-mode = "rmii";
    };

    &phy_sel {
      rmii-clock-ext;
    };

    =================================================
    am33xx.dtsi:
      mac: ethernet@4a100000 {
        compatible = "ti,am335x-cpsw","ti,cpsw";
        ti,hwmods = "cpgmac0";
        clocks = <&cpsw_125mhz_gclk>, <&cpsw_cpts_rft_clk>;
        clock-names = "fck", "cpts";
        cpdma_channels = <8>;
        ale_entries = <1024>;
        bd_ram_size = <0x2000>;
        mac_control = <0x20>;
        slaves = <1>;
        active_slave = <0>;
        cpts_clock_mult = <0x80000000>;
        cpts_clock_shift = <29>;
        reg = <0x4a100000 0x800
        0x4a101200 0x100>;
        #address-cells = <1>;
        #size-cells = <1>;
    /*
        * c0_rx_thresh_pend
        * c0_rx_pend
        * c0_tx_pend
        * c0_misc_pend
    */
        interrupts = <40 41 42 43>;
        ranges;
        syscon = <&scm_conf>;
        status = "disabled";

    davinci_mdio: mdio@4a101000 {
       compatible = "ti,cpsw-mdio","ti,davinci_mdio";
      reg = <0x4a101000 0x100>;
      #address-cells = <1>;
      #size-cells = <0>;
      ti,hwmods = "davinci_mdio";
      bus_freq = <1000000>;
      status = "disabled";
      /*#switch: switch-phy@0 {
      #compatible = "microchip,ksz8863";
      #reset-gpios = <&gpio2 18 GPIO_ACTIVE_LOW>;
      #reset-duration = <100>;
      #ports {
        # #address-cells = <1>;
        # #size-cells = <0>;
        # port@0 {
        # reg = <0>;
        # label = "cpu";
        # ethernet = <&davinci_mdio>;
        # };
        # port@1 { // external port 1
        # reg = <1>;
        label = "lan1";
        };
      };
     };*/
    };