summaryrefslogtreecommitdiff
path: root/ArmPkg
diff options
context:
space:
mode:
authorOlivier Martin <olivier.martin@arm.com>2014-03-01 11:00:07 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2014-03-01 11:00:07 +0000
commitf6c5a29bb9041caf66426ddced7454f9051124eb (patch)
tree6ef4f5253d217f182209668cab63bcc22b80858b /ArmPkg
parent992a1f830d94d87d98c1e2066f46f00200bdfd4c (diff)
downloadedk2-platforms-f6c5a29bb9041caf66426ddced7454f9051124eb.tar.xz
ArmPkg/ArmLib: Rationalise ArmReadMidr and cognate functions.
The function ArmReadMidr has been recently added, but that functionality was already present under other names such as Cp15IdCode and ArmMainIdCode. This change removes redundant code and moves the function to the Common library. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15276 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPkg')
-rw-r--r--ArmPkg/Include/Library/ArmLib.h6
-rw-r--r--ArmPkg/Library/ArmLib/AArch64/AArch64Support.S4
-rw-r--r--ArmPkg/Library/ArmLib/Arm11/Arm11Support.S5
-rw-r--r--ArmPkg/Library/ArmLib/ArmV7/ArmV7Support.S7
-rw-r--r--ArmPkg/Library/ArmLib/ArmV7/ArmV7Support.asm5
-rw-r--r--ArmPkg/Library/ArmLib/Common/AArch64/ArmLibSupport.S4
-rw-r--r--ArmPkg/Library/ArmLib/Common/Arm/ArmLibSupport.S6
-rw-r--r--ArmPkg/Library/ArmLib/Common/Arm/ArmLibSupport.asm6
8 files changed, 9 insertions, 34 deletions
diff --git a/ArmPkg/Include/Library/ArmLib.h b/ArmPkg/Include/Library/ArmLib.h
index 9694b9d06d..82f0c4b39c 100644
--- a/ArmPkg/Include/Library/ArmLib.h
+++ b/ArmPkg/Include/Library/ArmLib.h
@@ -214,12 +214,6 @@ ArmReadIdPfr1 (
UINT32
EFIAPI
-Cp15IdCode (
- VOID
- );
-
-UINT32
-EFIAPI
Cp15CacheInfo (
VOID
);
diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S b/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S
index 211457bd75..8cf4f69f5b 100644
--- a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S
+++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S
@@ -51,7 +51,6 @@ GCC_ASM_EXPORT (ArmEnableVFP)
GCC_ASM_EXPORT (ArmCallWFI)
GCC_ASM_EXPORT (ArmInvalidateInstructionAndDataTlb)
GCC_ASM_EXPORT (ArmReadMpidr)
-GCC_ASM_EXPORT (ArmReadMidr)
GCC_ASM_EXPORT (ArmReadTpidrurw)
GCC_ASM_EXPORT (ArmWriteTpidrurw)
GCC_ASM_EXPORT (ArmIsArchTimerImplemented)
@@ -469,9 +468,6 @@ ASM_PFX(ArmReadMpidr):
mrs x0, mpidr_el1 // read EL1 MPIDR
ret
-ASM_PFX(ArmReadMidr):
- mrs x0, midr_el1 // Read Main ID Register
- ret
// Keep old function names for C compatibilty for now. Change later?
ASM_PFX(ArmReadTpidrurw):
diff --git a/ArmPkg/Library/ArmLib/Arm11/Arm11Support.S b/ArmPkg/Library/ArmLib/Arm11/Arm11Support.S
index e18023e6ae..2f4be7e93f 100644
--- a/ArmPkg/Library/ArmLib/Arm11/Arm11Support.S
+++ b/ArmPkg/Library/ArmLib/Arm11/Arm11Support.S
@@ -43,7 +43,6 @@ GCC_ASM_EXPORT(ArmSetHighVectors)
GCC_ASM_EXPORT(ArmIsMpCore)
GCC_ASM_EXPORT(ArmCallWFI)
GCC_ASM_EXPORT(ArmReadMpidr)
-GCC_ASM_EXPORT(ArmReadMidr)
GCC_ASM_EXPORT(ArmUpdateTranslationTableEntry)
GCC_ASM_EXPORT(ArmEnableFiq)
GCC_ASM_EXPORT(ArmDisableFiq)
@@ -217,10 +216,6 @@ ASM_PFX(ArmReadMpidr):
mrc p15, 0, r0, c0, c0, 5 @ read MPIDR
bx lr
-ASM_PFX(ArmReadMpidr):
- mrc p15, 0, r0, c0, c0, 0 @ Read Main ID Register
- bx lr
-
ASM_PFX(ArmEnableFiq):
mrs R0,CPSR
bic R0,R0,#0x40 @Enable FIQ interrupts
diff --git a/ArmPkg/Library/ArmLib/ArmV7/ArmV7Support.S b/ArmPkg/Library/ArmLib/ArmV7/ArmV7Support.S
index d402118ce2..954762717c 100644
--- a/ArmPkg/Library/ArmLib/ArmV7/ArmV7Support.S
+++ b/ArmPkg/Library/ArmLib/ArmV7/ArmV7Support.S
@@ -49,7 +49,6 @@ GCC_ASM_EXPORT (ArmCallWFI)
GCC_ASM_EXPORT (ArmReadCbar)
GCC_ASM_EXPORT (ArmInvalidateInstructionAndDataTlb)
GCC_ASM_EXPORT (ArmReadMpidr)
-GCC_ASM_EXPORT (ArmReadMidr)
GCC_ASM_EXPORT (ArmReadTpidrurw)
GCC_ASM_EXPORT (ArmWriteTpidrurw)
GCC_ASM_EXPORT (ArmIsArchTimerImplemented)
@@ -377,11 +376,7 @@ ASM_PFX(ArmInvalidateInstructionAndDataTlb):
ASM_PFX(ArmReadMpidr):
mrc p15, 0, r0, c0, c0, 5 @ read MPIDR
bx lr
-
-ASM_PFX(ArmReadMidr):
- mrc p15, 0, r0, c0, c0, 0 @ Read Main ID Register
- bx lr
-
+
ASM_PFX(ArmReadTpidrurw):
mrc p15, 0, r0, c13, c0, 2 @ read TPIDRURW
bx lr
diff --git a/ArmPkg/Library/ArmLib/ArmV7/ArmV7Support.asm b/ArmPkg/Library/ArmLib/ArmV7/ArmV7Support.asm
index 8eee50dcfd..4808c7ba74 100644
--- a/ArmPkg/Library/ArmLib/ArmV7/ArmV7Support.asm
+++ b/ArmPkg/Library/ArmLib/ArmV7/ArmV7Support.asm
@@ -46,7 +46,6 @@
EXPORT ArmReadCbar
EXPORT ArmInvalidateInstructionAndDataTlb
EXPORT ArmReadMpidr
- EXPORT ArmReadMidr
EXPORT ArmReadTpidrurw
EXPORT ArmWriteTpidrurw
EXPORT ArmIsArchTimerImplemented
@@ -372,10 +371,6 @@ ArmReadMpidr
mrc p15, 0, r0, c0, c0, 5 ; read MPIDR
bx lr
-ArmReadMidr
- mrc p15, 0, r0, c0, c0, 0 ; Read Main ID Register
- bx lr
-
ArmReadTpidrurw
mrc p15, 0, r0, c13, c0, 2 ; read TPIDRURW
bx lr
diff --git a/ArmPkg/Library/ArmLib/Common/AArch64/ArmLibSupport.S b/ArmPkg/Library/ArmLib/Common/AArch64/ArmLibSupport.S
index 5dd3fca5e9..f7cc557245 100644
--- a/ArmPkg/Library/ArmLib/Common/AArch64/ArmLibSupport.S
+++ b/ArmPkg/Library/ArmLib/Common/AArch64/ArmLibSupport.S
@@ -17,7 +17,7 @@
.text
.align 3
-GCC_ASM_EXPORT (ArmMainIdCode)
+GCC_ASM_EXPORT (ArmReadMidr)
GCC_ASM_EXPORT (ArmCacheInfo)
GCC_ASM_EXPORT (ArmGetInterruptState)
GCC_ASM_EXPORT (ArmGetFiqState)
@@ -43,7 +43,7 @@ GCC_ASM_EXPORT (ArmCallSEV)
.set DAIF_FIQ_BIT, (1 << 0)
.set DAIF_IRQ_BIT, (1 << 1)
-ASM_PFX(ArmiMainIdCode):
+ASM_PFX(ArmReadMidr):
mrs x0, midr_el1 // Read from Main ID Register (MIDR)
ret
diff --git a/ArmPkg/Library/ArmLib/Common/Arm/ArmLibSupport.S b/ArmPkg/Library/ArmLib/Common/Arm/ArmLibSupport.S
index 4c95565e8f..57b205a7a8 100644
--- a/ArmPkg/Library/ArmLib/Common/Arm/ArmLibSupport.S
+++ b/ArmPkg/Library/ArmLib/Common/Arm/ArmLibSupport.S
@@ -1,7 +1,7 @@
#------------------------------------------------------------------------------
#
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-# Copyright (c) 2011-2013, ARM Limited. All rights reserved.
+# Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -23,7 +23,7 @@
.text
.align 2
-GCC_ASM_EXPORT(Cp15IdCode)
+GCC_ASM_EXPORT(ArmReadMidr)
GCC_ASM_EXPORT(Cp15CacheInfo)
GCC_ASM_EXPORT(ArmGetInterruptState)
GCC_ASM_EXPORT(ArmGetFiqState)
@@ -50,7 +50,7 @@ GCC_ASM_EXPORT(ArmReadSctlr)
#------------------------------------------------------------------------------
-ASM_PFX(Cp15IdCode):
+ASM_PFX(ArmReadMidr):
mrc p15,0,R0,c0,c0,0
bx LR
diff --git a/ArmPkg/Library/ArmLib/Common/Arm/ArmLibSupport.asm b/ArmPkg/Library/ArmLib/Common/Arm/ArmLibSupport.asm
index f4b22943ff..a464e4d86c 100644
--- a/ArmPkg/Library/ArmLib/Common/Arm/ArmLibSupport.asm
+++ b/ArmPkg/Library/ArmLib/Common/Arm/ArmLibSupport.asm
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
//
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-// Copyright (c) 2011-2013, ARM Limited. All rights reserved.
+// Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
@@ -23,7 +23,7 @@
#define dsb
#endif
- EXPORT Cp15IdCode
+ EXPORT ArmReadMidr
EXPORT Cp15CacheInfo
EXPORT ArmGetInterruptState
EXPORT ArmGetFiqState
@@ -50,7 +50,7 @@
AREA ArmLibSupport, CODE, READONLY
-Cp15IdCode
+ArmReadMidr
mrc p15,0,R0,c0,c0,0
bx LR