]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: socfpga: Move Stratix10 and Agilex SPL common code
authorSiew Chin Lim <elly.siew.chin.lim@intel.com>
Mon, 15 Mar 2021 07:59:16 +0000 (15:59 +0800)
committerLey Foon Tan <ley.foon.tan@intel.com>
Thu, 8 Apr 2021 09:29:11 +0000 (17:29 +0800)
Move Stratix10 and Agilex SPL common code to spl_soc64.c.
We are in preparation for new n5x device support.
No functional change in this patch.

Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>
arch/arm/mach-socfpga/Makefile
arch/arm/mach-socfpga/spl_agilex.c
arch/arm/mach-socfpga/spl_s10.c
arch/arm/mach-socfpga/spl_soc64.c [new file with mode: 0644]

index 9e63296b385fbf3c2dce3fd488823042d2ee6070..e4c2da93d59d589fcbcda8e752fb0bb647be4d34 100644 (file)
@@ -70,10 +70,12 @@ endif
 ifdef CONFIG_TARGET_SOCFPGA_STRATIX10
 obj-y  += firewall.o
 obj-y  += spl_s10.o
+obj-y  += spl_soc64.o
 endif
 ifdef CONFIG_TARGET_SOCFPGA_AGILEX
 obj-y  += firewall.o
 obj-y  += spl_agilex.o
+obj-y  += spl_soc64.o
 endif
 else
 obj-$(CONFIG_SPL_ATF) += secure_reg_helper.o
index 71b17ce3a59957fc493a750270bceb5064185087..ee5a9dc1e2f5059c52ea254c655a37046dd5a0af 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-u32 spl_boot_device(void)
-{
-       return BOOT_DEVICE_MMC1;
-}
-
-#ifdef CONFIG_SPL_MMC_SUPPORT
-u32 spl_mmc_boot_mode(const u32 boot_device)
-{
-#if defined(CONFIG_SPL_FS_FAT) || defined(CONFIG_SPL_FS_EXT4)
-       return MMCSD_MODE_FS;
-#else
-       return MMCSD_MODE_RAW;
-#endif
-}
-#endif
-
 void board_init_f(ulong dummy)
 {
        int ret;
index 955a1161e898a0d77ed44ec75a8611a2ac826516..c20e87cdbef3b69ab9384c85d5fa43c64d218049 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-u32 spl_boot_device(void)
-{
-       /* TODO: Get from SDM or handoff */
-       return BOOT_DEVICE_MMC1;
-}
-
-#ifdef CONFIG_SPL_MMC_SUPPORT
-u32 spl_mmc_boot_mode(const u32 boot_device)
-{
-#if defined(CONFIG_SPL_FS_FAT) || defined(CONFIG_SPL_FS_EXT4)
-       return MMCSD_MODE_FS;
-#else
-       return MMCSD_MODE_RAW;
-#endif
-}
-#endif
-
 void board_init_f(ulong dummy)
 {
        const struct cm_config *cm_default_cfg = cm_get_default_config();
diff --git a/arch/arm/mach-socfpga/spl_soc64.c b/arch/arm/mach-socfpga/spl_soc64.c
new file mode 100644 (file)
index 0000000..cb98ab3
--- /dev/null
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ *  Copyright (C) 2020 Intel Corporation. All rights reserved
+ *
+ */
+
+#include <common.h>
+#include <spl.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+u32 spl_boot_device(void)
+{
+       return BOOT_DEVICE_MMC1;
+}
+
+#if IS_ENABLED(CONFIG_SPL_MMC_SUPPORT)
+u32 spl_boot_mode(const u32 boot_device)
+{
+       if (IS_ENABLED(CONFIG_SPL_FS_FAT) || IS_ENABLED(CONFIG_SPL_FS_EXT4))
+               return MMCSD_MODE_FS;
+       else
+               return MMCSD_MODE_RAW;
+}
+#endif