diff --git a/Silicon/Qualcomm/SM7325Pkg/Library/PlatformPrePiLib/PlatformPrePiLib.c b/Silicon/Qualcomm/SM7325Pkg/Library/PlatformPrePiLib/PlatformPrePiLib.c index 670010d13..80e3537d9 100644 --- a/Silicon/Qualcomm/SM7325Pkg/Library/PlatformPrePiLib/PlatformPrePiLib.c +++ b/Silicon/Qualcomm/SM7325Pkg/Library/PlatformPrePiLib/PlatformPrePiLib.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "PlatformRegisters.h" @@ -8,13 +9,14 @@ VOID PlatformInitialize () { // Initialize GIC - // Wake up redistributor for CPU 0 - MmioWrite32( - GICR_WAKER_CURRENT_CPU, - (MmioRead32(GICR_WAKER_CURRENT_CPU) & ~GIC_WAKER_PROCESSORSLEEP)); + UINT32 EarlyInitCoreCnt = 2; + LocateConfigurationMapUINT32ByName("EarlyInitCoreCnt", &EarlyInitCoreCnt); - // Wake up redistributor for CPU 1 - MmioWrite32( - GICR_WAKER_CPU(1), - (MmioRead32(GICR_WAKER_CPU(1)) & ~GIC_WAKER_PROCESSORSLEEP)); + for (int i = 0; i < EarlyInitCoreCnt; i++) + { + // Wake up redistributor for CPU i + MmioWrite32( + GICR_WAKER_CPU(i), + (MmioRead32(GICR_WAKER_CPU(i)) & ~GIC_WAKER_PROCESSORSLEEP)); + } } \ No newline at end of file diff --git a/Silicon/Qualcomm/SM7325Pkg/Library/PlatformPrePiLib/PlatformPrePiLib.inf b/Silicon/Qualcomm/SM7325Pkg/Library/PlatformPrePiLib/PlatformPrePiLib.inf index 14d8c7b25..7ad7042fe 100644 --- a/Silicon/Qualcomm/SM7325Pkg/Library/PlatformPrePiLib/PlatformPrePiLib.inf +++ b/Silicon/Qualcomm/SM7325Pkg/Library/PlatformPrePiLib/PlatformPrePiLib.inf @@ -13,10 +13,12 @@ ArmPkg/ArmPkg.dec MdePkg/MdePkg.dec SiliciumPkg/SiliciumPkg.dec + QcomPkg/QcomPkg.dec [LibraryClasses] PcdLib IoLib + ConfigurationMapHelperLib [FixedPcd] gArmTokenSpaceGuid.PcdGicRedistributorsBase \ No newline at end of file diff --git a/Silicon/Qualcomm/SM8350Pkg/Library/PlatformPrePiLib/PlatformPrePiLib.c b/Silicon/Qualcomm/SM8350Pkg/Library/PlatformPrePiLib/PlatformPrePiLib.c index 670010d13..80e3537d9 100644 --- a/Silicon/Qualcomm/SM8350Pkg/Library/PlatformPrePiLib/PlatformPrePiLib.c +++ b/Silicon/Qualcomm/SM8350Pkg/Library/PlatformPrePiLib/PlatformPrePiLib.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "PlatformRegisters.h" @@ -8,13 +9,14 @@ VOID PlatformInitialize () { // Initialize GIC - // Wake up redistributor for CPU 0 - MmioWrite32( - GICR_WAKER_CURRENT_CPU, - (MmioRead32(GICR_WAKER_CURRENT_CPU) & ~GIC_WAKER_PROCESSORSLEEP)); + UINT32 EarlyInitCoreCnt = 2; + LocateConfigurationMapUINT32ByName("EarlyInitCoreCnt", &EarlyInitCoreCnt); - // Wake up redistributor for CPU 1 - MmioWrite32( - GICR_WAKER_CPU(1), - (MmioRead32(GICR_WAKER_CPU(1)) & ~GIC_WAKER_PROCESSORSLEEP)); + for (int i = 0; i < EarlyInitCoreCnt; i++) + { + // Wake up redistributor for CPU i + MmioWrite32( + GICR_WAKER_CPU(i), + (MmioRead32(GICR_WAKER_CPU(i)) & ~GIC_WAKER_PROCESSORSLEEP)); + } } \ No newline at end of file diff --git a/Silicon/Qualcomm/SM8350Pkg/Library/PlatformPrePiLib/PlatformPrePiLib.inf b/Silicon/Qualcomm/SM8350Pkg/Library/PlatformPrePiLib/PlatformPrePiLib.inf index 14d8c7b25..7ad7042fe 100644 --- a/Silicon/Qualcomm/SM8350Pkg/Library/PlatformPrePiLib/PlatformPrePiLib.inf +++ b/Silicon/Qualcomm/SM8350Pkg/Library/PlatformPrePiLib/PlatformPrePiLib.inf @@ -13,10 +13,12 @@ ArmPkg/ArmPkg.dec MdePkg/MdePkg.dec SiliciumPkg/SiliciumPkg.dec + QcomPkg/QcomPkg.dec [LibraryClasses] PcdLib IoLib + ConfigurationMapHelperLib [FixedPcd] gArmTokenSpaceGuid.PcdGicRedistributorsBase \ No newline at end of file