summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorLian Minghuan <B31939@freescale.com>2010-08-18 16:33:47 +0800
committerKumar Gala <galak@kernel.crashing.org>2010-08-19 02:06:14 -0500
commit0e159024ea0bc1c7ee2c31e98c5e45b08d42b4e7 (patch)
tree94ffa182134a44c9dca4a5de59b1af64ff2ec44b /board
parent90870d9846e6a302823712acf6d40f947e60ed75 (diff)
downloadu-boot-imx-0e159024ea0bc1c7ee2c31e98c5e45b08d42b4e7.zip
u-boot-imx-0e159024ea0bc1c7ee2c31e98c5e45b08d42b4e7.tar.gz
u-boot-imx-0e159024ea0bc1c7ee2c31e98c5e45b08d42b4e7.tar.bz2
powerpc/85xx: Fix SRIO LAW setup on corenet_ds boards
In function board_early_init_r(), serdes will not be initialize yet. Thus sRIO was always considered disabled. Move the check for sRIO into misc_init_r() which is called after fsl_serdes_init(). Also, fixed warning associated with gur variable possibly not being used. Signed-off-by: Roy Zang <tie-fei.zang@freescale.com> Signed-off-by: Lian Minghuan <B31939@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'board')
-rw-r--r--board/freescale/corenet_ds/corenet_ds.c47
1 files changed, 25 insertions, 22 deletions
diff --git a/board/freescale/corenet_ds/corenet_ds.c b/board/freescale/corenet_ds/corenet_ds.c
index 3cdefb3..48d95d6 100644
--- a/board/freescale/corenet_ds/corenet_ds.c
+++ b/board/freescale/corenet_ds/corenet_ds.c
@@ -23,6 +23,7 @@
#include <common.h>
#include <command.h>
#include <netdev.h>
+#include <linux/compiler.h>
#include <asm/mmu.h>
#include <asm/processor.h>
#include <asm/cache.h>
@@ -120,28 +121,6 @@ int board_early_init_r(void)
set_liodns();
setup_portals();
-#ifdef CONFIG_SRIO1
- if (is_serdes_configured(SRIO1)) {
- set_next_law(CONFIG_SYS_RIO1_MEM_PHYS, LAW_SIZE_256M,
- LAW_TRGT_IF_RIO_1);
- } else {
- printf (" SRIO1: disabled\n");
- }
-#else
- setbits_be32(&gur->devdisr, FSL_CORENET_DEVDISR_SRIO1); /* disable */
-#endif
-
-#ifdef CONFIG_SRIO2
- if (is_serdes_configured(SRIO2)) {
- set_next_law(CONFIG_SYS_RIO2_MEM_PHYS, LAW_SIZE_256M,
- LAW_TRGT_IF_RIO_2);
- } else {
- printf (" SRIO2: disabled\n");
- }
-#else
- setbits_be32(&gur->devdisr, FSL_CORENET_DEVDISR_SRIO2); /* disable */
-#endif
-
return 0;
}
@@ -164,10 +143,34 @@ static const char *serdes_clock_to_string(u32 clock)
int misc_init_r(void)
{
serdes_corenet_t *srds_regs = (void *)CONFIG_SYS_FSL_CORENET_SERDES_ADDR;
+ __maybe_unused ccsr_gur_t *gur;
u32 actual[NUM_SRDS_BANKS];
unsigned int i;
u8 sw3;
+ gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+#ifdef CONFIG_SRIO1
+ if (is_serdes_configured(SRIO1)) {
+ set_next_law(CONFIG_SYS_RIO1_MEM_PHYS, LAW_SIZE_256M,
+ LAW_TRGT_IF_RIO_1);
+ } else {
+ printf (" SRIO1: disabled\n");
+ }
+#else
+ setbits_be32(&gur->devdisr, FSL_CORENET_DEVDISR_SRIO1); /* disable */
+#endif
+
+#ifdef CONFIG_SRIO2
+ if (is_serdes_configured(SRIO2)) {
+ set_next_law(CONFIG_SYS_RIO2_MEM_PHYS, LAW_SIZE_256M,
+ LAW_TRGT_IF_RIO_2);
+ } else {
+ printf (" SRIO2: disabled\n");
+ }
+#else
+ setbits_be32(&gur->devdisr, FSL_CORENET_DEVDISR_SRIO2); /* disable */
+#endif
+
/* Warn if the expected SERDES reference clocks don't match the
* actual reference clocks. This needs to be done after calling
* p4080_erratum_serdes8(), since that function may modify the clocks.