]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_serdes.c
Merge git://git.denx.de/u-boot-fsl-qoriq
[people/ms/u-boot.git] / arch / arm / cpu / armv8 / fsl-layerscape / fsl_lsch2_serdes.c
index db2771ab404097f8529e64d3bcc5490904f6fa36..e06b0637404e28b7176453a0ddc29bbe985e2e02 100644 (file)
@@ -22,9 +22,15 @@ int is_serdes_configured(enum srds_prtcl device)
        int ret = 0;
 
 #ifdef CONFIG_SYS_FSL_SRDS_1
+       if (!serdes1_prtcl_map[NONE])
+               fsl_serdes_init();
+
        ret |= serdes1_prtcl_map[device];
 #endif
 #ifdef CONFIG_SYS_FSL_SRDS_2
+       if (!serdes2_prtcl_map[NONE])
+               fsl_serdes_init();
+
        ret |= serdes2_prtcl_map[device];
 #endif
 
@@ -98,6 +104,9 @@ void serdes_init(u32 sd, u32 sd_addr, u32 sd_prctl_mask, u32 sd_prctl_shift,
        u32 cfg;
        int lane;
 
+       if (serdes_prtcl_map[NONE])
+               return;
+
        memset(serdes_prtcl_map, 0, sizeof(u8) * SERDES_PRCTL_COUNT);
 
        cfg = gur_in32(&gur->rcwsr[4]) & sd_prctl_mask;
@@ -115,6 +124,9 @@ void serdes_init(u32 sd, u32 sd_addr, u32 sd_prctl_mask, u32 sd_prctl_shift,
                else
                        serdes_prtcl_map[lane_prtcl] = 1;
        }
+
+       /* Set the first element to indicate serdes has been initialized */
+       serdes_prtcl_map[NONE] = 1;
 }
 
 void fsl_serdes_init(void)