You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/01/20 11:09:44 UTC

[GitHub] [incubator-nuttx] jlaitine opened a new pull request #5289: Mpfs bootloader entrypoints

jlaitine opened a new pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289


   ## Summary
   
   This PR removes the hard-coded entry addresses from the mpfs startup logic, replacing them with CONFIG_ macros
   There is also a fix for stack alignment for stacks used by opensbi
   
   ## Impact
   
   Allow to configure & create nuttx-based bootloader application for MPFS, which can boot different code on different harts (other nuttx instances, linux instances etc)
   
   ## Testing
   
   Tested on MPFS Icicle board, booting another instance of NuttX(PX4) and Linux on the same SoC.
   


-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289#discussion_r788781383



##########
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);

Review comment:
       ```suggestion
   ```
   Seems to be unused




-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289#discussion_r789589468



##########
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
+	---help---
+		The default address of the entry point for HART0
+
+config MPFS_HART1_ENTRYPOINT
+	hex "Application entry point for HART1"
+	depends on MPFS_BOOTLOADER
+	default 0xffffffffffffffff
+	---help---
+		The default address of the entry point for HART1
+
+config MPFS_HART2_ENTRYPOINT
+	hex "Application entry point for HART2"
+	depends on MPFS_BOOTLOADER
+	default 0xAFB00000

Review comment:
       0xafb00000




-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289#discussion_r789519130



##########
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);

Review comment:
       thanks!




-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289#discussion_r788733201



##########
File path: arch/risc-v/src/mpfs/mpfs_head.S
##########
@@ -161,13 +173,17 @@ __start:
   csrw mie, zero
   csrw mip, zero
 
-#ifdef CONFIG_MPFS_OPENSBI
-  jal mpfs_opensbi_prepare_hart
-#else
-  /* Jump to app (TODO: remove fixed address) */
-  li a1, 0x80000000
-  jr a1
-#endif
+  /* Offset to g_entrypoints vector, acc. to hart id */
+  li t1,8
+  mul t1, a0, t1
+
+  /* Load the entrypoint address */
+  la t0, g_entrypoints
+  add t0,t0,t1
+  ld t0,0(t0)

Review comment:
       ```suggestion
     add t0, t0, t1
     ld t0, 0(t0)
   ```




-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289


   


-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289#discussion_r789588325



##########
File path: arch/risc-v/src/mpfs/mpfs_opensbi.c
##########
@@ -184,7 +184,7 @@ static sbi_scratch_holder_t g_scratches[MPFS_MAX_NUM_HARTS] \
 
 uint8_t g_hart_stacks[SBI_PLATFORM_DEFAULT_HART_STACK_SIZE * \
                       MPFS_HART_COUNT] \
-                      __attribute__((section(".ddrstorage")));
+                      __attribute__((section(".ddrstorage"), aligned(16)));

Review comment:
       should we use aligned_data and locate_data




