Hi all,
I've connected a lan8720 with imx6q, following doc recommandations. Component seems to correctly respond but there's no way to ping .
I've read in posts that imx6 kernel doesn't support rmii no longer, and that a patch is necessary. Is it the case ? I join schematics and config.
MX6Q_PAD_ENET_MDIO__ENET_MDIO, MX6Q_PAD_ENET_MDC__ENET_MDC, MX6Q_PAD_ENET_TX_EN__ENET_TX_EN, MX6Q_PAD_ENET_CRS_DV__ENET_RX_EN, MX6Q_PAD_ENET_RXD0__ENET_RDATA_0, MX6Q_PAD_ENET_RXD1__ENET_RDATA_1, MX6Q_PAD_ENET_TXD0__ENET_TDATA_0, MX6Q_PAD_ENET_TXD1__ENET_TDATA_1, MX6Q_PAD_ENET_RX_ER__ENET_RX_ER, MX6Q_PAD_RGMII_TX_CTL__ENET_ANATOP_ETHERNET_REF_OUT, /* Clock ref input */ MX6Q_PAD_EIM_D17__GPIO_3_17, /* Reset RMII */ MX6Q_PAD_EIM_D16__GPIO_3_16, /* Int RMII */ I use an external 50 MHz ref clock. Init in the kernel is like below: - reset MX6Q_PAD_EIM_D17__GPIO_3_1 - Bit 21 to 0: mxc_iomux_set_gpr_register(1, 21, 1, 0);
static struct fec_platform_data fec_data __initdata = { .init = mx6q_sabresd_fec_phy_init, .phy = PHY_INTERFACE_MODE_RMII, }; In uboot: /* * get enet tx reference clk from internal clock from anatop * GPR1[21] = 1 */ reg = readl(IOMUXC_BASE_ADDR + 0x4); // reg |= (0x1 << 21); reg |= (0x0 << 21); /* External clock chosen */ writel(reg, IOMUXC_BASE_ADDR + 0x4); And the modif in fec_init() #if defined(CONFIG_MX6Q) || defined(CONFIG_MX6DL) /* RGMII */ // fecp->rcr &= ~(0x100); // fecp->rcr |= 0x44; /* RMII */ fecp->rcr &= ~(0x40); fecp->rcr |= 0x104; #endif |
And the log:
CPU: Freescale i.MX6 family TO1.2 at 792 MHz
Temperature: 40 C, calibration data 0x5b350a7d
mx6q pll1: 792MHz
mx6q pll2: 528MHz
mx6q pll3: 480MHz
mx6q pll8: 50MHz
ipg clock : 66000000Hz
ipg per clock : 66000000Hz
uart clock : 80000000Hz
cspi clock : 60000000Hz
ahb clock : 132000000Hz
axi clock : 264000000Hz
emi_slow clock: 132000000Hz
ddr clock : 528000000Hz
usdhc1 clock : 198000000Hz
usdhc2 clock : 198000000Hz
usdhc3 clock : 198000000Hz
usdhc4 clock : 198000000Hz
nfc clock : 24000000Hz
Board: i.MX6Q-SABRESD: unknown-board Board: 0x63012 [POR ]
Boot Device: SD
I2C: ready
DRAM: 1 GB
MMC: FSL_USDHC: 0,FSL_USDHC: 1
CLKCTL_CSCDR3 108410x
CLKCTL_CHSCCDR 2a9530x
In: serial
Out: serial
Err: serial
Found PFUZE100! deviceid=10,revid=11
Net: got MAC address from IIM: 00:00:00:00:00:00
FEC0 [PRIME]
Hit any key to stop autoboot: 0
mmc0 is current device
MMC read: dev # 0, block # 2048, count 8192 ... 8192 blocks read: OK
## Booting kernel from Legacy Image at 10800000 ...
Image Name: Linux-3.0.35-2310-gc27cb38
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3430328 Bytes = 3.3 MB
Load Address: 10008000
Entry Point: 10008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
Linux version 3.0.35-2310-gc27cb38 (lucid@ubuntu) (gcc version 4.6.2 20110630 (prerelease) (Freescale MAD -- Linaro 2011.07 -- Built at 2011/08/10 09:20) ) #156 SMP PREEMPT Fri Sep 20 08:40:07 CEST 2013
CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d
CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: Freescale i.MX 6Quad/DualLite/Solo Sabre-SD Board
Ignoring unrecognised tag 0x54410008
Memory policy: ECC disabled, Data cache writealloc
CPU identified as i.MX6Q, silicon rev 1.2
PERCPU: Embedded 7 pages/cpu @8c008000 s5440 r8192 d15040 u32768
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 227328
Kernel command line: console=ttymxc0,115200 video=mxcfb0:dev=lcd,720P60R1,if=RGB24 video=mxcfb1:dev=ldb,LDB-XGA,if=RGB666 video=mxcfb2:dev=lcd,720P60R1,if=RGB32 video=mxcfb3:off root=/dev/mmcblk0p1 rw rootwait
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: 640MB 256MB = 896MB total
Memory: 901296k/901296k available, 147280k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
DMA : 0xf4600000 - 0xffe00000 ( 184 MB)
vmalloc : 0xc0800000 - 0xf2000000 ( 792 MB)
lowmem : 0x80000000 - 0xc0000000 (1024 MB)
pkmap : 0x7fe00000 - 0x80000000 ( 2 MB)
modules : 0x7f000000 - 0x7fe00000 ( 14 MB)
.init : 0x80008000 - 0x80036000 ( 184 kB)
.text : 0x80036000 - 0x8065081c (6251 kB)
.data : 0x80652000 - 0x806ac300 ( 361 kB)
.bss : 0x806ac324 - 0x806f6d74 ( 299 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
Preemptible hierarchical RCU implementation.
NR_IRQS:496
MXC GPIO hardware
sched_clock: 32 bits at 3000kHz, resolution 333ns, wraps every 1431655ms
arm_max_freq=1
MXC_Early serial console at MMIO 0x2020000 (options '115200')
bootconsole [ttymxc0] enabled
Console: colour dummy device 80x30
Calibrating delay loop... 1581.05 BogoMIPS (lpj=7905280)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
hw perfevents: enabled with ARMv7 Cortex-A9 PMU driver, 7 counters available
CPU1: Booted secondary processor
Brought up 2 CPUs
SMP: Total of 2 processors activated (3162.11 BogoMIPS).
print_constraints: dummy:
NET: Registered protocol family 16
print_constraints: vddpu: 725 <--> 1300 mV at 700 mV fast normal
print_constraints: vddcore: 725 <--> 1300 mV at 1150 mV fast normal
print_constraints: vddsoc: 725 <--> 1300 mV at 1200 mV fast normal
print_constraints: vdd2p5: 2000 <--> 2775 mV at 2400 mV fast normal
print_constraints: vdd1p1: 800 <--> 1400 mV at 1100 mV fast normal
print_constraints: vdd3p0: 2625 <--> 3400 mV at 3000 mV fast normal
hw-breakpoint: found 6 breakpoint and 1 watchpoint registers.
hw-breakpoint: 1 breakpoint(s) reserved for watchpoint single-step.
hw-breakpoint: maximum watchpoint size is 4 bytes.
L310 cache controller enabled
l2x0: 16 ways, CACHE_ID 0x410000c7, AUX_CTRL 0x02070000, Cache size: 1048576 B
bio: create slab <bio-0> at 0
mxs-dma mxs-dma-apbh: initialized
print_constraints: vmmc: 3300 mV
SCSI subsystem initialized
spi_imx imx6q-ecspi.0: probed
spi_imx imx6q-ecspi.1: probed
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Freescale USB OTG Driver loaded, $Revision: 1.55 $
i2c i2c-1: Failed to register i2c client pfuze100 at 0x08 (-16)
i2c i2c-1: Can't create device at 0x08
i2c i2c-2: Invalid 7-bit I2C address 0x00
i2c i2c-2: Can't create device at 0x00
imx-ipuv3 imx-ipuv3.0: IPU DMFC NORMAL mode: 1(0~1), 5B(4,5), 5F(6,7)
imx-ipuv3 imx-ipuv3.1: IPU DMFC NORMAL mode: 1(0~1), 5B(4,5), 5F(6,7)
mxc_mipi_csi2 mxc_mipi_csi2: i.MX MIPI CSI2 driver probed
mxc_mipi_csi2 mxc_mipi_csi2: i.MX MIPI CSI2 dphy version is 0x3130302a
MIPI CSI2 driver module loaded
Advanced Linux Sound Architecture Driver Version 1.0.24.
i2c-core: driver [max17135] using legacy suspend method
i2c-core: driver [max17135] using legacy resume method
Switching to clocksource mxc_timer1
NET: Registered protocol family 2
IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
TCP bind hash table entries: 65536 (order: 7, 786432 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
TCP reno registered
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.
PMU: registered new PMU device of type 0
Static Power Management for Freescale i.MX6
wait mode is enabled for i.MX6
cpaddr = c0880000 suspend_iram_base=c08fc000
PM driver module loaded
IMX usb wakeup probe
add wake up source irq 75
IMX usb wakeup probe
cpu regulator init ldo=0
i.MXC CPU frequency driver
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
msgmni has been set to 1760
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
mxc_mipi_dsi mxc_mipi_dsi: i.MX MIPI DSI driver probed
MIPI DSI driver module loaded
mxc_sdc_fb mxc_sdc_fb.0: register mxc display driver lcd
Register driver LCD MODE IPU0 DI0 : 720P60R1
Console: switching to colour frame buffer device 90x80
mxc_sdc_fb mxc_sdc_fb.1: register mxc display driver ldb
_regulator_get: get() with no identifier
mxc_sdc_fb mxc_sdc_fb.2: register mxc display driver lcd
Register driver LCD MODE IPU0 DI0 : 720P60R1
mxc_sdc_fb mxc_sdc_fb.2: ipu0-di0 already in use
mxc_sdc_fb: probe of mxc_sdc_fb.2 failed with error -16
mxc_sdc_fb mxc_sdc_fb.3: Can't get fb option for mxcfb3!
imx-sdma imx-sdma: loaded firmware 1.1
imx-sdma imx-sdma: initialized
Serial: IMX driver
imx-uart.0: ttymxc0 at MMIO 0x2020000 (irq = 58) is a IMX
console [ttymxc0] enabled, bootconsole disabled
console [ttymxc0] enabled, bootconsole disabled
loop: module loaded
GPMI NAND driver registered. (IMX)
FEC Ethernet Driver
fec_enet_mii_bus: probed
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller
fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 1
fsl-ehci fsl-ehci.0: irq 75, io base 0x02184000
fsl-ehci fsl-ehci.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
add wake up source irq 72
fsl-ehci fsl-ehci.1: Freescale On-Chip EHCI Host Controller
fsl-ehci fsl-ehci.1: new USB bus registered, assigned bus number 2
fsl-ehci fsl-ehci.1: irq 72, io base 0x02184200
fsl-ehci fsl-ehci.1: USB 2.0 started, EHCI 1.00
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
ARC USBOTG Device Controller driver (1 August 2005)
egalax_ts 1-0004: egalax_ts: failed to read firmware version
egalax_ts: probe of 1-0004 failed with error -5
egalax_ts 2-0004: egalax_ts: failed to read firmware version
egalax_ts: probe of 2-0004 failed with error -5
snvs_rtc snvs_rtc.0: rtc core: registered snvs_rtc as rtc0
i2c /dev entries driver
Linux video capture interface: v2.00
mxc_v4l2_output mxc_v4l2_output.0: V4L2 device registered as video16
mxc_v4l2_output mxc_v4l2_output.0: V4L2 device registered as video17
mxc_v4l2_output mxc_v4l2_output.0: V4L2 device registered as video18
imx2-wdt imx2-wdt.0: IMX2+ Watchdog Timer enabled. timeout=60s (nowayout=1)
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci sdhci-esdhc-imx.0: no write-protect pin available!
sdhci sdhci-esdhc-imx.0: no card-detect pin available!
mmc0: no vmmc regulator found
mmc0: SDHCI controller on platform [sdhci-esdhc-imx.0] using DMA
mmc1: SDHCI controller on platform [sdhci-esdhc-imx.1] using DMA
mxc_vdoa mxc_vdoa: i.MX Video Data Order Adapter(VDOA) driver probed
VPU initialized
mxc_asrc registered
Thermal calibration data is 0x5b350a7d
Anatop Thermal registered as thermal_zone0
anatop_thermal_probe: default cooling device is cpufreq!
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
usbcore: registered new interface driver snd-usb-audio
Cirrus Logic CS42888 ALSA SoC Codec Driver
i2c-core: driver [cs42888] using legacy suspend method
i2c-core: driver [cs42888] using legacy resume method
imx_3stack asoc driver
ALSA device list:
No soundcards found.
NET: Registered protocol family 26
TCP cubic registered
NET: Registered protocol family 17
lib80211: common routines for IEEE802.11 drivers
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
Bus freq driver module loaded
Bus freq driver Enabled
mxc_dvfs_core_probe
DVFS driver module loaded
snvs_rtc snvs_rtc.0: setting system clock to 1970-01-01 00:00:00 UTC (0)
Waiting for root device /dev/mmcblk0p1...
mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new high speed SDHC card at address e624
mmcblk0: mmc0:e624 SU04G 3.69 GiB
mmcblk0: p1
EXT3-fs: barriers not enabled
EXT3-fs (mmcblk0p1): warning: maximal mount count reached, running e2fsck is recommended
kjournald starting. Commit interval 5 seconds
EXT3-fs (mmcblk0p1): using internal journal
EXT3-fs (mmcblk0p1): recovery complete
EXT3-fs (mmcblk0p1): mounted filesystem with writeback data mode
VFS: Mounted root (ext3 filesystem) on device 179:1.
Freeing init memory: 184K
starting pid 1242, tty '': '/etc/rc.d/rcS'
Mounting /proc and /sys
Starting the hotplug events dispatcher udevd
udevd (1251): /proc/1251/oom_adj is deprecated, please use /proc/1251/oom_score_adj instead.
Synthesizing initial hotplug events
Mounting filesystems
mount: mounting usbfs on /proc/bus/usb failed: No such file or directory
Changing password for root
New password:
Bad password: too short
Retype password:
passwd: can't create '/etc/shadow+': File exists
passwd: can't update password file /etc/shadow
eth0: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=1:00, irq=-1)
PHY: 1:00 - Link is Up - 100/Full
root@ /$ ifconfig -a
eth0 Link encap:Ethernet HWaddr 1E:ED:19:27:1A:B3
inet addr:192.168.1.115 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING 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)
lo Link encap:Local Loopback
LOOPBACK MTU:16436 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:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Thank for your help,
Christophe
Solved! Go to Solution.
Hi Weidong,
A good idea but it doesn't solved the issue.
rgds,
Christophe
Also on RMII mode why do we need the ENET_REF_CLK Pad (V22) to be connected with External Clock source?
Thanks,
Hi,
1- You can use GPIO16 instead of MX6Q_PAD_RGMII_TX_CTL. I don't do like that because gpio16 is busy with something else in my board.
2- You can use an external oscillator or not. The external oscillator choice is more precise and safe. It seems to me imx had problems with that in the past.
3- I no longer use interrupt signal (not muxed now).
Christophe
Thanks for the response.
Our hardware is based on imx6Solo + RMII, the RGMII_TX_CTL is used for something else and we have a Driver code for imx6Q + RGMII.
I have modified the Driver code of imx6Q + RGMII to work for imx6Solo + RMII. For some reason I see the transmit is not working at all.
Hi Paveen
Are you able to put your PHY in loopback mode to see if
the issue is at FEC level or something to do with your PHY.
Regards
Sinan Akman
The MAC is able to communicate with the PHY chip on MDC and MDIO lines. Also the PHY link up / down interrupts are triggered without issues.
So I did not try the loopback on the PHY. I have to try the loopback on the MAC side.
These are my settings for GPIO16 (R2) <--- 50MHz EXT Clock --> TLK105L PHY:
GPR[21] = 0 //Disable internal clock
CCM_CCGR1[10] = 0x3 //Enable ENET Clk
GPIO16 SION = 1 //Receive the clock from external osc
GPIO16 Mode = 2 //Use this as CLK_REF for RMII
Thanks,
Hi Paveen
So, with a scope do you see data on mdio, correct clock on mdc and the generated external
clock is clean ? I'd suggest to check if any of these is missing.
Regards
Sinan Akman
Yes, I have validated those. I will cross check those again.
On the other note, the uboot code has transmit buffer size as 2 and Receive buffer as 64. Also the uboot code has tx buffer flush instructions before sending. I do not have all those in my driver code (which works okay for imx6Quad + RGMII) and my Tx buffer / Rx buffer are set to 64. Not sure whether the code difference we have in uboot are related to some imx6solo race condition issue. I am trying to get these extra uboot patch code on my driver to see if that resolves the problem.
Is the behavior of imx6Solo Ethernet differs from imx6Quad?
Hi Praveen
No the behaviour should be same, except of course solo/dual lite
has different reg map than quad.
You seemed to be porting part of uboot. Can't you just
use the latest uboot from the mainline and have that run
on your board. BTW, where do you see uboot xmit buffer
size is set to 2. Can you provide, file name, line number.
Regards
Sinan Akman
We are using the Nucleus Driver code and working on debug mode using probe.
I am going to work on customizing the uboot if this Nucleus Driver does not work.
Regarding the size, I am using Nitrogen6lite evb board uboot code as reference.
Refer to
File: fec_mux.h
Function: static int fec_alloc_descs(struct fec_priv *fec)
Hi Praveen
I don't know what Nitrogen evb included uboot is but I took a
look at the mainline uboot code as it seems it is not the buffers
but the number of tx descriptors is set to 2 (It actually
uses one descriptor but having 2 desc apparently prevents
a race condition). And it looks like you do need to flash for
dma to work properly. So please add the flash code and
perhaps also use only 2 (effectively 1) tx descriptors.
I suggest refer to mainline uboot code rather than the
version you are using.
Hope this helps
Regards
Sinan Akman
Sinan,
Yes, it is the number of TX desc, we have that as 64 in our code and we dont have the data flush.
I will cross check with mainline uboot also.
Thanks.
Hello Christophe,
We have a problem in using imx6Solo and TLK105L PHY chip on RMII mode. The transmit interrupt never triggered. I have configured the GPR, SION and IOMUX correctly.
Our schematics looks like yours with the following changes:
GPIO16 <---- External Clock ----->PHY
RGMII_TX_CTL is used for other peripheral and not connected to clock as you have mentioned.
any inputs would be a great help.
Thanks.
Weidong,
I've just finished to add Fugan Duan's modifs for rmii into the kenel, and it solved the issue.
Nevertheless, thanks for your help.
Rgds,
Christophe.
Where can I find "Fugan Duan's modifs".
Thanks.
-Mike
Hi Weidong,
A good idea but it doesn't solved the issue.
rgds,
Christophe
Hello,Chrisophe,
I didn't find issue from BSP setting, But It seems that there is a little issue in schematic. Please pull up MDIO pin to VDDIO via a 1.5K-resistor. Then try it again.
regards,
Weidong