From 1941a901f08893dfc2f2cb8a44c6172a9f7ae8e4 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Tue, 30 Jul 2024 19:27:03 +0200 Subject: ArmPlatformPkg/PrePi: Drop secondary stack handling This SEC driver is single CPU only now, so all of the secondary stack handling is dead code, and can be removed. This removes the last remaining user of the associated PCD, so drop that as well. Signed-off-by: Ard Biesheuvel --- ArmPlatformPkg/ArmPlatformPkg.dec | 1 - ArmPlatformPkg/PrePi/AArch64/ModuleEntryPoint.S | 30 ++++-------------------- ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.S | 31 ++++--------------------- ArmPlatformPkg/PrePi/PeiUniCore.inf | 2 -- 4 files changed, 10 insertions(+), 54 deletions(-) (limited to 'ArmPlatformPkg') diff --git a/ArmPlatformPkg/ArmPlatformPkg.dec b/ArmPlatformPkg/ArmPlatformPkg.dec index be384524bd..e8be550a8a 100644 --- a/ArmPlatformPkg/ArmPlatformPkg.dec +++ b/ArmPlatformPkg/ArmPlatformPkg.dec @@ -61,7 +61,6 @@ # Stack for CPU Cores in Non Secure Mode gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase|0|UINT64|0x00000009 gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize|0x10000|UINT32|0x00000037 - gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondaryStackSize|0x1000|UINT32|0x0000000A # Size of the region used by UEFI in permanent memory (Reserved 128MB by default) gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x08000000|UINT32|0x00000015 diff --git a/ArmPlatformPkg/PrePi/AArch64/ModuleEntryPoint.S b/ArmPlatformPkg/PrePi/AArch64/ModuleEntryPoint.S index e3aa546897..c45fc5f400 100644 --- a/ArmPlatformPkg/PrePi/AArch64/ModuleEntryPoint.S +++ b/ArmPlatformPkg/PrePi/AArch64/ModuleEntryPoint.S @@ -11,11 +11,6 @@ ASM_FUNC(_ModuleEntryPoint) // Do early platform specific actions bl ASM_PFX(ArmPlatformPeiBootAction) - // Get ID of this CPU in multi-core system - bl ASM_PFX(ArmReadMpidr) - // Keep a copy of the MpId register value - mov x10, x0 - _SetSVCMode: // Check if we can install the stack at the top of the System Memory or if we need // to install the stacks at the bottom of the Firmware Device (case the FD is located @@ -71,31 +66,16 @@ _GetBaseUefiMemory: sub x11, x1, x4 _GetStackBase: - // r1 = The top of the Mpcore Stacks + // r1 = The top of the stack + mov sp, x1 + // Stack for the primary core = PrimaryCoreStack MOV32 (x2, FixedPcdGet32(PcdCPUCorePrimaryStackSize)) sub x12, x1, x2 - // Stack for the secondary core = Number of Cores - 1 - MOV32 (x1, (FixedPcdGet32(PcdCoreCount) - 1) * FixedPcdGet32(PcdCPUCoreSecondaryStackSize)) - sub x12, x12, x1 - - // x12 = The base of the MpCore Stacks (primary stack & secondary stacks) - mov x0, x12 - mov x1, x10 - //ArmPlatformStackSet(StackBase, MpId, PrimaryStackSize, SecondaryStackSize) - MOV32 (x2, FixedPcdGet32(PcdCPUCorePrimaryStackSize)) - MOV32 (x3, FixedPcdGet32(PcdCPUCoreSecondaryStackSize)) - bl ASM_PFX(ArmPlatformStackSet) - - // Is it the Primary Core ? - mov x0, x10 - bl ASM_PFX(ArmPlatformIsPrimaryCore) - cmp x0, #1 - bne _PrepareArguments + // Get ID of this CPU in multi-core system + bl ASM_PFX(ArmReadMpidr) -_PrepareArguments: - mov x0, x10 mov x1, x11 mov x2, x12 diff --git a/ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.S b/ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.S index 60e530e4f1..c87f94689c 100644 --- a/ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.S +++ b/ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.S @@ -13,11 +13,6 @@ ASM_FUNC(_ModuleEntryPoint) // Do early platform specific actions bl ASM_PFX(ArmPlatformPeiBootAction) - // Get ID of this CPU in multi-core system - bl ASM_PFX(ArmReadMpidr) - // Keep a copy of the MpId register value - mov r8, r0 - _SetSVCMode: // Enter SVC mode, Disable FIQ and IRQ mov r1, #(CPSR_MODE_SVC | CPSR_IRQ | CPSR_FIQ) @@ -81,34 +76,18 @@ _GetBaseUefiMemory: sub r9, r1, r4 _GetStackBase: - // r1 = The top of the Mpcore Stacks + // r1 = The top of the stack + mov sp, r1 + // Stack for the primary core = PrimaryCoreStack MOV32 (r2, FixedPcdGet32(PcdCPUCorePrimaryStackSize)) sub r10, r1, r2 - // Stack for the secondary core = Number of Cores - 1 - MOV32 (r1, (FixedPcdGet32(PcdCoreCount) - 1) * FixedPcdGet32(PcdCPUCoreSecondaryStackSize)) - sub r10, r10, r1 - - // r10 = The base of the MpCore Stacks (primary stack & secondary stacks) - mov r0, r10 - mov r1, r8 - //ArmPlatformStackSet(StackBase, MpId, PrimaryStackSize, SecondaryStackSize) - MOV32 (r2, FixedPcdGet32(PcdCPUCorePrimaryStackSize)) - MOV32 (r3, FixedPcdGet32(PcdCPUCoreSecondaryStackSize)) - bl ASM_PFX(ArmPlatformStackSet) - - // Is it the Primary Core ? - mov r0, r8 - bl ASM_PFX(ArmPlatformIsPrimaryCore) - cmp r0, #1 - bne _PrepareArguments + // Get ID of this CPU in multi-core system + bl ASM_PFX(ArmReadMpidr) -_PrepareArguments: - mov r0, r8 mov r1, r9 mov r2, r10 - mov r3, sp // Move sec startup address into a data register // Ensure we're jumping to FV version of the code (not boot remapped alias) diff --git a/ArmPlatformPkg/PrePi/PeiUniCore.inf b/ArmPlatformPkg/PrePi/PeiUniCore.inf index 5c32fcbee4..9aa97d0a30 100644 --- a/ArmPlatformPkg/PrePi/PeiUniCore.inf +++ b/ArmPlatformPkg/PrePi/PeiUniCore.inf @@ -48,7 +48,6 @@ DebugAgentLib PrePiLib ArmPlatformLib - ArmPlatformStackLib MemoryAllocationLib HobLib PrePiHobListPointerLib @@ -78,7 +77,6 @@ gArmTokenSpaceGuid.PcdFvSize gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize - gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondaryStackSize gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize -- cgit v1.2.3