summaryrefslogtreecommitdiffstats
path: root/board/freescale/mpc8568mds/bcsr.c
diff options
context:
space:
mode:
authorAnton Vorontsov <avorontsov@ru.mvista.com>2007-10-22 18:12:46 +0400
committerAndrew Fleming-AFLEMING <afleming@freescale.com>2008-01-09 16:25:03 -0600
commitad162249cb371e9e38971676f09be791e5f3cf4a (patch)
tree268ae1825f88c6911f8fdd20e1f26d6f8d56710f /board/freescale/mpc8568mds/bcsr.c
parent2146cf56821c3364786ca94a7306008c5824b238 (diff)
downloadblackbird-obmc-uboot-ad162249cb371e9e38971676f09be791e5f3cf4a.tar.gz
blackbird-obmc-uboot-ad162249cb371e9e38971676f09be791e5f3cf4a.zip
MPC8568E-MDS: reset UCCs to use them reliably
In order to use GETH1 and GETH2 on the MPC8568E-MDS, we should reset UCCs. p.s Similar code exists in the Linux kernel board file (for capability reasons with older U-Boots), but should be removed some day. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Diffstat (limited to 'board/freescale/mpc8568mds/bcsr.c')
-rw-r--r--board/freescale/mpc8568mds/bcsr.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/board/freescale/mpc8568mds/bcsr.c b/board/freescale/mpc8568mds/bcsr.c
index aae0f98e03..791a50fc92 100644
--- a/board/freescale/mpc8568mds/bcsr.c
+++ b/board/freescale/mpc8568mds/bcsr.c
@@ -21,6 +21,8 @@
*/
#include <common.h>
+#include <asm/io.h>
+
#include "bcsr.h"
void enable_8568mds_duart()
@@ -54,3 +56,22 @@ void enable_8568mds_qe_mdio()
bcsr[7] |= 0x01;
}
+
+#if defined(CONFIG_UEC_ETH1) || defined(CONFIG_UEC_ETH2)
+void reset_8568mds_uccs(void)
+{
+ volatile u8 *bcsr = (u8 *)(CFG_BCSR);
+
+ /* Turn off UCC1 & UCC2 */
+ out_8(&bcsr[8], in_8(&bcsr[8]) & ~BCSR_UCC1_GETH_EN);
+ out_8(&bcsr[9], in_8(&bcsr[9]) & ~BCSR_UCC2_GETH_EN);
+
+ /* Mode is RGMII, all bits clear */
+ out_8(&bcsr[11], in_8(&bcsr[11]) & ~(BCSR_UCC1_MODE_MSK |
+ BCSR_UCC2_MODE_MSK));
+
+ /* Turn UCC1 & UCC2 on */
+ out_8(&bcsr[8], in_8(&bcsr[8]) | BCSR_UCC1_GETH_EN);
+ out_8(&bcsr[9], in_8(&bcsr[9]) | BCSR_UCC2_GETH_EN);
+}
+#endif
OpenPOWER on IntegriCloud