summaryrefslogtreecommitdiff
path: root/arch/powerpc/cpu/mpc85xx/p1010_serdes.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2016-09-26 13:24:46 -0400
committerTom Rini <trini@konsulko.com>2016-09-26 17:10:56 -0400
commitcbe7706ab8aab06c18edaa9b120371f9c8012728 (patch)
treeebbfacedf031c33969d8d2e4d7459904b7fc1647 /arch/powerpc/cpu/mpc85xx/p1010_serdes.c
parent8f2fe0c86c56175dd7d5d0e3bc26bef41f224f03 (diff)
parent295a24b3d6a751b79373e7ff2199d91765cae8a9 (diff)
Merge git://git.denx.de/u-boot-fsl-qoriq
trini: Drop local memset() from examples/standalone/mem_to_mem_idma2intr.c Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'arch/powerpc/cpu/mpc85xx/p1010_serdes.c')
-rw-r--r--arch/powerpc/cpu/mpc85xx/p1010_serdes.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/arch/powerpc/cpu/mpc85xx/p1010_serdes.c b/arch/powerpc/cpu/mpc85xx/p1010_serdes.c
index 4b965f7a0e..d8c0b62fe7 100644
--- a/arch/powerpc/cpu/mpc85xx/p1010_serdes.c
+++ b/arch/powerpc/cpu/mpc85xx/p1010_serdes.c
@@ -33,11 +33,19 @@ static const u8 serdes2_cfg_tbl[][SRDS2_MAX_LANES] = {
int is_serdes_configured(enum srds_prtcl device)
{
- int ret = (1 << device) & serdes1_prtcl_map;
+ int ret;
+
+ if (!(serdes1_prtcl_map & (1 << NONE)))
+ fsl_serdes_init();
+
+ ret = (1 << device) & serdes1_prtcl_map;
if (ret)
return ret;
+ if (!(serdes2_prtcl_map & (1 << NONE)))
+ fsl_serdes_init();
+
return (1 << device) & serdes2_prtcl_map;
}
@@ -49,6 +57,10 @@ void fsl_serdes_init(void)
MPC85xx_PORDEVSR_IO_SEL_SHIFT;
int lane;
+ if (serdes1_prtcl_map & (1 << NONE) &&
+ serdes2_prtcl_map & (1 << NONE))
+ return;
+
debug("PORDEVSR[IO_SEL_SRDS] = %x\n", srds_cfg);
if (srds_cfg >= ARRAY_SIZE(serdes1_cfg_tbl)) {
@@ -60,6 +72,9 @@ void fsl_serdes_init(void)
serdes1_prtcl_map |= (1 << lane_prtcl);
}
+ /* Set the first bit to indicate serdes has been initialized */
+ serdes1_prtcl_map |= (1 << NONE);
+
if (srds_cfg >= ARRAY_SIZE(serdes2_cfg_tbl)) {
printf("Invalid PORDEVSR[IO_SEL_SRDS] = %d\n", srds_cfg);
return;
@@ -69,4 +84,7 @@ void fsl_serdes_init(void)
enum srds_prtcl lane_prtcl = serdes2_cfg_tbl[srds_cfg][lane];
serdes2_prtcl_map |= (1 << lane_prtcl);
}
+
+ /* Set the first bit to indicate serdes has been initialized */
+ serdes2_prtcl_map |= (1 << NONE);
}