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 2021/12/04 15:12:35 UTC

[GitHub] [incubator-nuttx] nandojve opened a new pull request #4939: boards/arm/samv7: Introduce common folder

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


   ## Summary
   
   Add common folder to share common code between samv7 boards avoiding both duplicate and copy and paste practices.
   This is a sequence with:
   
   - Define internal memories sizes by SoC version to allow unify linker scripts using a template model.
   - Move all scripts and tools to common folder.It adapts current boards to use the common infrastructure and linker script template.
   - Move all MCUboot related code to common folder and drop all duplicated code and defines.
   - Demonstrate how simple is add MCUboot support to samv71-xult board.
   
   ## Impact
   
   None
   
   ## Testing
   
   - PassCI
   - samv7-xult


-- 
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] nandojve removed a comment on pull request #4939: boards/arm/samv7: Introduce common folder

Posted by GitBox <gi...@apache.org>.
nandojve removed a comment on pull request #4939:
URL: https://github.com/apache/incubator-nuttx/pull/4939#issuecomment-986139617


   Hi @pkarashchenko ,
   
   Thank you for your comments.
   
   I was thinking more about how integrade bootloaders into NuttX. Besides this PR helps to unify samv7 it still lacks for all NuttX platforms. If makes sense, I would like split this PR and keep only first 2 commits. The next step will be create a RFC to define all those variables that are required to allow an agnostic bootloader. I mean, there is no sense an App outside NuttX define things that are HW dependent. I think it should be the contrary. This way it will be possible that any external app pick configs from NuttX and configure itself which allows an agnostic bootloader.
   
   If above makes sense I prefer split PR.
   
   What do you think?


-- 
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] nandojve commented on pull request #4939: boards/arm/samv7: Introduce common folder

Posted by GitBox <gi...@apache.org>.
nandojve commented on pull request #4939:
URL: https://github.com/apache/incubator-nuttx/pull/4939#issuecomment-986139617


   Hi @pkarashchenko ,
   
   Thank you for your comments.
   
   I was thinking more about how integrade bootloaders into NuttX. Besides this PR helps to unify samv7 it still lacks for all NuttX platforms. If makes sense, I would like split this PR and keep only first 2 commits. The next step will be create a RFC to define all those variables that are required to allow an agnostic bootloader. I mean, there is no sense an App outside NuttX define things that are HW dependent. I think it should be the contrary. This way it will be possible that any external app pick configs from NuttX and configure itself which allows an agnostic bootloader.
   
   If above makes sense I prefer split PR.
   
   What do you think?


-- 
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 #4939: boards/arm/samv7: Introduce common folder

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



##########
File path: boards/arm/samv7/common/Kconfig
##########
@@ -0,0 +1,73 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+config BOARD_SAMV7_COMMON
+       bool "Board common logic"
+       default y
+       ---help---
+               Board common logic located in each board/common folder.
+
+if BOARD_SAMV7_COMMON
+
+config SAMV7_PROGMEM_MCUBOOT_PARTITION
+	bool
+	default n
+	select MTD
+	select MTD_BYTE_WRITE
+	select MTD_PARTITION
+	select MTD_PROGMEM
+	select MTD_PROGMEM_ERASESTATE
+
+menuconfig SAMV7_FORMAT_MCUBOOT
+	bool "MCUboot-bootable format"
+	default n
+	select ARCH_RAMFUNCS
+	select BOARDCTL_RESET
+	select BOOT_MCUBOOT

Review comment:
       This is `app` option. We should remove it from here.

##########
File path: boards/arm/samv7/common/Kconfig
##########
@@ -0,0 +1,73 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+config BOARD_SAMV7_COMMON
+       bool "Board common logic"
+       default y
+       ---help---
+               Board common logic located in each board/common folder.
+
+if BOARD_SAMV7_COMMON
+
+config SAMV7_PROGMEM_MCUBOOT_PARTITION
+	bool
+	default n
+	select MTD
+	select MTD_BYTE_WRITE
+	select MTD_PARTITION
+	select MTD_PROGMEM
+	select MTD_PROGMEM_ERASESTATE
+
+menuconfig SAMV7_FORMAT_MCUBOOT
+	bool "MCUboot-bootable format"
+	default n
+	select ARCH_RAMFUNCS
+	select BOARDCTL_RESET

