public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Marcin Juszkiewicz" <marcin.juszkiewicz@linaro.org>
To: devel@edk2.groups.io
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Leif Lindholm <quic_llindhol@quicinc.com>,
	Rebecca Cran <rebecca@bsdio.com>,
	Pedro Falcato <pedro.falcato@gmail.com>,
	Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Subject: [PATCH v7 1/2] ArmLib: add functions to read system registers
Date: Fri, 21 Apr 2023 17:51:15 +0200	[thread overview]
Message-ID: <20230421155116.105822-1-marcin.juszkiewicz@linaro.org> (raw)
In-Reply-To: <391daf63-b07a-2bff-ad73-7fca2461d1c2@bsdio.com>

ArmCpuInfo uses those to read system registers and other parts of EDK2
may find them useful.

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
---
 ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h    | 50 +++++++++++++++-
 .../Library/ArmLib/AArch64/AArch64Support.S   | 58 ++++++++++++++++---
 2 files changed, 99 insertions(+), 9 deletions(-)

diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h b/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h
index 330481fc50db..6380a019ddc5 100644
--- a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h
+++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h
@@ -40,7 +40,43 @@ ArmCleanInvalidateDataCacheEntryBySetWay (
 
 UINTN
 EFIAPI
-ArmReadIdAA64Pfr0 (
+ArmReadIdAA64Dfr0 (
+  VOID
+  );
+
+UINTN
+EFIAPI
+ArmReadIdAA64Dfr1 (
+  VOID
+  );
+
+UINTN
+EFIAPI
+ArmReadIdAA64Isar0 (
+  VOID
+  );
+
+UINTN
+EFIAPI
+ArmReadIdAA64Isar1 (
+  VOID
+  );
+
+UINTN
+EFIAPI
+ArmReadIdAA64Isar2 (
+  VOID
+  );
+
+UINTN
+EFIAPI
+ArmReadIdAA64Mmfr0 (
+  VOID
+  );
+
+UINTN
+EFIAPI
+ArmReadIdAA64Mmfr1 (
   VOID
   );
 
@@ -54,4 +90,16 @@ ArmReadIdAA64Mmfr2 (
   VOID
   );
 
+UINTN
+EFIAPI
+ArmReadIdAA64Pfr0 (
+  VOID
+  );
+
+UINTN
+EFIAPI
+ArmReadIdAA64Pfr1 (
+  VOID
+  );
+
 #endif // AARCH64_LIB_H_
diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S b/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S
index d3cc1e86716b..a7111e51882c 100644
--- a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S
+++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S
@@ -425,10 +425,6 @@ ASM_FUNC(ArmCallWFI)
   wfi
   ret
 
-ASM_FUNC(ArmReadIdAA64Mmfr2)
-  mrs   x0, ID_AA64MMFR2_EL1           // read EL1 MMFR2
-  ret
-
 ASM_FUNC(ArmReadMpidr)
   mrs   x0, mpidr_el1           // read EL1 MPIDR
   ret
@@ -452,10 +448,6 @@ ASM_FUNC(ArmIsArchTimerImplemented)
   ret
 
 
-ASM_FUNC(ArmReadIdAA64Pfr0)
-  mrs   x0, id_aa64pfr0_el1   // Read ID_AA64PFR0 Register
-  ret
-
 
 // VOID ArmWriteHcr(UINTN Hcr)
 ASM_FUNC(ArmWriteHcr)
@@ -482,4 +474,54 @@ ASM_FUNC(ArmWriteCntHctl)
   msr   cnthctl_el2, x0
   ret
 
+
+ASM_FUNC(ArmReadIdAA64Dfr0)
+  mrs   x0, ID_AA64DFR0_EL1
+  ret
+
+
+ASM_FUNC(ArmReadIdAA64Dfr1)
+  mrs   x0, ID_AA64DFR1_EL1
+  ret
+
+
+ASM_FUNC(ArmReadIdAA64Isar0)
+  mrs   x0, ID_AA64ISAR0_EL1
+  ret
+
+
+ASM_FUNC(ArmReadIdAA64Isar1)
+  mrs   x0, ID_AA64ISAR1_EL1
+  ret
+
+
+ASM_FUNC(ArmReadIdAA64Isar2)
+  mrs   x0, ID_AA64ISAR2_EL1
+  ret
+
+
+ASM_FUNC(ArmReadIdAA64Mmfr0)
+  mrs   x0, ID_AA64MMFR0_EL1
+  ret
+
+
+ASM_FUNC(ArmReadIdAA64Mmfr1)
+  mrs   x0, ID_AA64MMFR1_EL1
+  ret
+
+
+ASM_FUNC(ArmReadIdAA64Mmfr2)
+  mrs   x0, ID_AA64MMFR2_EL1
+  ret
+
+
+ASM_FUNC(ArmReadIdAA64Pfr0)
+  mrs   x0, ID_AA64PFR0_EL1
+  ret
+
+
+ASM_FUNC(ArmReadIdAA64Pfr1)
+  mrs   x0, ID_AA64PFR1_EL1
+  ret
+
 ASM_FUNCTION_REMOVE_IF_UNREFERENCED
-- 
2.40.0


  reply	other threads:[~2023-04-21 15:51 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-31 18:02 [PATCH] add ArmCpuInfo EFI application Marcin Juszkiewicz
2023-04-06 21:05 ` [edk2-devel] " Rebecca Cran
2023-04-07 10:39   ` [PATCH v2] " Marcin Juszkiewicz
2023-04-07 10:55     ` [edk2-devel] " Ard Biesheuvel
2023-04-07 12:46       ` Marcin Juszkiewicz
2023-04-07 13:07         ` Ard Biesheuvel
2023-04-07 12:47       ` [PATCH v3] " Marcin Juszkiewicz
2023-04-07 13:02         ` [edk2-devel] " Pedro Falcato
2023-04-07 13:05           ` Pedro Falcato
2023-04-07 13:29           ` Marcin Juszkiewicz
2023-04-07 13:40             ` Pedro Falcato
2023-04-07 13:41               ` Pedro Falcato
2023-04-07 13:42               ` Marcin Juszkiewicz
2023-04-07 14:02           ` [PATCH v4] " Marcin Juszkiewicz
     [not found]           ` <1753ABF1A296B040.11304@groups.io>
2023-04-07 15:11             ` [edk2-devel] " Marcin Juszkiewicz
2023-04-07 15:29             ` [PATCH v5 0/2] add ArmCpuInfo application Marcin Juszkiewicz
2023-04-07 15:29               ` [PATCH v5 1/2] ArmLib: add functions to read system registers Marcin Juszkiewicz
2023-04-20 10:54                 ` Leif Lindholm
2023-04-07 15:29               ` [PATCH v5 2/2] add ArmCpuInfo EFI application Marcin Juszkiewicz
2023-04-20 12:43                 ` Leif Lindholm
2023-04-20 14:42                   ` [edk2-devel] " Marcin Juszkiewicz
2023-04-20 14:44                   ` [PATCH v6 1/2] ArmLib: add functions to read system registers Marcin Juszkiewicz
2023-04-20 14:44                     ` [PATCH v6 2/2] add ArmCpuInfo EFI application Marcin Juszkiewicz
2023-04-20 17:29                       ` Leif Lindholm
2023-04-21 14:37                         ` [edk2-devel] " Rebecca Cran
2023-04-21 14:59                           ` Marcin Juszkiewicz
2023-04-21 15:15                             ` Rebecca Cran
2023-04-21 15:51                               ` Marcin Juszkiewicz [this message]
2023-04-21 15:51                                 ` [PATCH v7 " Marcin Juszkiewicz
2023-04-21 20:18                                   ` Leif Lindholm
2023-04-21 16:33                           ` [edk2-devel] [PATCH v6 " Leif Lindholm
2023-04-13  9:31               ` [PATCH v5 0/2] add ArmCpuInfo application Marcin Juszkiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230421155116.105822-1-marcin.juszkiewicz@linaro.org \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox