Boot: Remove forked MCUboot from TF-M
Remove the generic MCUboot source files from TF-M in order to
rely only on upstream MCUboot project as a secure second stage
bootloader. At this point all the features from the internal
fork are already upstreamed to the original project so from
feature point of view the switch is seamless. From now on
any new development is going to be directly upstreamed to the
original project.
Some platform and project specific files and scripts are still
kept in the bl2/ext/mcuboot folder to make possible the integration
with TF-M project.
Signed-off-by: Balint Matyi <Balint.Matyi@arm.com>
Signed-off-by: Tamas Ban <Tamas.Ban@arm.com>
Change-Id: I261c11383202d02eecff06c21d5c51d6ec8f27ea
diff --git a/bl2/ext/mcuboot/include/bl2_util.h b/bl2/ext/mcuboot/include/bl2_util.h
deleted file mode 100644
index ea8df98..0000000
--- a/bl2/ext/mcuboot/include/bl2_util.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2011-2014, Wind River Systems, Inc.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-#ifndef __BL2_UTIL_H__
-#define __BL2_UTIL_H__
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#include <stddef.h>
-
- /* Evaluates to 0 if cond is true-ish; compile error otherwise */
-#define ZERO_OR_COMPILE_ERROR(cond) ((int) sizeof(char[1 - 2 * !(cond)]) - 1)
-
- /* Evaluates to 0 if array is an array; compile error if not array (e.g.
- * pointer)
- */
-#if defined(NO_TYPEOF)
- /* __typeof__ is a non-standard gcc extension, not universally available.
- * As this is just compile time data type test, assume things are ok for
- * tool chains missing this feature.
- */
-#define IS_ARRAY(array) 0
-#else
-#define IS_ARRAY(array) \
- ZERO_OR_COMPILE_ERROR(!__builtin_types_compatible_p(__typeof__(array), \
- __typeof__(&(array)[0])))
-#endif
-
-#define ARRAY_SIZE(array) \
- ((unsigned long) (IS_ARRAY(array) + \
- (sizeof(array) / sizeof((array)[0]))))
-
-#define CONTAINER_OF(ptr, type, field) \
- ((type *)(((char *)(ptr)) - offsetof(type, field)))
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __BL2_UTIL_H__ */
-
diff --git a/bl2/ext/mcuboot/include/config-rsa.h b/bl2/ext/mcuboot/include/mcuboot-mbedtls-cfg.h
similarity index 95%
rename from bl2/ext/mcuboot/include/config-rsa.h
rename to bl2/ext/mcuboot/include/mcuboot-mbedtls-cfg.h
index c345245..7e52d34 100644
--- a/bl2/ext/mcuboot/include/config-rsa.h
+++ b/bl2/ext/mcuboot/include/mcuboot-mbedtls-cfg.h
@@ -33,8 +33,8 @@
* - RSA signature verification
*/
-#ifndef MCUBOOT_MBEDTLS_CONFIG_RSA
-#define MCUBOOT_MBEDTLS_CONFIG_RSA
+#ifndef __MCUBOOT_MBEDTLS_CFG__
+#define __MCUBOOT_MBEDTLS_CFG__
/* System support */
#define MBEDTLS_PLATFORM_C
@@ -85,4 +85,4 @@
#include "mbedtls/check_config.h"
-#endif /* MCUBOOT_MBEDTLS_CONFIG_RSA */
+#endif /* __MCUBOOT_MBEDTLS_CFG__ */
diff --git a/bl2/ext/mcuboot/include/security_cnt.h b/bl2/ext/mcuboot/include/security_cnt.h
deleted file mode 100644
index 7c17a94..0000000
--- a/bl2/ext/mcuboot/include/security_cnt.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-#ifndef __SECURITY_CNT_H__
-#define __SECURITY_CNT_H__
-
-/**
- * @file security_cnt.h
- *
- * @note The interface must be implemented in a fail-safe way that is
- * resistant to asynchronous power failures or it can use hardware
- * counters that have this capability, if supported by the platform.
- * When a counter incrementation was interrupted it must be able to
- * continue the incrementation process or recover the previous consistent
- * status of the counters. If the counters have reached a stable status
- * (every counter incrementation operation has finished), from that point
- * their value cannot decrease due to any kind of power failure.
- */
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Initialises the security counters.
- *
- * @return 0 on success; nonzero on failure.
- */
-int32_t boot_nv_security_counter_init(void);
-
-/**
- * Reads the stored value of a given image's security counter.
- *
- * @param image_id Index of the image (from 0).
- * @param security_cnt Pointer to store the security counter value.
- *
- * @return 0 on success; nonzero on failure.
- */
-int32_t boot_nv_security_counter_get(uint32_t image_id, uint32_t *security_cnt);
-
-/**
- * Updates the stored value of a given image's security counter with a new
- * security counter value if the new one is greater.
- *
- * @param image_id Index of the image (from 0).
- * @param img_security_cnt New security counter value. The new value must be
- * between 0 and UINT32_MAX and it must be greater than
- * or equal to the current security counter value.
- *
- * @return 0 on success; nonzero on failure.
- */
-int32_t boot_nv_security_counter_update(uint32_t image_id,
- uint32_t img_security_cnt);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __SECURITY_CNT_H__ */