summaryrefslogtreecommitdiff
path: root/board/tqm8xx
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <lg@denx.de>2008-01-10 17:59:07 +0100
committerWolfgang Denk <wd@denx.de>2008-01-12 00:25:03 +0100
commitefc6f447c1b940d1650c4b854c5598a595ddc3da (patch)
treee1067e6f52b638761d58d0d6f71f4f22ceb170ff /board/tqm8xx
parent34d51566bc4fb537da9f833aa67169c79cc69a97 (diff)
downloadu-boot-imx-efc6f447c1b940d1650c4b854c5598a595ddc3da.zip
u-boot-imx-efc6f447c1b940d1650c4b854c5598a595ddc3da.tar.gz
u-boot-imx-efc6f447c1b940d1650c4b854c5598a595ddc3da.tar.bz2
Add support for the TK885D baseboard from TELE-DATA
The TK885D board uses a TQM885D module from TQ, this port adds an own configuration file and adds a last_stage_init() method to configure the two PHYs, depending on the phy_auto_nego environment variable. Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
Diffstat (limited to 'board/tqm8xx')
-rw-r--r--board/tqm8xx/tqm8xx.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/board/tqm8xx/tqm8xx.c b/board/tqm8xx/tqm8xx.c
index fcd941e..18bf2a8 100644
--- a/board/tqm8xx/tqm8xx.c
+++ b/board/tqm8xx/tqm8xx.c
@@ -504,4 +504,51 @@ int misc_init_r (void)
}
#endif /* CONFIG_NSCU */
+/* ---------------------------------------------------------------------------- */
+/* TK885D specific initializaion */
+/* ---------------------------------------------------------------------------- */
+#ifdef CONFIG_TK885D
+#include <miiphy.h>
+int last_stage_init(void)
+{
+ const unsigned char phy[] = {CONFIG_FEC1_PHY, CONFIG_FEC2_PHY};
+ unsigned short reg;
+ int ret, i = 100;
+ char *s;
+
+ mii_init();
+ /* Without this delay 0xff is read from the UART buffer later in
+ * abortboot() and autoboot is aborted */
+ udelay(10000);
+ while (tstc() && i--)
+ (void)getc();
+
+ /* Check if auto-negotiation is prohibited */
+ s = getenv("phy_auto_nego");
+
+ if (!s || !strcmp(s, "on"))
+ /* Nothing to do - autonegotiation by default */
+ return 0;
+
+ for (i = 0; i < 2; i++) {
+ ret = miiphy_read("FEC ETHERNET", phy[i], PHY_BMCR, &reg);
+ if (ret) {
+ printf("Cannot read BMCR on PHY %d\n", phy[i]);
+ return 0;
+ }
+ /* Auto-negotiation off, hard set full duplex, 100Mbps */
+ ret = miiphy_write("FEC ETHERNET", phy[i],
+ PHY_BMCR, (reg | PHY_BMCR_100MB |
+ PHY_BMCR_DPLX) & ~PHY_BMCR_AUTON);
+ if (ret) {
+ printf("Cannot write BMCR on PHY %d\n", phy[i]);
+ return 0;
+ }
+ }
+
+ return 0;
+}
+
+#endif
+
/* ------------------------------------------------------------------------- */