-
Notifications
You must be signed in to change notification settings - Fork 1
Add ra6m4 support lib #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: ra_tfm_v1_1_bl2_integration
Are you sure you want to change the base?
Changes from all commits
8e5a1d5
631ce20
b01808a
fdc151a
efd2b64
4c6a841
6d9d7c0
c44396d
b942fa3
0d137c3
77cb804
e54ca19
19a2ba1
bbb3512
a1ff592
e2df43d
c45ec39
e338a01
e9f3890
43b9c02
d83ab44
d03d73c
4b706c8
f710ac1
72ada55
e2de802
f73cc4f
f3d62aa
1da1c84
622358d
0ff7c92
e6835df
4dfd933
da94211
8ec7d78
00747d6
8336ff2
1f9bf1b
9a31697
d2d1d22
0786907
eb66c84
c92af1e
7374813
acf934d
6d411c5
c4c01cd
0d08c30
3f6fe4a
685b5fc
197debb
0ed08b6
c165c35
89ecf72
754f39e
a02f0d3
df6d6b1
712b9cd
82515b8
7c81ae3
c8bfa44
2099bed
f79c804
0d356fa
417204b
808b907
aecbbf7
67adb02
4a48bf0
b418aad
4b5b3f9
94c6e86
0ed4c0d
962792f
1c05235
f8d9cef
8177481
361e061
c4b9341
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| /* | ||
| * Copyright (c) 2019-2020, Arm Limited. All rights reserved. | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
| * this software and associated documentation files (the "Software"), to deal in | ||
| * the Software without restriction, including without limitation the rights to | ||
| * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
| * the Software, and to permit persons to whom the Software is furnished to do so, | ||
| * subject to the following conditions: | ||
| * | ||
| * The above copyright notice and this permission notice shall be included in all | ||
| * copies or substantial portions of the Software. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
| * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
| * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
| * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
| * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| * | ||
| */ | ||
|
|
||
| /* | ||
| * This file contains the implementation of APIs which are defined in | ||
| * os_wrapper/mutex.h by TF-M(tag: TF-Mv1.1). The implementation is based | ||
| * on FreeRTOS mutex type semaphore. | ||
| */ | ||
|
|
||
| #include "os_wrapper/mutex.h" | ||
|
|
||
| #include "FreeRTOS.h" | ||
| #include "semphr.h" | ||
| #include "mpu_wrappers.h" | ||
|
|
||
| #if( configSUPPORT_STATIC_ALLOCATION == 1 ) | ||
| /* | ||
| * In the static allocation, the RAM is required to hold the semaphore's | ||
| * state. | ||
| */ | ||
| StaticSemaphore_t xSecureMutexBuffer; | ||
| #endif | ||
|
|
||
| void * os_wrapper_mutex_create( void ) | ||
| { | ||
| SemaphoreHandle_t xMutexHandle = NULL; | ||
|
|
||
| #if( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) | ||
| xMutexHandle = xSemaphoreCreateMutex(); | ||
| #elif( configSUPPORT_STATIC_ALLOCATION == 1 ) | ||
| xMutexHandle = xSemaphoreCreateMutexStatic( &xSecureMutexBuffer ); | ||
| #endif | ||
| return ( void * ) xMutexHandle; | ||
| } | ||
| /*-----------------------------------------------------------*/ | ||
|
|
||
| uint32_t os_wrapper_mutex_acquire( void * handle, uint32_t timeout ) | ||
| { | ||
| BaseType_t xRet; | ||
|
|
||
| if( ! handle ) | ||
| return OS_WRAPPER_ERROR; | ||
|
|
||
| xRet = xSemaphoreTake( ( SemaphoreHandle_t ) handle, | ||
| ( timeout == OS_WRAPPER_WAIT_FOREVER ) ? | ||
| portMAX_DELAY : ( TickType_t ) timeout ); | ||
|
|
||
| if( xRet != pdPASS ) | ||
| return OS_WRAPPER_ERROR; | ||
| else | ||
| return OS_WRAPPER_SUCCESS; | ||
| } | ||
| /*-----------------------------------------------------------*/ | ||
|
|
||
| uint32_t os_wrapper_mutex_release( void * handle ) | ||
| { | ||
| BaseType_t xRet; | ||
|
|
||
| if( !handle ) | ||
| return OS_WRAPPER_ERROR; | ||
|
|
||
| xRet = xSemaphoreGive( ( SemaphoreHandle_t ) handle ); | ||
|
|
||
| if( xRet != pdPASS ) | ||
| return OS_WRAPPER_ERROR; | ||
| else | ||
| return OS_WRAPPER_SUCCESS; | ||
| } | ||
| /*-----------------------------------------------------------*/ | ||
|
|
||
| uint32_t os_wrapper_mutex_delete( void * handle ) | ||
| { | ||
| vSemaphoreDelete( ( SemaphoreHandle_t ) handle ); | ||
|
|
||
| return OS_WRAPPER_SUCCESS; | ||
| } | ||
| /*-----------------------------------------------------------*/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ | |
| */ | ||
|
|
||
| #include <string.h> | ||
| #include "rm_bl2_cfg.h" | ||
|
|
||
| #include "mcuboot_config/mcuboot_config.h" | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,9 +26,7 @@ | |
| */ | ||
| #define IS_ARRAY(array) 0 | ||
| #else | ||
| #define IS_ARRAY(array) \ | ||
| ZERO_OR_COMPILE_ERROR(!__builtin_types_compatible_p(__typeof__(array), \ | ||
| __typeof__(&(array)[0]))) | ||
| #define IS_ARRAY(array) 0 | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check this |
||
| #endif | ||
|
|
||
| #define ARRAY_SIZE(array) \ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| /* | ||
| * Copyright (c) 2018 Open Source Foundries Limited | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @AjayN93 to check if necessary |
||
| * Copyright (c) 2019 Arm Limited | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| /* | ||
| * Original code taken from mcuboot project at: | ||
| * https://github.com/JuulLabs-OSS/mcuboot | ||
| * Git SHA of the original version: ac55554059147fff718015be9f4bd3108123f50a | ||
| */ | ||
|
|
||
| #ifndef __MCUBOOT_CONFIG_H__ | ||
| #define __MCUBOOT_CONFIG_H__ | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
| /* | ||
| * This file is also included by the simulator, but we don't want to | ||
| * define anything here in simulator builds. | ||
| * | ||
| * Instead of using mcuboot_config.h, the simulator adds MCUBOOT_xxx | ||
| * configuration flags to the compiler command lines based on the | ||
| * values of environment variables. However, the file still must | ||
| * exist, or bootutil won't build. | ||
| */ | ||
| #ifndef __BOOTSIM__ | ||
|
|
||
| /* | ||
| * In TF-M most of the configuration flags (e.g. signature type, | ||
| * upgrade mode ...) are handled by the CMake-based buildsystem and | ||
| * added to the compiler command lines. | ||
| */ | ||
|
|
||
| /* | ||
| * Cryptographic settings | ||
| */ | ||
| #define MCUBOOT_USE_MBED_TLS | ||
|
|
||
| /* | ||
| * Logging | ||
| */ | ||
| #define MCUBOOT_HAVE_LOGGING 1 | ||
|
|
||
| #endif /* !__BOOTSIM__ */ | ||
|
|
||
| /* | ||
| * Maximum size of the measured boot record. | ||
| * | ||
| * Its size can be calculated based on the following aspects: | ||
| * - There are 5 allowed software component claims, | ||
| * - SHA256 is used as the measurement method for the other claims. | ||
| * Considering these aspects, the only claim which size can vary is the type | ||
| * of the software component with a maximum length of 12 bytes, which means | ||
| * the boot record size can be up to 100 bytes. | ||
| */ | ||
| #define MAX_BOOT_RECORD_SZ (100u) | ||
|
|
||
| /* | ||
| * Watchdog feeding | ||
| */ | ||
| #define MCUBOOT_WATCHDOG_FEED() \ | ||
| do { \ | ||
| /* Do nothing. */ \ | ||
| } while (0) | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| #endif /* __MCUBOOT_CONFIG_H__ */ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,6 +62,7 @@ boot_add_data_to_shared_area(uint8_t major_type, | |
| size_t size, | ||
| const uint8_t *data) | ||
| { | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be removed. |
||
| #ifdef BOOT_DATA_AVAILABLE | ||
| struct shared_data_tlv_entry tlv_entry = {0}; | ||
| struct tfm_boot_data *boot_data; | ||
| uint8_t *next_tlv; | ||
|
|
@@ -120,6 +121,8 @@ boot_add_data_to_shared_area(uint8_t major_type, | |
|
|
||
| boot_data->header.tlv_tot_len += tlv_entry.tlv_len; | ||
|
|
||
| #endif /* BOOT_DATA_AVAILABLE */ | ||
|
|
||
| return SHARED_MEMORY_OK; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file to be deleted