IFC and QSPI are muxed on board.

Add fsl_fdt_fixup_flash()
-To disable IFC node in dts if QSPI is enabled.
-Or disable QSPI node in dts if IFC is enabled.

Signed-off-by: Santan Kumar <[email protected]>
Signed-off-by: Priyanka Jain <[email protected]>
---
 board/freescale/ls2080ardb/ls2080ardb.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/board/freescale/ls2080ardb/ls2080ardb.c 
b/board/freescale/ls2080ardb/ls2080ardb.c
index df2d768..0017f60 100644
--- a/board/freescale/ls2080ardb/ls2080ardb.c
+++ b/board/freescale/ls2080ardb/ls2080ardb.c
@@ -341,6 +341,32 @@ void board_quiesce_devices(void)
 #endif
 
 #ifdef CONFIG_OF_BOARD_SETUP
+void fsl_fdt_fixup_flash(void *fdt)
+{
+       int offset;
+
+/*
+ * IFC and QSPI are muxed on board.
+ * So disable IFC node in dts if QSPI is enabled or
+ * disable QSPI node in dts in case QSPI is not enabled.
+ */
+#ifdef CONFIG_FSL_QSPI
+       offset = fdt_path_offset(fdt, "/soc/ifc");
+
+       if (offset < 0)
+               offset = fdt_path_offset(fdt, "/ifc");
+#else
+       offset = fdt_path_offset(fdt, "/soc/quadspi");
+
+       if (offset < 0)
+               offset = fdt_path_offset(fdt, "/quadspi");
+#endif
+       if (offset < 0)
+               return;
+
+       fdt_status_disabled(fdt, offset);
+}
+
 int ft_board_setup(void *blob, bd_t *bd)
 {
        u64 base[CONFIG_NR_DRAM_BANKS];
@@ -368,6 +394,8 @@ int ft_board_setup(void *blob, bd_t *bd)
 
        fsl_fdt_fixup_dr_usb(blob, bd);
 
+       fsl_fdt_fixup_flash(blob);
+
 #ifdef CONFIG_FSL_MC_ENET
        fdt_fixup_board_enet(blob);
 #endif
-- 
1.9.1

_______________________________________________
U-Boot mailing list
[email protected]
https://lists.denx.de/listinfo/u-boot

Reply via email to