From: muaddib <muaddib1981@mail.ru>
To: u-boot@lists.denx.de
Subject: [U-Boot] mdio error on ar9344
Date: Tue, 23 Apr 2019 14:48:29 +0300 [thread overview]
Message-ID: <1556020109.884156161@f466.i.mail.ru> (raw)
Hi, I am using device based on Atheros AR9344.
When U-Boot initialize net device I get error
mdio_register: non unique device name 'gmac0'
dm tree command shows that eth_ag7xxx is not probed.
ag7xxx_eth_probe -> ag7xxx_mac_probe -> ag933x_phy_setup -> ag933x_phy_setup_reset_set -> ag7xxx_mdio_write -> ag7xxx_mdio_rw
return -ETIMEDOUT
because ag7xxx_switch_reg_read return 0xFFFFFFFF, see below
static int ag7xxx_mdio_rw(struct mii_dev *bus, int addr, int reg, u32 val)
{
u32 data;
unsigned long start;
int ret;
// No idea if this is long enough or too long
int timeout_ms = 1000;
// Dummy read followed by PHY read/write command.
ret = ag7xxx_switch_reg_read(bus, 0x98, &data);
if (ret < 0)
return ret;
data = val | (reg << 16) | (addr << 21) | BIT(30) | BIT(31);
ret = ag7xxx_switch_reg_write(bus, 0x98, data);
if (ret < 0)
return ret;
start = get_timer(0);
// Wait for operation to finish
do {
ret = ag7xxx_switch_reg_read(bus, 0x98, &data);
if (ret < 0)
return ret;
if (get_timer(start) > timeout_ms)
return -ETIMEDOUT;
} while (data & BIT(31));
return data & 0xffff;
}
I use tplink_wdr4320 u-boot profile for my device.
reply other threads:[~2019-04-23 11:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1556020109.884156161@f466.i.mail.ru \
--to=muaddib1981@mail.ru \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox