This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new c55a545b724 arm64: move gicv3_rdist_enable before 
gic_validate_redist_version
c55a545b724 is described below

commit c55a545b724de96c97bf7f7618c0f9d2bcafa462
Author: hujun5 <[email protected]>
AuthorDate: Thu Nov 13 12:37:01 2025 +0800

    arm64: move gicv3_rdist_enable before gic_validate_redist_version
    
    The power-up of the GICR is performed in the gicv3_rdist_enable,
    but the address of the GICR is accessed before that.
    We should not access the GICR address before writing to GICR_PWRR.
    This will trigger errors related to functional safety.
    
    Signed-off-by: hujun5 <[email protected]>
---
 arch/arm64/src/common/arm64_gicv3.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/arch/arm64/src/common/arm64_gicv3.c 
b/arch/arm64/src/common/arm64_gicv3.c
index 86b7e6bcc56..c27aa3b1d01 100644
--- a/arch/arm64/src/common/arm64_gicv3.c
+++ b/arch/arm64/src/common/arm64_gicv3.c
@@ -431,11 +431,6 @@ void arm64_gic_raise_sgi(unsigned int sgi_id, uint16_t 
target_list)
 
 static void gicv3_rdist_enable(unsigned long rdist)
 {
-  if (!(getreg32(rdist + GICR_WAKER) & BIT(GICR_WAKER_CA)))
-    {
-      return;
-    }
-
   /* Power up sequence of the Redistributors for GIC600/GIC700
    * please check GICR_PWRR define at trm of GIC600/GIC700
    */
@@ -1055,6 +1050,8 @@ static void arm64_gic_init(void)
   g_gic_rdists[cpu] = CONFIG_GICR_BASE +
                       up_cpu_index() * CONFIG_GICR_OFFSET;
 
+  gicv3_rdist_enable(gic_get_rdist());
+
   err = gic_validate_redist_version();
   if (err)
     {
@@ -1062,8 +1059,6 @@ static void arm64_gic_init(void)
       return;
     }
 
-  gicv3_rdist_enable(gic_get_rdist());
-
   gicv3_cpuif_init();
 
 #ifdef CONFIG_SMP

Reply via email to