UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor busy_bri
Visitor
6,793 Views
Registered: ‎04-28-2016

Kernel not detecting ethernet. Micrel KSZ9031

Hi All,

 

I have a custom XCSC7010 Board with a Micrel KSZ9031 (phy address 3) and I am unable to get the kernel to recognize the phy. U-boot is able to identify it and even TFTPBoot an image.ub from my host PC but as the kernel starts it detects no PHY and "ifconfig -a" only detects "lo" and "sit0".

 

## Loading kernel from FIT Image at 10000000 ...
   Using 'conf@1' configuration
   Verifying Hash Integrity ... OK
   Trying 'kernel@0' kernel subimage
     Description:  Linux Kernel
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x100000d4
     Data Size:    3898384 Bytes = 3.7 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x00008000
     Entry Point:  0x00008000
     Hash algo:    sha1
     Hash value:   77a574e983825f27f0c1bc2ea130831134c6a307
   Verifying Hash Integrity ... sha1+ OK
## Loading ramdisk from FIT Image at 10000000 ...
   Using 'conf@1' configuration
   Trying 'ramdisk@0' ramdisk subimage
     Description:  ramdisk
     Type:         RAMDisk Image
     Compression:  uncompressed
     Data Start:   0x103bb450
     Data Size:    5249296 Bytes = 5 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: unavailable
     Entry Point:  unavailable
     Hash algo:    sha1
     Hash value:   4f2e7f10dac4cdc8885889713df4de09acba01e6
   Verifying Hash Integrity ... sha1+ OK
## Loading fdt from FIT Image at 10000000 ...
   Using 'conf@1' configuration
   Trying 'fdt@0' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x103b7dd8
     Data Size:    13768 Bytes = 13.4 KiB
     Architecture: ARM
     Hash algo:    sha1
     Hash value:   d95c17af01bcb5f366dfc55a7c98785c5b5ddc42
   Verifying Hash Integrity ... sha1+ OK
   Booting using the fdt blob at 0x103b7dd8
   Loading Kernel Image ... OK
   Loading Ramdisk to 07afe000, end 07fff910 ... OK
   Loading Device Tree to 07af7000, end 07afd5c7 ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0
Linux version 4.6.0-xilinx (brion@brion-Latitude-E5550) (gcc version 5.2.1 20151005 (Linaro GCC 5.2-2015.11-2) ) #1 SMP PREEMPT Thu Mar 23 15:46:22 GMT 2017
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine model: pull_up_fb_off
bootconsole [earlycon0] enabled
cma: Reserved 16 MiB at 0x3f000000
Memory policy: Data cache writealloc
percpu: Embedded 12 pages/cpu @ef7d3000 s19840 r8192 d21120 u49152
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260608
Kernel command line: console=ttyPS0,115200 earlyprintk
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 1008112K/1048576K available (5289K kernel code, 238K rwdata, 1908K rodata, 1024K init, 294K bss, 24080K reserved, 16384K cma-reserved, 245760K highmem)
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 : 0xc0008000 - 0xc0807574   (8190 kB)
      .init : 0xc0900000 - 0xc0a00000   (1024 kB)
      .data : 0xc0a00000 - 0xc0a3bae0   ( 239 kB)
       .bss : 0xc0a3bae0 - 0xc0a85524   ( 295 kB)
Preemptible hierarchical RCU implementation.
        Build-time adjustment of leaf fanout to 32.
NR_IRQS:16 nr_irqs:16 16
efuse mapped to f0802000
slcr mapped to f0804000
L2C: platform modifies aux control register: 0x72360000 -> 0x72760000
L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000
L2C-310 erratum 769419 enabled
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 ID prefetch enabled, offset 1 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 512 kB
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001
zynq_clock_init: clkc starts at f0804100
Zynq clock init
sched_clock: 64 bits at 325MHz, resolution 3ns, wraps every 4398046511103ns
clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x4af477f6aa, max_idle_ns: 440795207830 ns
Switching to timer-based delay loop, resolution 3ns
clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 551318127 ns
timer #0 at f080c000, irq=17
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 650.00 BogoMIPS (lpj=3250000)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x100000 - 0x100058
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
Brought up 2 CPUs
SMP: Total of 2 processors activated (1300.00 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor menu
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0xf0880000
zynq-pinctrl 700.pinctrl: zynq pinctrl initialized
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
media: Linux media interface: v0.10
Linux video capture interface: v2.00
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
PTP clock support registered
EDAC MC: Ver: 3.0.0
Advanced Linux Sound Architecture Driver Initialized.
DMA-API: preallocated 4096 debug entries
DMA-API: debugging enabled by kernel config
clocksource: Switched to clocksource arm_global_timer
NET: Registered protocol family 2
TCP established hash table entries: 8192 (order: 3, 32768 bytes)
TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
UDP hash table entries: 512 (order: 2, 16384 bytes)
UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Trying to unpack rootfs image as initramfs...
Freeing initrd memory: 5128K (c7afe000 - c8000000)
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
futex hash table entries: 512 (order: 3, 32768 bytes)
workingset: timestamp_bits=28 max_order=18 bucket_order=0
jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
bounce: pool size: 64 pages
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330
dma-pl330 f8003000.dmac:        DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
e0000000.serial: ttyPS0 at MMIO 0xe0000000 (irq = 143, base_baud = 3125000) is a xuartps
ýconsole [ttyPS0] enabled
console [ttyPS0] enabled
bootconsole [earlycon0] disabled
bootconsole [earlycon0] disabled
xdevcfg f8007000.devcfg: ioremap 0xf8007000 to f086e000
[drm] Initialized drm 1.1.0 20060810
brd: module loaded
loop: module loaded
MACsec IEEE 802.1AE
libphy: Fixed MDIO Bus: probed
CAN device driver interface
gpiod_set_value: invalid GPIO
libphy: MACB_mii_bus: probed
mdio_bus e000b000.etherne:03: mdio_device_register
macb e000b000.ethernet eth0: no PHY found
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
usbcore: registered new interface driver usb-storage
mousedev: PS/2 mouse device common for all mice
i2c /dev entries driver
EDAC MC: ECC not enabled
Xilinx Zynq CpuIdle Driver started
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using DMA
ledtrig-cpu: registered to indicate activity on CPUs
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
NET: Registered protocol family 10
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20120528 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20120528)
can: broadcast manager protocol (rev 20120528 t)
can: netlink gateway (rev 20130117) max_hops=1
Registering SWP/SWPB emulation handler
console [netcon0] enabled
netconsole: network logging started
hctosys: unable to open rtc device (rtc0)
mmc0: new high speed SDHC card at address 0007
ALSA device list:
  No soundcards found.
