ARM Power Firmware / "APPF"
martin.blumenstingl at googlemail.com
Sun May 7 11:21:31 PDT 2017
recently I've been looking into the older-gen Amlogic Meson SoCs.
while looking at the suspend code from the vendor GPL kernel sources I
found something interesting:
these SoCs (Meson6, Meson8, Meson8b and Meson8m2) seem to use the ARM
Power Firmware, also called "APPF"
there's not much information about this on the internet.
however, the Amlogic u-boot GPL sources come with documentation for this: 
Amlogic seems to use APPF in case "Trustzone" is disabled (see ).
the actual invocation to APPF during suspend can be found here  for
non-Trustzone kernels, and here  for kernels with Trustzone enabled
(in the latter case a SMC is used)
from what I understood so far it works like this:
1. APPF - which is compiled as position independent ELF - is loaded
into main memory by u-boot, see 
2. u-boot initializes APPF (also part of )
3. kernel boots and should not modify this memory-region (reading and
executing is fine)
4. kernel initializes APPF by calling appf_runtime_call with function
APPF_INITIALIZE (this is done by simply jumping to the memory from the
APPF ELF -> this lands us here: )
5. appf_runtime_call is invoked with function APPF_POWER_DOWN_CPU ->
this blocks until the system is woken up
so far this sounds pretty generic and does not contain (much) Amlogic
there is a second (Amlogic specific) part which is involved in system
suspend: arc_power firmware - this seems to be executed on an ARC core
embedded in the Amlogic SoCs using the SRAM instead of DRAM (as the
latter is powered down / in self-refresh mode). sources for the
arc_power firmware can be found here: 
onto the actual question(s):
- are there any other SoC vendors which use APPF other than Amlogic?
- is there anything else I should know about this "feature"?
- is there a good reason why I should not try to implement mainline
support for this?
More information about the linux-amlogic