From: Neil Armstrong <narmstrong@baylibre.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RESEND PATCH 4/5] ARM: meson: Add support for fastboot_set_reboot_flag()
Date: Mon, 29 Jul 2019 16:07:50 +0200 [thread overview]
Message-ID: <20190729140751.7851-5-narmstrong@baylibre.com> (raw)
In-Reply-To: <20190729140751.7851-1-narmstrong@baylibre.com>
Add support for fastboot_set_reboot_flag() by storing the reboot
flag in the common code to be used by the custom PSCI reboot handler.
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
arch/arm/mach-meson/board-common.c | 33 ++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/arch/arm/mach-meson/board-common.c b/arch/arm/mach-meson/board-common.c
index 18383f774e..c39643fc17 100644
--- a/arch/arm/mach-meson/board-common.c
+++ b/arch/arm/mach-meson/board-common.c
@@ -14,6 +14,11 @@
#include <asm/unaligned.h>
#include <efi_loader.h>
+#if CONFIG_IS_ENABLED(FASTBOOT)
+#include <asm/psci.h>
+#include <fastboot.h>
+#endif
+
DECLARE_GLOBAL_DATA_PTR;
__weak int board_init(void)
@@ -142,7 +147,35 @@ int board_late_init(void)
return meson_board_late_init();
}
+#if CONFIG_IS_ENABLED(FASTBOOT)
+static unsigned int reboot_reason = REBOOT_REASON_NORMAL;
+
+int fastboot_set_reboot_flag()
+{
+ reboot_reason = REBOOT_REASON_BOOTLOADER;
+
+ printf("Using reboot reason: 0x%x\n", reboot_reason);
+
+ return 0;
+}
+
+void reset_cpu(ulong addr)
+{
+ struct pt_regs regs;
+
+ regs.regs[0] = ARM_PSCI_0_2_FN_SYSTEM_RESET;
+ regs.regs[1] = reboot_reason;
+
+ printf("Rebooting with reason: 0x%lx\n", regs.regs[1]);
+
+ smc_call(®s);
+
+ while (1)
+ ;
+}
+#else
void reset_cpu(ulong addr)
{
psci_system_reset();
}
+#endif
--
2.22.0
next prev parent reply other threads:[~2019-07-29 14:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-29 14:07 [U-Boot] [RESEND PATCH 0/5] amlogic: add support for the SEI Robotic SEI510 Neil Armstrong
2019-07-29 14:07 ` [U-Boot] [RESEND PATCH 1/5] ARM: dts: Import Amlogic G12A SEI510 DT from Linux 5.3-rc1 Neil Armstrong
2019-07-29 14:07 ` [U-Boot] [RESEND PATCH 2/5] configs: meson64: permit redefining ENV_SIZE Neil Armstrong
2019-07-29 14:07 ` [U-Boot] [RESEND PATCH 3/5] boards: meson: add g12a sei510 Neil Armstrong
2019-07-29 14:07 ` Neil Armstrong [this message]
2019-07-29 14:07 ` [U-Boot] [RESEND PATCH 5/5] configs: sei510: disable PSCI_RESET to support fastboot reboot_flag Neil Armstrong
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=20190729140751.7851-5-narmstrong@baylibre.com \
--to=narmstrong@baylibre.com \
--cc=u-boot@lists.denx.de \
/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