Skip to content

Commit

Permalink
ArmPkg: Update Generic Watchdog PCD Type
Browse files Browse the repository at this point in the history
Do not use the PCDs as only fixed when there is an option
to use them as dynamic that can be set per SKU.

Signed-off-by: Ashish Singhal <[email protected]>
  • Loading branch information
ashishsingha committed Dec 23, 2024
1 parent 4af5849 commit 42d9df6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdog.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
#define GENERIC_WATCHDOG_H_

// Refresh Frame:
#define GENERIC_WDOG_REFRESH_REG ((UINTN)FixedPcdGet64 (PcdGenericWatchdogRefreshBase) + 0x000)
#define GENERIC_WDOG_REFRESH_REG ((UINTN)PcdGet64 (PcdGenericWatchdogRefreshBase) + 0x000)

// Control Frame:
#define GENERIC_WDOG_CONTROL_STATUS_REG ((UINTN)FixedPcdGet64 (PcdGenericWatchdogControlBase) + 0x000)
#define GENERIC_WDOG_OFFSET_REG_LOW ((UINTN)FixedPcdGet64 (PcdGenericWatchdogControlBase) + 0x008)
#define GENERIC_WDOG_OFFSET_REG_HIGH ((UINTN)FixedPcdGet64 (PcdGenericWatchdogControlBase) + 0x00C)
#define GENERIC_WDOG_COMPARE_VALUE_REG_LOW ((UINTN)FixedPcdGet64 (PcdGenericWatchdogControlBase) + 0x010)
#define GENERIC_WDOG_COMPARE_VALUE_REG_HIGH ((UINTN)FixedPcdGet64 (PcdGenericWatchdogControlBase) + 0x014)
#define GENERIC_WDOG_IID_REG ((UINTN)FixedPcdGet64 (PcdGenericWatchdogControlBase) + 0xFCC)
#define GENERIC_WDOG_CONTROL_STATUS_REG ((UINTN)PcdGet64 (PcdGenericWatchdogControlBase) + 0x000)
#define GENERIC_WDOG_OFFSET_REG_LOW ((UINTN)PcdGet64 (PcdGenericWatchdogControlBase) + 0x008)
#define GENERIC_WDOG_OFFSET_REG_HIGH ((UINTN)PcdGet64 (PcdGenericWatchdogControlBase) + 0x00C)
#define GENERIC_WDOG_COMPARE_VALUE_REG_LOW ((UINTN)PcdGet64 (PcdGenericWatchdogControlBase) + 0x010)
#define GENERIC_WDOG_COMPARE_VALUE_REG_HIGH ((UINTN)PcdGet64 (PcdGenericWatchdogControlBase) + 0x014)
#define GENERIC_WDOG_IID_REG ((UINTN)PcdGet64 (PcdGenericWatchdogControlBase) + 0xFCC)

// Values of bit 0 of the Control/Status Register
#define GENERIC_WDOG_ENABLED 1
Expand Down
6 changes: 3 additions & 3 deletions ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ GenericWatchdogEntry (
// Install interrupt handler
Status = mInterruptProtocol->RegisterInterruptSource (
mInterruptProtocol,
FixedPcdGet32 (PcdGenericWatchdogEl2IntrNum),
PcdGet32 (PcdGenericWatchdogEl2IntrNum),
WatchdogInterruptHandler
);
if (EFI_ERROR (Status)) {
Expand All @@ -384,7 +384,7 @@ GenericWatchdogEntry (

Status = mInterruptProtocol->SetTriggerType (
mInterruptProtocol,
FixedPcdGet32 (PcdGenericWatchdogEl2IntrNum),
PcdGet32 (PcdGenericWatchdogEl2IntrNum),
EFI_HARDWARE_INTERRUPT2_TRIGGER_EDGE_RISING
);
if (EFI_ERROR (Status)) {
Expand Down Expand Up @@ -421,7 +421,7 @@ GenericWatchdogEntry (
// Unregister the handler
mInterruptProtocol->RegisterInterruptSource (
mInterruptProtocol,
FixedPcdGet32 (PcdGenericWatchdogEl2IntrNum),
PcdGet32 (PcdGenericWatchdogEl2IntrNum),
NULL
);
return Status;
Expand Down

0 comments on commit 42d9df6

Please sign in to comment.