]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c
Merge git://git.denx.de/u-boot-fsl-qoriq
[people/ms/u-boot.git] / arch / powerpc / cpu / mpc85xx / fsl_corenet_serdes.c
index ba22f90a6f92ec1e1c1bff290a6232a183e78c54..72d5e3007d9d20fc7f6b9205976988f17b82597d 100644 (file)
@@ -13,7 +13,7 @@
 #include <asm/io.h>
 #include <asm/processor.h>
 #include <asm/fsl_law.h>
-#include <asm/errno.h>
+#include <linux/errno.h>
 #include "fsl_corenet_serdes.h"
 
 /*
@@ -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)