imx7d with ar8035 can not work

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx7d with ar8035 can not work

4,535 Views
xing
Contributor I

I am using IMX7D with AR8035 PHY in my own custom board.

Now I met one problem. When I want ping the  board with PC, can transmit but can not receive any data.

the board boot log is in attachment, please give some advice.

the kernel file, DTS and mach-imx7d.c , SCHEMATIC  are also in attachment.

Thanks a lot!

Original Attachment has been moved to: ar8035-kernel.rar

Labels (1)
0 Kudos
11 Replies

2,521 Views
xing
Contributor I

Now fec0 is ok if I change uboot board file.and it will not need mii info cmd any more.

The fec part in uboot file

#ifdef CONFIG_FEC_MXC
static iomux_v3_cfg_t const fec1_pads[] = {
MX7D_PAD_ENET1_RGMII_RX_CTL__ENET1_RGMII_RX_CTL | MUX_PAD_CTRL(ENET_RX_PAD_CTRL),
MX7D_PAD_ENET1_RGMII_RD0__ENET1_RGMII_RD0 | MUX_PAD_CTRL(ENET_RX_PAD_CTRL),
MX7D_PAD_ENET1_RGMII_RD1__ENET1_RGMII_RD1 | MUX_PAD_CTRL(ENET_RX_PAD_CTRL),
MX7D_PAD_ENET1_RGMII_RD2__ENET1_RGMII_RD2 | MUX_PAD_CTRL(ENET_RX_PAD_CTRL),
MX7D_PAD_ENET1_RGMII_RD3__ENET1_RGMII_RD3 | MUX_PAD_CTRL(ENET_RX_PAD_CTRL),
MX7D_PAD_ENET1_RGMII_RXC__ENET1_RGMII_RXC | MUX_PAD_CTRL(ENET_RX_PAD_CTRL),
MX7D_PAD_ENET1_RGMII_TX_CTL__ENET1_RGMII_TX_CTL | MUX_PAD_CTRL(ENET_PAD_CTRL),
MX7D_PAD_ENET1_RGMII_TD0__ENET1_RGMII_TD0 | MUX_PAD_CTRL(ENET_PAD_CTRL),
MX7D_PAD_ENET1_RGMII_TD1__ENET1_RGMII_TD1 | MUX_PAD_CTRL(ENET_PAD_CTRL),
MX7D_PAD_ENET1_RGMII_TD2__ENET1_RGMII_TD2 | MUX_PAD_CTRL(ENET_PAD_CTRL),
MX7D_PAD_ENET1_RGMII_TD3__ENET1_RGMII_TD3 | MUX_PAD_CTRL(ENET_PAD_CTRL),
MX7D_PAD_ENET1_RGMII_TXC__ENET1_RGMII_TXC | MUX_PAD_CTRL(ENET_PAD_CTRL),
MX7D_PAD_GPIO1_IO10__ENET1_MDIO | MUX_PAD_CTRL(ENET_PAD_CTRL_MII),
MX7D_PAD_GPIO1_IO11__ENET1_MDC | MUX_PAD_CTRL(ENET_PAD_CTRL_MII),
};

static iomux_v3_cfg_t const fec2_pads[] = {
MX7D_PAD_EPDC_SDCE0__ENET2_RGMII_RX_CTL | MUX_PAD_CTRL(ENET_RX_PAD_CTRL),
MX7D_PAD_EPDC_SDCLK__ENET2_RGMII_RD0 | MUX_PAD_CTRL(ENET_RX_PAD_CTRL),
MX7D_PAD_EPDC_SDLE__ENET2_RGMII_RD1 | MUX_PAD_CTRL(ENET_RX_PAD_CTRL),
MX7D_PAD_EPDC_SDOE__ENET2_RGMII_RD2 | MUX_PAD_CTRL(ENET_RX_PAD_CTRL),
MX7D_PAD_EPDC_SDSHR__ENET2_RGMII_RD3 | MUX_PAD_CTRL(ENET_RX_PAD_CTRL),
MX7D_PAD_EPDC_SDCE1__ENET2_RGMII_RXC | MUX_PAD_CTRL(ENET_RX_PAD_CTRL),
MX7D_PAD_EPDC_GDRL__ENET2_RGMII_TX_CTL | MUX_PAD_CTRL(ENET_PAD_CTRL),
MX7D_PAD_EPDC_SDCE2__ENET2_RGMII_TD0 | MUX_PAD_CTRL(ENET_PAD_CTRL),
MX7D_PAD_EPDC_SDCE3__ENET2_RGMII_TD1 | MUX_PAD_CTRL(ENET_PAD_CTRL),
MX7D_PAD_EPDC_GDCLK__ENET2_RGMII_TD2 | MUX_PAD_CTRL(ENET_PAD_CTRL),
MX7D_PAD_EPDC_GDOE__ENET2_RGMII_TD3 | MUX_PAD_CTRL(ENET_PAD_CTRL),
MX7D_PAD_EPDC_GDSP__ENET2_RGMII_TXC | MUX_PAD_CTRL(ENET_PAD_CTRL),
MX7D_PAD_GPIO1_IO10__ENET1_MDIO | MUX_PAD_CTRL(ENET_PAD_CTRL_MII),
MX7D_PAD_GPIO1_IO11__ENET1_MDC | MUX_PAD_CTRL(ENET_PAD_CTRL_MII),
};

static iomux_v3_cfg_t const phy1_rst_pads[] = {
/* PHY1 RST */
MX7D_PAD_ECSPI2_SS0__GPIO4_IO23 | MUX_PAD_CTRL(GPIO_PAD_CTRL),
};

static iomux_v3_cfg_t const phy2_rst_pads[] = {
/* PHY2 RST */
MX7D_PAD_EPDC_PWR_COM__GPIO2_IO30 | MUX_PAD_CTRL(GPIO_PAD_CTRL),
};


static void setup_iomux_fec(void) //
{
if (0 == CONFIG_FEC_ENET_DEV) {
imx_iomux_v3_setup_multiple_pads(fec1_pads, ARRAY_SIZE(fec1_pads));
//imx_iomux_v3_setup_multiple_pads(phy1_rst_pads, ARRAY_SIZE(phy1_rst_pads));
} else {
imx_iomux_v3_setup_multiple_pads(fec2_pads, ARRAY_SIZE(fec2_pads)); //diff with sabre
imx_iomux_v3_setup_multiple_pads(phy2_rst_pads, ARRAY_SIZE(phy2_rst_pads));
}
}

