* [U-Boot] [PATCH v2 1/3] at91_emac.h: fix typo in register definition
@ 2010-09-07 17:10 Andreas Bießmann
2010-09-07 17:10 ` [U-Boot] [PATCH 2/3] at91_emac.c: fix 'Warning: eth device name has a space!' Andreas Bießmann
2010-09-07 17:10 ` [U-Boot] [PATCH 3/3] at91_emac.c: poll for IDLE when writing PHY Andreas Bießmann
0 siblings, 2 replies; 6+ messages in thread
From: Andreas Bießmann @ 2010-09-07 17:10 UTC (permalink / raw)
To: u-boot
Signed-off-by: Andreas Bie?mann <andreas.devel@googlemail.com>
Acked-by: Jens Scharsig <js_at_ng@scharsoft.de>
---
v2:
Acked-by: Jens Scharsig see http://article.gmane.org/gmane.comp.boot-loaders.u-boot/83624
additionally add this patch to a series of other patches related to atmel_emac driver
arch/arm/include/asm/arch-at91/at91_emac.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/include/asm/arch-at91/at91_emac.h b/arch/arm/include/asm/arch-at91/at91_emac.h
index 45ae333..0e2ff78 100644
--- a/arch/arm/include/asm/arch-at91/at91_emac.h
+++ b/arch/arm/include/asm/arch-at91/at91_emac.h
@@ -61,7 +61,7 @@ typedef struct at91_emac {
u32 reserved2[3];
u32 hsh;
u32 hsl;
- u32 sh1l;
+ u32 sa1l;
u32 sa1h;
u32 sa2l;
u32 sa2h;
--
1.7.2.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 2/3] at91_emac.c: fix 'Warning: eth device name has a space!'
2010-09-07 17:10 [U-Boot] [PATCH v2 1/3] at91_emac.h: fix typo in register definition Andreas Bießmann
@ 2010-09-07 17:10 ` Andreas Bießmann
2010-09-10 12:54 ` Reinhard Meyer
2010-09-23 8:48 ` Reinhard Meyer
2010-09-07 17:10 ` [U-Boot] [PATCH 3/3] at91_emac.c: poll for IDLE when writing PHY Andreas Bießmann
1 sibling, 2 replies; 6+ messages in thread
From: Andreas Bießmann @ 2010-09-07 17:10 UTC (permalink / raw)
To: u-boot
This patch also removes conditional nameing of at91_emac driver whether it's
connection to PHY is RMII or MII.
Signed-off-by: Andreas Bie?mann <andreas.devel@googlemail.com>
---
drivers/net/at91_emac.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/drivers/net/at91_emac.c b/drivers/net/at91_emac.c
index d82459b..69e5409 100644
--- a/drivers/net/at91_emac.c
+++ b/drivers/net/at91_emac.c
@@ -500,11 +500,7 @@ int at91emac_register(bd_t *bis, unsigned long iobase)
memset(emacfix, 0, sizeof(emac_device));
memset(dev, 0, sizeof(*dev));
-#ifndef CONFIG_RMII
- sprintf(dev->name, "AT91 EMAC");
-#else
- sprintf(dev->name, "AT91 EMAC RMII");
-#endif
+ sprintf(dev->name, "at91_emac");
dev->iobase = iobase;
dev->priv = emacfix;
dev->init = at91emac_init;
--
1.7.2.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 3/3] at91_emac.c: poll for IDLE when writing PHY
2010-09-07 17:10 [U-Boot] [PATCH v2 1/3] at91_emac.h: fix typo in register definition Andreas Bießmann
2010-09-07 17:10 ` [U-Boot] [PATCH 2/3] at91_emac.c: fix 'Warning: eth device name has a space!' Andreas Bießmann
@ 2010-09-07 17:10 ` Andreas Bießmann
2010-09-23 8:49 ` Reinhard Meyer
1 sibling, 1 reply; 6+ messages in thread
From: Andreas Bießmann @ 2010-09-07 17:10 UTC (permalink / raw)
To: u-boot
This patch replaces the unnecessary waiting in at91emac_read() and
at91emac_write() by checking the IDLE flag.
Signed-off-by: Andreas Bie?mann <andreas.devel@googlemail.com>
---
drivers/net/at91_emac.c | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/net/at91_emac.c b/drivers/net/at91_emac.c
index 69e5409..219c8c7 100644
--- a/drivers/net/at91_emac.c
+++ b/drivers/net/at91_emac.c
@@ -127,13 +127,19 @@ void at91emac_DisableMDIO(at91_emac_t *at91mac)
int at91emac_read(at91_emac_t *at91mac, unsigned char addr,
unsigned char reg, unsigned short *value)
{
+ unsigned long netstat;
at91emac_EnableMDIO(at91mac);
writel(AT91_EMAC_MAN_HIGH | AT91_EMAC_MAN_RW_R |
AT91_EMAC_MAN_REGA(reg) | AT91_EMAC_MAN_CODE_802_3 |
AT91_EMAC_MAN_PHYA(addr),
&at91mac->man);
- udelay(10000);
+
+ do {
+ netstat = readl(&at91mac->sr);
+ DEBUG_AT91PHY("poll SR %08lx\n", netstat);
+ } while (!(netstat & AT91_EMAC_SR_IDLE));
+
*value = readl(&at91mac->man) & AT91_EMAC_MAN_DATA_MASK;
at91emac_DisableMDIO(at91mac);
@@ -146,6 +152,7 @@ int at91emac_read(at91_emac_t *at91mac, unsigned char addr,
int at91emac_write(at91_emac_t *at91mac, unsigned char addr,
unsigned char reg, unsigned short value)
{
+ unsigned long netstat;
DEBUG_AT91PHY("AT91PHY write %x REG(%d)=%x\n", at91mac, reg, &value)
at91emac_EnableMDIO(at91mac);
@@ -154,9 +161,14 @@ int at91emac_write(at91_emac_t *at91mac, unsigned char addr,
AT91_EMAC_MAN_REGA(reg) | AT91_EMAC_MAN_CODE_802_3 |
AT91_EMAC_MAN_PHYA(addr) | (value & AT91_EMAC_MAN_DATA_MASK),
&at91mac->man);
- udelay(10000);
+
+ do {
+ netstat = readl(&at91mac->sr);
+ DEBUG_AT91PHY("poll SR %08lx\n", netstat);
+ } while (!(netstat & AT91_EMAC_SR_IDLE));
at91emac_DisableMDIO(at91mac);
+
return 0;
}
--
1.7.2.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 2/3] at91_emac.c: fix 'Warning: eth device name has a space!'
2010-09-07 17:10 ` [U-Boot] [PATCH 2/3] at91_emac.c: fix 'Warning: eth device name has a space!' Andreas Bießmann
@ 2010-09-10 12:54 ` Reinhard Meyer
2010-09-23 8:48 ` Reinhard Meyer
1 sibling, 0 replies; 6+ messages in thread
From: Reinhard Meyer @ 2010-09-10 12:54 UTC (permalink / raw)
To: u-boot
Dear Andreas Bie?mann,
> + sprintf(dev->name, "at91_emac");
I would think "emac" is sufficient. That they are on an AT91 system
should be obvious to the user.
And if, somehow, in the future, MACB and AT91_EMAC get merged, we
would not need to change this again :)
Reinhard
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 2/3] at91_emac.c: fix 'Warning: eth device name has a space!'
2010-09-07 17:10 ` [U-Boot] [PATCH 2/3] at91_emac.c: fix 'Warning: eth device name has a space!' Andreas Bießmann
2010-09-10 12:54 ` Reinhard Meyer
@ 2010-09-23 8:48 ` Reinhard Meyer
1 sibling, 0 replies; 6+ messages in thread
From: Reinhard Meyer @ 2010-09-23 8:48 UTC (permalink / raw)
To: u-boot
Dear Andreas Bie?mann,
> This patch also removes conditional nameing of at91_emac driver whether it's
> connection to PHY is RMII or MII.
>
> Signed-off-by: Andreas Bie?mann <andreas.devel@googlemail.com>
> + sprintf(dev->name, "at91_emac");
Applied to u-boot-atmel/at91, with name shortened to "emac".
Thanks,
Reinhard
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 3/3] at91_emac.c: poll for IDLE when writing PHY
2010-09-07 17:10 ` [U-Boot] [PATCH 3/3] at91_emac.c: poll for IDLE when writing PHY Andreas Bießmann
@ 2010-09-23 8:49 ` Reinhard Meyer
0 siblings, 0 replies; 6+ messages in thread
From: Reinhard Meyer @ 2010-09-23 8:49 UTC (permalink / raw)
To: u-boot
Dear Andreas Bie?mann,
> This patch replaces the unnecessary waiting in at91emac_read() and
> at91emac_write() by checking the IDLE flag.
>
> Signed-off-by: Andreas Bie?mann <andreas.devel@googlemail.com>
Applied to u-boot-atmel/at91.
Thanks,
Reinhard
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-09-23 8:49 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-07 17:10 [U-Boot] [PATCH v2 1/3] at91_emac.h: fix typo in register definition Andreas Bießmann
2010-09-07 17:10 ` [U-Boot] [PATCH 2/3] at91_emac.c: fix 'Warning: eth device name has a space!' Andreas Bießmann
2010-09-10 12:54 ` Reinhard Meyer
2010-09-23 8:48 ` Reinhard Meyer
2010-09-07 17:10 ` [U-Boot] [PATCH 3/3] at91_emac.c: poll for IDLE when writing PHY Andreas Bießmann
2010-09-23 8:49 ` Reinhard Meyer
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.