File tree Expand file tree Collapse file tree 2 files changed +43
-1
lines changed Expand file tree Collapse file tree 2 files changed +43
-1
lines changed Original file line number Diff line number Diff line change @@ -1094,14 +1094,35 @@ config BOOT_FIH_PROFILE_DEFAULT_HIGH
1094
1094
1095
1095
endmenu
1096
1096
1097
+ config MCUBOOT_LOGICAL_SECTOR_SIZE
1098
+ int "Size of a logical sector"
1099
+ default 0
1100
+ help
1101
+ Set to 0 to use hardware sectors. Any other value here should be
1102
+ aligned to hardware sectors in size and alignment.
1103
+
1104
+ config MCUBOOT_LOGICAL_SECTOR_SIZE_SET
1105
+ bool
1106
+ default y if MCUBOOT_LOGICAL_SECTOR_SIZE != 0
1107
+
1108
+ config MCUBOOT_LOGICAL_SECTOR_VALIDATION
1109
+ bool "Validate logical sector layout"
1110
+ default true if MCUBOOT_LOGICAL_SECTOR_SIZE != 0
1111
+ depends on MCUBOOT_LOGICAL_SECTOR_SIZE_SET
1112
+ help
1113
+ Validation of logical sector size against hardware constrains.
1114
+ Should be used to validate compile-time configuration against run-time
1115
+ system.
1116
+
1097
1117
config MCUBOOT_DEVICE_SETTINGS
1098
1118
# Hidden selector for device-specific settings
1099
1119
bool
1100
1120
default y
1101
1121
# CPU options
1102
1122
select MCUBOOT_DEVICE_CPU_CORTEX_M0 if CPU_CORTEX_M0
1103
1123
# Enable flash page layout if available
1104
- select FLASH_PAGE_LAYOUT if FLASH_HAS_PAGE_LAYOUT
1124
+ select FLASH_PAGE_LAYOUT if FLASH_HAS_PAGE_LAYOUT && !MCUBOOT_LOGICAL_SECTOR_SIZE_SET
1125
+ select FLASH_PAGE_LAYOUT if FLASH_HAS_PAGE_LAYOUT && MCUBOOT_LOGICAL_SECTOR_VALIDATION
1105
1126
# Enable flash_map module as flash I/O back-end
1106
1127
select FLASH_MAP
1107
1128
Original file line number Diff line number Diff line change 357
357
# endif
358
358
#endif
359
359
360
+ /* If set to non-0 it will use logical sectors rather than querying
361
+ * device for sector sizes. This slightly reduces code and RAM usage.
362
+ * Note that the logical sector size has to be multiply of erase
363
+ * sector size that is biggest for of all devices in the system.
364
+ */
365
+ #if defined(CONFIG_MCUBOOT_LOGICAL_SECTOR_SIZE )
366
+ #define MCUBOOT_LOGICAL_SECTOR_SIZE CONFIG_MCUBOOT_LOGICAL_SECTOR_SIZE
367
+ #endif
368
+
369
+ /* Enable to validate compile time logical sector setup vs the real device layout.
370
+ * This increases the size of bootloader but is useful to check whether
371
+ * selected logical sector size can be used with provided partitions
372
+ * and devices they are placed on.
373
+ * Once layout is tested, this option should be disabled, for production
374
+ * devices, as it is pointless to re-validate non-changing setup on
375
+ * every MCUboot run.
376
+ */
377
+ #if defined(CONFIG_MCUBOOT_LOGICAL_SECTOR_VALIDATION )
378
+ #define MCUBOOT_LOGICAL_SECTOR_VALIDATION 1
379
+ #endif
380
+
360
381
#if defined(CONFIG_BOOT_MAX_IMG_SECTORS_AUTO ) && defined(MIN_SECTOR_COUNT )
361
382
362
383
#define MCUBOOT_MAX_IMG_SECTORS MIN_SECTOR_COUNT
You can’t perform that action at this time.
0 commit comments