SPDX: Convert all of our single license tags to Linux Kernel style
[oweals/u-boot.git] / arch / arm / lib / bootm-fdt.c
index e261d4febf6f63e1d69dfafbd8f31893304c1b75..04f566d2b0f423ccfc02ed6acf0e1ceded810fe7 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (c) 2013, Google Inc.
  *
@@ -11,8 +12,6 @@
  * Marius Groeger <mgroeger@sysgo.de>
  *
  * Copyright (C) 2001  Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifdef CONFIG_FMAN_ENET
+__weak int fdt_update_ethernet_dt(void *blob)
+{
+       return 0;
+}
+#endif
+
 int arch_fixup_fdt(void *blob)
 {
+       __maybe_unused int ret = 0;
+#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_OF_LIBFDT)
        bd_t *bd = gd->bd;
-       int bank, ret;
+       int bank;
        u64 start[CONFIG_NR_DRAM_BANKS];
        u64 size[CONFIG_NR_DRAM_BANKS];
 
@@ -42,9 +50,11 @@ int arch_fixup_fdt(void *blob)
 #endif
        }
 
+#ifdef CONFIG_OF_LIBFDT
        ret = fdt_fixup_memory_banks(blob, start, size, CONFIG_NR_DRAM_BANKS);
        if (ret)
                return ret;
+#endif
 
 #ifdef CONFIG_ARMV8_SPIN_TABLE
        ret = spin_table_update_dt(blob);
@@ -53,11 +63,17 @@ int arch_fixup_fdt(void *blob)
 #endif
 
 #if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV8_PSCI) || \
-       defined(CONFIG_FSL_PPA_ARMV8_PSCI)
+       defined(CONFIG_SEC_FIRMWARE_ARMV8_PSCI)
        ret = psci_update_dt(blob);
        if (ret)
                return ret;
 #endif
+#endif
 
+#ifdef CONFIG_FMAN_ENET
+       ret = fdt_update_ethernet_dt(blob);
+       if (ret)
+               return ret;
+#endif
        return 0;
 }