All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
To: sbabic@denx.de, festevam@gmail.com
Cc: uboot-imx@nxp.com, u-boot@lists.denx.de, Ye Li <ye.li@nxp.com>,
	Peng Fan <peng.fan@nxp.com>
Subject: [PATCH V4 21/44] arm: imx8ulp: Update the reset vector in u-boot
Date: Wed, 21 Jul 2021 22:17:02 +0800	[thread overview]
Message-ID: <20210721141725.23346-22-peng.fan@oss.nxp.com> (raw)
In-Reply-To: <20210721141725.23346-1-peng.fan@oss.nxp.com>

From: Ye Li <ye.li@nxp.com>

Because we have set reset vector to ATF in SPL, have to set it back
to ROM for any reset in u-boot

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/mach-imx/imx8ulp/soc.c | 35 +++++++++++++++++++++------------
 1 file changed, 22 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-imx/imx8ulp/soc.c b/arch/arm/mach-imx/imx8ulp/soc.c
index 051dec1a5a..5e7bf57a62 100644
--- a/arch/arm/mach-imx/imx8ulp/soc.c
+++ b/arch/arm/mach-imx/imx8ulp/soc.c
@@ -321,21 +321,10 @@ void get_board_serial(struct tag_serialnr *serialnr)
 }
 #endif
 