Freeing unused kernel memory: 1024K (c0900000 - c0a00000)
INIT:  mmcblk0: p1 SD8GB 7.42 GiB
version 2.88 booting
FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
random: dd urandom read with 1 bits of entropy available
Thu Mar 23 16:05:03 UTC 2017
Starting internet superserver: inetd.
INIT: Entering runlevel: 5
Configuring network interfaces... ifconfig: SIOCGIFFLAGS: No such device
Starting Dropbear SSH server: Generating key, this may take a while...
Public key portion is:
ssh-rsa 
Fingerprint: 
dropbear.
Starting syslogd/klogd: done
Starting tcf-agent: OK

PetaLinux 2016.4 plnx_arm /dev/ttyPS0

plnx_arm login:

my <project_dir>/project-spec/meta-user/recipes-dt/device-tree/files/system-top.dts file is as follows

/dts-v1/;
/include/ "system-conf.dtsi"
/ {
};
&gem0 {
	phy-handle = <&phy0>;
	phy-mode = "rgmii-id";

	mdio {
		#address-cells = <1>;
		#size-cells = <0>;	
		phy0:phy@3 {
			compatible = "micrel,ksz9031";
			device_type = "ethernet-phy";
			reg = <3>;
			} ;
	} ; 
};

&qspi {
	
	flash0: flash@0 {
		compatible = "s25fl128s";
		
	};
};

&sdhci0 {
	status = "okay";
	clock-frequency = <25000000>;
};

I've added the following lines to <project_dir>/project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h 

 

#undef CONFIG_PHY_MARVELL
#define CONFIG_PHY_MICREL

I've also enabled "kernel configuration -> Device Drivers -> Network device support ->PHY Device and Infrastructure -> Drivers for Micrel PHY" in "petalinux-config -c kernel" (I'm using petalinux 2016.4)

 

I had to enable pull-ups on the hardware file for u-boot to detect it:

hardware.png

 

0 Kudos
3 Replies
Adventurer
Adventurer
6,719 Views
Registered: ‎11-09-2015

Re: Kernel not detecting ethernet. Micrel KSZ9031

	mdio {
		#address-cells = <1>;
		#size-cells = <0>;	
		phy0:phy@3 {
			compatible = "micrel,ksz9031";
			device_type = "ethernet-phy";
			reg = <0>;
			} ;
	} ; 
try use phyaddr 0.
0 Kudos
Visitor busy_bri
Visitor
6,600 Views
Registered: ‎04-28-2016

Re: Kernel not detecting ethernet. Micrel KSZ9031

Thanks for the reply,

 

Changing " reg = <0>; " didn't help. By removing the line " compatible ="micrel,ksz9031"; " and manually adding "CONFIG_KSZ9031=y" to a .cfg file in "<proj_dir>/project-spec/meta-user/recipes-kernel/linux/linux-xlnx" eth0 was detected:

 

macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 145 (00:0a:35:00:1e:53)
Micrel KSZ9031 Gigabit PHY e000b000.etherne:03: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=e000b000.etherne:03, irq=-1)

Which makes me wonder why I need to modify the system-top.dts, and why doesn't the "petalinux-config -c kernel" have the KSZ9031 option available?  

 

 

Update: I rebuilt the project without adding the any phy driver edits and it worked.

0 Kudos
Adventurer
Adventurer
6,558 Views
Registered: ‎11-09-2015

Re: Kernel not detecting ethernet. Micrel KSZ9031

hi,i think your kernel config CONFIG_MICREL_PHY miss at the frist time. You may examination it by run :

zcat /proc/config.gz | grep CONFIG_MICREL_PHY  at console.

CONFIG_KSZ9031=y don't help anything,take a look at https://github.com/Xilinx/linux-xlnx/blob/xilinx-v2016.2/drivers/net/phy/micrel.c,the driver's probe accord to phy's id.

 

******************************************

Update: I rebuilt the project without adding the any phy driver edits and it worked.

*******************************************

The phy has some common regsister,if you remove the compatible device node at your phy‘s device node ,linux may use the generic phy driver.

you will seen the emac’s probe message may be like:

e000b000.etherne:03: attached PHY driver[generic PHY](mii_bus:phy_addr=e000b000.etherne:03, irq=-1)

 

BRs. 

0 Kudos