* Patch by Sangmoon Kim, 23 Sep 2003:
fix pll_pci_to_mem_multiplier table for MPC8245
* Patch by Anders Larsen, 22 Sep 2003:
enable timed autoboot on PXA
* Patch by David Müller, 22 Sep 2003:
- add $(CFLAGS) to "-print-libgcc-filename" so compiler driver
returns correct libgcc file path
- "latency" reduction of busy-loop waiting to improve "U-Boot" boot
time on s3c24x0 systems
* Patch by Jon Diekema, 19 Sep 2003:
- Add CFG_FAULT_ECHO_LINK_DOWN option to echo the inverted Ethernet
link state to the fault LED.
- In NetLoop, make the Fault LED reflect the link status. The link
status gets updated on entry, and on timeouts.
diff --git a/common/miiphyutil.c b/common/miiphyutil.c
index 6b2425f..75c2df5 100644
--- a/common/miiphyutil.c
+++ b/common/miiphyutil.c
@@ -169,4 +169,27 @@
}
}
+#ifdef CFG_FAULT_ECHO_LINK_DOWN
+/*****************************************************************************
+ *
+ * Determine link status
+ */
+int miiphy_link (unsigned char addr)
+{
+ unsigned short reg;
+
+ if (miiphy_read (addr, PHY_BMSR, ®)) {
+ printf ("PHY_BMSR read failed, assuming no link\n");
+ return (0);
+ }
+
+ /* Determine if a link is active */
+ if ((reg & PHY_BMSR_LS) != 0) {
+ return (1);
+ } else {
+ return (0);
+ }
+}
+#endif
+
#endif /* CONFIG_MII || (CONFIG_COMMANDS & CFG_CMD_MII) */