Review comment:
       This is not mandatory. I think we should remove it from here

##########
File path: boards/arm/samv7/common/Kconfig
##########
@@ -0,0 +1,73 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+config BOARD_SAMV7_COMMON
+       bool "Board common logic"
+       default y
+       ---help---
+               Board common logic located in each board/common folder.
+
+if BOARD_SAMV7_COMMON
+
+config SAMV7_PROGMEM_MCUBOOT_PARTITION
+	bool
+	default n
+	select MTD
+	select MTD_BYTE_WRITE
+	select MTD_PARTITION
+	select MTD_PROGMEM
+	select MTD_PROGMEM_ERASESTATE
+
+menuconfig SAMV7_FORMAT_MCUBOOT
+	bool "MCUboot-bootable format"
+	default n
+	select ARCH_RAMFUNCS
+	select BOARDCTL_RESET
+	select BOOT_MCUBOOT
+	select SAMV7_PROGMEM
+	select SAMV7_PROGMEM_MCUBOOT_PARTITION
+	select SAMV7_SYSTEMRESET
+	---help---
+		The MCUboot support of loading the firmware images.
+
+if SAMV7_FORMAT_MCUBOOT
+
+comment "MCUboot Application Image MCUBOOT Update support"
+
+config SAMV7_MCUBOOT_PRIMARY_SLOT_OFFSET
+	hex "MCUboot application image primary slot offset"
+	default "0x20000"
+
+config SAMV7_MCUBOOT_PRIMARY_SLOT_DEVPATH
+	string "Application image primary slot device path"
+	default "/dev/mcuboot0"

Review comment:
       ```suggestion
   	default "/dev/ota0"
   ```

##########
File path: boards/arm/samv7/common/Kconfig
##########
@@ -0,0 +1,73 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+config BOARD_SAMV7_COMMON
+       bool "Board common logic"
+       default y
+       ---help---
+               Board common logic located in each board/common folder.
+
+if BOARD_SAMV7_COMMON
+
+config SAMV7_PROGMEM_MCUBOOT_PARTITION
+	bool
+	default n
+	select MTD
+	select MTD_BYTE_WRITE
+	select MTD_PARTITION
+	select MTD_PROGMEM
+	select MTD_PROGMEM_ERASESTATE
+
+menuconfig SAMV7_FORMAT_MCUBOOT
+	bool "MCUboot-bootable format"
+	default n
+	select ARCH_RAMFUNCS
+	select BOARDCTL_RESET
+	select BOOT_MCUBOOT
+	select SAMV7_PROGMEM
+	select SAMV7_PROGMEM_MCUBOOT_PARTITION
+	select SAMV7_SYSTEMRESET

Review comment:
       This is not mandatory for MCUboot. I think we should remove it

##########
File path: boards/arm/samv7/common/Kconfig
##########
@@ -0,0 +1,73 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+config BOARD_SAMV7_COMMON
+       bool "Board common logic"
+       default y
+       ---help---
+               Board common logic located in each board/common folder.
+
+if BOARD_SAMV7_COMMON
+
+config SAMV7_PROGMEM_MCUBOOT_PARTITION
+	bool
+	default n
+	select MTD
+	select MTD_BYTE_WRITE
+	select MTD_PARTITION
+	select MTD_PROGMEM
+	select MTD_PROGMEM_ERASESTATE
+
+menuconfig SAMV7_FORMAT_MCUBOOT
+	bool "MCUboot-bootable format"
+	default n
+	select ARCH_RAMFUNCS
+	select BOARDCTL_RESET
+	select BOOT_MCUBOOT
+	select SAMV7_PROGMEM
+	select SAMV7_PROGMEM_MCUBOOT_PARTITION
+	select SAMV7_SYSTEMRESET
+	---help---
+		The MCUboot support of loading the firmware images.
+
+if SAMV7_FORMAT_MCUBOOT
+
+comment "MCUboot Application Image MCUBOOT Update support"
+
+config SAMV7_MCUBOOT_PRIMARY_SLOT_OFFSET
+	hex "MCUboot application image primary slot offset"
+	default "0x20000"
+
+config SAMV7_MCUBOOT_PRIMARY_SLOT_DEVPATH
+	string "Application image primary slot device path"
+	default "/dev/mcuboot0"
+
+config SAMV7_MCUBOOT_SECONDARY_SLOT_OFFSET
+	hex "MCUboot application image secondary slot offset"
+	default "0x100000"
+
+config SAMV7_MCUBOOT_SECONDARY_SLOT_DEVPATH
+	string "Application image secondary slot device path"
+	default "/dev/mcuboot1"

