Skip to content

Commit

Permalink
Platform/Arm: Disable memmap platform timers for JunoR0
Browse files Browse the repository at this point in the history
Juno includes a system-level wakeup timer which is an implementation
of the ARM Generic Timer architecture.
The CNTCTL frame contains some registers that are accessible using a
Non-Secure access. Juno R0 incorrectly limits these accesses to Secure
access only. This issue is documented in the Juno Errata
832219: APB port security breaks SBSA compliance
https://developer.arm.com/documentation/epm008857/latest

This results in a crash when the OS tries to access these registers.
Therefore, disable memory mapped platform timers for Juno R0.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Thomas Abraham <thomas.abraham@arm.com>
Cc: Sudeep Holla <Sudeep.Holla@arm.com>

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reported-by: Sudeep Holla <Sudeep.Holla@arm.com>
Tested-by: Sudeep Holla <Sudeep.Holla@arm.com>
Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
  • Loading branch information
samimujawar committed Sep 11, 2023
1 parent bb6841e commit fc22c0e
Showing 1 changed file with 30 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @file
Configuration Manager Dxe
Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.<BR>
Copyright (c) 2017 - 2023, Arm Limited. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
Expand Down Expand Up @@ -1380,26 +1380,38 @@ GetArmNameSpaceObject (
break;

case EArmObjPlatformGTBlockInfo:
Status = HandleCmObject (
CmObjectId,
PlatformRepo->GTBlockInfo,
sizeof (PlatformRepo->GTBlockInfo),
ARRAY_SIZE (PlatformRepo->GTBlockInfo),
CmObject
);
if (PlatformRepo->JunoRevision == JUNO_REVISION_R0) {
// Disable Memory Mapped Platform Timers for Juno R0
// due to Juno Erratum 832219.
Status = EFI_NOT_FOUND;
} else {
Status = HandleCmObject (
CmObjectId,
PlatformRepo->GTBlockInfo,
sizeof (PlatformRepo->GTBlockInfo),
ARRAY_SIZE (PlatformRepo->GTBlockInfo),
CmObject
);
}
break;

case EArmObjGTBlockTimerFrameInfo:
Status = HandleCmObjectRefByToken (
This,
CmObjectId,
PlatformRepo->GTBlock0TimerInfo,
sizeof (PlatformRepo->GTBlock0TimerInfo),
ARRAY_SIZE (PlatformRepo->GTBlock0TimerInfo),
Token,
GetGTBlockTimerFrameInfo,
CmObject
);
if (PlatformRepo->JunoRevision == JUNO_REVISION_R0) {
// Disable Memory Mapped Platform Timers for Juno R0
// due to Juno Erratum 832219.
Status = EFI_NOT_FOUND;
} else {
Status = HandleCmObjectRefByToken (
This,
CmObjectId,
PlatformRepo->GTBlock0TimerInfo,
sizeof (PlatformRepo->GTBlock0TimerInfo),
ARRAY_SIZE (PlatformRepo->GTBlock0TimerInfo),
Token,
GetGTBlockTimerFrameInfo,
CmObject
);
}
break;

case EArmObjGicCInfo:
Expand Down

0 comments on commit fc22c0e

Please sign in to comment.