-int arch_cpu_init(void)
+static void set_core0_reset_vector(u32 entry)
 {
-	if (IS_ENABLED(CONFIG_SPL_BUILD))
-		clock_init();
-
-	return 0;
-}
-
-#if defined(CONFIG_SPL_BUILD)
-__weak void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
-{
-	debug("image entry point: 0x%lx\n", spl_image->entry_point);
-
 	/* Update SIM1 DGO8 for reset vector base */
-	writel((u32)spl_image->entry_point, SIM1_BASE_ADDR + 0x5c);
+	writel(entry, SIM1_BASE_ADDR + 0x5c);
 
 	/* set update bit */
 	setbits_le32(SIM1_BASE_ADDR + 0x8, 0x1 << 24);
@@ -349,6 +338,26 @@ __weak void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
 
 	/* clear the ack by set 1 */
 	setbits_le32(SIM1_BASE_ADDR + 0x8, (0x1 << 26));
+}
+
+int arch_cpu_init(void)
+{
+	if (IS_ENABLED(CONFIG_SPL_BUILD)) {
+		clock_init();
+	} else {
+		/* reconfigure core0 reset vector to ROM */
+		set_core0_reset_vector(0x1000);
+	}
+
+	return 0;
+}
+
+#if defined(CONFIG_SPL_BUILD)
+__weak void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
+{
+	debug("image entry point: 0x%lx\n", spl_image->entry_point);
+
+	set_core0_reset_vector((u32)spl_image->entry_point);
 
 	/* Enable the 512KB cache */
 	setbits_le32(SIM1_BASE_ADDR + 0x30, (0x1 << 4));
-- 
2.30.0


  parent reply	other threads:[~2021-07-21 13:47 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21 14:16 [PATCH V4 00/44] imx: add i.MX8ULP support Peng Fan (OSS)
2021-07-21 14:16 ` [PATCH V4 01/44] arm: imx: add i.MX8ULP basic Kconfig option Peng Fan (OSS)
2021-07-21 14:16 ` [PATCH V4 02/44] arm: imx: add i.MX8ULP cpu type and helper Peng Fan (OSS)
2021-07-21 14:16 ` [PATCH V4 03/44] arm: imx: sys_proto: move boot mode define to common header Peng Fan (OSS)
2021-07-21 14:16 ` [PATCH V4 04/44] arm: imx8ulp: support print cpu info Peng Fan (OSS)
2021-07-21 14:16 ` [PATCH V4 05/44] imx: imx8ulp: add get reset cause Peng Fan (OSS)
2021-07-21 14:16 ` [PATCH V4 06/44] arm: imx: basic i.MX8ULP support Peng Fan (OSS)
2021-07-21 14:16 ` [PATCH V4 07/44] arm: imx8: Move container parser and image to mach-imx common folder Peng Fan (OSS)
2021-07-21 14:16 ` [PATCH V4 08/44] arm: imx8: Move container image header file to mach-imx Peng Fan (OSS)
2021-07-21 14:16 ` [PATCH V4 09/44] arm: imx: parse-container: guard included header files Peng Fan (OSS)
2021-07-21 14:16 ` [PATCH V4 10/44] arm: imx8ulp: add container support Peng Fan (OSS)
2021-07-21 14:16 ` [PATCH V4 11/44] arm: imx: move container Kconfig under mach-imx Peng Fan (OSS)
2021-07-21 14:16 ` [PATCH V4 12/44] driver: misc: Add MU and S400 API to communicate with Sentinel Peng Fan (OSS)
2021-07-21 14:16 ` [PATCH V4 13/44] net: fec_mxc: support i.MX8ULP Peng Fan (OSS)
2021-07-21 14:16 ` [PATCH V4 14/44] pinctrl: Add pinctrl driver for imx8ulp Peng Fan (OSS)
2021-07-21 14:16 ` [PATCH V4 15/44] driver: serial: fsl_lpuart: support i.MX8ULP Peng Fan (OSS)
2021-07-21 14:16 ` [PATCH V4 16/44] arm: imx8ulp: add clock support Peng Fan (OSS)
2021-07-21 14:16 ` [PATCH V4 17/44] drivers: mmc: fsl_esdhc_imx: support i.MX8ULP Peng Fan (OSS)
2021-07-21 14:16 ` [PATCH V4 18/44] arm: imx8ulp: soc: Change to use CMC1 to get bootcfg Peng Fan (OSS)
2021-07-21 14:17 ` [PATCH V4 19/44] arm: imx8ulp: Enable full L2 cache in SPL Peng Fan (OSS)
2021-07-21 14:17 ` [PATCH V4 20/44] arm: imx8ulp: disable wdog3 Peng Fan (OSS)
2021-07-21 14:17 ` Peng Fan (OSS) [this message]
2021-07-21 14:17 ` [PATCH V4 22/44] drivers: misc: s400_api: Update S400_SUCCESS_IND to 0xd6 Peng Fan (OSS)
2021-07-21 14:17 ` [PATCH V4 23/44] drivers: misc: imx8ulp: Add S400 API for image authentication Peng Fan (OSS)
2021-07-21 14:17 ` [PATCH V4 24/44] drivers: misc: imx8ulp: Update S400 API for release RDC Peng Fan (OSS)
2021-07-21 14:17 ` [PATCH V4 25/44] drivers: misc: s400_api: Update API for fuse read and write Peng Fan (OSS)
2021-07-21 14:17 ` [PATCH V4 26/44] arm: imx8ulp: release and configure XRDC at early phase Peng Fan (OSS)
2021-07-21 14:17 ` [PATCH V4 27/44] arm: imx8ulp: add rdc support Peng Fan (OSS)
2021-07-21 14:17 ` [PATCH V4 28/44] arm: imx8ulp: add trdc release request Peng Fan (OSS)
2021-07-21 14:17 ` [PATCH V4 29/44] arm: imx8ulp: release trdc and assign lpav from RTD to APD Peng Fan (OSS)
2021-07-21 14:17 ` [PATCH V4 30/44] imx8ulp: unify rdc functions Peng Fan (OSS)
2021-07-21 14:17 ` [PATCH V4 31/44] arm: imx8ulp: Probe the S400 MU device in arch init Peng Fan (OSS)
2021-07-21 14:17 ` [PATCH V4 32/44] arm: iMX8ULP: Add boot device relevant functions Peng Fan (OSS)
2021-07-21 14:17 ` [PATCH V4 33/44] arm: imx8ulp: Allocate DCNANO and MIPI_DSI to AD domain Peng Fan (OSS)
2021-07-21 14:17 ` [PATCH V4 34/44] arm: imx8ulp: add dummy imx_get_mac_from_fuse Peng Fan (OSS)
2021-07-21 14:17 ` [PATCH V4 35/44] arm: imx8ulp: add iomuxc support Peng Fan (OSS)
2021-07-21 14:17 ` [PATCH V4 36/44] driver: misc: imx8ulp: Add fuse driver for imx8ulp Peng Fan (OSS)
2021-07-21 14:17 ` [PATCH V4 37/44] imx8ulp: soc: correct reset cause Peng Fan (OSS)
2021-07-21 14:17 ` [PATCH V4 38/44] imx8ulp: Use DGO_GP5 to get boot config Peng Fan (OSS)
2021-07-21 14:17 ` [PATCH V4 39/44] imx8ulp: Add workaround for eMMC boot Peng Fan (OSS)
2021-07-21 14:17 ` [PATCH V4 40/44] imx8ulp: move struct mu_type to common header Peng Fan (OSS)
2021-07-21 14:17 ` [PATCH V4 41/44] imx8ulp: add upower api support Peng Fan (OSS)
2021-07-21 14:17 ` [PATCH V4 42/44] ddr: Add DDR driver for iMX8ULP Peng Fan (OSS)
2021-07-21 14:17 ` [PATCH V4 43/44] arm: dts: add i.MX8ULP dtsi Peng Fan (OSS)
2021-07-21 14:17 ` [PATCH V4 44/44] arm: imx: add i.MX8ULP EVK support Peng Fan (OSS)
2021-08-02  9:45 ` [PATCH V4 00/44] imx: add i.MX8ULP support Peng Fan (OSS)
2021-08-02  9:54   ` Stefano Babic
2021-08-02 11:01     ` Peng Fan (OSS)
2021-08-06 14:09       ` Stefano Babic
2021-08-07  7:36         ` Peng Fan (OSS)

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=20210721141725.23346-22-peng.fan@oss.nxp.com \
    --to=peng.fan@oss.nxp.com \
    --cc=festevam@gmail.com \
    --cc=peng.fan@nxp.com \
    --cc=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    --cc=ye.li@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.