#define FEC1_RST_GPIO IMX_GPIO_NR(4, 23)
#define FEC2_RST_GPIO IMX_GPIO_NR(2, 30)

int board_eth_init(bd_t *bis)
{
int ret;

setup_iomux_fec();

ret = fecmxc_initialize_multi(bis, CONFIG_FEC_ENET_DEV,
CONFIG_FEC_MXC_PHYADDR, IMX_FEC_BASE);
if (ret)
printf("FEC1 MXC: %s:failed\n", __func__);

gpio_direction_output(FEC1_RST_GPIO, 0);
gpio_direction_output(FEC2_RST_GPIO, 0); //diff with sabre add fec rst
udelay(5000);
gpio_set_value(FEC1_RST_GPIO, 1);
gpio_set_value(FEC2_RST_GPIO, 1);

return ret;
}

static int setup_fec(int fec_id)
{
struct iomuxc_gpr_base_regs *const iomuxc_gpr_regs
= (struct iomuxc_gpr_base_regs *) IOMUXC_GPR_BASE_ADDR;
int ret;

if (0 == fec_id) {
/* Use 125M anatop REF_CLK1 for ENET1, clear gpr1[13], gpr1[17]*/
clrsetbits_le32(&iomuxc_gpr_regs->gpr[1],
(IOMUXC_GPR_GPR1_GPR_ENET1_TX_CLK_SEL_MASK |
IOMUXC_GPR_GPR1_GPR_ENET1_CLK_DIR_MASK), 0);
} else {
/* Use 125M anatop REF_CLK2 for ENET2, clear gpr1[14], gpr1[18]*/
clrsetbits_le32(&iomuxc_gpr_regs->gpr[1],
(IOMUXC_GPR_GPR1_GPR_ENET2_TX_CLK_SEL_MASK |
IOMUXC_GPR_GPR1_GPR_ENET2_CLK_DIR_MASK), 0);
}

ret = set_clk_enet(ENET_125MHz);
if (ret)
return ret;

return 0;
}


int board_phy_config(struct phy_device *phydev)
{
/* enable rgmii rxc skew and phy mode select to RGMII copper */
//phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x21);
//phy_write(phydev, MDIO_DEVAD_NONE, 0x1f, 0x7ea8);
//phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x2f);
//phy_write(phydev, MDIO_DEVAD_NONE, 0x1f, 0x71b7);

//below add for ar8035 diff with sabre

unsigned short val;

/* To enable AR8035 ouput a 125MHz clk from CLK_25M */
phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x7);
phy_write(phydev, MDIO_DEVAD_NONE, 0xe, 0x8016);
phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x4007);

val = phy_read(phydev, MDIO_DEVAD_NONE, 0xe);
val &= 0xffe7;
val |= 0x18;
phy_write(phydev, MDIO_DEVAD_NONE, 0xe, val);

/* introduce tx clock delay */
phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x5);
val = phy_read(phydev, MDIO_DEVAD_NONE, 0x1e);
val |= 0x0100;
phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, val);

if (phydev->drv->config)
phydev->drv->config(phydev);
return 0;
}
#endif

If  I delete  //imx_iomux_v3_setup_multiple_pads(phy1_rst_pads, ARRAY_SIZE(phy1_rst_pads));

then it will be ok. but the uboot log will send message :

Net: Phy 2 not found
PHY reset timed out

What's wrong?

FEC0 dose not work in boot now and before.

The dts file is seems to be ok now. 

0 Kudos

2,521 Views
BiyongSUN
NXP Employee
NXP Employee


Sugget you can use the DTS to try. 
You can debug in the following API to see if the GPIO really get and reset the  phy.
Also please measure by oscilloscope.

fec_main.c

static void fec_reset_phy(struct platform_device *pdev)
{
 int err, phy_reset;
 int msec = 1;
 struct device_node *np = pdev->dev.of_node;

 if (!np)
  return;

 err = of_property_read_u32(np, "phy-reset-duration", &msec);
 

/* A sane reset duration should not be longer than 1s */
 if (!err && msec > 1000)
  msec = 1;

 phy_reset = of_get_named_gpio(np, "phy-reset-gpios", 0);
 if (!gpio_is_valid(phy_reset))
  return;

 err = devm_gpio_request_one(&pdev->dev, phy_reset,
        GPIOF_OUT_INIT_LOW, "phy-reset");
 if (err) {
  dev_err(&pdev->dev, "failed to get phy-reset-gpios: %d\n", err);
  return;
 }
 msleep(msec);
 gpio_set_value(phy_reset, 1);
}
#else /* CONFIG_OF */
static void fec_reset_phy(struct platform_device *pdev)
{
 /*
  * In case of platform probe, the reset has been done
  * by machine code.
  */
}

I also seet  the following statement in the imx7d-wiseiot.dts