Review comment:
       ```suggestion
   	default "/dev/ota1"
   ```

##########
File path: boards/arm/samv7/common/Kconfig
##########
@@ -0,0 +1,73 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+config BOARD_SAMV7_COMMON
+       bool "Board common logic"
+       default y
+       ---help---
+               Board common logic located in each board/common folder.
+
+if BOARD_SAMV7_COMMON
+
+config SAMV7_PROGMEM_MCUBOOT_PARTITION
+	bool
+	default n
+	select MTD
+	select MTD_BYTE_WRITE
+	select MTD_PARTITION
+	select MTD_PROGMEM
+	select MTD_PROGMEM_ERASESTATE
+
+menuconfig SAMV7_FORMAT_MCUBOOT
+	bool "MCUboot-bootable format"
+	default n
+	select ARCH_RAMFUNCS
+	select BOARDCTL_RESET
+	select BOOT_MCUBOOT
+	select SAMV7_PROGMEM
+	select SAMV7_PROGMEM_MCUBOOT_PARTITION
+	select SAMV7_SYSTEMRESET
+	---help---
+		The MCUboot support of loading the firmware images.
+
+if SAMV7_FORMAT_MCUBOOT
+
+comment "MCUboot Application Image MCUBOOT Update support"
+
+config SAMV7_MCUBOOT_PRIMARY_SLOT_OFFSET
+	hex "MCUboot application image primary slot offset"
+	default "0x20000"
+
+config SAMV7_MCUBOOT_PRIMARY_SLOT_DEVPATH
+	string "Application image primary slot device path"
+	default "/dev/mcuboot0"
+
+config SAMV7_MCUBOOT_SECONDARY_SLOT_OFFSET
+	hex "MCUboot application image secondary slot offset"
+	default "0x100000"
+
+config SAMV7_MCUBOOT_SECONDARY_SLOT_DEVPATH
+	string "Application image secondary slot device path"
+	default "/dev/mcuboot1"
+
+config SAMV7_MCUBOOT_SLOT_SIZE
+	hex "MCUboot application image slot size (in bytes)"
+	default "0xe0000"
+
+config SAMV7_MCUBOOT_SCRATCH_OFFSET
+	hex "MCUboot scratch partition offset"
+	default "0x1e0000"
+
+config SAMV7_MCUBOOT_SCRATCH_DEVPATH
+	string "Scratch partition device path"
+	default "/dev/mcubootS"

Review comment:
       ```suggestion
   	default "/dev/otascratch"
   ```

