Commit 61038df3 authored by Marti Bolivar's avatar Marti Bolivar
Browse files

zephyr: move nRF5 target config into soc_family_nrf5.h

All of the information we need is in DTS or is the same across all
boards in the SoC family. There's no need for board-specific headers
for these targets.

Signed-off-by: default avatarMarti Bolivar <marti.bolivar@linaro.org>
parent 2da23ebc
Loading
Loading
Loading
Loading
+8 −4
Changes for README-zephyr.rst: 8 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -23,10 +23,14 @@ if slot0 should be validated on every boot.
There is a ``build_boot.sh`` script at the top level that can make
building a bit easier.  It assumes that the mcuboot tree is next to,
at the same level, as the zephyr source tree.  It takes a single
argument, which is the target to build.  This must match one of the
targets in ``boot/zephyr/targets`` to be a supported board. Additionally,
the Zephyr Device Tree board definition in ``dts/<arch>/<board>.dts``  must
contain the flash partitions description.
argument, which is the target to build. This must be a Zephyr board
which supports mcuboot.

To support mcuboot, a Zephyr board needs to provide data about the
flash driver and image layout. This is centralized in
boot/zephyr/include/target.h. Depending on the board, this information
may come from board-specfic headers, Device Tree, or be configured by
mcuboot on a per-SoC family basis.

Once this is finished building, the bootloader should reside in
``outdir/targname/zephyr.[bin|hex]``.  Use the flashing tools you have to
+2
Changes for boot/zephyr/Makefile: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
ifneq ($(wildcard $(PROJECT)/boot/zephyr/targets/$(BOARD).h),)
subdir-ccflags-y += -DMCUBOOT_TARGET_CONFIG='"$(BOARD).h"'
endif
subdir-ccflags-y += -I$(PROJECT)/boot/bootutil/include
subdir-ccflags-y += -I$(PROJECT)/boot/zephyr/include
subdir-ccflags-y += -I$(PROJECT)/boot/zephyr/targets
+16 −2
Changes for boot/zephyr/include/target.h: 16 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -9,8 +9,6 @@
/* Board-specific definitions go first, to allow maximum override. */
#if defined(MCUBOOT_TARGET_CONFIG)
#include MCUBOOT_TARGET_CONFIG
#else
#error "Board is currently not supported by bootloader"
#endif

/* SoC family configuration. */
@@ -18,4 +16,20 @@
#include "soc_family_nrf5.h"
#endif

/*
 * This information can come from DTS, a target-specific header file,
 * or an SoC-specific header file. If any of it is missing, target
 * support is incomplete.
 */
#if !defined(FLASH_DRIVER_NAME) || \
    !defined(FLASH_ALIGN) ||                  \
    !defined(FLASH_AREA_IMAGE_0_OFFSET) || \
    !defined(FLASH_AREA_IMAGE_0_SIZE) || \
    !defined(FLASH_AREA_IMAGE_1_OFFSET) || \
    !defined(FLASH_AREA_IMAGE_1_SIZE) || \
    !defined(FLASH_AREA_IMAGE_SCRATCH_OFFSET) || \
    !defined(FLASH_AREA_IMAGE_SCRATCH_SIZE)
#error "Target support is incomplete; cannot build mcuboot."
#endif

#endif
−24

File deleted.

−9

File deleted.

Loading