Commit b788c71c authored by Andrzej Puzdrowski's avatar Andrzej Puzdrowski Committed by Fabio Utzig
Browse files

Replace mcuboot flash_map by zephyr flash_map

The patch introduce usage of zephyr flas_map module instead
of mcuboot zephyr-only implementation. Unused flash_area_to_sectors
API of former flash_map was removed as well.
Size of sector-status-update-map entry is now defined thanks to the
minimum write size supported by the flash driver.

For avoid ambiguity former zephyr-only files flash_map.c
were renamed to flash_map_extended.c (its code now implements
only addition to this what zephyr flash_map implements).

flash_map.h header include is now warped by flash_map_backedn.h headre
because implementations and include pathes are diferent in Zephyr and Mynewt.

Usage of hal_flash_align() were replaced by usage flash_area_align().
This provide consistency between MyNewt and Zephyr implementation as
this API is available in both RTOSes.

flash_map.h was moved to the simulator c-support files as now missing in
the boot/zephyr subdirectories.

f. boot_scratch_fa_device_id was removed as unused.
f. boot_img_fa_device_id was and expanded the only use of it
(on loader.c).

Signed-off-by: default avatarAndrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
parent aa70dae2
Loading
Loading
Loading
Loading
+1 −1
Changes for boot/boot_serial/pkg.yml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ pkg.deps:
    - "@apache-mynewt-core/encoding/tinycbor"
    - "@apache-mynewt-core/encoding/cborattr"
    - "@apache-mynewt-core/encoding/base64"
    - "@apache-mynewt-core/sys/flash_map"
    - "@mcuboot/boot/mynewt/flash_map_backend"
    - "@apache-mynewt-core/util/crc"

pkg.req_apis:
+1 −2
Changes for boot/boot_serial/src/boot_serial.c: 1 added line, 2 removed lines.
Original line number Diff line number Diff line
@@ -49,8 +49,7 @@
#endif /* __ZEPHYR__ */

#include <cborattr/cborattr.h>

#include <flash_map/flash_map.h>
#include <flash_map_backend/flash_map_backend.h>
#include <hal/hal_flash.h>
#include <os/os.h>
#include <os/os_malloc.h>
+1 −1
Changes for boot/boot_serial/test/src/boot_test.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@
#include "crc/crc16.h"
#include "testutil/testutil.h"
#include "hal/hal_flash.h"
#include "flash_map/flash_map.h"
#include "flash_map_backend/flash_map_backend.h"

#include "boot_serial_priv.h"

+1 −1
Changes for boot/boot_serial/test/src/boot_test.h: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@
#include "crc/crc16.h"
#include "testutil/testutil.h"
#include "hal/hal_flash.h"
#include "flash_map/flash_map.h"
#include "flash_map_backend/flash_map_backend.h"

#include "boot_serial_priv.h"

+1 −1
Changes for boot/bootutil/pkg.yml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ pkg.deps:
    - "@apache-mynewt-core/hw/hal"
    - "@apache-mynewt-core/kernel/os"
    - "@apache-mynewt-core/sys/defs"
    - "@apache-mynewt-core/sys/flash_map"
    - "@mcuboot/boot/mynewt/flash_map_backend"

pkg.deps.BOOTUTIL_USE_MBED_TLS:
    - "@apache-mynewt-core/crypto/mbedtls"
Loading