Skip to content

Commit

Permalink
Update PlatformPrePiLib
Browse files Browse the repository at this point in the history
  • Loading branch information
N1kroks committed Jun 22, 2024
1 parent 6e7faac commit 99b5c2a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
#include <Library/IoLib.h>
#include <Library/PlatformPrePiLib.h>
#include <Library/PcdLib.h>
#include <Library/ConfigurationMapHelperLib.h>

#include "PlatformRegisters.h"

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));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
ArmPkg/ArmPkg.dec
MdePkg/MdePkg.dec
SiliciumPkg/SiliciumPkg.dec
QcomPkg/QcomPkg.dec

[LibraryClasses]
PcdLib
IoLib
ConfigurationMapHelperLib

[FixedPcd]
gArmTokenSpaceGuid.PcdGicRedistributorsBase
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
#include <Library/IoLib.h>
#include <Library/PlatformPrePiLib.h>
#include <Library/PcdLib.h>
#include <Library/ConfigurationMapHelperLib.h>

#include "PlatformRegisters.h"

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));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
ArmPkg/ArmPkg.dec
MdePkg/MdePkg.dec
SiliciumPkg/SiliciumPkg.dec
QcomPkg/QcomPkg.dec

[LibraryClasses]
PcdLib
IoLib
ConfigurationMapHelperLib

[FixedPcd]
gArmTokenSpaceGuid.PcdGicRedistributorsBase

0 comments on commit 99b5c2a

Please sign in to comment.