]> git.sur5r.net Git - u-boot/blobdiff - arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c
Merge git://git.denx.de/u-boot-fsl-qoriq
[u-boot] / arch / powerpc / cpu / mpc85xx / fsl_corenet_serdes.c
index ee60bfaa7d402e37903bafd525036a164e82e016..72d5e3007d9d20fc7f6b9205976988f17b82597d 100644 (file)
@@ -136,6 +136,9 @@ int is_serdes_configured(enum srds_prtcl device)
        if (!(in_be32(&gur->rcwsr[5]) & FSL_CORENET_RCWSR5_SRDS_EN))
                return 0;
 
+       if (!(serdes_prtcl_map & (1 << NONE)))
+               fsl_serdes_init();
+
        return (1 << device) & serdes_prtcl_map;
 }
 
@@ -514,6 +517,8 @@ void fsl_serdes_init(void)
        if (getenv_f("hwconfig", buffer, sizeof(buffer)) > 0)
                buf = buffer;
 #endif
+       if (serdes_prtcl_map & (1 << NONE))
+               return;
 
        /* Is serdes enabled at all? */
        if (!(in_be32(&gur->rcwsr[5]) & FSL_CORENET_RCWSR5_SRDS_EN))
@@ -857,6 +862,9 @@ void fsl_serdes_init(void)
                             SRDS_RSTCTL_SDPD);
        }
 #endif
+
+       /* Set the first bit to indicate serdes has been initialized */
+       serdes_prtcl_map |= (1 << NONE);
 }
 
 const char *serdes_clock_to_string(u32 clock)