mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 02:17:36 -04:00
firmware: smccc: Fix Arm SMCCC SOC_ID name call
Commit5f9c23abc4("firmware: smccc: Support optional Arm SMCCC SOC_ID name") introduced the SOC_ID name string call, which reports a human readable string describing the SoC, as returned by firmware. The SMCCC spec v1.6 describes this feature as AArch64 only, since we rely on 8 characters to be transmitted per register. Consequently the SMCCC call must use the AArch64 calling convention, which requires bit 30 of the FID to be set. The spec is a bit confusing here, since it mentions that in the parameter description ("2: SoC name (optionally implemented for SMC64 calls, ..."), but still prints the FID explicitly as 0x80000002. But as this FID is using the SMC32 calling convention (correct for the other two calls), it will not match what any SMCCC conformant firmware is expecting, so any call would return NOT_SUPPORTED. Add a 64-bit version of the ARCH_SOC_ID FID macro, and use that for the SoC name version of the call to fix the issue. Fixes:5f9c23abc4("firmware: smccc: Support optional Arm SMCCC SOC_ID name") Signed-off-by: Andre Przywara <andre.przywara@arm.com> Link: https://patch.msgid.link/20250902172053.304911-1-andre.przywara@arm.com Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
This commit is contained in:
committed by
Sudeep Holla
parent
01b9cae706
commit
70492cfce2
@@ -60,7 +60,7 @@ static char __init *smccc_soc_name_init(void)
|
||||
* to the ARM_SMCCC_ARCH_SOC_ID function. Fetch it if
|
||||
* available.
|
||||
*/
|
||||
args.a0 = ARM_SMCCC_ARCH_SOC_ID;
|
||||
args.a0 = ARM_SMCCC_ARCH_SOC_ID64;
|
||||
args.a1 = 2; /* SOC_ID name */
|
||||
arm_smccc_1_2_invoke(&args, &res);
|
||||
|
||||
|
||||
@@ -90,6 +90,11 @@
|
||||
ARM_SMCCC_SMC_32, \
|
||||
0, 2)
|
||||
|
||||
#define ARM_SMCCC_ARCH_SOC_ID64 \
|
||||
ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \
|
||||
ARM_SMCCC_SMC_64, \
|
||||
0, 2)
|
||||
|
||||
#define ARM_SMCCC_ARCH_WORKAROUND_1 \
|
||||
ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \
|
||||
ARM_SMCCC_SMC_32, \
|
||||
|
||||
Reference in New Issue
Block a user