&iomuxc_lpsr {
 
pinctrl-names = "default";
 
pinctrl-0 = <&pinctrl_enet_refclk>;

 
imx7d-pico-miscpins {
  
pinctrl_enet_refclk: enet_refclk {


see the MX7D_PAD_UART3_RX_DATA__GPIO4_IO4    
fsl,pins = <
    
MX7D_PAD_GPIO1_IO01__CCM_ENET_REF_CLK3  0x1 
 

pinctrl_enet1: enet1grp {
   
fsl,pins = <
    
MX7D_PAD_GPIO1_IO10__ENET1_MDIO  0x3
    
MX7D_PAD_GPIO1_IO11__ENET1_MDC  0x3
                               
MX7D_PAD_UART3_RX_DATA__GPIO4_IO4  0x3


Suggest to use a clean DTS from NXP BSP to try.

0 Kudos

2,521 Views
BiyongSUN
NXP Employee
NXP Employee

I reviewed the schematic Ethernet1.pdf. For usinng ar8035 hardware design.

Please refer to the the hardware design for dual ethernet ar8031 in i.MX6SX. Please pay attention to the connections of clocks.

It should use the i.MX output for ar8035 or  using ar8035 for feeding i.MX clock.

In the i.MX6SX has those options.

无标题2.png

i.MX6SX schematic:

无标题.png
0 Kudos

2,521 Views
xing
Contributor I

my dts  fec1 fec2 redefine mdio mdc.

After I delet fec define,the log

loop: module loaded
CAN device driver interface
flexcan 30a10000.can: device registered (reg_base=f5a10000, irq=280)
30be0000.ethernet supply phy not found, using dummy regulator
pps pps0: new PPS source ptp0
libphy: fec_enet_mii_bus: probed
fec 30be0000.ethernet eth0: registered PHC device 0
30bf0000.ethernet supply phy not found, using dummy regulator
pps pps1: new PPS source ptp1
fec 30bf0000.ethernet (unnamed net_device) (uninitialized): Invalid MAC address: 00:00:00:00:00:00
fec 30bf0000.ethernet (unnamed net_device) (uninitialized): Using random MAC address: ba:66:c6:01:a8:ef
fec 30bf0000.ethernet eth1: registered PHC device 1
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-mxc: Freescale On-Chip EHCI Host driver
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usb_ehset_test
30b10200.usbmisc supply vbus-wakeup not found, using dummy regulator
30b20200.usbmisc supply vbus-wakeup not found, using dummy regulator
30b30200.usbmisc supply vbus-wakeup not found, using dummy regulator
mousedev: PS/2 mouse device common for all mice
input: 30370000.snvs:snvs-powerkey as /devices/platform/soc/30000000.aips-bus/30370000.snvs/30370000.snvs:snvs-powerkey/input/input0
snvs_rtc 30370000.snvs:snvs-rtc-lp: rtc core: registered 30370000.snvs:snvs- as rtc0

0 Kudos

2,521 Views
xing
Contributor I

Hi, Biyong Sun

I have rework the board, and set fec1 phy_id is to 2.

dts file add

phy-reset-duration = <10>;
the board still need mii info uboot  cmd .
now the log ,  the uboot board file and dts file.
U-Boot 2015.04 (Jun 26 2017 - 20:54:28)

CPU: Freescale i.MX7D rev1.2 at 792 MHz
CPU: Temperature -206 C
Reset cause: POR
Board: i.MX7D WISEIOT
I2C: ready
DRAM: 1 GiB
PMIC: PFUZE300 DEV_ID=0x30 REV_ID=0x11
MMC: FSL_SDHC: 0, FSL_SDHC: 1
No panel is detected: default to MCIMX28LCD
Display: MCIMX28LCD (800x480)
Video: 800x480x24
In: serial
Out: serial
Err: serial
switch to partitions #0, OK
mmc0 is current device
Net: FEC0
Normal Boot
Hit any key to stop autoboot: 0
=>
=>
=> mii info
PHY 0x02: OUI = 0x1374, Model = 0x07, Rev = 0x02, 100baseT, FDX
PHY 0x04: OUI = 0x1374, Model = 0x07, Rev = 0x02, 10baseT, HDX
=> boot
switch to partitions #0, OK
mmc0 is current device
switch to partitions #0, OK
mmc0 is current device
reading boot.scr
** Unable to read file boot.scr **
reading zImage
6629248 bytes read in 394 ms (16 MiB/s)
Booting from mmc ...
reading imx7d-wiseiot.dtb
39656 bytes read in 18 ms (2.1 MiB/s)
Kernel image @ 0x80800000 [ 0x000000 - 0x652780 ]
## Flattened Device Tree blob at 83000000
Booting using the fdt blob at 0x83000000
Using Device Tree in place at 83000000, end 8300cae7

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 4.1.15 (root@xing-pc) (gcc version 4.8.4 (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.1) ) #6 SMP PREEMPT Wed Jun 14 21:33:40 CST 2017
CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine model: Factontech wiseiot Board
Reserved memory: created CMA memory pool at 0xac000000, size 320 MiB
Reserved memory: initialized node linux,cma, compatible id shared-dma-pool
Memory policy: Data cache writealloc
PERCPU: Embedded 12 pages/cpu @ab721000 s16960 r8192 d24000 u49152
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 260096
Kernel command line: console=ttymxc0,115200 root=/dev/mmcblk0p2 rootwait rw
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: 698452K/1048576K available (8299K kernel code, 433K rwdata, 2896K rodata, 432K init, 450K bss, 22444K reserved, 327680K cma-reserved, 0K highmem)
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xc0800000 - 0xff000000 (1000 MB)
lowmem : 0x80000000 - 0xc0000000 (1024 MB)
pkmap : 0x7fe00000 - 0x80000000 ( 2 MB)
modules : 0x7f000000 - 0x7fe00000 ( 14 MB)
.text : 0x80008000 - 0x80af70a0 (11197 kB)
.init : 0x80af8000 - 0x80b64000 ( 432 kB)
.data : 0x80b64000 - 0x80bd0540 ( 434 kB)
.bss : 0x80bd3000 - 0x80c43a5c ( 451 kB)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
Preemptible hierarchical RCU implementation.
Additional per-CPU info printed with stalls.
RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
NR_IRQS:16 nr_irqs:16 16
Architected cp15 timer(s) running at 8.00MHz (phys).
clocksource arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 440795202120 ns
sched_clock: 56 bits at 8MHz, resolution 125ns, wraps every 2199023255500ns
Switching to timer-based delay loop, resolution 125ns
mxc_clocksource_init 3000000
Ignoring duplicate/late registration of read_current_timer delay
clocksource mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 637086815595 ns
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 16.00 BogoMIPS (lpj=80000)
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
/cpus/cpu@0 missing clock-frequency property
/cpus/cpu@1 missing clock-frequency property
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x80008280 - 0x800082d8
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
Brought up 2 CPUs
SMP: Total of 2 processors activated (32.00 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
device-tree: Duplicate name in lcdif@30730000, renamed to "display#1"
VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
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 ladder
cpuidle: using governor menu
DDR type is DDR3!
hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 8 bytes.
imx7d-pinctrl 302c0000.iomuxc-lpsr: initialized IMX pinctrl driver
imx7d-pinctrl 30330000.iomuxc: initialized IMX pinctrl driver
MU is ready for cross core communication!
mxs-dma 33000000.dma-apbh: initialized
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
30800000.aips-bus:usbphy_nop1 supply vcc not found, using dummy regulator
30800000.aips-bus:usbphy_nop2 supply vcc not found, using dummy regulator
i2c i2c-0: IMX I2C adapter registered
i2c i2c-0: can't use DMA
i2c i2c-2: IMX I2C adapter registered
i2c i2c-2: can't use DMA
i2c i2c-3: IMX I2C adapter registered
i2c i2c-3: can't use DMA
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
MIPI CSI2 driver module loaded
Advanced Linux Sound Architecture Driver Initialized.
Bluetooth: Core ver 2.20
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP socket layer initialized
Bluetooth: SCO socket layer initialized
Switched to clocksource arch_sys_counter
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.
imx rpmsg driver is registered.
Bus freq driver module loaded
futex hash table entries: 512 (order: 3, 32768 bytes)
VFS: Disk quotas dquot_6.6.0
VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
jffs2: version 2.2. (NAND) 漏 2001-2006 Red Hat, Inc.
fuse init (API version 7.23)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
backlight supply power not found, using dummy regulator
MIPI DSI driver module loaded
MIPI DSI driver module loaded
sii902x 2-0039: No reset pin found
sii902x 2-0039: Sii902x: cound not find device
30730000.lcdif supply lcd not found, using dummy regulator
mxsfb 30730000.lcdif: failed to find mxc display driver
Console: switching to colour frame buffer device 100x30
mxsfb 30730000.lcdif: initialized
imx-sdma 30bd0000.sdma: no event needs to be remapped
imx-sdma 30bd0000.sdma: loaded firmware 4.2
imx-sdma 30bd0000.sdma: initialized
pfuze100-regulator 0-0008: Full layer: 1, Metal layer: 1
pfuze100-regulator 0-0008: FAB: 0, FIN: 0
pfuze100-regulator 0-0008: pfuze3000 found.
30860000.serial: ttymxc0 at MMIO 0x30860000 (irq = 278, base_baud = 1500000) is a IMX
console [ttymxc0] enabled
30a80000.serial: ttymxc5 at MMIO 0x30a80000 (irq = 284, base_baud = 5000000) is a IMX
imx sema4 driver is registered.
[drm] Initialized drm 1.1.0 20060810
[drm] Initialized vivante 1.0.0 20120216 on minor 0
brd: module loaded
loop: module loaded
CAN device driver interface
flexcan 30a10000.can: device registered (reg_base=f5a10000, irq=280)
30be0000.ethernet supply phy not found, using dummy regulator
pps pps0: new PPS source ptp0
libphy: fec_enet_mii_bus: probed
fec 30be0000.ethernet eth0: registered PHC device 0
imx7d-pinctrl 30330000.iomuxc: pin MX7D_PAD_GPIO1_IO10 already requested by 30be0000.ethernet; cannot claim for 30bf0000.ethernet
imx7d-pinctrl 30330000.iomuxc: pin-7 (30bf0000.ethernet) status -22
imx7d-pinctrl 30330000.iomuxc: could not request pin 7 (MX7D_PAD_GPIO1_IO10) from group enet2grp on device 30330000.iomuxc
fec 30bf0000.ethernet: Error applying setting, reverse things back
30bf0000.ethernet supply phy not found, using dummy regulator
pps pps1: new PPS source ptp1
fec 30bf0000.ethernet (unnamed net_device) (uninitialized): Invalid MAC address: 00:00:00:00:00:00
fec 30bf0000.ethernet (unnamed net_device) (uninitialized): Using random MAC address: 52:41:37:b1:fd:f6
fec 30bf0000.ethernet eth1: registered PHC device 1
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-mxc: Freescale On-Chip EHCI Host driver
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usb_ehset_test
30b10200.usbmisc supply vbus-wakeup not found, using dummy regulator
30b20200.usbmisc supply vbus-wakeup not found, using dummy regulator
30b30200.usbmisc supply vbus-wakeup not found, using dummy regulator
mousedev: PS/2 mouse device common for all mice
input: 30370000.snvs:snvs-powerkey as /devices/platform/soc/30000000.aips-bus/30370000.snvs/30370000.snvs:snvs-powerkey/input/input0
snvs_rtc 30370000.snvs:snvs-rtc-lp: rtc core: registered 30370000.snvs:snvs- as rtc0
i2c /dev entries driver
IR NEC protocol handler initialized
IR RC5(x/sz) protocol handler initialized
IR RC6 protocol handler initialized
IR JVC protocol handler initialized
IR Sony protocol handler initialized
IR SANYO protocol handler initialized
IR Sharp protocol handler initialized
IR MCE Keyboard/mouse protocol handler initialized
IR XMP protocol handler initialized
pxp-v4l2 pxp_v4l2_out: initialized
imx2-wdt 30280000.wdog: use WDOG_B to reboot.
imx2-wdt 30280000.wdog: timeout 60 sec (nowayout=0)
Bluetooth: HCI UART driver ver 2.3
Bluetooth: HCI UART protocol H4 registered
Bluetooth: HCI UART protocol BCSP registered
Bluetooth: HCI UART protocol ATH3K registered
usbcore: registered new interface driver bcm203x
usbcore: registered new interface driver btusb
usbcore: registered new interface driver ath3k
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
/soc/aips-bus@30800000/usdhc@30b40000: voltage-ranges unspecified
sdhci-esdhc-imx 30b40000.usdhc: Got CD GPIO
sdhci-esdhc-imx 30b40000.usdhc: No vqmmc regulator found
mmc0: SDHCI controller on 30b40000.usdhc [30b40000.usdhc] using ADMA
/soc/aips-bus@30800000/usdhc@30b50000: voltage-ranges unspecified
sdhci-esdhc-imx 30b50000.usdhc: assigned as wifi host
sdhci-esdhc-imx 30b50000.usdhc: No vmmc regulator found
sdhci-esdhc-imx 30b50000.usdhc: No vqmmc regulator found
mmc0: host does not support reading read-only switch, assuming write-enable
mmc0: new high speed SDHC card at address b368
mmcblk0: mmc0:b368 SD 3.76 GiB
mmcblk0: p1 p2
mmc1: SDHCI controller on 30b50000.usdhc [30b50000.usdhc] using ADMA
/soc/aips-bus@30800000/usdhc@30b60000: voltage-ranges unspecified
sdhci-esdhc-imx 30b60000.usdhc: No vmmc regulator found
sdhci-esdhc-imx 30b60000.usdhc: No vqmmc regulator found
mmc2: SDHCI controller on 30b60000.usdhc [30b60000.usdhc] using ADMA
caam 30900000.caam: Entropy delay = 3200
caam 30900000.caam: Instantiated RNG4 SH0
caam 30900000.caam: Instantiated RNG4 SH1
caam 30900000.caam: device ID = 0x0a16030000000000 (Era -524)
caam 30900000.caam: job rings = 3, qi = 0
mmc2: MAN_BKOPS_EN bit is not set
mmc2: new HS400 MMC card at address 0001
mmcblk2: mmc2:0001 016G30 14.6 GiB
mmcblk2boot0: mmc2:0001 016G30 partition 1 4.00 MiB
mmcblk2boot1: mmc2:0001 016G30 partition 2 4.00 MiB
mmcblk2rpmb: mmc2:0001 016G30 partition 3 4.00 MiB
caam algorithms registered in /proc/crypto
caam_jr 30901000.jr0: registering rng-caam
platform caam_sm: blkkey_ex: 8 keystore units available
platform caam_sm: 64-bit clear key:
platform caam_sm: [0000] 00 01 02 03 04 0f 06 07
platform caam_sm: 64-bit black key:
platform caam_sm: [0000] 68 a9 a0 0e b8 09 43 65
platform caam_sm: [0008] c2 58 d1 1d b5 b9 18 cc
platform caam_sm: 128-bit clear key:
platform caam_sm: [0000] 00 01 02 03 04 0f 06 07
platform caam_sm: [0008] 08 09 0a 0b 0c 0d 0e 0f
platform caam_sm: 128-bit black key:
platform caam_sm: [0000] bf f7 b7 21 db 4a 5c ed
platform caam_sm: [0008] 5a 4c 5f b3 a6 5b 8f cb
platform caam_sm: 192-bit clear key:
platform caam_sm: [0000] 00 01 02 03 04 0f 06 07
platform caam_sm: [0008] 08 09 0a 0b 0c 0d 0e 0f
platform caam_sm: [0016] 10 11 12 13 14 15 16 17
platform caam_sm: 192-bit black key:
platform caam_sm: [0000] 98 08 d9 4d 7e cc 6e 84
platform caam_sm: [0008] 52 d1 20 12 cf 5b aa d0
platform caam_sm: [0016] d1 d7 13 2b 28 6c 8d 13
platform caam_sm: [0024] 32 d9 4f d1 18 27 9d 78
platform caam_sm: 256-bit clear key:
platform caam_sm: [0000] 00 01 02 03 04 0f 06 07
platform caam_sm: [0008] 08 09 0a 0b 0c 0d 0e 0f
platform caam_sm: [0016] 10 11 12 13 14 15 16 17
platform caam_sm: [0024] 18 19 1a 1b 1c 1d 1e 1f
platform caam_sm: 256-bit black key:
platform caam_sm: [0000] b6 67 84 37 48 ba df 54
platform caam_sm: [0008] fb b3 da a3 a2 b1 fa 00
platform caam_sm: [0016] 94 d8 b6 41 58 a8 27 30
platform caam_sm: [0024] 66 71 0e d1 2a 1a f6 1a
platform caam_sm: 64-bit unwritten blob:
platform caam_sm: [0000] 00 00 00 00 00 00 00 00
platform caam_sm: [0008] 00 00 00 00 00 00 00 00
platform caam_sm: [0016] 00 00 00 00 00 00 00 00
platform caam_sm: [0024] 00 00 00 00 00 00 00 00
platform caam_sm: [0032] 00 00 00 00 00 00 00 00
platform caam_sm: [0040] 00 00 00 00 00 00 00 00
platform caam_sm: [0048] 00 00 00 00 00 00 00 00
platform caam_sm: [0056] 00 00 00 00 00 00 00 00
platform caam_sm: [0064] 00 00 00 00 00 00 00 00
platform caam_sm: [0072] 00 00 00 00 00 00 00 00
platform caam_sm: [0080] 00 00 00 00 00 00 00 00
platform caam_sm: [0088] 00 00 00 00 00 00 00 00
platform caam_sm: 128-bit unwritten blob:
platform caam_sm: [0000] 00 00 00 00 00 00 00 00
platform caam_sm: [0008] 00 00 00 00 00 00 00 00
platform caam_sm: [0016] 00 00 00 00 00 00 00 00
platform caam_sm: [0024] 00 00 00 00 00 00 00 00
platform caam_sm: [0032] 00 00 00 00 00 00 00 00
platform caam_sm: [0040] 00 00 00 00 00 00 00 00
platform caam_sm: [0048] 00 00 00 00 00 00 00 00
platform caam_sm: [0056] 00 00 00 00 00 00 00 00
platform caam_sm: [0064] 00 00 00 00 00 00 00 00
platform caam_sm: [0072] 00 00 00 00 00 00 00 00
platform caam_sm: [0080] 00 00 00 00 00 00 00 00
platform caam_sm: [0088] 00 00 00 00 00 00 00 00
platform caam_sm: 196-bit unwritten blob:
platform caam_sm: [0000] 00 00 00 00 00 00 00 00
platform caam_sm: [0008] 00 00 00 00 00 00 00 00
platform caam_sm: [0016] 00 00 00 00 00 00 00 00
platform caam_sm: [0024] 00 00 00 00 00 00 00 00
platform caam_sm: [0032] 00 00 00 00 00 00 00 00
platform caam_sm: [0040] 00 00 00 00 00 00 00 00
platform caam_sm: [0048] 00 00 00 00 00 00 00 00
platform caam_sm: [0056] 00 00 00 00 00 00 00 00
platform caam_sm: [0064] 00 00 00 00 00 00 00 00
platform caam_sm: [0072] 00 00 00 00 00 00 00 00
platform caam_sm: [0080] 00 00 00 00 00 00 00 00
platform caam_sm: [0088] 00 00 00 00 00 00 00 00
platform caam_sm: 256-bit unwritten blob:
platform caam_sm: [0000] 00 00 00 00 00 00 00 00
platform caam_sm: [0008] 00 00 00 00 00 00 00 00
platform caam_sm: [0016] 00 00 00 00 00 00 00 00
platform caam_sm: [0024] 00 00 00 00 00 00 00 00
platform caam_sm: [0032] 00 00 00 00 00 00 00 00
platform caam_sm: [0040] 00 00 00 00 00 00 00 00
platform caam_sm: [0048] 00 00 00 00 00 00 00 00
platform caam_sm: [0056] 00 00 00 00 00 00 00 00
platform caam_sm: [0064] 00 00 00 00 00 00 00 00
platform caam_sm: [0072] 00 00 00 00 00 00 00 00
platform caam_sm: [0080] 00 00 00 00 00 00 00 00
platform caam_sm: [0088] 00 00 00 00 00 00 00 00
platform caam_sm: 64-bit black key in blob:
platform caam_sm: [0000] b8 46 4a 86 ca 9e d3 3e
platform caam_sm: [0008] 44 3b 2b 05 c7 70 53 14
platform caam_sm: [0016] a8 c5 55 f8 c9 09 b4 ba
platform caam_sm: [0024] ee 44 8e a1 89 eb ef 4c
platform caam_sm: [0032] ca 4b ec cb 28 3d 96 7f
platform caam_sm: [0040] ef 2e cb bd c1 52 3d 15
platform caam_sm: [0048] cf bc 31 e2 97 36 c5 02
platform caam_sm: [0056] 00 00 00 00 00 00 00 00
platform caam_sm: [0064] 00 00 00 00 00 00 00 00
platform caam_sm: [0072] 00 00 00 00 00 00 00 00
platform caam_sm: [0080] 00 00 00 00 00 00 00 00
platform caam_sm: [0088] 00 00 00 00 00 00 00 00
platform caam_sm: 128-bit black key in blob:
platform caam_sm: [0000] ea 1e b5 33 65 b0 08 fa
platform caam_sm: [0008] 1e 17 cb d4 30 f4 d3 16
platform caam_sm: [0016] 07 71 7e 69 60 68 4a 77
platform caam_sm: [0024] 13 8f 6a 4c 8d 99 ee 38
platform caam_sm: [0032] dc 40 08 08 d2 81 81 07
platform caam_sm: [0040] 10 34 55 70 7e b0 7f 8d
platform caam_sm: [0048] 5c 3d 08 40 37 54 76 d8
platform caam_sm: [0056] bd f2 ab 13 75 cc 04 3c
platform caam_sm: [0064] 00 00 00 00 00 00 00 00
platform caam_sm: [0072] 00 00 00 00 00 00 00 00
platform caam_sm: [0080] 00 00 00 00 00 00 00 00
platform caam_sm: [0088] 00 00 00 00 00 00 00 00
platform caam_sm: 192-bit black key in blob:
platform caam_sm: [0000] 93 dd 84 a9 ba 0c db 50
platform caam_sm: [0008] cf b1 5d 44 97 94 5c 38
platform caam_sm: [0016] e5 5e db 3c bd 75 88 c6
platform caam_sm: [0024] 4b c6 96 ee 62 09 37 03
platform caam_sm: [0032] 24 1e 16 8e 40 c2 ff fc
platform caam_sm: [0040] 1d 5f 0d e5 5f 31 fc 7b
platform caam_sm: [0048] d9 91 08 b9 a1 81 5b 25
platform caam_sm: [0056] be 85 49 3e e2 1a 13 99
platform caam_sm: [0064] 69 4c c4 f9 09 24 1f 20
platform caam_sm: [0072] 00 00 00 00 00 00 00 00
platform caam_sm: [0080] 00 00 00 00 00 00 00 00
platform caam_sm: [0088] 00 00 00 00 00 00 00 00
platform caam_sm: 256-bit black key in blob:
platform caam_sm: [0000] ef 9a 65 79 5f c5 74 4b
platform caam_sm: [0008] c9 8c 43 61 2e 9d 46 4f
platform caam_sm: [0016] 2a fc 0e 78 4c 14 52 5e
platform caam_sm: [0024] f9 45 27 e3 4f e3 4b ed
platform caam_sm: [0032] ad 21 27 75 77 06 cd c1
platform caam_sm: [0040] e6 22 c1 e7 32 61 ec d5
platform caam_sm: [0048] ed 24 7a 7f de 7a a4 3a
platform caam_sm: [0056] 54 b6 3e 73 ab 00 8a 27
platform caam_sm: [0064] 94 f2 7a 20 cc f1 7f cd
platform caam_sm: [0072] 4c 0a ab 13 09 17 e0 4c
platform caam_sm: [0080] 00 00 00 00 00 00 00 00
platform caam_sm: [0088] 00 00 00 00 00 00 00 00
platform caam_sm: restored 64-bit black key:
platform caam_sm: [0000] ea 71 0b 68 f6 88 7e 63
platform caam_sm: [0008] 72 07 08 42 25 dc 15 43
platform caam_sm: restored 128-bit black key:
platform caam_sm: [0000] bf f7 b7 21 db 4a 5c ed
platform caam_sm: [0008] 5a 4c 5f b3 a6 5b 8f cb
platform caam_sm: restored 192-bit black key:
platform caam_sm: [0000] 98 08 d9 4d 7e cc 6e 84
platform caam_sm: [0008] 52 d1 20 12 cf 5b aa d0
platform caam_sm: [0016] 39 0f 09 40 49 93 04 4d
platform caam_sm: [0024] f9 3a 6a 7f 32 1b f4 61
platform caam_sm: restored 256-bit black key:
platform caam_sm: [0000] b6 67 84 37 48 ba df 54
platform caam_sm: [0008] fb b3 da a3 a2 b1 fa 00
platform caam_sm: [0016] 94 d8 b6 41 58 a8 27 30
platform caam_sm: [0024] 66 71 0e d1 2a 1a f6 1a
snvs-secvio 30370000.caam-snvs: can't get snvs clock
snvs-secvio 30370000.caam-snvs: violation handlers armed - non-secure state
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
NET: Registered protocol family 26
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
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM ver 1.11
Bluetooth: BNEP (Ethernet Emulation) ver 1.3
Bluetooth: BNEP filters: protocol multicast
Bluetooth: BNEP socket layer initialized
Bluetooth: HIDP (Human Interface Emulation) ver 1.2
Bluetooth: HIDP socket layer initialized
8021q: 802.1Q VLAN Support v1.8
Key type dns_resolver registered
cpu cpu0: dev_pm_opp_get_opp_count: device OPP not found (-19)
backlight supply power not found, using dummy regulator
backlight supply power not found, using dummy regulator
dhd_module_init in
Power-up adapter 'DHD generic adapter'
wifi_platform_bus_enumerate device present 1
mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
mmc1: queuing unknown CIS tuple 0x91 (3 bytes)
mmc1: new ultra high speed SDR104 SDIO card at address 0001
backlight supply power not found, using dummy regulator
backlight supply power not found, using dummy regulator
F1 signature OK, socitype:0x1 chip:0x4339 rev:0x1 pkg:0x2
backlight supply power not found, using dummy regulator
DHD: dongle ram size is set to 786432(orig 786432) at 0x180000
wifi_platform_get_mac_addr
CFG80211-ERROR) wl_setup_wiphy : Registering Vendor80211)
wl_create_event_handler(): thread:wl_event_handler:95 started
CFG80211-ERROR) wl_event_handler : tsk Enter, tsk = 0xa85c143c
dhd_attach(): thread:dhd_watchdog_thread:96 started
dhd_attach(): thread:dhd_dpc:97 started
dhd_deferred_work_init: work queue initialized

Dongle Host Driver, version 1.141.88 (r)
Compiled from
Register interface [wlan0] MAC: 00:90:4c:11:22:33

CFG80211-ERROR) wl_event_handler : was terminated
wl_destroy_event_handler(): thread:wl_event_handler:95 terminated OK
dhd_prot_ioctl : bus is down. we have nothing to do
backlight supply power not found, using dummy regulator
snvs_rtc 30370000.snvs:snvs-rtc-lp: setting system clock to 1970-01-01 00:00:01 UTC (1)
backlight supply power not found, using dummy regulator
wlreg_on: disabling
can2-3v3: disabling
usb_otg1_vbus: disabling
ALSA device list:
No soundcards found.
random: nonblocking pool is initialized
kjournald starting. Commit interval 5 seconds
EXT3-fs (mmcblk0p2): using internal journal
EXT3-fs (mmcblk0p2): recovery complete
EXT3-fs (mmcblk0p2): mounted filesystem with ordered data mode
VFS: Mounted root (ext3 filesystem) on device 179:2.
devtmpfs: mounted
Freeing unused kernel memory: 432K (80af8000 - 80b64000)
INIT: version 2.88 booting
Starting udev
udevd[193]: starting version 182
bootlogd: cannot allocate pseudo tty: No such file or directory
FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
ALSA: Restoring mixer settings...
/usr/sbin/alsactl: load_state:1735: No soundcards found...
Thu Jun 30 10:55:12 UTC 2016
INIT: Entering runlevel: 5
Configuring network interfaces... fec 30be0000.ethernet eth0: Freescale FEC PHY driver [Atheros 8035 ethernet] (mii_bus:phy_addr=30be0000.etherne:02, irq=-1)
IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
done.
Starting Xserver
Starting system message bus: dbus.
Starting Connection Manager
Starting Dropbear SSH server: dropbear.
Starting rpcbind daemon...fec 30bf0000.ethernet eth1: Freescale FEC PHY driver [Atheros 8035 ethernet] (mii_bus:phy_addr=30be0000.etherne:04, irq=-1)
IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
done.
starting statd: done
Starting advanced power management daemon: No APM support in kernel
(failed.)
exportfs: can't open /etc/exports for reading
NFS daemon support not enabled in kernel
Starting syslogd/klogd: done
* Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon
...done.
Starting Telephony daemon
Starting Linux NFC daemon
Running local boot scripts (/etc/rc.local).

Freescale i.MX Release Distro 4.1.15-1.2.0 wiseiot /dev/ttymxc0

wiseiot login: fec 30be0000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready


Freescale i.MX Release Distro 4.1.15-1.2.0 wiseiot /dev/ttymxc0

wiseiot login: root
root@wiseiot:~# ifconfig eth0 192.168.1.3
root@wiseiot:~# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: seq=0 ttl=64 time=2.531 ms
64 bytes from 192.168.1.1: seq=1 ttl=64 time=1.368 ms
64 bytes from 192.168.1.1: seq=2 ttl=64 time=1.319 ms
^C
--- 192.168.1.1 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 1.319/1.739/2.531 ms
root@wiseiot:~#
0 Kudos

2,521 Views
BiyongSUN
NXP Employee
NXP Employee

First of all, in your log, the pin has confilct for eth0.

In the uboot, the clock is shared.

So please reset the phy in the kernel by gpio.

You can refer to the binding guide  Documentation\devicetree\bindings\net\fsl-fec.txt

- phy-reset-gpios : Should specify the gpio for phy reset
- phy-reset-duration : Reset duration in milliseconds.  Should present

The conflict in your log:

ps pps0: new PPS source ptp0
libphy: fec_enet_mii_bus: probed
fec 30be0000.ethernet eth0: registered PHC device 0
imx7d-pinctrl 30330000.iomuxc: pin MX7D_PAD_GPIO1_IO10 already requested by 30be0000.ethernet; cannot claim for 30bf0000.ethernet
imx7d-pinctrl 30330000.iomuxc: pin-7 (30bf0000.ethernet) status -22
imx7d-pinctrl 30330000.iomuxc: could not request pin 7 (MX7D_PAD_GPIO1_IO10) from group enet2grp on device 30330000.iomuxc
fec 30bf0000.ethernet: Error applying setting, reverse things back
30bf0000.ethernet supply phy not found, using dummy regulator
pps pps1: new PPS source ptp1
fec 30bf0000.ethernet (unnamed net_device) (uninitialized): Invalid MAC address: 00:00:00:00:00:00
fec 30bf0000.ethernet (unnamed net_device) (uninitialized): Using random MAC address: 52:41:37:b1:fd:f6

0 Kudos

2,521 Views
xing
Contributor I

Hi, Biyong Sun

Thank you reply. I have test by changing phyid at 0x02, but it does not work.

And now the fec2 is ok in kernel .

When I use the mii info cmd in uboot  and then boot the kernel, the fec1 can work now.

If there is no mii info cmd, the fec1 will not work.

The fec1 phy id is still 0  now.

So we can fix the problem on software. I miss somthing in kernel?  Please help me!

=> mii info
PHY 0x00: OUI = 0x1374, Model = 0x07, Rev = 0x02, 100baseT, FDX
PHY 0x04: OUI = 0x1374, Model = 0x07, Rev = 0x02, 10baseT, HDX

Freescale i.MX Release Distro 4.1.15-1.2.0 wiseiot /dev/ttymxc0

wiseiot login: fec 30be0000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready


Freescale i.MX Release Distro 4.1.15-1.2.0 wiseiot /dev/ttymxc0

wiseiot login: root
root@wiseiot:~# ifconfig eth0 192.168.1.2
root@wiseiot:~# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: seq=0 ttl=64 time=2.482 ms
64 bytes from 192.168.1.1: seq=1 ttl=64 time=1.344 ms
64 bytes from 192.168.1.1: seq=2 ttl=64 time=1.291 ms
64 bytes from 192.168.1.1: seq=3 ttl=64 time=1.327 ms
64 bytes from 192.168.1.1: seq=4 ttl=64 time=1.332 ms
^C
--- 192.168.1.1 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 1.291/1.555/2.482 ms
root@wiseiot:~#

0 Kudos

2,521 Views
BiyongSUN
NXP Employee
NXP Employee

If you don't define the phyid as the BSP release, it will do the autoscan from phyid 0. But in you hardward design the 0 should be the broadcast PHY address not  unique PHY address..

The phy address is defined by "hardware". Please check the hardware design then make it in dts.

You log shows you are using the autoscan. And the 0 phyid is got.

Untitled.png

So I provided the two ways in the previous reply. One is to use dts to define, of course according to the hardware design.

If not define the phyid in the dts to use the autoscan. Make changes in the kernel C code, to scan from 1 not 0.

It is the same in the uboot. and you will see the phyid in the result. and the software will automatically set the phyid for you.  

For the uboot,

1. so far, it doesn't support two ethernet interface. It is not neccessary to support two ethernet interfaces in uboot.

2.   also you can use  and certain address for the mii info  command: mii info   <addr>                     - display MII PHY info

3. In the hardware design, you can make PHY Address 0 set as unique PHY address. Broadcast phy address 0 is not used under your case.

4. If you cannot re-work the hardware, you can make the mirror change as it is in the Linux kernel.

    To scan from 1 not 0.

 

uboot-imx\common\miiphyutil.c

void mdio_list_devices(void)
{
 struct list_head *entry;

 list_for_each(entry, &mii_devs) {
  int i;
  struct mii_dev *bus = list_entry(entry, struct mii_dev, link);

  printf("%s:\n", bus->name);

 //for (i = 0; i < PHY_MAX_ADDR; i++) {

  for (i = 1; i < PHY_MAX_ADDR; i++) {
   struct phy_device *phydev = bus->phymap[i];

   if (phydev) {
    printf("%d - %s", i, phydev->drv->name);

    if (phydev->dev)
     printf(" <--> %s\n", phydev->dev->name);
    else
     printf("\n");
   }
  }
 }
}

In the previous reply:

For the kernel

fec_main.c:

 

tatic int fec_enet_mii_probe(struct net_device *ndev)
{
 struct fec_enet_private *fep = netdev_priv(ndev);
 struct phy_device *phy_dev = NULL;
 char mdio_bus_id[MII_BUS_ID_SIZE];
 char phy_name[MII_BUS_ID_SIZE + 3];
 int phy_id;
 int dev_id = fep->dev_id;

 fep->phy_dev = NULL;

 if (fep->phy_node) {
  phy_dev = of_phy_connect(ndev, fep->phy_node,
      &fec_enet_adjust_link, 0,
      fep->phy_interface);
  if (!phy_dev)
   return -ENODEV;
 } else {
  /* check for attached phy */
  //for (phy_id = 0; (phy_id < PHY_MAX_ADDR); phy_id++) {

 for (phy_id = 1; (phy_id < PHY_MAX_ADDR); phy_id++) {
   if ((fep->mii_bus->phy_mask & (1 << phy_id)))
    continue;
   if (fep->mii_bus->phy_map[phy_id] == NULL)
    continue;
   if (fep->mii_bus->phy_map[phy_id]->phy_id == 0)
    continue;
   if (dev_id--)
    continue;
   strlcpy(mdio_bus_id, fep->mii_bus->id, MII_BUS_ID_SIZE);
   break;
  }

0 Kudos

2,521 Views
BiyongSUN
NXP Employee
NXP Employee

从log 来看 用的PHY的地址ID是 00 是一个广播地址。 这个应该是硬件设计的问题。

在device tree 里面根据硬件设计配置一下PHYID 再试验一下。

或者改一下fec_main.c 从 1 开始找phy 而不是0

 //for (phy_id = 0; (phy_id < PHY_MAX_ADDR); phy_id++) {

 for (phy_id = 1; (phy_id < PHY_MAX_ADDR); phy_id++) {

dts:

&fec1 {
 pinctrl-names = "default";
 pinctrl-0 = <&pinctrl_enet1>;
 pinctrl-assert-gpios = <&gpio_spi 5 GPIO_ACTIVE_HIGH>;
 assigned-clocks = <&clks IMX7D_ENET1_TIME_ROOT_SRC>,
     <&clks IMX7D_ENET1_TIME_ROOT_CLK>;
 assigned-clock-parents = <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>;
 assigned-clock-rates = <0>, <100000000>;
 phy-mode = "rgmii";
 phy-handle = <&ethphy0>;
 fsl,magic-packet;
 status = "okay";

 mdio {
  #address-cells = <1>;
  #size-cells = <0>;

  ethphy0: ethernet-phy@0 {
   compatible = "ethernet-phy-ieee802.3-c22";
   reg = <0>;
  };

  ethphy1: ethernet-phy@1 {
   compatible = "ethernet-phy-ieee802.3-c22";
   reg = <1>;
  };
 };
};

&fec2 {
 pinctrl-names = "default";
 pinctrl-0 = <&pinctrl_enet2 &pinctrl_enet2_epdc0_en>;
 pinctrl-assert-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
 assigned-clocks = <&clks IMX7D_ENET2_TIME_ROOT_SRC>,
     <&clks IMX7D_ENET2_TIME_ROOT_CLK>;
 assigned-clock-parents = <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>;
 assigned-clock-rates = <0>, <100000000>;
 phy-mode = "rgmii";
 phy-handle = <&ethphy1>;
 fsl,magic-packet;
 status = "okay";
};

fec_main.c:

tatic int fec_enet_mii_probe(struct net_device *ndev)
{
 struct fec_enet_private *fep = netdev_priv(ndev);
 struct phy_device *phy_dev = NULL;
 char mdio_bus_id[MII_BUS_ID_SIZE];
 char phy_name[MII_BUS_ID_SIZE + 3];
 int phy_id;
 int dev_id = fep->dev_id;

 fep->phy_dev = NULL;

 if (fep->phy_node) {
  phy_dev = of_phy_connect(ndev, fep->phy_node,
      &fec_enet_adjust_link, 0,
      fep->phy_interface);
  if (!phy_dev)
   return -ENODEV;
 } else {
  /* check for attached phy */
  //for (phy_id = 0; (phy_id < PHY_MAX_ADDR); phy_id++) {

 for (phy_id = 1; (phy_id < PHY_MAX_ADDR); phy_id++) {
   if ((fep->mii_bus->phy_mask & (1 << phy_id)))
    continue;
   if (fep->mii_bus->phy_map[phy_id] == NULL)
    continue;
   if (fep->mii_bus->phy_map[phy_id]->phy_id == 0)
    continue;
   if (dev_id--)
    continue;
   strlcpy(mdio_bus_id, fep->mii_bus->id, MII_BUS_ID_SIZE);
   break;
  }

0 Kudos

2,521 Views
xing
Contributor I
in UBOOT:
=> mii info
PHY 0x00: OUI = 0x1374, Model = 0x07, Rev = 0x02, 100baseT, FDX
PHY 0x04: OUI = 0x1374, Model = 0x07, Rev = 0x02, 10baseT, HDX
CLK_25M   output 25MHz
0 Kudos

2,521 Views
igorpadykov
NXP Employee
NXP Employee

Hi tian

please check with oscilloscope if rgmii timings conform to

Table 71. RGMII signal switching specifications i.MX7D Reference Manual

http://cache.nxp.com/files/32bit/doc/ref_manual/IMX7DRM.pdf

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos