From 922dbccace49382d6aedcce18e5d494b444ce0b8 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Sat, 17 Apr 2021 13:33:54 -0500 Subject: [PATCH] sunxi: Enable support for SCP firmware on H3 Now that issues with the BROM have been sorted out, we can implement PSCI system suspend on H3 by delegating to SCP firmware. Let's start by including the firmware in the FIT image and starting the coprocessor if valid firmware is loaded. Signed-off-by: Samuel Holland --- arch/arm/dts/sunxi-u-boot.dtsi | 1 + board/sunxi/board.c | 8 ++++++++ include/configs/sun8i.h | 3 +++ 3 files changed, 12 insertions(+) diff --git a/arch/arm/dts/sunxi-u-boot.dtsi b/arch/arm/dts/sunxi-u-boot.dtsi index 9cb9e854536..228b43c0c03 100644 --- a/arch/arm/dts/sunxi-u-boot.dtsi +++ b/arch/arm/dts/sunxi-u-boot.dtsi @@ -9,6 +9,7 @@ #if defined(CONFIG_MACH_SUN8I_H3) #ifdef CONFIG_ARMV7_PSCI #define RESUME_ADDR SUNXI_RESUME_BASE +#define SCP_ADDR SUNXI_SCP_BASE #endif #elif defined(CONFIG_MACH_SUN50I) || defined(CONFIG_MACH_SUN50I_H5) #define BL31_ADDR 0x00044000 diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 21a2407e062..2be00b5d2f6 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -869,6 +870,13 @@ int board_late_init(void) usb_ether_init(); #endif +#ifdef CONFIG_REMOTEPROC_SUN6I_AR100 + if (!rproc_load(0, SUNXI_SCP_BASE, SUNXI_SCP_MAX_SIZE)) { + puts("Starting SCP...\n"); + rproc_start(0); + } +#endif + return 0; } diff --git a/include/configs/sun8i.h b/include/configs/sun8i.h index 5c31d91f406..7e2e5be5e20 100644 --- a/include/configs/sun8i.h +++ b/include/configs/sun8i.h @@ -12,6 +12,9 @@ CONFIG_ARMV7_SECURE_MAX_SIZE) #define SUNXI_RESUME_SIZE 1024 +#define SUNXI_SCP_BASE (SUNXI_RESUME_BASE + SUNXI_RESUME_SIZE) +#define SUNXI_SCP_MAX_SIZE (16 * 1024) + #include #endif /* __CONFIG_H */