Laczen commented on code in PR #19794:
URL: https://github.com/apache/nuttx/pull/19794#discussion_r3759203542


##########
arch/Kconfig:
##########
@@ -1562,8 +1532,25 @@ endchoice
 
 menu "Boot Memory Configuration"
 
+config USE_BOOT_MEMORY_CFG
+       bool "Use boot memory configuration when supported"
+       default n
+       ---help---
+               This option allows enforcing the boot memory configuration in
+               linker scripts. Linker scripts can use this option to determine
+               whether they need to apply the boot memory configuration.
+
+config APP_SET_BOOT_MEMORY_CFG
+       bool
+       default n
+       ---help---
+               This option allows an application configuration to specify
+               the boot memory configuration. It is selected by an application
+               that uses it.
+
 config RAM_START
        hex "Primary RAM start address (physical)"
+       default RAM_START_APP_SET if APP_SET_BOOT_MEMORY_CFG

Review Comment:
   Hi @xiaoxiang781216 thanks for taking a look at this so fast.
   
   All `XXX_APP_SET` defines would be set in the application. 



##########
arch/Kconfig:
##########
@@ -1583,6 +1571,7 @@ config RAM_VSTART
 
 config RAM_SIZE
        int "Primary RAM size"
+       default RAM_SIZE_APP_SET if APP_SET_BOOT_MEMORY_CFG

Review Comment:
   When working with a bootloader you want to specify e.g. for what slot the 
image will be generated. This will typically be defined for a slot (that has a 
offset) and might need a header to be added (e.g. for secure validation). The 
config in the app will calculate the final offset and set the value.
   
   I have extended this setup also to ram_start and ram_size, but maybe this is 
not required.



-- 
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