##########
File path: boards/arm/samv7/common/Kconfig
##########
@@ -0,0 +1,73 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+config BOARD_SAMV7_COMMON
+       bool "Board common logic"
+       default y
+       ---help---
+               Board common logic located in each board/common folder.
+
+if BOARD_SAMV7_COMMON
+
+config SAMV7_PROGMEM_MCUBOOT_PARTITION
+	bool
+	default n
+	select MTD
+	select MTD_BYTE_WRITE
+	select MTD_PARTITION
+	select MTD_PROGMEM
+	select MTD_PROGMEM_ERASESTATE
+
+menuconfig SAMV7_FORMAT_MCUBOOT
+	bool "MCUboot-bootable format"
+	default n
+	select ARCH_RAMFUNCS
+	select BOARDCTL_RESET
+	select BOOT_MCUBOOT
+	select SAMV7_PROGMEM
+	select SAMV7_PROGMEM_MCUBOOT_PARTITION
+	select SAMV7_SYSTEMRESET
+	---help---
+		The MCUboot support of loading the firmware images.
+
+if SAMV7_FORMAT_MCUBOOT
+
+comment "MCUboot Application Image MCUBOOT Update support"
+
+config SAMV7_MCUBOOT_PRIMARY_SLOT_OFFSET
+	hex "MCUboot application image primary slot offset"
+	default "0x20000"
+
+config SAMV7_MCUBOOT_PRIMARY_SLOT_DEVPATH
+	string "Application image primary slot device path"
+	default "/dev/mcuboot0"
+
+config SAMV7_MCUBOOT_SECONDARY_SLOT_OFFSET
+	hex "MCUboot application image secondary slot offset"
+	default "0x100000"
+
+config SAMV7_MCUBOOT_SECONDARY_SLOT_DEVPATH
+	string "Application image secondary slot device path"
+	default "/dev/mcuboot1"
+
+config SAMV7_MCUBOOT_SLOT_SIZE
+	hex "MCUboot application image slot size (in bytes)"
+	default "0xe0000"
+
+config SAMV7_MCUBOOT_SCRATCH_OFFSET
+	hex "MCUboot scratch partition offset"
+	default "0x1e0000"
+
+config SAMV7_MCUBOOT_SCRATCH_DEVPATH
+	string "Scratch partition device path"
+	default "/dev/mcubootS"
+
+config SAMV7_MCUBOOT_SCRATCH_SIZE
+	hex "MCUboot scratch partition size (in bytes)"
+	default "0x20000"

Review comment:
       Default should depend on `SAMV7_CHIP_MEM_FLASH_XXXX`

##########
File path: boards/arm/samv7/common/Kconfig
##########
@@ -0,0 +1,73 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+config BOARD_SAMV7_COMMON
+       bool "Board common logic"
+       default y
+       ---help---
+               Board common logic located in each board/common folder.
+
+if BOARD_SAMV7_COMMON
+
+config SAMV7_PROGMEM_MCUBOOT_PARTITION
+	bool
+	default n
+	select MTD
+	select MTD_BYTE_WRITE
+	select MTD_PARTITION
+	select MTD_PROGMEM
+	select MTD_PROGMEM_ERASESTATE
+
+menuconfig SAMV7_FORMAT_MCUBOOT
+	bool "MCUboot-bootable format"
+	default n
+	select ARCH_RAMFUNCS
+	select BOARDCTL_RESET
+	select BOOT_MCUBOOT
+	select SAMV7_PROGMEM
+	select SAMV7_PROGMEM_MCUBOOT_PARTITION
+	select SAMV7_SYSTEMRESET
+	---help---
+		The MCUboot support of loading the firmware images.
+
+if SAMV7_FORMAT_MCUBOOT
+
+comment "MCUboot Application Image MCUBOOT Update support"
+
+config SAMV7_MCUBOOT_PRIMARY_SLOT_OFFSET
+	hex "MCUboot application image primary slot offset"
+	default "0x20000"
+
+config SAMV7_MCUBOOT_PRIMARY_SLOT_DEVPATH
+	string "Application image primary slot device path"
+	default "/dev/mcuboot0"
+
+config SAMV7_MCUBOOT_SECONDARY_SLOT_OFFSET
+	hex "MCUboot application image secondary slot offset"
+	default "0x100000"
+
+config SAMV7_MCUBOOT_SECONDARY_SLOT_DEVPATH
+	string "Application image secondary slot device path"
+	default "/dev/mcuboot1"
+
+config SAMV7_MCUBOOT_SLOT_SIZE
+	hex "MCUboot application image slot size (in bytes)"
+	default "0xe0000"

Review comment:
       Default should depend on `SAMV7_CHIP_MEM_FLASH_XXXX`