-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
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_RV32
   	default 0xffffffffffffffff if ARCH_RV64
   ```




-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289#discussion_r788732715



##########
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:
       Could you please use lower case? I see that upper case is used only in one file https://github.com/apache/incubator-nuttx/blob/master/boards/arm/cxd56xx/spresense/Kconfig and other use lower case. I will make a PR to change spresense/Kconfig to lower case




-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] jlaitine commented on a change in pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
jlaitine commented on a change in pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289#discussion_r789507291



##########
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:
       mpfs don't have ARCH_RV32




-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] jlaitine commented on a change in pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
jlaitine commented on a change in pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289#discussion_r789509120



##########
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:
       why? I know that this is uint64_t on the mpfs platform. also, other places are not really subject to this PR




-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] jlaitine commented on a change in pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
jlaitine commented on a change in pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289#discussion_r789507833



##########
File path: arch/risc-v/src/mpfs/mpfs_head.S
##########
@@ -161,13 +173,17 @@ __start:
   csrw mie, zero
   csrw mip, zero
 
-#ifdef CONFIG_MPFS_OPENSBI
-  jal mpfs_opensbi_prepare_hart
-#else
-  /* Jump to app (TODO: remove fixed address) */
-  li a1, 0x80000000
-  jr a1
-#endif
+  /* Offset to g_entrypoints vector, acc. to hart id */
+  li t1,8
+  mul t1, a0, t1
+
+  /* Load the entrypoint address */
+  la t0, g_entrypoints
+  add t0,t0,t1
+  ld t0,0(t0)

Review comment:
       ok




-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289#discussion_r789597452



##########
File path: arch/risc-v/src/mpfs/mpfs_opensbi.c
##########
@@ -186,6 +184,15 @@ uint8_t g_hart_stacks[SBI_PLATFORM_DEFAULT_HART_STACK_SIZE * \
                       MPFS_HART_COUNT] \
                       __attribute__((section(".ddrstorage"), aligned(16)));
 
+uint64_t g_sbi_entrypoints[] =

Review comment:
       add static const?




-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289#discussion_r789597452



##########
File path: arch/risc-v/src/mpfs/mpfs_opensbi.c
##########
@@ -186,6 +184,15 @@ uint8_t g_hart_stacks[SBI_PLATFORM_DEFAULT_HART_STACK_SIZE * \
                       MPFS_HART_COUNT] \
                       __attribute__((section(".ddrstorage"), aligned(16)));
 
+uint64_t g_sbi_entrypoints[] =

Review comment:
       add static const? and move https://github.com/apache/incubator-nuttx/pull/5289/commits/26c6a1ec4126f87854fbcfda78e351149cf039ce#diff-2492761a114edeb6357a1082365a9c03a32677b51265019596b1520dfc6742e0R164-R174 to public data section




-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289#discussion_r789597887



##########
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(void);
+
+/* Default boot address for every hart */
+
+uint64_t g_entrypoints[5] =

Review comment:
       add const




-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289#discussion_r788787597



##########
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;
   
   uintptr_t g_entrypoints[5] =
   {
   #ifdef CONFIG_MPFS_HART0_SBI
     (uintptr_t)&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: commits-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289#discussion_r788735147



##########
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:
       ```suggestion
   uintptr_t g_entrypoints[5] =
   ```
   here and in other places?




-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] jlaitine commented on a change in pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
jlaitine commented on a change in pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289#discussion_r789507291



##########
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:
       mpfs don't have ARCH_RV32. Will change to lowercase




-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
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: commits-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289#discussion_r788732453



##########
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:
       Could you please use lower case? I see that upper case is used only in one file https://github.com/apache/incubator-nuttx/blob/master/boards/arm/cxd56xx/spresense/Kconfig and other use lower case. I will make a PR to change `spresense/Kconfig` to  lower case




-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289#discussion_r788779517



##########
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();

Review comment:
       ```suggestion
   extern void mpfs_opensbi_prepare_hart(void);
   ```




-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289#discussion_r789520606



##########
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:
       Ok. Since there is not 32bit variant we can keep `uint64_t`, but `uintptr_t` makes it easy to copy in case if similar case is needed for other variants.




-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289#discussion_r788787597



##########
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;
   
   uintptr_t g_entrypoints[5] =
   {
   #ifdef CONFIG_MPFS_HART0_SBI
     (uintptr_t)&mpfs_opensbi_prepare_hart,
   #else
     (uintptr_t)CONFIG_MPFS_HART0_ENTRYPOINT,
   #endif
   ...
   }
   ```
   but `extern void mpfs_opensbi_prepare_hart(void);` should also work




-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289#discussion_r789518620



##########
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:
       Ok..




-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] jlaitine commented on a change in pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
jlaitine commented on a change in pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289#discussion_r789508283



##########
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);

Review comment:
       sure, though not related to this PR, I didn't add that

##########
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();

Review comment:
       ok
   




-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5289: Mpfs bootloader entrypoints

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5289:
URL: https://github.com/apache/incubator-nuttx/pull/5289#discussion_r788787597



##########
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;
   
   uintptr_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: commits-unsubscribe@nuttx.apache.org

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