* [U-Boot-Users] [PATCH] MPC8568E-MDS: reset UCCs to use them reliably
@ 2007-10-22 14:12 Anton Vorontsov
2008-01-09 7:52 ` Andy Fleming
0 siblings, 1 reply; 2+ messages in thread
From: Anton Vorontsov @ 2007-10-22 14:12 UTC (permalink / raw)
To: u-boot
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>
---
board/mpc8568mds/bcsr.c | 21 +++++++++++++++++++++
board/mpc8568mds/bcsr.h | 9 +++++++++
board/mpc8568mds/mpc8568mds.c | 3 +++
3 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/board/mpc8568mds/bcsr.c b/board/mpc8568mds/bcsr.c
index aae0f98..791a50f 100644
--- a/board/mpc8568mds/bcsr.c
+++ b/board/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
diff --git a/board/mpc8568mds/bcsr.h b/board/mpc8568mds/bcsr.h
index aefd9bf..f7f70bc 100644
--- a/board/mpc8568mds/bcsr.h
+++ b/board/mpc8568mds/bcsr.h
@@ -90,6 +90,11 @@
7 Flash write protect
*/
+#define BCSR_UCC1_GETH_EN (0x1 << 7)
+#define BCSR_UCC2_GETH_EN (0x1 << 7)
+#define BCSR_UCC1_MODE_MSK (0x3 << 4)
+#define BCSR_UCC2_MODE_MSK (0x3 << 0)
+
/*BCSR Utils functions*/
void enable_8568mds_duart(void);
@@ -97,4 +102,8 @@ void enable_8568mds_flash_write(void);
void disable_8568mds_flash_write(void);
void enable_8568mds_qe_mdio(void);
+#if defined(CONFIG_UEC_ETH1) || defined(CONFIG_UEC_ETH2)
+void reset_8568mds_uccs(void);
+#endif
+
#endif /* __BCSR_H_ */
diff --git a/board/mpc8568mds/mpc8568mds.c b/board/mpc8568mds/mpc8568mds.c
index 818ff13..2b3f44f 100644
--- a/board/mpc8568mds/mpc8568mds.c
+++ b/board/mpc8568mds/mpc8568mds.c
@@ -106,6 +106,9 @@ int board_early_init_f (void)
enable_8568mds_duart();
enable_8568mds_flash_write();
+#if defined(CONFIG_UEC_ETH1) || defined(CONFIG_UEC_ETH2)
+ reset_8568mds_uccs();
+#endif
#if defined(CONFIG_QE) && !defined(CONFIG_eTSEC_MDIO_BUS)
enable_8568mds_qe_mdio();
#endif
--
1.5.0.6
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot-Users] [PATCH] MPC8568E-MDS: reset UCCs to use them reliably
2007-10-22 14:12 [U-Boot-Users] [PATCH] MPC8568E-MDS: reset UCCs to use them reliably Anton Vorontsov
@ 2008-01-09 7:52 ` Andy Fleming
0 siblings, 0 replies; 2+ messages in thread
From: Andy Fleming @ 2008-01-09 7:52 UTC (permalink / raw)
To: u-boot
applied, thanks!
On 10/22/07, Anton Vorontsov <avorontsov@ru.mvista.com> wrote:
> 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>
> ---
> board/mpc8568mds/bcsr.c | 21 +++++++++++++++++++++
> board/mpc8568mds/bcsr.h | 9 +++++++++
> board/mpc8568mds/mpc8568mds.c | 3 +++
> 3 files changed, 33 insertions(+), 0 deletions(-)
>
> diff --git a/board/mpc8568mds/bcsr.c b/board/mpc8568mds/bcsr.c
> index aae0f98..791a50f 100644
> --- a/board/mpc8568mds/bcsr.c
> +++ b/board/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
> diff --git a/board/mpc8568mds/bcsr.h b/board/mpc8568mds/bcsr.h
> index aefd9bf..f7f70bc 100644
> --- a/board/mpc8568mds/bcsr.h
> +++ b/board/mpc8568mds/bcsr.h
> @@ -90,6 +90,11 @@
> 7 Flash write protect
> */
>
> +#define BCSR_UCC1_GETH_EN (0x1 << 7)
> +#define BCSR_UCC2_GETH_EN (0x1 << 7)
> +#define BCSR_UCC1_MODE_MSK (0x3 << 4)
> +#define BCSR_UCC2_MODE_MSK (0x3 << 0)
> +
> /*BCSR Utils functions*/
>
> void enable_8568mds_duart(void);
> @@ -97,4 +102,8 @@ void enable_8568mds_flash_write(void);
> void disable_8568mds_flash_write(void);
> void enable_8568mds_qe_mdio(void);
>
> +#if defined(CONFIG_UEC_ETH1) || defined(CONFIG_UEC_ETH2)
> +void reset_8568mds_uccs(void);
> +#endif
> +
> #endif /* __BCSR_H_ */
> diff --git a/board/mpc8568mds/mpc8568mds.c b/board/mpc8568mds/mpc8568mds.c
> index 818ff13..2b3f44f 100644
> --- a/board/mpc8568mds/mpc8568mds.c
> +++ b/board/mpc8568mds/mpc8568mds.c
> @@ -106,6 +106,9 @@ int board_early_init_f (void)
>
> enable_8568mds_duart();
> enable_8568mds_flash_write();
> +#if defined(CONFIG_UEC_ETH1) || defined(CONFIG_UEC_ETH2)
> + reset_8568mds_uccs();
> +#endif
> #if defined(CONFIG_QE) && !defined(CONFIG_eTSEC_MDIO_BUS)
> enable_8568mds_qe_mdio();
> #endif
> --
> 1.5.0.6
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-01-09 7:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-22 14:12 [U-Boot-Users] [PATCH] MPC8568E-MDS: reset UCCs to use them reliably Anton Vorontsov
2008-01-09 7:52 ` Andy Fleming
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox