0040-sunxi-Enable-support-for-SCP-firmware-on-H3.patch 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. From aefe751d6f23c9d526bca447c6c28da97e45e528 Mon Sep 17 00:00:00 2001
  2. From: Samuel Holland <[email protected]>
  3. Date: Sat, 17 Apr 2021 13:33:54 -0500
  4. Subject: [PATCH 40/90] sunxi: Enable support for SCP firmware on H3
  5. Now that issues with the BROM have been sorted out, we can implement
  6. PSCI system suspend on H3 by delegating to SCP firmware. Let's start by
  7. including the firmware in the FIT image and starting the coprocessor if
  8. valid firmware is loaded.
  9. Signed-off-by: Samuel Holland <[email protected]>
  10. ---
  11. arch/arm/dts/sunxi-u-boot.dtsi | 1 +
  12. board/sunxi/board.c | 8 ++++++++
  13. include/configs/sun8i.h | 3 +++
  14. 3 files changed, 12 insertions(+)
  15. --- a/arch/arm/dts/sunxi-u-boot.dtsi
  16. +++ b/arch/arm/dts/sunxi-u-boot.dtsi
  17. @@ -9,6 +9,7 @@
  18. #if defined(CONFIG_MACH_SUN8I_H3)
  19. #ifdef CONFIG_ARMV7_PSCI
  20. #define RESUME_ADDR SUNXI_RESUME_BASE
  21. +#define SCP_ADDR SUNXI_SCP_BASE
  22. #endif
  23. #elif defined(CONFIG_MACH_SUN50I) || defined(CONFIG_MACH_SUN50I_H5)
  24. #define BL31_ADDR 0x00044000
  25. --- a/board/sunxi/board.c
  26. +++ b/board/sunxi/board.c
  27. @@ -19,6 +19,7 @@
  28. #include <init.h>
  29. #include <log.h>
  30. #include <mmc.h>
  31. +#include <remoteproc.h>
  32. #include <axp_pmic.h>
  33. #include <generic-phy.h>
  34. #include <phy-sun4i-usb.h>
  35. @@ -867,6 +868,13 @@ int board_late_init(void)
  36. usb_ether_init();
  37. #endif
  38. +#ifdef CONFIG_REMOTEPROC_SUN6I_AR100
  39. + if (!rproc_load(0, SUNXI_SCP_BASE, SUNXI_SCP_MAX_SIZE)) {
  40. + puts("Starting SCP...\n");
  41. + rproc_start(0);
  42. + }
  43. +#endif
  44. +
  45. return 0;
  46. }
  47. --- a/include/configs/sun8i.h
  48. +++ b/include/configs/sun8i.h
  49. @@ -12,6 +12,9 @@
  50. CONFIG_ARMV7_SECURE_MAX_SIZE)
  51. #define SUNXI_RESUME_SIZE 1024
  52. +#define SUNXI_SCP_BASE (SUNXI_RESUME_BASE + SUNXI_RESUME_SIZE)
  53. +#define SUNXI_SCP_MAX_SIZE (16 * 1024)
  54. +
  55. #include <configs/sunxi-common.h>
  56. #endif /* __CONFIG_H */