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>,
Sieu Mun Tang <sieu.mun.tang@intel.com>,
Jit Loon Lim <jit.loon.lim@intel.com>,
Chee Hong Ang <chee.hong.ang@intel.com>
Subject: [PATCH 2/2] arm: socfpga: soc64: Perform warm reset after L2 reset in SPL on S10
Date: Wed, 31 Aug 2022 19:20:44 +0800 [thread overview]
Message-ID: <20220831112044.25371-3-jit.loon.lim@intel.com> (raw)
In-Reply-To: <20220831112044.25371-1-jit.loon.lim@intel.com>
From: Chee Hong Ang <chee.hong.ang@intel.com>
SPL checks for magic word in system manager's scratch register
to find out whether the system has performed L2 reset. If L2
reset was performed, SPL put all slave CPUs (CPU1-3) into WFI
mode. Master CPU (CPU0) requests warm reset via RMR_EL3 system
register and put itself into WFI mode. Firmware will get the
warm reset request from HPS and perform the warm reset sequence
to reboot all the HPS cores.
Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
---
arch/arm/mach-socfpga/lowlevel_init_soc64.S | 24 +++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/arch/arm/mach-socfpga/lowlevel_init_soc64.S b/arch/arm/mach-socfpga/lowlevel_init_soc64.S
index 875927cc4d..1fd0a50b3a 100644
--- a/arch/arm/mach-socfpga/lowlevel_init_soc64.S
+++ b/arch/arm/mach-socfpga/lowlevel_init_soc64.S
@@ -12,6 +12,30 @@
ENTRY(lowlevel_init)
mov x29, lr /* Save LR */
+#ifdef CONFIG_SPL_BUILD
+ /* Check for L2 reset magic word */
+ ldr x4, =L2_RESET_DONE_REG
+ ldr x5, [x4]
+ ldr x1, =L2_RESET_DONE_STATUS
+ cmp x1, x5
+ /* No L2 reset, skip warm reset */
+ b.ne skipwarmreset
+ /* L2 reset completed */
+ str xzr, [x4]
+ /* Put all slaves CPUs into WFI mode */
+ branch_if_slave x0, put_cpu_in_wfi
+ /* Master CPU (CPU0) request for warm reset */
+ mrs x1, rmr_el3
+ orr x1, x1, #0x02
+ msr rmr_el3, x1
+ isb
+ dsb sy
+put_cpu_in_wfi:
+ wfi
+ b put_cpu_in_wfi
+skipwarmreset:
+#endif
+
#if defined(CONFIG_GICV2) || defined(CONFIG_GICV3)
#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_ATF)
wait_for_atf:
--
2.26.2
prev parent reply other threads:[~2022-08-31 11:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-31 11:20 [PATCH 0/2] *** SUBJECT HERE *** Jit Loon Lim
2022-08-31 11:20 ` [PATCH 1/2] arm: socfpga: soc64: Enable L2 reset on S10 Jit Loon Lim
2022-08-31 11:20 ` Jit Loon Lim [this message]
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=20220831112044.25371-3-jit.loon.lim@intel.com \
--to=jit.loon.lim@intel.com \
--cc=alif.zakuan.yuslaimi@intel.com \
--cc=boon.khai.ng@intel.com \
--cc=chee.hong.ang@intel.com \
--cc=dinesh.maniyam@intel.com \
--cc=elly.siew.chin.lim@intel.com \
--cc=jagan@amarulasolutions.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