From: Wolfgang Wegner <wolfgang@leila.ping.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] several problems with ethernet on MCF5445x
Date: Fri, 26 Mar 2010 17:19:12 +0100 [thread overview]
Message-ID: <20100326161912.GA23389@leila.ping.de> (raw)
In-Reply-To: <4BACDBED.20549.15E1640@w.wegner.astro-kom.de>
Hi all,
the problems boiled down to two things:
- full MII and non-shared MII-management interface is not
currently supported for MCF5445x
- when a PHY returns id 0x0, matching for this ID results in
a lock-up in mcfmii.c
considering PHY ID 0x0 as broken anyways, I could get my board
to run with both ethernet interfaces with the patch below. As this
is not yet thoroughly tested and my tree is too much out of sync
at the moment, I do not provide a proper patch for now, but maybe
this already helps somebody else in case he runs into the same
problems.
Regards,
Wolfgang
diff --git a/cpu/mcf5445x/cpu_init.c b/cpu/mcf5445x/cpu_init.c
index 48b37df..8b86d6d 100644
--- a/cpu/mcf5445x/cpu_init.c
+++ b/cpu/mcf5445x/cpu_init.c
@@ -152,13 +152,32 @@ int fecpin_setclear(struct eth_device *dev, int setclear)
struct fec_info_s *info = (struct fec_info_s *)dev->priv;
if (setclear) {
+#ifdef CONFIG_SYS_FEC_NO_SHARED_MII
+ if (info->iobase == CONFIG_SYS_FEC0_IOBASE)
+ gpio->par_feci2c |=
+ (GPIO_PAR_FECI2C_MDC0_MDC0 |
+ GPIO_PAR_FECI2C_MDIO0_MDIO0);
+ else
+ gpio->par_feci2c |=
+ (GPIO_PAR_FECI2C_MDC1_MDC1 |
+ GPIO_PAR_FECI2C_MDIO1_MDIO1);
+#else
gpio->par_feci2c |=
(GPIO_PAR_FECI2C_MDC0_MDC0 | GPIO_PAR_FECI2C_MDIO0_MDIO0);
+#endif
if (info->iobase == CONFIG_SYS_FEC0_IOBASE)
+#ifdef CONFIG_SYS_FEC_FULL_MII
+ gpio->par_fec |= GPIO_PAR_FEC_FEC0_MII;
+#else
gpio->par_fec |= GPIO_PAR_FEC_FEC0_RMII_GPIO;
+#endif
else
+#ifdef CONFIG_SYS_FEC_FULL_MII
+ gpio->par_fec |= GPIO_PAR_FEC_FEC1_MII;
+#else
gpio->par_fec |= GPIO_PAR_FEC_FEC1_RMII_ATA;
+#endif
} else {
gpio->par_feci2c &=
~(GPIO_PAR_FECI2C_MDC0_MDC0 | GPIO_PAR_FECI2C_MDIO0_MDIO0);
diff --git a/drivers/net/mcfmii.c b/drivers/net/mcfmii.c
index 4acc29e..e83bb07 100644
--- a/drivers/net/mcfmii.c
+++ b/drivers/net/mcfmii.c
@@ -185,7 +185,10 @@ int mii_discover_phy(struct eth_device *dev)
printf("PHY @ 0x%x pass %d\n", phyno, pass);
#endif
- for (i = 0; i < (sizeof(phyinfo) / sizeof(phy_info_t)); i++) {
+ for (i = 0;
+ (i < (sizeof(phyinfo) / sizeof(phy_info_t)))
+ && (phyinfo[i].phyid != 0);
+ i++) {
if (phyinfo[i].phyid == phytype) {
#ifdef ET_DEBUG
printf("phyid %x - %s\n",
next prev parent reply other threads:[~2010-03-26 16:19 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-23 14:50 [U-Boot] several problems with ethernet on MCF5445x w.wegner at astro-kom.de
2010-03-23 15:11 ` John Schmoller
2010-03-23 15:40 ` w.wegner at astro-kom.de
2010-03-23 16:10 ` Liew Tsi Chung-R5AAHP
2010-03-26 13:13 ` w.wegner at astro-kom.de
2010-03-26 14:55 ` w.wegner at astro-kom.de
2010-03-26 15:08 ` w.wegner at astro-kom.de
2010-03-26 16:19 ` Wolfgang Wegner [this message]
2010-03-30 17:19 ` [U-Boot] [PATCH] fix lockup in mcfmii/mii_discover_phy() in case communication fails Wolfgang Wegner
2010-03-30 17:19 ` [U-Boot] [PATCH] add CONFIG_SYS_FEC_NO_SHARED_PHY for MCF5445x Wolfgang Wegner
2010-03-30 17:19 ` [U-Boot] [PATCH] add CONFIG_SYS_FEC_FULL_MII " Wolfgang Wegner
2010-03-30 17:24 ` [U-Boot] [PATCH] add CONFIG_SYS_FEC_NO_SHARED_PHY " Liew Tsi Chung-R5AAHP
2010-04-05 5:44 ` [U-Boot] [PATCH] fix lockup in mcfmii/mii_discover_phy() in case communication fails Ben Warren
2010-04-06 8:38 ` w.wegner at astro-kom.de
2010-04-06 9:13 ` [U-Boot] [PATCH v2 RFC] " Wolfgang Wegner
2010-04-06 17:10 ` Ben Warren
2010-04-06 9:15 ` [U-Boot] [PATCH] " w.wegner at astro-kom.de
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=20100326161912.GA23389@leila.ping.de \
--to=wolfgang@leila.ping.de \
--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