The MC reads the SD1 lane grouping once, when it boots.
lx2160a_serdes_apply_hwconfig() has to run before.

Signed-off-by: Vincent Jardin <[email protected]>

---

Changes in v4:
- New patch

 board/nxp/lx2160a/serdes_split.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/board/nxp/lx2160a/serdes_split.c b/board/nxp/lx2160a/serdes_split.c
index a8fbb278b3a..057d3c97739 100644
--- a/board/nxp/lx2160a/serdes_split.c
+++ b/board/nxp/lx2160a/serdes_split.c
@@ -12,6 +12,7 @@
 #include <asm/arch/fsl_serdes.h>
 #include <asm/arch/immap_lsch3.h>
 #include <asm/arch/soc.h>              /* gur_in32() picks the GUR endianness 
*/
+#include <fsl-mc/fsl_mc.h>
 #include <linux/bitmap.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
@@ -556,8 +557,16 @@ void lx2160a_serdes_apply_hwconfig(void)
                mode = &sd1_modes[i];
        }
 
-       if (mode)
-               sd1_enter(mode, mode, 0);
+       if (!mode || mode->is_active(srds_base(FSL_SRDS_1)))
+               return;
+
+       if (IS_ENABLED(CONFIG_FSL_MC_ENET) && get_mc_boot_status() != -1) {
+               printf("lx2160a serdes: the MC is already running, serdes1:%s 
not applied\n",
+                      mode->name);
+               return;
+       }
+
+       sd1_enter(mode, mode, 0);
 }
 
 #endif /* CONFIG_ARCH_LX2160A */
-- 
2.43.0

Reply via email to