##########
File path: boards/arm/samv7/common/Kconfig
##########
@@ -0,0 +1,73 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+config BOARD_SAMV7_COMMON
+       bool "Board common logic"
+       default y
+       ---help---
+               Board common logic located in each board/common folder.
+
+if BOARD_SAMV7_COMMON
+
+config SAMV7_PROGMEM_MCUBOOT_PARTITION
+	bool
+	default n
+	select MTD
+	select MTD_BYTE_WRITE
+	select MTD_PARTITION
+	select MTD_PROGMEM
+	select MTD_PROGMEM_ERASESTATE
+
+menuconfig SAMV7_FORMAT_MCUBOOT
+	bool "MCUboot-bootable format"
+	default n
+	select ARCH_RAMFUNCS
+	select BOARDCTL_RESET
+	select BOOT_MCUBOOT
+	select SAMV7_PROGMEM
+	select SAMV7_PROGMEM_MCUBOOT_PARTITION
+	select SAMV7_SYSTEMRESET
+	---help---
+		The MCUboot support of loading the firmware images.
+
+if SAMV7_FORMAT_MCUBOOT
+
+comment "MCUboot Application Image MCUBOOT Update support"
+
+config SAMV7_MCUBOOT_PRIMARY_SLOT_OFFSET
+	hex "MCUboot application image primary slot offset"
+	default "0x20000"
+
+config SAMV7_MCUBOOT_PRIMARY_SLOT_DEVPATH
+	string "Application image primary slot device path"
+	default "/dev/mcuboot0"
+
+config SAMV7_MCUBOOT_SECONDARY_SLOT_OFFSET
+	hex "MCUboot application image secondary slot offset"
+	default "0x100000"
+
+config SAMV7_MCUBOOT_SECONDARY_SLOT_DEVPATH
+	string "Application image secondary slot device path"
+	default "/dev/mcuboot1"
+
+config SAMV7_MCUBOOT_SLOT_SIZE
+	hex "MCUboot application image slot size (in bytes)"
+	default "0xe0000"
+
+config SAMV7_MCUBOOT_SCRATCH_OFFSET
+	hex "MCUboot scratch partition offset"
+	default "0x1e0000"

Review comment:
       Default should depend on `SAMV7_CHIP_MEM_FLASH_XXXX`

##########
File path: boards/arm/samv7/common/Kconfig
##########
@@ -0,0 +1,73 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+config BOARD_SAMV7_COMMON
+       bool "Board common logic"
+       default y
+       ---help---
+               Board common logic located in each board/common folder.
+
+if BOARD_SAMV7_COMMON
+
+config SAMV7_PROGMEM_MCUBOOT_PARTITION
+	bool
+	default n
+	select MTD
+	select MTD_BYTE_WRITE
+	select MTD_PARTITION
+	select MTD_PROGMEM
+	select MTD_PROGMEM_ERASESTATE
+
+menuconfig SAMV7_FORMAT_MCUBOOT
+	bool "MCUboot-bootable format"
+	default n
+	select ARCH_RAMFUNCS
+	select BOARDCTL_RESET
+	select BOOT_MCUBOOT
+	select SAMV7_PROGMEM
+	select SAMV7_PROGMEM_MCUBOOT_PARTITION
+	select SAMV7_SYSTEMRESET
+	---help---
+		The MCUboot support of loading the firmware images.
+
+if SAMV7_FORMAT_MCUBOOT
+
+comment "MCUboot Application Image MCUBOOT Update support"
+
+config SAMV7_MCUBOOT_PRIMARY_SLOT_OFFSET
+	hex "MCUboot application image primary slot offset"
+	default "0x20000"
+
+config SAMV7_MCUBOOT_PRIMARY_SLOT_DEVPATH
+	string "Application image primary slot device path"
+	default "/dev/mcuboot0"
+
+config SAMV7_MCUBOOT_SECONDARY_SLOT_OFFSET
+	hex "MCUboot application image secondary slot offset"
+	default "0x100000"

Review comment:
       Default should depend on `SAMV7_CHIP_MEM_FLASH_XXXX`

