Skip to content

Commit dbbeae4

Browse files
de-nordicnordicjm
authored andcommitted
Revert "zephyr: Add support for devices without erase and reduced erases"
Need to revert changes provided to support devices without erase until problme with TF-M, missing implementation of flash_area_get_sector, is resolved. This reverts commit c12dced. Signed-off-by: Dominik Ermel <[email protected]>
1 parent 9c84013 commit dbbeae4

File tree

3 files changed

+0
-78
lines changed

3 files changed

+0
-78
lines changed

boot/zephyr/Kconfig

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,44 +1023,6 @@ endif # BOOT_DECOMPRESSION_SUPPORT
10231023

10241024
endmenu
10251025

1026-
config MCUBOOT_STORAGE_WITHOUT_ERASE
1027-
bool "Support for devices without erase"
1028-
depends on FLASH_HAS_NO_EXPLICIT_ERASE
1029-
default y
1030-
help
1031-
Not all devices require erase before write and, depending on driver,
1032-
may emulate erase by write, as a way to scramble data rather then
1033-
by hardware requirement. This unfortunately means that code that
1034-
does erase before write, when not needed, will write device twice
1035-
which not only reduces device life time but also doubles time
1036-
of any write operation (one write for erase and one write for actual
1037-
write).
1038-
When this option is enabled, MCUboot will check for type of device
1039-
and will avoid erase where not needed.
1040-
1041-
config MCUBOOT_STORAGE_WITH_ERASE
1042-
bool "Support for devices with erase"
1043-
depends on FLASH_HAS_EXPLICIT_ERASE
1044-
default y
1045-
help
1046-
Support for devices with erase
1047-
1048-
config MCUBOOT_STORAGE_MINIMAL_SCRAMBLE
1049-
bool "Do minimal required work to remove data (EXPERIMENTAL)"
1050-
help
1051-
In some cases MCUboot has to remove data, which usually means make
1052-
it non-viable for MCUboot rather then completely destroyed.
1053-
For example when MCUboot does not want to bother with broken image,
1054-
in some slot, it will remove it.
1055-
The same can be achieved with just removal of header and footer,
1056-
leaving the rest of image untouched, as without header MCUboot will
1057-
not be able to recognize image in slot as bootable.
1058-
When this option is enabled, MCUboot will not attempt to erase
1059-
entire slot or image, instead it will just remove enough of
1060-
data from slot to not recognize it as image anymore.
1061-
Depending on type of device this may be done by erase of minimal
1062-
number of pages or overwrite of part of image.
1063-
10641026
config MCUBOOT_DEVICE_SETTINGS
10651027
# Hidden selector for device-specific settings
10661028
bool

boot/zephyr/include/flash_map_backend/flash_map_backend.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -106,23 +106,6 @@ static inline uint32_t flash_sector_get_size(const struct flash_sector *fs)
106106
int flash_area_get_sector(const struct flash_area *fa, off_t off,
107107
struct flash_sector *fs);
108108

109-
110-
#if defined(CONFIG_MCUBOOT)
111-
static inline bool flash_area_erase_required(const struct flash_area *fa)
112-
{
113-
#if defined(CONFIG_FLASH_HAS_EXPLICIT_ERASE) && defined(CONFIG_FLASH_HAS_NO_EXPLICIT_ERASE)
114-
const struct flash_parameters *fp = flash_get_parameters(flash_area_get_device(fa));
115-
116-
return flash_params_get_erase_cap(flash_get_parameters(flash_area_get_device(fa))) &
117-
FLASH_ERASE_C_EXPLICIT;
118-
#elif defined(CONFIG_FLASH_HAS_EXPLICIT_ERASE)
119-
return true;
120-
#else
121-
return false;
122-
#endif
123-
}
124-
#endif
125-
126109
#ifdef __cplusplus
127110
}
128111
#endif

boot/zephyr/include/mcuboot_config/mcuboot_config.h

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -307,29 +307,6 @@
307307
#define MCUBOOT_ERASE_PROGRESSIVELY
308308
#endif
309309

310-
/*
311-
* Devices that do not require erase prior to write or do not support
312-
* erase should avoid emulation of erase by additional write.
313-
* The emulation is also taking time which doubles required write time
314-
* for such devices.
315-
*/
316-
#ifdef CONFIG_MCUBOOT_STORAGE_WITHOUT_ERASE
317-
#define MCUBOOT_SUPPORT_DEV_WITHOUT_ERASE
318-
#endif
319-
320-
#ifdef CONFIG_MCUBOOT_STORAGE_WITH_ERASE
321-
#define MCUBOOT_SUPPORT_DEV_WITH_ERASE
322-
#endif
323-
324-
/*
325-
* MCUboot often calls erase on device just to remove data or make application
326-
* image not recognizable. In such instances it may be faster to just remove
327-
* portion of data to make image unrecognizable.
328-
*/
329-
#ifdef CONFIG_MCUBOOT_STORAGE_MINIMAL_SCRAMBLE
330-
#define MCUBOOT_MINIMAL_SCRAMBLE
331-
#endif
332-
333310
/*
334311
* Enabling this option uses newer flash map APIs. This saves RAM and
335312
* avoids deprecated API usage.

0 commit comments

Comments
 (0)