Commit f91bca51 authored by Marti Bolivar's avatar Marti Bolivar Committed by Fabio Utzig
Browse files

Mandate the presence of mcuboot_config/mcuboot_config.h

Mynewt uses this file to convert MYNEWT_VAL(xxx) to MCUBOOT_xxx config
options. Zephyr currently adds config options via the compiler command
line, but it should use this instead.

As prep work for that conversion, add an empty mcuboot_config.h to the
Zephyr port, and include this file unconditionally wherever it's
needed. This takes care of the simulator as well, since that puts
boot/zephyr/include on its C file include path.

This turned up a couple of files (bootutil_priv.h and caps.c) that
were using the MCUBOOT_xxx config values without including the
file. Add the includes there, as they'll be needed later.

To make this official, add it to the requirements in the porting guide
and provide a template file porters can use while getting started.

Signed-off-by: default avatarMarti Bolivar <marti@opensourcefoundries.com>

fixup! Mandate the presence of mcuboot_config/mcuboot_config.h
parent bc2fa4e1
Loading
Loading
Loading
Loading
−2
Changes for boot/bootutil/include/bootutil/sha256.h: 0 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -29,9 +29,7 @@
#ifndef __BOOTUTIL_CRYPTO_H_
#define __BOOTUTIL_CRYPTO_H_

#ifdef MCUBOOT_MYNEWT
#include "mcuboot_config/mcuboot_config.h"
#endif

#if defined(MCUBOOT_USE_MBED_TLS) && defined(MCUBOOT_USE_TINYCRYPT)
    #error "Cannot define both MBED_TLS and TINYCRYPT"
+1
Changes for boot/bootutil/src/bootutil_priv.h: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include "sysflash/sysflash.h"
#include "flash_map/flash_map.h"
#include "bootutil/image.h"
#include "mcuboot_config/mcuboot_config.h"

#ifdef __cplusplus
extern "C" {
+1
Changes for boot/bootutil/src/caps.c: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */

#include <bootutil/caps.h>
#include "mcuboot_config/mcuboot_config.h"

uint32_t bootutil_get_caps(void)
{
−2
Changes for boot/bootutil/src/image_ec.c: 0 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -19,9 +19,7 @@

#include <string.h>

#ifdef MCUBOOT_MYNEWT
#include "mcuboot_config/mcuboot_config.h"
#endif

#ifdef MCUBOOT_SIGN_EC
#include "bootutil/sign_key.h"
−2
Changes for boot/bootutil/src/image_ec256.c: 0 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -19,9 +19,7 @@

#include <string.h>

#ifdef MCUBOOT_MYNEWT
#include "mcuboot_config/mcuboot_config.h"
#endif

#ifdef MCUBOOT_SIGN_EC256
#include "bootutil/sign_key.h"
Loading