Hi Arm experts,
Is PSCI related code in ArmPakage up-to-date?
There are couple of definition and function call to check for PSCI support
(below) and I can't find that documented in ARM PSCI white paper. Perhaps I am
missing something. Can you help provide pointer which document provide details
on SMC call defined in ArmSmc.h?
Thanks
-Alok
For example BdsLinuxFdt makes SMC call to check for PSCI support but I don't
see these SMC call defined in PSCI white paper
ArmSmc.h:
#define ARM_TRUSTZONE_ARM_FAST_SMC_ID_PRESENCE 0x80FFFF00
#define ARM_TRUSTZONE_ARM_FAST_SMC_ID_UID 0x80FFFF10
#define ARM_SMC_ID_PRESENCE ARM_TRUSTZONE_ARM_FAST_SMC_ID_PRESENCE
#define ARM_SMC_ID_UID ARM_TRUSTZONE_ARM_FAST_SMC_ID_UID
#define ARM_SMC_ID_REVISION ARM_TRUSTZONE_ARM_FAST_SMC_ID_REVISION
#define ARM_SMC_ARM_CPU_SUSPEND 0x80100001
#define ARM_SMC_ARM_CPU_OFF 0x80100002
#define ARM_SMC_ARM_CPU_ON 0x80100003
#define ARM_SMC_ARM_MIGRATE 0x80100004
None of those seems to match the PSCI value that is defined in the whitepaper.
The correct value of the PSCI functions should be below (as defined in the
trusted firmware code/PSCI document)
#define PSCI_VERSION 0x84000000
#define PSCI_CPU_OFF 0x84000002
#define PSCI_CPU_ON_AARCH32 0x84000003
#define PSCI_CPU_ON_AARCH64 0xc4000003
#define PSCI_SYSTEM_OFF 0x84000008
#define PSCI_SYSTEM_RESET 0x84000009
Similarly the below code make undocumented (or I don't have that document) SMC
call ARM_SMC_ID_PRESENCE to check for PSCI support. Should the below function
rather make SMC call to check for PSCI version (0x84000000) etc
File: BdsLinuxFdt.c
STATIC
BOOLEAN
IsPsciSmcSupported (
VOID
)
{
BOOLEAN PsciSmcSupported;
UINTN Rx;
PsciSmcSupported = FALSE;
// Check the SMC response to the Presence SMC
Rx = ARM_SMC_ID_PRESENCE;
ArmCallSmc (&Rx);
if (Rx == 1) {
// Check the SMC UID
Rx = ARM_SMC_ID_UID;
ArmCallSmc (&Rx);
if (Rx == ARM_TRUSTZONE_UID_4LETTERID) {
Rx = ARM_SMC_ID_UID + 1;
ArmCallSmc (&Rx);
if (Rx == ARM_TRUSTZONE_ARM_UID) {
PsciSmcSupported = TRUE;
}
}
}
return PsciSmcSupported;
}
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel