xiaoxiang781216 commented on code in PR #12353:
URL: https://github.com/apache/nuttx/pull/12353#discussion_r1605798562


##########
arch/arm64/src/common/arm64_boot.c:
##########
@@ -78,7 +78,7 @@ void arm64_boot_el3_init(void)
   reg = 0U;               /* Reset */
   reg |= SCR_NS_BIT;      /* EL2 / EL3 non-secure */
   reg |= (SCR_RES1 |      /* RES1 */
-  #ifdef CONFIG_ARCH_BOOT_EL3
+#if (CONFIG_ARCH_ARM64_EXCEPTION_LEVEL == 3)

Review Comment:
   remove ALL ()



##########
arch/arm64/src/common/arm64_mmu.c:
##########
@@ -523,6 +523,40 @@ static void setup_page_tables(void)
     }
 }
 
+#ifdef CONFIG_ARCH_BOOT_EL3
+static void enable_mmu_el3(unsigned int flags)
+{
+  uint64_t value;
+  UNUSED(flags);
+
+  /* Set MAIR, TCR and TBBR registers */
+
+  write_sysreg(MEMORY_ATTRIBUTES, mair_el3);
+  write_sysreg(get_tcr(3), tcr_el3);
+  write_sysreg(((uint64_t)base_xlat_table), ttbr0_el3);

Review Comment:
   remove () around base_xlat_table



##########
arch/arm64/Kconfig:
##########
@@ -146,14 +146,13 @@ config ARCH_HAVE_EL3
                runing at EL3 is not necessary and system register for EL3
                is not accessible
 
-config ARCH_BOOT_EL3
-       bool "Boot in EL3"
-       default n
-       depends on ARCH_HAVE_EL3
+config ARCH_ARM64_EXCEPTION_LEVEL
+       int "Exception level to operate"
+       default 1

Review Comment:
   let's add range?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to