Skip to content

Commit 8abd562

Browse files
committed
espressif: mcuboot: get MCUBOOT_BOOT_MAX_ALIGN value from DT
This change affects only MCUboot Zephyr Port for ESP chips or Zephyr application with MCUboot compatibilty (which builds the bootutil lib). In these cases, MCUBOOT_BOOT_MAX_ALIGN value must be taken from DT flash write-block-size if its greater than 8. Signed-off-by: Almir Okato <[email protected]>
1 parent f3453bd commit 8abd562

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

zephyr/port/include/boot/mcuboot_config/mcuboot_config.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#ifndef __MCUBOOT_CONFIG_H__
88
#define __MCUBOOT_CONFIG_H__
99

10+
#include <zephyr/devicetree.h>
11+
1012
/*
1113
* Signature types
1214
*
@@ -29,8 +31,13 @@
2931
#define MCUBOOT_SIGN_ED25519
3032
#endif
3133

32-
#if defined(CONFIG_SECURE_FLASH_ENC_ENABLED)
33-
#define MCUBOOT_BOOT_MAX_ALIGN 32
34+
/* This mcuboot_config.h is used only by Zephyr builds, such as MCUboot
35+
* Zephyr Port for ESP chips or a Zephyr application with MCUboot
36+
* compatibilty (that builds the bootutil lib).
37+
* In these cases, MCUBOOT_BOOT_MAX_ALIGN value must be taken from DT if
38+
* the write-block-size is greater than 8 */
39+
#if DT_PROP(DT_CHOSEN(zephyr_flash), write_block_size) > 8
40+
#define MCUBOOT_BOOT_MAX_ALIGN DT_PROP(DT_CHOSEN(zephyr_flash), write_block_size)
3441
#endif
3542

3643
/*

0 commit comments

Comments
 (0)