aboutsummaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorJamie McCrae <jamie.mccrae@lairdconnect.com>2021-05-04 08:57:47 +0100
committerKen Liu <ken.liu@arm.com>2021-05-06 10:35:57 +0200
commitc129828282028d946ad9e317123984f3768bdf38 (patch)
tree18aa9730bfdff648200d2c5b50ccb4b6d8cae0b1 /platform
parenta1f68964a4f6f155b88b9cd662327f386db67bc3 (diff)
downloadtrusted-firmware-m-c129828282028d946ad9e317123984f3768bdf38.tar.gz
Platform: bl5340: Update platform with minor fixes
This adds a missing .c service file for the Laird Connectivity BL5340 build target and fixes some minor issues when using a Zephyr application Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com> Change-Id: I345ad92b52b1372513fb00e5e087dbcc536569b7
Diffstat (limited to 'platform')
-rw-r--r--platform/ext/target/lairdconnectivity/bl5340_dvk_cpuapp/services/src/tfm_platform_system.c27
-rw-r--r--platform/ext/target/lairdconnectivity/common/bl5340/partition/region_defs.h5
-rw-r--r--platform/ext/target/lairdconnectivity/common/bl5340/target_cfg.c5
-rw-r--r--platform/ext/target/lairdconnectivity/common/core/plat_test.c1
4 files changed, 35 insertions, 3 deletions
diff --git a/platform/ext/target/lairdconnectivity/bl5340_dvk_cpuapp/services/src/tfm_platform_system.c b/platform/ext/target/lairdconnectivity/bl5340_dvk_cpuapp/services/src/tfm_platform_system.c
new file mode 100644
index 000000000..1b115fc46
--- /dev/null
+++ b/platform/ext/target/lairdconnectivity/bl5340_dvk_cpuapp/services/src/tfm_platform_system.c
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2019, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#include "platform/include/tfm_platform_system.h"
+#include "cmsis.h"
+
+void tfm_platform_hal_system_reset(void)
+{
+ /* Reset the system */
+ NVIC_SystemReset();
+}
+
+enum tfm_platform_err_t tfm_platform_hal_ioctl(tfm_platform_ioctl_req_t request,
+ psa_invec *in_vec,
+ psa_outvec *out_vec)
+{
+ (void)request;
+ (void)in_vec;
+ (void)out_vec;
+
+ /* Not needed for this platform */
+ return TFM_PLATFORM_ERR_NOT_SUPPORTED;
+}
diff --git a/platform/ext/target/lairdconnectivity/common/bl5340/partition/region_defs.h b/platform/ext/target/lairdconnectivity/common/bl5340/partition/region_defs.h
index 58dcc3970..281a29d9f 100644
--- a/platform/ext/target/lairdconnectivity/common/bl5340/partition/region_defs.h
+++ b/platform/ext/target/lairdconnectivity/common/bl5340/partition/region_defs.h
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2017-2020 Arm Limited. All rights reserved.
* Copyright (c) 2020 Nordic Semiconductor ASA. All rights reserved.
+ * Copyright (c) 2021 Laird Connectivity. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -42,7 +43,7 @@
#define PSA_INITIAL_ATTEST_TOKEN_MAX_SIZE (0x250)
/*
- * SPU flash region granularity is 32 KB on nRF5340. Alignment
+ * SPU flash region granularity is 16KB on nRF5340. Alignment
* of partitions is defined in accordance with this constraint.
*/
#ifdef BL2
@@ -104,7 +105,7 @@
#define S_CODE_LIMIT (S_CODE_START + S_CODE_SIZE - 1)
#define S_DATA_START (S_RAM_ALIAS(0x0))
-#define S_DATA_SIZE ((TOTAL_RAM_SIZE / 4) * 3)
+#define S_DATA_SIZE (TOTAL_RAM_SIZE / 2)
#define S_DATA_LIMIT (S_DATA_START + S_DATA_SIZE - 1)
/* The CMSE veneers shall be placed in an NSC region
diff --git a/platform/ext/target/lairdconnectivity/common/bl5340/target_cfg.c b/platform/ext/target/lairdconnectivity/common/bl5340/target_cfg.c
index 7dd55b598..a5734e757 100644
--- a/platform/ext/target/lairdconnectivity/common/bl5340/target_cfg.c
+++ b/platform/ext/target/lairdconnectivity/common/bl5340/target_cfg.c
@@ -152,7 +152,12 @@ enum tfm_plat_err_t nvic_interrupt_target_state_cfg(void)
NVIC_ClearTargetState(NRFX_IRQ_NUMBER_GET(NRF_UARTE1));
#endif
+#ifdef CORE_TEST_INTERACTIVE
+ /* TWIM2 is a secure peripheral for the interactive test, so its IRQ has
+ * to target S state
+ */
NVIC_ClearTargetState(NRFX_IRQ_NUMBER_GET(NRF_TWIM2));
+#endif
return TFM_PLAT_ERR_SUCCESS;
}
diff --git a/platform/ext/target/lairdconnectivity/common/core/plat_test.c b/platform/ext/target/lairdconnectivity/common/core/plat_test.c
index 99a1a47bb..6f5f9a010 100644
--- a/platform/ext/target/lairdconnectivity/common/core/plat_test.c
+++ b/platform/ext/target/lairdconnectivity/common/core/plat_test.c
@@ -273,7 +273,6 @@ void tfm_plat_test_set_led_status(uint32_t status)
uint32_t tfm_plat_test_get_userled_mask(void)
{
-#warning "check this"
return PORT_EXPANDER_LED1_IO;
}