Commit 575c5cc0 authored by Troy Kisky's avatar Troy Kisky Committed by Stefano Babic
Browse files

net: fec_mxc: change fec_mii_setspeed parameter

Only the hardware ethernet registers are needed
for this function, so don't pass the more general
structure. I'm trying to separate MII and fec.

This also fixes MX28 fec_mii_setspeed use on secondary ethernet port

This was found by inspection of the code and should be
checked on real hardware.
Signed-off-by: default avatarTroy Kisky <>
parent 09439c31
......@@ -135,15 +135,15 @@ static int fec_mdio_read(struct ethernet_regs *eth, uint8_t phyAddr,
return val;
static void fec_mii_setspeed(struct fec_priv *fec)
static void fec_mii_setspeed(struct ethernet_regs *eth)
* Set MII_SPEED = (1/(mii_speed * 2)) * System Clock
* and do not drop the Preamble.
writel((((imx_get_fecclk() / 1000000) + 2) / 5) << 1,
debug("%s: mii_speed %08x\n", __func__, readl(&fec->eth->mii_speed));
debug("%s: mii_speed %08x\n", __func__, readl(&eth->mii_speed));
static int fec_mdio_write(struct ethernet_regs *eth, uint8_t phyAddr,
......@@ -611,7 +611,7 @@ static int fec_init(struct eth_device *dev, bd_t* bd)
if (fec->xcv_type != SEVENWIRE)
* Set Opcode/Pause Duration Register
......@@ -966,7 +966,6 @@ static int fec_probe(bd_t *bd, int dev_id, int phy_id, uint32_t base_addr)
if (dev_id == -1) {
sprintf(edev->name, "FEC");
......@@ -995,6 +994,7 @@ static int fec_probe(bd_t *bd, int dev_id, int phy_id, uint32_t base_addr)
bus->priv = fec->eth;
ret = mdio_register(bus);
if (ret) {
printf("mdio_register failed\n");
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment