Hello,
I'm trying to bring up the ENET2 subsystem of a custom board.
I use LAN8720 on ENET1 and a LAN9303 connected to ENET2.
The MDIO Interface found the LAN9303 but ENET2 can't find the PHY (see Boot Message).
I'm working with Linux 4.19 (Yocto Zeus Build).
Can anyone help me?
LAN9303 configuration:
- RMII_PHY_Mode_CLOCK_is_Input
- SMI_Managed_Mode
- The PHY address values are as follows:
Virtual PHY = 0
PHY Port 1 = 1
PHY Port 2 = 2
- Auto-MDIX is enabled for port 1 and 2
Device Tree:
&fec1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_enet1>;
phy-mode = "rmii";
phy-handle = <ðphy0>;
phy-supply = <®_fec_3v3>;
phy-reset-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
phy-reset-duration = <25>;
phy-reset-post-delay = <1>;
status = "okay";
mdio {
#address-cells = <1>;
#size-cells = <0>;
ethphy0: ethernet-phy@0 {
compatible = "ethernet-phy-ieee802.3-c22";
max-speed = <100>;
reg = <0>;
};
};
};
master: &fec2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_enet2 &pinctrl_enet2_mdc>;
phy-mode = "rmii";
phy-handle = <&switch>;
phy-supply = <®_fec_3v3>;
phy-reset-gpios = <&gpio3 4 GPIO_ACTIVE_LOW>;
phy-reset-duration = <25>;
phy-reset-post-delay = <1>;
phy-reset-active-high;
status = "okay";
mdio {
#address-cells = <1>;
#size-cells = <0>;
switch: switch-phy@1 {
compatible = "smsc,lan9303-mdio";
reg = <1>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
label = "eth0";
ethernet = <&master>;
};
port@1 {
reg = <1>;
label = "lan1";
};
port@2 {
reg = <2>;
label = "lan2";
};
};
};
};
Boot Message:
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.14.78 (oe-user@oe-host) (gcc version 9.2.0 (GCC)) #1 PREEMPT Fri Sep 4 09:10:49 UTC 2020
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c53c7d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: TQ TQMa6ULL REV.030x on MBa6UL
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] Reserved memory: created CMA memory pool at 0x8a000000, size 96 MiB
[ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[ 0.000000] On node 0 totalpages: 65536
[ 0.000000] free_area_init_node: node 0, pgdat 80fae9d0, node_mem_map 89dc7000
[ 0.000000] Normal zone: 512 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 65536 pages, LIFO batch:15
[ 0.000000] CPU: All CPU(s) started in SVC mode.
[ 0.000000] random: get_random_bytes called from start_kernel+0xb0/0x3c0 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: 65024
[ 0.000000] Kernel command line: root=/dev/nfs rw nfsroot=192.168.0.34:/nfs/rootfs,v3,tcp ip=192.168.0.222:192.168.0.34::255.255.255.0::eth0:off console=ttymxc0,115200 consoleblank=0 cma=32M debug
[ 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: 145628K/262144K available (9216K kernel code, 790K rwdata, 2940K rodata, 1024K init, 414K bss, 18212K reserved, 98304K cma-reserved, 0K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0x90800000 - 0xff800000 (1776 MB)
[ 0.000000] lowmem : 0x80000000 - 0x90000000 ( 256 MB)
[ 0.000000] pkmap : 0x7fe00000 - 0x80000000 ( 2 MB)
[ 0.000000] modules : 0x7f000000 - 0x7fe00000 ( 14 MB)
[ 0.000000] .text : 0x80008000 - 0x80a00000 (10208 kB)
[ 0.000000] .init : 0x80e00000 - 0x80f00000 (1024 kB)
[ 0.000000] .data : 0x80f00000 - 0x80fc5bdc ( 791 kB)
[ 0.000000] .bss : 0x80fc5be0 - 0x8102d3f4 ( 415 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] ftrace: allocating 31002 entries in 91 pages
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] Tasks RCU enabled.
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] Switching to timer-based delay loop, resolution 333ns
[ 0.000016] sched_clock: 32 bits at 3000kHz, resolution 333ns, wraps every 715827882841ns
[ 0.000059] clocksource: mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 637086815595 ns
[ 0.003704] Console: colour dummy device 80x30
[ 0.003770] Calibrating delay loop (skipped), value calculated using timer frequency.. 6.00 BogoMIPS (lpj=30000)
[ 0.003806] pid_max: default: 32768 minimum: 301
[ 0.004219] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.004255] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.005566] CPU: Testing write buffer coherency: ok
[ 0.006874] Setting up static identity map for 0x80100000 - 0x80100060
[ 0.007177] Hierarchical SRCU implementation.
[ 0.016623] devtmpfs: initialized
[ 0.036546] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.037138] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.037181] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.046042] pinctrl core: initialized pinctrl subsystem
[ 0.048430] NET: Registered protocol family 16
[ 0.064732] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.067042] cpuidle: using governor ladder
[ 0.067120] cpuidle: using governor menu
[ 0.082566] vdd3p0: supplied by regulator-dummy
[ 0.083852] cpu: supplied by regulator-dummy
[ 0.085087] vddsoc: supplied by regulator-dummy
[ 0.109528] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.109565] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.110854] imx6ul-pinctrl 20e0000.iomuxc: Invalid fsl,pins or pins property in node /soc/aips-bus@02000000/iomuxc@020e0000/imx6ul-mba6ul/pwm2grp
[ 0.111113] imx6ul-pinctrl 20e0000.iomuxc: initialized IMX pinctrl driver
[ 0.111824] imx6ul-pinctrl 2290000.iomuxc-snvs: no groups defined in /soc/aips-bus@02200000/iomuxc-snvs@02290000
[ 0.111860] imx6ul-pinctrl 2290000.iomuxc-snvs: initialized IMX pinctrl driver
[ 0.154208] vgaarb: loaded
[ 0.155649] SCSI subsystem initialized
[ 0.156183] usbcore: registered new interface driver usbfs
[ 0.156352] usbcore: registered new interface driver hub
[ 0.156568] usbcore: registered new device driver usb
[ 0.158479] i2c i2c-1: IMX I2C adapter registered
[ 0.158533] i2c i2c-1: can't use DMA, using PIO instead.
[ 0.162300] pca953x 3-0020: 3-0020 supply vcc not found, using dummy regulator
[ 0.171772] pca953x 3-0020: failed reading register
[ 0.172675] pca953x 3-0022: 3-0022 supply vcc not found, using dummy regulator
[ 0.181770] pca953x 3-0022: failed reading register
[ 0.182528] i2c i2c-3: IMX I2C adapter registered
[ 0.182579] i2c i2c-3: can't use DMA, using PIO instead.
[ 0.182942] media: Linux media interface: v0.10
[ 0.183068] Linux video capture interface: v2.00
[ 0.183242] pps_core: LinuxPPS API ver. 1 registered
[ 0.183266] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.183322] PTP clock support registered
[ 0.185590] Advanced Linux Sound Architecture Driver Initialized.
[ 0.187958] clocksource: Switched to clocksource mxc_timer1
[ 0.357136] NET: Registered protocol family 2
[ 0.358674] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.358755] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.358822] TCP: Hash tables configured (established 2048 bind 2048)
[ 0.359033] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.359083] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.359448] NET: Registered protocol family 1
[ 0.360292] RPC: Registered named UNIX socket transport module.
[ 0.360328] RPC: Registered udp transport module.
[ 0.360347] RPC: Registered tcp transport module.
[ 0.360364] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.360396] PCI: CLS 0 bytes, default 64
[ 0.366189] Bus freq driver module loaded
[ 0.367667] audit: initializing netlink subsys (disabled)
[ 0.369398] audit: type=2000 audit(0.360:1): state=initialized audit_enabled=0 res=1
[ 0.369628] workingset: timestamp_bits=30 max_order=16 bucket_order=0
[ 0.382572] NFS: Registering the id_resolver key type
[ 0.382659] Key type id_resolver registered
[ 0.382681] Key type id_legacy registered
[ 0.382725] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[ 0.383219] fuse init (API version 7.26)
[ 0.384732] NILFS version 2 loaded
[ 0.403780] NET: Registered protocol family 38
[ 0.403867] io scheduler noop registered
[ 0.403889] io scheduler deadline registered
[ 0.404522] io scheduler cfq registered (default)
[ 0.404554] io scheduler mq-deadline registered
[ 0.404574] io scheduler kyber registered
[ 0.407285] imx-weim 21b8000.weim: srj - major num: 247
[ 0.410010] imx-weim 21b8000.weim: Driver registered.
[ 0.422528] mxs-dma 1804000.dma-apbh: initialized
[ 0.427354] pfuze100-regulator 3-0008: Full layer: 1, Metal layer: 1
[ 0.428306] pfuze100-regulator 3-0008: FAB: 0, FIN: 0
[ 0.428337] pfuze100-regulator 3-0008: pfuze3000 found.
[ 0.453289] 2020000.serial: ttymxc0 at MMIO 0x2020000 (irq = 19, base_baud = 5000000) is a IMX
[ 1.188572] console [ttymxc0] enabled
[ 1.194264] 21ec000.serial: ttymxc2 at MMIO 0x21ec000 (irq = 60, base_baud = 5000000) is a IMX
[ 1.240340] imx-rng 2284000.rngb: iMX RNG Registered.
[ 1.263067] loop: module loaded
[ 1.267826] at24 3-0050: 8192 byte 24c64 EEPROM, writable, 32 bytes/write
[ 1.276191] at24 3-0052: 256 byte 24c02 EEPROM, writable, 16 bytes/write
[ 1.285495] random: fast init done
[ 1.312289] fsl-quadspi 21e0000.qspi: n25q512a (65536 Kbytes)
[ 1.319010] 6 ofpart partitions found on MTD device 21e0000.qspi
[ 1.325077] Creating 6 MTD partitions on "21e0000.qspi":
[ 1.330626] 0x000000000000-0x0000000d0000 : "U-Boot"
[ 1.337823] 0x0000000d0000-0x0000000e0000 : "ENV1"
[ 1.344892] 0x0000000e0000-0x0000000f0000 : "ENV2"
[ 1.352095] 0x0000000f0000-0x000000100000 : "DTB"
[ 1.359179] 0x000000100000-0x000000800000 : "Linux"
[ 1.366150] 0x000000800000-0x000004000000 : "RootFS"
[ 1.375095] spi_imx 200c000.ecspi: dma setup error -19, use pio
[ 1.382414] spi_imx 200c000.ecspi: probed
[ 1.388640] libphy: Fixed MDIO Bus: probed
[ 1.394923] CAN device driver interface
[ 1.402744] pps pps0: new PPS source ptp0
[ 1.408445] libphy: fec_enet_mii_bus: probed
[ 1.416535] LAN9303_MDIO 20b4000.ethernet-1:01: No reset GPIO defined
[ 1.433223] LAN9303_MDIO 20b4000.ethernet-1:01: Found LAN9303 rev. 1
[ 1.443708] LAN9303_MDIO 20b4000.ethernet-1:01: Phy setup '0-1-2' detected
[ 1.483884] LAN9303_MDIO 20b4000.ethernet-1:01: Failed to register switch: -517
[ 1.493503] mdio_bus 20b4000.ethernet-1: registered mdio device switch-phy at address 1
[ 1.502922] fec 20b4000.ethernet eth0: registered PHC device 0
[ 1.510156] imx6ul-pinctrl 20e0000.iomuxc: pin MX6UL_PAD_GPIO1_IO06 already requested by 20b4000.ethernet; cannot claim for 2188000.ethernet
[ 1.522994] imx6ul-pinctrl 20e0000.iomuxc: pin-29 (2188000.ethernet) status -22
[ 1.530412] imx6ul-pinctrl 20e0000.iomuxc: could not request pin 29 (MX6UL_PAD_GPIO1_IO06) from group enet1grp on device 20e0000.iomuxc
[ 1.542758] fec 2188000.ethernet: Error applying setting, reverse things back
[ 1.550010] fec: probe of 2188000.ethernet failed with error -22
[ 1.556632] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.563306] ehci-pci: EHCI PCI platform driver
[ 1.568141] usbcore: registered new interface driver usb-storage
[ 1.574282] usbcore: registered new interface driver usb_ehset_test
[ 1.583370] usbmisc_imx 2184800.usbmisc: 2184800.usbmisc supply vbus-wakeup not found, using dummy regulator
[ 1.595486] imx6ul-pinctrl 20e0000.iomuxc: pin MX6UL_PAD_GPIO1_IO00 already requested by 21a4000.i2c; cannot claim for 2184000.usb
[ 1.607381] imx6ul-pinctrl 20e0000.iomuxc: pin-23 (2184000.usb) status -22
[ 1.614355] imx6ul-pinctrl 20e0000.iomuxc: could not request pin 23 (MX6UL_PAD_GPIO1_IO00) from group usbotg1grp on device 20e0000.iomuxc
[ 1.626992] imx_usb 2184000.usb: Error applying setting, reverse things back
[ 1.634171] imx_usb: probe of 2184000.usb failed with error -22
[ 1.642626] mousedev: PS/2 mouse device common for all mice
[ 1.650215] input: 20cc000.snvs:snvs-powerkey as /devices/soc0/soc/2000000.aips-bus/20cc000.snvs/20cc000.snvs:snvs-powerkey/input/input0
[ 1.668880] rtc-ds1307 3-0068: SET TIME!
[ 1.679372] rtc-ds1307 3-0068: registered as rtc0
[ 1.685069] i2c /dev entries driver
[ 1.689747] IR NEC protocol handler initialized
[ 1.694333] IR RC5(x/sz) protocol handler initialized
[ 1.699608] IR RC6 protocol handler initialized
[ 1.704179] IR JVC protocol handler initialized
[ 1.708795] IR Sony protocol handler initialized
[ 1.713443] IR SANYO protocol handler initialized
[ 1.718215] IR Sharp protocol handler initialized
[ 1.722950] IR MCE Keyboard/mouse protocol handler initialized
[ 1.728849] IR XMP protocol handler initialized
[ 1.741245] imx2-wdt 20bc000.wdog: timeout 60 sec (nowayout=0)
[ 1.749499] sdhci: Secure Digital Host Controller Interface driver
[ 1.755738] sdhci: Copyright(c) Pierre Ossman
[ 1.760225] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.828139] mmc0: SDHCI controller on 2194000.usdhc [2194000.usdhc] using ADMA
[ 1.843013] ledtrig-cpu: registered to indicate activity on CPUs
[ 1.865462] hidraw: raw HID events driver (C) Jiri Kosina
[ 1.871637] usbcore: registered new interface driver usbhid
[ 1.877258] usbhid: USB HID core driver
[ 1.896079] imx-tlv320aic32x4 sound: failed to find SSI platform device
[ 1.903465] NET: Registered protocol family 26
[ 1.913346] NET: Registered protocol family 10
[ 1.923103] Segment Routing with IPv6
[ 1.927188] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[ 1.939268] NET: Registered protocol family 17
[ 1.947869] can: controller area network core (rev 20170425 abi 9)
[ 1.958706] NET: Registered protocol family 29
[ 1.963214] can: raw protocol (rev 20170425)
[ 1.967522] can: broadcast manager protocol (rev 20170425 t)
[ 1.976533] can: netlink gateway (rev 20170425) max_hops=1
[ 1.985789] 8021q: 802.1Q VLAN Support v1.8
[ 1.993416] Key type dns_resolver registered
[ 2.007136] mmc0: new HS200 MMC card at address 0001
[ 2.013659] mmcblk0: mmc0:0001 DG4008 7.28 GiB
[ 2.019360] mmcblk0boot0: mmc0:0001 DG4008 partition 1 4.00 MiB
[ 2.026347] mmcblk0boot1: mmc0:0001 DG4008 partition 2 4.00 MiB
[ 2.033944] mmcblk0rpmb: mmc0:0001 DG4008 partition 3 4.00 MiB
[ 2.044256] mmcblk0: p1 p2
[ 2.077462] LAN9303_MDIO 20b4000.ethernet-1:01: No reset GPIO defined
[ 2.093944] LAN9303_MDIO 20b4000.ethernet-1:01: Found LAN9303 rev. 1
[ 2.104442] LAN9303_MDIO 20b4000.ethernet-1:01: Phy setup '0-1-2' detected
[ 2.146208] DSA: switch 0 0 parsed
[ 2.155679] DSA: tree 0 parsed
[ 2.165056] libphy: dsa slave smi: probed
[ 2.268199] SMSC LAN911x Internal PHY dsa-0.0:01: attached PHY driver [SMSC LAN911x Internal PHY] (mii_bus:phy_addr=dsa-0.0:01, irq=POLL)
[ 2.378229] SMSC LAN911x Internal PHY dsa-0.0:02: attached PHY driver [SMSC LAN911x Internal PHY] (mii_bus:phy_addr=dsa-0.0:02, irq=POLL)
[ 2.391861] LAN9303_MDIO 20b4000.ethernet-1:01: LAN9303 MDIO driver loaded successfully
[ 2.404832] (NULL device *): hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
[ 2.417678] imx_thermal 2000000.aips-bus:tempmon: Industrial CPU temperature grade - max:105C critical:100C passive:95C
[ 2.430420] imx-tlv320aic32x4 sound: failed to find SSI platform device
[ 2.442776] rtc-ds1307 3-0068: setting system clock to 2000-01-01 00:00:14 UTC (946684814)
[ 2.470705] fec 20b4000.ethernet eth0: Unable to connect to phy
[ 2.481046] IP-Config: Failed to open eth0
[ 2.503347] fec 20b4000.ethernet eth0: Unable to connect to phy
[ 2.513573] IP-Config: Failed to open eth0
[ 2.517710] IP-Config: Device `eth0' not found
[ 2.522610] SW1A: disabling
[ 2.526162] VLDO1: disabling
[ 2.529725] VLDO2: disabling
[ 2.533209] VCCSD: disabling
[ 2.536681] VLDO3: disabling
[ 2.540319] ALSA device list:
[ 2.543314] No soundcards found.