aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-meson/board-common.c
diff options
context:
space:
mode:
authorTom Rini2019-08-12 18:48:34 -0400
committerTom Rini2019-08-12 23:03:35 -0400
commit60f38d82c45fef55ac04ee52b234e6dd07e31935 (patch)
tree1bf05a3ecc7ebeba4247134aa6cf5dda1ec87e73 /arch/arm/mach-meson/board-common.c
parent9c6115822e894ead72fa4c094bf718eaabb9e103 (diff)
parenteb1677250d704b93169a58114a74424c7bfa495a (diff)
Merge tag 'u-boot-amlogic-20190812' of https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic
- amlogic: add support for the SEI Robotic SEI510
Diffstat (limited to 'arch/arm/mach-meson/board-common.c')
-rw-r--r--arch/arm/mach-meson/board-common.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/arm/mach-meson/board-common.c b/arch/arm/mach-meson/board-common.c
index 0843dca156c..d261b4ea331 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(&regs);
+
+ while (1)
+ ;
+}
+#else
void reset_cpu(ulong addr)
{
psci_system_reset();
}
+#endif