From: Jit Loon Lim <jit.loon.lim@intel.com>
To: u-boot@lists.denx.de
Cc: Jagan Teki <jagan@amarulasolutions.com>,
Vignesh R <vigneshr@ti.com>, Marek <marex@denx.de>,
Simon <simon.k.r.goldschmidt@gmail.com>,
Tien Fong <tien.fong.chee@intel.com>,
Kok Kiang <kok.kiang.hea@intel.com>,
Siew Chin <elly.siew.chin.lim@intel.com>,
Sin Hui <sin.hui.kho@intel.com>, Raaj <raaj.lokanathan@intel.com>,
Dinesh <dinesh.maniyam@intel.com>,
Boon Khai <boon.khai.ng@intel.com>,
Alif <alif.zakuan.yuslaimi@intel.com>,
Teik Heng <teik.heng.chong@intel.com>,
Hazim <muhammad.hazim.izzat.zamri@intel.com>,
Jit Loon Lim <jit.loon.lim@intel.com>,
Sieu Mun Tang <sieu.mun.tang@intel.com>,
"Ooi, Joyce" <joyce.ooi@intel.com>,
Ooi@ecsmtp.png.intel.com
Subject: [PATCH 2/2] arm: spl: create a common spl for Stratix10 and Agilex
Date: Fri, 16 Sep 2022 22:23:36 +0800 [thread overview]
Message-ID: <20220916142336.18907-2-jit.loon.lim@intel.com> (raw)
In-Reply-To: <20220916142336.18907-1-jit.loon.lim@intel.com>
From: "Ooi, Joyce" <joyce.ooi@intel.com>
Since Stratix10 and Agilex are using ARM64, there are some common codes
in the SPL. Hence, spl_soc64.c is created to place the common codes.
Signed-off-by: Ooi, Joyce <joyce.ooi@intel.com>
Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
---
arch/arm/mach-socfpga/spl_s10.c | 63 ---------------------------
arch/arm/mach-socfpga/spl_soc64.c | 71 +++++++++++++++++++++++++++++--
2 files changed, 67 insertions(+), 67 deletions(-)
diff --git a/arch/arm/mach-socfpga/spl_s10.c b/arch/arm/mach-socfpga/spl_s10.c
index c4b82ebf14..fb807acf27 100644
--- a/arch/arm/mach-socfpga/spl_s10.c
+++ b/arch/arm/mach-socfpga/spl_s10.c
@@ -29,69 +29,6 @@
DECLARE_GLOBAL_DATA_PTR;
-u32 spl_boot_device(void)
-{
- int ret, size;
- ofnode node;
- const fdt32_t *phandle_p;
- u32 phandle;
- struct udevice *dev;
-
- node = ofnode_path("/chosen");
- if (!ofnode_valid(node)) {
- debug("%s: /chosen node was not found.\n", __func__);
- goto fallback;
- }
-
- phandle_p = ofnode_get_property(node, "u-boot,boot0", &size);
- if (!phandle_p) {
- debug("%s: u-boot,boot0 property was not found.\n",
- __func__);
- goto fallback;
- }
-
- phandle = fdt32_to_cpu(*phandle_p);
-
- node = ofnode_get_by_phandle(phandle);
-
- ret = device_get_global_by_ofnode(node, &dev);
- if (ret) {
- debug("%s: Boot device at not found, error: %d\n", __func__,
- ret);
- goto fallback;
- }
-
- debug("%s: Found boot device %s\n", __func__, dev->name);
-
- switch (device_get_uclass_id(dev)) {
- case UCLASS_SPI_FLASH:
- return BOOT_DEVICE_SPI;
- case UCLASS_MISC:
- return BOOT_DEVICE_NAND;
- case UCLASS_MMC:
- return BOOT_DEVICE_MMC1;
- default:
- debug("%s: Booting from device uclass '%s' is not "
- "supported\n", __func__,
- dev_get_uclass_name(dev));
- }
-
-fallback:
- /* Return default boot device */
- 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
index ba6efc1d86..ea1acaf309 100644
--- a/arch/arm/mach-socfpga/spl_soc64.c
+++ b/arch/arm/mach-socfpga/spl_soc64.c
@@ -4,22 +4,85 @@
*
*/
+#include <asm/io.h>
+#include <asm/u-boot.h>
+#include <asm/utils.h>
#include <common.h>
+#include <debug_uart.h>
+#include <dm.h>
+#include <dm/ofnode.h>
+#include <image.h>
+#include <log.h>
#include <spl.h>
+#include <asm/arch/clock_manager.h>
+#include <asm/arch/firewall.h>
+#include <asm/arch/mailbox_s10.h>
+#include <asm/arch/reset_manager.h>
+#include <asm/arch/system_manager.h>
+#include <asm/arch/smmu_s10.h>
+#include <watchdog.h>
+#include <dm/uclass.h>
DECLARE_GLOBAL_DATA_PTR;
u32 spl_boot_device(void)
{
+ int ret, size;
+ ofnode node;
+ const fdt32_t *phandle_p;
+ u32 phandle;
+ struct udevice *dev;
+
+ node = ofnode_path("/chosen");
+ if (!ofnode_valid(node)) {
+ debug("%s: /chosen node was not found.\n", __func__);
+ goto fallback;
+ }
+
+ phandle_p = ofnode_get_property(node, "u-boot,boot0", &size);
+ if (!phandle_p) {
+ debug("%s: u-boot,boot0 property was not found.\n",
+ __func__);
+ goto fallback;
+ }
+
+ phandle = fdt32_to_cpu(*phandle_p);
+
+ node = ofnode_get_by_phandle(phandle);
+
+ ret = device_get_global_by_ofnode(node, &dev);
+ if (ret) {
+ debug("%s: Boot device at not found, error: %d\n", __func__,
+ ret);
+ goto fallback;
+ }
+
+ debug("%s: Found boot device %s\n", __func__, dev->name);
+
+ switch (device_get_uclass_id(dev)) {
+ case UCLASS_SPI_FLASH:
+ return BOOT_DEVICE_SPI;
+ case UCLASS_MISC:
+ return BOOT_DEVICE_NAND;
+ case UCLASS_MMC:
+ return BOOT_DEVICE_MMC1;
+ default:
+ debug("%s: Booting from device uclass '%s' is not supported\n",
+ __func__, dev_get_uclass_name(dev));
+ }
+
+fallback:
+ /* Return default boot device */
return BOOT_DEVICE_MMC1;
}
#if IS_ENABLED(CONFIG_SPL_MMC)
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;
+#if defined(CONFIG_SPL_FS_FAT) || defined(CONFIG_SPL_FS_EXT4)
+ return MMCSD_MODE_FS;
+#else
+ return MMCSD_MODE_RAW;
+#endif
}
#endif
--
2.26.2
next prev parent reply other threads:[~2022-09-16 14:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-16 14:23 [PATCH 1/2] spl: socfpga: Getting SPL boot device from DT Jit Loon Lim
2022-09-16 14:23 ` Jit Loon Lim [this message]
2022-09-16 14:31 ` Quentin Schulz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220916142336.18907-2-jit.loon.lim@intel.com \
--to=jit.loon.lim@intel.com \
--cc=Ooi@ecsmtp.png.intel.com \
--cc=alif.zakuan.yuslaimi@intel.com \
--cc=boon.khai.ng@intel.com \
--cc=dinesh.maniyam@intel.com \
--cc=elly.siew.chin.lim@intel.com \
--cc=jagan@amarulasolutions.com \
--cc=joyce.ooi@intel.com \
--cc=kok.kiang.hea@intel.com \
--cc=marex@denx.de \
--cc=muhammad.hazim.izzat.zamri@intel.com \
--cc=raaj.lokanathan@intel.com \
--cc=sieu.mun.tang@intel.com \
--cc=simon.k.r.goldschmidt@gmail.com \
--cc=sin.hui.kho@intel.com \
--cc=teik.heng.chong@intel.com \
--cc=tien.fong.chee@intel.com \
--cc=u-boot@lists.denx.de \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox