Commit Graph

8 Commits

Author SHA1 Message Date
Marti Bolivar 1011b433c2 zephyr: flash_map: fix up logging
The Zephyr log backend already prepends the function, so it's
redundant to do it here.

Also convert a stray SYS_LOG_ERR to BOOT_LOG_ERR().

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-03-20 09:00:58 -04:00
Marti Bolivar 53cfdb9988 zephyr: fix flash_area_erase()
Flash must be unlocked before it can be erased.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-02-10 15:33:14 -08:00
Marti Bolivar 4a97b4c0b1 boot: zephyr: use bootutil_log.h, not sys_log.h
Now that mcuboot has its own logging subsystem, use that instead.

Note that this changes the domain from "[BOOTLOADER]" to "[MCUBOOT]".

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-02-07 16:59:50 -05:00
Michael Scott de6ee59daf zephyr: generate mutliple records in flash_map when required
Currently, the flash map is a single entry sized to fit the
FLASH_AREA_IMAGE_0_SIZE.  This works for HW where
FLASH_AREA_IMAGE_SCRATCH_SIZE is the same or larger than
FLASH_AREA_IMAGE_0_SIZE.

However, if FLASH_AREA_IMAGE_SCRATCH_SIZE is smaller than
FLASH_AREA_IMAGE_0_SIZE, we need to generate enough write blocks in the
flash_map so that each will fit in FLASH_AREA_IMAGE_SCRATCH_SIZE.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 16:25:14 -08:00
Michael Scott e12746c4a2 zephyr: flash HAL requires flash_write_protection_set() calls
In Zephyr there is a flash HAL function: flash_write_protection_set()
which for many SoCs is a stubbed function with no functionality,
but for others performs the unlock / lock procedures required before
writing to flash.

We need to add this function to our flash_area_write() wrapper
to support the hardware that requires it.

This fixes mcuboot flash writing for the nRF5x SoCs.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 16:25:14 -08:00
Ricardo Salveti 7cf3d9ec91 zephyr: use SYS_LOG instead of printk
Easier to manage and can be easily disabled via config.

Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-01-19 19:51:35 -02:00
Ricardo Salveti 3a2c1242f1 zephyr: restructure the build process to use board config files
Move the board specific configurations into its own header file, which
can now be created per board, once it gets tested and validated by the
bootloader.

Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-01-19 10:26:40 -02:00
David Brown 299245d7de zephyr: Move code under 'boot' directory
The Zephyr build systems makes some assumptions about the directory
layout, and encounters problems if the necessary path contains "../..".
To help this, place the zephyr directory next to the bootutil directory
so that the Makefile can just refer to "../bootutil".  This keeps all of
the build artifacts under the proper top-level directory.
2017-01-10 09:49:47 -07:00