2013-01-25 12:28:06 +01:00
|
|
|
/** @file
|
|
|
|
|
|
|
|
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
2014-06-03 18:37:29 +02:00
|
|
|
Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.
|
2021-02-08 01:52:42 +01:00
|
|
|
Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
|
2014-08-19 15:29:52 +02:00
|
|
|
|
2019-04-04 01:03:18 +02:00
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
2013-01-25 12:28:06 +01:00
|
|
|
|
|
|
|
**/
|
2020-02-26 13:49:03 +01:00
|
|
|
|
|
|
|
#include <Base.h>
|
|
|
|
|
2013-01-25 12:28:06 +01:00
|
|
|
#include <Library/ArmLib.h>
|
2020-02-26 14:07:32 +01:00
|
|
|
#include <Library/DebugLib.h>
|
2020-02-26 13:49:03 +01:00
|
|
|
|
2024-03-11 16:05:46 +01:00
|
|
|
#include <Arm/AArch32.h>
|
2020-02-26 13:49:03 +01:00
|
|
|
|
2013-01-25 12:28:06 +01:00
|
|
|
#include "ArmV7Lib.h"
|
|
|
|
#include "ArmLibPrivate.h"
|
|
|
|
|
2020-12-18 12:55:52 +01:00
|
|
|
/**
|
|
|
|
Check whether the CPU supports the GIC system register interface (any version)
|
|
|
|
|
|
|
|
@return Whether GIC System Register Interface is supported
|
|
|
|
|
|
|
|
**/
|
|
|
|
BOOLEAN
|
|
|
|
EFIAPI
|
|
|
|
ArmHasGicSystemRegisters (
|
|
|
|
VOID
|
|
|
|
)
|
|
|
|
{
|
|
|
|
return ((ArmReadIdPfr1 () & ARM_PFR1_GIC) != 0);
|
|
|
|
}
|
2020-12-18 14:21:08 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
Check whether the CPU supports the Security extensions
|
|
|
|
|
|
|
|
@return Whether the Security extensions are implemented
|
|
|
|
|
|
|
|
**/
|
|
|
|
BOOLEAN
|
|
|
|
EFIAPI
|
|
|
|
ArmHasSecurityExtensions (
|
|
|
|
VOID
|
|
|
|
)
|
|
|
|
{
|
|
|
|
return ((ArmReadIdPfr1 () & ARM_PFR1_SEC) != 0);
|
|
|
|
}
|
2021-02-08 01:52:42 +01:00
|
|
|
|
|
|
|
/** Checks if CCIDX is implemented.
|
|
|
|
|
|
|
|
@retval TRUE CCIDX is implemented.
|
|
|
|
@retval FALSE CCIDX is not implemented.
|
|
|
|
**/
|
|
|
|
BOOLEAN
|
|
|
|
EFIAPI
|
|
|
|
ArmHasCcidx (
|
|
|
|
VOID
|
|
|
|
)
|
|
|
|
{
|
|
|
|
UINTN Mmfr4;
|
|
|
|
|
|
|
|
Mmfr4 = ArmReadIdMmfr4 ();
|
|
|
|
return (((Mmfr4 >> 24) & 0xF) == 1) ? TRUE : FALSE;
|
|
|
|
}
|