pkarashchenko commented on a change in pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289#discussion_r788785088



##########
File path: arch/risc-v/src/mpfs/Kconfig
##########
@@ -58,6 +58,66 @@ config MPFS_OPENSBI
         ---help---
                 This uses a ld-envm-opensbi.script linker script and the 
mpfs_opensbi.c code to use external OpenSBI.
 
+config MPFS_HART0_SBI
+       bool "HART0 boots via SBI"
+       depends on MPFS_OPENSBI
+       default n
+
+config MPFS_HART1_SBI
+       bool "HART1 boots via SBI"
+       depends on MPFS_OPENSBI
+       default n
+
+config MPFS_HART2_SBI
+       bool "HART2 boots via SBI"
+       depends on MPFS_OPENSBI
+       default n
+
+config MPFS_HART3_SBI
+       bool "HART3 boots via SBI"
+       depends on MPFS_OPENSBI
+       default n
+
+config MPFS_HART4_SBI
+       bool "HART4 boots via SBI"
+       depends on MPFS_OPENSBI
+       default n
+
+config MPFS_HART0_ENTRYPOINT
+       hex "Application entry point for HART0"
+       depends on MPFS_BOOTLOADER
+       default 0xFFFFFFFFFFFFFFFF

Review comment:
       ```suggestion
        default 0xffffffff if ARCH_RV64
        default 0xffffffffffffffff if ARCH_RV64
   ```

##########
File path: arch/risc-v/src/mpfs/mpfs_start.c
##########
@@ -65,6 +65,47 @@ volatile bool g_serial_ok = false;
 
 extern void mpfs_cpu_boot(uint32_t);
 
+#ifdef CONFIG_MPFS_BOOTLOADER
+
+extern void mpfs_opensbi_prepare_hart();
+
+/* Default boot address for every hart */
+
+uint64_t g_entrypoints[5] =

Review comment:
       probably can simply do
   
   ```
   extern uintptr_t mpfs_opensbi_prepare_hart;
   
   uint64_t *g_entrypoints[5] =
   {
   #ifdef CONFIG_MPFS_HART0_SBI
     &mpfs_opensbi_prepare_hart,
   #else
     (uintptr_t *)CONFIG_MPFS_HART0_ENTRYPOINT,
   #endif
   ...
   }
   
   ```




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to