##########
File path: boards/arm/samv7/same70-qmtech/README.txt
##########
@@ -794,8 +794,8 @@ Configuration sub-directories
       CONFIG_MCUBOOT_BOOTLOADER=y
       CONFIG_MCUBOOT_ENABLE_LOGGING=y
 
-      CONFIG_SAME70QMTECH_FORMAT_MCUBOOT=y
-      CONFIG_SAME70QMTECH_MCUBOOT_BOOTLOADER=y
+      CONFIG_SAMV7_FORMAT_MCUBOOT=y
+      CONFIG_SAMV7_PROGMEM_NSECTORS=16

Review comment:
       Qmtech board has 4 NSECTORS -- that is a default value

##########
File path: boards/arm/samv7/same70-qmtech/configs/mcuboot-loader/defconfig
##########
@@ -44,13 +47,12 @@ CONFIG_RAM_SIZE=262144
 CONFIG_RAM_START=0x20400000
 CONFIG_RAW_BINARY=y
 CONFIG_RR_INTERVAL=200
-CONFIG_SAME70QMTECH_FORMAT_MCUBOOT=y
-CONFIG_SAME70QMTECH_MCUBOOT_BOOTLOADER=y
+CONFIG_SAMV7_FORMAT_MCUBOOT=y
 CONFIG_SAMV7_GPIOA_IRQ=y
-CONFIG_SAMV7_GPIOD_IRQ=y
+CONFIG_SAMV7_GPIOC_IRQ=y
 CONFIG_SAMV7_GPIO_IRQ=y
 CONFIG_SAMV7_HSMCI0=y
-CONFIG_SAMV7_PROGMEM=y
+CONFIG_SAMV7_PROGMEM_NSECTORS=16

Review comment:
       ```suggestion
   ```

##########
File path: boards/arm/samv7/same70-qmtech/configs/mcuboot-loader/defconfig
##########
@@ -32,6 +32,9 @@ CONFIG_FS_FAT=y
 CONFIG_FS_PROCFS=y
 CONFIG_MCUBOOT_BOOTLOADER=y
 CONFIG_MCUBOOT_ENABLE_LOGGING=y
+CONFIG_MCUBOOT_PRIMARY_SLOT_PATH="/dev/mcuboot0"
+CONFIG_MCUBOOT_SCRATCH_PATH="/dev/mcubootS"
+CONFIG_MCUBOOT_SECONDARY_SLOT_PATH="/dev/mcuboot1"

Review comment:
       Let's go with defaults: `/dev/ota0`, `/dev/ota1`, `/dev/otascratch`

##########
File path: boards/arm/samv7/same70-qmtech/configs/mcuboot-confirm/defconfig_debug
##########
@@ -41,6 +41,9 @@ CONFIG_FS_FAT=y
 CONFIG_FS_PROCFS=y
 CONFIG_I2CTOOL_MAXBUS=0
 CONFIG_INTELHEX_BINARY=y
+CONFIG_MCUBOOT_PRIMARY_SLOT_PATH="/dev/mcuboot0"
+CONFIG_MCUBOOT_SCRATCH_PATH="/dev/mcubootS"
+CONFIG_MCUBOOT_SECONDARY_SLOT_PATH="/dev/mcuboot1"

Review comment:
       This file is committed by mistake. We should remove it

##########
File path: boards/arm/samv7/same70-qmtech/configs/mcuboot-confirm/defconfig
##########
@@ -43,12 +46,12 @@ CONFIG_RAM_SIZE=262144
 CONFIG_RAM_START=0x20400000
 CONFIG_RAW_BINARY=y
 CONFIG_RR_INTERVAL=200
-CONFIG_SAME70QMTECH_FORMAT_MCUBOOT=y
+CONFIG_SAMV7_FORMAT_MCUBOOT=y
 CONFIG_SAMV7_GPIOA_IRQ=y
 CONFIG_SAMV7_GPIOD_IRQ=y
 CONFIG_SAMV7_GPIO_IRQ=y
 CONFIG_SAMV7_HSMCI0=y
-CONFIG_SAMV7_PROGMEM=y
+CONFIG_SAMV7_PROGMEM_NSECTORS=16

Review comment:
       ```suggestion
   ```

##########
File path: boards/arm/samv7/same70-qmtech/configs/mcuboot-confirm/defconfig
##########
@@ -30,6 +30,9 @@ CONFIG_FAT_LCNAMES=y
 CONFIG_FAT_LFN=y
 CONFIG_FS_FAT=y
 CONFIG_FS_PROCFS=y
+CONFIG_MCUBOOT_PRIMARY_SLOT_PATH="/dev/mcuboot0"
+CONFIG_MCUBOOT_SCRATCH_PATH="/dev/mcubootS"
+CONFIG_MCUBOOT_SECONDARY_SLOT_PATH="/dev/mcuboot1"

Review comment:
       Let's go with defaults: `/dev/ota0`, `/dev/ota1`, `/dev/otascratch`

##########
File path: boards/arm/samv7/common/Kconfig
##########
@@ -0,0 +1,73 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+config BOARD_SAMV7_COMMON
+       bool "Board common logic"
+       default y
+       ---help---
+               Board common logic located in each board/common folder.
+
+if BOARD_SAMV7_COMMON
+
+config SAMV7_PROGMEM_MCUBOOT_PARTITION
+	bool
+	default n
+	select MTD
+	select MTD_BYTE_WRITE
+	select MTD_PARTITION
+	select MTD_PROGMEM
+	select MTD_PROGMEM_ERASESTATE
+
+menuconfig SAMV7_FORMAT_MCUBOOT
+	bool "MCUboot-bootable format"
+	default n
+	select ARCH_RAMFUNCS
+	select BOARDCTL_RESET
+	select BOOT_MCUBOOT
+	select SAMV7_PROGMEM
+	select SAMV7_PROGMEM_MCUBOOT_PARTITION
+	select SAMV7_SYSTEMRESET
+	---help---
+		The MCUboot support of loading the firmware images.
+
+if SAMV7_FORMAT_MCUBOOT

Review comment:
       `SAMV7_MCUBOOT_BOOTLOADER` -- config option is missing

##########
File path: boards/arm/samv7/same70-qmtech/README.txt
##########
@@ -815,5 +815,6 @@ Configuration sub-directories
       CONFIG_BOOT_MCUBOOT=y
       CONFIG_MCUBOOT_SLOT_CONFIRM_EXAMPLE=y
 
-      CONFIG_SAME70QMTECH_FORMAT_MCUBOOT=y
+      CONFIG_SAMV7_FORMAT_MCUBOOT=y
+      CONFIG_SAMV7_PROGMEM_NSECTORS=16

Review comment:
       Qmtech board has 4 NSECTORS -- that is a default value

##########
File path: boards/arm/samv7/same70-qmtech/configs/mcuboot-loader/defconfig
##########
@@ -44,13 +47,12 @@ CONFIG_RAM_SIZE=262144
 CONFIG_RAM_START=0x20400000
 CONFIG_RAW_BINARY=y
 CONFIG_RR_INTERVAL=200
-CONFIG_SAME70QMTECH_FORMAT_MCUBOOT=y
-CONFIG_SAME70QMTECH_MCUBOOT_BOOTLOADER=y
+CONFIG_SAMV7_FORMAT_MCUBOOT=y

Review comment:
       `CONFIG_SAMV7_MCUBOOT_BOOTLOADER` -- is missing

##########
File path: boards/arm/samv7/same70-qmtech/configs/mcuboot-loader/defconfig
##########
@@ -44,13 +47,12 @@ CONFIG_RAM_SIZE=262144
 CONFIG_RAM_START=0x20400000
 CONFIG_RAW_BINARY=y
 CONFIG_RR_INTERVAL=200
-CONFIG_SAME70QMTECH_FORMAT_MCUBOOT=y
-CONFIG_SAME70QMTECH_MCUBOOT_BOOTLOADER=y
+CONFIG_SAMV7_FORMAT_MCUBOOT=y
 CONFIG_SAMV7_GPIOA_IRQ=y
-CONFIG_SAMV7_GPIOD_IRQ=y
+CONFIG_SAMV7_GPIOC_IRQ=y

Review comment:
       ```suggestion
   CONFIG_SAMV7_GPIOD_IRQ=y
   ```




-- 
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] nandojve closed pull request #4939: boards/arm/samv7: Introduce common folder

Posted by GitBox <gi...@apache.org>.
nandojve closed pull request #4939:
URL: https://github.com/apache/incubator-nuttx/pull/4939


   


-- 
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] nandojve commented on pull request #4939: boards/arm/samv7: Introduce common folder

Posted by GitBox <gi...@apache.org>.
nandojve commented on pull request #4939:
URL: https://github.com/apache/incubator-nuttx/pull/4939#issuecomment-987945043


   I'm working to better integrate bootloaders into NuttX. To do that, it is necessary re-order commit sequence, patch MCUboot and update Apps. I'll open a new PR as draft following a RFC proposal.


-- 
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] nandojve commented on a change in pull request #4939: boards/arm/samv7: Introduce common folder

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



##########
File path: boards/arm/samv7/common/Kconfig
##########
@@ -0,0 +1,73 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+config BOARD_SAMV7_COMMON
+       bool "Board common logic"
+       default y
+       ---help---
+               Board common logic located in each board/common folder.
+
+if BOARD_SAMV7_COMMON
+
+config SAMV7_PROGMEM_MCUBOOT_PARTITION
+	bool
+	default n
+	select MTD
+	select MTD_BYTE_WRITE
+	select MTD_PARTITION
+	select MTD_PROGMEM
+	select MTD_PROGMEM_ERASESTATE
+
+menuconfig SAMV7_FORMAT_MCUBOOT
+	bool "MCUboot-bootable format"
+	default n
+	select ARCH_RAMFUNCS
+	select BOARDCTL_RESET
+	select BOOT_MCUBOOT
+	select SAMV7_PROGMEM
+	select SAMV7_PROGMEM_MCUBOOT_PARTITION
+	select SAMV7_SYSTEMRESET
+	---help---
+		The MCUboot support of loading the firmware images.
+
+if SAMV7_FORMAT_MCUBOOT

Review comment:
       CONFIG_BOARDCTL_BOOT_IMAGE is selected when building the boot-loader and is enough.




-- 
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] nandojve commented on a change in pull request #4939: boards/arm/samv7: Introduce common folder

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



##########
File path: boards/arm/samv7/same70-qmtech/configs/mcuboot-loader/defconfig
##########
@@ -44,13 +47,12 @@ CONFIG_RAM_SIZE=262144
 CONFIG_RAM_START=0x20400000
 CONFIG_RAW_BINARY=y
 CONFIG_RR_INTERVAL=200
-CONFIG_SAME70QMTECH_FORMAT_MCUBOOT=y
-CONFIG_SAME70QMTECH_MCUBOOT_BOOTLOADER=y
+CONFIG_SAMV7_FORMAT_MCUBOOT=y

Review comment:
       CONFIG_BOARDCTL_BOOT_IMAGE have same function.




-- 
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] nandojve removed a comment on pull request #4939: boards/arm/samv7: Introduce common folder

Posted by GitBox <gi...@apache.org>.
nandojve removed a comment on pull request #4939:
URL: https://github.com/apache/incubator-nuttx/pull/4939#issuecomment-986139617


   Hi @pkarashchenko ,
   
   Thank you for your comments.
   
   I was thinking more about how integrade bootloaders into NuttX. Besides this PR helps to unify samv7 it still lacks for all NuttX platforms. If makes sense, I would like split this PR and keep only first 2 commits. The next step will be create a RFC to define all those variables that are required to allow an agnostic bootloader. I mean, there is no sense an App outside NuttX define things that are HW dependent. I think it should be the contrary. This way it will be possible that any external app pick configs from NuttX and configure itself which allows an agnostic bootloader.
   
   If above makes sense I prefer split PR.
   
   What do you think?


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