* [U-Boot] [PATCH] tsec: Fix a bug in soft-resetting
@ 2009-02-04 0:26 Andy Fleming
2009-02-04 22:12 ` Peter Tyser
2009-02-06 7:54 ` Ben Warren
0 siblings, 2 replies; 3+ messages in thread
From: Andy Fleming @ 2009-02-04 0:26 UTC (permalink / raw)
To: u-boot
SOFT_RESET must be asserted for at least 3 TX clocks. Usually, that's about 30
clock cycles, so it's been mostly working. But we had no guarantee, and at
slower bitrates, it's just over a microsecond (over 1000 clock cycles). This
enforces a 2 microsecond gap between assertion and deassertion.
Signed-off-by: Andy Fleming <afleming@freescale.com>
---
drivers/net/tsec.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index fbc9a6d..4682c8b 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -158,6 +158,7 @@ int tsec_initialize(bd_t * bis, struct tsec_info_struct *tsec_info)
/* Reset the MAC */
priv->regs->maccfg1 |= MACCFG1_SOFT_RESET;
+ udelay(2); /* Soft Reset must be asserted for 3 TX clocks */
priv->regs->maccfg1 &= ~(MACCFG1_SOFT_RESET);
#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) \
--
1.5.4.GIT
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] tsec: Fix a bug in soft-resetting
2009-02-04 0:26 [U-Boot] [PATCH] tsec: Fix a bug in soft-resetting Andy Fleming
@ 2009-02-04 22:12 ` Peter Tyser
2009-02-06 7:54 ` Ben Warren
1 sibling, 0 replies; 3+ messages in thread
From: Peter Tyser @ 2009-02-04 22:12 UTC (permalink / raw)
To: u-boot
On Tue, 2009-02-03 at 18:26 -0600, Andy Fleming wrote:
> SOFT_RESET must be asserted for at least 3 TX clocks. Usually, that's about 30
> clock cycles, so it's been mostly working. But we had no guarantee, and at
> slower bitrates, it's just over a microsecond (over 1000 clock cycles). This
> enforces a 2 microsecond gap between assertion and deassertion.
>
> Signed-off-by: Andy Fleming <afleming@freescale.com>
> ---
> drivers/net/tsec.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
> index fbc9a6d..4682c8b 100644
> --- a/drivers/net/tsec.c
> +++ b/drivers/net/tsec.c
> @@ -158,6 +158,7 @@ int tsec_initialize(bd_t * bis, struct tsec_info_struct *tsec_info)
>
> /* Reset the MAC */
> priv->regs->maccfg1 |= MACCFG1_SOFT_RESET;
> + udelay(2); /* Soft Reset must be asserted for 3 TX clocks */
> priv->regs->maccfg1 &= ~(MACCFG1_SOFT_RESET);
>
> #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) \
I tried the patch out and it resolves a semi-common issue I was seeing
where the 1st received packet would have a CRC error that would result
in an error such as:
=> dhcp
Enet starting in 100BT/HD
Speed: 100, half duplex
BOOTP broadcast 1
Got error 4
BOOTP broadcast 2
Thanks!
Tested-by: Peter Tyser <ptyser@xes-inc.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] tsec: Fix a bug in soft-resetting
2009-02-04 0:26 [U-Boot] [PATCH] tsec: Fix a bug in soft-resetting Andy Fleming
2009-02-04 22:12 ` Peter Tyser
@ 2009-02-06 7:54 ` Ben Warren
1 sibling, 0 replies; 3+ messages in thread
From: Ben Warren @ 2009-02-06 7:54 UTC (permalink / raw)
To: u-boot
Hi Andy,
Andy Fleming wrote:
> SOFT_RESET must be asserted for at least 3 TX clocks. Usually, that's about 30
> clock cycles, so it's been mostly working. But we had no guarantee, and at
> slower bitrates, it's just over a microsecond (over 1000 clock cycles). This
> enforces a 2 microsecond gap between assertion and deassertion.
>
> Signed-off-by: Andy Fleming <afleming@freescale.com>
> ---
> drivers/net/tsec.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
> index fbc9a6d..4682c8b 100644
> --- a/drivers/net/tsec.c
> +++ b/drivers/net/tsec.c
> @@ -158,6 +158,7 @@ int tsec_initialize(bd_t * bis, struct tsec_info_struct *tsec_info)
>
> /* Reset the MAC */
> priv->regs->maccfg1 |= MACCFG1_SOFT_RESET;
> + udelay(2); /* Soft Reset must be asserted for 3 TX clocks */
> priv->regs->maccfg1 &= ~(MACCFG1_SOFT_RESET);
>
> #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) \
>
Applied to net repo.
thanks,
Ben
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-02-06 7:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-04 0:26 [U-Boot] [PATCH] tsec: Fix a bug in soft-resetting Andy Fleming
2009-02-04 22:12 ` Peter Tyser
2009-02-06 7:54 ` Ben Warren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox