public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/1] SMC911x driver fixed for NFS boot
@ 2009-05-19 15:15 Josh Karabin
  2009-05-19 21:42 ` Wolfgang Denk
  0 siblings, 1 reply; 8+ messages in thread
From: Josh Karabin @ 2009-05-19 15:15 UTC (permalink / raw)
  To: u-boot


Manikandan Pillai wrote:
> eth_halt() function in the smc911x drivers used to call the
> smc911x_reset() function. eth_halt() used to be called after
> tftp transfers. This used to put the ethernet chip in reset
> while the linux boots up resulting in the ethernet driver
> not coming up. NFS boot used to fail as a result.
> 
> This patch calls smc911x_shutdown() instead of smc911x_reset().
> Some comments received has also been fixed.

This patch fixes NFS boot in the case where the kernel is first loaded
with tftpboot, as described.

If the kernel is loaded using some other mechanism, like flash, the smc
device is never initialized.  At least in the case where there is no
valid EEPROM connected to the smc device, NFS boot will fail.  I'm not
sure whether or not a loaded MAC address has anything to do with it, or
if the kernel is expecting the smc device to be in a different state.

Relying on tftpboot leaving the ethernet device in the right state
doesn't seem right.  Is there an existing clean way to deal with this,
short of adding an initramfs to fix it up?  I'll work on a patch if
someone can suggest an approach that makes sense.


Regards,

- Josh

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [U-Boot] [PATCH 1/1] SMC911x driver fixed for NFS boot
@ 2009-04-08  3:44 Manikandan Pillai
  2009-04-27 22:20 ` Wolfgang Denk
  2009-06-09 22:08 ` Wolfgang Denk
  0 siblings, 2 replies; 8+ messages in thread
From: Manikandan Pillai @ 2009-04-08  3:44 UTC (permalink / raw)
  To: u-boot

eth_halt() function in the smc911x drivers used to call the
smc911x_reset() function. eth_halt() used to be called after
tftp transfers. This used to put the ethernet chip in reset
while the linux boots up resulting in the ethernet driver
not coming up. NFS boot used to fail as a result.

This patch calls smc911x_shutdown() instead of smc911x_reset().
Some comments received has also been fixed.

Signed-off-by: Manikandan Pillai <mani.pillai@ti.com>
---
 drivers/net/smc911x.c |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 1ded8f0..5bc3914 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -116,6 +116,27 @@ static int smc911x_phy_reset(void)
 	return 0;
 }
 
+static void smc911x_shutdown(void)
+{
+	unsigned int cr;
+
+	/* Turn of Rx and TX */
+	cr = smc911x_get_mac_csr(MAC_CR);
+	cr &= ~(MAC_CR_TXEN | MAC_CR_RXEN | MAC_CR_HBDIS);
+	smc911x_set_mac_csr(MAC_CR, cr);
+
+	/* Stop Transmission */
+	cr = smc911x_get_mac_csr(TX_CFG);
+	cr &= ~(TX_CFG_STOP_TX);
+	smc911x_set_mac_csr(TX_CFG, cr);
+	/* Stop receiving packets */
+	cr = smc911x_get_mac_csr(RX_CFG);
+	cr &= ~(RX_CFG_RXDOFF);
+	smc911x_set_mac_csr(RX_CFG, cr);
+
+}
+
+
 static void smc911x_phy_configure(void)
 {
 	int timeout;
@@ -224,7 +245,7 @@ int eth_send(volatile void *packet, int length)
 
 void eth_halt(void)
 {
-	smc911x_reset();
+	smc911x_shutdown();
 }
 
 int eth_rx(void)
-- 
1.6.0.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-06-13 13:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-19 15:15 [U-Boot] [PATCH 1/1] SMC911x driver fixed for NFS boot Josh Karabin
2009-05-19 21:42 ` Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2009-04-08  3:44 Manikandan Pillai
2009-04-27 22:20 ` Wolfgang Denk
2009-04-27 22:34   ` Ben Warren
2009-06-09 22:08 ` Wolfgang Denk
2009-06-12 21:04   ` Wolfgang Denk
2009-06-13 13:51     ` Jean-Christophe PLAGNIOL-VILLARD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox