diff options
author | Amit Daniel Kachhap <amit.kachhap@arm.com> | 2018-07-23 14:01:04 +0530 |
---|---|---|
committer | ronald-cron-arm <39518861+ronald-cron-arm@users.noreply.github.com> | 2018-10-18 17:22:34 +0000 |
commit | b4b1fc161c3114d8f1e2578645e5252f6bd0c4c3 (patch) | |
tree | 0ed88546a9bfc1a3a929af04cac9e077afafb6a6 /product/sgi575 | |
parent | d6e40d31188cd11071b2e9422f60e2bf972eba39 (diff) |
sgi575/scp_ramfw: Enable multi-threading
Change-Id: Ibc567fe4c05816ff36655160d147e9b9f0311487
Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com>
Diffstat (limited to 'product/sgi575')
-rw-r--r-- | product/sgi575/scp_ramfw/RTX_Config.h | 56 | ||||
-rw-r--r-- | product/sgi575/scp_ramfw/firmware.mk | 3 | ||||
-rw-r--r-- | product/sgi575/scp_ramfw/rtx_config.c | 35 |
3 files changed, 93 insertions, 1 deletions
diff --git a/product/sgi575/scp_ramfw/RTX_Config.h b/product/sgi575/scp_ramfw/RTX_Config.h new file mode 100644 index 00000000..fa9dbda8 --- /dev/null +++ b/product/sgi575/scp_ramfw/RTX_Config.h @@ -0,0 +1,56 @@ +/* + * Arm SCP/MCP Software + * Copyright (c) 2018, Arm Limited and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Description: + * RTX2 v5 configuration file. + * The file must be called RTX_Config.h as it is included by a RTX file + * in order to create an object file containing the configuration. + */ + +#ifndef RTX_CONFIG_H_ +#define RTX_CONFIG_H_ + +/* System */ +#define OS_DYNAMIC_MEM_SIZE 0 +#define OS_TICK_FREQ 1000 /* Hz */ +#define OS_ROBIN_ENABLE 0 +#define OS_ROBIN_TIMEOUT 0 +#define OS_ISR_FIFO_QUEUE 16 + +/* Thread */ +#define OS_THREAD_OBJ_MEM 0 +#define OS_THREAD_NUM 1 +#define OS_THREAD_DEF_STACK_NUM 0 +#define OS_THREAD_USER_STACK_SIZE 0 +#define OS_STACK_SIZE 200 +#define OS_IDLE_THREAD_STACK_SIZE 200 +#define OS_STACK_CHECK 1 +#define OS_STACK_WATERMARK 0 +#define OS_PRIVILEGE_MODE 1 + +/* Timer */ +#define OS_TIMER_OBJ_MEM 0 +#define OS_TIMER_NUM 1 +#define OS_TIMER_THREAD_PRIO 40 +#define OS_TIMER_THREAD_STACK_SIZE 200 +#define OS_TIMER_CB_QUEUE 4 + +/* Event flags */ +#define OS_EVFLAGS_OBJ_MEM 0 +#define OS_EVFLAGS_NUM 1 + +#define OS_MUTEX_OBJ_MEM 0 +#define OS_MUTEX_NUM 1 +#define OS_SEMAPHORE_OBJ_MEM 0 +#define OS_SEMAPHORE_NUM 1 +#define OS_MEMPOOL_OBJ_MEM 0 +#define OS_MEMPOOL_NUM 1 +#define OS_MEMPOOL_DATA_SIZE 0 +#define OS_MSGQUEUE_OBJ_MEM 0 +#define OS_MSGQUEUE_NUM 1 +#define OS_MSGQUEUE_DATA_SIZE 0 + +#endif /* RTX_CONFIG_H_ */ diff --git a/product/sgi575/scp_ramfw/firmware.mk b/product/sgi575/scp_ramfw/firmware.mk index 005aa29f..43ccb7fb 100644 --- a/product/sgi575/scp_ramfw/firmware.mk +++ b/product/sgi575/scp_ramfw/firmware.mk @@ -6,7 +6,7 @@ # BS_FIRMWARE_CPU := cortex-m7 -BS_FIRMWARE_HAS_MULTITHREADING := no +BS_FIRMWARE_HAS_MULTITHREADING := yes BS_FIRMWARE_HAS_NOTIFICATION := yes BS_FIRMWARE_MODULE_HEADERS_ONLY := \ power_domain \ @@ -18,6 +18,7 @@ BS_FIRMWARE_MODULES := \ clock BS_FIRMWARE_SOURCES := \ + rtx_config.c \ config_log.c \ config_clock.c diff --git a/product/sgi575/scp_ramfw/rtx_config.c b/product/sgi575/scp_ramfw/rtx_config.c new file mode 100644 index 00000000..bce3ba4b --- /dev/null +++ b/product/sgi575/scp_ramfw/rtx_config.c @@ -0,0 +1,35 @@ +/* + * Arm SCP/MCP Software + * Copyright (c) 2018, Arm Limited and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <stdbool.h> +#include <stdint.h> +#include <cmsis_compiler.h> +#include <rtx_lib.c> +#include <rtx_os.h> +#include <system_clock.h> + +/* + * Required by RTX to configure the SysTick timer. + */ +uint32_t SystemCoreClock = CLOCK_RATE_REFCLK; + +/* + * Idle thread + */ +__NO_RETURN void osRtxIdleThread(void *argument) +{ + while (true) + __WFI(); +} + +/* + * OS error handler + */ +uint32_t osRtxErrorNotify(uint32_t code, void *object_id) +{ + osRtxIdleThread(object_id); +} |