From 01cb85d637c7cbf912de336a068456f7f94d3401 Mon Sep 17 00:00:00 2001 From: wangxiaodong1030 Date: Thu, 4 Sep 2025 14:18:19 +0800 Subject: [PATCH] update sdk --- docs/ChangeLog.md | 28 + drivers/port/dlist.h | 592 ++++++++++++++++ drivers/port/fdrivers_port.c | 6 + drivers/port/fdrivers_port.h | 52 ++ example/freertos_feature/eventgroup/sdkconfig | 3 + .../freertos_feature/eventgroup/sdkconfig.h | 3 + example/freertos_feature/interrupt/sdkconfig | 3 + .../freertos_feature/interrupt/sdkconfig.h | 3 + example/freertos_feature/queue/sdkconfig | 3 + example/freertos_feature/queue/sdkconfig.h | 3 + example/freertos_feature/resource/sdkconfig | 3 + example/freertos_feature/resource/sdkconfig.h | 3 + .../freertos_feature/software_timer/sdkconfig | 3 + .../software_timer/sdkconfig.h | 3 + example/freertos_feature/task/sdkconfig | 3 + example/freertos_feature/task/sdkconfig.h | 3 + .../freertos_feature/task_notify/sdkconfig | 3 + .../freertos_feature/task_notify/sdkconfig.h | 3 + example/network/lwip_https/sdkconfig | 7 + example/network/lwip_https/sdkconfig.h | 7 + example/network/lwip_iperf/sdkconfig | 38 +- example/network/lwip_iperf/sdkconfig.h | 38 +- .../pd1904_aarch32_dsk_lwip_startup.config | 1 + .../pd1904_aarch64_dsk_lwip_startup.config | 1 + .../pd2008_aarch32_test_lwip_startup.config | 1 + .../pd2008_aarch64_test_lwip_startup.config | 1 + example/network/lwip_startup/sdkconfig | 40 +- example/network/lwip_startup/sdkconfig.h | 40 +- .../network/sockets/udp_multicast/sdkconfig | 7 + .../network/sockets/udp_multicast/sdkconfig.h | 7 + example/network/wlan/sdkconfig | 7 + example/network/wlan/sdkconfig.h | 7 + example/peripheral/can/can/sdkconfig | 7 + example/peripheral/can/can/sdkconfig.h | 7 + example/peripheral/can/canfd/sdkconfig | 7 + example/peripheral/can/canfd/sdkconfig.h | 7 + example/peripheral/dma/ddma/sdkconfig | 7 + example/peripheral/dma/ddma/sdkconfig.h | 7 + example/peripheral/dma/gdma/sdkconfig | 7 + example/peripheral/dma/gdma/sdkconfig.h | 7 + example/peripheral/gpio/sdkconfig | 3 + example/peripheral/gpio/sdkconfig.h | 3 + example/peripheral/i2c/i2c/sdkconfig | 7 + example/peripheral/i2c/i2c/sdkconfig.h | 7 + example/peripheral/i2c/i2c_msg/sdkconfig | 3 + example/peripheral/i2c/i2c_msg/sdkconfig.h | 3 + example/peripheral/i2s/sdkconfig | 7 + example/peripheral/i2s/sdkconfig.h | 7 + example/peripheral/media/lvgl_demo/sdkconfig | 2 + .../peripheral/media/lvgl_demo/sdkconfig.h | 2 + example/peripheral/media/lvgl_indev/sdkconfig | 2 + .../peripheral/media/lvgl_indev/sdkconfig.h | 2 + example/peripheral/media/lvgl_ui/sdkconfig | 2 + example/peripheral/media/lvgl_ui/sdkconfig.h | 2 + example/peripheral/media/media_test/sdkconfig | 2 + .../peripheral/media/media_test/sdkconfig.h | 2 + example/peripheral/pwm/sdkconfig | 3 + example/peripheral/pwm/sdkconfig.h | 3 + example/peripheral/qspi/sdkconfig | 3 + example/peripheral/qspi/sdkconfig.h | 3 + example/peripheral/sdif/sdkconfig | 3 + example/peripheral/sdif/sdkconfig.h | 3 + example/peripheral/spi/sdkconfig | 3 + example/peripheral/spi/sdkconfig.h | 3 + example/peripheral/timer_tacho/sdkconfig | 7 + example/peripheral/timer_tacho/sdkconfig.h | 7 + example/peripheral/usb/usb_device/sdkconfig | 3 + example/peripheral/usb/usb_device/sdkconfig.h | 3 + example/peripheral/usb/usb_host/makefile | 4 +- example/peripheral/usb/usb_host/sdkconfig | 3 + example/peripheral/usb/usb_host/sdkconfig.h | 3 + example/peripheral/wdt/sdkconfig | 3 + example/peripheral/wdt/sdkconfig.h | 3 + example/storage/fatfs/sdkconfig | 3 + example/storage/fatfs/sdkconfig.h | 3 + example/storage/qspi_spiffs/sdkconfig | 8 + example/storage/qspi_spiffs/sdkconfig.h | 8 + example/storage/spim_spiffs/sdkconfig | 3 + example/storage/spim_spiffs/sdkconfig.h | 3 + .../amp/openamp/common/libmetal_configs.h | 6 +- .../system/amp/openamp/common/memory_layout.h | 30 +- .../amp/openamp/common/openamp_configs.h | 14 +- ...08_aarch32_test_openamp_device_core.config | 1 - ...08_aarch64_test_openamp_device_core.config | 1 - ...08_aarch64_demo_openamp_device_core.config | 1 - ..._aarch64_test_a_openamp_device_core.config | 1 - ...02_aarch32_demo_openamp_device_core.config | 1 - ...02_aarch64_demo_openamp_device_core.config | 1 - ...04_aarch32_demo_openamp_device_core.config | 1 - ...rch32_phytiumpi_openamp_device_core.config | 1 - ...04_aarch64_demo_openamp_device_core.config | 1 - ...rch64_phytiumpi_openamp_device_core.config | 1 - .../amp/openamp/device_core/ft_openamp.ld | 2 +- .../system/amp/openamp/device_core/sdkconfig | 28 +- .../amp/openamp/device_core/sdkconfig.h | 28 +- .../openamp/device_core/src/matrix_multiply.c | 58 +- .../device_core/src/rpmsg-demo-listening.c | 138 ++-- .../device_core/src/rpmsg-nocopy-ping.c | 54 +- .../amp/openamp/device_core/src/rpmsg-ping.c | 54 +- .../device_core/src/rpmsg-sample-ping.c | 48 +- .../system/amp/openamp/driver_core/README.md | 2 +- .../openamp/driver_core/build/amp_packed.c | 0 .../system/amp/openamp/driver_core/sdkconfig | 29 +- .../amp/openamp/driver_core/sdkconfig.h | 29 +- .../driver_core/src/matrix_multiplyd.c | 32 +- .../driver_core/src/rpmsg-demo-manager_cmd.c | 193 +++--- .../amp/openamp/driver_core/src/rpmsg-echo.c | 30 +- .../driver_core/src/rpmsg-nocopy-echo.c | 32 +- .../driver_core/src/rpmsg-sample-echo.c | 30 +- .../common/libmetal_configs.h | 10 +- .../openamp_for_linux/common/memory_layout.h | 24 +- .../common/openamp_configs.h | 2 +- .../amp/openamp_for_linux/ft_openamp.ld | 2 +- .../system/amp/openamp_for_linux/sdkconfig | 2 + .../system/amp/openamp_for_linux/sdkconfig.h | 2 + .../amp/openamp_for_linux/src/rpmsg-echo_os.c | 119 ++-- example/system/atomic/sdkconfig | 3 + example/system/atomic/sdkconfig.h | 3 + example/system/exception_debug/sdkconfig | 3 + example/system/exception_debug/sdkconfig.h | 3 + example/system/nested_interrupt/sdkconfig | 3 + example/system/nested_interrupt/sdkconfig.h | 3 + example/system/posix/sdkconfig | 3 + example/system/posix/sdkconfig.h | 3 + example/template/sdkconfig | 41 +- example/template/sdkconfig.h | 41 +- install.py | 4 +- third-party/freertos/History.txt | 143 +++- third-party/freertos/README.md | 192 +++++ third-party/freertos/croutine.c | 2 +- third-party/freertos/event_groups.c | 11 +- third-party/freertos/include/FreeRTOS.h | 61 +- third-party/freertos/include/StackMacros.h | 2 +- third-party/freertos/include/atomic.h | 2 +- third-party/freertos/include/croutine.h | 5 +- .../freertos/include/deprecated_definitions.h | 2 +- third-party/freertos/include/event_groups.h | 15 +- third-party/freertos/include/list.h | 2 +- third-party/freertos/include/message_buffer.h | 62 +- third-party/freertos/include/mpu_prototypes.h | 229 ++++-- .../freertos/include/mpu_syscall_numbers.h | 2 +- third-party/freertos/include/mpu_wrappers.h | 20 +- .../freertos/include/newlib-freertos.h | 2 +- .../freertos/include/picolibc-freertos.h | 2 +- third-party/freertos/include/portable.h | 15 +- third-party/freertos/include/projdefs.h | 2 +- third-party/freertos/include/queue.h | 124 +++- third-party/freertos/include/semphr.h | 2 +- third-party/freertos/include/stack_macros.h | 64 +- third-party/freertos/include/stdint.readme | 2 +- third-party/freertos/include/stream_buffer.h | 50 +- third-party/freertos/include/task.h | 65 +- third-party/freertos/include/timers.h | 25 +- third-party/freertos/list.c | 8 +- third-party/freertos/queue.c | 54 +- third-party/freertos/stream_buffer.c | 18 +- third-party/freertos/tasks.c | 653 +++++++++++------- third-party/freertos/timers.c | 207 +++--- third-party/libmetal/include.mk | 6 +- .../metal/system/freertos/CMakeLists.txt | 24 - .../libmetal/metal/system/freertos/alloc.h | 39 -- .../libmetal/metal/system/freertos/assert.h | 27 - .../libmetal/metal/system/freertos/cache.h | 40 -- .../metal/system/freertos/condition.c | 21 - .../metal/system/freertos/condition.h | 62 -- .../libmetal/metal/system/freertos/device.c | 31 - .../libmetal/metal/system/freertos/init.c | 28 - .../libmetal/metal/system/freertos/io.c | 31 - .../libmetal/metal/system/freertos/io.h | 44 -- .../libmetal/metal/system/freertos/irq.c | 30 - .../libmetal/metal/system/freertos/irq.h | 19 - .../libmetal/metal/system/freertos/log.h | 52 -- .../libmetal/metal/system/freertos/mutex.h | 95 --- .../libmetal/metal/system/freertos/shmem.c | 18 - .../libmetal/metal/system/freertos/sleep.h | 40 -- .../libmetal/metal/system/freertos/sys.h | 54 -- .../libmetal/metal/system/freertos/time.c | 20 - third-party/libmetal/src.mk | 12 +- third-party/openamp/include.mk | 5 +- third-party/openamp/ports/helper.h | 44 -- third-party/openamp/ports/phytium_os_rproc.c | 312 --------- third-party/openamp/ports/platform_info.c | 288 -------- third-party/openamp/ports/platform_info.h | 105 --- third-party/openamp/src.mk | 4 +- 184 files changed, 3063 insertions(+), 2671 deletions(-) create mode 100644 drivers/port/dlist.h delete mode 100644 example/system/amp/openamp/driver_core/build/amp_packed.c create mode 100644 third-party/freertos/README.md delete mode 100644 third-party/libmetal/metal/system/freertos/CMakeLists.txt delete mode 100644 third-party/libmetal/metal/system/freertos/alloc.h delete mode 100644 third-party/libmetal/metal/system/freertos/assert.h delete mode 100644 third-party/libmetal/metal/system/freertos/cache.h delete mode 100644 third-party/libmetal/metal/system/freertos/condition.c delete mode 100644 third-party/libmetal/metal/system/freertos/condition.h delete mode 100644 third-party/libmetal/metal/system/freertos/device.c delete mode 100644 third-party/libmetal/metal/system/freertos/init.c delete mode 100644 third-party/libmetal/metal/system/freertos/io.c delete mode 100644 third-party/libmetal/metal/system/freertos/io.h delete mode 100644 third-party/libmetal/metal/system/freertos/irq.c delete mode 100644 third-party/libmetal/metal/system/freertos/irq.h delete mode 100644 third-party/libmetal/metal/system/freertos/log.h delete mode 100644 third-party/libmetal/metal/system/freertos/mutex.h delete mode 100644 third-party/libmetal/metal/system/freertos/shmem.c delete mode 100644 third-party/libmetal/metal/system/freertos/sleep.h delete mode 100644 third-party/libmetal/metal/system/freertos/sys.h delete mode 100644 third-party/libmetal/metal/system/freertos/time.c delete mode 100644 third-party/openamp/ports/helper.h delete mode 100644 third-party/openamp/ports/phytium_os_rproc.c delete mode 100644 third-party/openamp/ports/platform_info.c delete mode 100644 third-party/openamp/ports/platform_info.h diff --git a/docs/ChangeLog.md b/docs/ChangeLog.md index e065924c..00a151dc 100644 --- a/docs/ChangeLog.md +++ b/docs/ChangeLog.md @@ -1,3 +1,31 @@ +# Phytium FreeRTOS SDK 2025-09-04 ChangeLog + +Change Log since 2025-09-03 + +## example + +- update network example configs + +# Phytium FreeRTOS SDK 2025-08-11 ChangeLog + +Change Log since 2025-08-06 + +## example + +- update OpenAMP example + +## Third-party + +- update OpenAMP to V1.8.0 + +# Phytium FreeRTOS SDK 2025-08-06 ChangeLog + +Change Log since 2025-07-22 + +## third-party + +- update FreeRTOS-Kernel to V11.2.0 + # Phytium FreeRTOS SDK 2025-07-18 ChangeLog Change Log since 2025-07-18 diff --git a/drivers/port/dlist.h b/drivers/port/dlist.h new file mode 100644 index 00000000..77c11f3a --- /dev/null +++ b/drivers/port/dlist.h @@ -0,0 +1,592 @@ +/* + * Copyright (c) 2013-2015 Wind River Systems, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @file + * @defgroup doubly-linked-list_apis Doubly-linked list + * @ingroup datastructure_apis + * + * @brief Doubly-linked list implementation + * + * Doubly-linked list implementation using inline macros/functions. + * This API is not thread safe, and thus if a list is used across threads, + * calls to functions must be protected with synchronization primitives. + * + * The lists are expected to be initialized such that both the head and tail + * pointers point to the list itself. Initializing the lists in such a fashion + * simplifies the adding and removing of nodes to/from the list. + * + * @{ + */ + +#ifndef COMMON_DIST_H +#define COMMON_DIST_H + +#include +#include + + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @brief Get a pointer to a structure containing the element + * + * Example: + * + * struct foo { + * int bar; + * }; + * + * struct foo my_foo; + * int *ptr = &my_foo.bar; + * + * struct foo *container = DIST_CONTAINER_OF(ptr, struct foo, bar); + * + * Above, @p container points at @p my_foo. + * + * @param ptr pointer to a structure element + * @param type name of the type that @p ptr is an element of + * @param field the name of the field within the struct @p ptr points to + * @return a pointer to the structure that contains @p ptr + */ +#define DIST_CONTAINER_OF(ptr, type, field) \ + ({ ((type *)(((char *)(ptr)) - offsetof(type, field))); }) + + +struct _dnode +{ + union + { + struct _dnode *head; /* ptr to head of list (sys_dlist_t) */ + struct _dnode *next; /* ptr to next node (sys_dnode_t) */ + }; + union + { + struct _dnode *tail; /* ptr to tail of list (sys_dlist_t) */ + struct _dnode *prev; /* ptr to previous node (sys_dnode_t) */ + }; +}; + +/** + * @brief Doubly-linked list structure. + */ +typedef struct _dnode sys_dlist_t; +/** + * @brief Doubly-linked list node structure. + */ +typedef struct _dnode sys_dnode_t; + + +/** + * @brief Provide the primitive to iterate on a list + * Note: the loop is unsafe and thus __dn should not be removed + * + * User _MUST_ add the loop statement curly braces enclosing its own code: + * + * SYS_DLIST_FOR_EACH_NODE(l, n) { + * + * } + * + * This and other SYS_DLIST_*() macros are not thread safe. + * + * @param __dl A pointer on a sys_dlist_t to iterate on + * @param __dn A sys_dnode_t pointer to peek each node of the list + */ +#define SYS_DLIST_FOR_EACH_NODE(__dl, __dn) \ + for (__dn = sys_dlist_peek_head(__dl); __dn != NULL; __dn = sys_dlist_peek_next(__dl, __dn)) + +/** + * @brief Provide the primitive to iterate on a list, from a node in the list + * Note: the loop is unsafe and thus __dn should not be removed + * + * User _MUST_ add the loop statement curly braces enclosing its own code: + * + * SYS_DLIST_ITERATE_FROM_NODE(l, n) { + * + * } + * + * Like SYS_DLIST_FOR_EACH_NODE(), but __dn already contains a node in the list + * where to start searching for the next entry from. If NULL, it starts from + * the head. + * + * This and other SYS_DLIST_*() macros are not thread safe. + * + * @param __dl A pointer on a sys_dlist_t to iterate on + * @param __dn A sys_dnode_t pointer to peek each node of the list; + * it contains the starting node, or NULL to start from the head + */ +#define SYS_DLIST_ITERATE_FROM_NODE(__dl, __dn) \ + for (__dn = __dn ? sys_dlist_peek_next_no_check(__dl, __dn) : sys_dlist_peek_head(__dl); \ + __dn != NULL; __dn = sys_dlist_peek_next(__dl, __dn)) + +/** + * @brief Provide the primitive to safely iterate on a list + * Note: __dn can be removed, it will not break the loop. + * + * User _MUST_ add the loop statement curly braces enclosing its own code: + * + * SYS_DLIST_FOR_EACH_NODE_SAFE(l, n, s) { + * + * } + * + * This and other SYS_DLIST_*() macros are not thread safe. + * + * @param __dl A pointer on a sys_dlist_t to iterate on + * @param __dn A sys_dnode_t pointer to peek each node of the list + * @param __dns A sys_dnode_t pointer for the loop to run safely + */ +#define SYS_DLIST_FOR_EACH_NODE_SAFE(__dl, __dn, __dns) \ + for ((__dn) = sys_dlist_peek_head(__dl), (__dns) = sys_dlist_peek_next((__dl), (__dn)); \ + (__dn) != NULL; (__dn) = (__dns), (__dns) = sys_dlist_peek_next(__dl, __dn)) + +/** + * @brief Provide the primitive to resolve the container of a list node + * Note: it is safe to use with NULL pointer nodes + * + * @param __dn A pointer on a sys_dnode_t to get its container + * @param __cn Container struct type pointer + * @param __n The field name of sys_dnode_t within the container struct + */ +#define SYS_DLIST_CONTAINER(__dn, __cn, __n) \ + (((__dn) != NULL) ? DIST_CONTAINER_OF(__dn, __typeof__(*(__cn)), __n) : NULL) +/** + * @brief Provide the primitive to peek container of the list head + * + * @param __dl A pointer on a sys_dlist_t to peek + * @param __cn Container struct type pointer + * @param __n The field name of sys_dnode_t within the container struct + */ +#define SYS_DLIST_PEEK_HEAD_CONTAINER(__dl, __cn, __n) \ + SYS_DLIST_CONTAINER(sys_dlist_peek_head(__dl), __cn, __n) + +/** + * @brief Provide the primitive to peek the next container + * + * @param __dl A pointer on a sys_dlist_t to peek + * @param __cn Container struct type pointer + * @param __n The field name of sys_dnode_t within the container struct + */ +#define SYS_DLIST_PEEK_NEXT_CONTAINER(__dl, __cn, __n) \ + (((__cn) != NULL) ? SYS_DLIST_CONTAINER(sys_dlist_peek_next((__dl), &((__cn)->__n)), __cn, __n) : NULL) + +/** + * @brief Provide the primitive to iterate on a list under a container + * Note: the loop is unsafe and thus __cn should not be detached + * + * User _MUST_ add the loop statement curly braces enclosing its own code: + * + * SYS_DLIST_FOR_EACH_CONTAINER(l, c, n) { + * + * } + * + * @param __dl A pointer on a sys_dlist_t to iterate on + * @param __cn A container struct type pointer to peek each entry of the list + * @param __n The field name of sys_dnode_t within the container struct + */ +#define SYS_DLIST_FOR_EACH_CONTAINER(__dl, __cn, __n) \ + for ((__cn) = SYS_DLIST_PEEK_HEAD_CONTAINER(__dl, __cn, __n); (__cn) != NULL; \ + (__cn) = SYS_DLIST_PEEK_NEXT_CONTAINER(__dl, __cn, __n)) + +/** + * @brief Provide the primitive to safely iterate on a list under a container + * Note: __cn can be detached, it will not break the loop. + * + * User _MUST_ add the loop statement curly braces enclosing its own code: + * + * SYS_DLIST_FOR_EACH_CONTAINER_SAFE(l, c, cn, n) { + * + * } + * + * @param __dl A pointer on a sys_dlist_t to iterate on + * @param __cn A container struct type pointer to peek each entry of the list + * @param __cns A container struct type pointer for the loop to run safely + * @param __n The field name of sys_dnode_t within the container struct + */ +#define SYS_DLIST_FOR_EACH_CONTAINER_SAFE(__dl, __cn, __cns, __n) \ + for ((__cn) = SYS_DLIST_PEEK_HEAD_CONTAINER(__dl, __cn, __n), \ + (__cns) = SYS_DLIST_PEEK_NEXT_CONTAINER(__dl, __cn, __n); \ + (__cn) != NULL; \ + (__cn) = (__cns), (__cns) = SYS_DLIST_PEEK_NEXT_CONTAINER(__dl, __cn, __n)) + +/** + * @brief initialize list to its empty state + * + * @param list the doubly-linked list + */ + +static inline void sys_dlist_init(sys_dlist_t *list) +{ + list->head = (sys_dnode_t *)list; + list->tail = (sys_dnode_t *)list; +} + +/** + * @brief Static initializer for a doubly-linked list + */ +#define SYS_DLIST_STATIC_INIT(ptr_to_list) \ + { \ + {(ptr_to_list)}, \ + { \ + (ptr_to_list) \ + } \ + } + +/** + * @brief initialize node to its state when not in a list + * + * @param node the node + */ + +static inline void sys_dnode_init(sys_dnode_t *node) +{ + node->next = NULL; + node->prev = NULL; +} + +/** + * @brief check if a node is a member of any list + * + * @param node the node + * + * @return true if node is linked into a list, false if it is not + */ + +static inline bool sys_dnode_is_linked(const sys_dnode_t *node) +{ + return node->next != NULL; +} + +/** + * @brief check if a node is the list's head + * + * @param list the doubly-linked list to operate on + * @param node the node to check + * + * @return true if node is the head, false otherwise + */ + +static inline bool sys_dlist_is_head(sys_dlist_t *list, sys_dnode_t *node) +{ + return list->head == node; +} + +/** + * @brief check if a node is the list's tail + * + * @param list the doubly-linked list to operate on + * @param node the node to check + * + * @return true if node is the tail, false otherwise + */ + +static inline bool sys_dlist_is_tail(sys_dlist_t *list, sys_dnode_t *node) +{ + return list->tail == node; +} + +/** + * @brief check if the list is empty + * + * @param list the doubly-linked list to operate on + * + * @return true if empty, false otherwise + */ + +static inline bool sys_dlist_is_empty(sys_dlist_t *list) +{ + return list->head == list; +} + +/** + * @brief check if more than one node present + * + * This and other sys_dlist_*() functions are not thread safe. + * + * @param list the doubly-linked list to operate on + * + * @return true if multiple nodes, false otherwise + */ + +static inline bool sys_dlist_has_multiple_nodes(sys_dlist_t *list) +{ + return list->head != list->tail; +} + +/** + * @brief get a reference to the head item in the list + * + * @param list the doubly-linked list to operate on + * + * @return a pointer to the head element, NULL if list is empty + */ + +static inline sys_dnode_t *sys_dlist_peek_head(sys_dlist_t *list) +{ + return sys_dlist_is_empty(list) ? NULL : list->head; +} + +/** + * @brief get a reference to the head item in the list + * + * The list must be known to be non-empty. + * + * @param list the doubly-linked list to operate on + * + * @return a pointer to the head element + */ + +static inline sys_dnode_t *sys_dlist_peek_head_not_empty(sys_dlist_t *list) +{ + return list->head; +} + +/** + * @brief get a reference to the next item in the list, node is not NULL + * + * Faster than sys_dlist_peek_next() if node is known not to be NULL. + * + * @param list the doubly-linked list to operate on + * @param node the node from which to get the next element in the list + * + * @return a pointer to the next element from a node, NULL if node is the tail + */ + +static inline sys_dnode_t *sys_dlist_peek_next_no_check(sys_dlist_t *list, sys_dnode_t *node) +{ + return (node == list->tail) ? NULL : node->next; +} + +/** + * @brief get a reference to the next item in the list + * + * @param list the doubly-linked list to operate on + * @param node the node from which to get the next element in the list + * + * @return a pointer to the next element from a node, NULL if node is the tail + * or NULL (when node comes from reading the head of an empty list). + */ + +static inline sys_dnode_t *sys_dlist_peek_next(sys_dlist_t *list, sys_dnode_t *node) +{ + return (node != NULL) ? sys_dlist_peek_next_no_check(list, node) : NULL; +} + +/** + * @brief get a reference to the previous item in the list, node is not NULL + * + * Faster than sys_dlist_peek_prev() if node is known not to be NULL. + * + * @param list the doubly-linked list to operate on + * @param node the node from which to get the previous element in the list + * + * @return a pointer to the previous element from a node, NULL if node is the + * tail + */ + +static inline sys_dnode_t *sys_dlist_peek_prev_no_check(sys_dlist_t *list, sys_dnode_t *node) +{ + return (node == list->head) ? NULL : node->prev; +} + +/** + * @brief get a reference to the previous item in the list + * + * @param list the doubly-linked list to operate on + * @param node the node from which to get the previous element in the list + * + * @return a pointer to the previous element from a node, NULL if node is the + * tail or NULL (when node comes from reading the head of an empty + * list). + */ + +static inline sys_dnode_t *sys_dlist_peek_prev(sys_dlist_t *list, sys_dnode_t *node) +{ + return (node != NULL) ? sys_dlist_peek_prev_no_check(list, node) : NULL; +} + +/** + * @brief get a reference to the tail item in the list + * + * @param list the doubly-linked list to operate on + * + * @return a pointer to the tail element, NULL if list is empty + */ + +static inline sys_dnode_t *sys_dlist_peek_tail(sys_dlist_t *list) +{ + return sys_dlist_is_empty(list) ? NULL : list->tail; +} + +/** + * @brief add node to tail of list + * + * This and other sys_dlist_*() functions are not thread safe. + * + * @param list the doubly-linked list to operate on + * @param node the element to append + */ + +static inline void sys_dlist_append(sys_dlist_t *list, sys_dnode_t *node) +{ + sys_dnode_t *const tail = list->tail; + + node->next = list; + node->prev = tail; + + tail->next = node; + list->tail = node; +} + +/** + * @brief add node to head of list + * + * This and other sys_dlist_*() functions are not thread safe. + * + * @param list the doubly-linked list to operate on + * @param node the element to append + */ + +static inline void sys_dlist_prepend(sys_dlist_t *list, sys_dnode_t *node) +{ + sys_dnode_t *const head = list->head; + + node->next = head; + node->prev = list; + + head->prev = node; + list->head = node; +} + +/** + * @brief Insert a node into a list + * + * Insert a node before a specified node in a dlist. + * + * @param successor the position before which "node" will be inserted + * @param node the element to insert + */ +static inline void sys_dlist_insert(sys_dnode_t *successor, sys_dnode_t *node) +{ + sys_dnode_t *const prev = successor->prev; + + node->prev = prev; + node->next = successor; + prev->next = node; + successor->prev = node; +} + +/** + * @brief insert node at position + * + * Insert a node in a location depending on a external condition. The cond() + * function checks if the node is to be inserted _before_ the current node + * against which it is checked. + * This and other sys_dlist_*() functions are not thread safe. + * + * @param list the doubly-linked list to operate on + * @param node the element to insert + * @param cond a function that determines if the current node is the correct + * insert point + * @param data parameter to cond() + */ + +static inline void sys_dlist_insert_at(sys_dlist_t *list, sys_dnode_t *node, + int (*cond)(sys_dnode_t *node, void *data), void *data) +{ + if (sys_dlist_is_empty(list)) + { + sys_dlist_append(list, node); + } + else + { + sys_dnode_t *pos = sys_dlist_peek_head(list); + + while ((pos != NULL) && (cond(pos, data) == 0)) + { + pos = sys_dlist_peek_next(list, pos); + } + if (pos != NULL) + { + sys_dlist_insert(pos, node); + } + else + { + sys_dlist_append(list, node); + } + } +} + +/** + * @brief remove a specific node from a list + * + * The list is implicit from the node. The node must be part of a list. + * This and other sys_dlist_*() functions are not thread safe. + * + * @param node the node to remove + */ + +static inline void sys_dlist_remove(sys_dnode_t *node) +{ + sys_dnode_t *const prev = node->prev; + sys_dnode_t *const next = node->next; + + prev->next = next; + next->prev = prev; + sys_dnode_init(node); +} + +/** + * @brief get the first node in a list + * + * This and other sys_dlist_*() functions are not thread safe. + * + * @param list the doubly-linked list to operate on + * + * @return the first node in the list, NULL if list is empty + */ + +static inline sys_dnode_t *sys_dlist_get(sys_dlist_t *list) +{ + sys_dnode_t *node = NULL; + + if (!sys_dlist_is_empty(list)) + { + node = list->head; + sys_dlist_remove(node); + } + + return node; +} + +/** + * @brief Compute the size of the given list in O(n) time + * + * @param list A pointer on the list + * + * @return an integer equal to the size of the list, or 0 if empty + */ +static inline size_t sys_dlist_len(sys_dlist_t *list) +{ + size_t len = 0; + sys_dnode_t *node = NULL; + + SYS_DLIST_FOR_EACH_NODE(list, node) + { + len++; + } + return len; +} + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* COMMON_DIST_H */ diff --git a/drivers/port/fdrivers_port.c b/drivers/port/fdrivers_port.c index 6be97014..d8da5275 100644 --- a/drivers/port/fdrivers_port.c +++ b/drivers/port/fdrivers_port.c @@ -28,6 +28,8 @@ #include "fcache.h" #include "fsleep.h" +#include "fgeneric_timer.h" +#include "fparameters.h" /* cache */ void FDriverDCacheRangeFlush(uintptr_t adr,size_t len) @@ -64,3 +66,7 @@ void FDriverSdelay(u32 sec) fsleep_seconds(sec); } +u64 FDriverGetTimerTick(void) +{ + return GenericTimerRead(GENERIC_TIMER_ID0); +} diff --git a/drivers/port/fdrivers_port.h b/drivers/port/fdrivers_port.h index 8b6e5f20..822441f7 100644 --- a/drivers/port/fdrivers_port.h +++ b/drivers/port/fdrivers_port.h @@ -34,6 +34,7 @@ #include "fassert.h" #include "fkernel.h" #include "fdebug.h" +#include "fgeneric_timer.h" #include "sdkconfig.h" /***************************** Include Files *********************************/ @@ -86,6 +87,57 @@ void FDriverSdelay(u32 sec); #define FT_DEBUG_PRINT_V(TAG, format, ...) #endif +u64 FDriverGetTimerTick(void); + + +/** + * @name: TICKS_TO_SECONDS + * @msg: 将tick数转换为秒(整数除法,向下取整) + * @param {u64} tick, tick计数值 + * @return {u64} 对应的秒数 + */ +#define TICKS_TO_SECONDS() ((u64)(GenericTimerRead(0)) / GenericTimerFrequecy()) + +/** + * @name: TICKS_TO_MILLISECONDS + * @msg: 将tick数转换为毫秒(避免乘法溢出的安全计算) + * @param {u64} tick, tick计数值 + * @return {u64} 对应的毫秒数 + */ +#define TICKS_TO_MILLISECONDS() \ + ({ \ + u64 __freq = GenericTimerFrequecy(); \ + u64 __quot = (u64)(GenericTimerRead(0)) / __freq; \ + u64 __rem = (u64)(GenericTimerRead(0)) % __freq; \ + (__quot * 1000) + (__rem * 1000) / __freq; \ + }) + +/** + * @name: MSEC_TO_TICKS + * @msg: 将毫秒转换为定时器 tick 值(向下取整) + * @param {u64} ms, 毫秒时间值 + * @return {u64} 对应的定时器 tick 值 + */ +#define MSEC_TO_TICKS(ms) ((u64)(((ms)*GenericTimerFrequecy()) / 1000)) + +/** + * @name: SEC_TO_TICKS + * @msg: 将秒转换为定时器 tick 值 + * @param {u64} s, 秒时间值 + * @return {u64} 对应的定时器 tick 值 + */ +#define SEC_TO_TICKS(s) ((u64)((s)*GenericTimerFrequecy())) + +/** + * @name: USEC_TO_TICKS + * @msg: 将微秒转换为定时器 tick 值(向下取整) + * @param {u64} us, 微秒时间值 + * @return {u64} 对应的定时器 tick 值 + */ +#define USEC_TO_TICKS(us) ((u64)(((us)*GenericTimerFrequecy()) / 1000000)) + + + #ifdef __cplusplus } #endif diff --git a/example/freertos_feature/eventgroup/sdkconfig b/example/freertos_feature/eventgroup/sdkconfig index 27e5dcfb..92e37570 100644 --- a/example/freertos_feature/eventgroup/sdkconfig +++ b/example/freertos_feature/eventgroup/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_ERROR=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/freertos_feature/eventgroup/sdkconfig.h b/example/freertos_feature/eventgroup/sdkconfig.h index 1eb36c1a..0d425eea 100644 --- a/example/freertos_feature/eventgroup/sdkconfig.h +++ b/example/freertos_feature/eventgroup/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/freertos_feature/interrupt/sdkconfig b/example/freertos_feature/interrupt/sdkconfig index 412198e8..ce424bd9 100644 --- a/example/freertos_feature/interrupt/sdkconfig +++ b/example/freertos_feature/interrupt/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_INFO=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/freertos_feature/interrupt/sdkconfig.h b/example/freertos_feature/interrupt/sdkconfig.h index 0a9f290e..37c165bb 100644 --- a/example/freertos_feature/interrupt/sdkconfig.h +++ b/example/freertos_feature/interrupt/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/freertos_feature/queue/sdkconfig b/example/freertos_feature/queue/sdkconfig index 55cc94be..011da834 100644 --- a/example/freertos_feature/queue/sdkconfig +++ b/example/freertos_feature/queue/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_INFO=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/freertos_feature/queue/sdkconfig.h b/example/freertos_feature/queue/sdkconfig.h index 40d64322..6f72ed73 100644 --- a/example/freertos_feature/queue/sdkconfig.h +++ b/example/freertos_feature/queue/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/freertos_feature/resource/sdkconfig b/example/freertos_feature/resource/sdkconfig index c333162e..22224ef5 100644 --- a/example/freertos_feature/resource/sdkconfig +++ b/example/freertos_feature/resource/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_INFO=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/freertos_feature/resource/sdkconfig.h b/example/freertos_feature/resource/sdkconfig.h index f5da8c76..3cc94503 100644 --- a/example/freertos_feature/resource/sdkconfig.h +++ b/example/freertos_feature/resource/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/freertos_feature/software_timer/sdkconfig b/example/freertos_feature/software_timer/sdkconfig index 165d8167..2cfffb10 100644 --- a/example/freertos_feature/software_timer/sdkconfig +++ b/example/freertos_feature/software_timer/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_INFO=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/freertos_feature/software_timer/sdkconfig.h b/example/freertos_feature/software_timer/sdkconfig.h index 21728622..dbe002bb 100644 --- a/example/freertos_feature/software_timer/sdkconfig.h +++ b/example/freertos_feature/software_timer/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/freertos_feature/task/sdkconfig b/example/freertos_feature/task/sdkconfig index b1860141..2e70d8bb 100644 --- a/example/freertos_feature/task/sdkconfig +++ b/example/freertos_feature/task/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_ERROR=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/freertos_feature/task/sdkconfig.h b/example/freertos_feature/task/sdkconfig.h index f427dac6..91bf2830 100644 --- a/example/freertos_feature/task/sdkconfig.h +++ b/example/freertos_feature/task/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/freertos_feature/task_notify/sdkconfig b/example/freertos_feature/task_notify/sdkconfig index 9712e70c..751747cf 100644 --- a/example/freertos_feature/task_notify/sdkconfig +++ b/example/freertos_feature/task_notify/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_INFO=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/freertos_feature/task_notify/sdkconfig.h b/example/freertos_feature/task_notify/sdkconfig.h index dfccd4b3..47a35f16 100644 --- a/example/freertos_feature/task_notify/sdkconfig.h +++ b/example/freertos_feature/task_notify/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/network/lwip_https/sdkconfig b/example/network/lwip_https/sdkconfig index 018e18b7..b9d7fbee 100644 --- a/example/network/lwip_https/sdkconfig +++ b/example/network/lwip_https/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_ERROR=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set @@ -237,6 +240,7 @@ CONFIG_STACK_SIZE=0x400 # FreeRTOS Uart Drivers # CONFIG_FREERTOS_USE_UART=y +# CONFIG_FREERTOS_USE_SERIAL_V2 is not set # end of FreeRTOS Uart Drivers # @@ -262,12 +266,14 @@ CONFIG_FREERTOS_USE_UART=y # CONFIG_FREERTOS_USE_XMAC=y # CONFIG_FREERTOS_USE_GMAC is not set +# CONFIG_FREERTOS_USE_XMAC_V2 is not set # end of FreeRTOS Eth Drivers # # FreeRTOS Spim Drivers # # CONFIG_FREERTOS_USE_FSPIM is not set +# CONFIG_FREERTOS_USE_FSPIM_V2 is not set # end of FreeRTOS Spim Drivers # @@ -293,6 +299,7 @@ CONFIG_FREERTOS_USE_XMAC=y # FreeRTOS I2c Drivers # # CONFIG_FREERTOS_USE_I2C is not set +# CONFIG_FREERTOS_USE_FI2C_V2 is not set # end of FreeRTOS I2c Drivers # diff --git a/example/network/lwip_https/sdkconfig.h b/example/network/lwip_https/sdkconfig.h index 6308cce4..d785bb82 100644 --- a/example/network/lwip_https/sdkconfig.h +++ b/example/network/lwip_https/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ @@ -214,6 +217,7 @@ /* FreeRTOS Uart Drivers */ #define CONFIG_FREERTOS_USE_UART +/* CONFIG_FREERTOS_USE_SERIAL_V2 is not set */ /* end of FreeRTOS Uart Drivers */ /* FreeRTOS Pwm Drivers */ @@ -235,11 +239,13 @@ #define CONFIG_FREERTOS_USE_XMAC /* CONFIG_FREERTOS_USE_GMAC is not set */ +/* CONFIG_FREERTOS_USE_XMAC_V2 is not set */ /* end of FreeRTOS Eth Drivers */ /* FreeRTOS Spim Drivers */ /* CONFIG_FREERTOS_USE_FSPIM is not set */ +/* CONFIG_FREERTOS_USE_FSPIM_V2 is not set */ /* end of FreeRTOS Spim Drivers */ /* FreeRTOS DMA Drivers */ @@ -261,6 +267,7 @@ /* FreeRTOS I2c Drivers */ /* CONFIG_FREERTOS_USE_I2C is not set */ +/* CONFIG_FREERTOS_USE_FI2C_V2 is not set */ /* end of FreeRTOS I2c Drivers */ /* FreeRTOS Mio Drivers */ diff --git a/example/network/lwip_iperf/sdkconfig b/example/network/lwip_iperf/sdkconfig index f94c4199..019aecc8 100644 --- a/example/network/lwip_iperf/sdkconfig +++ b/example/network/lwip_iperf/sdkconfig @@ -50,45 +50,50 @@ CONFIG_MAX_XLAT_TABLES=256 # # Soc configuration # -# CONFIG_TARGET_PE2204 is not set +CONFIG_TARGET_PE2204=y # CONFIG_TARGET_PE2202 is not set # CONFIG_TARGET_PE2201 is not set # CONFIG_TARGET_PD1904 is not set # CONFIG_TARGET_PD2008 is not set # CONFIG_TARGET_PD2308 is not set # CONFIG_TARGET_PS2316 is not set -CONFIG_TARGET_PD2408=y +# CONFIG_TARGET_PD2408 is not set # CONFIG_TARGET_QEMU_VIRT is not set -CONFIG_SOC_NAME="pd2408" -CONFIG_SOC_CORE_NUM=8 +CONFIG_SOC_NAME="pe220x" +CONFIG_TARGET_TYPE_NAME="pe2204" +CONFIG_SOC_CORE_NUM=4 CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 +CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # # Board Configuration # -CONFIG_BOARD_NAME="test_a" +CONFIG_BOARD_NAME="phytiumpi" # CONFIG_USE_SPI_IOPAD is not set # CONFIG_USE_GPIO_IOPAD is not set +# CONFIG_USE_CAN_IOPAD is not set # CONFIG_USE_QSPI_IOPAD is not set # CONFIG_USE_PWM_IOPAD is not set +# CONFIG_USE_MIO_IOPAD is not set # CONFIG_USE_TACHO_IOPAD is not set # CONFIG_USE_UART_IOPAD is not set # CONFIG_USE_THIRD_PARTY_IOPAD is not set -CONFIG_PD2408_TEST_A_BOARD=y +# CONFIG_E2000Q_DEMO_BOARD is not set +CONFIG_PHYTIUMPI_FIREFLY_BOARD=y # # IO mux configuration when board start up # # end of IO mux configuration when board start up -# CONFIG_PD2408_TEST_B_BOARD is not set # CONFIG_CUS_DEMO_BOARD is not set # @@ -113,6 +118,8 @@ CONFIG_LOG_ERROR=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set @@ -133,7 +140,6 @@ CONFIG_USE_SERIAL=y # Usart Configuration # CONFIG_ENABLE_Pl011_UART=y -# CONFIG_USE_SERIAL_V2 is not set # end of Usart Configuration # CONFIG_USE_GPIO is not set @@ -142,10 +148,11 @@ CONFIG_USE_ETH=y # # Eth Configuration # -# CONFIG_ENABLE_FXMAC is not set +CONFIG_ENABLE_FXMAC=y # CONFIG_ENABLE_FGMAC is not set -CONFIG_ENABLE_FXMAC_V2=y # CONFIG_ENABLE_E1000E is not set +CONFIG_FXMAC_PHY_COMMON=y +# CONFIG_FXMAC_PHY_YT is not set # end of Eth Configuration # CONFIG_USE_CAN is not set @@ -166,7 +173,7 @@ CONFIG_ENABLE_FXMAC_V2=y # CONFIG_USE_SCMI_MHU is not set # CONFIG_USE_I2S is not set # CONFIG_USE_I3C is not set -CONFIG_USE_MSG=y +# CONFIG_USE_MSG is not set # CONFIG_USE_DEVICE is not set # end of Drivers configuration @@ -234,6 +241,7 @@ CONFIG_STACK_SIZE=0x400 # FreeRTOS Uart Drivers # CONFIG_FREERTOS_USE_UART=y +# CONFIG_FREERTOS_USE_SERIAL_V2 is not set # end of FreeRTOS Uart Drivers # @@ -257,9 +265,9 @@ CONFIG_FREERTOS_USE_UART=y # # FreeRTOS Eth Drivers # -# CONFIG_FREERTOS_USE_XMAC is not set +CONFIG_FREERTOS_USE_XMAC=y # CONFIG_FREERTOS_USE_GMAC is not set -CONFIG_FREERTOS_USE_XMAC_V2=y +# CONFIG_FREERTOS_USE_XMAC_V2 is not set # end of FreeRTOS Eth Drivers # @@ -292,6 +300,7 @@ CONFIG_FREERTOS_USE_XMAC_V2=y # FreeRTOS I2c Drivers # # CONFIG_FREERTOS_USE_I2C is not set +# CONFIG_FREERTOS_USE_FI2C_V2 is not set # end of FreeRTOS I2c Drivers # @@ -335,8 +344,7 @@ CONFIG_USE_LWIP=y # # LWIP Port Configuration # -# CONFIG_LWIP_FXMAC is not set -CONFIG_LWIP_FXMAC_V2=y +CONFIG_LWIP_FXMAC=y # CONFIG_LWIP_FGMAC is not set # CONFIG_LWIP_E1000E is not set # CONFIG_LWIP_FSDIF is not set diff --git a/example/network/lwip_iperf/sdkconfig.h b/example/network/lwip_iperf/sdkconfig.h index 7988ff15..c1188938 100644 --- a/example/network/lwip_iperf/sdkconfig.h +++ b/example/network/lwip_iperf/sdkconfig.h @@ -46,42 +46,47 @@ /* Soc configuration */ -/* CONFIG_TARGET_PE2204 is not set */ +#define CONFIG_TARGET_PE2204 /* CONFIG_TARGET_PE2202 is not set */ /* CONFIG_TARGET_PE2201 is not set */ /* CONFIG_TARGET_PD1904 is not set */ /* CONFIG_TARGET_PD2008 is not set */ /* CONFIG_TARGET_PD2308 is not set */ /* CONFIG_TARGET_PS2316 is not set */ -#define CONFIG_TARGET_PD2408 +/* CONFIG_TARGET_PD2408 is not set */ /* CONFIG_TARGET_QEMU_VIRT is not set */ -#define CONFIG_SOC_NAME "pd2408" -#define CONFIG_SOC_CORE_NUM 8 +#define CONFIG_SOC_NAME "pe220x" +#define CONFIG_TARGET_TYPE_NAME "pe2204" +#define CONFIG_SOC_CORE_NUM 4 #define CONFIG_F32BIT_MEMORY_ADDRESS 0x80000000 #define CONFIG_F32BIT_MEMORY_LENGTH 0x80000000 #define CONFIG_F64BIT_MEMORY_ADDRESS 0x2000000000 #define CONFIG_F64BIT_MEMORY_LENGTH 0x800000000 +#define CONFIG_TARGET_PE220X #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ -#define CONFIG_BOARD_NAME "test_a" +#define CONFIG_BOARD_NAME "phytiumpi" /* CONFIG_USE_SPI_IOPAD is not set */ /* CONFIG_USE_GPIO_IOPAD is not set */ +/* CONFIG_USE_CAN_IOPAD is not set */ /* CONFIG_USE_QSPI_IOPAD is not set */ /* CONFIG_USE_PWM_IOPAD is not set */ +/* CONFIG_USE_MIO_IOPAD is not set */ /* CONFIG_USE_TACHO_IOPAD is not set */ /* CONFIG_USE_UART_IOPAD is not set */ /* CONFIG_USE_THIRD_PARTY_IOPAD is not set */ -#define CONFIG_PD2408_TEST_A_BOARD +/* CONFIG_E2000Q_DEMO_BOARD is not set */ +#define CONFIG_PHYTIUMPI_FIREFLY_BOARD /* IO mux configuration when board start up */ /* end of IO mux configuration when board start up */ -/* CONFIG_PD2408_TEST_B_BOARD is not set */ /* CONFIG_CUS_DEMO_BOARD is not set */ /* Build project name */ @@ -104,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ @@ -122,17 +129,17 @@ /* Usart Configuration */ #define CONFIG_ENABLE_Pl011_UART -/* CONFIG_USE_SERIAL_V2 is not set */ /* end of Usart Configuration */ /* CONFIG_USE_GPIO is not set */ #define CONFIG_USE_ETH /* Eth Configuration */ -/* CONFIG_ENABLE_FXMAC is not set */ +#define CONFIG_ENABLE_FXMAC /* CONFIG_ENABLE_FGMAC is not set */ -#define CONFIG_ENABLE_FXMAC_V2 /* CONFIG_ENABLE_E1000E is not set */ +#define CONFIG_FXMAC_PHY_COMMON +/* CONFIG_FXMAC_PHY_YT is not set */ /* end of Eth Configuration */ /* CONFIG_USE_CAN is not set */ /* CONFIG_USE_I2C is not set */ @@ -152,7 +159,7 @@ /* CONFIG_USE_SCMI_MHU is not set */ /* CONFIG_USE_I2S is not set */ /* CONFIG_USE_I3C is not set */ -#define CONFIG_USE_MSG +/* CONFIG_USE_MSG is not set */ /* CONFIG_USE_DEVICE is not set */ /* end of Drivers configuration */ @@ -211,6 +218,7 @@ /* FreeRTOS Uart Drivers */ #define CONFIG_FREERTOS_USE_UART +/* CONFIG_FREERTOS_USE_SERIAL_V2 is not set */ /* end of FreeRTOS Uart Drivers */ /* FreeRTOS Pwm Drivers */ @@ -230,9 +238,9 @@ /* FreeRTOS Eth Drivers */ -/* CONFIG_FREERTOS_USE_XMAC is not set */ +#define CONFIG_FREERTOS_USE_XMAC /* CONFIG_FREERTOS_USE_GMAC is not set */ -#define CONFIG_FREERTOS_USE_XMAC_V2 +/* CONFIG_FREERTOS_USE_XMAC_V2 is not set */ /* end of FreeRTOS Eth Drivers */ /* FreeRTOS Spim Drivers */ @@ -260,6 +268,7 @@ /* FreeRTOS I2c Drivers */ /* CONFIG_FREERTOS_USE_I2C is not set */ +/* CONFIG_FREERTOS_USE_FI2C_V2 is not set */ /* end of FreeRTOS I2c Drivers */ /* FreeRTOS Mio Drivers */ @@ -293,8 +302,7 @@ /* LWIP Port Configuration */ -/* CONFIG_LWIP_FXMAC is not set */ -#define CONFIG_LWIP_FXMAC_V2 +#define CONFIG_LWIP_FXMAC /* CONFIG_LWIP_FGMAC is not set */ /* CONFIG_LWIP_E1000E is not set */ /* CONFIG_LWIP_FSDIF is not set */ diff --git a/example/network/lwip_startup/configs/pd1904_aarch32_dsk_lwip_startup.config b/example/network/lwip_startup/configs/pd1904_aarch32_dsk_lwip_startup.config index 876f3905..447fc66a 100644 --- a/example/network/lwip_startup/configs/pd1904_aarch32_dsk_lwip_startup.config +++ b/example/network/lwip_startup/configs/pd1904_aarch32_dsk_lwip_startup.config @@ -5,6 +5,7 @@ CONFIG_USE_ETH=y CONFIG_DEFAULT_LINKER_SCRIPT=y CONFIG_IMAGE_MAX_LENGTH=0x2000000 CONFIG_USE_LWIP=y +CONFIG_LWIP_FGMAC=y # CONFIG_LWIP_NO_SYS is not set CONFIG_LWIP_USE_MEM_HEAP=y CONFIG_MEM_SIZE=2 diff --git a/example/network/lwip_startup/configs/pd1904_aarch64_dsk_lwip_startup.config b/example/network/lwip_startup/configs/pd1904_aarch64_dsk_lwip_startup.config index 2bdb9f55..62fe74b9 100644 --- a/example/network/lwip_startup/configs/pd1904_aarch64_dsk_lwip_startup.config +++ b/example/network/lwip_startup/configs/pd1904_aarch64_dsk_lwip_startup.config @@ -5,6 +5,7 @@ CONFIG_USE_ETH=y CONFIG_DEFAULT_LINKER_SCRIPT=y CONFIG_IMAGE_MAX_LENGTH=0x2000000 CONFIG_USE_LWIP=y +CONFIG_LWIP_FGMAC=y # CONFIG_LWIP_NO_SYS is not set CONFIG_LWIP_USE_MEM_HEAP=y CONFIG_MEM_SIZE=2 diff --git a/example/network/lwip_startup/configs/pd2008_aarch32_test_lwip_startup.config b/example/network/lwip_startup/configs/pd2008_aarch32_test_lwip_startup.config index f7b48e08..7c801d86 100644 --- a/example/network/lwip_startup/configs/pd2008_aarch32_test_lwip_startup.config +++ b/example/network/lwip_startup/configs/pd2008_aarch32_test_lwip_startup.config @@ -5,6 +5,7 @@ CONFIG_USE_ETH=y CONFIG_DEFAULT_LINKER_SCRIPT=y CONFIG_IMAGE_MAX_LENGTH=0x2000000 CONFIG_USE_LWIP=y +CONFIG_LWIP_FGMAC=y # CONFIG_LWIP_NO_SYS is not set CONFIG_LWIP_USE_MEM_HEAP=y CONFIG_MEM_SIZE=2 diff --git a/example/network/lwip_startup/configs/pd2008_aarch64_test_lwip_startup.config b/example/network/lwip_startup/configs/pd2008_aarch64_test_lwip_startup.config index b43e6b25..fc1fae34 100644 --- a/example/network/lwip_startup/configs/pd2008_aarch64_test_lwip_startup.config +++ b/example/network/lwip_startup/configs/pd2008_aarch64_test_lwip_startup.config @@ -5,6 +5,7 @@ CONFIG_USE_ETH=y CONFIG_DEFAULT_LINKER_SCRIPT=y CONFIG_IMAGE_MAX_LENGTH=0x2000000 CONFIG_USE_LWIP=y +CONFIG_LWIP_FGMAC=y # CONFIG_LWIP_NO_SYS is not set CONFIG_LWIP_USE_MEM_HEAP=y CONFIG_MEM_SIZE=2 diff --git a/example/network/lwip_startup/sdkconfig b/example/network/lwip_startup/sdkconfig index 66fd292f..4c591700 100644 --- a/example/network/lwip_startup/sdkconfig +++ b/example/network/lwip_startup/sdkconfig @@ -50,45 +50,50 @@ CONFIG_MAX_XLAT_TABLES=256 # # Soc configuration # -# CONFIG_TARGET_PE2204 is not set +CONFIG_TARGET_PE2204=y # CONFIG_TARGET_PE2202 is not set # CONFIG_TARGET_PE2201 is not set # CONFIG_TARGET_PD1904 is not set # CONFIG_TARGET_PD2008 is not set # CONFIG_TARGET_PD2308 is not set # CONFIG_TARGET_PS2316 is not set -CONFIG_TARGET_PD2408=y +# CONFIG_TARGET_PD2408 is not set # CONFIG_TARGET_QEMU_VIRT is not set -CONFIG_SOC_NAME="pd2408" -CONFIG_SOC_CORE_NUM=8 +CONFIG_SOC_NAME="pe220x" +CONFIG_TARGET_TYPE_NAME="pe2204" +CONFIG_SOC_CORE_NUM=4 CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 +CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # # Board Configuration # -CONFIG_BOARD_NAME="test_a" +CONFIG_BOARD_NAME="phytiumpi" # CONFIG_USE_SPI_IOPAD is not set # CONFIG_USE_GPIO_IOPAD is not set +# CONFIG_USE_CAN_IOPAD is not set # CONFIG_USE_QSPI_IOPAD is not set # CONFIG_USE_PWM_IOPAD is not set +# CONFIG_USE_MIO_IOPAD is not set # CONFIG_USE_TACHO_IOPAD is not set # CONFIG_USE_UART_IOPAD is not set # CONFIG_USE_THIRD_PARTY_IOPAD is not set -CONFIG_PD2408_TEST_A_BOARD=y +# CONFIG_E2000Q_DEMO_BOARD is not set +CONFIG_PHYTIUMPI_FIREFLY_BOARD=y # # IO mux configuration when board start up # # end of IO mux configuration when board start up -# CONFIG_PD2408_TEST_B_BOARD is not set # CONFIG_CUS_DEMO_BOARD is not set # @@ -113,6 +118,8 @@ CONFIG_LOG_ERROR=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set @@ -133,7 +140,6 @@ CONFIG_USE_SERIAL=y # Usart Configuration # CONFIG_ENABLE_Pl011_UART=y -# CONFIG_USE_SERIAL_V2 is not set # end of Usart Configuration # CONFIG_USE_GPIO is not set @@ -142,10 +148,11 @@ CONFIG_USE_ETH=y # # Eth Configuration # -# CONFIG_ENABLE_FXMAC is not set +CONFIG_ENABLE_FXMAC=y # CONFIG_ENABLE_FGMAC is not set -CONFIG_ENABLE_FXMAC_V2=y # CONFIG_ENABLE_E1000E is not set +CONFIG_FXMAC_PHY_COMMON=y +# CONFIG_FXMAC_PHY_YT is not set # end of Eth Configuration # CONFIG_USE_CAN is not set @@ -166,7 +173,7 @@ CONFIG_ENABLE_FXMAC_V2=y # CONFIG_USE_SCMI_MHU is not set # CONFIG_USE_I2S is not set # CONFIG_USE_I3C is not set -CONFIG_USE_MSG=y +# CONFIG_USE_MSG is not set # CONFIG_USE_DEVICE is not set # end of Drivers configuration @@ -233,6 +240,7 @@ CONFIG_STACK_SIZE=0x400 # FreeRTOS Uart Drivers # CONFIG_FREERTOS_USE_UART=y +# CONFIG_FREERTOS_USE_SERIAL_V2 is not set # end of FreeRTOS Uart Drivers # @@ -256,9 +264,9 @@ CONFIG_FREERTOS_USE_UART=y # # FreeRTOS Eth Drivers # -# CONFIG_FREERTOS_USE_XMAC is not set +CONFIG_FREERTOS_USE_XMAC=y # CONFIG_FREERTOS_USE_GMAC is not set -CONFIG_FREERTOS_USE_XMAC_V2=y +# CONFIG_FREERTOS_USE_XMAC_V2 is not set # end of FreeRTOS Eth Drivers # @@ -291,6 +299,7 @@ CONFIG_FREERTOS_USE_XMAC_V2=y # FreeRTOS I2c Drivers # # CONFIG_FREERTOS_USE_I2C is not set +# CONFIG_FREERTOS_USE_FI2C_V2 is not set # end of FreeRTOS I2c Drivers # @@ -334,8 +343,7 @@ CONFIG_USE_LWIP=y # # LWIP Port Configuration # -# CONFIG_LWIP_FXMAC is not set -CONFIG_LWIP_FXMAC_V2=y +CONFIG_LWIP_FXMAC=y # CONFIG_LWIP_FGMAC is not set # CONFIG_LWIP_E1000E is not set # CONFIG_LWIP_FSDIF is not set @@ -422,7 +430,7 @@ CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y # # IGMP # -# CONFIG_LWIP_IGMP_EN is not set +CONFIG_LWIP_IGMP_EN=y # end of IGMP # diff --git a/example/network/lwip_startup/sdkconfig.h b/example/network/lwip_startup/sdkconfig.h index 1ae445a0..bf099ccc 100644 --- a/example/network/lwip_startup/sdkconfig.h +++ b/example/network/lwip_startup/sdkconfig.h @@ -46,42 +46,47 @@ /* Soc configuration */ -/* CONFIG_TARGET_PE2204 is not set */ +#define CONFIG_TARGET_PE2204 /* CONFIG_TARGET_PE2202 is not set */ /* CONFIG_TARGET_PE2201 is not set */ /* CONFIG_TARGET_PD1904 is not set */ /* CONFIG_TARGET_PD2008 is not set */ /* CONFIG_TARGET_PD2308 is not set */ /* CONFIG_TARGET_PS2316 is not set */ -#define CONFIG_TARGET_PD2408 +/* CONFIG_TARGET_PD2408 is not set */ /* CONFIG_TARGET_QEMU_VIRT is not set */ -#define CONFIG_SOC_NAME "pd2408" -#define CONFIG_SOC_CORE_NUM 8 +#define CONFIG_SOC_NAME "pe220x" +#define CONFIG_TARGET_TYPE_NAME "pe2204" +#define CONFIG_SOC_CORE_NUM 4 #define CONFIG_F32BIT_MEMORY_ADDRESS 0x80000000 #define CONFIG_F32BIT_MEMORY_LENGTH 0x80000000 #define CONFIG_F64BIT_MEMORY_ADDRESS 0x2000000000 #define CONFIG_F64BIT_MEMORY_LENGTH 0x800000000 +#define CONFIG_TARGET_PE220X #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ -#define CONFIG_BOARD_NAME "test_a" +#define CONFIG_BOARD_NAME "phytiumpi" /* CONFIG_USE_SPI_IOPAD is not set */ /* CONFIG_USE_GPIO_IOPAD is not set */ +/* CONFIG_USE_CAN_IOPAD is not set */ /* CONFIG_USE_QSPI_IOPAD is not set */ /* CONFIG_USE_PWM_IOPAD is not set */ +/* CONFIG_USE_MIO_IOPAD is not set */ /* CONFIG_USE_TACHO_IOPAD is not set */ /* CONFIG_USE_UART_IOPAD is not set */ /* CONFIG_USE_THIRD_PARTY_IOPAD is not set */ -#define CONFIG_PD2408_TEST_A_BOARD +/* CONFIG_E2000Q_DEMO_BOARD is not set */ +#define CONFIG_PHYTIUMPI_FIREFLY_BOARD /* IO mux configuration when board start up */ /* end of IO mux configuration when board start up */ -/* CONFIG_PD2408_TEST_B_BOARD is not set */ /* CONFIG_CUS_DEMO_BOARD is not set */ /* Build project name */ @@ -104,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ @@ -122,17 +129,17 @@ /* Usart Configuration */ #define CONFIG_ENABLE_Pl011_UART -/* CONFIG_USE_SERIAL_V2 is not set */ /* end of Usart Configuration */ /* CONFIG_USE_GPIO is not set */ #define CONFIG_USE_ETH /* Eth Configuration */ -/* CONFIG_ENABLE_FXMAC is not set */ +#define CONFIG_ENABLE_FXMAC /* CONFIG_ENABLE_FGMAC is not set */ -#define CONFIG_ENABLE_FXMAC_V2 /* CONFIG_ENABLE_E1000E is not set */ +#define CONFIG_FXMAC_PHY_COMMON +/* CONFIG_FXMAC_PHY_YT is not set */ /* end of Eth Configuration */ /* CONFIG_USE_CAN is not set */ /* CONFIG_USE_I2C is not set */ @@ -152,7 +159,7 @@ /* CONFIG_USE_SCMI_MHU is not set */ /* CONFIG_USE_I2S is not set */ /* CONFIG_USE_I3C is not set */ -#define CONFIG_USE_MSG +/* CONFIG_USE_MSG is not set */ /* CONFIG_USE_DEVICE is not set */ /* end of Drivers configuration */ @@ -210,6 +217,7 @@ /* FreeRTOS Uart Drivers */ #define CONFIG_FREERTOS_USE_UART +/* CONFIG_FREERTOS_USE_SERIAL_V2 is not set */ /* end of FreeRTOS Uart Drivers */ /* FreeRTOS Pwm Drivers */ @@ -229,9 +237,9 @@ /* FreeRTOS Eth Drivers */ -/* CONFIG_FREERTOS_USE_XMAC is not set */ +#define CONFIG_FREERTOS_USE_XMAC /* CONFIG_FREERTOS_USE_GMAC is not set */ -#define CONFIG_FREERTOS_USE_XMAC_V2 +/* CONFIG_FREERTOS_USE_XMAC_V2 is not set */ /* end of FreeRTOS Eth Drivers */ /* FreeRTOS Spim Drivers */ @@ -259,6 +267,7 @@ /* FreeRTOS I2c Drivers */ /* CONFIG_FREERTOS_USE_I2C is not set */ +/* CONFIG_FREERTOS_USE_FI2C_V2 is not set */ /* end of FreeRTOS I2c Drivers */ /* FreeRTOS Mio Drivers */ @@ -292,8 +301,7 @@ /* LWIP Port Configuration */ -/* CONFIG_LWIP_FXMAC is not set */ -#define CONFIG_LWIP_FXMAC_V2 +#define CONFIG_LWIP_FXMAC /* CONFIG_LWIP_FGMAC is not set */ /* CONFIG_LWIP_E1000E is not set */ /* CONFIG_LWIP_FSDIF is not set */ @@ -369,7 +377,7 @@ /* IGMP */ -/* CONFIG_LWIP_IGMP_EN is not set */ +#define CONFIG_LWIP_IGMP_EN /* end of IGMP */ /* DNS */ diff --git a/example/network/sockets/udp_multicast/sdkconfig b/example/network/sockets/udp_multicast/sdkconfig index 75f48a6c..51b55517 100644 --- a/example/network/sockets/udp_multicast/sdkconfig +++ b/example/network/sockets/udp_multicast/sdkconfig @@ -87,6 +87,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -134,6 +135,8 @@ CONFIG_LOG_INFO=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set @@ -254,6 +257,7 @@ CONFIG_STACK_SIZE=0x400 # FreeRTOS Uart Drivers # CONFIG_FREERTOS_USE_UART=y +# CONFIG_FREERTOS_USE_SERIAL_V2 is not set # end of FreeRTOS Uart Drivers # @@ -279,12 +283,14 @@ CONFIG_FREERTOS_USE_UART=y # CONFIG_FREERTOS_USE_XMAC=y # CONFIG_FREERTOS_USE_GMAC is not set +# CONFIG_FREERTOS_USE_XMAC_V2 is not set # end of FreeRTOS Eth Drivers # # FreeRTOS Spim Drivers # # CONFIG_FREERTOS_USE_FSPIM is not set +# CONFIG_FREERTOS_USE_FSPIM_V2 is not set # end of FreeRTOS Spim Drivers # @@ -310,6 +316,7 @@ CONFIG_FREERTOS_USE_XMAC=y # FreeRTOS I2c Drivers # # CONFIG_FREERTOS_USE_I2C is not set +# CONFIG_FREERTOS_USE_FI2C_V2 is not set # end of FreeRTOS I2c Drivers # diff --git a/example/network/sockets/udp_multicast/sdkconfig.h b/example/network/sockets/udp_multicast/sdkconfig.h index 1b614769..6657dd31 100644 --- a/example/network/sockets/udp_multicast/sdkconfig.h +++ b/example/network/sockets/udp_multicast/sdkconfig.h @@ -80,6 +80,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -122,6 +123,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ @@ -228,6 +231,7 @@ /* FreeRTOS Uart Drivers */ #define CONFIG_FREERTOS_USE_UART +/* CONFIG_FREERTOS_USE_SERIAL_V2 is not set */ /* end of FreeRTOS Uart Drivers */ /* FreeRTOS Pwm Drivers */ @@ -249,11 +253,13 @@ #define CONFIG_FREERTOS_USE_XMAC /* CONFIG_FREERTOS_USE_GMAC is not set */ +/* CONFIG_FREERTOS_USE_XMAC_V2 is not set */ /* end of FreeRTOS Eth Drivers */ /* FreeRTOS Spim Drivers */ /* CONFIG_FREERTOS_USE_FSPIM is not set */ +/* CONFIG_FREERTOS_USE_FSPIM_V2 is not set */ /* end of FreeRTOS Spim Drivers */ /* FreeRTOS DMA Drivers */ @@ -275,6 +281,7 @@ /* FreeRTOS I2c Drivers */ /* CONFIG_FREERTOS_USE_I2C is not set */ +/* CONFIG_FREERTOS_USE_FI2C_V2 is not set */ /* end of FreeRTOS I2c Drivers */ /* FreeRTOS Mio Drivers */ diff --git a/example/network/wlan/sdkconfig b/example/network/wlan/sdkconfig index 6f6b7f2f..867dd42e 100644 --- a/example/network/wlan/sdkconfig +++ b/example/network/wlan/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_ERROR=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set @@ -230,6 +233,7 @@ CONFIG_STACK_SIZE=0x400 # FreeRTOS Uart Drivers # CONFIG_FREERTOS_USE_UART=y +# CONFIG_FREERTOS_USE_SERIAL_V2 is not set # end of FreeRTOS Uart Drivers # @@ -255,12 +259,14 @@ CONFIG_FREERTOS_USE_UART=y # # CONFIG_FREERTOS_USE_XMAC is not set # CONFIG_FREERTOS_USE_GMAC is not set +# CONFIG_FREERTOS_USE_XMAC_V2 is not set # end of FreeRTOS Eth Drivers # # FreeRTOS Spim Drivers # # CONFIG_FREERTOS_USE_FSPIM is not set +# CONFIG_FREERTOS_USE_FSPIM_V2 is not set # end of FreeRTOS Spim Drivers # @@ -286,6 +292,7 @@ CONFIG_FREERTOS_USE_UART=y # FreeRTOS I2c Drivers # # CONFIG_FREERTOS_USE_I2C is not set +# CONFIG_FREERTOS_USE_FI2C_V2 is not set # end of FreeRTOS I2c Drivers # diff --git a/example/network/wlan/sdkconfig.h b/example/network/wlan/sdkconfig.h index 47f5b069..c256a78e 100644 --- a/example/network/wlan/sdkconfig.h +++ b/example/network/wlan/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ @@ -209,6 +212,7 @@ /* FreeRTOS Uart Drivers */ #define CONFIG_FREERTOS_USE_UART +/* CONFIG_FREERTOS_USE_SERIAL_V2 is not set */ /* end of FreeRTOS Uart Drivers */ /* FreeRTOS Pwm Drivers */ @@ -230,11 +234,13 @@ /* CONFIG_FREERTOS_USE_XMAC is not set */ /* CONFIG_FREERTOS_USE_GMAC is not set */ +/* CONFIG_FREERTOS_USE_XMAC_V2 is not set */ /* end of FreeRTOS Eth Drivers */ /* FreeRTOS Spim Drivers */ /* CONFIG_FREERTOS_USE_FSPIM is not set */ +/* CONFIG_FREERTOS_USE_FSPIM_V2 is not set */ /* end of FreeRTOS Spim Drivers */ /* FreeRTOS DMA Drivers */ @@ -256,6 +262,7 @@ /* FreeRTOS I2c Drivers */ /* CONFIG_FREERTOS_USE_I2C is not set */ +/* CONFIG_FREERTOS_USE_FI2C_V2 is not set */ /* end of FreeRTOS I2c Drivers */ /* FreeRTOS Mio Drivers */ diff --git a/example/peripheral/can/can/sdkconfig b/example/peripheral/can/can/sdkconfig index 8f3e7295..e70c8421 100644 --- a/example/peripheral/can/can/sdkconfig +++ b/example/peripheral/can/can/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_INFO=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set @@ -227,6 +230,7 @@ CONFIG_STACK_SIZE=0x100000 # FreeRTOS Uart Drivers # CONFIG_FREERTOS_USE_UART=y +# CONFIG_FREERTOS_USE_SERIAL_V2 is not set # end of FreeRTOS Uart Drivers # @@ -252,12 +256,14 @@ CONFIG_FREERTOS_USE_UART=y # # CONFIG_FREERTOS_USE_XMAC is not set # CONFIG_FREERTOS_USE_GMAC is not set +# CONFIG_FREERTOS_USE_XMAC_V2 is not set # end of FreeRTOS Eth Drivers # # FreeRTOS Spim Drivers # # CONFIG_FREERTOS_USE_FSPIM is not set +# CONFIG_FREERTOS_USE_FSPIM_V2 is not set # end of FreeRTOS Spim Drivers # @@ -283,6 +289,7 @@ CONFIG_FREERTOS_USE_CAN=y # FreeRTOS I2c Drivers # # CONFIG_FREERTOS_USE_I2C is not set +# CONFIG_FREERTOS_USE_FI2C_V2 is not set # end of FreeRTOS I2c Drivers # diff --git a/example/peripheral/can/can/sdkconfig.h b/example/peripheral/can/can/sdkconfig.h index d549514c..34fda245 100644 --- a/example/peripheral/can/can/sdkconfig.h +++ b/example/peripheral/can/can/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ @@ -206,6 +209,7 @@ /* FreeRTOS Uart Drivers */ #define CONFIG_FREERTOS_USE_UART +/* CONFIG_FREERTOS_USE_SERIAL_V2 is not set */ /* end of FreeRTOS Uart Drivers */ /* FreeRTOS Pwm Drivers */ @@ -227,11 +231,13 @@ /* CONFIG_FREERTOS_USE_XMAC is not set */ /* CONFIG_FREERTOS_USE_GMAC is not set */ +/* CONFIG_FREERTOS_USE_XMAC_V2 is not set */ /* end of FreeRTOS Eth Drivers */ /* FreeRTOS Spim Drivers */ /* CONFIG_FREERTOS_USE_FSPIM is not set */ +/* CONFIG_FREERTOS_USE_FSPIM_V2 is not set */ /* end of FreeRTOS Spim Drivers */ /* FreeRTOS DMA Drivers */ @@ -253,6 +259,7 @@ /* FreeRTOS I2c Drivers */ /* CONFIG_FREERTOS_USE_I2C is not set */ +/* CONFIG_FREERTOS_USE_FI2C_V2 is not set */ /* end of FreeRTOS I2c Drivers */ /* FreeRTOS Mio Drivers */ diff --git a/example/peripheral/can/canfd/sdkconfig b/example/peripheral/can/canfd/sdkconfig index 34e949e9..4523fc42 100644 --- a/example/peripheral/can/canfd/sdkconfig +++ b/example/peripheral/can/canfd/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_INFO=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set @@ -227,6 +230,7 @@ CONFIG_STACK_SIZE=0x100000 # FreeRTOS Uart Drivers # CONFIG_FREERTOS_USE_UART=y +# CONFIG_FREERTOS_USE_SERIAL_V2 is not set # end of FreeRTOS Uart Drivers # @@ -252,12 +256,14 @@ CONFIG_FREERTOS_USE_UART=y # # CONFIG_FREERTOS_USE_XMAC is not set # CONFIG_FREERTOS_USE_GMAC is not set +# CONFIG_FREERTOS_USE_XMAC_V2 is not set # end of FreeRTOS Eth Drivers # # FreeRTOS Spim Drivers # # CONFIG_FREERTOS_USE_FSPIM is not set +# CONFIG_FREERTOS_USE_FSPIM_V2 is not set # end of FreeRTOS Spim Drivers # @@ -283,6 +289,7 @@ CONFIG_FREERTOS_USE_CAN=y # FreeRTOS I2c Drivers # # CONFIG_FREERTOS_USE_I2C is not set +# CONFIG_FREERTOS_USE_FI2C_V2 is not set # end of FreeRTOS I2c Drivers # diff --git a/example/peripheral/can/canfd/sdkconfig.h b/example/peripheral/can/canfd/sdkconfig.h index 79174fe0..4cb808b2 100644 --- a/example/peripheral/can/canfd/sdkconfig.h +++ b/example/peripheral/can/canfd/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ @@ -206,6 +209,7 @@ /* FreeRTOS Uart Drivers */ #define CONFIG_FREERTOS_USE_UART +/* CONFIG_FREERTOS_USE_SERIAL_V2 is not set */ /* end of FreeRTOS Uart Drivers */ /* FreeRTOS Pwm Drivers */ @@ -227,11 +231,13 @@ /* CONFIG_FREERTOS_USE_XMAC is not set */ /* CONFIG_FREERTOS_USE_GMAC is not set */ +/* CONFIG_FREERTOS_USE_XMAC_V2 is not set */ /* end of FreeRTOS Eth Drivers */ /* FreeRTOS Spim Drivers */ /* CONFIG_FREERTOS_USE_FSPIM is not set */ +/* CONFIG_FREERTOS_USE_FSPIM_V2 is not set */ /* end of FreeRTOS Spim Drivers */ /* FreeRTOS DMA Drivers */ @@ -253,6 +259,7 @@ /* FreeRTOS I2c Drivers */ /* CONFIG_FREERTOS_USE_I2C is not set */ +/* CONFIG_FREERTOS_USE_FI2C_V2 is not set */ /* end of FreeRTOS I2c Drivers */ /* FreeRTOS Mio Drivers */ diff --git a/example/peripheral/dma/ddma/sdkconfig b/example/peripheral/dma/ddma/sdkconfig index 91838dbb..7564abe8 100644 --- a/example/peripheral/dma/ddma/sdkconfig +++ b/example/peripheral/dma/ddma/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_ERROR=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set @@ -230,6 +233,7 @@ CONFIG_STACK_SIZE=0x400 # FreeRTOS Uart Drivers # CONFIG_FREERTOS_USE_UART=y +# CONFIG_FREERTOS_USE_SERIAL_V2 is not set # end of FreeRTOS Uart Drivers # @@ -255,12 +259,14 @@ CONFIG_FREERTOS_USE_UART=y # # CONFIG_FREERTOS_USE_XMAC is not set # CONFIG_FREERTOS_USE_GMAC is not set +# CONFIG_FREERTOS_USE_XMAC_V2 is not set # end of FreeRTOS Eth Drivers # # FreeRTOS Spim Drivers # CONFIG_FREERTOS_USE_FSPIM=y +# CONFIG_FREERTOS_USE_FSPIM_V2 is not set # end of FreeRTOS Spim Drivers # @@ -286,6 +292,7 @@ CONFIG_FREERTOS_USE_FDDMA=y # FreeRTOS I2c Drivers # # CONFIG_FREERTOS_USE_I2C is not set +# CONFIG_FREERTOS_USE_FI2C_V2 is not set # end of FreeRTOS I2c Drivers # diff --git a/example/peripheral/dma/ddma/sdkconfig.h b/example/peripheral/dma/ddma/sdkconfig.h index c5c6daa6..8fc10ac7 100644 --- a/example/peripheral/dma/ddma/sdkconfig.h +++ b/example/peripheral/dma/ddma/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ @@ -209,6 +212,7 @@ /* FreeRTOS Uart Drivers */ #define CONFIG_FREERTOS_USE_UART +/* CONFIG_FREERTOS_USE_SERIAL_V2 is not set */ /* end of FreeRTOS Uart Drivers */ /* FreeRTOS Pwm Drivers */ @@ -230,11 +234,13 @@ /* CONFIG_FREERTOS_USE_XMAC is not set */ /* CONFIG_FREERTOS_USE_GMAC is not set */ +/* CONFIG_FREERTOS_USE_XMAC_V2 is not set */ /* end of FreeRTOS Eth Drivers */ /* FreeRTOS Spim Drivers */ #define CONFIG_FREERTOS_USE_FSPIM +/* CONFIG_FREERTOS_USE_FSPIM_V2 is not set */ /* end of FreeRTOS Spim Drivers */ /* FreeRTOS DMA Drivers */ @@ -256,6 +262,7 @@ /* FreeRTOS I2c Drivers */ /* CONFIG_FREERTOS_USE_I2C is not set */ +/* CONFIG_FREERTOS_USE_FI2C_V2 is not set */ /* end of FreeRTOS I2c Drivers */ /* FreeRTOS Mio Drivers */ diff --git a/example/peripheral/dma/gdma/sdkconfig b/example/peripheral/dma/gdma/sdkconfig index 0fb07758..b113de0a 100644 --- a/example/peripheral/dma/gdma/sdkconfig +++ b/example/peripheral/dma/gdma/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_EXTRA_INFO=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set @@ -228,6 +231,7 @@ CONFIG_STACK_SIZE=0x400 # FreeRTOS Uart Drivers # CONFIG_FREERTOS_USE_UART=y +# CONFIG_FREERTOS_USE_SERIAL_V2 is not set # end of FreeRTOS Uart Drivers # @@ -253,12 +257,14 @@ CONFIG_FREERTOS_USE_UART=y # # CONFIG_FREERTOS_USE_XMAC is not set # CONFIG_FREERTOS_USE_GMAC is not set +# CONFIG_FREERTOS_USE_XMAC_V2 is not set # end of FreeRTOS Eth Drivers # # FreeRTOS Spim Drivers # # CONFIG_FREERTOS_USE_FSPIM is not set +# CONFIG_FREERTOS_USE_FSPIM_V2 is not set # end of FreeRTOS Spim Drivers # @@ -284,6 +290,7 @@ CONFIG_FREERTOS_USE_FGDMA=y # FreeRTOS I2c Drivers # # CONFIG_FREERTOS_USE_I2C is not set +# CONFIG_FREERTOS_USE_FI2C_V2 is not set # end of FreeRTOS I2c Drivers # diff --git a/example/peripheral/dma/gdma/sdkconfig.h b/example/peripheral/dma/gdma/sdkconfig.h index 16b0d5ff..a0ebe33c 100644 --- a/example/peripheral/dma/gdma/sdkconfig.h +++ b/example/peripheral/dma/gdma/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ @@ -207,6 +210,7 @@ /* FreeRTOS Uart Drivers */ #define CONFIG_FREERTOS_USE_UART +/* CONFIG_FREERTOS_USE_SERIAL_V2 is not set */ /* end of FreeRTOS Uart Drivers */ /* FreeRTOS Pwm Drivers */ @@ -228,11 +232,13 @@ /* CONFIG_FREERTOS_USE_XMAC is not set */ /* CONFIG_FREERTOS_USE_GMAC is not set */ +/* CONFIG_FREERTOS_USE_XMAC_V2 is not set */ /* end of FreeRTOS Eth Drivers */ /* FreeRTOS Spim Drivers */ /* CONFIG_FREERTOS_USE_FSPIM is not set */ +/* CONFIG_FREERTOS_USE_FSPIM_V2 is not set */ /* end of FreeRTOS Spim Drivers */ /* FreeRTOS DMA Drivers */ @@ -254,6 +260,7 @@ /* FreeRTOS I2c Drivers */ /* CONFIG_FREERTOS_USE_I2C is not set */ +/* CONFIG_FREERTOS_USE_FI2C_V2 is not set */ /* end of FreeRTOS I2c Drivers */ /* FreeRTOS Mio Drivers */ diff --git a/example/peripheral/gpio/sdkconfig b/example/peripheral/gpio/sdkconfig index 9ea3c5e8..997bda7c 100644 --- a/example/peripheral/gpio/sdkconfig +++ b/example/peripheral/gpio/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_EXTRA_INFO=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/peripheral/gpio/sdkconfig.h b/example/peripheral/gpio/sdkconfig.h index b1c6e5fb..2aede9ea 100644 --- a/example/peripheral/gpio/sdkconfig.h +++ b/example/peripheral/gpio/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/peripheral/i2c/i2c/sdkconfig b/example/peripheral/i2c/i2c/sdkconfig index c188756d..aff9b369 100644 --- a/example/peripheral/i2c/i2c/sdkconfig +++ b/example/peripheral/i2c/i2c/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_ERROR=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set @@ -235,6 +238,7 @@ CONFIG_STACK_SIZE=0x400 # FreeRTOS Uart Drivers # CONFIG_FREERTOS_USE_UART=y +# CONFIG_FREERTOS_USE_SERIAL_V2 is not set # end of FreeRTOS Uart Drivers # @@ -260,12 +264,14 @@ CONFIG_FREERTOS_USE_UART=y # # CONFIG_FREERTOS_USE_XMAC is not set # CONFIG_FREERTOS_USE_GMAC is not set +# CONFIG_FREERTOS_USE_XMAC_V2 is not set # end of FreeRTOS Eth Drivers # # FreeRTOS Spim Drivers # # CONFIG_FREERTOS_USE_FSPIM is not set +# CONFIG_FREERTOS_USE_FSPIM_V2 is not set # end of FreeRTOS Spim Drivers # @@ -291,6 +297,7 @@ CONFIG_FREERTOS_USE_UART=y # FreeRTOS I2c Drivers # CONFIG_FREERTOS_USE_I2C=y +# CONFIG_FREERTOS_USE_FI2C_V2 is not set # end of FreeRTOS I2c Drivers # diff --git a/example/peripheral/i2c/i2c/sdkconfig.h b/example/peripheral/i2c/i2c/sdkconfig.h index 19882d9e..9f0474e7 100644 --- a/example/peripheral/i2c/i2c/sdkconfig.h +++ b/example/peripheral/i2c/i2c/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ @@ -212,6 +215,7 @@ /* FreeRTOS Uart Drivers */ #define CONFIG_FREERTOS_USE_UART +/* CONFIG_FREERTOS_USE_SERIAL_V2 is not set */ /* end of FreeRTOS Uart Drivers */ /* FreeRTOS Pwm Drivers */ @@ -233,11 +237,13 @@ /* CONFIG_FREERTOS_USE_XMAC is not set */ /* CONFIG_FREERTOS_USE_GMAC is not set */ +/* CONFIG_FREERTOS_USE_XMAC_V2 is not set */ /* end of FreeRTOS Eth Drivers */ /* FreeRTOS Spim Drivers */ /* CONFIG_FREERTOS_USE_FSPIM is not set */ +/* CONFIG_FREERTOS_USE_FSPIM_V2 is not set */ /* end of FreeRTOS Spim Drivers */ /* FreeRTOS DMA Drivers */ @@ -259,6 +265,7 @@ /* FreeRTOS I2c Drivers */ #define CONFIG_FREERTOS_USE_I2C +/* CONFIG_FREERTOS_USE_FI2C_V2 is not set */ /* end of FreeRTOS I2c Drivers */ /* FreeRTOS Mio Drivers */ diff --git a/example/peripheral/i2c/i2c_msg/sdkconfig b/example/peripheral/i2c/i2c_msg/sdkconfig index 0895a09d..d0dff045 100644 --- a/example/peripheral/i2c/i2c_msg/sdkconfig +++ b/example/peripheral/i2c/i2c_msg/sdkconfig @@ -68,6 +68,7 @@ CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -113,6 +114,8 @@ CONFIG_LOG_ERROR=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/peripheral/i2c/i2c_msg/sdkconfig.h b/example/peripheral/i2c/i2c_msg/sdkconfig.h index 8593eb08..ac315063 100644 --- a/example/peripheral/i2c/i2c_msg/sdkconfig.h +++ b/example/peripheral/i2c/i2c_msg/sdkconfig.h @@ -64,6 +64,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -104,6 +105,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/peripheral/i2s/sdkconfig b/example/peripheral/i2s/sdkconfig index c343a603..fb305678 100644 --- a/example/peripheral/i2s/sdkconfig +++ b/example/peripheral/i2s/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_NONE=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set @@ -255,6 +258,7 @@ CONFIG_STACK_SIZE=0x400 # FreeRTOS Uart Drivers # CONFIG_FREERTOS_USE_UART=y +# CONFIG_FREERTOS_USE_SERIAL_V2 is not set # end of FreeRTOS Uart Drivers # @@ -280,12 +284,14 @@ CONFIG_FREERTOS_USE_UART=y # # CONFIG_FREERTOS_USE_XMAC is not set # CONFIG_FREERTOS_USE_GMAC is not set +# CONFIG_FREERTOS_USE_XMAC_V2 is not set # end of FreeRTOS Eth Drivers # # FreeRTOS Spim Drivers # # CONFIG_FREERTOS_USE_FSPIM is not set +# CONFIG_FREERTOS_USE_FSPIM_V2 is not set # end of FreeRTOS Spim Drivers # @@ -311,6 +317,7 @@ CONFIG_FREERTOS_USE_FDDMA=y # FreeRTOS I2c Drivers # CONFIG_FREERTOS_USE_I2C=y +# CONFIG_FREERTOS_USE_FI2C_V2 is not set # end of FreeRTOS I2c Drivers # diff --git a/example/peripheral/i2s/sdkconfig.h b/example/peripheral/i2s/sdkconfig.h index a95e5811..bd3ee1d9 100644 --- a/example/peripheral/i2s/sdkconfig.h +++ b/example/peripheral/i2s/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ @@ -229,6 +232,7 @@ /* FreeRTOS Uart Drivers */ #define CONFIG_FREERTOS_USE_UART +/* CONFIG_FREERTOS_USE_SERIAL_V2 is not set */ /* end of FreeRTOS Uart Drivers */ /* FreeRTOS Pwm Drivers */ @@ -250,11 +254,13 @@ /* CONFIG_FREERTOS_USE_XMAC is not set */ /* CONFIG_FREERTOS_USE_GMAC is not set */ +/* CONFIG_FREERTOS_USE_XMAC_V2 is not set */ /* end of FreeRTOS Eth Drivers */ /* FreeRTOS Spim Drivers */ /* CONFIG_FREERTOS_USE_FSPIM is not set */ +/* CONFIG_FREERTOS_USE_FSPIM_V2 is not set */ /* end of FreeRTOS Spim Drivers */ /* FreeRTOS DMA Drivers */ @@ -276,6 +282,7 @@ /* FreeRTOS I2c Drivers */ #define CONFIG_FREERTOS_USE_I2C +/* CONFIG_FREERTOS_USE_FI2C_V2 is not set */ /* end of FreeRTOS I2c Drivers */ /* FreeRTOS Mio Drivers */ diff --git a/example/peripheral/media/lvgl_demo/sdkconfig b/example/peripheral/media/lvgl_demo/sdkconfig index 9b86ce46..4367ff1b 100644 --- a/example/peripheral/media/lvgl_demo/sdkconfig +++ b/example/peripheral/media/lvgl_demo/sdkconfig @@ -118,6 +118,8 @@ CONFIG_LOG_DEBUG=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/peripheral/media/lvgl_demo/sdkconfig.h b/example/peripheral/media/lvgl_demo/sdkconfig.h index 309a3fcf..ff1f17ca 100644 --- a/example/peripheral/media/lvgl_demo/sdkconfig.h +++ b/example/peripheral/media/lvgl_demo/sdkconfig.h @@ -109,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/peripheral/media/lvgl_indev/sdkconfig b/example/peripheral/media/lvgl_indev/sdkconfig index 9b76cd9e..2ca293c7 100644 --- a/example/peripheral/media/lvgl_indev/sdkconfig +++ b/example/peripheral/media/lvgl_indev/sdkconfig @@ -118,6 +118,8 @@ CONFIG_LOG_DEBUG=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/peripheral/media/lvgl_indev/sdkconfig.h b/example/peripheral/media/lvgl_indev/sdkconfig.h index 48c0aa7f..5d529eb8 100644 --- a/example/peripheral/media/lvgl_indev/sdkconfig.h +++ b/example/peripheral/media/lvgl_indev/sdkconfig.h @@ -109,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/peripheral/media/lvgl_ui/sdkconfig b/example/peripheral/media/lvgl_ui/sdkconfig index 9b76cd9e..2ca293c7 100644 --- a/example/peripheral/media/lvgl_ui/sdkconfig +++ b/example/peripheral/media/lvgl_ui/sdkconfig @@ -118,6 +118,8 @@ CONFIG_LOG_DEBUG=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/peripheral/media/lvgl_ui/sdkconfig.h b/example/peripheral/media/lvgl_ui/sdkconfig.h index 48c0aa7f..5d529eb8 100644 --- a/example/peripheral/media/lvgl_ui/sdkconfig.h +++ b/example/peripheral/media/lvgl_ui/sdkconfig.h @@ -109,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/peripheral/media/media_test/sdkconfig b/example/peripheral/media/media_test/sdkconfig index f9aba351..e0280ad5 100644 --- a/example/peripheral/media/media_test/sdkconfig +++ b/example/peripheral/media/media_test/sdkconfig @@ -118,6 +118,8 @@ CONFIG_LOG_EXTRA_INFO=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/peripheral/media/media_test/sdkconfig.h b/example/peripheral/media/media_test/sdkconfig.h index 0e8dd28d..b4efdb3d 100644 --- a/example/peripheral/media/media_test/sdkconfig.h +++ b/example/peripheral/media/media_test/sdkconfig.h @@ -109,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/peripheral/pwm/sdkconfig b/example/peripheral/pwm/sdkconfig index 303ba9f1..b52773a0 100644 --- a/example/peripheral/pwm/sdkconfig +++ b/example/peripheral/pwm/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_INFO=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/peripheral/pwm/sdkconfig.h b/example/peripheral/pwm/sdkconfig.h index f68941e8..e7473d2d 100644 --- a/example/peripheral/pwm/sdkconfig.h +++ b/example/peripheral/pwm/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/peripheral/qspi/sdkconfig b/example/peripheral/qspi/sdkconfig index d50213b0..e8b241b9 100644 --- a/example/peripheral/qspi/sdkconfig +++ b/example/peripheral/qspi/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_INFO=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/peripheral/qspi/sdkconfig.h b/example/peripheral/qspi/sdkconfig.h index d9cc5c77..8202e07c 100644 --- a/example/peripheral/qspi/sdkconfig.h +++ b/example/peripheral/qspi/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/peripheral/sdif/sdkconfig b/example/peripheral/sdif/sdkconfig index a236de4c..1773c1b3 100644 --- a/example/peripheral/sdif/sdkconfig +++ b/example/peripheral/sdif/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_EXTRA_INFO=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/peripheral/sdif/sdkconfig.h b/example/peripheral/sdif/sdkconfig.h index 97c11934..283ae8a4 100644 --- a/example/peripheral/sdif/sdkconfig.h +++ b/example/peripheral/sdif/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/peripheral/spi/sdkconfig b/example/peripheral/spi/sdkconfig index 6641e429..463788ed 100644 --- a/example/peripheral/spi/sdkconfig +++ b/example/peripheral/spi/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_EXTRA_INFO=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/peripheral/spi/sdkconfig.h b/example/peripheral/spi/sdkconfig.h index 82314449..1d2cbb24 100644 --- a/example/peripheral/spi/sdkconfig.h +++ b/example/peripheral/spi/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/peripheral/timer_tacho/sdkconfig b/example/peripheral/timer_tacho/sdkconfig index 018db277..439b32b4 100644 --- a/example/peripheral/timer_tacho/sdkconfig +++ b/example/peripheral/timer_tacho/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_ERROR=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set @@ -233,6 +236,7 @@ CONFIG_STACK_SIZE=0x400 # FreeRTOS Uart Drivers # CONFIG_FREERTOS_USE_UART=y +# CONFIG_FREERTOS_USE_SERIAL_V2 is not set # end of FreeRTOS Uart Drivers # @@ -258,12 +262,14 @@ CONFIG_FREERTOS_USE_UART=y # # CONFIG_FREERTOS_USE_XMAC is not set # CONFIG_FREERTOS_USE_GMAC is not set +# CONFIG_FREERTOS_USE_XMAC_V2 is not set # end of FreeRTOS Eth Drivers # # FreeRTOS Spim Drivers # # CONFIG_FREERTOS_USE_FSPIM is not set +# CONFIG_FREERTOS_USE_FSPIM_V2 is not set # end of FreeRTOS Spim Drivers # @@ -289,6 +295,7 @@ CONFIG_FREERTOS_USE_UART=y # FreeRTOS I2c Drivers # # CONFIG_FREERTOS_USE_I2C is not set +# CONFIG_FREERTOS_USE_FI2C_V2 is not set # end of FreeRTOS I2c Drivers # diff --git a/example/peripheral/timer_tacho/sdkconfig.h b/example/peripheral/timer_tacho/sdkconfig.h index 5592d09e..c343601f 100644 --- a/example/peripheral/timer_tacho/sdkconfig.h +++ b/example/peripheral/timer_tacho/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ @@ -210,6 +213,7 @@ /* FreeRTOS Uart Drivers */ #define CONFIG_FREERTOS_USE_UART +/* CONFIG_FREERTOS_USE_SERIAL_V2 is not set */ /* end of FreeRTOS Uart Drivers */ /* FreeRTOS Pwm Drivers */ @@ -231,11 +235,13 @@ /* CONFIG_FREERTOS_USE_XMAC is not set */ /* CONFIG_FREERTOS_USE_GMAC is not set */ +/* CONFIG_FREERTOS_USE_XMAC_V2 is not set */ /* end of FreeRTOS Eth Drivers */ /* FreeRTOS Spim Drivers */ /* CONFIG_FREERTOS_USE_FSPIM is not set */ +/* CONFIG_FREERTOS_USE_FSPIM_V2 is not set */ /* end of FreeRTOS Spim Drivers */ /* FreeRTOS DMA Drivers */ @@ -257,6 +263,7 @@ /* FreeRTOS I2c Drivers */ /* CONFIG_FREERTOS_USE_I2C is not set */ +/* CONFIG_FREERTOS_USE_FI2C_V2 is not set */ /* end of FreeRTOS I2c Drivers */ /* FreeRTOS Mio Drivers */ diff --git a/example/peripheral/usb/usb_device/sdkconfig b/example/peripheral/usb/usb_device/sdkconfig index 49b2b555..0eccd032 100644 --- a/example/peripheral/usb/usb_device/sdkconfig +++ b/example/peripheral/usb/usb_device/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_EXTRA_INFO=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/peripheral/usb/usb_device/sdkconfig.h b/example/peripheral/usb/usb_device/sdkconfig.h index d66702e0..b09da05d 100644 --- a/example/peripheral/usb/usb_device/sdkconfig.h +++ b/example/peripheral/usb/usb_device/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/peripheral/usb/usb_host/makefile b/example/peripheral/usb/usb_host/makefile index d0f4fa8e..842ab841 100644 --- a/example/peripheral/usb/usb_host/makefile +++ b/example/peripheral/usb/usb_host/makefile @@ -26,7 +26,9 @@ else USR_BOOT_DIR ?= /mnt/d/tftpboot endif -image: all +image: + $(MAKE) clean + $(MAKE) all -j @cp ./$(IMAGE_OUT_NAME).elf $(USR_BOOT_DIR)/freertos.elf ifdef CONFIG_OUTPUT_BINARY @cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin diff --git a/example/peripheral/usb/usb_host/sdkconfig b/example/peripheral/usb/usb_host/sdkconfig index ffee6043..432a9246 100644 --- a/example/peripheral/usb/usb_host/sdkconfig +++ b/example/peripheral/usb/usb_host/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_EXTRA_INFO=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/peripheral/usb/usb_host/sdkconfig.h b/example/peripheral/usb/usb_host/sdkconfig.h index b0015372..9e0a4b96 100644 --- a/example/peripheral/usb/usb_host/sdkconfig.h +++ b/example/peripheral/usb/usb_host/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/peripheral/wdt/sdkconfig b/example/peripheral/wdt/sdkconfig index b8a7bdfa..dc95e2f3 100644 --- a/example/peripheral/wdt/sdkconfig +++ b/example/peripheral/wdt/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_ERROR=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/peripheral/wdt/sdkconfig.h b/example/peripheral/wdt/sdkconfig.h index b20b8a46..00897a28 100644 --- a/example/peripheral/wdt/sdkconfig.h +++ b/example/peripheral/wdt/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/storage/fatfs/sdkconfig b/example/storage/fatfs/sdkconfig index b0461faa..a24aca34 100644 --- a/example/storage/fatfs/sdkconfig +++ b/example/storage/fatfs/sdkconfig @@ -79,6 +79,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -126,6 +127,8 @@ CONFIG_LOG_EXTRA_INFO=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/storage/fatfs/sdkconfig.h b/example/storage/fatfs/sdkconfig.h index 5f23a514..6928cbbe 100644 --- a/example/storage/fatfs/sdkconfig.h +++ b/example/storage/fatfs/sdkconfig.h @@ -72,6 +72,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -114,6 +115,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/storage/qspi_spiffs/sdkconfig b/example/storage/qspi_spiffs/sdkconfig index d532471f..c4776d97 100644 --- a/example/storage/qspi_spiffs/sdkconfig +++ b/example/storage/qspi_spiffs/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_INFO=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set @@ -233,6 +236,7 @@ CONFIG_STACK_SIZE=0x400 # FreeRTOS Uart Drivers # CONFIG_FREERTOS_USE_UART=y +# CONFIG_FREERTOS_USE_SERIAL_V2 is not set # end of FreeRTOS Uart Drivers # @@ -258,12 +262,14 @@ CONFIG_FREERTOS_USE_QSPI=y # # CONFIG_FREERTOS_USE_XMAC is not set # CONFIG_FREERTOS_USE_GMAC is not set +# CONFIG_FREERTOS_USE_XMAC_V2 is not set # end of FreeRTOS Eth Drivers # # FreeRTOS Spim Drivers # # CONFIG_FREERTOS_USE_FSPIM is not set +# CONFIG_FREERTOS_USE_FSPIM_V2 is not set # end of FreeRTOS Spim Drivers # @@ -289,6 +295,7 @@ CONFIG_FREERTOS_USE_QSPI=y # FreeRTOS I2c Drivers # # CONFIG_FREERTOS_USE_I2C is not set +# CONFIG_FREERTOS_USE_FI2C_V2 is not set # end of FreeRTOS I2c Drivers # @@ -358,6 +365,7 @@ CONFIG_USE_SPIFFS=y # SPIFFS Configuration # # CONFIG_SPIFFS_ON_FSPIM_SFUD is not set +# CONFIG_SPIFFS_ON_FSPIM_V2_SFUD is not set CONFIG_SPIFFS_ON_FQSPI_SFUD=y # end of SPIFFS Configuration diff --git a/example/storage/qspi_spiffs/sdkconfig.h b/example/storage/qspi_spiffs/sdkconfig.h index 0a628886..97bf6270 100644 --- a/example/storage/qspi_spiffs/sdkconfig.h +++ b/example/storage/qspi_spiffs/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ @@ -210,6 +213,7 @@ /* FreeRTOS Uart Drivers */ #define CONFIG_FREERTOS_USE_UART +/* CONFIG_FREERTOS_USE_SERIAL_V2 is not set */ /* end of FreeRTOS Uart Drivers */ /* FreeRTOS Pwm Drivers */ @@ -231,11 +235,13 @@ /* CONFIG_FREERTOS_USE_XMAC is not set */ /* CONFIG_FREERTOS_USE_GMAC is not set */ +/* CONFIG_FREERTOS_USE_XMAC_V2 is not set */ /* end of FreeRTOS Eth Drivers */ /* FreeRTOS Spim Drivers */ /* CONFIG_FREERTOS_USE_FSPIM is not set */ +/* CONFIG_FREERTOS_USE_FSPIM_V2 is not set */ /* end of FreeRTOS Spim Drivers */ /* FreeRTOS DMA Drivers */ @@ -257,6 +263,7 @@ /* FreeRTOS I2c Drivers */ /* CONFIG_FREERTOS_USE_I2C is not set */ +/* CONFIG_FREERTOS_USE_FI2C_V2 is not set */ /* end of FreeRTOS I2c Drivers */ /* FreeRTOS Mio Drivers */ @@ -316,6 +323,7 @@ /* SPIFFS Configuration */ /* CONFIG_SPIFFS_ON_FSPIM_SFUD is not set */ +/* CONFIG_SPIFFS_ON_FSPIM_V2_SFUD is not set */ #define CONFIG_SPIFFS_ON_FQSPI_SFUD /* end of SPIFFS Configuration */ /* CONFIG_USE_LITTLE_FS is not set */ diff --git a/example/storage/spim_spiffs/sdkconfig b/example/storage/spim_spiffs/sdkconfig index a6dd1608..07552b2a 100644 --- a/example/storage/spim_spiffs/sdkconfig +++ b/example/storage/spim_spiffs/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_ERROR=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/storage/spim_spiffs/sdkconfig.h b/example/storage/spim_spiffs/sdkconfig.h index 0b6f846d..373c1818 100644 --- a/example/storage/spim_spiffs/sdkconfig.h +++ b/example/storage/spim_spiffs/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/system/amp/openamp/common/libmetal_configs.h b/example/system/amp/openamp/common/libmetal_configs.h index 958e8394..c610a26e 100644 --- a/example/system/amp/openamp/common/libmetal_configs.h +++ b/example/system/amp/openamp/common/libmetal_configs.h @@ -42,9 +42,9 @@ extern "C" #define KICK_SGI_NUM_2 2 #define KICK_SGI_NUM_3 3 #define KICK_SGI_NUM_4 4 -/* device name for slave 00 */ -#define SLAVE_00_KICK_DEV_NAME "slave_00_kick" -#define SLAVE_00_SGI KICK_SGI_NUM_1 +/* device name for device 00 */ +#define DEVICE_00_KICK_DEV_NAME "device_00_kick" +#define DEVICE_00_SGI KICK_SGI_NUM_1 #ifdef __cplusplus } diff --git a/example/system/amp/openamp/common/memory_layout.h b/example/system/amp/openamp/common/memory_layout.h index 094f521c..9b28e4b5 100644 --- a/example/system/amp/openamp/common/memory_layout.h +++ b/example/system/amp/openamp/common/memory_layout.h @@ -35,22 +35,22 @@ extern "C" { #endif -/*slave core0*/ -#define SLAVE00_IMAGE_NUM 0 /*镜像位置与amp_config.json中编译排序对应*/ -#define SLAVE00_SOURCE_TABLE_ADDR 0xc0000000 -#define SLAVE00_SOURCE_TABLE_SIZE SLAVE00_KICK_IO_ADDR - SLAVE00_SOURCE_TABLE_ADDR -#define SLAVE00_KICK_IO_ADDR 0xc0020000 -#define SLAVE00_KICK_IO_SIZE SLAVE00_SHARE_MEM_ADDR - SLAVE00_KICK_IO_ADDR +/*device core0*/ +#define DEVICE00_IMAGE_NUM 0 /*镜像位置与amp_config.json中编译排序对应*/ +#define DEVICE00_SOURCE_TABLE_ADDR 0xc0000000 +#define DEVICE00_SOURCE_TABLE_SIZE DEVICE00_KICK_IO_ADDR - DEVICE00_SOURCE_TABLE_ADDR +#define DEVICE00_KICK_IO_ADDR 0xc0020000 +#define DEVICE00_KICK_IO_SIZE DEVICE00_SHARE_MEM_ADDR - DEVICE00_KICK_IO_ADDR /* MEM = |tx vring|rx vring|share buffer| */ -#define SLAVE00_SHARE_MEM_ADDR 0xc1000000 -#define SLAVE00_SHARE_MEM_SIZE 0x1000000 -#define SLAVE00_VRING_SIZE (SLAVE00_SHARE_MEM_SIZE >> 2) -#define SLAVE00_VRING_NUM 0x100 -#define SLAVE00_TX_VRING_ADDR 0xc1000000 -#define SLAVE00_RX_VRING_ADDR (SLAVE00_TX_VRING_ADDR + SLAVE00_VRING_SIZE/2) - -#define SLAVE00_SOURCE_TABLE_ATTRIBUTE (MT_NORMAL|MT_P_RW_U_NA) -#define SLAVE00_SHARE_BUFFER_ATTRIBUTE (MT_NORMAL|MT_P_RW_U_NA) +#define DEVICE00_SHARE_MEM_ADDR 0xc1000000 +#define DEVICE00_SHARE_MEM_SIZE 0x1000000 +#define DEVICE00_VRING_SIZE (DEVICE00_SHARE_MEM_SIZE >> 2) +#define DEVICE00_VRING_NUM 0x100 +#define DEVICE00_TX_VRING_ADDR 0xc1000000 +#define DEVICE00_RX_VRING_ADDR (DEVICE00_TX_VRING_ADDR + DEVICE00_VRING_SIZE/2) + +#define DEVICE00_SOURCE_TABLE_ATTRIBUTE (MT_NORMAL|MT_P_RW_U_NA) +#define DEVICE00_SHARE_BUFFER_ATTRIBUTE (MT_NORMAL|MT_P_RW_U_NA) #ifdef __cplusplus } diff --git a/example/system/amp/openamp/common/openamp_configs.h b/example/system/amp/openamp/common/openamp_configs.h index 6b197ef8..6844d20c 100644 --- a/example/system/amp/openamp/common/openamp_configs.h +++ b/example/system/amp/openamp/common/openamp_configs.h @@ -40,25 +40,25 @@ extern "C" /*记录当前系统中有多少个remoteproc设备*/ static u32 remoteproc_online_mask = 0 ; -#define MASTER_DRIVER_EPT_ADDR (0x3 + 1024) -#define SLAVE_DEVICE_00_EPT_ADDR (0x4 + 1024) +#define DRIVER_EPT_ADDR (0x3 + 1024) +#define DEVICE_00_EPT_ADDR (0x4 + 1024) #define RPMSG_SERVICE_00_NAME "rpmsg_service_name_00" /* 从核发送消息时,需要指定发送的cpu的核号,用来确定软件中断的发送到哪个核上 */ #if defined(CONFIG_TARGET_PE2204) -#define MASTER_DRIVER_CORE 2 /* 与amp_config.json中的管理(主)核配置保持一致 */ +#define DRIVER_CORE 2 /* 与amp_config.json中的管理(主)核配置保持一致 */ #else -#define MASTER_DRIVER_CORE 0 /* 与amp_config.json中的管理(主)核配置保持一致 */ +#define DRIVER_CORE 0 /* 与amp_config.json中的管理(主)核配置保持一致 */ #endif /* 主核发送消息时,需要指定接收的cpu的核号,用来确定软件中断的发送到哪个核上,以及主核指定启动镜像在那个核心上运行 */ #if defined(CONFIG_TARGET_PD2008) -#define SLAVE_DEVICE_CORE_00 4 +#define DEVICE_CORE_00 4 #elif defined(CONFIG_TARGET_PE2204) -#define SLAVE_DEVICE_CORE_00 0 +#define DEVICE_CORE_00 0 #else -#define SLAVE_DEVICE_CORE_00 1 +#define DEVICE_CORE_00 1 #endif #ifdef __cplusplus diff --git a/example/system/amp/openamp/device_core/configs/pd2008_aarch32_test_openamp_device_core.config b/example/system/amp/openamp/device_core/configs/pd2008_aarch32_test_openamp_device_core.config index fd264345..1d84f857 100644 --- a/example/system/amp/openamp/device_core/configs/pd2008_aarch32_test_openamp_device_core.config +++ b/example/system/amp/openamp/device_core/configs/pd2008_aarch32_test_openamp_device_core.config @@ -6,7 +6,6 @@ CONFIG_TARGET_NAME="openamp_device_core" CONFIG_LOG_VERBOS=y CONFIG_LOG_DISPALY_CORE_NUM=y CONFIG_INTERRUPT_ROLE_SLAVE=y -CONFIG_USE_SERIAL=y # CONFIG_OUTPUT_BINARY is not set CONFIG_DEFAULT_LINKER_SCRIPT=y CONFIG_IMAGE_LOAD_ADDRESS=0xe0100000 diff --git a/example/system/amp/openamp/device_core/configs/pd2008_aarch64_test_openamp_device_core.config b/example/system/amp/openamp/device_core/configs/pd2008_aarch64_test_openamp_device_core.config index 787f76cb..8ee07437 100644 --- a/example/system/amp/openamp/device_core/configs/pd2008_aarch64_test_openamp_device_core.config +++ b/example/system/amp/openamp/device_core/configs/pd2008_aarch64_test_openamp_device_core.config @@ -5,7 +5,6 @@ CONFIG_TARGET_NAME="openamp_device_core" CONFIG_LOG_VERBOS=y CONFIG_LOG_DISPALY_CORE_NUM=y CONFIG_INTERRUPT_ROLE_SLAVE=y -CONFIG_USE_SERIAL=y # CONFIG_OUTPUT_BINARY is not set CONFIG_DEFAULT_LINKER_SCRIPT=y CONFIG_IMAGE_LOAD_ADDRESS=0xe0100000 diff --git a/example/system/amp/openamp/device_core/configs/pd2308_aarch64_demo_openamp_device_core.config b/example/system/amp/openamp/device_core/configs/pd2308_aarch64_demo_openamp_device_core.config index 9d038b0c..7c360c02 100644 --- a/example/system/amp/openamp/device_core/configs/pd2308_aarch64_demo_openamp_device_core.config +++ b/example/system/amp/openamp/device_core/configs/pd2308_aarch64_demo_openamp_device_core.config @@ -5,7 +5,6 @@ CONFIG_LOG_VERBOS=y CONFIG_LOG_DISPALY_CORE_NUM=y CONFIG_INTERRUPT_ROLE_SLAVE=y CONFIG_ENABLE_IOPAD=y -CONFIG_USE_SERIAL=y # CONFIG_OUTPUT_BINARY is not set CONFIG_DEFAULT_LINKER_SCRIPT=y CONFIG_IMAGE_LOAD_ADDRESS=0xe0100000 diff --git a/example/system/amp/openamp/device_core/configs/pd2408_aarch64_test_a_openamp_device_core.config b/example/system/amp/openamp/device_core/configs/pd2408_aarch64_test_a_openamp_device_core.config index 3aaf74f9..6161b4d4 100644 --- a/example/system/amp/openamp/device_core/configs/pd2408_aarch64_test_a_openamp_device_core.config +++ b/example/system/amp/openamp/device_core/configs/pd2408_aarch64_test_a_openamp_device_core.config @@ -6,7 +6,6 @@ CONFIG_LOG_DISPALY_CORE_NUM=y CONFIG_INTERRUPT_ROLE_SLAVE=y CONFIG_USE_IOMUX=y CONFIG_ENABLE_IOPAD=y -CONFIG_USE_SERIAL=y # CONFIG_OUTPUT_BINARY is not set # CONFIG_DEBUG_LINK_MAP is not set CONFIG_DEFAULT_LINKER_SCRIPT=y diff --git a/example/system/amp/openamp/device_core/configs/pe2202_aarch32_demo_openamp_device_core.config b/example/system/amp/openamp/device_core/configs/pe2202_aarch32_demo_openamp_device_core.config index b13242db..18524eaf 100644 --- a/example/system/amp/openamp/device_core/configs/pe2202_aarch32_demo_openamp_device_core.config +++ b/example/system/amp/openamp/device_core/configs/pe2202_aarch32_demo_openamp_device_core.config @@ -5,7 +5,6 @@ CONFIG_TARGET_NAME="openamp_device_core" CONFIG_LOG_VERBOS=y CONFIG_LOG_DISPALY_CORE_NUM=y CONFIG_INTERRUPT_ROLE_SLAVE=y -CONFIG_USE_SERIAL=y # CONFIG_OUTPUT_BINARY is not set CONFIG_DEFAULT_LINKER_SCRIPT=y CONFIG_IMAGE_LOAD_ADDRESS=0xe0100000 diff --git a/example/system/amp/openamp/device_core/configs/pe2202_aarch64_demo_openamp_device_core.config b/example/system/amp/openamp/device_core/configs/pe2202_aarch64_demo_openamp_device_core.config index cfb2bff2..f7c23788 100644 --- a/example/system/amp/openamp/device_core/configs/pe2202_aarch64_demo_openamp_device_core.config +++ b/example/system/amp/openamp/device_core/configs/pe2202_aarch64_demo_openamp_device_core.config @@ -4,7 +4,6 @@ CONFIG_TARGET_NAME="openamp_device_core" CONFIG_LOG_VERBOS=y CONFIG_LOG_DISPALY_CORE_NUM=y CONFIG_INTERRUPT_ROLE_SLAVE=y -CONFIG_USE_SERIAL=y # CONFIG_OUTPUT_BINARY is not set CONFIG_DEFAULT_LINKER_SCRIPT=y CONFIG_IMAGE_LOAD_ADDRESS=0xe0100000 diff --git a/example/system/amp/openamp/device_core/configs/pe2204_aarch32_demo_openamp_device_core.config b/example/system/amp/openamp/device_core/configs/pe2204_aarch32_demo_openamp_device_core.config index 1cc6ad30..d5c48e76 100644 --- a/example/system/amp/openamp/device_core/configs/pe2204_aarch32_demo_openamp_device_core.config +++ b/example/system/amp/openamp/device_core/configs/pe2204_aarch32_demo_openamp_device_core.config @@ -4,7 +4,6 @@ CONFIG_TARGET_NAME="openamp_device_core" CONFIG_LOG_VERBOS=y CONFIG_LOG_DISPALY_CORE_NUM=y CONFIG_INTERRUPT_ROLE_SLAVE=y -CONFIG_USE_SERIAL=y # CONFIG_OUTPUT_BINARY is not set CONFIG_DEFAULT_LINKER_SCRIPT=y CONFIG_IMAGE_LOAD_ADDRESS=0xe0100000 diff --git a/example/system/amp/openamp/device_core/configs/pe2204_aarch32_phytiumpi_openamp_device_core.config b/example/system/amp/openamp/device_core/configs/pe2204_aarch32_phytiumpi_openamp_device_core.config index c40c5210..492a90da 100644 --- a/example/system/amp/openamp/device_core/configs/pe2204_aarch32_phytiumpi_openamp_device_core.config +++ b/example/system/amp/openamp/device_core/configs/pe2204_aarch32_phytiumpi_openamp_device_core.config @@ -5,7 +5,6 @@ CONFIG_TARGET_NAME="openamp_device_core" CONFIG_LOG_VERBOS=y CONFIG_LOG_DISPALY_CORE_NUM=y CONFIG_INTERRUPT_ROLE_SLAVE=y -CONFIG_USE_SERIAL=y # CONFIG_OUTPUT_BINARY is not set CONFIG_DEFAULT_LINKER_SCRIPT=y CONFIG_IMAGE_LOAD_ADDRESS=0xe0100000 diff --git a/example/system/amp/openamp/device_core/configs/pe2204_aarch64_demo_openamp_device_core.config b/example/system/amp/openamp/device_core/configs/pe2204_aarch64_demo_openamp_device_core.config index 72e90d83..4a264cea 100644 --- a/example/system/amp/openamp/device_core/configs/pe2204_aarch64_demo_openamp_device_core.config +++ b/example/system/amp/openamp/device_core/configs/pe2204_aarch64_demo_openamp_device_core.config @@ -3,7 +3,6 @@ CONFIG_TARGET_NAME="openamp_device_core" CONFIG_LOG_VERBOS=y CONFIG_LOG_DISPALY_CORE_NUM=y CONFIG_INTERRUPT_ROLE_SLAVE=y -CONFIG_USE_SERIAL=y # CONFIG_OUTPUT_BINARY is not set CONFIG_DEFAULT_LINKER_SCRIPT=y CONFIG_IMAGE_LOAD_ADDRESS=0xe0100000 diff --git a/example/system/amp/openamp/device_core/configs/pe2204_aarch64_phytiumpi_openamp_device_core.config b/example/system/amp/openamp/device_core/configs/pe2204_aarch64_phytiumpi_openamp_device_core.config index 0c366b39..0958054c 100644 --- a/example/system/amp/openamp/device_core/configs/pe2204_aarch64_phytiumpi_openamp_device_core.config +++ b/example/system/amp/openamp/device_core/configs/pe2204_aarch64_phytiumpi_openamp_device_core.config @@ -4,7 +4,6 @@ CONFIG_TARGET_NAME="openamp_device_core" CONFIG_LOG_VERBOS=y CONFIG_LOG_DISPALY_CORE_NUM=y CONFIG_INTERRUPT_ROLE_SLAVE=y -CONFIG_USE_SERIAL=y # CONFIG_OUTPUT_BINARY is not set CONFIG_DEFAULT_LINKER_SCRIPT=y CONFIG_IMAGE_LOAD_ADDRESS=0xe0100000 diff --git a/example/system/amp/openamp/device_core/ft_openamp.ld b/example/system/amp/openamp/device_core/ft_openamp.ld index 585b201e..861acc00 100644 --- a/example/system/amp/openamp/device_core/ft_openamp.ld +++ b/example/system/amp/openamp/device_core/ft_openamp.ld @@ -1,6 +1,6 @@ #include "memory_layout.h" - .resource_table SLAVE00_SOURCE_TABLE_ADDR: { + .resource_table DEVICE00_SOURCE_TABLE_ADDR: { . = ALIGN(4); *(.resource_table) } diff --git a/example/system/amp/openamp/device_core/sdkconfig b/example/system/amp/openamp/device_core/sdkconfig index bcd38ebb..aa08d8ed 100644 --- a/example/system/amp/openamp/device_core/sdkconfig +++ b/example/system/amp/openamp/device_core/sdkconfig @@ -50,39 +50,44 @@ CONFIG_MAX_XLAT_TABLES=256 # # Soc configuration # -# CONFIG_TARGET_PE2204 is not set +CONFIG_TARGET_PE2204=y # CONFIG_TARGET_PE2202 is not set # CONFIG_TARGET_PE2201 is not set # CONFIG_TARGET_PD1904 is not set # CONFIG_TARGET_PD2008 is not set # CONFIG_TARGET_PD2308 is not set # CONFIG_TARGET_PS2316 is not set -CONFIG_TARGET_PD2408=y +# CONFIG_TARGET_PD2408 is not set # CONFIG_TARGET_QEMU_VIRT is not set -CONFIG_SOC_NAME="pd2408" -CONFIG_SOC_CORE_NUM=8 +CONFIG_SOC_NAME="pe220x" +CONFIG_TARGET_TYPE_NAME="pe2204" +CONFIG_SOC_CORE_NUM=4 CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 +CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # # Board Configuration # -CONFIG_BOARD_NAME="test_b" +CONFIG_BOARD_NAME="phytiumpi" # CONFIG_USE_SPI_IOPAD is not set # CONFIG_USE_GPIO_IOPAD is not set +# CONFIG_USE_CAN_IOPAD is not set # CONFIG_USE_QSPI_IOPAD is not set # CONFIG_USE_PWM_IOPAD is not set +# CONFIG_USE_MIO_IOPAD is not set # CONFIG_USE_TACHO_IOPAD is not set # CONFIG_USE_UART_IOPAD is not set # CONFIG_USE_THIRD_PARTY_IOPAD is not set -# CONFIG_PD2408_TEST_A_BOARD is not set -CONFIG_PD2408_TEST_B_BOARD=y +# CONFIG_E2000Q_DEMO_BOARD is not set +CONFIG_PHYTIUMPI_FIREFLY_BOARD=y # # IO mux configuration when board start up @@ -102,9 +107,9 @@ CONFIG_TARGET_NAME="openamp_device_core" # Sdk common configuration # CONFIG_ELOG_LINE_BUF_SIZE=0x100 -# CONFIG_LOG_VERBOS is not set +CONFIG_LOG_VERBOS=y # CONFIG_LOG_DEBUG is not set -CONFIG_LOG_INFO=y +# CONFIG_LOG_INFO is not set # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set @@ -113,6 +118,8 @@ CONFIG_LOG_DISPALY_CORE_NUM=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y # CONFIG_INTERRUPT_ROLE_MASTER is not set CONFIG_INTERRUPT_ROLE_SLAVE=y @@ -133,7 +140,6 @@ CONFIG_USE_SERIAL=y # Usart Configuration # CONFIG_ENABLE_Pl011_UART=y -# CONFIG_USE_SERIAL_V2 is not set # end of Usart Configuration # CONFIG_USE_GPIO is not set @@ -173,7 +179,7 @@ CONFIG_CHECK_DEPS=y # CONFIG_DEBUG_CUSTOMOPT is not set CONFIG_DEBUG_FULLOPT=y CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y -# CONFIG_DEBUG_LINK_MAP is not set +CONFIG_DEBUG_LINK_MAP=y # CONFIG_CCACHE is not set # CONFIG_ARCH_COVERAGE is not set # CONFIG_LTO_FULL is not set diff --git a/example/system/amp/openamp/device_core/sdkconfig.h b/example/system/amp/openamp/device_core/sdkconfig.h index 4b051551..2ec4b8fc 100644 --- a/example/system/amp/openamp/device_core/sdkconfig.h +++ b/example/system/amp/openamp/device_core/sdkconfig.h @@ -46,38 +46,43 @@ /* Soc configuration */ -/* CONFIG_TARGET_PE2204 is not set */ +#define CONFIG_TARGET_PE2204 /* CONFIG_TARGET_PE2202 is not set */ /* CONFIG_TARGET_PE2201 is not set */ /* CONFIG_TARGET_PD1904 is not set */ /* CONFIG_TARGET_PD2008 is not set */ /* CONFIG_TARGET_PD2308 is not set */ /* CONFIG_TARGET_PS2316 is not set */ -#define CONFIG_TARGET_PD2408 +/* CONFIG_TARGET_PD2408 is not set */ /* CONFIG_TARGET_QEMU_VIRT is not set */ -#define CONFIG_SOC_NAME "pd2408" -#define CONFIG_SOC_CORE_NUM 8 +#define CONFIG_SOC_NAME "pe220x" +#define CONFIG_TARGET_TYPE_NAME "pe2204" +#define CONFIG_SOC_CORE_NUM 4 #define CONFIG_F32BIT_MEMORY_ADDRESS 0x80000000 #define CONFIG_F32BIT_MEMORY_LENGTH 0x80000000 #define CONFIG_F64BIT_MEMORY_ADDRESS 0x2000000000 #define CONFIG_F64BIT_MEMORY_LENGTH 0x800000000 +#define CONFIG_TARGET_PE220X #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ -#define CONFIG_BOARD_NAME "test_b" +#define CONFIG_BOARD_NAME "phytiumpi" /* CONFIG_USE_SPI_IOPAD is not set */ /* CONFIG_USE_GPIO_IOPAD is not set */ +/* CONFIG_USE_CAN_IOPAD is not set */ /* CONFIG_USE_QSPI_IOPAD is not set */ /* CONFIG_USE_PWM_IOPAD is not set */ +/* CONFIG_USE_MIO_IOPAD is not set */ /* CONFIG_USE_TACHO_IOPAD is not set */ /* CONFIG_USE_UART_IOPAD is not set */ /* CONFIG_USE_THIRD_PARTY_IOPAD is not set */ -/* CONFIG_PD2408_TEST_A_BOARD is not set */ -#define CONFIG_PD2408_TEST_B_BOARD +/* CONFIG_E2000Q_DEMO_BOARD is not set */ +#define CONFIG_PHYTIUMPI_FIREFLY_BOARD /* IO mux configuration when board start up */ @@ -93,9 +98,9 @@ /* Sdk common configuration */ #define CONFIG_ELOG_LINE_BUF_SIZE 0x100 -/* CONFIG_LOG_VERBOS is not set */ +#define CONFIG_LOG_VERBOS /* CONFIG_LOG_DEBUG is not set */ -#define CONFIG_LOG_INFO +/* CONFIG_LOG_INFO is not set */ /* CONFIG_LOG_WARN is not set */ /* CONFIG_LOG_ERROR is not set */ /* CONFIG_LOG_NONE is not set */ @@ -104,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG /* CONFIG_INTERRUPT_ROLE_MASTER is not set */ #define CONFIG_INTERRUPT_ROLE_SLAVE @@ -122,7 +129,6 @@ /* Usart Configuration */ #define CONFIG_ENABLE_Pl011_UART -/* CONFIG_USE_SERIAL_V2 is not set */ /* end of Usart Configuration */ /* CONFIG_USE_GPIO is not set */ /* CONFIG_USE_ETH is not set */ @@ -159,7 +165,7 @@ /* CONFIG_DEBUG_CUSTOMOPT is not set */ #define CONFIG_DEBUG_FULLOPT #define CONFIG_DEBUG_OPT_UNUSED_SECTIONS -/* CONFIG_DEBUG_LINK_MAP is not set */ +#define CONFIG_DEBUG_LINK_MAP /* CONFIG_CCACHE is not set */ /* CONFIG_ARCH_COVERAGE is not set */ /* CONFIG_LTO_FULL is not set */ diff --git a/example/system/amp/openamp/device_core/src/matrix_multiply.c b/example/system/amp/openamp/device_core/src/matrix_multiply.c index 8eda3948..1949310b 100644 --- a/example/system/amp/openamp/device_core/src/matrix_multiply.c +++ b/example/system/amp/openamp/device_core/src/matrix_multiply.c @@ -4,8 +4,8 @@ /* This is a sample demonstration application that showcases usage of remoteproc and rpmsg APIs on the remote core. This application is meant to run on the remote CPU -running baremetal code. This application receives two matrices from the master, -multiplies them and returns the result to the master core. */ +running baremetal code. This application receives two matrices from the driver, +multiplies them and returns the result to the driver core. */ #include #include @@ -17,10 +17,10 @@ multiplies them and returns the result to the master core. */ #include "rpmsg_service.h" #include "fdebug.h" -#define MAT_MULT_MASTER_DEBUG_TAG " MASTER_03" -#define MAT_MULT_MASTER_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( MAT_MULT_MASTER_DEBUG_TAG, format, ##__VA_ARGS__) -#define MAT_MULT_MASTER_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( MAT_MULT_MASTER_DEBUG_TAG, format, ##__VA_ARGS__) -#define MAT_MULT_MASTER_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( MAT_MULT_MASTER_DEBUG_TAG, format, ##__VA_ARGS__) +#define MAT_MULT_DRIVER_DEBUG_TAG " DRIVER_03" +#define MAT_MULT_DRIVER_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( MAT_MULT_DRIVER_DEBUG_TAG, format, ##__VA_ARGS__) +#define MAT_MULT_DRIVER_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( MAT_MULT_DRIVER_DEBUG_TAG, format, ##__VA_ARGS__) +#define MAT_MULT_DRIVER_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( MAT_MULT_DRIVER_DEBUG_TAG, format, ##__VA_ARGS__) #define MAX_SIZE 6 #define NUM_MATRIX 2 @@ -55,7 +55,7 @@ static void matrix_print(struct _matrix *m) unsigned int i, j; /* Generate two random matrices */ - MAT_MULT_MASTER_DEBUG_I("Printing matrix... \r\n"); + MAT_MULT_DRIVER_DEBUG_I("Printing matrix... \r\n"); for (i = 0; i < m->size; ++i) { for (j = 0; j < m->size; ++j) @@ -76,7 +76,7 @@ static void generate_matrices(int num_matrices, /* Initialize workload */ p_matrix[i].size = matrix_size; - MAT_MULT_MASTER_DEBUG_I("Input matrix %d \r\n", i); + MAT_MULT_DRIVER_DEBUG_I("Input matrix %d \r\n", i); for (j = 0; j < matrix_size; j++) { printf("\r\n"); for (k = 0; k < matrix_size; k++) { @@ -121,7 +121,7 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, (void)priv; (void)src; if (len != sizeof(struct _matrix)) { - MAT_MULT_MASTER_DEBUG_E("Received matrix is of invalid len: %d:%lu\r\n", + MAT_MULT_DRIVER_DEBUG_E("Received matrix is of invalid len: %d:%lu\r\n", (int)sizeof(struct _matrix), (unsigned long)len); err_cnt++; return RPMSG_SUCCESS; @@ -136,10 +136,10 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, } } if (err_cnt) { - MAT_MULT_MASTER_DEBUG_E("Result mismatched...\r\n"); - MAT_MULT_MASTER_DEBUG_E("Expected matrix:\r\n"); + MAT_MULT_DRIVER_DEBUG_E("Result mismatched...\r\n"); + MAT_MULT_DRIVER_DEBUG_E("Expected matrix:\r\n"); matrix_print(&e_matrix); - MAT_MULT_MASTER_DEBUG_E("Actual matrix:\r\n"); + MAT_MULT_DRIVER_DEBUG_E("Actual matrix:\r\n"); matrix_print(r_matrix); } else { result_returned = 1; @@ -151,7 +151,7 @@ static void rpmsg_service_unbind(struct rpmsg_endpoint *ept) { (void)ept; rpmsg_destroy_ept(&lept); - MAT_MULT_MASTER_DEBUG_I("echo test: service is destroyed\r\n"); + MAT_MULT_DRIVER_DEBUG_I("echo test: service is destroyed\r\n"); ept_deleted = 1; } @@ -159,7 +159,7 @@ static void rpmsg_name_service_bind_cb(struct rpmsg_device *rdev, const char *name, uint32_t dest) { if (strcmp(name, RPMSG_SERVICE_NAME)) - MAT_MULT_MASTER_DEBUG_E("Unexpected name service %s.\r\n", name); + MAT_MULT_DRIVER_DEBUG_E("Unexpected name service %s.\r\n", name); else (void)rpmsg_create_ept(&lept, rdev, RPMSG_SERVICE_NAME, RPMSG_ADDR_ANY, dest, @@ -178,24 +178,24 @@ static int app (struct rpmsg_device *rdev, void *priv) ept_deleted = 0; - MAT_MULT_MASTER_DEBUG_I("Compute thread unblocked ..\r\n"); - MAT_MULT_MASTER_DEBUG_I("It will generate two random matrices.\r\n"); - MAT_MULT_MASTER_DEBUG_I("Send to the remote and get the computation result back.\r\n"); - MAT_MULT_MASTER_DEBUG_I("It will then check if the result is expected.\r\n"); + MAT_MULT_DRIVER_DEBUG_I("Compute thread unblocked ..\r\n"); + MAT_MULT_DRIVER_DEBUG_I("It will generate two random matrices.\r\n"); + MAT_MULT_DRIVER_DEBUG_I("Send to the remote and get the computation result back.\r\n"); + MAT_MULT_DRIVER_DEBUG_I("It will then check if the result is expected.\r\n"); /* Create RPMsg endpoint */ ret = rpmsg_create_ept(&lept, rdev, RPMSG_SERVICE_NAME, RPMSG_ADDR_ANY, RPMSG_ADDR_ANY, rpmsg_endpoint_cb, rpmsg_service_unbind); if (ret) { - MAT_MULT_MASTER_DEBUG_E("Failed to create RPMsg endpoint.\r\n"); + MAT_MULT_DRIVER_DEBUG_E("Failed to create RPMsg endpoint.\r\n"); return ret; } while (!is_rpmsg_ept_ready(&lept)) platform_poll(priv); - MAT_MULT_MASTER_DEBUG_I("RPMSG endpoint is binded with remote.\r\n"); + MAT_MULT_DRIVER_DEBUG_I("RPMSG endpoint is binded with remote.\r\n"); err_cnt = 0; srand(time(NULL)); for (c = 0; c < 200; c++) { @@ -205,10 +205,10 @@ static int app (struct rpmsg_device *rdev, void *priv) ret = rpmsg_send(&lept, i_matrix, sizeof(i_matrix)); if (ret < 0) { - MAT_MULT_MASTER_DEBUG_I("Error sending data...\r\n"); + MAT_MULT_DRIVER_DEBUG_I("Error sending data...\r\n"); break; } - MAT_MULT_MASTER_DEBUG_I("Matrix multiply: sent : %lu\r\n", + MAT_MULT_DRIVER_DEBUG_I("Matrix multiply: sent : %lu\r\n", (unsigned long)sizeof(i_matrix)); do { platform_poll(priv); @@ -218,13 +218,13 @@ static int app (struct rpmsg_device *rdev, void *priv) break; } - MAT_MULT_MASTER_DEBUG_I("**********************************\r\n"); - MAT_MULT_MASTER_DEBUG_I(" Test Results: Error count = %d \r\n", err_cnt); - MAT_MULT_MASTER_DEBUG_I("**********************************\r\n"); + MAT_MULT_DRIVER_DEBUG_I("**********************************\r\n"); + MAT_MULT_DRIVER_DEBUG_I(" Test Results: Error count = %d \r\n", err_cnt); + MAT_MULT_DRIVER_DEBUG_I("**********************************\r\n"); /* Detroy RPMsg endpoint */ rpmsg_destroy_ept(&lept); - MAT_MULT_MASTER_DEBUG_I("Quitting application .. Matrix multiplication end\r\n"); + MAT_MULT_DRIVER_DEBUG_I("Quitting application .. Matrix multiplication end\r\n"); return 0; } @@ -235,15 +235,15 @@ int matrix_multiply(struct rpmsg_device *rdev, void *priv) metal_assert(priv); int ret; - MAT_MULT_MASTER_DEBUG_I("Starting matrix_multiply application...\r\n"); + MAT_MULT_DRIVER_DEBUG_I("Starting matrix_multiply application...\r\n"); ret = app(rdev, priv); if (ret != 0) { - MAT_MULT_MASTER_DEBUG_E("Matrix_multiply application error,code:0x%x",ret); + MAT_MULT_DRIVER_DEBUG_E("Matrix_multiply application error,code:0x%x",ret); return ret; } - MAT_MULT_MASTER_DEBUG_I("Stopping matrix_multiply application...\r\n"); + MAT_MULT_DRIVER_DEBUG_I("Stopping matrix_multiply application...\r\n"); return ret; } diff --git a/example/system/amp/openamp/device_core/src/rpmsg-demo-listening.c b/example/system/amp/openamp/device_core/src/rpmsg-demo-listening.c index ae4a5a7a..43bf69f2 100644 --- a/example/system/amp/openamp/device_core/src/rpmsg-demo-listening.c +++ b/example/system/amp/openamp/device_core/src/rpmsg-demo-listening.c @@ -35,7 +35,6 @@ #include #include "platform_info.h" #include "rsc_table.h" -#include "helper.h" #include "rpmsg_service.h" #include "fcache.h" #include "fdebug.h" @@ -53,10 +52,10 @@ #define SHUTDOWN_MSG 0xEF56A55A #define RECV_MSG 0xE5E5E5E5 -#define DEMO_LIST_SLAVE_DEBUG_TAG "DEMO_LIST_SLAVE" -#define DEMO_LIST_SLAVE_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( DEMO_LIST_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) -#define DEMO_LIST_SLAVE_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( DEMO_LIST_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) -#define DEMO_LIST_SLAVE_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( DEMO_LIST_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) +#define DEMO_LIST_DEVICE_DEBUG_TAG "DEMO_LIST_DEVICE" +#define DEMO_LIST_DEVICE_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( DEMO_LIST_DEVICE_DEBUG_TAG, format, ##__VA_ARGS__) +#define DEMO_LIST_DEVICE_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( DEMO_LIST_DEVICE_DEBUG_TAG, format, ##__VA_ARGS__) +#define DEMO_LIST_DEVICE_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( DEMO_LIST_DEVICE_DEBUG_TAG, format, ##__VA_ARGS__) #define RPMSG_PING_DEMO 0x1 #define RPMSG_SAM_PING_DEMO 0X2 @@ -84,40 +83,43 @@ static struct remote_resource_table __resource resources __attribute__((used)) = }, /* Vring rsc entry - part of vdev rsc entry */ - {SLAVE00_TX_VRING_ADDR, VRING_ALIGN, SLAVE00_VRING_NUM, 1, 0}, - {SLAVE00_RX_VRING_ADDR, VRING_ALIGN, SLAVE00_VRING_NUM, 2, 0}, + {DEVICE00_TX_VRING_ADDR, VRING_ALIGN, DEVICE00_VRING_NUM, 1, 0}, + {DEVICE00_RX_VRING_ADDR, VRING_ALIGN, DEVICE00_VRING_NUM, 2, 0}, }; struct metal_device kick_driver_00 = { - .name = SLAVE_00_KICK_DEV_NAME, + .name = DEVICE_00_KICK_DEV_NAME, .bus = NULL, .irq_num = 1,/* Number of IRQs per device */ - .irq_info = (void *)SLAVE_00_SGI, + .irq_info = (void *)DEVICE_00_SGI, } ; -struct remoteproc_priv slave_00_priv = { - .kick_dev_name = SLAVE_00_KICK_DEV_NAME , +struct remoteproc_priv device_00_priv = { + .kick_dev_name = DEVICE_00_KICK_DEV_NAME , .kick_dev_bus_name = KICK_BUS_NAME , - .cpu_id = MASTER_DRIVER_CORE , + .cpu_id = DRIVER_CORE , - .src_table_attribute = SLAVE00_SOURCE_TABLE_ATTRIBUTE , + .src_table_attribute = DEVICE00_SOURCE_TABLE_ATTRIBUTE , /* |rx vring|tx vring|share buffer| */ - .share_mem_va = SLAVE00_SHARE_MEM_ADDR , - .share_mem_pa = SLAVE00_SHARE_MEM_ADDR , - .share_buffer_offset = SLAVE00_VRING_SIZE , - .share_mem_size = SLAVE00_SHARE_MEM_SIZE , - .share_mem_attribute = SLAVE00_SHARE_BUFFER_ATTRIBUTE + .share_mem_va = DEVICE00_SHARE_MEM_ADDR , + .share_mem_pa = DEVICE00_SHARE_MEM_ADDR , + .share_buffer_offset = DEVICE00_VRING_SIZE , + .share_mem_size = DEVICE00_SHARE_MEM_SIZE , + .share_mem_attribute = DEVICE00_SHARE_BUFFER_ATTRIBUTE } ; -struct remoteproc remoteproc_slave_00; -static struct rpmsg_device *rpdev_slave_00 = NULL; -struct rpmsg_endpoint ept_slave_00; +struct remoteproc remoteproc_device_00; +static struct rpmsg_device *rpdev_device_00 = NULL; +struct rpmsg_endpoint ept_device_00; static volatile u32 flag_req = 0; static volatile int demo_flag = 0; /************************** Function Prototypes ******************************/ +/* External functions */ +extern int init_system(); + extern int rpmsg_ping(struct rpmsg_device *rdev, void *priv) ; extern int rpmsg_sample_ping(struct rpmsg_device *rdev, void *priv) ; extern int matrix_multiply(struct rpmsg_device *rdev, void *priv) ; @@ -128,21 +130,21 @@ extern int rpmsg_nocopy_ping(struct rpmsg_device *rdev, void *priv) ; static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, uint32_t src, void *priv) { (void)priv; - DEMO_LIST_SLAVE_DEBUG_E("src:0x%x",src); + DEMO_LIST_DEVICE_DEBUG_E("src:0x%x",src); ept->dest_addr = src; /* On reception of a shutdown we signal the application to terminate */ if ((*(unsigned int *)data) == SHUTDOWN_MSG) { - DEMO_LIST_SLAVE_DEBUG_I("Shutdown message is received.\r\n"); + DEMO_LIST_DEVICE_DEBUG_I("Shutdown message is received.\r\n"); flag_req = SHUTDOWN_MSG; return RPMSG_SUCCESS; } demo_flag = (*(unsigned int *)data); - /* Send data back to master */ + /* Send data back to driver */ if (rpmsg_send(ept, data, len) < 0) { - DEMO_LIST_SLAVE_DEBUG_E("rpmsg_send failed.\r\n"); + DEMO_LIST_DEVICE_DEBUG_E("rpmsg_send failed.\r\n"); } flag_req = RECV_MSG; return RPMSG_SUCCESS; @@ -151,8 +153,8 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, static void rpmsg_service_unbind(struct rpmsg_endpoint *ept) { (void)ept; - rpmsg_destroy_ept(&ept_slave_00); - DEMO_LIST_SLAVE_DEBUG_I("Unexpected remote endpoint destroy.\r\n"); + rpmsg_destroy_ept(&ept_device_00); + DEMO_LIST_DEVICE_DEBUG_I("Unexpected remote endpoint destroy.\r\n"); flag_req = SHUTDOWN_MSG; } @@ -163,13 +165,13 @@ static int app(struct rpmsg_device *rdev, void *priv) { int ret; /* Initialize RPMSG framework */ - ret = rpmsg_create_ept(&ept_slave_00, rdev, RPMSG_SERVICE_00_NAME, SLAVE_DEVICE_00_EPT_ADDR, MASTER_DRIVER_EPT_ADDR, rpmsg_endpoint_cb, rpmsg_service_unbind); + ret = rpmsg_create_ept(&ept_device_00, rdev, RPMSG_SERVICE_00_NAME, DEVICE_00_EPT_ADDR, DRIVER_EPT_ADDR, rpmsg_endpoint_cb, rpmsg_service_unbind); if (ret) { - DEMO_LIST_SLAVE_DEBUG_E("Failed to create endpoint. %d \r\n", ret); + DEMO_LIST_DEVICE_DEBUG_E("Failed to create endpoint. %d \r\n", ret); return -1; } - DEMO_LIST_SLAVE_DEBUG_I("Successfully created rpmsg endpoint.\r\n"); + DEMO_LIST_DEVICE_DEBUG_I("Successfully created rpmsg endpoint.\r\n"); demo_flag = 0; flag_req = 0; while (1) @@ -181,13 +183,13 @@ static int app(struct rpmsg_device *rdev, void *priv) if (demo_flag == RPMSG_PING_DEMO) { printf("\r\n\r\n"); - DEMO_LIST_SLAVE_DEBUG_I("*********************************************......\r\n"); - DEMO_LIST_SLAVE_DEBUG_I("***********Demo rpmsg_ping running***********......\r\n"); - DEMO_LIST_SLAVE_DEBUG_I("*********************************************......\r\n"); + DEMO_LIST_DEVICE_DEBUG_I("*********************************************......\r\n"); + DEMO_LIST_DEVICE_DEBUG_I("***********Demo rpmsg_ping running***********......\r\n"); + DEMO_LIST_DEVICE_DEBUG_I("*********************************************......\r\n"); ret = rpmsg_ping(rdev, priv); if (ret != 0) { - DEMO_LIST_SLAVE_DEBUG_E("rpmsg_echo running error,ecode:%d.", ret); + DEMO_LIST_DEVICE_DEBUG_E("rpmsg_echo running error,ecode:%d.", ret); return 0; } } @@ -195,13 +197,13 @@ static int app(struct rpmsg_device *rdev, void *priv) if (demo_flag == RPMSG_SAM_PING_DEMO) { printf("\r\n\r\n"); - DEMO_LIST_SLAVE_DEBUG_I("*********************************************......\r\n"); - DEMO_LIST_SLAVE_DEBUG_I("*******Demo rpmsg_sample_ping running********......\r\n"); - DEMO_LIST_SLAVE_DEBUG_I("*********************************************......\r\n"); + DEMO_LIST_DEVICE_DEBUG_I("*********************************************......\r\n"); + DEMO_LIST_DEVICE_DEBUG_I("*******Demo rpmsg_sample_ping running********......\r\n"); + DEMO_LIST_DEVICE_DEBUG_I("*********************************************......\r\n"); ret = rpmsg_sample_ping(rdev, priv); if (ret != 0) { - DEMO_LIST_SLAVE_DEBUG_E("rpmsg_sample_ping running error,ecode:%d.", ret); + DEMO_LIST_DEVICE_DEBUG_E("rpmsg_sample_ping running error,ecode:%d.", ret); return 0; } } @@ -209,13 +211,13 @@ static int app(struct rpmsg_device *rdev, void *priv) if (demo_flag == RPMSG_MAT_MULT_DEMO) { printf("\r\n\r\n"); - DEMO_LIST_SLAVE_DEBUG_I("*********************************************......\r\n"); - DEMO_LIST_SLAVE_DEBUG_I("********Demo matrix_multiply running*********......\r\n"); - DEMO_LIST_SLAVE_DEBUG_I("*********************************************......\r\n"); + DEMO_LIST_DEVICE_DEBUG_I("*********************************************......\r\n"); + DEMO_LIST_DEVICE_DEBUG_I("********Demo matrix_multiply running*********......\r\n"); + DEMO_LIST_DEVICE_DEBUG_I("*********************************************......\r\n"); ret = matrix_multiply(rdev, priv); if (ret != 0) { - DEMO_LIST_SLAVE_DEBUG_E("matrix_multiply running error,ecode:%d.", ret); + DEMO_LIST_DEVICE_DEBUG_E("matrix_multiply running error,ecode:%d.", ret); return 0; } } @@ -223,26 +225,26 @@ static int app(struct rpmsg_device *rdev, void *priv) if (demo_flag == RPMSG_NO_COPY_DEMO) { printf("\r\n\r\n"); - DEMO_LIST_SLAVE_DEBUG_I("*********************************************......\r\n"); - DEMO_LIST_SLAVE_DEBUG_I("*******Demo rpmsg_nocopy_ping running********......\r\n"); - DEMO_LIST_SLAVE_DEBUG_I("*********************************************......\r\n"); + DEMO_LIST_DEVICE_DEBUG_I("*********************************************......\r\n"); + DEMO_LIST_DEVICE_DEBUG_I("*******Demo rpmsg_nocopy_ping running********......\r\n"); + DEMO_LIST_DEVICE_DEBUG_I("*********************************************......\r\n"); ret = rpmsg_nocopy_ping(rdev, priv); if (ret != 0) { - DEMO_LIST_SLAVE_DEBUG_E("rpmsg_nocopy_ping running error,ecode:%d.", ret); + DEMO_LIST_DEVICE_DEBUG_E("rpmsg_nocopy_ping running error,ecode:%d.", ret); return 0; } } flag_req = 0; demo_flag = 0; - DEMO_LIST_SLAVE_DEBUG_I(" Demo running over..."); + DEMO_LIST_DEVICE_DEBUG_I(" Demo running over..."); } if (flag_req == SHUTDOWN_MSG) { break; } } - DEMO_LIST_SLAVE_DEBUG_I("Listening demo over."); + DEMO_LIST_DEVICE_DEBUG_I("Listening demo over."); return ret; } @@ -250,34 +252,34 @@ int FFreeRTOSOpenAMPSlaveInit(void) { init_system(); /* Initialize the system resources and environment */ - if (!platform_create_proc(&remoteproc_slave_00, &slave_00_priv, &kick_driver_00)) + if (!platform_create_proc(&remoteproc_device_00, &device_00_priv, &kick_driver_00)) { - DEMO_LIST_SLAVE_DEBUG_E("Failed to create remoteproc instance for slave 00\r\n"); + DEMO_LIST_DEVICE_DEBUG_E("Failed to create remoteproc instance for device 00\r\n"); return -1; /* Return with an error if creation fails */ } /* Setup resource tables for the created remoteproc instances */ - remoteproc_slave_00.rsc_table = &resources; + remoteproc_device_00.rsc_table = &resources; /* 在主核创建rpmsg之前,保证从核已经初始化资源表,否则会导致主核发送中断,从核进入中断服务函数后,获取异常指针资源表 */ - if (platform_setup_src_table(&remoteproc_slave_00,remoteproc_slave_00.rsc_table)) + if (platform_setup_src_table(&remoteproc_device_00,remoteproc_device_00.rsc_table)) { - DEMO_LIST_SLAVE_DEBUG_E("Failed to setup src table for slave 00\r\n"); + DEMO_LIST_DEVICE_DEBUG_E("Failed to setup src table for device 00\r\n"); return -1; /* Return with an error if setup fails */ } - DEMO_LIST_SLAVE_DEBUG_I("Setup resource tables for the created remoteproc instances is over \r\n"); + DEMO_LIST_DEVICE_DEBUG_I("Setup resource tables for the created remoteproc instances is over \r\n"); - if (platform_setup_share_mems(&remoteproc_slave_00)) + if (platform_setup_share_mems(&remoteproc_device_00)) { - DEMO_LIST_SLAVE_DEBUG_E("Failed to setup shared memory for slave 00\r\n"); + DEMO_LIST_DEVICE_DEBUG_E("Failed to setup shared memory for device 00\r\n"); return -1; /* Return with an error if setup fails */ } - DEMO_LIST_SLAVE_DEBUG_I("Setup shared memory regions for both remoteproc instances is over \r\n"); + DEMO_LIST_DEVICE_DEBUG_I("Setup shared memory regions for both remoteproc instances is over \r\n"); - rpdev_slave_00 = platform_create_rpmsg_vdev(&remoteproc_slave_00, 0, VIRTIO_DEV_SLAVE, NULL, NULL); - if (!rpdev_slave_00) + rpdev_device_00 = platform_create_rpmsg_vdev(&remoteproc_device_00, 0, VIRTIO_DEV_DEVICE, NULL, NULL); + if (!rpdev_device_00) { - DEMO_LIST_SLAVE_DEBUG_E("Failed to create rpmsg vdev for slave 00\r\n"); + DEMO_LIST_DEVICE_DEBUG_E("Failed to create rpmsg vdev for device 00\r\n"); return -1; /* Return with an error if creation fails */ } @@ -289,21 +291,21 @@ void rpmsg_listening_task(void *args) int ret = 0; while (!ret) { - DEMO_LIST_SLAVE_DEBUG_I("SLAVER Starting application...\r\n"); + DEMO_LIST_DEVICE_DEBUG_I("DEVICE Starting application...\r\n"); if(!FFreeRTOSOpenAMPSlaveInit()) { - ret = app(rpdev_slave_00,&remoteproc_slave_00) ; + ret = app(rpdev_device_00,&remoteproc_device_00) ; } else { - DEMO_LIST_SLAVE_DEBUG_E("Failed to init remoteproc.\r\n"); + DEMO_LIST_DEVICE_DEBUG_E("Failed to init remoteproc.\r\n"); break; } - platform_release_rpmsg_vdev(rpdev_slave_00, &remoteproc_slave_00); - DEMO_LIST_SLAVE_DEBUG_I("Stopping application...\r\n"); - platform_cleanup(&remoteproc_slave_00); + platform_release_rpmsg_vdev(rpdev_device_00, &remoteproc_device_00); + DEMO_LIST_DEVICE_DEBUG_I("Stopping application...\r\n"); + platform_cleanup(&remoteproc_device_00); } - DEMO_LIST_SLAVE_DEBUG_E("SLAVER Exiting...\r\n"); + DEMO_LIST_DEVICE_DEBUG_E("DEVICE Exiting...\r\n"); vTaskDelete(NULL); } @@ -322,7 +324,7 @@ int rpmsg_listening_func(void) if(ret != pdPASS) { - DEMO_LIST_SLAVE_DEBUG_E("Failed to create a rpmsg_listening_task task "); + DEMO_LIST_DEVICE_DEBUG_E("Failed to create a rpmsg_listening_task task "); return -1; } return ret; diff --git a/example/system/amp/openamp/device_core/src/rpmsg-nocopy-ping.c b/example/system/amp/openamp/device_core/src/rpmsg-nocopy-ping.c index e0873105..6864e18d 100644 --- a/example/system/amp/openamp/device_core/src/rpmsg-nocopy-ping.c +++ b/example/system/amp/openamp/device_core/src/rpmsg-nocopy-ping.c @@ -15,10 +15,10 @@ #include "rpmsg_service.h" #include "fdebug.h" -#define NO_COPY_MASTER_DEBUG_TAG " MASTER_04" -#define NO_COPY_MASTER_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( NO_COPY_MASTER_DEBUG_TAG, format, ##__VA_ARGS__) -#define NO_COPY_MASTER_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( NO_COPY_MASTER_DEBUG_TAG, format, ##__VA_ARGS__) -#define NO_COPY_MASTER_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( NO_COPY_MASTER_DEBUG_TAG, format, ##__VA_ARGS__) +#define NO_COPY_DRIVER_DEBUG_TAG " DRIVER_04" +#define NO_COPY_DRIVER_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( NO_COPY_DRIVER_DEBUG_TAG, format, ##__VA_ARGS__) +#define NO_COPY_DRIVER_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( NO_COPY_DRIVER_DEBUG_TAG, format, ##__VA_ARGS__) +#define NO_COPY_DRIVER_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( NO_COPY_DRIVER_DEBUG_TAG, format, ##__VA_ARGS__) struct _payload { unsigned long num; @@ -49,14 +49,14 @@ static int rpmsg_check_rcv_msg(struct rpmsg_rcv_msg *rcv_msg, uint32_t exp_num) struct _payload *r_payload = rcv_msg->payload; if (r_payload->num != exp_num) { - NO_COPY_MASTER_DEBUG_E("Invalid message number received %ld, expected %d\r\n", + NO_COPY_DRIVER_DEBUG_E("Invalid message number received %ld, expected %d\r\n", r_payload->num, exp_num); ret = RPMSG_ERR_PARAM; goto out; } if (r_payload->size == 0) { - NO_COPY_MASTER_DEBUG_E(" Invalid size of package is received.\r\n"); + NO_COPY_DRIVER_DEBUG_E(" Invalid size of package is received.\r\n"); ret = RPMSG_ERR_PARAM; goto out; } @@ -64,7 +64,7 @@ static int rpmsg_check_rcv_msg(struct rpmsg_rcv_msg *rcv_msg, uint32_t exp_num) /* Validate data buffer integrity. */ for (i = 0; i < (int)r_payload->size; i++) { if (r_payload->data[i] != 0xA5) { - NO_COPY_MASTER_DEBUG_I("Data corruption at index %d\r\n", i); + NO_COPY_DRIVER_DEBUG_I("Data corruption at index %d\r\n", i); ret = RPMSG_ERR_PARAM; goto out; } @@ -86,7 +86,7 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, rcv_msg.payload = (struct _payload *)data; rcv_msg.len = len; - NO_COPY_MASTER_DEBUG_I(" received payload number %lu of size %lu \r\n", + NO_COPY_DRIVER_DEBUG_I(" received payload number %lu of size %lu \r\n", rcv_msg.payload->num, (unsigned long)len); rnum = rcv_msg.payload->num + 1; @@ -97,16 +97,16 @@ static void rpmsg_service_unbind(struct rpmsg_endpoint *ept) { (void)ept; rpmsg_destroy_ept(&lept); - NO_COPY_MASTER_DEBUG_I("echo test: service is destroyed\r\n"); + NO_COPY_DRIVER_DEBUG_I("echo test: service is destroyed\r\n"); ept_deleted = 1; } static void rpmsg_name_service_bind_cb(struct rpmsg_device *rdev, const char *name, uint32_t dest) { - NO_COPY_MASTER_DEBUG_I("new endpoint notification is received.\r\n"); + NO_COPY_DRIVER_DEBUG_I("new endpoint notification is received.\r\n"); if (strcmp(name, RPMSG_SERVICE_NAME)) - NO_COPY_MASTER_DEBUG_E("Unexpected name service %s.\r\n", name); + NO_COPY_DRIVER_DEBUG_E("Unexpected name service %s.\r\n", name); else (void)rpmsg_create_ept(&lept, rdev, RPMSG_SERVICE_NAME, RPMSG_ADDR_ANY, dest, @@ -126,12 +126,12 @@ static int app(struct rpmsg_device *rdev, void *priv) err_cnt = 0; ept_deleted = 0; - NO_COPY_MASTER_DEBUG_I(" 1 - Send data to remote core, retrieve the echo"); - NO_COPY_MASTER_DEBUG_I(" and validate its integrity ..\r\n"); + NO_COPY_DRIVER_DEBUG_I(" 1 - Send data to remote core, retrieve the echo"); + NO_COPY_DRIVER_DEBUG_I(" and validate its integrity ..\r\n"); max_size = rpmsg_virtio_get_buffer_size(rdev); if ((int32_t)max_size < 0) { - NO_COPY_MASTER_DEBUG_E("No available buffer size.\r\n"); + NO_COPY_DRIVER_DEBUG_E("No available buffer size.\r\n"); return -1; } max_size -= sizeof(struct _payload); @@ -143,20 +143,20 @@ static int app(struct rpmsg_device *rdev, void *priv) rpmsg_endpoint_cb, rpmsg_service_unbind); if (ret) { - NO_COPY_MASTER_DEBUG_E("Failed to create RPMsg endpoint.\r\n"); + NO_COPY_DRIVER_DEBUG_E("Failed to create RPMsg endpoint.\r\n"); return ret; } while (!is_rpmsg_ept_ready(&lept)) platform_poll(priv); - NO_COPY_MASTER_DEBUG_I("RPMSG endpoint is binded with remote.\r\n"); + NO_COPY_DRIVER_DEBUG_I("RPMSG endpoint is binded with remote.\r\n"); for (i = 0, size = PAYLOAD_MIN_SIZE; i < num_payloads; i++, size++) { struct _payload *i_payload; i_payload = rpmsg_get_tx_payload_buffer(&lept, &max_size, 1); if (!i_payload) { - NO_COPY_MASTER_DEBUG_E("Failed to get payload...\r\n"); + NO_COPY_DRIVER_DEBUG_E("Failed to get payload...\r\n"); break; } @@ -166,7 +166,7 @@ static int app(struct rpmsg_device *rdev, void *priv) /* Mark the data buffer. */ memset(&i_payload->data[0], 0xA5, size); - NO_COPY_MASTER_DEBUG_I("sending payload number %lu of size %lu\r\n", + NO_COPY_DRIVER_DEBUG_I("sending payload number %lu of size %lu\r\n", i_payload->num, (unsigned long)(2 * sizeof(unsigned long)) + size); @@ -174,10 +174,10 @@ static int app(struct rpmsg_device *rdev, void *priv) (2 * sizeof(unsigned long)) + size); if (ret < 0) { - NO_COPY_MASTER_DEBUG_E("Failed to send data...\r\n"); + NO_COPY_DRIVER_DEBUG_E("Failed to send data...\r\n"); break; } - NO_COPY_MASTER_DEBUG_I("echo test: sent : %lu\r\n", + NO_COPY_DRIVER_DEBUG_I("echo test: sent : %lu\r\n", (unsigned long)(2 * sizeof(unsigned long)) + size); expect_rnum++; @@ -191,12 +191,12 @@ static int app(struct rpmsg_device *rdev, void *priv) err_cnt++; } - NO_COPY_MASTER_DEBUG_I("**********************************\r\n"); - NO_COPY_MASTER_DEBUG_I(" Test Results: Error count = %d \r\n", err_cnt); - NO_COPY_MASTER_DEBUG_I("**********************************\r\n"); + NO_COPY_DRIVER_DEBUG_I("**********************************\r\n"); + NO_COPY_DRIVER_DEBUG_I(" Test Results: Error count = %d \r\n", err_cnt); + NO_COPY_DRIVER_DEBUG_I("**********************************\r\n"); /* Destroy the RPMsg endpoint */ rpmsg_destroy_ept(&lept); - NO_COPY_MASTER_DEBUG_I("Quitting application .. Echo test end\r\n"); + NO_COPY_DRIVER_DEBUG_I("Quitting application .. Echo test end\r\n"); return 0; } @@ -207,16 +207,16 @@ int rpmsg_nocopy_ping(struct rpmsg_device *rdev, void *priv) metal_assert(priv); int ret; - NO_COPY_MASTER_DEBUG_I("Starting rpmsg_nocopy_ping application...\r\n"); + NO_COPY_DRIVER_DEBUG_I("Starting rpmsg_nocopy_ping application...\r\n"); ret = app(rdev, priv); if (ret != 0) { - NO_COPY_MASTER_DEBUG_E("Rpmsg_nocopy_ping application error,code:0x%x",ret); + NO_COPY_DRIVER_DEBUG_E("Rpmsg_nocopy_ping application error,code:0x%x",ret); return ret; } - NO_COPY_MASTER_DEBUG_I("Stopping rpmsg_nocopy_ping application...\r\n"); + NO_COPY_DRIVER_DEBUG_I("Stopping rpmsg_nocopy_ping application...\r\n"); return ret; } diff --git a/example/system/amp/openamp/device_core/src/rpmsg-ping.c b/example/system/amp/openamp/device_core/src/rpmsg-ping.c index 87a95d44..c0cfae6c 100644 --- a/example/system/amp/openamp/device_core/src/rpmsg-ping.c +++ b/example/system/amp/openamp/device_core/src/rpmsg-ping.c @@ -4,7 +4,7 @@ /* This is a sample demonstration application that showcases usage of rpmsg This application is meant to run on the remote CPU running baremetal code. -This application echoes back data that was sent to it by the master core. */ +This application echoes back data that was sent to it by the driver core. */ /***************************** Include Files *********************************/ @@ -21,10 +21,10 @@ This application echoes back data that was sent to it by the master core. */ /************************** Constant Definitions *****************************/ /***************** Macros (Inline Functions) Definitions *********************/ -#define PING_DEV_MASTER_DEBUG_TAG " MASTER_01" -#define PING_DEV_MASTER_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( PING_DEV_MASTER_DEBUG_TAG, format, ##__VA_ARGS__) -#define PING_DEV_MASTER_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( PING_DEV_MASTER_DEBUG_TAG, format, ##__VA_ARGS__) -#define PING_DEV_MASTER_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( PING_DEV_MASTER_DEBUG_TAG, format, ##__VA_ARGS__) +#define PING_DEV_DRIVER_DEBUG_TAG " DRIVER_01" +#define PING_DEV_DRIVER_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( PING_DEV_DRIVER_DEBUG_TAG, format, ##__VA_ARGS__) +#define PING_DEV_DRIVER_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( PING_DEV_DRIVER_DEBUG_TAG, format, ##__VA_ARGS__) +#define PING_DEV_DRIVER_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( PING_DEV_DRIVER_DEBUG_TAG, format, ##__VA_ARGS__) /**************************** Type Definitions *******************************/ #define PAYLOAD_MIN_SIZE 1 @@ -63,7 +63,7 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, if (r_payload->size == 0) { - PING_DEV_MASTER_DEBUG_E(" Invalid size of package is received.\r\n"); + PING_DEV_DRIVER_DEBUG_E(" Invalid size of package is received.\r\n"); err_cnt++; return RPMSG_SUCCESS; } @@ -72,9 +72,9 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, { if (r_payload->data[i] != flg_cnt) { - PING_DEV_MASTER_DEBUG_I("Data corruption at index %d.\r\n", i); - PING_DEV_MASTER_DEBUG_I("Want data is %d.\r\n", flg_cnt); - PING_DEV_MASTER_DEBUG_I("Get data is %d.\r\n", r_payload->data[i]); + PING_DEV_DRIVER_DEBUG_I("Data corruption at index %d.\r\n", i); + PING_DEV_DRIVER_DEBUG_I("Want data is %d.\r\n", flg_cnt); + PING_DEV_DRIVER_DEBUG_I("Get data is %d.\r\n", r_payload->data[i]); err_cnt++; break; } @@ -87,17 +87,17 @@ static void rpmsg_service_unbind(struct rpmsg_endpoint *ept) { (void)ept; rpmsg_destroy_ept(&lept); - PING_DEV_MASTER_DEBUG_I("Echo test: service is destroyed.\r\n"); + PING_DEV_DRIVER_DEBUG_I("Echo test: service is destroyed.\r\n"); ept_deleted = 1; } static void rpmsg_name_service_bind_cb(struct rpmsg_device *rdev, const char *name, uint32_t dest) { - PING_DEV_MASTER_DEBUG_I("New endpoint notification is received.\r\n"); + PING_DEV_DRIVER_DEBUG_I("New endpoint notification is received.\r\n"); if (strcmp(name, RPMSG_SERVICE_NAME)) { - PING_DEV_MASTER_DEBUG_E("Unexpected name service %s.\r\n", name); + PING_DEV_DRIVER_DEBUG_E("Unexpected name service %s.\r\n", name); } else (void)rpmsg_create_ept(&lept, rdev, RPMSG_SERVICE_NAME, @@ -120,13 +120,13 @@ static int app(struct rpmsg_device *rdev, void *priv) err_cnt = 0; ept_deleted = 0; - PING_DEV_MASTER_DEBUG_I("Send data to remote core, retrieve the echo."); - PING_DEV_MASTER_DEBUG_I(" and validate its integrity ..\r\n"); + PING_DEV_DRIVER_DEBUG_I("Send data to remote core, retrieve the echo."); + PING_DEV_DRIVER_DEBUG_I(" and validate its integrity ..\r\n"); max_size = rpmsg_virtio_get_buffer_size(rdev); if (max_size < 0) { - PING_DEV_MASTER_DEBUG_E("No avaiable buffer size.\r\n"); + PING_DEV_DRIVER_DEBUG_E("No avaiable buffer size.\r\n"); return -1; } max_size -= sizeof(struct _payload); @@ -137,7 +137,7 @@ static int app(struct rpmsg_device *rdev, void *priv) if (!i_payload) { - PING_DEV_MASTER_DEBUG_E("Memory allocation failed.\r\n"); + PING_DEV_DRIVER_DEBUG_E("Memory allocation failed.\r\n"); return -1; } @@ -148,17 +148,17 @@ static int app(struct rpmsg_device *rdev, void *priv) if (ret) { - PING_DEV_MASTER_DEBUG_E("Failed to create RPMsg endpoint.\r\n"); + PING_DEV_DRIVER_DEBUG_E("Failed to create RPMsg endpoint.\r\n"); metal_free_memory(i_payload); return ret; } while (!is_rpmsg_ept_ready(&lept)) { - PING_DEV_MASTER_DEBUG_I("start to wait platform_poll \r\n"); + PING_DEV_DRIVER_DEBUG_I("start to wait platform_poll \r\n"); platform_poll(priv); } - PING_DEV_MASTER_DEBUG_I("RPMSG endpoint is binded with remote.\r\n"); + PING_DEV_DRIVER_DEBUG_I("RPMSG endpoint is binded with remote.\r\n"); for (i = 0, size = PAYLOAD_MIN_SIZE; i < num_payloads; i++, size++) { i_payload->num = i; @@ -170,7 +170,7 @@ static int app(struct rpmsg_device *rdev, void *priv) ret = rpmsg_send(&lept, i_payload, (2 * sizeof(unsigned long)) + size); if (ret < 0) { - PING_DEV_MASTER_DEBUG_E("Failed to send data...\r\n"); + PING_DEV_DRIVER_DEBUG_E("Failed to send data...\r\n"); break; } @@ -183,13 +183,13 @@ static int app(struct rpmsg_device *rdev, void *priv) } - PING_DEV_MASTER_DEBUG_I("**********************************\r\n"); - PING_DEV_MASTER_DEBUG_I(" Test Results: Error count = %d \r\n", err_cnt); - PING_DEV_MASTER_DEBUG_I("**********************************\r\n"); + PING_DEV_DRIVER_DEBUG_I("**********************************\r\n"); + PING_DEV_DRIVER_DEBUG_I(" Test Results: Error count = %d \r\n", err_cnt); + PING_DEV_DRIVER_DEBUG_I("**********************************\r\n"); /* Destroy the RPMsg endpoint */ /* lept.addr = RPMSG_ADDR_ANY 远程endpoint 才能触发 rpmsg_service_unbind 事件回调退出 */ rpmsg_destroy_ept(&lept); - PING_DEV_MASTER_DEBUG_I("Quitting application .. Echo test end\r\n"); + PING_DEV_DRIVER_DEBUG_I("Quitting application .. Echo test end\r\n"); metal_free_memory(i_payload); return 0; @@ -201,16 +201,16 @@ int rpmsg_ping(struct rpmsg_device *rdev, void *priv) metal_assert(priv); int ret; - PING_DEV_MASTER_DEBUG_I("Starting rpmsg_ping application...\r\n"); + PING_DEV_DRIVER_DEBUG_I("Starting rpmsg_ping application...\r\n"); ret = app(rdev, priv); if (ret != 0) { - PING_DEV_MASTER_DEBUG_E("Rpmsg_ping application error,code:0x%x",ret); + PING_DEV_DRIVER_DEBUG_E("Rpmsg_ping application error,code:0x%x",ret); return ret; } - PING_DEV_MASTER_DEBUG_I("Stopping rpmsg_ping application...\r\n"); + PING_DEV_DRIVER_DEBUG_I("Stopping rpmsg_ping application...\r\n"); return ret; } diff --git a/example/system/amp/openamp/device_core/src/rpmsg-sample-ping.c b/example/system/amp/openamp/device_core/src/rpmsg-sample-ping.c index 11d8d185..883be2ae 100644 --- a/example/system/amp/openamp/device_core/src/rpmsg-sample-ping.c +++ b/example/system/amp/openamp/device_core/src/rpmsg-sample-ping.c @@ -20,10 +20,10 @@ #include "fdebug.h" /***************** Macros (Inline Functions) Definitions *********************/ -#define VIRTIO_DEV_MASTER_DEBUG_TAG " MASTER_02" -#define VIRTIO_DEV_MASTER_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( VIRTIO_DEV_MASTER_DEBUG_TAG, format, ##__VA_ARGS__) -#define VIRTIO_DEV_MASTER_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( VIRTIO_DEV_MASTER_DEBUG_TAG, format, ##__VA_ARGS__) -#define VIRTIO_DEV_MASTER_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( VIRTIO_DEV_MASTER_DEBUG_TAG, format, ##__VA_ARGS__) +#define VIRTIO_DEV_DRIVER_DEBUG_TAG " DRIVER_02" +#define VIRTIO_DEV_DRIVER_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( VIRTIO_DEV_DRIVER_DEBUG_TAG, format, ##__VA_ARGS__) +#define VIRTIO_DEV_DRIVER_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( VIRTIO_DEV_DRIVER_DEBUG_TAG, format, ##__VA_ARGS__) +#define VIRTIO_DEV_DRIVER_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( VIRTIO_DEV_DRIVER_DEBUG_TAG, format, ##__VA_ARGS__) #define HELLO_MSG "hello world!" #define BYE_MSG "goodbye!" @@ -50,7 +50,7 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, memset(payload, 0, RPMSG_BUFFER_SIZE); memcpy(payload, data, len); - VIRTIO_DEV_MASTER_DEBUG_I("received message %d: %s of size %lu \r\n", + VIRTIO_DEV_DRIVER_DEBUG_I("received message %d: %s of size %lu \r\n", rnum + 1, payload, (unsigned long)len); if (rnum == (MSG_LIMIT - 1)) @@ -58,15 +58,15 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, else sprintf (seed, "%s", HELLO_MSG); - VIRTIO_DEV_MASTER_DEBUG_I(" seed %s: \r\n", seed); + VIRTIO_DEV_DRIVER_DEBUG_I(" seed %s: \r\n", seed); if (strncmp(payload, seed, len)) { - VIRTIO_DEV_MASTER_DEBUG_E(" Invalid message is received.\r\n"); + VIRTIO_DEV_DRIVER_DEBUG_E(" Invalid message is received.\r\n"); err_cnt++; return RPMSG_SUCCESS; } rnum++; - VIRTIO_DEV_MASTER_DEBUG_I(" rnum %d: \r\n", rnum); + VIRTIO_DEV_DRIVER_DEBUG_I(" rnum %d: \r\n", rnum); if (rnum == MSG_LIMIT) { ept_deleted = 1; @@ -78,16 +78,16 @@ static void rpmsg_service_unbind(struct rpmsg_endpoint *ept) { (void)ept; rpmsg_destroy_ept(&lept); - VIRTIO_DEV_MASTER_DEBUG_I("echo test: service is destroyed\r\n"); + VIRTIO_DEV_DRIVER_DEBUG_I("echo test: service is destroyed\r\n"); ept_deleted = 1; } static void rpmsg_name_service_bind_cb(struct rpmsg_device *rdev, const char *name, uint32_t dest) { - VIRTIO_DEV_MASTER_DEBUG_I("new endpoint notification is received.\r\n"); + VIRTIO_DEV_DRIVER_DEBUG_I("new endpoint notification is received.\r\n"); if (strcmp(name, RPMSG_SERVICE_NAME)) - VIRTIO_DEV_MASTER_DEBUG_E("Unexpected name service %s.\r\n", name); + VIRTIO_DEV_DRIVER_DEBUG_E("Unexpected name service %s.\r\n", name); else (void)rpmsg_create_ept(&lept, rdev, RPMSG_SERVICE_NAME, RPMSG_ADDR_ANY, dest, @@ -107,7 +107,7 @@ static int app(struct rpmsg_device *rdev, void *priv) err_cnt = 0; ept_deleted = 0; - VIRTIO_DEV_MASTER_DEBUG_I(" 1 - Send data to remote core, retrieve the echo"); + VIRTIO_DEV_DRIVER_DEBUG_I(" 1 - Send data to remote core, retrieve the echo"); /* Create RPMsg endpoint */ ret = rpmsg_create_ept(&lept, rdev, RPMSG_SERVICE_NAME, @@ -115,17 +115,17 @@ static int app(struct rpmsg_device *rdev, void *priv) rpmsg_endpoint_cb, rpmsg_service_unbind); if (ret) { - VIRTIO_DEV_MASTER_DEBUG_E("Failed to create RPMsg endpoint.\r\n"); + VIRTIO_DEV_DRIVER_DEBUG_E("Failed to create RPMsg endpoint.\r\n"); return ret; } while (!is_rpmsg_ept_ready(&lept)) { - VIRTIO_DEV_MASTER_DEBUG_I("start to wait platform_poll \r\n"); + VIRTIO_DEV_DRIVER_DEBUG_I("start to wait platform_poll \r\n"); platform_poll(priv); } - VIRTIO_DEV_MASTER_DEBUG_I("RPMSG endpoint is binded with remote.\r\n"); + VIRTIO_DEV_DRIVER_DEBUG_I("RPMSG endpoint is binded with remote.\r\n"); for (i = 1; i <= MSG_LIMIT; i++) { @@ -135,10 +135,10 @@ static int app(struct rpmsg_device *rdev, void *priv) ret = rpmsg_send(&lept, BYE_MSG, strlen(BYE_MSG)); if (ret < 0) { - VIRTIO_DEV_MASTER_DEBUG_E("Failed to send data...\r\n"); + VIRTIO_DEV_DRIVER_DEBUG_E("Failed to send data...\r\n"); break; } - VIRTIO_DEV_MASTER_DEBUG_I("rpmsg sample test: message %d sent\r\n", i); + VIRTIO_DEV_DRIVER_DEBUG_I("rpmsg sample test: message %d sent\r\n", i); do { platform_poll(priv); @@ -146,16 +146,16 @@ static int app(struct rpmsg_device *rdev, void *priv) } - VIRTIO_DEV_MASTER_DEBUG_I("**********************************\r\n"); - VIRTIO_DEV_MASTER_DEBUG_I(" Test Results: Error count = %d\r\n", err_cnt); - VIRTIO_DEV_MASTER_DEBUG_I("**********************************\r\n"); + VIRTIO_DEV_DRIVER_DEBUG_I("**********************************\r\n"); + VIRTIO_DEV_DRIVER_DEBUG_I(" Test Results: Error count = %d\r\n", err_cnt); + VIRTIO_DEV_DRIVER_DEBUG_I("**********************************\r\n"); while (!ept_deleted) { platform_poll(priv); } rpmsg_destroy_ept(&lept); - VIRTIO_DEV_MASTER_DEBUG_I("Quitting application .. rpmsg sample test end.\r\n"); + VIRTIO_DEV_DRIVER_DEBUG_I("Quitting application .. rpmsg sample test end.\r\n"); return 0; } @@ -166,16 +166,16 @@ int rpmsg_sample_ping(struct rpmsg_device *rdev, void *priv) metal_assert(priv); int ret; - VIRTIO_DEV_MASTER_DEBUG_I("Starting rpmsg_sample_ping application...\r\n"); + VIRTIO_DEV_DRIVER_DEBUG_I("Starting rpmsg_sample_ping application...\r\n"); ret = app(rdev, priv); if (ret != 0) { - VIRTIO_DEV_MASTER_DEBUG_E("Rpmsg_sample_ping application error,code:0x%x",ret); + VIRTIO_DEV_DRIVER_DEBUG_E("Rpmsg_sample_ping application error,code:0x%x",ret); return ret; } - VIRTIO_DEV_MASTER_DEBUG_I("Stopping rpmsg_sample_ping application...\r\n"); + VIRTIO_DEV_DRIVER_DEBUG_I("Stopping rpmsg_sample_ping application...\r\n"); return ret; } diff --git a/example/system/amp/openamp/driver_core/README.md b/example/system/amp/openamp/driver_core/README.md index dc42c001..216a47f4 100644 --- a/example/system/amp/openamp/driver_core/README.md +++ b/example/system/amp/openamp/driver_core/README.md @@ -30,7 +30,7 @@ #### 系统架构 - 角色介绍:管理核作为交互管理的核心,主要进行任务分配,也承担一部分的任务反馈功能,性能核作为任务的运算执行核心,主要承担接受管理核的指令和任务运算的工作。 -- 本例程中 `driver_core` 目录下的程序为管理核(模拟)程序、`device_core`目录下为性能核(模拟)程序。管理核程序功能为初始化创建platform和rpmsg_device(主VIRTIO_DEV_MASTER),创建成功后,创建管理endpoint节点与性能核构建通信机制。性能核功能为初始化创建platform和与管理核绑定的rpmsg_device(从VIRTIO_DEV_SLAVE),创建成功后,创建监听endpoint节点接收管理核的命令来运行相关的例程。 +- 本例程中 `driver_core` 目录下的程序为管理核(模拟)程序、`device_core`目录下为性能核(模拟)程序。管理核程序功能为初始化创建platform和rpmsg_device(主VIRTIO_DEV_DRIVER),创建成功后,创建管理endpoint节点与性能核构建通信机制。性能核功能为初始化创建platform和与管理核绑定的rpmsg_device(从VIRTIO_DEV_DEVICE),创建成功后,创建监听endpoint节点接收管理核的命令来运行相关的例程。 - 核心的分配以及架构参考amp_config.json文件(具体描述参考 `Phytium-Standalone-SDK/example/system/amp/README.md` 的介绍) - common目录下为公共配置文件,方便管理核和性能核共用,也方便了解使用的资源以及修改配置。 - rpmsg 创建流程以及参考文档 diff --git a/example/system/amp/openamp/driver_core/build/amp_packed.c b/example/system/amp/openamp/driver_core/build/amp_packed.c deleted file mode 100644 index e69de29b..00000000 diff --git a/example/system/amp/openamp/driver_core/sdkconfig b/example/system/amp/openamp/driver_core/sdkconfig index d06c3b1f..573abc27 100644 --- a/example/system/amp/openamp/driver_core/sdkconfig +++ b/example/system/amp/openamp/driver_core/sdkconfig @@ -39,8 +39,8 @@ CONFIG_GCC_CODE_MODEL_SMALL=y CONFIG_USE_MSDF=y CONFIG_MSDF0=y # CONFIG_MSDF1 is not set -CONFIG_SOC_CORE_MAX_ID=7 -CONFIG_MSDF_CORE_ID=0 +CONFIG_SOC_CORE_MAX_ID=3 +CONFIG_MSDF_CORE_ID=2 # end of multi-core system deployment framework CONFIG_MMU_PAGE_SIZE_4K=y @@ -54,39 +54,44 @@ CONFIG_MAX_XLAT_TABLES=256 # # Soc configuration # -# CONFIG_TARGET_PE2204 is not set +CONFIG_TARGET_PE2204=y # CONFIG_TARGET_PE2202 is not set # CONFIG_TARGET_PE2201 is not set # CONFIG_TARGET_PD1904 is not set # CONFIG_TARGET_PD2008 is not set # CONFIG_TARGET_PD2308 is not set # CONFIG_TARGET_PS2316 is not set -CONFIG_TARGET_PD2408=y +# CONFIG_TARGET_PD2408 is not set # CONFIG_TARGET_QEMU_VIRT is not set -CONFIG_SOC_NAME="pd2408" -CONFIG_SOC_CORE_NUM=8 +CONFIG_SOC_NAME="pe220x" +CONFIG_TARGET_TYPE_NAME="pe2204" +CONFIG_SOC_CORE_NUM=4 CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 +CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # # Board Configuration # -CONFIG_BOARD_NAME="test_b" +CONFIG_BOARD_NAME="phytiumpi" # CONFIG_USE_SPI_IOPAD is not set # CONFIG_USE_GPIO_IOPAD is not set +# CONFIG_USE_CAN_IOPAD is not set # CONFIG_USE_QSPI_IOPAD is not set # CONFIG_USE_PWM_IOPAD is not set +# CONFIG_USE_MIO_IOPAD is not set # CONFIG_USE_TACHO_IOPAD is not set # CONFIG_USE_UART_IOPAD is not set # CONFIG_USE_THIRD_PARTY_IOPAD is not set -# CONFIG_PD2408_TEST_A_BOARD is not set -CONFIG_PD2408_TEST_B_BOARD=y +# CONFIG_E2000Q_DEMO_BOARD is not set +CONFIG_PHYTIUMPI_FIREFLY_BOARD=y # # IO mux configuration when board start up @@ -117,6 +122,8 @@ CONFIG_LOG_DISPALY_CORE_NUM=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set @@ -137,7 +144,6 @@ CONFIG_USE_SERIAL=y # Usart Configuration # CONFIG_ENABLE_Pl011_UART=y -# CONFIG_USE_SERIAL_V2 is not set # end of Usart Configuration # CONFIG_USE_GPIO is not set @@ -325,14 +331,11 @@ CONFIG_USE_LETTER_SHELL=y # Letter Shell Configuration # CONFIG_LS_PL011_UART=y -# CONFIG_LS_SERIAL_V2 is not set CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y # CONFIG_DEFAULT_LETTER_SHELL_USE_UART0 is not set # CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set CONFIG_LETTER_SHELL_UART_INTERRUPT_MODE=y # CONFIG_LETTER_SHELL_UART_POLLED_MODE is not set -# CONFIG_LETTER_SHELL_UART_MSG_INTR_MODE is not set -# CONFIG_LETTER_SHELL_UART_MSG_POLLED_MODE is not set # end of Letter Shell Configuration CONFIG_USE_AMP=y diff --git a/example/system/amp/openamp/driver_core/sdkconfig.h b/example/system/amp/openamp/driver_core/sdkconfig.h index 2e1ece1c..400fae17 100644 --- a/example/system/amp/openamp/driver_core/sdkconfig.h +++ b/example/system/amp/openamp/driver_core/sdkconfig.h @@ -37,8 +37,8 @@ #define CONFIG_USE_MSDF #define CONFIG_MSDF0 /* CONFIG_MSDF1 is not set */ -#define CONFIG_SOC_CORE_MAX_ID 7 -#define CONFIG_MSDF_CORE_ID 0 +#define CONFIG_SOC_CORE_MAX_ID 3 +#define CONFIG_MSDF_CORE_ID 2 /* end of multi-core system deployment framework */ #define CONFIG_MMU_PAGE_SIZE_4K /* CONFIG_MMU_PAGE_SIZE_16K is not set */ @@ -50,38 +50,43 @@ /* Soc configuration */ -/* CONFIG_TARGET_PE2204 is not set */ +#define CONFIG_TARGET_PE2204 /* CONFIG_TARGET_PE2202 is not set */ /* CONFIG_TARGET_PE2201 is not set */ /* CONFIG_TARGET_PD1904 is not set */ /* CONFIG_TARGET_PD2008 is not set */ /* CONFIG_TARGET_PD2308 is not set */ /* CONFIG_TARGET_PS2316 is not set */ -#define CONFIG_TARGET_PD2408 +/* CONFIG_TARGET_PD2408 is not set */ /* CONFIG_TARGET_QEMU_VIRT is not set */ -#define CONFIG_SOC_NAME "pd2408" -#define CONFIG_SOC_CORE_NUM 8 +#define CONFIG_SOC_NAME "pe220x" +#define CONFIG_TARGET_TYPE_NAME "pe2204" +#define CONFIG_SOC_CORE_NUM 4 #define CONFIG_F32BIT_MEMORY_ADDRESS 0x80000000 #define CONFIG_F32BIT_MEMORY_LENGTH 0x80000000 #define CONFIG_F64BIT_MEMORY_ADDRESS 0x2000000000 #define CONFIG_F64BIT_MEMORY_LENGTH 0x800000000 +#define CONFIG_TARGET_PE220X #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ -#define CONFIG_BOARD_NAME "test_b" +#define CONFIG_BOARD_NAME "phytiumpi" /* CONFIG_USE_SPI_IOPAD is not set */ /* CONFIG_USE_GPIO_IOPAD is not set */ +/* CONFIG_USE_CAN_IOPAD is not set */ /* CONFIG_USE_QSPI_IOPAD is not set */ /* CONFIG_USE_PWM_IOPAD is not set */ +/* CONFIG_USE_MIO_IOPAD is not set */ /* CONFIG_USE_TACHO_IOPAD is not set */ /* CONFIG_USE_UART_IOPAD is not set */ /* CONFIG_USE_THIRD_PARTY_IOPAD is not set */ -/* CONFIG_PD2408_TEST_A_BOARD is not set */ -#define CONFIG_PD2408_TEST_B_BOARD +/* CONFIG_E2000Q_DEMO_BOARD is not set */ +#define CONFIG_PHYTIUMPI_FIREFLY_BOARD /* IO mux configuration when board start up */ @@ -108,6 +113,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ @@ -126,7 +133,6 @@ /* Usart Configuration */ #define CONFIG_ENABLE_Pl011_UART -/* CONFIG_USE_SERIAL_V2 is not set */ /* end of Usart Configuration */ /* CONFIG_USE_GPIO is not set */ /* CONFIG_USE_ETH is not set */ @@ -289,14 +295,11 @@ /* Letter Shell Configuration */ #define CONFIG_LS_PL011_UART -/* CONFIG_LS_SERIAL_V2 is not set */ #define CONFIG_DEFAULT_LETTER_SHELL_USE_UART1 /* CONFIG_DEFAULT_LETTER_SHELL_USE_UART0 is not set */ /* CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set */ #define CONFIG_LETTER_SHELL_UART_INTERRUPT_MODE /* CONFIG_LETTER_SHELL_UART_POLLED_MODE is not set */ -/* CONFIG_LETTER_SHELL_UART_MSG_INTR_MODE is not set */ -/* CONFIG_LETTER_SHELL_UART_MSG_POLLED_MODE is not set */ /* end of Letter Shell Configuration */ #define CONFIG_USE_AMP #define CONFIG_USE_LIBMETAL diff --git a/example/system/amp/openamp/driver_core/src/matrix_multiplyd.c b/example/system/amp/openamp/driver_core/src/matrix_multiplyd.c index 11bcbede..17da239a 100644 --- a/example/system/amp/openamp/driver_core/src/matrix_multiplyd.c +++ b/example/system/amp/openamp/driver_core/src/matrix_multiplyd.c @@ -4,8 +4,8 @@ /* This is a sample demonstration application that showcases usage of remoteproc and rpmsg APIs on the remote core. This application is meant to run on the remote CPU -running baremetal code. This applicationr receives two matrices from the master, -multiplies them and returns the result to the master core. */ +running baremetal code. This applicationr receives two matrices from the driver, +multiplies them and returns the result to the driver core. */ #include #include @@ -15,10 +15,10 @@ multiplies them and returns the result to the master core. */ #include "platform_info.h" #include "fdebug.h" -#define MAT_MULT_SLAVE_DEBUG_TAG " SLAVE_03" -#define MAT_MULT_SLAVE_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( MAT_MULT_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) -#define MAT_MULT_SLAVE_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( MAT_MULT_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) -#define MAT_MULT_SLAVE_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( MAT_MULT_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) +#define MAT_MULT_DEVICE_DEBUG_TAG " DEVICE_03" +#define MAT_MULT_DEVICE_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( MAT_MULT_DEVICE_DEBUG_TAG, format, ##__VA_ARGS__) +#define MAT_MULT_DEVICE_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( MAT_MULT_DEVICE_DEBUG_TAG, format, ##__VA_ARGS__) +#define MAT_MULT_DEVICE_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( MAT_MULT_DEVICE_DEBUG_TAG, format, ##__VA_ARGS__) #define MAX_SIZE 6 #define NUM_MATRIX 2 @@ -67,7 +67,7 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, (void)src; if ((*(unsigned int *)data) == SHUTDOWN_MSG) { - MAT_MULT_SLAVE_DEBUG_I("shutdown message is received.\r\n"); + MAT_MULT_DEVICE_DEBUG_I("shutdown message is received.\r\n"); shutdown_req = 1; return RPMSG_SUCCESS; } @@ -76,9 +76,9 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, /* Process received data and multiple matrices. */ Matrix_Multiply(&matrix_array[0], &matrix_array[1], &matrix_result); - /* Send the result of matrix multiplication back to master. */ + /* Send the result of matrix multiplication back to driver. */ if (rpmsg_send(ept, &matrix_result, sizeof(matrix)) < 0) { - MAT_MULT_SLAVE_DEBUG_E("rpmsg_send failed\r\n"); + MAT_MULT_DEVICE_DEBUG_E("rpmsg_send failed\r\n"); } return RPMSG_SUCCESS; } @@ -86,7 +86,7 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, static void rpmsg_service_unbind(struct rpmsg_endpoint *ept) { (void)ept; - MAT_MULT_SLAVE_DEBUG_E("Endpoint is destroyed\r\n"); + MAT_MULT_DEVICE_DEBUG_E("Endpoint is destroyed\r\n"); shutdown_req = 1; } @@ -103,11 +103,11 @@ static int app(struct rpmsg_device *rdev, void *priv) rpmsg_endpoint_cb, rpmsg_service_unbind); if (ret) { - MAT_MULT_SLAVE_DEBUG_E("Failed to create endpoint.\r\n"); + MAT_MULT_DEVICE_DEBUG_E("Failed to create endpoint.\r\n"); return -1; } - MAT_MULT_SLAVE_DEBUG_I("Waiting for events...\r\n"); + MAT_MULT_DEVICE_DEBUG_I("Waiting for events...\r\n"); while(1) { platform_poll(priv); /* we got a shutdown request, exit */ @@ -125,21 +125,21 @@ static int app(struct rpmsg_device *rdev, void *priv) *-----------------------------------------------------------------------------*/ int matrix_multiplyd(struct rpmsg_device *rdev, void *priv) { - MAT_MULT_SLAVE_DEBUG_I("Starting application...\r\n"); + MAT_MULT_DEVICE_DEBUG_I("Starting application...\r\n"); metal_assert(rdev); metal_assert(priv); int ret; - MAT_MULT_SLAVE_DEBUG_I("Starting matrix_multiplyd application...\r\n"); + MAT_MULT_DEVICE_DEBUG_I("Starting matrix_multiplyd application...\r\n"); ret = app(rdev, priv); if (ret != 0) { - MAT_MULT_SLAVE_DEBUG_E("Matrix_multiplyd application error,code:0x%x",ret); + MAT_MULT_DEVICE_DEBUG_E("Matrix_multiplyd application error,code:0x%x",ret); return ret; } - MAT_MULT_SLAVE_DEBUG_I("Stopping matrix_multiplyd application...\r\n"); + MAT_MULT_DEVICE_DEBUG_I("Stopping matrix_multiplyd application...\r\n"); return ret; } diff --git a/example/system/amp/openamp/driver_core/src/rpmsg-demo-manager_cmd.c b/example/system/amp/openamp/driver_core/src/rpmsg-demo-manager_cmd.c index d92c2f5f..d6fd88e0 100644 --- a/example/system/amp/openamp/driver_core/src/rpmsg-demo-manager_cmd.c +++ b/example/system/amp/openamp/driver_core/src/rpmsg-demo-manager_cmd.c @@ -37,7 +37,6 @@ #include "platform_info.h" #include "rpmsg_service.h" #include "rsc_table.h" -#include "helper.h" #include "load_fw.h" #include "fparameters.h" #include "fdebug.h" @@ -55,10 +54,10 @@ /************************** Constant Definitions *****************************/ /***************** Macros (Inline Functions) Definitions *********************/ -#define DEMO_MANG_MASTER_DEBUG_TAG "DEMO_MANG_MASTER" -#define DEMO_MANG_MASTER_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( DEMO_MANG_MASTER_DEBUG_TAG, format, ##__VA_ARGS__) -#define DEMO_MANG_MASTER_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( DEMO_MANG_MASTER_DEBUG_TAG, format, ##__VA_ARGS__) -#define DEMO_MANG_MASTER_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( DEMO_MANG_MASTER_DEBUG_TAG, format, ##__VA_ARGS__) +#define DEMO_MANG_DRIVER_DEBUG_TAG "DEMO_MANG_DRIVER" +#define DEMO_MANG_DRIVER_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( DEMO_MANG_DRIVER_DEBUG_TAG, format, ##__VA_ARGS__) +#define DEMO_MANG_DRIVER_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( DEMO_MANG_DRIVER_DEBUG_TAG, format, ##__VA_ARGS__) +#define DEMO_MANG_DRIVER_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( DEMO_MANG_DRIVER_DEBUG_TAG, format, ##__VA_ARGS__) /**************************** Type Definitions *******************************/ @@ -73,30 +72,30 @@ /************************** Variable Definitions *****************************/ struct metal_device kick_device_00 = { - .name = SLAVE_00_KICK_DEV_NAME, + .name = DEVICE_00_KICK_DEV_NAME, .bus = NULL, .irq_num = 1, - .irq_info = (void *)SLAVE_00_SGI, + .irq_info = (void *)DEVICE_00_SGI, } ; -struct remoteproc_priv slave_00_priv = { - .kick_dev_name = SLAVE_00_KICK_DEV_NAME , +struct remoteproc_priv device_00_priv = { + .kick_dev_name = DEVICE_00_KICK_DEV_NAME , .kick_dev_bus_name = KICK_BUS_NAME , - .cpu_id = SLAVE_DEVICE_CORE_00 ,/* 设置CPU ID */ + .cpu_id = DEVICE_CORE_00 ,/* 设置CPU ID */ - .src_table_attribute = SLAVE00_SOURCE_TABLE_ATTRIBUTE , + .src_table_attribute = DEVICE00_SOURCE_TABLE_ATTRIBUTE , /* |rx vring|tx vring|share buffer| */ - .share_mem_va = SLAVE00_SHARE_MEM_ADDR , - .share_mem_pa = SLAVE00_SHARE_MEM_ADDR , - .share_buffer_offset = SLAVE00_VRING_SIZE , - .share_mem_size = SLAVE00_SHARE_MEM_SIZE , - .share_mem_attribute = SLAVE00_SHARE_BUFFER_ATTRIBUTE , + .share_mem_va = DEVICE00_SHARE_MEM_ADDR , + .share_mem_pa = DEVICE00_SHARE_MEM_ADDR , + .share_buffer_offset = DEVICE00_VRING_SIZE , + .share_mem_size = DEVICE00_SHARE_MEM_SIZE , + .share_mem_attribute = DEVICE00_SHARE_BUFFER_ATTRIBUTE , } ; /*OpenAMP 相关定义*/ -struct remoteproc remoteproc_slave_00 ; -static struct rpmsg_device *rpdev_slave_00 = NULL; -static struct rpmsg_endpoint ept_master_slave_00; +struct remoteproc remoteproc_device_00 ; +static struct rpmsg_device *rpdev_device_00 = NULL; +static struct rpmsg_endpoint ept_driver_device_00; /* 标志相关定义 */ static int volatile cmd_ok = MANAGE_WAIT; static u32 demo_flag = RPMSG_PING_DEMO; @@ -107,6 +106,8 @@ static struct mem_file image[FCORE_NUM] = {(void *)0}; extern void * amp_img_start; extern void * amp_img_end; /************************** Function Prototypes ******************************/ +/* External functions */ +extern int init_system(); extern int rpmsg_echo(struct rpmsg_device *rdev, void *priv); extern int rpmsg_sample_echo(struct rpmsg_device *rdev, void *priv) ; extern int matrix_multiplyd(struct rpmsg_device *rdev, void *priv) ; @@ -124,13 +125,13 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, (void)ept; (void)src; (void)priv; - DEMO_MANG_MASTER_DEBUG_E("src:0x%x",src); + DEMO_MANG_DRIVER_DEBUG_E("src:0x%x",src); /* 通过'src'可以筛选自己想要的数据来源 */ if (i != demo_flag) { - DEMO_MANG_MASTER_DEBUG_I("Data corruption at index %d.\r\n", i); - DEMO_MANG_MASTER_DEBUG_I("Want data is %d.\r\n", demo_flag); + DEMO_MANG_DRIVER_DEBUG_I("Data corruption at index %d.\r\n", i); + DEMO_MANG_DRIVER_DEBUG_I("Want data is %d.\r\n", demo_flag); return RPMSG_ERROR_BASE; } cmd_ok = MANAGE_READ; @@ -140,21 +141,21 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, static void rpmsg_service_unbind(struct rpmsg_endpoint *ept) { (void)ept; - rpmsg_destroy_ept(&ept_master_slave_00); - DEMO_MANG_MASTER_DEBUG_E("Echo test: service is destroyed.\r\n"); + rpmsg_destroy_ept(&ept_driver_device_00); + DEMO_MANG_DRIVER_DEBUG_E("Echo test: service is destroyed.\r\n"); } static void rpmsg_name_service_bind_cb(struct rpmsg_device *rdev, const char *name, uint32_t dest) { - DEMO_MANG_MASTER_DEBUG_I("New endpoint notification is received.\r\n"); + DEMO_MANG_DRIVER_DEBUG_I("New endpoint notification is received.\r\n"); if (strcmp(name, RPMSG_SERVICE_00_NAME)) { - DEMO_MANG_MASTER_DEBUG_E("Unexpected name service %s.\r\n", name); + DEMO_MANG_DRIVER_DEBUG_E("Unexpected name service %s.\r\n", name); } else - (void)rpmsg_create_ept(&ept_master_slave_00, rdev, RPMSG_SERVICE_00_NAME, - MASTER_DRIVER_EPT_ADDR, dest, + (void)rpmsg_create_ept(&ept_driver_device_00, rdev, RPMSG_SERVICE_00_NAME, + DRIVER_EPT_ADDR, dest, rpmsg_endpoint_cb, rpmsg_service_unbind); } @@ -167,20 +168,20 @@ static int FManageEptCreat(struct rpmsg_device *rdev, void *priv) int ret = 0; /* Create RPMsg endpoint */ - ret = rpmsg_create_ept(&ept_master_slave_00, rdev, RPMSG_SERVICE_00_NAME, - MASTER_DRIVER_EPT_ADDR, SLAVE_DEVICE_00_EPT_ADDR, + ret = rpmsg_create_ept(&ept_driver_device_00, rdev, RPMSG_SERVICE_00_NAME, + DRIVER_EPT_ADDR, DEVICE_00_EPT_ADDR, rpmsg_endpoint_cb, rpmsg_service_unbind); if (ret) { - DEMO_MANG_MASTER_DEBUG_E("Failed to create endpoint. %d \r\n", ret); + DEMO_MANG_DRIVER_DEBUG_E("Failed to create endpoint. %d \r\n", ret); return -1; } - while (!is_rpmsg_ept_ready(&ept_master_slave_00)) + while (!is_rpmsg_ept_ready(&ept_driver_device_00)) { - DEMO_MANG_MASTER_DEBUG_I("start to wait platform_poll \r\n"); + DEMO_MANG_DRIVER_DEBUG_I("start to wait platform_poll \r\n"); platform_poll(priv); } - DEMO_MANG_MASTER_DEBUG_I("Manage rpmsg_ept_ready!!!"); + DEMO_MANG_DRIVER_DEBUG_I("Manage rpmsg_ept_ready!!!"); return ret; } @@ -188,10 +189,10 @@ int FRunningApp(struct rpmsg_device *rdev, void *priv) { int ret = 0; - ret = rpmsg_send(&ept_master_slave_00, &demo_flag, sizeof(u32)); + ret = rpmsg_send(&ept_driver_device_00, &demo_flag, sizeof(u32)); if (ret < 0) { - DEMO_MANG_MASTER_DEBUG_E("Failed to send data,ret:%d...\r\n",ret); + DEMO_MANG_DRIVER_DEBUG_E("Failed to send data,ret:%d...\r\n",ret); return ret; } cmd_ok = MANAGE_WAIT; @@ -205,13 +206,13 @@ int FRunningApp(struct rpmsg_device *rdev, void *priv) { if (demo_flag == RPMSG_PING_DEMO) { - DEMO_MANG_MASTER_DEBUG_I("*********************************************......\r\n") ; - DEMO_MANG_MASTER_DEBUG_I("***********Demo rpmsg_echo running***********......\r\n") ; - DEMO_MANG_MASTER_DEBUG_I("*********************************************......\r\n") ; + DEMO_MANG_DRIVER_DEBUG_I("*********************************************......\r\n") ; + DEMO_MANG_DRIVER_DEBUG_I("***********Demo rpmsg_echo running***********......\r\n") ; + DEMO_MANG_DRIVER_DEBUG_I("*********************************************......\r\n") ; ret = rpmsg_echo(rdev, priv); if (ret != 0) { - DEMO_MANG_MASTER_DEBUG_E("rpmsg_echo running error,ecode:%d.",ret); + DEMO_MANG_DRIVER_DEBUG_E("rpmsg_echo running error,ecode:%d.",ret); return ret; } } @@ -219,13 +220,13 @@ int FRunningApp(struct rpmsg_device *rdev, void *priv) if (demo_flag == RPMSG_SAM_PING_DEMO) { printf("\r\n\r\n"); - DEMO_MANG_MASTER_DEBUG_I("*********************************************......\r\n"); - DEMO_MANG_MASTER_DEBUG_I("*******Demo rpmsg_sample_echo running********......\r\n") ; - DEMO_MANG_MASTER_DEBUG_I("*********************************************......\r\n") ; + DEMO_MANG_DRIVER_DEBUG_I("*********************************************......\r\n"); + DEMO_MANG_DRIVER_DEBUG_I("*******Demo rpmsg_sample_echo running********......\r\n") ; + DEMO_MANG_DRIVER_DEBUG_I("*********************************************......\r\n") ; ret = rpmsg_sample_echo(rdev, priv); if (ret != 0) { - DEMO_MANG_MASTER_DEBUG_E("rpmsg_sample_echo running error,ecode:%d.",ret); + DEMO_MANG_DRIVER_DEBUG_E("rpmsg_sample_echo running error,ecode:%d.",ret); return ret; } } @@ -233,13 +234,13 @@ int FRunningApp(struct rpmsg_device *rdev, void *priv) if (demo_flag == RPMSG_MAT_MULT_DEMO) { printf("\r\n\r\n"); - DEMO_MANG_MASTER_DEBUG_I("*********************************************......\r\n") ; - DEMO_MANG_MASTER_DEBUG_I("*******Demo matrix_multiplyd running********......\r\n") ; - DEMO_MANG_MASTER_DEBUG_I("*********************************************......\r\n") ; + DEMO_MANG_DRIVER_DEBUG_I("*********************************************......\r\n") ; + DEMO_MANG_DRIVER_DEBUG_I("*******Demo matrix_multiplyd running********......\r\n") ; + DEMO_MANG_DRIVER_DEBUG_I("*********************************************......\r\n") ; ret = matrix_multiplyd(rdev, priv); if (ret != 0) { - DEMO_MANG_MASTER_DEBUG_E("matrix_multiplyd running error,ecode:%d.",ret); + DEMO_MANG_DRIVER_DEBUG_E("matrix_multiplyd running error,ecode:%d.",ret); return ret; } } @@ -247,18 +248,18 @@ int FRunningApp(struct rpmsg_device *rdev, void *priv) if (demo_flag == RPMSG_NO_COPY_DEMO) { printf("\r\n\r\n"); - DEMO_MANG_MASTER_DEBUG_I("*********************************************......\r\n") ; - DEMO_MANG_MASTER_DEBUG_I("*******Demo rpmsg_nocopy_echo running********......\r\n") ; - DEMO_MANG_MASTER_DEBUG_I("*********************************************......\r\n") ; + DEMO_MANG_DRIVER_DEBUG_I("*********************************************......\r\n") ; + DEMO_MANG_DRIVER_DEBUG_I("*******Demo rpmsg_nocopy_echo running********......\r\n") ; + DEMO_MANG_DRIVER_DEBUG_I("*********************************************......\r\n") ; ret = rpmsg_nocopy_echo(rdev, priv); if (ret != 0) { - DEMO_MANG_MASTER_DEBUG_E("rpmsg_nocopy_echo running error,ecode:%d.",ret); + DEMO_MANG_DRIVER_DEBUG_E("rpmsg_nocopy_echo running error,ecode:%d.",ret); return ret; } } cmd_ok = MANAGE_WAIT; - DEMO_MANG_MASTER_DEBUG_I(" Demo %d running over...",demo_flag); + DEMO_MANG_DRIVER_DEBUG_I(" Demo %d running over...",demo_flag); demo_flag++; return ret; } @@ -273,24 +274,20 @@ static int FOpenampClose(void *platform) struct remoteproc *rproc = platform; if (rproc == NULL) return -1; - if (rpdev_slave_00 == NULL) + if (rpdev_device_00 == NULL) return -1; - rpmsg_destroy_ept(&ept_master_slave_00); + rpmsg_destroy_ept(&ept_driver_device_00); - platform_release_rpmsg_vdev(rpdev_slave_00, platform); + platform_release_rpmsg_vdev(rpdev_device_00, platform); ret = remoteproc_shutdown(rproc); if (ret != 0) { - DEMO_MANG_MASTER_DEBUG_E("Can't shutdown remoteproc,error code:0x%x.",ret); + DEMO_MANG_DRIVER_DEBUG_E("Can't shutdown remoteproc,error code:0x%x.",ret); } - ret = platform_cleanup(platform); - if (ret != 0) - { - DEMO_MANG_MASTER_DEBUG_E("Can't remove platform,error code:0x%x.",ret); - } + platform_cleanup(platform); return ret; } @@ -332,61 +329,61 @@ int FOpenampExample(void) init_system(); /* Initialize the system resources and environment */ /* Initialize remoteproc */ - if (!platform_create_proc(&remoteproc_slave_00, &slave_00_priv, &kick_device_00)) + if (!platform_create_proc(&remoteproc_device_00, &device_00_priv, &kick_device_00)) { - DEMO_MANG_MASTER_DEBUG_E("Failed to create remoteproc instance for slave 00\r\n"); - platform_cleanup(&remoteproc_slave_00); + DEMO_MANG_DRIVER_DEBUG_E("Failed to create remoteproc instance for device 00\r\n"); + platform_cleanup(&remoteproc_device_00); return -1; } /*加载镜像,并启动,镜像的序号对应为 amp_config.json中 一个配置项 的索引位置*/ - if(load_exectuable_block(&remoteproc_slave_00, &mem_image_store_ops, &image[SLAVE00_IMAGE_NUM].base, NULL)) + if(load_exectuable_block(&remoteproc_device_00, &mem_image_store_ops, &image[DEVICE00_IMAGE_NUM].base, NULL)) { return -1; } /* Setup resource tables for the created remoteproc instances*/ - if (platform_setup_src_table(&remoteproc_slave_00, remoteproc_slave_00.rsc_table)) + if (platform_setup_src_table(&remoteproc_device_00, remoteproc_device_00.rsc_table)) { - DEMO_MANG_MASTER_DEBUG_E("Failed to setup src table for slave 00\r\n"); + DEMO_MANG_DRIVER_DEBUG_E("Failed to setup src table for device 00\r\n"); return -1; } - DEMO_MANG_MASTER_DEBUG_I("Setup resource tables for the created remoteproc instances is over \r\n"); + DEMO_MANG_DRIVER_DEBUG_I("Setup resource tables for the created remoteproc instances is over \r\n"); /* Setup shared memory regions for both remoteproc instances */ - if (platform_setup_share_mems(&remoteproc_slave_00)) + if (platform_setup_share_mems(&remoteproc_device_00)) { - DEMO_MANG_MASTER_DEBUG_E("Failed to setup shared memory for slave 00\r\n"); + DEMO_MANG_DRIVER_DEBUG_E("Failed to setup shared memory for device 00\r\n"); return -1; } - DEMO_MANG_MASTER_DEBUG_I("Setup shared memory regions for both remoteproc instances is over \r\n"); + DEMO_MANG_DRIVER_DEBUG_I("Setup shared memory regions for both remoteproc instances is over \r\n"); /* Create rpmsg virtual devices for communication */ - rpdev_slave_00 = platform_create_rpmsg_vdev(&remoteproc_slave_00, 0, VIRTIO_DEV_MASTER, NULL, rpmsg_name_service_bind_cb); - if (!rpdev_slave_00) + rpdev_device_00 = platform_create_rpmsg_vdev(&remoteproc_device_00, 0, VIRTIO_DEV_DRIVER, NULL, rpmsg_name_service_bind_cb); + if (!rpdev_device_00) { - DEMO_MANG_MASTER_DEBUG_E("Failed to create rpmsg vdev for slave 00\r\n"); - platform_cleanup(&remoteproc_slave_00); + DEMO_MANG_DRIVER_DEBUG_E("Failed to create rpmsg vdev for device 00\r\n"); + platform_cleanup(&remoteproc_device_00); return -1; } - DEMO_MANG_MASTER_DEBUG_I("Create rpmsg virtual devices for communication \r\n"); - ret = FManageEptCreat(rpdev_slave_00, &remoteproc_slave_00); + DEMO_MANG_DRIVER_DEBUG_I("Create rpmsg virtual devices for communication \r\n"); + ret = FManageEptCreat(rpdev_device_00, &remoteproc_device_00); if (ret) { - return FOpenampClose(&remoteproc_slave_00); + return FOpenampClose(&remoteproc_device_00); } elf_boot_flag = 1; - fsleep_millisec(1000);/*等待slave 00 启动完成,并完成初始化任务调度*/ + fsleep_millisec(1000);/*等待device 00 启动完成,并完成初始化任务调度*/ } if (elf_boot_flag == 1) { while (demo_flag < RPMSG_DEMO_MAX) { - ret = FRunningApp(rpdev_slave_00, &remoteproc_slave_00); + ret = FRunningApp(rpdev_device_00, &remoteproc_device_00); if (ret) { - return FOpenampClose(&remoteproc_slave_00); + return FOpenampClose(&remoteproc_device_00); } } } vTaskDelay(pdMS_TO_TICKS(100)); - DEMO_MANG_MASTER_DEBUG_I("Stopping application...\r\n"); + DEMO_MANG_DRIVER_DEBUG_I("Stopping application...\r\n"); if (ret != 0 && elf_boot_flag == 1 && demo_flag == (RPMSG_DEMO_MAX-1)) { printf("%s@%d: openamp example [failure] !!! \r\n", __func__, __LINE__); @@ -405,23 +402,23 @@ void RpmsgEchoTask( void * args ) { int ret; - DEMO_MANG_MASTER_DEBUG_I("complier %s ,%s \r\n", __DATE__, __TIME__); - DEMO_MANG_MASTER_DEBUG_I("openamp lib version: %s (", openamp_version()); - DEMO_MANG_MASTER_DEBUG_I("Major: %d, ", openamp_version_major()); - DEMO_MANG_MASTER_DEBUG_I("Minor: %d, ", openamp_version_minor()); - DEMO_MANG_MASTER_DEBUG_I("Patch: %d)\r\n", openamp_version_patch()); + DEMO_MANG_DRIVER_DEBUG_I("complier %s ,%s \r\n", __DATE__, __TIME__); + DEMO_MANG_DRIVER_DEBUG_I("openamp lib version: %s (", openamp_version()); + DEMO_MANG_DRIVER_DEBUG_I("Major: %d, ", openamp_version_major()); + DEMO_MANG_DRIVER_DEBUG_I("Minor: %d, ", openamp_version_minor()); + DEMO_MANG_DRIVER_DEBUG_I("Patch: %d)\r\n", openamp_version_patch()); - DEMO_MANG_MASTER_DEBUG_I("libmetal lib version: %s (", metal_ver()); - DEMO_MANG_MASTER_DEBUG_I("Major: %d, ", metal_ver_major()); - DEMO_MANG_MASTER_DEBUG_I("Minor: %d, ", metal_ver_minor()); - DEMO_MANG_MASTER_DEBUG_I("Patch: %d)\r\n", metal_ver_patch()); + DEMO_MANG_DRIVER_DEBUG_I("libmetal lib version: %s (", metal_ver()); + DEMO_MANG_DRIVER_DEBUG_I("Major: %d, ", metal_ver_major()); + DEMO_MANG_DRIVER_DEBUG_I("Minor: %d, ", metal_ver_minor()); + DEMO_MANG_DRIVER_DEBUG_I("Patch: %d)\r\n", metal_ver_patch()); /* Initialize platform */ - DEMO_MANG_MASTER_DEBUG_I("start application"); + DEMO_MANG_DRIVER_DEBUG_I("start application"); ret = FOpenampExample(); if (ret) { - DEMO_MANG_MASTER_DEBUG_E("Failed to running example.\r\n"); + DEMO_MANG_DRIVER_DEBUG_E("Failed to running example.\r\n"); } vTaskDelete(NULL); } @@ -439,7 +436,7 @@ BaseType_t FFreeRTOSOpenampExample(void) if(xReturn != pdPASS) { - DEMO_MANG_MASTER_DEBUG_E("Failed to create a RpmsgEchoTask task "); + DEMO_MANG_DRIVER_DEBUG_E("Failed to create a RpmsgEchoTask task "); return -1; } return xReturn; @@ -451,10 +448,10 @@ static void FOpenampCmdUsage() printf("Usage:\r\n"); printf("openamp auto \r\n"); printf("-- Auto running.\r\n"); - printf("-- [1] This application echoes back data that was sent to it by the master core.\r\n"); + printf("-- [1] This application echoes back data that was sent to it by the driver core.\r\n"); printf("-- [2] This application simulate sample rpmsg driver. For this it echo 100 time message sent by the rpmsg sample client available in distribution.\r\n"); - printf("-- [3] This application receives two matrices from the master, multiplies them and returns the result to the master core.\r\n"); - printf("-- [4] This application echoes back data that was sent to it by the master core.\r\n"); + printf("-- [3] This application receives two matrices from the driver, multiplies them and returns the result to the driver core.\r\n"); + printf("-- [4] This application echoes back data that was sent to it by the driver core.\r\n"); } BaseType_t FOpenampCmdEntry(int argc, char *argv[]) diff --git a/example/system/amp/openamp/driver_core/src/rpmsg-echo.c b/example/system/amp/openamp/driver_core/src/rpmsg-echo.c index b0885281..df5e2528 100644 --- a/example/system/amp/openamp/driver_core/src/rpmsg-echo.c +++ b/example/system/amp/openamp/driver_core/src/rpmsg-echo.c @@ -19,7 +19,7 @@ * LastEditTime: 2022-03-09 10:01:19 * Description:  This is a sample demonstration application that showcases usage of rpmsg * This application is meant to run on the remote CPU running baremetal code. - * This application echoes back data that was sent to it by the master core. + * This application echoes back data that was sent to it by the driver core. * * Modify History: * Ver   Who        Date         Changes @@ -44,10 +44,10 @@ #define SHUTDOWN_MSG 0xEF56A55A -#define ECHO_DEV_SLAVE_DEBUG_TAG " SLAVE_01" -#define ECHO_DEV_SLAVE_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( ECHO_DEV_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) -#define ECHO_DEV_SLAVE_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( ECHO_DEV_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) -#define ECHO_DEV_SLAVE_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( ECHO_DEV_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) +#define ECHO_DEV_DEVICE_DEBUG_TAG " DEVICE_01" +#define ECHO_DEV_DEVICE_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( ECHO_DEV_DEVICE_DEBUG_TAG, format, ##__VA_ARGS__) +#define ECHO_DEV_DEVICE_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( ECHO_DEV_DEVICE_DEBUG_TAG, format, ##__VA_ARGS__) +#define ECHO_DEV_DEVICE_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( ECHO_DEV_DEVICE_DEBUG_TAG, format, ##__VA_ARGS__) /************************** Variable Definitions *****************************/ static struct rpmsg_endpoint lept; static int shutdown_req = 0; @@ -65,7 +65,7 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, /* On reception of a shutdown we signal the application to terminate */ if ((*(unsigned int *)data) == SHUTDOWN_MSG) { - ECHO_DEV_SLAVE_DEBUG_I("Shutdown message is received.\r\n"); + ECHO_DEV_DEVICE_DEBUG_I("Shutdown message is received.\r\n"); shutdown_req = 1; return RPMSG_SUCCESS; } @@ -74,10 +74,10 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, FCacheDCacheInvalidateRange((intptr)data, len); #endif - /* Send data back to master */ + /* Send data back to driver */ if (rpmsg_send(ept, data, len) < 0) { - ECHO_DEV_SLAVE_DEBUG_E("rpmsg_send failed.\r\n"); + ECHO_DEV_DEVICE_DEBUG_E("rpmsg_send failed.\r\n"); } return RPMSG_SUCCESS; @@ -86,7 +86,7 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, static void rpmsg_service_unbind(struct rpmsg_endpoint *ept) { (void)ept; - ECHO_DEV_SLAVE_DEBUG_I("Unexpected remote endpoint destroy.\r\n"); + ECHO_DEV_DEVICE_DEBUG_I("Unexpected remote endpoint destroy.\r\n"); shutdown_req = 1; } @@ -98,16 +98,16 @@ static int app(struct rpmsg_device *rdev, void *priv) int ret; shutdown_req = 0; /* Initialize RPMSG framework */ - ECHO_DEV_SLAVE_DEBUG_I("Try to create rpmsg endpoint.\r\n"); + ECHO_DEV_DEVICE_DEBUG_I("Try to create rpmsg endpoint.\r\n"); ret = rpmsg_create_ept(&lept, rdev, RPMSG_SERVICE_NAME, 0x4, RPMSG_ADDR_ANY, rpmsg_endpoint_cb, rpmsg_service_unbind); if (ret) { - ECHO_DEV_SLAVE_DEBUG_E("Failed to create endpoint. %d \r\n", ret); + ECHO_DEV_DEVICE_DEBUG_E("Failed to create endpoint. %d \r\n", ret); return -1; } - ECHO_DEV_SLAVE_DEBUG_I("Successfully created rpmsg endpoint.\r\n"); + ECHO_DEV_DEVICE_DEBUG_I("Successfully created rpmsg endpoint.\r\n"); while (1) { @@ -134,15 +134,15 @@ int rpmsg_echo(struct rpmsg_device *rdev, void *priv) metal_assert(rdev); metal_assert(priv); int ret; - ECHO_DEV_SLAVE_DEBUG_I("Starting rpmsg_echo application...\r\n"); + ECHO_DEV_DEVICE_DEBUG_I("Starting rpmsg_echo application...\r\n"); ret = app(rdev, priv); if (ret != 0) { - ECHO_DEV_SLAVE_DEBUG_E("Rpmsg_echo application error,code:0x%x",ret); + ECHO_DEV_DEVICE_DEBUG_E("Rpmsg_echo application error,code:0x%x",ret); return ret; } - ECHO_DEV_SLAVE_DEBUG_I("Stopping rpmsg_echo application...\r\n"); + ECHO_DEV_DEVICE_DEBUG_I("Stopping rpmsg_echo application...\r\n"); return ret; } diff --git a/example/system/amp/openamp/driver_core/src/rpmsg-nocopy-echo.c b/example/system/amp/openamp/driver_core/src/rpmsg-nocopy-echo.c index 62fffe7e..9b9364f6 100644 --- a/example/system/amp/openamp/driver_core/src/rpmsg-nocopy-echo.c +++ b/example/system/amp/openamp/driver_core/src/rpmsg-nocopy-echo.c @@ -7,7 +7,7 @@ /* * This is a sample demonstration application that showcases usage of rpmsg * This application is meant to run on the remote CPU running baremetal code. - * This application echoes back data that was sent to it by the master core. + * This application echoes back data that was sent to it by the driver core. */ #include @@ -17,10 +17,10 @@ #include "rpmsg_service.h" #include "fdebug.h" -#define NO_COPY_SLAVE_DEBUG_TAG " SLAVE_04" -#define NO_COPY_SLAVE_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( NO_COPY_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) -#define NO_COPY_SLAVE_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( NO_COPY_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) -#define NO_COPY_SLAVE_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( NO_COPY_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) +#define NO_COPY_DEVICE_DEBUG_TAG " DEVICE_04" +#define NO_COPY_DEVICE_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( NO_COPY_DEVICE_DEBUG_TAG, format, ##__VA_ARGS__) +#define NO_COPY_DEVICE_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( NO_COPY_DEVICE_DEBUG_TAG, format, ##__VA_ARGS__) +#define NO_COPY_DEVICE_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( NO_COPY_DEVICE_DEBUG_TAG, format, ##__VA_ARGS__) #define SHUTDOWN_MSG 0xEF56A55A @@ -49,14 +49,14 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, /* On reception of a shutdown we signal the application to terminate */ if ((*(unsigned int *)data) == SHUTDOWN_MSG) { - NO_COPY_SLAVE_DEBUG_I("shutdown message is received.\r\n"); + NO_COPY_DEVICE_DEBUG_I("shutdown message is received.\r\n"); shutdown_req = 1; return RPMSG_SUCCESS; } rpmsg_node = metal_allocate_memory(sizeof(*rpmsg_node)); if (!rpmsg_node) { - NO_COPY_SLAVE_DEBUG_E("rpmsg_node allocation failed\r\n"); + NO_COPY_DEVICE_DEBUG_E("rpmsg_node allocation failed\r\n"); return -1; } rpmsg_hold_rx_buffer(ept, data); @@ -80,7 +80,7 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, static void rpmsg_service_unbind(struct rpmsg_endpoint *ept) { (void)ept; - NO_COPY_SLAVE_DEBUG_I("unexpected Remote endpoint destroy\r\n"); + NO_COPY_DEVICE_DEBUG_I("unexpected Remote endpoint destroy\r\n"); shutdown_req = 1; } @@ -94,7 +94,7 @@ static int app(struct rpmsg_device *rdev, void *priv) struct rpmsg_rcv_msg *rpmsg_node; shutdown_req = 0; /* Initialize RPMSG framework */ - NO_COPY_SLAVE_DEBUG_I("Try to create rpmsg endpoint.\r\n"); + NO_COPY_DEVICE_DEBUG_I("Try to create rpmsg endpoint.\r\n"); rpmsg_list = NULL; ret = rpmsg_create_ept(&lept, rdev, RPMSG_SERVICE_NAME, @@ -102,11 +102,11 @@ static int app(struct rpmsg_device *rdev, void *priv) rpmsg_endpoint_cb, rpmsg_service_unbind); if (ret) { - NO_COPY_SLAVE_DEBUG_E("Failed to create endpoint.\r\n"); + NO_COPY_DEVICE_DEBUG_E("Failed to create endpoint.\r\n"); return -1; } - NO_COPY_SLAVE_DEBUG_I("Successfully created rpmsg endpoint.\r\n"); + NO_COPY_DEVICE_DEBUG_I("Successfully created rpmsg endpoint.\r\n"); while (1) { platform_poll(priv); /* we got a shutdown request, exit */ @@ -114,11 +114,11 @@ static int app(struct rpmsg_device *rdev, void *priv) break; } while (rpmsg_list) { - /* Send data back to master */ + /* Send data back to driver */ ret = rpmsg_send(rpmsg_list->ept, rpmsg_list->data, rpmsg_list->len); if (ret < 0) { - NO_COPY_SLAVE_DEBUG_E("rpmsg_send failed\r\n"); + NO_COPY_DEVICE_DEBUG_E("rpmsg_send failed\r\n"); return ret; } rpmsg_release_rx_buffer(rpmsg_list->ept, @@ -143,16 +143,16 @@ int rpmsg_nocopy_echo(struct rpmsg_device *rdev, void *priv) metal_assert(priv); int ret; - NO_COPY_SLAVE_DEBUG_I("Starting rpmsg_nocopy_echo application...\r\n"); + NO_COPY_DEVICE_DEBUG_I("Starting rpmsg_nocopy_echo application...\r\n"); ret = app(rdev, priv); if (ret != 0) { - NO_COPY_SLAVE_DEBUG_E("Rpmsg_nocopy_echo application error,code:0x%x",ret); + NO_COPY_DEVICE_DEBUG_E("Rpmsg_nocopy_echo application error,code:0x%x",ret); return ret; } - NO_COPY_SLAVE_DEBUG_I("Stopping rpmsg_nocopy_echo application...\r\n"); + NO_COPY_DEVICE_DEBUG_I("Stopping rpmsg_nocopy_echo application...\r\n"); return ret; } diff --git a/example/system/amp/openamp/driver_core/src/rpmsg-sample-echo.c b/example/system/amp/openamp/driver_core/src/rpmsg-sample-echo.c index 78198d39..7ad5def7 100644 --- a/example/system/amp/openamp/driver_core/src/rpmsg-sample-echo.c +++ b/example/system/amp/openamp/driver_core/src/rpmsg-sample-echo.c @@ -6,7 +6,7 @@ * This is a sample demonstration application that showcases usage of rpmsg * This application is meant to run on the remote CPU running baremetal code. * This application allows to check the compatibility with running on - * the master CPU. For this it echo MSG_LIMIT time message sent by the rpmsg + * the driver CPU. For this it echo MSG_LIMIT time message sent by the rpmsg * sample client available in distribution. */ @@ -17,10 +17,10 @@ #include "rpmsg_service.h" #include "fdebug.h" -#define VIRTIO_DEV_SLAVE_DEBUG_TAG " SLAVE_02" -#define VIRTIO_DEV_SLAVE_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( VIRTIO_DEV_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) -#define VIRTIO_DEV_SLAVE_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( VIRTIO_DEV_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) -#define VIRTIO_DEV_SLAVE_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( VIRTIO_DEV_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) +#define VIRTIO_DEV_DEVICE_DEBUG_TAG " DEVICE_02" +#define VIRTIO_DEV_DEVICE_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( VIRTIO_DEV_DEVICE_DEBUG_TAG, format, ##__VA_ARGS__) +#define VIRTIO_DEV_DEVICE_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( VIRTIO_DEV_DEVICE_DEBUG_TAG, format, ##__VA_ARGS__) +#define VIRTIO_DEV_DEVICE_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( VIRTIO_DEV_DEVICE_DEBUG_TAG, format, ##__VA_ARGS__) #define MSG_LIMIT 100 @@ -37,15 +37,15 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, (void)src; char payload[RPMSG_BUFFER_SIZE]; - /* Send data back MSG_LIMIT time to master */ + /* Send data back MSG_LIMIT time to driver */ memset(payload, 0, RPMSG_BUFFER_SIZE); memcpy(payload, data, len); if (++count <= MSG_LIMIT) { - VIRTIO_DEV_SLAVE_DEBUG_I("echo message number %u: %s\r\n",(unsigned int)count, payload); + VIRTIO_DEV_DEVICE_DEBUG_I("echo message number %u: %s\r\n",(unsigned int)count, payload); if (rpmsg_send(ept, (char *)data, len) < 0) { - VIRTIO_DEV_SLAVE_DEBUG_E("rpmsg_send failed\r\n"); + VIRTIO_DEV_DEVICE_DEBUG_E("rpmsg_send failed\r\n"); shutdown_req = 1; } } @@ -55,7 +55,7 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, static void rpmsg_service_unbind(struct rpmsg_endpoint *ept) { (void)ept; - VIRTIO_DEV_SLAVE_DEBUG_I("unexpected Remote endpoint destroy\r\n"); + VIRTIO_DEV_DEVICE_DEBUG_I("unexpected Remote endpoint destroy\r\n"); shutdown_req = 1; } @@ -68,17 +68,17 @@ static int app(struct rpmsg_device *rdev, void *priv) shutdown_req = 0; count = 0; /* Initialize RPMSG framework */ - VIRTIO_DEV_SLAVE_DEBUG_I("Try to create rpmsg endpoint.\r\n"); + VIRTIO_DEV_DEVICE_DEBUG_I("Try to create rpmsg endpoint.\r\n"); ret = rpmsg_create_ept(&lept, rdev, RPMSG_SERVICE_NAME, RPMSG_ADDR_ANY, RPMSG_ADDR_ANY, rpmsg_endpoint_cb, rpmsg_service_unbind); if (ret) { - VIRTIO_DEV_SLAVE_DEBUG_E("Failed to create endpoint.\r\n"); + VIRTIO_DEV_DEVICE_DEBUG_E("Failed to create endpoint.\r\n"); return -1; } - VIRTIO_DEV_SLAVE_DEBUG_I("Successfully created rpmsg endpoint.\r\n"); + VIRTIO_DEV_DEVICE_DEBUG_I("Successfully created rpmsg endpoint.\r\n"); while (1) { platform_poll(priv); @@ -102,16 +102,16 @@ int rpmsg_sample_echo(struct rpmsg_device *rdev, void *priv) metal_assert(priv); int ret; - VIRTIO_DEV_SLAVE_DEBUG_I("Starting rpmsg_sample_echo application...\r\n"); + VIRTIO_DEV_DEVICE_DEBUG_I("Starting rpmsg_sample_echo application...\r\n"); ret = app(rdev, priv); if (ret != 0) { - VIRTIO_DEV_SLAVE_DEBUG_E("Rpmsg_sample_echo application error,code:0x%x",ret); + VIRTIO_DEV_DEVICE_DEBUG_E("Rpmsg_sample_echo application error,code:0x%x",ret); return ret; } - VIRTIO_DEV_SLAVE_DEBUG_I("Stopping rpmsg_sample_echo application...\r\n"); + VIRTIO_DEV_DEVICE_DEBUG_I("Stopping rpmsg_sample_echo application...\r\n"); return ret; } diff --git a/example/system/amp/openamp_for_linux/common/libmetal_configs.h b/example/system/amp/openamp_for_linux/common/libmetal_configs.h index d24cc055..a62fc2c3 100644 --- a/example/system/amp/openamp_for_linux/common/libmetal_configs.h +++ b/example/system/amp/openamp_for_linux/common/libmetal_configs.h @@ -41,12 +41,12 @@ extern "C" { /* 备用 */ /* #define KICK_SGI_NUM_10 10 */ -/* device name for slave 00 */ -#define SLAVE_00_KICK_DEV_NAME "slave_00_kick" -#define SLAVE_00_SGI KICK_SGI_NUM_9 /* 采用SGI9中断进行消息提醒,需要与linux协商好 */ +/* device name for device 00 */ +#define DEVICE_00_KICK_DEV_NAME "device_00_kick" +#define DEVICE_00_SGI KICK_SGI_NUM_9 /* 采用SGI9中断进行消息提醒,需要与linux协商好 */ /* 备用 */ -/* #define SLAVE_01_KICK_DEV_NAME "slave_01_kick" */ -/* #define SLAVE_01_SGI KICK_SGI_NUM_10 */ +/* #define DEVICE_01_KICK_DEV_NAME "device_01_kick" */ +/* #define DEVICE_01_SGI KICK_SGI_NUM_10 */ #if defined __cplusplus } diff --git a/example/system/amp/openamp_for_linux/common/memory_layout.h b/example/system/amp/openamp_for_linux/common/memory_layout.h index d9cbcb97..6ea31dde 100644 --- a/example/system/amp/openamp_for_linux/common/memory_layout.h +++ b/example/system/amp/openamp_for_linux/common/memory_layout.h @@ -34,21 +34,21 @@ extern "C" { #endif -/*slave core0*/ +/*device core0*/ /* 与linux共享的内存 */ -#define SLAVE00_SOURCE_TABLE_ADDR 0xc0000000 /*与linux协商好的地址*/ -#define SLAVE00_KICK_IO_ADDR 0xc0224000 +#define DEVICE00_SOURCE_TABLE_ADDR 0xc0000000 /*与linux协商好的地址*/ +#define DEVICE00_KICK_IO_ADDR 0xc0224000 /* MEM = |tx vring|rx vring|share buffer| */ -#define SLAVE00_SHARE_MEM_ADDR 0xffffffff /*全F表示等待linux分配*/ -#define SLAVE00_SHARE_MEM_SIZE 0x100000 /*共享内存大小*/ -#define SLAVE00_VRING_SIZE 0x8000UL -#define SLAVE00_VRING_NUM 0x100 -#define SLAVE00_TX_VRING_ADDR 0xffffffff /*全F表示等待linux分配*/ -#define SLAVE00_RX_VRING_ADDR 0xffffffff /*全F表示等待linux分配*/ - -#define SLAVE00_SOURCE_TABLE_ATTRIBUTE (MT_NORMAL|MT_P_RW_U_RW) -#define SLAVE00_SHARE_BUFFER_ATTRIBUTE (MT_NORMAL|MT_P_RW_U_RW) +#define DEVICE00_SHARE_MEM_ADDR 0xffffffff /*全F表示等待linux分配*/ +#define DEVICE00_SHARE_MEM_SIZE 0x100000 /*共享内存大小*/ +#define DEVICE00_VRING_SIZE 0x8000UL +#define DEVICE00_VRING_NUM 0x100 +#define DEVICE00_TX_VRING_ADDR 0xffffffff /*全F表示等待linux分配*/ +#define DEVICE00_RX_VRING_ADDR 0xffffffff /*全F表示等待linux分配*/ + +#define DEVICE00_SOURCE_TABLE_ATTRIBUTE (MT_NORMAL|MT_P_RW_U_RW) +#define DEVICE00_SHARE_BUFFER_ATTRIBUTE (MT_NORMAL|MT_P_RW_U_RW) #if defined __cplusplus } diff --git a/example/system/amp/openamp_for_linux/common/openamp_configs.h b/example/system/amp/openamp_for_linux/common/openamp_configs.h index 8cbed86c..7fd8d7ee 100644 --- a/example/system/amp/openamp_for_linux/common/openamp_configs.h +++ b/example/system/amp/openamp_for_linux/common/openamp_configs.h @@ -37,7 +37,7 @@ extern "C" { /* 从核发送消息时,需要指定发送的cpu的核号,用来确定软件中断的发送到哪个核上 */ -#define MASTER_CORE_MASK 255 /* 采用协商好的方式,给所有核心都发送中断,注意:openamp 的freeRTOS 接口层PhytiumProcNotify()做了区分 */ +#define DRIVER_CORE_MASK 255 /* 采用协商好的方式,给所有核心都发送中断,注意:openamp 的freeRTOS 接口层PhytiumProcNotify()做了区分 */ #if defined __cplusplus } diff --git a/example/system/amp/openamp_for_linux/ft_openamp.ld b/example/system/amp/openamp_for_linux/ft_openamp.ld index 585b201e..861acc00 100644 --- a/example/system/amp/openamp_for_linux/ft_openamp.ld +++ b/example/system/amp/openamp_for_linux/ft_openamp.ld @@ -1,6 +1,6 @@ #include "memory_layout.h" - .resource_table SLAVE00_SOURCE_TABLE_ADDR: { + .resource_table DEVICE00_SOURCE_TABLE_ADDR: { . = ALIGN(4); *(.resource_table) } diff --git a/example/system/amp/openamp_for_linux/sdkconfig b/example/system/amp/openamp_for_linux/sdkconfig index 1478d246..0f6d9d6e 100644 --- a/example/system/amp/openamp_for_linux/sdkconfig +++ b/example/system/amp/openamp_for_linux/sdkconfig @@ -129,6 +129,8 @@ CONFIG_LOG_DISPALY_CORE_NUM=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y # CONFIG_INTERRUPT_ROLE_MASTER is not set CONFIG_INTERRUPT_ROLE_SLAVE=y diff --git a/example/system/amp/openamp_for_linux/sdkconfig.h b/example/system/amp/openamp_for_linux/sdkconfig.h index 8b9f175c..f15811ef 100644 --- a/example/system/amp/openamp_for_linux/sdkconfig.h +++ b/example/system/amp/openamp_for_linux/sdkconfig.h @@ -115,6 +115,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG /* CONFIG_INTERRUPT_ROLE_MASTER is not set */ #define CONFIG_INTERRUPT_ROLE_SLAVE diff --git a/example/system/amp/openamp_for_linux/src/rpmsg-echo_os.c b/example/system/amp/openamp_for_linux/src/rpmsg-echo_os.c index 1f114102..cab8a0ab 100644 --- a/example/system/amp/openamp_for_linux/src/rpmsg-echo_os.c +++ b/example/system/amp/openamp_for_linux/src/rpmsg-echo_os.c @@ -19,7 +19,7 @@ * Last Modified: 2025-03-17 10:25:19 * Description: This file is for This file is for a sample demonstration application that showcases usage of rpmsg. * This application is meant to run on the remote CPU running freertos code. - * This application echoes back data that was sent to it by the master core. + * This application echoes back data that was sent to it by the driver core. * * Modify History: * Ver   Who        Date         Changes @@ -53,23 +53,26 @@ /**************************** Type Definitions *******************************/ -#define OPENAMP_SLAVE_DEBUG_TAG "OPENAMP_SLAVE" -#define OPENAMP_SLAVE_ERROR(format, ...) FT_DEBUG_PRINT_E(OPENAMP_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) -#define OPENAMP_SLAVE_WARN(format, ...) FT_DEBUG_PRINT_W(OPENAMP_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) -#define OPENAMP_SLAVE_INFO(format, ...) FT_DEBUG_PRINT_I(OPENAMP_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) -#define OPENAMP_SLAVE_DEBUG(format, ...) FT_DEBUG_PRINT_D(OPENAMP_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) +#define OPENAMP_DEVICE_DEBUG_TAG "OPENAMP_DEVICE" +#define OPENAMP_DEVICE_ERROR(format, ...) FT_DEBUG_PRINT_E(OPENAMP_DEVICE_DEBUG_TAG, format, ##__VA_ARGS__) +#define OPENAMP_DEVICE_WARN(format, ...) FT_DEBUG_PRINT_W(OPENAMP_DEVICE_DEBUG_TAG, format, ##__VA_ARGS__) +#define OPENAMP_DEVICE_INFO(format, ...) FT_DEBUG_PRINT_I(OPENAMP_DEVICE_DEBUG_TAG, format, ##__VA_ARGS__) +#define OPENAMP_DEVICE_DEBUG(format, ...) FT_DEBUG_PRINT_D(OPENAMP_DEVICE_DEBUG_TAG, format, ##__VA_ARGS__) #define MAX_DATA_LENGTH (RPMSG_BUFFER_SIZE / 2) #define DEVICE_CORE_START 0x0001U /* 开始任务 */ #define DEVICE_CORE_SHUTDOWN 0x0002U /* 关闭核心 */ #define DEVICE_CORE_CHECK 0x0003U /* 检查消息 */ + +/* External functions */ +extern int init_system(); /************************** Variable Definitions *****************************/ static volatile int shutdown_req = 0; /*******************例程全局变量***********************************************/ -struct remoteproc remoteproc_slave_00; -static struct rpmsg_device *rpdev_slave_00 = NULL; +struct remoteproc remoteproc_device_00; +static struct rpmsg_device *rpdev_device_00 = NULL; /* 协议数据结构 */ typedef struct { @@ -102,44 +105,44 @@ static struct remote_resource_table __resource resources __attribute__((used)) = }, /* Vring rsc entry - part of vdev rsc entry */ - {SLAVE00_TX_VRING_ADDR, VRING_ALIGN, SLAVE00_VRING_NUM, 1, 0}, - {SLAVE00_RX_VRING_ADDR, VRING_ALIGN, SLAVE00_VRING_NUM, 2, 0}, + {DEVICE00_TX_VRING_ADDR, VRING_ALIGN, DEVICE00_VRING_NUM, 1, 0}, + {DEVICE00_RX_VRING_ADDR, VRING_ALIGN, DEVICE00_VRING_NUM, 2, 0}, }; /********** 共享内存定义,与linux协商一致 **********/ -static metal_phys_addr_t poll_phys_addr = SLAVE00_KICK_IO_ADDR; +static metal_phys_addr_t poll_phys_addr = DEVICE00_KICK_IO_ADDR; struct metal_device kick_driver_00 = { - .name = SLAVE_00_KICK_DEV_NAME, + .name = DEVICE_00_KICK_DEV_NAME, .bus = NULL, .num_regions = 1, .regions = { { - .virt = (void *)SLAVE00_KICK_IO_ADDR, + .virt = (void *)DEVICE00_KICK_IO_ADDR, .physmap = &poll_phys_addr, .size = 0x1000, .page_shift = -1UL, .page_mask = -1UL, - .mem_flags = SLAVE00_SOURCE_TABLE_ATTRIBUTE, + .mem_flags = DEVICE00_SOURCE_TABLE_ATTRIBUTE, .ops = {NULL}, } }, .irq_num = 1,/* Number of IRQs per device */ - .irq_info = (void *)SLAVE_00_SGI, + .irq_info = (void *)DEVICE_00_SGI, } ; -struct remoteproc_priv slave_00_priv = { - .kick_dev_name = SLAVE_00_KICK_DEV_NAME , +struct remoteproc_priv device_00_priv = { + .kick_dev_name = DEVICE_00_KICK_DEV_NAME , .kick_dev_bus_name = KICK_BUS_NAME , - .cpu_id = MASTER_CORE_MASK,/* 给所有core发送中断 */ + .cpu_id = DRIVER_CORE_MASK,/* 给所有core发送中断 */ - .src_table_attribute = SLAVE00_SOURCE_TABLE_ATTRIBUTE , + .src_table_attribute = DEVICE00_SOURCE_TABLE_ATTRIBUTE , /* |rx vring|tx vring|share buffer| */ - .share_mem_va = SLAVE00_SHARE_MEM_ADDR , - .share_mem_pa = SLAVE00_SHARE_MEM_ADDR , - .share_buffer_offset = SLAVE00_VRING_SIZE , - .share_mem_size = SLAVE00_SHARE_MEM_SIZE , - .share_mem_attribute = SLAVE00_SHARE_BUFFER_ATTRIBUTE + .share_mem_va = DEVICE00_SHARE_MEM_ADDR , + .share_mem_pa = DEVICE00_SHARE_MEM_ADDR , + .share_buffer_offset = DEVICE00_VRING_SIZE , + .share_mem_size = DEVICE00_SHARE_MEM_SIZE , + .share_mem_attribute = DEVICE00_SHARE_BUFFER_ATTRIBUTE } ; /************************** Function Prototypes ******************************/ @@ -202,16 +205,16 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, int ret; (void)priv; - OPENAMP_SLAVE_INFO("src:0x%x",src); + OPENAMP_DEVICE_INFO("src:0x%x",src); ept->dest_addr = src; ret = parse_protocol_data((char *)data, len, &protocol_data); if(ret != 0) { - OPENAMP_SLAVE_ERROR("parse protocol data error,ret:%d",ret); + OPENAMP_DEVICE_ERROR("parse protocol data error,ret:%d",ret); return RPMSG_SUCCESS;/* 解析失败,忽略数据 */ } - OPENAMP_SLAVE_INFO("command:0x%x,length:%d.",protocol_data.command,protocol_data.length); + OPENAMP_DEVICE_INFO("command:0x%x,length:%d.",protocol_data.command,protocol_data.length); switch (protocol_data.command) { case DEVICE_CORE_START: @@ -225,12 +228,12 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, } case DEVICE_CORE_CHECK: { - /* Send temp_data back to master */ + /* Send temp_data back to driver */ /* 请勿直接对data指针对应的内存进行写操作,操作vring中remoteproc发送通道分配的内存,引发错误的问题*/ ret = rpmsg_send(ept, &protocol_data, len); if (ret < 0) { - OPENAMP_SLAVE_ERROR("rpmsg_send failed.\r\n"); + OPENAMP_DEVICE_ERROR("rpmsg_send failed.\r\n"); return ret; } break; @@ -245,7 +248,7 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, static void rpmsg_service_unbind(struct rpmsg_endpoint *ept) { (void)ept; - OPENAMP_SLAVE_INFO("unexpected Remote endpoint destroy."); + OPENAMP_DEVICE_INFO("unexpected Remote endpoint destroy."); shutdown_req = 1; } @@ -255,19 +258,19 @@ static void rpmsg_service_unbind(struct rpmsg_endpoint *ept) static int FRpmsgEchoApp(struct rpmsg_device *rdev, void *priv) { int ret = 0; - struct rpmsg_endpoint lept; + struct rpmsg_endpoint lept = {0}; shutdown_req = 0; /* Initialize RPMSG framework */ - OPENAMP_SLAVE_INFO("Try to create rpmsg endpoint.\r\n"); + OPENAMP_DEVICE_INFO("Try to create rpmsg endpoint.\r\n"); ret = rpmsg_create_ept(&lept, rdev, RPMSG_SERVICE_NAME, 0, RPMSG_ADDR_ANY, rpmsg_endpoint_cb, rpmsg_service_unbind); if (ret) { - OPENAMP_SLAVE_ERROR("Failed to create endpoint. %d \r\n", ret); + OPENAMP_DEVICE_ERROR("Failed to create endpoint. %d \r\n", ret); return -1; } - OPENAMP_SLAVE_INFO("Successfully created rpmsg endpoint.\r\n"); + OPENAMP_DEVICE_INFO("Successfully created rpmsg endpoint.\r\n"); while (1) { @@ -289,38 +292,38 @@ static int FRpmsgEchoApp(struct rpmsg_device *rdev, void *priv) /*-----------------------------------------------------------------------------* * Application entry point *-----------------------------------------------------------------------------*/ -int slave_init(void) +int device_init(void) { init_system(); // Initialize the system resources and environment - if (!platform_create_proc(&remoteproc_slave_00, &slave_00_priv, &kick_driver_00)) + if (!platform_create_proc(&remoteproc_device_00, &device_00_priv, &kick_driver_00)) { - OPENAMP_SLAVE_ERROR("Failed to create remoteproc instance for slave 00\r\n"); + OPENAMP_DEVICE_ERROR("Failed to create remoteproc instance for device 00\r\n"); return -1; // Return with an error if creation fails } - remoteproc_slave_00.rsc_table = &resources; + remoteproc_device_00.rsc_table = &resources; - if (platform_setup_src_table(&remoteproc_slave_00,remoteproc_slave_00.rsc_table)) + if (platform_setup_src_table(&remoteproc_device_00,remoteproc_device_00.rsc_table)) { - OPENAMP_SLAVE_ERROR("Failed to setup src table for slave 00\r\n"); + OPENAMP_DEVICE_ERROR("Failed to setup src table for device 00\r\n"); return -1; // Return with an error if setup fails } - OPENAMP_SLAVE_INFO("Setup resource tables for the created remoteproc instances is over \r\n"); + OPENAMP_DEVICE_INFO("Setup resource tables for the created remoteproc instances is over \r\n"); - if (platform_setup_share_mems(&remoteproc_slave_00)) + if (platform_setup_share_mems(&remoteproc_device_00)) { - OPENAMP_SLAVE_ERROR("Failed to setup shared memory for slave 00\r\n"); + OPENAMP_DEVICE_ERROR("Failed to setup shared memory for device 00\r\n"); return -1; // Return with an error if setup fails } - OPENAMP_SLAVE_INFO("Setup shared memory regions for both remoteproc instances is over \r\n"); + OPENAMP_DEVICE_INFO("Setup shared memory regions for both remoteproc instances is over \r\n"); - rpdev_slave_00 = platform_create_rpmsg_vdev(&remoteproc_slave_00, 0, VIRTIO_DEV_SLAVE, NULL, NULL); - if (!rpdev_slave_00) + rpdev_device_00 = platform_create_rpmsg_vdev(&remoteproc_device_00, 0, VIRTIO_DEV_DEVICE, NULL, NULL); + if (!rpdev_device_00) { - OPENAMP_SLAVE_ERROR("Failed to create rpmsg vdev for slave 00\r\n"); + OPENAMP_DEVICE_ERROR("Failed to create rpmsg vdev for device 00\r\n"); return -1; // Return with an error if creation fails } @@ -341,23 +344,23 @@ int RpmsgEchoTask(void * args) printf("Patch: %d)\r\n", metal_ver_patch()); /* Initialize platform */ - OPENAMP_SLAVE_INFO("start application..."); - if(!slave_init()) + OPENAMP_DEVICE_INFO("start application..."); + if(!device_init()) { - FRpmsgEchoApp(rpdev_slave_00,&remoteproc_slave_00) ; + FRpmsgEchoApp(rpdev_device_00,&remoteproc_device_00) ; if (ret) { - OPENAMP_SLAVE_ERROR("Failed to running echoapp"); - platform_cleanup(&remoteproc_slave_00); + OPENAMP_DEVICE_ERROR("Failed to running echoapp"); + platform_cleanup(&remoteproc_device_00); } - platform_release_rpmsg_vdev(rpdev_slave_00, &remoteproc_slave_00); - OPENAMP_SLAVE_INFO("Stopping application..."); - platform_cleanup(&remoteproc_slave_00); + platform_release_rpmsg_vdev(rpdev_device_00, &remoteproc_device_00); + OPENAMP_DEVICE_INFO("Stopping application..."); + platform_cleanup(&remoteproc_device_00); } else { - platform_cleanup(&remoteproc_slave_00); - OPENAMP_SLAVE_ERROR("Failed to init remoteproc.\r\n"); + platform_cleanup(&remoteproc_device_00); + OPENAMP_DEVICE_ERROR("Failed to init remoteproc.\r\n"); } FPsciCpuOff(); } @@ -375,7 +378,7 @@ int rpmsg_echo_task(void) if(ret != pdPASS) { - OPENAMP_SLAVE_ERROR("Failed to create a rpmsg_echo task. \r\n"); + OPENAMP_DEVICE_ERROR("Failed to create a rpmsg_echo task. \r\n"); return -1; } return 0; diff --git a/example/system/atomic/sdkconfig b/example/system/atomic/sdkconfig index a25c5c51..b25dc595 100644 --- a/example/system/atomic/sdkconfig +++ b/example/system/atomic/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_ERROR=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/system/atomic/sdkconfig.h b/example/system/atomic/sdkconfig.h index 8b53247f..e6553f2c 100644 --- a/example/system/atomic/sdkconfig.h +++ b/example/system/atomic/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/system/exception_debug/sdkconfig b/example/system/exception_debug/sdkconfig index f47b1b0b..b0a4d767 100644 --- a/example/system/exception_debug/sdkconfig +++ b/example/system/exception_debug/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_ERROR=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/system/exception_debug/sdkconfig.h b/example/system/exception_debug/sdkconfig.h index f1e95241..8ee12934 100644 --- a/example/system/exception_debug/sdkconfig.h +++ b/example/system/exception_debug/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/system/nested_interrupt/sdkconfig b/example/system/nested_interrupt/sdkconfig index 917d50ed..e23fee48 100644 --- a/example/system/nested_interrupt/sdkconfig +++ b/example/system/nested_interrupt/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_INFO=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/system/nested_interrupt/sdkconfig.h b/example/system/nested_interrupt/sdkconfig.h index d97a7dab..b9299b55 100644 --- a/example/system/nested_interrupt/sdkconfig.h +++ b/example/system/nested_interrupt/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/system/posix/sdkconfig b/example/system/posix/sdkconfig index fc33e7a2..170b69f2 100644 --- a/example/system/posix/sdkconfig +++ b/example/system/posix/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -117,6 +118,8 @@ CONFIG_LOG_ERROR=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set diff --git a/example/system/posix/sdkconfig.h b/example/system/posix/sdkconfig.h index f8dd9ec2..8f3b009c 100644 --- a/example/system/posix/sdkconfig.h +++ b/example/system/posix/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -108,6 +109,8 @@ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ diff --git a/example/template/sdkconfig b/example/template/sdkconfig index 3f845223..b64d87e2 100644 --- a/example/template/sdkconfig +++ b/example/template/sdkconfig @@ -50,39 +50,44 @@ CONFIG_MAX_XLAT_TABLES=256 # # Soc configuration # -# CONFIG_TARGET_PE2204 is not set +CONFIG_TARGET_PE2204=y # CONFIG_TARGET_PE2202 is not set # CONFIG_TARGET_PE2201 is not set # CONFIG_TARGET_PD1904 is not set # CONFIG_TARGET_PD2008 is not set # CONFIG_TARGET_PD2308 is not set # CONFIG_TARGET_PS2316 is not set -CONFIG_TARGET_PD2408=y +# CONFIG_TARGET_PD2408 is not set # CONFIG_TARGET_QEMU_VIRT is not set -CONFIG_SOC_NAME="pd2408" -CONFIG_SOC_CORE_NUM=8 +CONFIG_SOC_NAME="pe220x" +CONFIG_TARGET_TYPE_NAME="pe2204" +CONFIG_SOC_CORE_NUM=4 CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 +CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # # Board Configuration # -CONFIG_BOARD_NAME="test_b" +CONFIG_BOARD_NAME="phytiumpi" # CONFIG_USE_SPI_IOPAD is not set # CONFIG_USE_GPIO_IOPAD is not set +# CONFIG_USE_CAN_IOPAD is not set # CONFIG_USE_QSPI_IOPAD is not set # CONFIG_USE_PWM_IOPAD is not set +# CONFIG_USE_MIO_IOPAD is not set # CONFIG_USE_TACHO_IOPAD is not set -CONFIG_USE_UART_IOPAD=y +# CONFIG_USE_UART_IOPAD is not set # CONFIG_USE_THIRD_PARTY_IOPAD is not set -# CONFIG_PD2408_TEST_A_BOARD is not set -CONFIG_PD2408_TEST_B_BOARD=y +# CONFIG_E2000Q_DEMO_BOARD is not set +CONFIG_PHYTIUMPI_FIREFLY_BOARD=y # # IO mux configuration when board start up @@ -103,16 +108,18 @@ CONFIG_TARGET_NAME="eg" # CONFIG_ELOG_LINE_BUF_SIZE=0x100 # CONFIG_LOG_VERBOS is not set -CONFIG_LOG_DEBUG=y +# CONFIG_LOG_DEBUG is not set # CONFIG_LOG_INFO is not set # CONFIG_LOG_WARN is not set -# CONFIG_LOG_ERROR is not set +CONFIG_LOG_ERROR=y # CONFIG_LOG_NONE is not set # CONFIG_LOG_EXTRA_INFO is not set # CONFIG_LOG_DISPALY_CORE_NUM is not set # CONFIG_BOOTUP_DEBUG_PRINTS is not set CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_SLEEP_USE_NS_GTIMER=y +# CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set @@ -133,7 +140,6 @@ CONFIG_USE_SERIAL=y # Usart Configuration # CONFIG_ENABLE_Pl011_UART=y -CONFIG_USE_SERIAL_V2=y # end of Usart Configuration # CONFIG_USE_GPIO is not set @@ -156,7 +162,7 @@ CONFIG_USE_SERIAL_V2=y # CONFIG_USE_SCMI_MHU is not set # CONFIG_USE_I2S is not set # CONFIG_USE_I3C is not set -CONFIG_USE_MSG=y +# CONFIG_USE_MSG is not set # CONFIG_USE_DEVICE is not set # end of Drivers configuration @@ -222,8 +228,8 @@ CONFIG_STACK_SIZE=0x400 # # FreeRTOS Uart Drivers # -# CONFIG_FREERTOS_USE_UART is not set -CONFIG_FREERTOS_USE_SERIAL_V2=y +CONFIG_FREERTOS_USE_UART=y +# CONFIG_FREERTOS_USE_SERIAL_V2 is not set # end of FreeRTOS Uart Drivers # @@ -320,15 +326,12 @@ CONFIG_USE_LETTER_SHELL=y # # Letter Shell Configuration # -# CONFIG_LS_PL011_UART is not set -CONFIG_LS_SERIAL_V2=y +CONFIG_LS_PL011_UART=y CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y # CONFIG_DEFAULT_LETTER_SHELL_USE_UART0 is not set # CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set -# CONFIG_LETTER_SHELL_UART_INTERRUPT_MODE is not set +CONFIG_LETTER_SHELL_UART_INTERRUPT_MODE=y # CONFIG_LETTER_SHELL_UART_POLLED_MODE is not set -CONFIG_LETTER_SHELL_UART_MSG_INTR_MODE=y -# CONFIG_LETTER_SHELL_UART_MSG_POLLED_MODE is not set # end of Letter Shell Configuration # CONFIG_USE_AMP is not set diff --git a/example/template/sdkconfig.h b/example/template/sdkconfig.h index 19a933e2..8dd77d68 100644 --- a/example/template/sdkconfig.h +++ b/example/template/sdkconfig.h @@ -46,38 +46,43 @@ /* Soc configuration */ -/* CONFIG_TARGET_PE2204 is not set */ +#define CONFIG_TARGET_PE2204 /* CONFIG_TARGET_PE2202 is not set */ /* CONFIG_TARGET_PE2201 is not set */ /* CONFIG_TARGET_PD1904 is not set */ /* CONFIG_TARGET_PD2008 is not set */ /* CONFIG_TARGET_PD2308 is not set */ /* CONFIG_TARGET_PS2316 is not set */ -#define CONFIG_TARGET_PD2408 +/* CONFIG_TARGET_PD2408 is not set */ /* CONFIG_TARGET_QEMU_VIRT is not set */ -#define CONFIG_SOC_NAME "pd2408" -#define CONFIG_SOC_CORE_NUM 8 +#define CONFIG_SOC_NAME "pe220x" +#define CONFIG_TARGET_TYPE_NAME "pe2204" +#define CONFIG_SOC_CORE_NUM 4 #define CONFIG_F32BIT_MEMORY_ADDRESS 0x80000000 #define CONFIG_F32BIT_MEMORY_LENGTH 0x80000000 #define CONFIG_F64BIT_MEMORY_ADDRESS 0x2000000000 #define CONFIG_F64BIT_MEMORY_LENGTH 0x800000000 +#define CONFIG_TARGET_PE220X #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ -#define CONFIG_BOARD_NAME "test_b" +#define CONFIG_BOARD_NAME "phytiumpi" /* CONFIG_USE_SPI_IOPAD is not set */ /* CONFIG_USE_GPIO_IOPAD is not set */ +/* CONFIG_USE_CAN_IOPAD is not set */ /* CONFIG_USE_QSPI_IOPAD is not set */ /* CONFIG_USE_PWM_IOPAD is not set */ +/* CONFIG_USE_MIO_IOPAD is not set */ /* CONFIG_USE_TACHO_IOPAD is not set */ -#define CONFIG_USE_UART_IOPAD +/* CONFIG_USE_UART_IOPAD is not set */ /* CONFIG_USE_THIRD_PARTY_IOPAD is not set */ -/* CONFIG_PD2408_TEST_A_BOARD is not set */ -#define CONFIG_PD2408_TEST_B_BOARD +/* CONFIG_E2000Q_DEMO_BOARD is not set */ +#define CONFIG_PHYTIUMPI_FIREFLY_BOARD /* IO mux configuration when board start up */ @@ -94,16 +99,18 @@ #define CONFIG_ELOG_LINE_BUF_SIZE 0x100 /* CONFIG_LOG_VERBOS is not set */ -#define CONFIG_LOG_DEBUG +/* CONFIG_LOG_DEBUG is not set */ /* CONFIG_LOG_INFO is not set */ /* CONFIG_LOG_WARN is not set */ -/* CONFIG_LOG_ERROR is not set */ +#define CONFIG_LOG_ERROR /* CONFIG_LOG_NONE is not set */ /* CONFIG_LOG_EXTRA_INFO is not set */ /* CONFIG_LOG_DISPALY_CORE_NUM is not set */ /* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_SLEEP_USE_NS_GTIMER +/* CONFIG_SLEEP_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ @@ -122,7 +129,6 @@ /* Usart Configuration */ #define CONFIG_ENABLE_Pl011_UART -#define CONFIG_USE_SERIAL_V2 /* end of Usart Configuration */ /* CONFIG_USE_GPIO is not set */ /* CONFIG_USE_ETH is not set */ @@ -144,7 +150,7 @@ /* CONFIG_USE_SCMI_MHU is not set */ /* CONFIG_USE_I2S is not set */ /* CONFIG_USE_I3C is not set */ -#define CONFIG_USE_MSG +/* CONFIG_USE_MSG is not set */ /* CONFIG_USE_DEVICE is not set */ /* end of Drivers configuration */ @@ -201,8 +207,8 @@ /* FreeRTOS Uart Drivers */ -/* CONFIG_FREERTOS_USE_UART is not set */ -#define CONFIG_FREERTOS_USE_SERIAL_V2 +#define CONFIG_FREERTOS_USE_UART +/* CONFIG_FREERTOS_USE_SERIAL_V2 is not set */ /* end of FreeRTOS Uart Drivers */ /* FreeRTOS Pwm Drivers */ @@ -284,15 +290,12 @@ /* Letter Shell Configuration */ -/* CONFIG_LS_PL011_UART is not set */ -#define CONFIG_LS_SERIAL_V2 +#define CONFIG_LS_PL011_UART #define CONFIG_DEFAULT_LETTER_SHELL_USE_UART1 /* CONFIG_DEFAULT_LETTER_SHELL_USE_UART0 is not set */ /* CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set */ -/* CONFIG_LETTER_SHELL_UART_INTERRUPT_MODE is not set */ +#define CONFIG_LETTER_SHELL_UART_INTERRUPT_MODE /* CONFIG_LETTER_SHELL_UART_POLLED_MODE is not set */ -#define CONFIG_LETTER_SHELL_UART_MSG_INTR_MODE -/* CONFIG_LETTER_SHELL_UART_MSG_POLLED_MODE is not set */ /* end of Letter Shell Configuration */ /* CONFIG_USE_AMP is not set */ /* CONFIG_USE_YMODEM is not set */ diff --git a/install.py b/install.py index fb0b2929..b035ae65 100755 --- a/install.py +++ b/install.py @@ -28,13 +28,13 @@ curr_path = os.getcwd() freertos_sdk_path = install_path # Add standalone sdk -standalone_sdk_v="329f9046f27b3c545548ab395bcfa3c4abf4b0d6" +standalone_sdk_v="16c19e5a8b157e1fedb6f40a014a2c4a95f804a9" if (install_platform == windows_x64): standalone_path=freertos_sdk_path + '\\standalone' else: standalone_path=freertos_sdk_path + '/standalone' standalone_branch="master" -standalone_remote="https://gitee.com/phytium_embedded/phytium-standalone-sdk.git" +standalone_remote="https://gitee.com/phytium_embedded/phytium-standalone-sdk" if not os.path.exists(standalone_path): current_path = os.getcwd() diff --git a/third-party/freertos/History.txt b/third-party/freertos/History.txt index d5293b90..7df76e16 100644 --- a/third-party/freertos/History.txt +++ b/third-party/freertos/History.txt @@ -1,5 +1,140 @@ Documentation and download available at https://www.FreeRTOS.org/ +Changes between FreeRTOS V11.1.0 and FreeRTOS V11.2.0 released March 04, 2025 + + + Add CC-RH port for Renesas F1Kx devices. We thank @TrongNguyenR for their + contribution. + + Add Pointer Authentication (PAC) and Branch Target Identification (BTI) + support to the ARMv8-M ports. We thank @AhmedIsmail02 for their + contribution. + + Add Floating Point Unit (FPU) support to the ARM_AARCH64 port. We thank + @StefanBalt for their contribution. + + Add FPU Safe Application IRQ Handler suport to the ARM_AARCH64_SRE port. + We thank @GhMarwen for their contribution. + + Add Privileged eXecute Never MPU attribute support to the ARMv8-M ports. + We thank @AhmedIsmail02 for their contribution. + + Update XMOS xcore.ai port to be compatible with FreeRTOS Kernel version + 11. We thank @ACascarino for their contribution. + + ARM_CRx_No_GIC port updates: + - Remove inline assembly and move assembly code to separate portASM.S + file. + - Add support for Floating Point Unit (FPU). + - Add support to allow the application writer to handle SVC calls raised + from the application code. + - Add support for vApplicationFPUSafeIRQHandler. + + POSIX port updates: + - Set PTHREAD_MUTEX_ROBUST attribute on the mutex to prevent application + hangs when a thread dies while holding a mutex. + - Avoid calling pthread_sigmask on non-FreeROS threads when + vPortEndScheduler is called from a non-FreeRTOS thread. We thank + @johnboiles for their contribution. + - Remove unnecessary call to pthread_attr_setstacksize. We thank + @hollinsky for their contribution. + - Add an assert to catch if vPortYield is called from a non-FreeRTOS + thread. We thank @johnboiles for their contribution. + - Fix Posix port compilation on FreeBSD. We thank @tymmej for their + contribution. + + Update the Xtensa port and move it to the Partner-Supported-Ports + repository. We thank @ianstcdns for their contribution. + + Add vPortGenerateSimulatedInterruptFromWindowsThread API in the MSVC-MingW + port to enable native windows thread to synchronize with FreeRTOS task + through simulated interrupt. + + Update Windows port to use Waitable Timer instead of Sleep to improve tick + accuracy. We thank @bknicholls and @leegeth for their contribution. + + Update the value of queueQUEUE_TYPE_SET to a unique value (5) to allow + tracers to differentiate between queues and queue sets. We thank @schilkp + for their contribution. + + Add traceSTARTING_SCHEDULER tracing hook to enable tracers to run code on + startup. We thank @schilkp for their contribution. + + Define vApplicationGetTimerTaskMemory only when configUSE_TIMERS is set to + 1. We thank @HazardyKnusperkeks for their contribution. + + Reset xNextTaskUnblockTime in task notify FromISR APIs to allow the core + to enter sleep mode at the earliest possible time when using tickless + idle. + + Optimize xTaskIncrementTick for SMP by removing xYieldRequiredForCore. We + thank @cymizer for their contribution. + + Update the SMP scheduler to re-select a core to yield when the core + affinity of a ready task is changed. + + Update xEventGroupSetBits to read the event bits value to be returned to + the caller while the scheduler is suspended. This fixes dereference after + the event group is deleted by higher priority task. We thank @skotopes for + their contribution. + + Optimize certain getter APIs by removing unnecessary calls to + task{ENTER|EXIT}_CRITICAL() when the data access is atomic. We thank + @GuilhermeGiacomoSimoes for their contribution. + + Optimize xTaskNotifyWait and ulTaskNotifyTake APIs to suspend the + scheduler only if the task is not already notified, and the caller is + willing to wait for the notification. We thank @jefftenney for + their contribution. + + Fix error checking of prvCreateIdleTasks. We thank @kakkoko for their + contribution. + + Update SMP lock macros and critical nesting macros to pass core ID as an + argument. This reduces the number of accesses to a peripheral register to + query core ID. We thank @felixvanoost for their contribution. + + Add stack pointer bounds check when configCHECK_FOR_STACK_OVERFLOW is set + to 2 to improve reliability of stack overflow detection. We thank + @jiladahe1997 for their contribution. + + Update run-time stats to include time elapsed since the last context + switch for the currently running task. + + Add xQueueCreateSetStatic API for static creation of Queue Sets. We thank + @kzorer for their contribution. + + Update the traceMALLOC() macro to pass the actual size of the allocated + block for secure_heap, heap_2, heap_4 and heap_5. We thank @DazzlingOkami + for their contribution. + + Update heap_1 to use heapADD_WILL_OVERFLOW macro to improve readability. + We thank @wdfk-prog for their contribution. + + Add pointer protection to the pxNextFreeBlock member of the allocated + block's metadata in heap_4 and heap_5 when configENABLE_HEAP_PROTECTOR is + set to 1. We thank @Saiiijchan for their contribution. + + Allow the application writer to override pointer validation for heap_5 + when configENABLE_HEAP_PROTECTOR is used. We thank @Saiiijchan for their + contribution. + + Add xPortResetHeapMinimumEverFreeHeapSize to heap_4.c and heap_5.c. + We thank @TomasGalbickaNXP for their contribution. + + Add NULL check in the event_create function in the POSIX port. We thank + @laroche for their contribution. + + Use _GNU_SOURCE macro instead of __USE_GNU in the Posix port. We thank + @maxiaogood for their contribution. + + Use the new __ARM_FP macro instead of the deprectred __VFP_FP__ macro in + GCC/ARM_CM7, GCC/ARM_CM4_MPU, and GCC/ARM_CM4F ports. We thank @haydenridd + for their contribution. + + Add portMEMORY_BARRIER definition to the Xtensa port. We thank @superroc + for their contribution. + + Move the hardware include msp430.h to port.c from portmacro.h. We thank + @mayl for their contribution. + + Update ARM assembly syntax for Cortex-M ports. We thank @laroche for their + contribution. + + Update the Windows port to records a pending yield in + vPortCloseRunningThread to ensure that the next tick interrupt schedules + the next task regardless of the value of configUSE_PREEMPTION. + + Fix the context switch issue in the RL78 port. We thank @KeitaKashima for + their contribution. + + Fix compilation issue in ARM CM0 port when using Keil MDK. We thank + @TomasGalbickaNXP for their contribution. + + Fix IA32 port compilation when configUSE_COMMON_INTERRUPT_ENTRY_POINT is + set to 0. We thank @Ryzee119 for their contribution. + + Store configMTIMECMP_BASE_ADDRESS in a 64-bit integer for the RISC-V port. + We thank @vishwamartur for their contribution. + + Fix nested interrupt handling and optimize FPU related context switching + for the F1Kx port. We thank @TrongNguyenR for their contribution. + + Update the RP2040 port to add support for Raspberry Pi Pico SDK 2.0.0. + We thank @kilograham for their contribution. + + Fix the return value of portYIELD_FROM_ISR macro for the MSVC-MingW port. + We thank @wwhheerree for their contribution. + + Optimize vApplicationFPUSafeIRQHandler for the Coretex-A9 port by + removing the unnecessarily preserved callee saved registers. We thank + @Saiiijchan for their contribution. + + Fix the context array size for MPU ports to ensure the saved context + location falls within the reserved context area rather than overlapping + with the next MPU_SETTINGS structure member. + + Update CMake files for RP2040 port to fetch the port from the + Community-Supported-Ports repo. We thank @kilograham for their + contribution. + + Fix CMake file for the GCC ARM_CM0 port to include MPU files. We thank + @0mhu for their contribution. + + Add an example of human readable table generated by vTaskListTasks() in + the function documentation. We thank @wwhheerree for their contribution. + Changes between FreeRTOS V11.0.1 and FreeRTOS V11.1.0 released April 22, 2024 + Add ARMv7-R port with Memory Protection Unit (MPU) support. @@ -528,7 +663,7 @@ Changes between FreeRTOS V10.4.3 and FreeRTOS V10.4.4 released May 28 2021 in more files. + Other minor updates include adding additional configASSERT() checks and correcting and improving code comments. - + Go look at the smp branch to see the progress towards the Symetric + + Go look at the smp branch to see the progress towards the Symmetric Multiprocessing Kernel. https://github.com/FreeRTOS/FreeRTOS-Kernel/tree/smp Changes between FreeRTOS V10.4.2 and FreeRTOS V10.4.3 released December 14 2020 @@ -2015,7 +2150,7 @@ Changes between V6.1.0 and V6.1.1 released January 14 2011 Embedded Workbench. + Added a new port for the MSP430X core using the IAR Embedded Workbench. + Updated all the RX62N demo projects that target the Renesas Demonstration - Kit (RDK) to take into account the revered LED wiring on later hardware + Kit (RDK) to take into account the reversed LED wiring on later hardware revisions, and the new J-Link debug interface DLL. + Updated all the RX62N demo projects so the IO page served by the example embedded web server works with all web browsers. @@ -3174,7 +3309,7 @@ Changes between V1.2.3 and V1.2.4 xSerialPortInitMinimal() and the function xPortInit() has been renamed to xSerialPortInit(). + The function sSerialPutChar() has been renamed cSerialPutChar() and - the function return type chaned to portCHAR. + the function return type changed to portCHAR. + The integer and flop tasks now include calls to tskYIELD(), allowing them to be used with the cooperative scheduler. + All the demo applications now use the integer and comtest tasks when the @@ -3308,7 +3443,7 @@ Changes between V1.01 and V1.2.0 ports to allocate a different maximum number of priorities. + By default the trace facility is off, previously USE_TRACE_FACILITY was defined. - + comtest.c now uses a psuedo random delay between sends. This allows for + + comtest.c now uses a pseudo random delay between sends. This allows for better testing as the interrupts do not arrive at regular intervals. + Minor change to the Flashlite serial port driver. The driver is written to demonstrate the scheduler and is not written to be efficient. diff --git a/third-party/freertos/README.md b/third-party/freertos/README.md new file mode 100644 index 00000000..a6d383ad --- /dev/null +++ b/third-party/freertos/README.md @@ -0,0 +1,192 @@ +[![CMock Unit Tests](https://github.com/FreeRTOS/FreeRTOS-Kernel/actions/workflows/unit-tests.yml/badge.svg?branch=main&event=push)](https://github.com/FreeRTOS/FreeRTOS-Kernel/actions/workflows/unit-tests.yml?query=branch%3Amain+event%3Apush+workflow%3A%22CMock+Unit+Tests%22++) +[![codecov](https://codecov.io/gh/FreeRTOS/FreeRTOS-Kernel/badge.svg?branch=main)](https://codecov.io/gh/FreeRTOS/FreeRTOS-Kernel) + +## Getting started + +This repository contains FreeRTOS kernel source/header files and kernel +ports only. This repository is referenced as a submodule in +[FreeRTOS/FreeRTOS](https://github.com/FreeRTOS/FreeRTOS) +repository, which contains pre-configured demo application projects under +```FreeRTOS/Demo``` directory. + +The easiest way to use FreeRTOS is to start with one of the pre-configured demo +application projects. That way you will have the correct FreeRTOS source files +included, and the correct include paths configured. Once a demo application is +building and executing you can remove the demo application files, and start to +add in your own application source files. See the +[FreeRTOS Kernel Quick Start Guide](https://www.freertos.org/Documentation/01-FreeRTOS-quick-start/01-Beginners-guide/02-Quick-start-guide) +for detailed instructions and other useful links. + +Additionally, for FreeRTOS kernel feature information refer to the +[Developer Documentation](https://www.freertos.org/Documentation/02-Kernel/02-Kernel-features/00-Developer-docs), +and [API Reference](https://www.freertos.org/Documentation/02-Kernel/04-API-references/01-Task-creation/00-TaskHandle). + +Also for contributing and creating a Pull Request please refer to +[the instructions here](.github/CONTRIBUTING.md#contributing-via-pull-request). + +**FreeRTOS-Kernel V11.1.0 +[source code](https://github.com/FreeRTOS/FreeRTOS-Kernel/tree/V11.1.0) is part +of the +[FreeRTOS 202406.00 LTS](https://github.com/FreeRTOS/FreeRTOS-LTS/tree/202406-LTS) +release.** + +### Getting help + +If you have any questions or need assistance troubleshooting your FreeRTOS project, +we have an active community that can help on the +[FreeRTOS Community Support Forum](https://forums.freertos.org). + +## To consume FreeRTOS-Kernel + +### Consume with CMake + +If using CMake, it is recommended to use this repository using FetchContent. +Add the following into your project's main or a subdirectory's `CMakeLists.txt`: + +- Define the source and version/tag you want to use: + +```cmake +FetchContent_Declare( freertos_kernel + GIT_REPOSITORY https://github.com/FreeRTOS/FreeRTOS-Kernel.git + GIT_TAG main #Note: Best practice to use specific git-hash or tagged version +) +``` + +In case you prefer to add it as a git submodule, do: + +```bash +git submodule add https://github.com/FreeRTOS/FreeRTOS-Kernel.git +git submodule update --init +``` + +- Add a freertos_config library (typically an INTERFACE library) The following assumes the directory structure: + - `include/FreeRTOSConfig.h` + +```cmake +add_library(freertos_config INTERFACE) + +target_include_directories(freertos_config SYSTEM +INTERFACE + include +) + +target_compile_definitions(freertos_config + INTERFACE + projCOVERAGE_TEST=0 +) +``` + +In case you installed FreeRTOS-Kernel as a submodule, you will have to add it as a subdirectory: + +```cmake +add_subdirectory(${FREERTOS_PATH}) +``` + +- Configure the FreeRTOS-Kernel and make it available + - this particular example supports a native and cross-compiled build option. + +```cmake +set( FREERTOS_HEAP "4" CACHE STRING "" FORCE) +# Select the native compile PORT +set( FREERTOS_PORT "GCC_POSIX" CACHE STRING "" FORCE) +# Select the cross-compile PORT +if (CMAKE_CROSSCOMPILING) + set(FREERTOS_PORT "GCC_ARM_CA9" CACHE STRING "" FORCE) +endif() + +FetchContent_MakeAvailable(freertos_kernel) +``` + +- In case of cross compilation, you should also add the following to `freertos_config`: + +```cmake +target_compile_definitions(freertos_config INTERFACE ${definitions}) +target_compile_options(freertos_config INTERFACE ${options}) +``` + +### Consuming stand-alone - Cloning this repository + +To clone using HTTPS: + +``` +git clone https://github.com/FreeRTOS/FreeRTOS-Kernel.git +``` + +Using SSH: + +``` +git clone git@github.com:FreeRTOS/FreeRTOS-Kernel.git +``` + +## Repository structure + +- The root of this repository contains the three files that are common to +every port - list.c, queue.c and tasks.c. The kernel is contained within these +three files. croutine.c implements the optional co-routine functionality - which +is normally only used on very memory limited systems. + +- The ```./portable``` directory contains the files that are specific to a particular microcontroller and/or compiler. +See the readme file in the ```./portable``` directory for more information. + +- The ```./include``` directory contains the real time kernel header files. + +- The ```./template_configuration``` directory contains a sample `FreeRTOSConfig.h` to help jumpstart a new project. +See the [FreeRTOSConfig.h](examples/template_configuration/FreeRTOSConfig.h) file for instructions. + +### Code Formatting + +FreeRTOS files are formatted using the +"[uncrustify](https://github.com/uncrustify/uncrustify)" tool. +The configuration file used by uncrustify can be found in the +[FreeRTOS/CI-CD-GitHub-Actions's](https://github.com/FreeRTOS/CI-CD-Github-Actions) +[uncrustify.cfg](https://github.com/FreeRTOS/CI-CD-Github-Actions/tree/main/formatting) +file. + +### Line Endings + +File checked into the FreeRTOS-Kernel repository use unix-style LF line endings +for the best compatibility with git. + +For optimal compatibility with Microsoft Windows tools, it is best to enable +the git autocrlf feature. You can enable this setting for the current +repository using the following command: + +``` +git config core.autocrlf true +``` + +### Git History Optimizations + +Some commits in this repository perform large refactors which touch many lines +and lead to unwanted behavior when using the `git blame` command. You can +configure git to ignore the list of large refactor commits in this repository +with the following command: + +``` +git config blame.ignoreRevsFile .git-blame-ignore-revs +``` + +### Spelling and Formatting + +We recommend using [Visual Studio Code](https://code.visualstudio.com), +commonly referred to as VSCode, when working on the FreeRTOS-Kernel. +The FreeRTOS-Kernel also uses [cSpell](https://cspell.org/) as part of its +spelling check. The config file for which can be found at [cspell.config.yaml](cspell.config.yaml) +There is additionally a +[cSpell plugin for VSCode](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) +that can be used as well. +*[.cSpellWords.txt](.github/.cSpellWords.txt)* contains words that are not +traditionally found in an English dictionary. It is used by the spellchecker +to verify the various jargon, variable names, and other odd words used in the +FreeRTOS code base are correct. If your pull request fails to pass the spelling +and you believe this is a mistake, then add the word to +*[.cSpellWords.txt](.github/.cSpellWords.txt)*. When adding a word please +then sort the list, which can be done by running the bash command: +`sort -u .cSpellWords.txt -o .cSpellWords.txt` +Note that only the FreeRTOS-Kernel Source Files, [include](include), +[portable/MemMang](portable/MemMang), and [portable/Common](portable/Common) +files are checked for proper spelling, and formatting at this time. + +## Third Party Tools +Visit [this link](.github/third_party_tools.md) for detailed information about +third-party tools with FreeRTOS support. diff --git a/third-party/freertos/croutine.c b/third-party/freertos/croutine.c index e2c9cb01..84e1b99b 100644 --- a/third-party/freertos/croutine.c +++ b/third-party/freertos/croutine.c @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT diff --git a/third-party/freertos/event_groups.c b/third-party/freertos/event_groups.c index 9e6fd805..6a2ba076 100644 --- a/third-party/freertos/event_groups.c +++ b/third-party/freertos/event_groups.c @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT @@ -551,7 +551,7 @@ ListItem_t * pxNext; ListItem_t const * pxListEnd; List_t const * pxList; - EventBits_t uxBitsToClear = 0, uxBitsWaitedFor, uxControlBits; + EventBits_t uxBitsToClear = 0, uxBitsWaitedFor, uxControlBits, uxReturnBits; EventGroup_t * pxEventBits = xEventGroup; BaseType_t xMatchFound = pdFALSE; @@ -635,12 +635,15 @@ /* Clear any bits that matched when the eventCLEAR_EVENTS_ON_EXIT_BIT * bit was set in the control word. */ pxEventBits->uxEventBits &= ~uxBitsToClear; + + /* Snapshot resulting bits. */ + uxReturnBits = pxEventBits->uxEventBits; } ( void ) xTaskResumeAll(); - traceRETURN_xEventGroupSetBits( pxEventBits->uxEventBits ); + traceRETURN_xEventGroupSetBits( uxReturnBits ); - return pxEventBits->uxEventBits; + return uxReturnBits; } /*-----------------------------------------------------------*/ diff --git a/third-party/freertos/include/FreeRTOS.h b/third-party/freertos/include/FreeRTOS.h index 146f286f..ce8530e7 100644 --- a/third-party/freertos/include/FreeRTOS.h +++ b/third-party/freertos/include/FreeRTOS.h @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT @@ -49,12 +49,6 @@ */ #include /* READ COMMENT ABOVE. */ -/* *INDENT-OFF* */ -#ifdef __cplusplus - extern "C" { -#endif -/* *INDENT-ON* */ - /* Acceptable values for configTICK_TYPE_WIDTH_IN_BITS. */ #define TICK_TYPE_WIDTH_16_BITS 0 #define TICK_TYPE_WIDTH_32_BITS 1 @@ -100,6 +94,13 @@ #define configUSE_MALLOC_FAILED_HOOK 0 #endif +#ifndef configASSERT + #define configASSERT( x ) + #define configASSERT_DEFINED 0 +#else + #define configASSERT_DEFINED 1 +#endif + /* Basic FreeRTOS definitions. */ #include "projdefs.h" @@ -129,6 +130,12 @@ #endif /* if ( configUSE_PICOLIBC_TLS == 1 ) */ +/* *INDENT-OFF* */ +#ifdef __cplusplus + extern "C" { +#endif +/* *INDENT-ON* */ + #ifndef configUSE_C_RUNTIME_TLS_SUPPORT #define configUSE_C_RUNTIME_TLS_SUPPORT 0 #endif @@ -364,13 +371,6 @@ #error configMAX_TASK_NAME_LEN must be set to a minimum of 1 in FreeRTOSConfig.h #endif -#ifndef configASSERT - #define configASSERT( x ) - #define configASSERT_DEFINED 0 -#else - #define configASSERT_DEFINED 1 -#endif - /* configPRECONDITION should be defined as configASSERT. * The CBMC proofs need a way to track assumptions and assertions. * A configPRECONDITION statement should express an implicit invariant or @@ -445,7 +445,7 @@ #ifndef portRELEASE_TASK_LOCK #if ( configNUMBER_OF_CORES == 1 ) - #define portRELEASE_TASK_LOCK() + #define portRELEASE_TASK_LOCK( xCoreID ) #else #error portRELEASE_TASK_LOCK is required in SMP #endif @@ -455,7 +455,7 @@ #ifndef portGET_TASK_LOCK #if ( configNUMBER_OF_CORES == 1 ) - #define portGET_TASK_LOCK() + #define portGET_TASK_LOCK( xCoreID ) #else #error portGET_TASK_LOCK is required in SMP #endif @@ -465,7 +465,7 @@ #ifndef portRELEASE_ISR_LOCK #if ( configNUMBER_OF_CORES == 1 ) - #define portRELEASE_ISR_LOCK() + #define portRELEASE_ISR_LOCK( xCoreID ) #else #error portRELEASE_ISR_LOCK is required in SMP #endif @@ -475,7 +475,7 @@ #ifndef portGET_ISR_LOCK #if ( configNUMBER_OF_CORES == 1 ) - #define portGET_ISR_LOCK() + #define portGET_ISR_LOCK( xCoreID ) #else #error portGET_ISR_LOCK is required in SMP #endif @@ -621,6 +621,13 @@ #define traceTASK_SWITCHED_IN() #endif +#ifndef traceSTARTING_SCHEDULER + +/* Called after all idle tasks and timer task (if enabled) have been created + * successfully, just before the scheduler is started. */ + #define traceSTARTING_SCHEDULER( xIdleTaskHandles ) +#endif + #ifndef traceINCREASE_TICK_COUNT /* Called before stepping the tick count after waking from tickless idle @@ -1477,6 +1484,14 @@ #define traceRETURN_xQueueCreateSet( pxQueue ) #endif +#ifndef traceENTER_xQueueCreateSetStatic + #define traceENTER_xQueueCreateSetStatic( uxEventQueueLength ) +#endif + +#ifndef traceRETURN_xQueueCreateSetStatic + #define traceRETURN_xQueueCreateSetStatic( pxQueue ) +#endif + #ifndef traceENTER_xQueueAddToSet #define traceENTER_xQueueAddToSet( xQueueOrSemaphore, xQueueSet ) #endif @@ -3025,6 +3040,16 @@ #define configCONTROL_INFINITE_LOOP() #endif +/* Set configENABLE_PAC and/or configENABLE_BTI to 1 to enable PAC and/or BTI + * support and 0 to disable them. These are currently used in ARMv8.1-M ports. */ +#ifndef configENABLE_PAC + #define configENABLE_PAC 0 +#endif + +#ifndef configENABLE_BTI + #define configENABLE_BTI 0 +#endif + /* Sometimes the FreeRTOSConfig.h settings only allow a task to be created using * dynamically allocated RAM, in which case when any task is deleted it is known * that both the task's stack and TCB need to be freed. Sometimes the diff --git a/third-party/freertos/include/StackMacros.h b/third-party/freertos/include/StackMacros.h index f47b1c42..d0c62473 100644 --- a/third-party/freertos/include/StackMacros.h +++ b/third-party/freertos/include/StackMacros.h @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT diff --git a/third-party/freertos/include/atomic.h b/third-party/freertos/include/atomic.h index c2480d19..335a77fd 100644 --- a/third-party/freertos/include/atomic.h +++ b/third-party/freertos/include/atomic.h @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT diff --git a/third-party/freertos/include/croutine.h b/third-party/freertos/include/croutine.h index 6cbb743c..a5e2e446 100644 --- a/third-party/freertos/include/croutine.h +++ b/third-party/freertos/include/croutine.h @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT @@ -246,7 +246,10 @@ void vCoRoutineSchedule( void ); * \defgroup crSTART crSTART * \ingroup Tasks */ + +/* *INDENT-OFF* */ #define crEND() } +/* *INDENT-ON* */ /* * These macros are intended for internal use by the co-routine implementation diff --git a/third-party/freertos/include/deprecated_definitions.h b/third-party/freertos/include/deprecated_definitions.h index ebf8fe46..edc0f224 100644 --- a/third-party/freertos/include/deprecated_definitions.h +++ b/third-party/freertos/include/deprecated_definitions.h @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT diff --git a/third-party/freertos/include/event_groups.h b/third-party/freertos/include/event_groups.h index e872cf23..9e634868 100644 --- a/third-party/freertos/include/event_groups.h +++ b/third-party/freertos/include/event_groups.h @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT @@ -483,14 +483,11 @@ EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup, * and bit 0 set uxBitsToSet to 0x09. * * @return The value of the event group at the time the call to - * xEventGroupSetBits() returns. There are two reasons why the returned value - * might have the bits specified by the uxBitsToSet parameter cleared. First, - * if setting a bit results in a task that was waiting for the bit leaving the - * blocked state then it is possible the bit will be cleared automatically - * (see the xClearBitOnExit parameter of xEventGroupWaitBits()). Second, any - * unblocked (or otherwise Ready state) task that has a priority above that of - * the task that called xEventGroupSetBits() will execute and may change the - * event group value before the call to xEventGroupSetBits() returns. + * xEventGroupSetBits() returns. Returned value might have the bits specified + * by the uxBitsToSet parameter cleared if setting a bit results in a task + * that was waiting for the bit leaving the blocked state then it is possible + * the bit will be cleared automatically (see the xClearBitOnExit parameter + * of xEventGroupWaitBits()). * * Example usage: * @code{c} diff --git a/third-party/freertos/include/list.h b/third-party/freertos/include/list.h index e5e6583b..b64450c7 100644 --- a/third-party/freertos/include/list.h +++ b/third-party/freertos/include/list.h @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT diff --git a/third-party/freertos/include/message_buffer.h b/third-party/freertos/include/message_buffer.h index a47ce467..9fb97ffd 100644 --- a/third-party/freertos/include/message_buffer.h +++ b/third-party/freertos/include/message_buffer.h @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT @@ -43,12 +43,12 @@ * writer and reader to be different tasks or interrupts, but, unlike other * FreeRTOS objects, it is not safe to have multiple different writers or * multiple different readers. If there are to be multiple different writers - * then the application writer must place each call to a writing API function - * (such as xMessageBufferSend()) inside a critical section and set the send - * block time to 0. Likewise, if there are to be multiple different readers - * then the application writer must place each call to a reading API function - * (such as xMessageBufferRead()) inside a critical section and set the receive - * timeout to 0. + * then the application writer must serialize calls to writing API functions + * (such as xStreamBufferSend()). Likewise, if there are to be multiple + * different readers then the application writer must serialize calls to reading + * API functions (such as xStreamBufferReceive()). One way to achieve such + * serialization in single core or SMP kernel is to place each API call inside a + * critical section and use a block time of 0. * * Message buffers hold variable length messages. To enable that, when a * message is written to the message buffer an additional sizeof( size_t ) bytes @@ -306,12 +306,12 @@ typedef StreamBufferHandle_t MessageBufferHandle_t; * writer and reader to be different tasks or interrupts, but, unlike other * FreeRTOS objects, it is not safe to have multiple different writers or * multiple different readers. If there are to be multiple different writers - * then the application writer must place each call to a writing API function - * (such as xMessageBufferSend()) inside a critical section and set the send - * block time to 0. Likewise, if there are to be multiple different readers - * then the application writer must place each call to a reading API function - * (such as xMessageBufferRead()) inside a critical section and set the receive - * block time to 0. + * then the application writer must serialize calls to writing API functions + * (such as xStreamBufferSend()). Likewise, if there are to be multiple + * different readers then the application writer must serialize calls to reading + * API functions (such as xStreamBufferReceive()). One way to achieve such + * serialization in single core or SMP kernel is to place each API call inside a + * critical section and use a block time of 0. * * Use xMessageBufferSend() to write to a message buffer from a task. Use * xMessageBufferSendFromISR() to write to a message buffer from an interrupt @@ -409,12 +409,12 @@ typedef StreamBufferHandle_t MessageBufferHandle_t; * writer and reader to be different tasks or interrupts, but, unlike other * FreeRTOS objects, it is not safe to have multiple different writers or * multiple different readers. If there are to be multiple different writers - * then the application writer must place each call to a writing API function - * (such as xMessageBufferSend()) inside a critical section and set the send - * block time to 0. Likewise, if there are to be multiple different readers - * then the application writer must place each call to a reading API function - * (such as xMessageBufferRead()) inside a critical section and set the receive - * block time to 0. + * then the application writer must serialize calls to writing API functions + * (such as xStreamBufferSend()). Likewise, if there are to be multiple + * different readers then the application writer must serialize calls to reading + * API functions (such as xStreamBufferReceive()). One way to achieve such + * serialization in single core or SMP kernel is to place each API call inside a + * critical section and use a block time of 0. * * Use xMessageBufferSend() to write to a message buffer from a task. Use * xMessageBufferSendFromISR() to write to a message buffer from an interrupt @@ -516,12 +516,12 @@ typedef StreamBufferHandle_t MessageBufferHandle_t; * writer and reader to be different tasks or interrupts, but, unlike other * FreeRTOS objects, it is not safe to have multiple different writers or * multiple different readers. If there are to be multiple different writers - * then the application writer must place each call to a writing API function - * (such as xMessageBufferSend()) inside a critical section and set the send - * block time to 0. Likewise, if there are to be multiple different readers - * then the application writer must place each call to a reading API function - * (such as xMessageBufferRead()) inside a critical section and set the receive - * block time to 0. + * then the application writer must serialize calls to writing API functions + * (such as xStreamBufferSend()). Likewise, if there are to be multiple + * different readers then the application writer must serialize calls to reading + * API functions (such as xStreamBufferReceive()). One way to achieve such + * serialization in single core or SMP kernel is to place each API call inside a + * critical section and use a block time of 0. * * Use xMessageBufferReceive() to read from a message buffer from a task. Use * xMessageBufferReceiveFromISR() to read from a message buffer from an @@ -610,12 +610,12 @@ typedef StreamBufferHandle_t MessageBufferHandle_t; * writer and reader to be different tasks or interrupts, but, unlike other * FreeRTOS objects, it is not safe to have multiple different writers or * multiple different readers. If there are to be multiple different writers - * then the application writer must place each call to a writing API function - * (such as xMessageBufferSend()) inside a critical section and set the send - * block time to 0. Likewise, if there are to be multiple different readers - * then the application writer must place each call to a reading API function - * (such as xMessageBufferRead()) inside a critical section and set the receive - * block time to 0. + * then the application writer must serialize calls to writing API functions + * (such as xStreamBufferSend()). Likewise, if there are to be multiple + * different readers then the application writer must serialize calls to reading + * API functions (such as xStreamBufferReceive()). One way to achieve such + * serialization in single core or SMP kernel is to place each API call inside a + * critical section and use a block time of 0. * * Use xMessageBufferReceive() to read from a message buffer from a task. Use * xMessageBufferReceiveFromISR() to read from a message buffer from an diff --git a/third-party/freertos/include/mpu_prototypes.h b/third-party/freertos/include/mpu_prototypes.h index 0f42d6b9..9df2a576 100644 --- a/third-party/freertos/include/mpu_prototypes.h +++ b/third-party/freertos/include/mpu_prototypes.h @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT @@ -136,25 +136,59 @@ BaseType_t MPU_xTaskGetSchedulerState( void ) FREERTOS_SYSTEM_CALL; /* Privileged only wrappers for Task APIs. These are needed so that * the application can use opaque handles maintained in mpu_wrappers.c * with all the APIs. */ -BaseType_t MPU_xTaskCreate( TaskFunction_t pxTaskCode, - const char * const pcName, - const configSTACK_DEPTH_TYPE uxStackDepth, - void * const pvParameters, - UBaseType_t uxPriority, - TaskHandle_t * const pxCreatedTask ) PRIVILEGED_FUNCTION; -TaskHandle_t MPU_xTaskCreateStatic( TaskFunction_t pxTaskCode, - const char * const pcName, - const configSTACK_DEPTH_TYPE uxStackDepth, - void * const pvParameters, - UBaseType_t uxPriority, - StackType_t * const puxStackBuffer, - StaticTask_t * const pxTaskBuffer ) PRIVILEGED_FUNCTION; -void MPU_vTaskDelete( TaskHandle_t xTaskToDelete ) PRIVILEGED_FUNCTION; -void MPU_vTaskPrioritySet( TaskHandle_t xTask, - UBaseType_t uxNewPriority ) PRIVILEGED_FUNCTION; -TaskHandle_t MPU_xTaskGetHandle( const char * pcNameToQuery ) PRIVILEGED_FUNCTION; -BaseType_t MPU_xTaskCallApplicationTaskHook( TaskHandle_t xTask, - void * pvParameter ) PRIVILEGED_FUNCTION; +#if ( configUSE_MPU_WRAPPERS_V1 == 1 ) + + BaseType_t MPU_xTaskCreate( TaskFunction_t pxTaskCode, + const char * const pcName, + const configSTACK_DEPTH_TYPE uxStackDepth, + void * const pvParameters, + UBaseType_t uxPriority, + TaskHandle_t * const pxCreatedTask ) FREERTOS_SYSTEM_CALL; + TaskHandle_t MPU_xTaskCreateStatic( TaskFunction_t pxTaskCode, + const char * const pcName, + const configSTACK_DEPTH_TYPE uxStackDepth, + void * const pvParameters, + UBaseType_t uxPriority, + StackType_t * const puxStackBuffer, + StaticTask_t * const pxTaskBuffer ) FREERTOS_SYSTEM_CALL; + void MPU_vTaskDelete( TaskHandle_t xTaskToDelete ) FREERTOS_SYSTEM_CALL; + void MPU_vTaskPrioritySet( TaskHandle_t xTask, + UBaseType_t uxNewPriority ) FREERTOS_SYSTEM_CALL; + TaskHandle_t MPU_xTaskGetHandle( const char * pcNameToQuery ) FREERTOS_SYSTEM_CALL; + BaseType_t MPU_xTaskCallApplicationTaskHook( TaskHandle_t xTask, + void * pvParameter ) FREERTOS_SYSTEM_CALL; + void MPU_vTaskGetRunTimeStatistics( char * pcWriteBuffer, + size_t uxBufferLength ) FREERTOS_SYSTEM_CALL; + void MPU_vTaskListTasks( char * pcWriteBuffer, + size_t uxBufferLength ) FREERTOS_SYSTEM_CALL; + void MPU_vTaskSuspendAll( void ) FREERTOS_SYSTEM_CALL; + BaseType_t MPU_xTaskCatchUpTicks( TickType_t xTicksToCatchUp ) FREERTOS_SYSTEM_CALL; + BaseType_t MPU_xTaskResumeAll( void ) FREERTOS_SYSTEM_CALL; + +#else /* #if ( configUSE_MPU_WRAPPERS_V1 == 1 ) */ + + BaseType_t MPU_xTaskCreate( TaskFunction_t pxTaskCode, + const char * const pcName, + const configSTACK_DEPTH_TYPE uxStackDepth, + void * const pvParameters, + UBaseType_t uxPriority, + TaskHandle_t * const pxCreatedTask ) PRIVILEGED_FUNCTION; + TaskHandle_t MPU_xTaskCreateStatic( TaskFunction_t pxTaskCode, + const char * const pcName, + const configSTACK_DEPTH_TYPE uxStackDepth, + void * const pvParameters, + UBaseType_t uxPriority, + StackType_t * const puxStackBuffer, + StaticTask_t * const pxTaskBuffer ) PRIVILEGED_FUNCTION; + void MPU_vTaskDelete( TaskHandle_t xTaskToDelete ) PRIVILEGED_FUNCTION; + void MPU_vTaskPrioritySet( TaskHandle_t xTask, + UBaseType_t uxNewPriority ) PRIVILEGED_FUNCTION; + TaskHandle_t MPU_xTaskGetHandle( const char * pcNameToQuery ) PRIVILEGED_FUNCTION; + BaseType_t MPU_xTaskCallApplicationTaskHook( TaskHandle_t xTask, + void * pvParameter ) PRIVILEGED_FUNCTION; + +#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 1 ) */ + char * MPU_pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; BaseType_t MPU_xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition, TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION; @@ -215,28 +249,64 @@ uint8_t MPU_ucQueueGetQueueType( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL; /* Privileged only wrappers for Queue APIs. These are needed so that * the application can use opaque handles maintained in mpu_wrappers.c * with all the APIs. */ -void MPU_vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; -QueueHandle_t MPU_xQueueCreateMutex( const uint8_t ucQueueType ) PRIVILEGED_FUNCTION; -QueueHandle_t MPU_xQueueCreateMutexStatic( const uint8_t ucQueueType, - StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION; -QueueHandle_t MPU_xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount, - const UBaseType_t uxInitialCount ) PRIVILEGED_FUNCTION; -QueueHandle_t MPU_xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount, - const UBaseType_t uxInitialCount, - StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION; -QueueHandle_t MPU_xQueueGenericCreate( const UBaseType_t uxQueueLength, - const UBaseType_t uxItemSize, - const uint8_t ucQueueType ) PRIVILEGED_FUNCTION; -QueueHandle_t MPU_xQueueGenericCreateStatic( const UBaseType_t uxQueueLength, - const UBaseType_t uxItemSize, - uint8_t * pucQueueStorage, - StaticQueue_t * pxStaticQueue, - const uint8_t ucQueueType ) PRIVILEGED_FUNCTION; -QueueSetHandle_t MPU_xQueueCreateSet( const UBaseType_t uxEventQueueLength ) PRIVILEGED_FUNCTION; -BaseType_t MPU_xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore, - QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION; -BaseType_t MPU_xQueueGenericReset( QueueHandle_t xQueue, - BaseType_t xNewQueue ) PRIVILEGED_FUNCTION; +#if ( configUSE_MPU_WRAPPERS_V1 == 1 ) + + void MPU_vQueueDelete( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL; + QueueHandle_t MPU_xQueueCreateMutex( const uint8_t ucQueueType ) FREERTOS_SYSTEM_CALL; + QueueHandle_t MPU_xQueueCreateMutexStatic( const uint8_t ucQueueType, + StaticQueue_t * pxStaticQueue ) FREERTOS_SYSTEM_CALL; + QueueHandle_t MPU_xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount, + const UBaseType_t uxInitialCount ) FREERTOS_SYSTEM_CALL; + QueueHandle_t MPU_xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount, + const UBaseType_t uxInitialCount, + StaticQueue_t * pxStaticQueue ) FREERTOS_SYSTEM_CALL; + QueueHandle_t MPU_xQueueGenericCreate( const UBaseType_t uxQueueLength, + const UBaseType_t uxItemSize, + const uint8_t ucQueueType ) FREERTOS_SYSTEM_CALL; + QueueHandle_t MPU_xQueueGenericCreateStatic( const UBaseType_t uxQueueLength, + const UBaseType_t uxItemSize, + uint8_t * pucQueueStorage, + StaticQueue_t * pxStaticQueue, + const uint8_t ucQueueType ) FREERTOS_SYSTEM_CALL; + QueueSetHandle_t MPU_xQueueCreateSet( const UBaseType_t uxEventQueueLength ) FREERTOS_SYSTEM_CALL; + QueueSetHandle_t MPU_xQueueCreateSetStatic( const UBaseType_t uxEventQueueLength, + uint8_t * pucQueueStorage, + StaticQueue_t * pxStaticQueue ) FREERTOS_SYSTEM_CALL; + BaseType_t MPU_xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore, + QueueSetHandle_t xQueueSet ) FREERTOS_SYSTEM_CALL; + BaseType_t MPU_xQueueGenericReset( QueueHandle_t xQueue, + BaseType_t xNewQueue ) FREERTOS_SYSTEM_CALL; + +#else /* #if ( configUSE_MPU_WRAPPERS_V1 == 1 ) */ + + void MPU_vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; + QueueHandle_t MPU_xQueueCreateMutex( const uint8_t ucQueueType ) PRIVILEGED_FUNCTION; + QueueHandle_t MPU_xQueueCreateMutexStatic( const uint8_t ucQueueType, + StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION; + QueueHandle_t MPU_xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount, + const UBaseType_t uxInitialCount ) PRIVILEGED_FUNCTION; + QueueHandle_t MPU_xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount, + const UBaseType_t uxInitialCount, + StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION; + QueueHandle_t MPU_xQueueGenericCreate( const UBaseType_t uxQueueLength, + const UBaseType_t uxItemSize, + const uint8_t ucQueueType ) PRIVILEGED_FUNCTION; + QueueHandle_t MPU_xQueueGenericCreateStatic( const UBaseType_t uxQueueLength, + const UBaseType_t uxItemSize, + uint8_t * pucQueueStorage, + StaticQueue_t * pxStaticQueue, + const uint8_t ucQueueType ) PRIVILEGED_FUNCTION; + QueueSetHandle_t MPU_xQueueCreateSet( const UBaseType_t uxEventQueueLength ) PRIVILEGED_FUNCTION; + QueueSetHandle_t MPU_xQueueCreateSetStatic( const UBaseType_t uxEventQueueLength, + uint8_t * pucQueueStorage, + StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION; + BaseType_t MPU_xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore, + QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION; + BaseType_t MPU_xQueueGenericReset( QueueHandle_t xQueue, + BaseType_t xNewQueue ) PRIVILEGED_FUNCTION; + +#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 1 ) */ + BaseType_t MPU_xQueueGenericGetStaticBuffers( QueueHandle_t xQueue, uint8_t ** ppucQueueStorage, StaticQueue_t ** ppxStaticQueue ) PRIVILEGED_FUNCTION; @@ -271,7 +341,7 @@ BaseType_t MPU_xTimerGenericCommandFromTask( TimerHandle_t xTimer, BaseType_t MPU_xTimerGenericCommandFromTaskEntry( const xTimerGenericCommandFromTaskParams_t * pxParams ) FREERTOS_SYSTEM_CALL; const char * MPU_pcTimerGetName( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL; void MPU_vTimerSetReloadMode( TimerHandle_t xTimer, - const BaseType_t uxAutoReload ) FREERTOS_SYSTEM_CALL; + const BaseType_t xAutoReload ) FREERTOS_SYSTEM_CALL; BaseType_t MPU_xTimerGetReloadMode( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL; UBaseType_t MPU_uxTimerGetReloadMode( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL; TickType_t MPU_xTimerGetPeriod( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL; @@ -282,12 +352,12 @@ TickType_t MPU_xTimerGetExpiryTime( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL; * with all the APIs. */ TimerHandle_t MPU_xTimerCreate( const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, - const UBaseType_t uxAutoReload, + const BaseType_t xAutoReload, void * const pvTimerID, TimerCallbackFunction_t pxCallbackFunction ) PRIVILEGED_FUNCTION; TimerHandle_t MPU_xTimerCreateStatic( const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, - const UBaseType_t uxAutoReload, + const BaseType_t xAutoReload, void * const pvTimerID, TimerCallbackFunction_t pxCallbackFunction, StaticTimer_t * pxTimerBuffer ) PRIVILEGED_FUNCTION; @@ -318,14 +388,25 @@ EventBits_t MPU_xEventGroupSync( EventGroupHandle_t xEventGroup, UBaseType_t MPU_uxEventGroupGetNumber( void * xEventGroup ) FREERTOS_SYSTEM_CALL; void MPU_vEventGroupSetNumber( void * xEventGroup, UBaseType_t uxEventGroupNumber ) FREERTOS_SYSTEM_CALL; -#endif /* ( configUSE_TRACE_FACILITY == 1 )*/ +#endif /* #if ( configUSE_TRACE_FACILITY == 1 ) */ /* Privileged only wrappers for Event Group APIs. These are needed so that * the application can use opaque handles maintained in mpu_wrappers.c * with all the APIs. */ -EventGroupHandle_t MPU_xEventGroupCreate( void ) PRIVILEGED_FUNCTION; -EventGroupHandle_t MPU_xEventGroupCreateStatic( StaticEventGroup_t * pxEventGroupBuffer ) PRIVILEGED_FUNCTION; -void MPU_vEventGroupDelete( EventGroupHandle_t xEventGroup ) PRIVILEGED_FUNCTION; +#if ( configUSE_MPU_WRAPPERS_V1 == 1 ) + + EventGroupHandle_t MPU_xEventGroupCreate( void ) FREERTOS_SYSTEM_CALL; + EventGroupHandle_t MPU_xEventGroupCreateStatic( StaticEventGroup_t * pxEventGroupBuffer ) FREERTOS_SYSTEM_CALL; + void MPU_vEventGroupDelete( EventGroupHandle_t xEventGroup ) FREERTOS_SYSTEM_CALL; + +#else /* #if ( configUSE_MPU_WRAPPERS_V1 == 1 ) */ + + EventGroupHandle_t MPU_xEventGroupCreate( void ) PRIVILEGED_FUNCTION; + EventGroupHandle_t MPU_xEventGroupCreateStatic( StaticEventGroup_t * pxEventGroupBuffer ) PRIVILEGED_FUNCTION; + void MPU_vEventGroupDelete( EventGroupHandle_t xEventGroup ) PRIVILEGED_FUNCTION; + +#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 1 ) */ + BaseType_t MPU_xEventGroupGetStaticBuffer( EventGroupHandle_t xEventGroup, StaticEventGroup_t ** ppxEventGroupBuffer ) PRIVILEGED_FUNCTION; BaseType_t MPU_xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup, @@ -355,20 +436,42 @@ size_t MPU_xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuff /* Privileged only wrappers for Stream Buffer APIs. These are needed so that * the application can use opaque handles maintained in mpu_wrappers.c * with all the APIs. */ -StreamBufferHandle_t MPU_xStreamBufferGenericCreate( size_t xBufferSizeBytes, - size_t xTriggerLevelBytes, - BaseType_t xStreamBufferType, - StreamBufferCallbackFunction_t pxSendCompletedCallback, - StreamBufferCallbackFunction_t pxReceiveCompletedCallback ) PRIVILEGED_FUNCTION; -StreamBufferHandle_t MPU_xStreamBufferGenericCreateStatic( size_t xBufferSizeBytes, - size_t xTriggerLevelBytes, - BaseType_t xStreamBufferType, - uint8_t * const pucStreamBufferStorageArea, - StaticStreamBuffer_t * const pxStaticStreamBuffer, - StreamBufferCallbackFunction_t pxSendCompletedCallback, - StreamBufferCallbackFunction_t pxReceiveCompletedCallback ) PRIVILEGED_FUNCTION; -void MPU_vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION; -BaseType_t MPU_xStreamBufferReset( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION; +#if ( configUSE_MPU_WRAPPERS_V1 == 1 ) + + StreamBufferHandle_t MPU_xStreamBufferGenericCreate( size_t xBufferSizeBytes, + size_t xTriggerLevelBytes, + BaseType_t xStreamBufferType, + StreamBufferCallbackFunction_t pxSendCompletedCallback, + StreamBufferCallbackFunction_t pxReceiveCompletedCallback ) FREERTOS_SYSTEM_CALL; + StreamBufferHandle_t MPU_xStreamBufferGenericCreateStatic( size_t xBufferSizeBytes, + size_t xTriggerLevelBytes, + BaseType_t xStreamBufferType, + uint8_t * const pucStreamBufferStorageArea, + StaticStreamBuffer_t * const pxStaticStreamBuffer, + StreamBufferCallbackFunction_t pxSendCompletedCallback, + StreamBufferCallbackFunction_t pxReceiveCompletedCallback ) FREERTOS_SYSTEM_CALL; + void MPU_vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL; + BaseType_t MPU_xStreamBufferReset( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL; + +#else /* #if ( configUSE_MPU_WRAPPERS_V1 == 1 ) */ + + StreamBufferHandle_t MPU_xStreamBufferGenericCreate( size_t xBufferSizeBytes, + size_t xTriggerLevelBytes, + BaseType_t xStreamBufferType, + StreamBufferCallbackFunction_t pxSendCompletedCallback, + StreamBufferCallbackFunction_t pxReceiveCompletedCallback ) PRIVILEGED_FUNCTION; + StreamBufferHandle_t MPU_xStreamBufferGenericCreateStatic( size_t xBufferSizeBytes, + size_t xTriggerLevelBytes, + BaseType_t xStreamBufferType, + uint8_t * const pucStreamBufferStorageArea, + StaticStreamBuffer_t * const pxStaticStreamBuffer, + StreamBufferCallbackFunction_t pxSendCompletedCallback, + StreamBufferCallbackFunction_t pxReceiveCompletedCallback ) PRIVILEGED_FUNCTION; + void MPU_vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION; + BaseType_t MPU_xStreamBufferReset( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION; + +#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 1 ) */ + BaseType_t MPU_xStreamBufferGetStaticBuffers( StreamBufferHandle_t xStreamBuffers, uint8_t * ppucStreamBufferStorageArea, StaticStreamBuffer_t * ppxStaticStreamBuffer ) PRIVILEGED_FUNCTION; diff --git a/third-party/freertos/include/mpu_syscall_numbers.h b/third-party/freertos/include/mpu_syscall_numbers.h index 82092342..7c625a78 100644 --- a/third-party/freertos/include/mpu_syscall_numbers.h +++ b/third-party/freertos/include/mpu_syscall_numbers.h @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT diff --git a/third-party/freertos/include/mpu_wrappers.h b/third-party/freertos/include/mpu_wrappers.h index 5b505726..3b4738e9 100644 --- a/third-party/freertos/include/mpu_wrappers.h +++ b/third-party/freertos/include/mpu_wrappers.h @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT @@ -85,6 +85,18 @@ /* Privileged only wrappers for Task APIs. These are needed so that * the application can use opaque handles maintained in mpu_wrappers.c * with all the APIs. */ + #if ( configUSE_MPU_WRAPPERS_V1 == 1 ) + +/* These are not needed in v2 because they do not take a task + * handle and therefore, no lookup is needed. Needed in v1 because + * these are available as system calls in v1. */ + #define vTaskGetRunTimeStatistics MPU_vTaskGetRunTimeStatistics + #define vTaskListTasks MPU_vTaskListTasks + #define vTaskSuspendAll MPU_vTaskSuspendAll + #define xTaskCatchUpTicks MPU_xTaskCatchUpTicks + #define xTaskResumeAll MPU_xTaskResumeAll + #endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 1 ) */ + #define xTaskCreate MPU_xTaskCreate #define xTaskCreateStatic MPU_xTaskCreateStatic #define vTaskDelete MPU_vTaskDelete @@ -138,6 +150,7 @@ #define xQueueGenericCreateStatic MPU_xQueueGenericCreateStatic #define xQueueGenericReset MPU_xQueueGenericReset #define xQueueCreateSet MPU_xQueueCreateSet + #define xQueueCreateSetStatic MPU_xQueueCreateSetStatic #define xQueueRemoveFromSet MPU_xQueueRemoveFromSet #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) @@ -165,11 +178,14 @@ #define xTimerGetPeriod MPU_xTimerGetPeriod #define xTimerGetExpiryTime MPU_xTimerGetExpiryTime + #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) + #define xTimerGetReloadMode MPU_xTimerGetReloadMode + #endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */ + /* Privileged only wrappers for Timer APIs. These are needed so that * the application can use opaque handles maintained in mpu_wrappers.c * with all the APIs. */ #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) - #define xTimerGetReloadMode MPU_xTimerGetReloadMode #define xTimerCreate MPU_xTimerCreate #define xTimerCreateStatic MPU_xTimerCreateStatic #define xTimerGetStaticBuffer MPU_xTimerGetStaticBuffer diff --git a/third-party/freertos/include/newlib-freertos.h b/third-party/freertos/include/newlib-freertos.h index 2b51ee71..4414d24a 100644 --- a/third-party/freertos/include/newlib-freertos.h +++ b/third-party/freertos/include/newlib-freertos.h @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT diff --git a/third-party/freertos/include/picolibc-freertos.h b/third-party/freertos/include/picolibc-freertos.h index 9a3b5a86..5cf01afa 100644 --- a/third-party/freertos/include/picolibc-freertos.h +++ b/third-party/freertos/include/picolibc-freertos.h @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT diff --git a/third-party/freertos/include/portable.h b/third-party/freertos/include/portable.h index 1cbb4fc3..68e11e79 100644 --- a/third-party/freertos/include/portable.h +++ b/third-party/freertos/include/portable.h @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT @@ -85,6 +85,14 @@ #define portARCH_NAME NULL #endif +#ifndef portBASE_TYPE_ENTER_CRITICAL + #define portBASE_TYPE_ENTER_CRITICAL() taskENTER_CRITICAL() +#endif + +#ifndef portBASE_TYPE_EXIT_CRITICAL + #define portBASE_TYPE_EXIT_CRITICAL() taskEXIT_CRITICAL() +#endif + #ifndef configSTACK_DEPTH_TYPE #define configSTACK_DEPTH_TYPE StackType_t #endif @@ -94,14 +102,14 @@ #define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0 #endif +#include "mpu_wrappers.h" + /* *INDENT-OFF* */ #ifdef __cplusplus extern "C" { #endif /* *INDENT-ON* */ -#include "mpu_wrappers.h" - /* * Setup the stack of a new task so it is ready to be placed under the * scheduler control. The registers have to be placed on the stack in @@ -185,6 +193,7 @@ void vPortFree( void * pv ) PRIVILEGED_FUNCTION; void vPortInitialiseBlocks( void ) PRIVILEGED_FUNCTION; size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION; size_t xPortGetMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION; +void xPortResetHeapMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION; #if ( configSTACK_ALLOCATION_FROM_SEPARATE_HEAP == 1 ) void * pvPortMallocStack( size_t xSize ) PRIVILEGED_FUNCTION; diff --git a/third-party/freertos/include/projdefs.h b/third-party/freertos/include/projdefs.h index d55dfde2..04ec47fa 100644 --- a/third-party/freertos/include/projdefs.h +++ b/third-party/freertos/include/projdefs.h @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT diff --git a/third-party/freertos/include/queue.h b/third-party/freertos/include/queue.h index 1e5cf2bb..56753d30 100644 --- a/third-party/freertos/include/queue.h +++ b/third-party/freertos/include/queue.h @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT @@ -34,14 +34,14 @@ #error "include FreeRTOS.h" must appear in source files before "include queue.h" #endif +#include "task.h" + /* *INDENT-OFF* */ #ifdef __cplusplus extern "C" { #endif /* *INDENT-ON* */ -#include "task.h" - /** * Type by which queues are referenced. For example, a call to xQueueCreate() * returns an QueueHandle_t variable that can then be used as a parameter to @@ -71,11 +71,11 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t; /* For internal use only. These definitions *must* match those in queue.c. */ #define queueQUEUE_TYPE_BASE ( ( uint8_t ) 0U ) -#define queueQUEUE_TYPE_SET ( ( uint8_t ) 0U ) #define queueQUEUE_TYPE_MUTEX ( ( uint8_t ) 1U ) #define queueQUEUE_TYPE_COUNTING_SEMAPHORE ( ( uint8_t ) 2U ) #define queueQUEUE_TYPE_BINARY_SEMAPHORE ( ( uint8_t ) 3U ) #define queueQUEUE_TYPE_RECURSIVE_MUTEX ( ( uint8_t ) 4U ) +#define queueQUEUE_TYPE_SET ( ( uint8_t ) 5U ) /** * queue. h @@ -109,7 +109,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t; * the same size. * * @return If the queue is successfully create then a handle to the newly - * created queue is returned. If the queue cannot be created then 0 is + * created queue is returned. If the queue cannot be created then NULL is * returned. * * Example usage: @@ -126,7 +126,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t; * * // Create a queue capable of containing 10 uint32_t values. * xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) ); - * if( xQueue1 == 0 ) + * if( xQueue1 == NULL ) * { * // Queue was not created and must not be used. * } @@ -134,7 +134,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t; * // Create a queue capable of containing 10 pointers to AMessage structures. * // These should be passed by pointer as they contain a lot of data. * xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) ); - * if( xQueue2 == 0 ) + * if( xQueue2 == NULL ) * { * // Queue was not created and must not be used. * } @@ -292,7 +292,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t; * queue is full. The time is defined in tick periods so the constant * portTICK_PERIOD_MS should be used to convert to real time if this is required. * - * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL. + * @return pdPASS if the item was successfully posted, otherwise errQUEUE_FULL. * * Example usage: * @code{c} @@ -375,7 +375,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t; * is full. The time is defined in tick periods so the constant * portTICK_PERIOD_MS should be used to convert to real time if this is required. * - * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL. + * @return pdPASS if the item was successfully posted, otherwise errQUEUE_FULL. * * Example usage: * @code{c} @@ -460,7 +460,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t; * queue is full. The time is defined in tick periods so the constant * portTICK_PERIOD_MS should be used to convert to real time if this is required. * - * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL. + * @return pdPASS if the item was successfully posted, otherwise errQUEUE_FULL. * * Example usage: * @code{c} @@ -633,7 +633,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t; * item at the back of the queue, or queueSEND_TO_FRONT to place the item * at the front of the queue (for high priority messages). * - * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL. + * @return pdPASS if the item was successfully posted, otherwise errQUEUE_FULL. * * Example usage: * @code{c} @@ -723,8 +723,8 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue, * xQueuePeek() will return immediately if xTicksToWait is 0 and the queue * is empty. * - * @return pdTRUE if an item was successfully received from the queue, - * otherwise pdFALSE. + * @return pdPASS if an item was successfully received from the queue, + * otherwise errQUEUE_EMPTY. * * Example usage: * @code{c} @@ -811,8 +811,8 @@ BaseType_t xQueuePeek( QueueHandle_t xQueue, * @param pvBuffer Pointer to the buffer into which the received item will * be copied. * - * @return pdTRUE if an item was successfully received from the queue, - * otherwise pdFALSE. + * @return pdPASS if an item was successfully received from the queue, + * otherwise pdFAIL. * * \defgroup xQueuePeekFromISR xQueuePeekFromISR * \ingroup QueueManagement @@ -852,8 +852,8 @@ BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue, * constant portTICK_PERIOD_MS should be used to convert to real time if this is * required. * - * @return pdTRUE if an item was successfully received from the queue, - * otherwise pdFALSE. + * @return pdPASS if an item was successfully received from the queue, + * otherwise errQUEUE_EMPTY. * * Example usage: * @code{c} @@ -998,7 +998,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; * running task. If xQueueSendToFrontFromISR() sets this value to pdTRUE then * a context switch should be requested before the interrupt is exited. * - * @return pdTRUE if the data was successfully sent to the queue, otherwise + * @return pdPASS if the data was successfully sent to the queue, otherwise * errQUEUE_FULL. * * Example usage for buffered IO (where the ISR can obtain more than one value @@ -1070,7 +1070,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; * running task. If xQueueSendToBackFromISR() sets this value to pdTRUE then * a context switch should be requested before the interrupt is exited. * - * @return pdTRUE if the data was successfully sent to the queue, otherwise + * @return pdPASS if the data was successfully sent to the queue, otherwise * errQUEUE_FULL. * * Example usage for buffered IO (where the ISR can obtain more than one value @@ -1235,7 +1235,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; * running task. If xQueueSendFromISR() sets this value to pdTRUE then * a context switch should be requested before the interrupt is exited. * - * @return pdTRUE if the data was successfully sent to the queue, otherwise + * @return pdPASS if the data was successfully sent to the queue, otherwise * errQUEUE_FULL. * * Example usage for buffered IO (where the ISR can obtain more than one value @@ -1318,7 +1318,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; * item at the back of the queue, or queueSEND_TO_FRONT to place the item * at the front of the queue (for high priority messages). * - * @return pdTRUE if the data was successfully sent to the queue, otherwise + * @return pdPASS if the data was successfully sent to the queue, otherwise * errQUEUE_FULL. * * Example usage for buffered IO (where the ISR can obtain more than one value @@ -1389,8 +1389,8 @@ BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue, * to unblock *pxTaskWoken will get set to pdTRUE, otherwise *pxTaskWoken will * remain unchanged. * - * @return pdTRUE if an item was successfully received from the queue, - * otherwise pdFALSE. + * @return pdPASS if an item was successfully received from the queue, + * otherwise pdFAIL. * * Example usage: * @code{c} @@ -1638,14 +1638,14 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION; * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this * function. * - * A queue set must be explicitly created using a call to xQueueCreateSet() - * before it can be used. Once created, standard FreeRTOS queues and semaphores - * can be added to the set using calls to xQueueAddToSet(). - * xQueueSelectFromSet() is then used to determine which, if any, of the queues - * or semaphores contained in the set is in a state where a queue read or - * semaphore take operation would be successful. + * A queue set must be explicitly created using a call to xQueueCreateSet() or + * xQueueCreateSetStatic() before it can be used. Once created, standard + * FreeRTOS queues and semaphores can be added to the set using calls to + * xQueueAddToSet(). xQueueSelectFromSet() is then used to determine which, if + * any, of the queues or semaphores contained in the set is in a state where a + * queue read or semaphore take operation would be successful. * - * Note 1: See the documentation on https://www.FreeRTOS.org/RTOS-queue-sets.html + * Note 1: See the documentation on https://www.freertos.org/Documentation/02-Kernel/04-API-references/07-Queue-sets/00-RTOS-queue-sets * for reasons why queue sets are very rarely needed in practice as there are * simpler methods of blocking on multiple objects. * @@ -1683,9 +1683,69 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION; QueueSetHandle_t xQueueCreateSet( const UBaseType_t uxEventQueueLength ) PRIVILEGED_FUNCTION; #endif +/* + * Queue sets provide a mechanism to allow a task to block (pend) on a read + * operation from multiple queues or semaphores simultaneously. + * + * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this + * function. + * + * A queue set must be explicitly created using a call to xQueueCreateSet() + * or xQueueCreateSetStatic() before it can be used. Once created, standard + * FreeRTOS queues and semaphores can be added to the set using calls to + * xQueueAddToSet(). xQueueSelectFromSet() is then used to determine which, if + * any, of the queues or semaphores contained in the set is in a state where a + * queue read or semaphore take operation would be successful. + * + * Note 1: See the documentation on https://www.freertos.org/Documentation/02-Kernel/04-API-references/07-Queue-sets/00-RTOS-queue-sets + * for reasons why queue sets are very rarely needed in practice as there are + * simpler methods of blocking on multiple objects. + * + * Note 2: Blocking on a queue set that contains a mutex will not cause the + * mutex holder to inherit the priority of the blocked task. + * + * Note 3: An additional 4 bytes of RAM is required for each space in a every + * queue added to a queue set. Therefore counting semaphores that have a high + * maximum count value should not be added to a queue set. + * + * Note 4: A receive (in the case of a queue) or take (in the case of a + * semaphore) operation must not be performed on a member of a queue set unless + * a call to xQueueSelectFromSet() has first returned a handle to that set member. + * + * @param uxEventQueueLength Queue sets store events that occur on + * the queues and semaphores contained in the set. uxEventQueueLength specifies + * the maximum number of events that can be queued at once. To be absolutely + * certain that events are not lost uxEventQueueLength should be set to the + * total sum of the length of the queues added to the set, where binary + * semaphores and mutexes have a length of 1, and counting semaphores have a + * length set by their maximum count value. Examples: + * + If a queue set is to hold a queue of length 5, another queue of length 12, + * and a binary semaphore, then uxEventQueueLength should be set to + * (5 + 12 + 1), or 18. + * + If a queue set is to hold three binary semaphores then uxEventQueueLength + * should be set to (1 + 1 + 1 ), or 3. + * + If a queue set is to hold a counting semaphore that has a maximum count of + * 5, and a counting semaphore that has a maximum count of 3, then + * uxEventQueueLength should be set to (5 + 3), or 8. + * + * @param pucQueueStorage pucQueueStorage must point to a uint8_t array that is + * at least large enough to hold uxEventQueueLength events. + * + * @param pxQueueBuffer Must point to a variable of type StaticQueue_t, which + * will be used to hold the queue's data structure. + * + * @return If the queue set is created successfully then a handle to the created + * queue set is returned. If pxQueueBuffer is NULL then NULL is returned. + */ +#if ( ( configUSE_QUEUE_SETS == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) ) + QueueSetHandle_t xQueueCreateSetStatic( const UBaseType_t uxEventQueueLength, + uint8_t * pucQueueStorage, + StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION; +#endif + /* * Adds a queue or semaphore to a queue set that was previously created by a - * call to xQueueCreateSet(). + * call to xQueueCreateSet() or xQueueCreateSetStatic(). * * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this * function. @@ -1742,7 +1802,7 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION; * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this * function. * - * Note 1: See the documentation on https://www.FreeRTOS.org/RTOS-queue-sets.html + * Note 1: See the documentation on https://www.freertos.org/Documentation/02-Kernel/04-API-references/07-Queue-sets/00-RTOS-queue-sets * for reasons why queue sets are very rarely needed in practice as there are * simpler methods of blocking on multiple objects. * diff --git a/third-party/freertos/include/semphr.h b/third-party/freertos/include/semphr.h index 13e01339..8977acad 100644 --- a/third-party/freertos/include/semphr.h +++ b/third-party/freertos/include/semphr.h @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT diff --git a/third-party/freertos/include/stack_macros.h b/third-party/freertos/include/stack_macros.h index 393c95c8..6d011772 100644 --- a/third-party/freertos/include/stack_macros.h +++ b/third-party/freertos/include/stack_macros.h @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT @@ -53,11 +53,23 @@ #define portSTACK_LIMIT_PADDING 0 #endif -#if ( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH < 0 ) ) +/* Stack overflow check is not straight forward to implement for MPU ports + * because of the following reasons: + * 1. The context is stored in TCB and as a result, pxTopOfStack member points + * to the context location in TCB. + * 2. System calls are executed on a separate privileged only stack. + * + * It is still okay because an MPU region is used to protect task stack which + * means task stack overflow will trigger an MPU fault for unprivileged tasks. + * Additionally, architectures with hardware stack overflow checking support + * (such as Armv8-M) will trigger a fault when a task's stack overflows. + */ +#if ( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH < 0 ) && ( portUSING_MPU_WRAPPERS != 1 ) ) /* Only the current stack state is to be checked. */ #define taskCHECK_FOR_STACK_OVERFLOW() \ - do { \ + do \ + { \ /* Is the currently saved stack pointer within the stack limit? */ \ if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack + portSTACK_LIMIT_PADDING ) \ { \ @@ -69,12 +81,12 @@ #endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */ /*-----------------------------------------------------------*/ -#if ( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH > 0 ) ) +#if ( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH > 0 ) && ( portUSING_MPU_WRAPPERS != 1 ) ) /* Only the current stack state is to be checked. */ #define taskCHECK_FOR_STACK_OVERFLOW() \ - do { \ - \ + do \ + { \ /* Is the currently saved stack pointer within the stack limit? */ \ if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack - portSTACK_LIMIT_PADDING ) \ { \ @@ -86,30 +98,33 @@ #endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */ /*-----------------------------------------------------------*/ -#if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) ) +#if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) && ( portUSING_MPU_WRAPPERS != 1 ) ) - #define taskCHECK_FOR_STACK_OVERFLOW() \ - do { \ - const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \ - const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5U; \ - \ - if( ( pulStack[ 0 ] != ulCheckValue ) || \ - ( pulStack[ 1 ] != ulCheckValue ) || \ - ( pulStack[ 2 ] != ulCheckValue ) || \ - ( pulStack[ 3 ] != ulCheckValue ) ) \ - { \ - char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \ - vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \ - } \ + #define taskCHECK_FOR_STACK_OVERFLOW() \ + do \ + { \ + const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \ + const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5U; \ + \ + if( ( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack + portSTACK_LIMIT_PADDING ) || \ + ( pulStack[ 0 ] != ulCheckValue ) || \ + ( pulStack[ 1 ] != ulCheckValue ) || \ + ( pulStack[ 2 ] != ulCheckValue ) || \ + ( pulStack[ 3 ] != ulCheckValue ) ) \ + { \ + char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \ + vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \ + } \ } while( 0 ) #endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */ /*-----------------------------------------------------------*/ -#if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) ) +#if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) && ( portUSING_MPU_WRAPPERS != 1 ) ) #define taskCHECK_FOR_STACK_OVERFLOW() \ - do { \ + do \ + { \ int8_t * pcEndOfStack = ( int8_t * ) pxCurrentTCB->pxEndOfStack; \ static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ @@ -117,11 +132,10 @@ tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE }; \ \ - \ pcEndOfStack -= sizeof( ucExpectedStackBytes ); \ \ - /* Has the extremity of the task stack ever been written over? */ \ - if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \ + if( ( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack - portSTACK_LIMIT_PADDING ) || \ + ( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) ) \ { \ char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \ vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \ diff --git a/third-party/freertos/include/stdint.readme b/third-party/freertos/include/stdint.readme index 5a0822c2..bfe3bb6f 100644 --- a/third-party/freertos/include/stdint.readme +++ b/third-party/freertos/include/stdint.readme @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT diff --git a/third-party/freertos/include/stream_buffer.h b/third-party/freertos/include/stream_buffer.h index 84fde67c..b0093fc8 100644 --- a/third-party/freertos/include/stream_buffer.h +++ b/third-party/freertos/include/stream_buffer.h @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT @@ -40,12 +40,12 @@ * writer and reader to be different tasks or interrupts, but, unlike other * FreeRTOS objects, it is not safe to have multiple different writers or * multiple different readers. If there are to be multiple different writers - * then the application writer must place each call to a writing API function - * (such as xStreamBufferSend()) inside a critical section and set the send - * block time to 0. Likewise, if there are to be multiple different readers - * then the application writer must place each call to a reading API function - * (such as xStreamBufferReceive()) inside a critical section section and set the - * receive block time to 0. + * then the application writer must serialize calls to writing API functions + * (such as xStreamBufferSend()). Likewise, if there are to be multiple + * different readers then the application writer must serialize calls to reading + * API functions (such as xStreamBufferReceive()). One way to achieve such + * serialization in single core or SMP kernel is to place each API call inside a + * critical section and use a block time of 0. * */ @@ -514,12 +514,12 @@ typedef void (* StreamBufferCallbackFunction_t)( StreamBufferHandle_t xStreamBuf * writer and reader to be different tasks or interrupts, but, unlike other * FreeRTOS objects, it is not safe to have multiple different writers or * multiple different readers. If there are to be multiple different writers - * then the application writer must place each call to a writing API function - * (such as xStreamBufferSend()) inside a critical section and set the send - * block time to 0. Likewise, if there are to be multiple different readers - * then the application writer must place each call to a reading API function - * (such as xStreamBufferReceive()) inside a critical section and set the receive - * block time to 0. + * then the application writer must serialize calls to writing API functions + * (such as xStreamBufferSend()). Likewise, if there are to be multiple + * different readers then the application writer must serialize calls to reading + * API functions (such as xStreamBufferReceive()). One way to achieve such + * serialization in single core or SMP kernel is to place each API call inside a + * critical section and use a block time of 0. * * Use xStreamBufferSend() to write to a stream buffer from a task. Use * xStreamBufferSendFromISR() to write to a stream buffer from an interrupt @@ -615,12 +615,12 @@ size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer, * writer and reader to be different tasks or interrupts, but, unlike other * FreeRTOS objects, it is not safe to have multiple different writers or * multiple different readers. If there are to be multiple different writers - * then the application writer must place each call to a writing API function - * (such as xStreamBufferSend()) inside a critical section and set the send - * block time to 0. Likewise, if there are to be multiple different readers - * then the application writer must place each call to a reading API function - * (such as xStreamBufferReceive()) inside a critical section and set the receive - * block time to 0. + * then the application writer must serialize calls to writing API functions + * (such as xStreamBufferSend()). Likewise, if there are to be multiple + * different readers then the application writer must serialize calls to reading + * API functions (such as xStreamBufferReceive()). One way to achieve such + * serialization in single core or SMP kernel is to place each API call inside a + * critical section and use a block time of 0. * * Use xStreamBufferSend() to write to a stream buffer from a task. Use * xStreamBufferSendFromISR() to write to a stream buffer from an interrupt @@ -718,12 +718,12 @@ size_t xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer, * writer and reader to be different tasks or interrupts, but, unlike other * FreeRTOS objects, it is not safe to have multiple different writers or * multiple different readers. If there are to be multiple different writers - * then the application writer must place each call to a writing API function - * (such as xStreamBufferSend()) inside a critical section and set the send - * block time to 0. Likewise, if there are to be multiple different readers - * then the application writer must place each call to a reading API function - * (such as xStreamBufferReceive()) inside a critical section and set the receive - * block time to 0. + * then the application writer must serialize calls to writing API functions + * (such as xStreamBufferSend()). Likewise, if there are to be multiple + * different readers then the application writer must serialize calls to reading + * API functions (such as xStreamBufferReceive()). One way to achieve such + * serialization in single core or SMP kernel is to place each API call inside a + * critical section and use a block time of 0. * * Use xStreamBufferReceive() to read from a stream buffer from a task. Use * xStreamBufferReceiveFromISR() to read from a stream buffer from an diff --git a/third-party/freertos/include/task.h b/third-party/freertos/include/task.h index d9639a1c..a25740e3 100644 --- a/third-party/freertos/include/task.h +++ b/third-party/freertos/include/task.h @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT @@ -53,30 +53,33 @@ * The tskKERNEL_VERSION_MAJOR, tskKERNEL_VERSION_MINOR, tskKERNEL_VERSION_BUILD * values will reflect the last released version number. */ -#define tskKERNEL_VERSION_NUMBER "11.1.0" -#define tskKERNEL_VERSION_MAJOR 11 -#define tskKERNEL_VERSION_MINOR 1 -#define tskKERNEL_VERSION_BUILD 0 +#define tskKERNEL_VERSION_NUMBER "V11.1.0+" +#define tskKERNEL_VERSION_MAJOR 11 +#define tskKERNEL_VERSION_MINOR 1 +#define tskKERNEL_VERSION_BUILD 0 /* MPU region parameters passed in ulParameters * of MemoryRegion_t struct. */ -#define tskMPU_REGION_READ_ONLY ( 1U << 0U ) -#define tskMPU_REGION_READ_WRITE ( 1U << 1U ) -#define tskMPU_REGION_EXECUTE_NEVER ( 1U << 2U ) -#define tskMPU_REGION_NORMAL_MEMORY ( 1U << 3U ) -#define tskMPU_REGION_DEVICE_MEMORY ( 1U << 4U ) +#define tskMPU_REGION_READ_ONLY ( 1U << 0U ) +#define tskMPU_REGION_READ_WRITE ( 1U << 1U ) +#define tskMPU_REGION_EXECUTE_NEVER ( 1U << 2U ) +#define tskMPU_REGION_NORMAL_MEMORY ( 1U << 3U ) +#define tskMPU_REGION_DEVICE_MEMORY ( 1U << 4U ) +#if defined( portARMV8M_MINOR_VERSION ) && ( portARMV8M_MINOR_VERSION >= 1 ) + #define tskMPU_REGION_PRIVILEGED_EXECUTE_NEVER ( 1U << 5U ) +#endif /* portARMV8M_MINOR_VERSION >= 1 */ /* MPU region permissions stored in MPU settings to * authorize access requests. */ -#define tskMPU_READ_PERMISSION ( 1U << 0U ) -#define tskMPU_WRITE_PERMISSION ( 1U << 1U ) +#define tskMPU_READ_PERMISSION ( 1U << 0U ) +#define tskMPU_WRITE_PERMISSION ( 1U << 1U ) /* The direct to task notification feature used to have only a single notification * per task. Now there is an array of notifications per task that is dimensioned by * configTASK_NOTIFICATION_ARRAY_ENTRIES. For backward compatibility, any use of the * original direct to task notification defaults to using the first index in the * array. */ -#define tskDEFAULT_INDEX_TO_NOTIFY ( 0 ) +#define tskDEFAULT_INDEX_TO_NOTIFY ( 0 ) /** * task. h @@ -161,7 +164,7 @@ typedef struct xTASK_STATUS { TaskHandle_t xHandle; /* The handle of the task to which the rest of the information in the structure relates. */ const char * pcTaskName; /* A pointer to the task's name. This value will be invalid if the task was deleted since the structure was populated! */ - UBaseType_t xTaskNumber; /* A number unique to the task. */ + UBaseType_t xTaskNumber; /* A number unique to the task. Note that this is not the task number that may be modified using vTaskSetTaskNumber() and uxTaskGetTaskNumber(), but a separate TCB-specific and unique identifier automatically assigned on task generation. */ eTaskState eCurrentState; /* The state in which the task existed when the structure was populated. */ UBaseType_t uxCurrentPriority; /* The priority at which the task was running (may be inherited) when the structure was populated. */ UBaseType_t uxBasePriority; /* The priority to which the task will return if the task's current priority has been inherited to avoid unbounded priority inversion when obtaining a mutex. Only valid if configUSE_MUTEXES is defined as 1 in FreeRTOSConfig.h. */ @@ -2196,8 +2199,8 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; * Lists all the current tasks, along with their current state and stack * usage high water mark. * - * Tasks are reported as blocked ('B'), ready ('R'), deleted ('D') or - * suspended ('S'). + * Tasks are reported as running ('X'), blocked ('B'), ready ('R'), deleted ('D') + * or suspended ('S'). * * PLEASE NOTE: * @@ -2205,8 +2208,16 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; * demo applications. Do not consider it to be part of the scheduler. * * vTaskListTasks() calls uxTaskGetSystemState(), then formats part of the - * uxTaskGetSystemState() output into a human readable table that displays task: - * names, states, priority, stack usage and task number. + * uxTaskGetSystemState() output into a human readable table that displays task + * information in the following format: + * Task Name, Task State, Task Priority, Task Stack High Watermak, Task Number. + * + * The following is a sample output: + * Task A X 2 67 2 + * Task B R 1 67 3 + * IDLE R 0 67 5 + * Tmr Svc B 6 137 6 + * * Stack usage specified as the number of unused StackType_t words stack can hold * on top of stack - not the number of bytes. * @@ -2257,8 +2268,8 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; * Lists all the current tasks, along with their current state and stack * usage high water mark. * - * Tasks are reported as blocked ('B'), ready ('R'), deleted ('D') or - * suspended ('S'). + * Tasks are reported as running ('X'), blocked ('B'), ready ('R'), deleted ('D') + * or suspended ('S'). * * PLEASE NOTE: * @@ -2266,8 +2277,16 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; * demo applications. Do not consider it to be part of the scheduler. * * vTaskList() calls uxTaskGetSystemState(), then formats part of the - * uxTaskGetSystemState() output into a human readable table that displays task: - * names, states, priority, stack usage and task number. + * uxTaskGetSystemState() output into a human readable table that displays task + * information in the following format: + * Task Name, Task State, Task Priority, Task Stack High Watermak, Task Number. + * + * The following is a sample output: + * Task A X 2 67 2 + * Task B R 1 67 3 + * IDLE R 0 67 5 + * Tmr Svc B 6 137 6 + * * Stack usage specified as the number of unused StackType_t words stack can hold * on top of stack - not the number of bytes. * @@ -2369,7 +2388,7 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; * * WARN: This function assumes that the pcWriteBuffer is of length * configSTATS_BUFFER_MAX_LENGTH. This function is there only for - * backward compatiblity. New applications are recommended to use + * backward compatibility. New applications are recommended to use * vTaskGetRunTimeStatistics and supply the length of the pcWriteBuffer * explicitly. * diff --git a/third-party/freertos/include/timers.h b/third-party/freertos/include/timers.h index e12a424e..7d99d353 100644 --- a/third-party/freertos/include/timers.h +++ b/third-party/freertos/include/timers.h @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT @@ -737,14 +737,18 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void ) PRIVILEGED_FUNCTION; * // The key press event handler. * void vKeyPressEventHandler( char cKey ) * { - * // Ensure the LCD back-light is on, then reset the timer that is - * // responsible for turning the back-light off after 5 seconds of - * // key inactivity. Wait 10 ticks for the command to be successfully sent - * // if it cannot be sent immediately. - * vSetBacklightState( BACKLIGHT_ON ); - * if( xTimerReset( xBacklightTimer, 100 ) != pdPASS ) + * // Reset the timer that is responsible for turning the back-light off after + * // 5 seconds of key inactivity. Wait 10 ticks for the command to be + * // successfully sent if it cannot be sent immediately. + * if( xTimerReset( xBacklightTimer, 10 ) == pdPASS ) * { - * // The reset command was not executed successfully. Take appropriate + * // Turn on the LCD back-light. It will be turned off in the + * // vBacklightTimerCallback after 5 seconds of key inactivity. + * vSetBacklightState( BACKLIGHT_ON ); + * } + * else + * { + * // The reset command was not executed successfully. Take appropriate * // action here. * } * @@ -753,16 +757,15 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void ) PRIVILEGED_FUNCTION; * * void main( void ) * { - * int32_t x; * * // Create then start the one-shot timer that is responsible for turning * // the back-light off if no keys are pressed within a 5 second period. * xBacklightTimer = xTimerCreate( "BacklightTimer", // Just a text name, not used by the kernel. - * ( 5000 / portTICK_PERIOD_MS), // The timer period in ticks. + * pdMS_TO_TICKS( 5000 ), // The timer period in ticks. * pdFALSE, // The timer is a one-shot timer. * 0, // The id is not used by the callback so can take any value. * vBacklightTimerCallback // The callback function that switches the LCD back-light off. - * ); + * ); * * if( xBacklightTimer == NULL ) * { diff --git a/third-party/freertos/list.c b/third-party/freertos/list.c index 62271064..0c0f3676 100644 --- a/third-party/freertos/list.c +++ b/third-party/freertos/list.c @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT @@ -166,7 +166,7 @@ void vListInsert( List_t * const pxList, { /* *** NOTE *********************************************************** * If you find your application is crashing here then likely causes are - * listed below. In addition see https://www.FreeRTOS.org/FAQHelp.html for + * listed below. In addition see https://www.freertos.org/Why-FreeRTOS/FAQs for * more tips, and ensure configASSERT() is defined! * https://www.FreeRTOS.org/a00110.html#configASSERT * @@ -192,7 +192,9 @@ void vListInsert( List_t * const pxList, for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext ) { /* There is nothing to do here, just iterating to the wanted - * insertion position. */ + * insertion position. + * IF YOU FIND YOUR CODE STUCK HERE, SEE THE NOTE JUST ABOVE. + */ } } diff --git a/third-party/freertos/queue.c b/third-party/freertos/queue.c index f91841f9..fe06368d 100644 --- a/third-party/freertos/queue.c +++ b/third-party/freertos/queue.c @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT @@ -247,7 +247,7 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength, * other tasks that are waiting for the same mutex. This function returns * that priority. */ - static UBaseType_t prvGetDisinheritPriorityAfterTimeout( const Queue_t * const pxQueue ) PRIVILEGED_FUNCTION; + static UBaseType_t prvGetHighestPriorityOfWaitToReceiveList( const Queue_t * const pxQueue ) PRIVILEGED_FUNCTION; #endif /*-----------------------------------------------------------*/ @@ -418,7 +418,7 @@ BaseType_t xQueueGenericReset( QueueHandle_t xQueue, #if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) { - /* Queues can be allocated wither statically or dynamically, so + /* Queues can be allocated either statically or dynamically, so * note this queue was allocated statically in case the queue is * later deleted. */ pxNewQueue->ucStaticallyAllocated = pdTRUE; @@ -513,7 +513,10 @@ BaseType_t xQueueGenericReset( QueueHandle_t xQueue, /* Check for multiplication overflow. */ ( ( SIZE_MAX / uxQueueLength ) >= uxItemSize ) && /* Check for addition overflow. */ - ( ( UBaseType_t ) ( SIZE_MAX - sizeof( Queue_t ) ) >= ( uxQueueLength * uxItemSize ) ) ) + /* MISRA Ref 14.3.1 [Configuration dependent invariant] */ + /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-143. */ + /* coverity[misra_c_2012_rule_14_3_violation] */ + ( ( SIZE_MAX - sizeof( Queue_t ) ) >= ( size_t ) ( ( size_t ) uxQueueLength * ( size_t ) uxItemSize ) ) ) { /* Allocate enough space to hold the maximum number of items that * can be in the queue at any time. It is valid for uxItemSize to be @@ -830,6 +833,10 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength, if( pxMutex->u.xSemaphore.xMutexHolder == xTaskGetCurrentTaskHandle() ) { ( pxMutex->u.xSemaphore.uxRecursiveCallCount )++; + + /* Check if an overflow occurred. */ + configASSERT( pxMutex->u.xSemaphore.uxRecursiveCallCount ); + xReturn = pdPASS; } else @@ -842,6 +849,9 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength, if( xReturn != pdFAIL ) { ( pxMutex->u.xSemaphore.uxRecursiveCallCount )++; + + /* Check if an overflow occurred. */ + configASSERT( pxMutex->u.xSemaphore.uxRecursiveCallCount ); } else { @@ -1844,13 +1854,13 @@ BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue, * has timed out the priority should be disinherited * again, but only as low as the next highest priority * task that is waiting for the same mutex. */ - uxHighestWaitingPriority = prvGetDisinheritPriorityAfterTimeout( pxQueue ); + uxHighestWaitingPriority = prvGetHighestPriorityOfWaitToReceiveList( pxQueue ); /* vTaskPriorityDisinheritAfterTimeout uses the uxHighestWaitingPriority * parameter to index pxReadyTasksLists when adding the task holding * mutex to the ready list for its new priority. Coverity thinks that * it can result in out-of-bounds access which is not true because - * uxHighestWaitingPriority, as returned by prvGetDisinheritPriorityAfterTimeout, + * uxHighestWaitingPriority, as returned by prvGetHighestPriorityOfWaitToReceiveList, * is capped at ( configMAX_PRIORITIES - 1 ). */ /* coverity[overrun] */ vTaskPriorityDisinheritAfterTimeout( pxQueue->u.xSemaphore.xMutexHolder, uxHighestWaitingPriority ); @@ -2202,11 +2212,11 @@ UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue ) configASSERT( xQueue ); - taskENTER_CRITICAL(); + portBASE_TYPE_ENTER_CRITICAL(); { uxReturn = ( ( Queue_t * ) xQueue )->uxMessagesWaiting; } - taskEXIT_CRITICAL(); + portBASE_TYPE_EXIT_CRITICAL(); traceRETURN_uxQueueMessagesWaiting( uxReturn ); @@ -2223,11 +2233,11 @@ UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue ) configASSERT( pxQueue ); - taskENTER_CRITICAL(); + portBASE_TYPE_ENTER_CRITICAL(); { uxReturn = ( UBaseType_t ) ( pxQueue->uxLength - pxQueue->uxMessagesWaiting ); } - taskEXIT_CRITICAL(); + portBASE_TYPE_EXIT_CRITICAL(); traceRETURN_uxQueueSpacesAvailable( uxReturn ); @@ -2362,7 +2372,7 @@ UBaseType_t uxQueueGetQueueLength( QueueHandle_t xQueue ) /* PRIVILEGED_FUNCTION #if ( configUSE_MUTEXES == 1 ) - static UBaseType_t prvGetDisinheritPriorityAfterTimeout( const Queue_t * const pxQueue ) + static UBaseType_t prvGetHighestPriorityOfWaitToReceiveList( const Queue_t * const pxQueue ) { UBaseType_t uxHighestPriorityOfWaitingTasks; @@ -3186,7 +3196,27 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue ) return pxQueue; } -#endif /* configUSE_QUEUE_SETS */ +#endif /* #if ( ( configUSE_QUEUE_SETS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) */ +/*-----------------------------------------------------------*/ + +#if ( ( configUSE_QUEUE_SETS == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) ) + + QueueSetHandle_t xQueueCreateSetStatic( const UBaseType_t uxEventQueueLength, + uint8_t * pucQueueStorage, + StaticQueue_t * pxStaticQueue ) + { + QueueSetHandle_t pxQueue; + + traceENTER_xQueueCreateSetStatic( uxEventQueueLength ); + + pxQueue = xQueueGenericCreateStatic( uxEventQueueLength, ( UBaseType_t ) sizeof( Queue_t * ), pucQueueStorage, pxStaticQueue, queueQUEUE_TYPE_SET ); + + traceRETURN_xQueueCreateSetStatic( pxQueue ); + + return pxQueue; + } + +#endif /* #if ( ( configUSE_QUEUE_SETS == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) ) */ /*-----------------------------------------------------------*/ #if ( configUSE_QUEUE_SETS == 1 ) diff --git a/third-party/freertos/stream_buffer.c b/third-party/freertos/stream_buffer.c index 6decfed6..b1f9c0d5 100644 --- a/third-party/freertos/stream_buffer.c +++ b/third-party/freertos/stream_buffer.c @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT @@ -39,14 +39,6 @@ #include "task.h" #include "stream_buffer.h" -#if ( configUSE_TASK_NOTIFICATIONS != 1 ) - #error configUSE_TASK_NOTIFICATIONS must be set to 1 to build stream_buffer.c -#endif - -#if ( INCLUDE_xTaskGetCurrentTaskHandle != 1 ) - #error INCLUDE_xTaskGetCurrentTaskHandle must be set to 1 to build stream_buffer.c -#endif - /* The MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined * for the header files above, but not in this file, in order to generate the * correct privileged Vs unprivileged linkage and placement. */ @@ -58,6 +50,14 @@ * configUSE_STREAM_BUFFERS is set to 1 in FreeRTOSConfig.h. */ #if ( configUSE_STREAM_BUFFERS == 1 ) + #if ( configUSE_TASK_NOTIFICATIONS != 1 ) + #error configUSE_TASK_NOTIFICATIONS must be set to 1 to build stream_buffer.c + #endif + + #if ( INCLUDE_xTaskGetCurrentTaskHandle != 1 ) + #error INCLUDE_xTaskGetCurrentTaskHandle must be set to 1 to build stream_buffer.c + #endif + /* If the user has not provided application specific Rx notification macros, * or #defined the notification macros away, then provide default implementations * that uses task notifications. */ diff --git a/third-party/freertos/tasks.c b/third-party/freertos/tasks.c index fd3bc638..24cfb262 100644 --- a/third-party/freertos/tasks.c +++ b/third-party/freertos/tasks.c @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT @@ -156,6 +156,22 @@ #define configIDLE_TASK_NAME "IDLE" #endif +/* Reserve space for Core ID and null termination. */ +#if ( configNUMBER_OF_CORES > 1 ) + /* Multi-core systems with up to 9 cores require 1 character for core ID and 1 for null termination. */ + #if ( configMAX_TASK_NAME_LEN < 2U ) + #error Minimum required task name length is 2. Please increase configMAX_TASK_NAME_LEN. + #endif + #define taskRESERVED_TASK_NAME_LENGTH 2U + +#else /* if ( configNUMBER_OF_CORES > 1 ) */ + /* Reserve space for null termination. */ + #if ( configMAX_TASK_NAME_LEN < 1U ) + #error Minimum required task name length is 1. Please increase configMAX_TASK_NAME_LEN. + #endif + #define taskRESERVED_TASK_NAME_LENGTH 1U +#endif /* if ( ( configNUMBER_OF_CORES > 1 ) */ + #if ( configUSE_PORT_OPTIMISED_TASK_SELECTION == 0 ) /* If configUSE_PORT_OPTIMISED_TASK_SELECTION is 0 then task selection is @@ -317,10 +333,10 @@ #define taskATTRIBUTE_IS_IDLE ( UBaseType_t ) ( 1U << 0U ) #if ( ( configNUMBER_OF_CORES > 1 ) && ( portCRITICAL_NESTING_IN_TCB == 1 ) ) - #define portGET_CRITICAL_NESTING_COUNT() ( pxCurrentTCBs[ portGET_CORE_ID() ]->uxCriticalNesting ) - #define portSET_CRITICAL_NESTING_COUNT( x ) ( pxCurrentTCBs[ portGET_CORE_ID() ]->uxCriticalNesting = ( x ) ) - #define portINCREMENT_CRITICAL_NESTING_COUNT() ( pxCurrentTCBs[ portGET_CORE_ID() ]->uxCriticalNesting++ ) - #define portDECREMENT_CRITICAL_NESTING_COUNT() ( pxCurrentTCBs[ portGET_CORE_ID() ]->uxCriticalNesting-- ) + #define portGET_CRITICAL_NESTING_COUNT( xCoreID ) ( pxCurrentTCBs[ ( xCoreID ) ]->uxCriticalNesting ) + #define portSET_CRITICAL_NESTING_COUNT( xCoreID, x ) ( pxCurrentTCBs[ ( xCoreID ) ]->uxCriticalNesting = ( x ) ) + #define portINCREMENT_CRITICAL_NESTING_COUNT( xCoreID ) ( pxCurrentTCBs[ ( xCoreID ) ]->uxCriticalNesting++ ) + #define portDECREMENT_CRITICAL_NESTING_COUNT( xCoreID ) ( pxCurrentTCBs[ ( xCoreID ) ]->uxCriticalNesting-- ) #endif /* #if ( ( configNUMBER_OF_CORES > 1 ) && ( portCRITICAL_NESTING_IN_TCB == 1 ) ) */ #define taskBITS_PER_BYTE ( ( size_t ) 8 ) @@ -662,7 +678,8 @@ static void prvAddCurrentTaskToDelayedList( TickType_t xTicksToWait, /* * Return the amount of time, in ticks, that will pass before the kernel will - * next move a task from the Blocked state to the Running state. + * next move a task from the Blocked state to the Running state or before the + * tick count overflows (whichever is earlier). * * This conditional compilation should use inequality to 0, not equality to 1. * This is to ensure portSUPPRESS_TICKS_AND_SLEEP() can be called when user @@ -806,13 +823,14 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION; { UBaseType_t uxPrevCriticalNesting; const TCB_t * pxThisTCB; + BaseType_t xCoreID = ( BaseType_t ) portGET_CORE_ID(); /* This must only be called from within a task. */ portASSERT_IF_IN_ISR(); /* This function is always called with interrupts disabled * so this is safe. */ - pxThisTCB = pxCurrentTCBs[ portGET_CORE_ID() ]; + pxThisTCB = pxCurrentTCBs[ xCoreID ]; while( pxThisTCB->xTaskRunState == taskTASK_SCHEDULED_TO_YIELD ) { @@ -824,12 +842,12 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION; * the suspension and critical nesting counts, as well as release * and reacquire the correct locks. And then, do it all over again * if our state changed again during the reacquisition. */ - uxPrevCriticalNesting = portGET_CRITICAL_NESTING_COUNT(); + uxPrevCriticalNesting = portGET_CRITICAL_NESTING_COUNT( xCoreID ); if( uxPrevCriticalNesting > 0U ) { - portSET_CRITICAL_NESTING_COUNT( 0U ); - portRELEASE_ISR_LOCK(); + portSET_CRITICAL_NESTING_COUNT( xCoreID, 0U ); + portRELEASE_ISR_LOCK( xCoreID ); } else { @@ -838,26 +856,29 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION; mtCOVERAGE_TEST_MARKER(); } - portRELEASE_TASK_LOCK(); + portRELEASE_TASK_LOCK( xCoreID ); portMEMORY_BARRIER(); configASSERT( pxThisTCB->xTaskRunState == taskTASK_SCHEDULED_TO_YIELD ); portENABLE_INTERRUPTS(); - /* Enabling interrupts should cause this core to immediately - * service the pending interrupt and yield. If the run state is still - * yielding here then that is a problem. */ - configASSERT( pxThisTCB->xTaskRunState != taskTASK_SCHEDULED_TO_YIELD ); + /* Enabling interrupts should cause this core to immediately service + * the pending interrupt and yield. After servicing the pending interrupt, + * the task needs to re-evaluate its run state within this loop, as + * other cores may have requested this task to yield, potentially altering + * its run state. */ portDISABLE_INTERRUPTS(); - portGET_TASK_LOCK(); - portGET_ISR_LOCK(); - portSET_CRITICAL_NESTING_COUNT( uxPrevCriticalNesting ); + xCoreID = ( BaseType_t ) portGET_CORE_ID(); + portGET_TASK_LOCK( xCoreID ); + portGET_ISR_LOCK( xCoreID ); + + portSET_CRITICAL_NESTING_COUNT( xCoreID, uxPrevCriticalNesting ); if( uxPrevCriticalNesting == 0U ) { - portRELEASE_ISR_LOCK(); + portRELEASE_ISR_LOCK( xCoreID ); } } } @@ -872,13 +893,14 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION; BaseType_t xCurrentCoreTaskPriority; BaseType_t xLowestPriorityCore = ( BaseType_t ) -1; BaseType_t xCoreID; + const BaseType_t xCurrentCoreID = portGET_CORE_ID(); #if ( configRUN_MULTIPLE_PRIORITIES == 0 ) BaseType_t xYieldCount = 0; #endif /* #if ( configRUN_MULTIPLE_PRIORITIES == 0 ) */ /* This must be called from a critical section. */ - configASSERT( portGET_CRITICAL_NESTING_COUNT() > 0U ); + configASSERT( portGET_CRITICAL_NESTING_COUNT( xCurrentCoreID ) > 0U ); #if ( configRUN_MULTIPLE_PRIORITIES == 0 ) @@ -967,11 +989,11 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION; #if ( configRUN_MULTIPLE_PRIORITIES == 0 ) /* Verify that the calling core always yields to higher priority tasks. */ - if( ( ( pxCurrentTCBs[ portGET_CORE_ID() ]->uxTaskAttributes & taskATTRIBUTE_IS_IDLE ) == 0U ) && - ( pxTCB->uxPriority > pxCurrentTCBs[ portGET_CORE_ID() ]->uxPriority ) ) + if( ( ( pxCurrentTCBs[ xCurrentCoreID ]->uxTaskAttributes & taskATTRIBUTE_IS_IDLE ) == 0U ) && + ( pxTCB->uxPriority > pxCurrentTCBs[ xCurrentCoreID ]->uxPriority ) ) { - configASSERT( ( xYieldPendings[ portGET_CORE_ID() ] == pdTRUE ) || - ( taskTASK_IS_RUNNING( pxCurrentTCBs[ portGET_CORE_ID() ] ) == pdFALSE ) ); + configASSERT( ( xYieldPendings[ xCurrentCoreID ] == pdTRUE ) || + ( taskTASK_IS_RUNNING( pxCurrentTCBs[ xCurrentCoreID ] ) == pdFALSE ) ); } #endif } @@ -1994,7 +2016,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode, pxNewTCB->xTaskRunState = taskTASK_NOT_RUNNING; /* Is this an idle task? */ - if( ( ( TaskFunction_t ) pxTaskCode == ( TaskFunction_t ) prvIdleTask ) || ( ( TaskFunction_t ) pxTaskCode == ( TaskFunction_t ) prvPassiveIdleTask ) ) + if( ( ( TaskFunction_t ) pxTaskCode == ( TaskFunction_t ) ( &prvIdleTask ) ) || ( ( TaskFunction_t ) pxTaskCode == ( TaskFunction_t ) ( &prvPassiveIdleTask ) ) ) { pxNewTCB->uxTaskAttributes |= taskATTRIBUTE_IS_IDLE; } @@ -2201,6 +2223,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode, /* If null is passed in here then it is the calling task that is * being deleted. */ pxTCB = prvGetTCBFromHandle( xTaskToDelete ); + configASSERT( pxTCB != NULL ); /* Remove task from the ready/delayed list. */ if( uxListRemove( &( pxTCB->xStateListItem ) ) == ( UBaseType_t ) 0 ) @@ -2493,7 +2516,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode, traceENTER_eTaskGetState( xTask ); - configASSERT( pxTCB ); + configASSERT( pxTCB != NULL ); #if ( configNUMBER_OF_CORES == 1 ) if( pxTCB == pxCurrentTCB ) @@ -2621,14 +2644,16 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode, traceENTER_uxTaskPriorityGet( xTask ); - taskENTER_CRITICAL(); + portBASE_TYPE_ENTER_CRITICAL(); { /* If null is passed in here then it is the priority of the task * that called uxTaskPriorityGet() that is being queried. */ pxTCB = prvGetTCBFromHandle( xTask ); + configASSERT( pxTCB != NULL ); + uxReturn = pxTCB->uxPriority; } - taskEXIT_CRITICAL(); + portBASE_TYPE_EXIT_CRITICAL(); traceRETURN_uxTaskPriorityGet( uxReturn ); @@ -2674,6 +2699,8 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode, /* If null is passed in here then it is the priority of the calling * task that is being queried. */ pxTCB = prvGetTCBFromHandle( xTask ); + configASSERT( pxTCB != NULL ); + uxReturn = pxTCB->uxPriority; } taskEXIT_CRITICAL_FROM_ISR( uxSavedInterruptStatus ); @@ -2695,14 +2722,16 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode, traceENTER_uxTaskBasePriorityGet( xTask ); - taskENTER_CRITICAL(); + portBASE_TYPE_ENTER_CRITICAL(); { /* If null is passed in here then it is the base priority of the task * that called uxTaskBasePriorityGet() that is being queried. */ pxTCB = prvGetTCBFromHandle( xTask ); + configASSERT( pxTCB != NULL ); + uxReturn = pxTCB->uxBasePriority; } - taskEXIT_CRITICAL(); + portBASE_TYPE_EXIT_CRITICAL(); traceRETURN_uxTaskBasePriorityGet( uxReturn ); @@ -2748,6 +2777,8 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode, /* If null is passed in here then it is the base priority of the calling * task that is being queried. */ pxTCB = prvGetTCBFromHandle( xTask ); + configASSERT( pxTCB != NULL ); + uxReturn = pxTCB->uxBasePriority; } taskEXIT_CRITICAL_FROM_ISR( uxSavedInterruptStatus ); @@ -2792,6 +2823,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode, /* If null is passed in here then it is the priority of the calling * task that is being changed. */ pxTCB = prvGetTCBFromHandle( xTask ); + configASSERT( pxTCB != NULL ); traceTASK_PRIORITY_SET( pxTCB, uxNewPriority ); @@ -2980,19 +3012,14 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode, { TCB_t * pxTCB; BaseType_t xCoreID; - UBaseType_t uxPrevCoreAffinityMask; - - #if ( configUSE_PREEMPTION == 1 ) - UBaseType_t uxPrevNotAllowedCores; - #endif traceENTER_vTaskCoreAffinitySet( xTask, uxCoreAffinityMask ); taskENTER_CRITICAL(); { pxTCB = prvGetTCBFromHandle( xTask ); + configASSERT( pxTCB != NULL ); - uxPrevCoreAffinityMask = pxTCB->uxCoreAffinityMask; pxTCB->uxCoreAffinityMask = uxCoreAffinityMask; if( xSchedulerRunning != pdFALSE ) @@ -3012,17 +3039,14 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode, { #if ( configUSE_PREEMPTION == 1 ) { - /* Calculate the cores on which this task was not allowed to - * run previously. */ - uxPrevNotAllowedCores = ( ~uxPrevCoreAffinityMask ) & ( ( 1U << configNUMBER_OF_CORES ) - 1U ); - - /* Does the new core mask enables this task to run on any of the - * previously not allowed cores? If yes, check if this task can be - * scheduled on any of those cores. */ - if( ( uxPrevNotAllowedCores & uxCoreAffinityMask ) != 0U ) - { - prvYieldForTask( pxTCB ); - } + /* The SMP scheduler requests a core to yield when a ready + * task is able to run. It is possible that the core affinity + * of the ready task is changed before the requested core + * can select it to run. In that case, the task may not be + * selected by the previously requested core due to core affinity + * constraint and the SMP scheduler must select a new core to + * yield for the task. */ + prvYieldForTask( xTask ); } #else /* #if( configUSE_PREEMPTION == 1 ) */ { @@ -3047,12 +3071,14 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode, traceENTER_vTaskCoreAffinityGet( xTask ); - taskENTER_CRITICAL(); + portBASE_TYPE_ENTER_CRITICAL(); { pxTCB = prvGetTCBFromHandle( xTask ); + configASSERT( pxTCB != NULL ); + uxCoreAffinityMask = pxTCB->uxCoreAffinityMask; } - taskEXIT_CRITICAL(); + portBASE_TYPE_EXIT_CRITICAL(); traceRETURN_vTaskCoreAffinityGet( uxCoreAffinityMask ); @@ -3073,6 +3099,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode, taskENTER_CRITICAL(); { pxTCB = prvGetTCBFromHandle( xTask ); + configASSERT( pxTCB != NULL ); pxTCB->xPreemptionDisable = pdTRUE; } @@ -3096,6 +3123,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode, taskENTER_CRITICAL(); { pxTCB = prvGetTCBFromHandle( xTask ); + configASSERT( pxTCB != NULL ); pxTCB->xPreemptionDisable = pdFALSE; @@ -3129,6 +3157,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode, /* If null is passed in here then it is the running task that is * being suspended. */ pxTCB = prvGetTCBFromHandle( xTaskToSuspend ); + configASSERT( pxTCB != NULL ); traceTASK_SUSPEND( pxTCB ); @@ -3512,17 +3541,20 @@ static BaseType_t prvCreateIdleTasks( void ) { BaseType_t xReturn = pdPASS; BaseType_t xCoreID; - char cIdleName[ configMAX_TASK_NAME_LEN ]; + char cIdleName[ configMAX_TASK_NAME_LEN ] = { 0 }; TaskFunction_t pxIdleTaskFunction = NULL; - BaseType_t xIdleTaskNameIndex; + UBaseType_t xIdleTaskNameIndex; - for( xIdleTaskNameIndex = ( BaseType_t ) 0; xIdleTaskNameIndex < ( BaseType_t ) configMAX_TASK_NAME_LEN; xIdleTaskNameIndex++ ) + /* MISRA Ref 14.3.1 [Configuration dependent invariant] */ + /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-143. */ + /* coverity[misra_c_2012_rule_14_3_violation] */ + for( xIdleTaskNameIndex = 0U; xIdleTaskNameIndex < ( configMAX_TASK_NAME_LEN - taskRESERVED_TASK_NAME_LENGTH ); xIdleTaskNameIndex++ ) { + /* MISRA Ref 18.1.1 [Configuration dependent bounds checking] */ + /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-181. */ + /* coverity[misra_c_2012_rule_18_1_violation] */ cIdleName[ xIdleTaskNameIndex ] = configIDLE_TASK_NAME[ xIdleTaskNameIndex ]; - /* Don't copy all configMAX_TASK_NAME_LEN if the string is shorter than - * configMAX_TASK_NAME_LEN characters just in case the memory after the - * string is not accessible (extremely unlikely). */ if( cIdleName[ xIdleTaskNameIndex ] == ( char ) 0x00 ) { break; @@ -3533,12 +3565,15 @@ static BaseType_t prvCreateIdleTasks( void ) } } + /* Ensure null termination. */ + cIdleName[ xIdleTaskNameIndex ] = '\0'; + /* Add each idle task at the lowest priority. */ for( xCoreID = ( BaseType_t ) 0; xCoreID < ( BaseType_t ) configNUMBER_OF_CORES; xCoreID++ ) { #if ( configNUMBER_OF_CORES == 1 ) { - pxIdleTaskFunction = prvIdleTask; + pxIdleTaskFunction = &prvIdleTask; } #else /* #if ( configNUMBER_OF_CORES == 1 ) */ { @@ -3547,11 +3582,11 @@ static BaseType_t prvCreateIdleTasks( void ) * run when no other task is available to run. */ if( xCoreID == 0 ) { - pxIdleTaskFunction = prvIdleTask; + pxIdleTaskFunction = &prvIdleTask; } else { - pxIdleTaskFunction = prvPassiveIdleTask; + pxIdleTaskFunction = &prvPassiveIdleTask; } } #endif /* #if ( configNUMBER_OF_CORES == 1 ) */ @@ -3561,25 +3596,14 @@ static BaseType_t prvCreateIdleTasks( void ) * only one idle task. */ #if ( configNUMBER_OF_CORES > 1 ) { - /* Append the idle task number to the end of the name if there is space. */ - if( xIdleTaskNameIndex < ( BaseType_t ) configMAX_TASK_NAME_LEN ) - { - cIdleName[ xIdleTaskNameIndex ] = ( char ) ( xCoreID + '0' ); - - /* And append a null character if there is space. */ - if( ( xIdleTaskNameIndex + 1 ) < ( BaseType_t ) configMAX_TASK_NAME_LEN ) - { - cIdleName[ xIdleTaskNameIndex + 1 ] = '\0'; - } - else - { - mtCOVERAGE_TEST_MARKER(); - } - } - else - { - mtCOVERAGE_TEST_MARKER(); - } + /* Append the idle task number to the end of the name. + * + * Note: Idle task name index only supports single-character + * core IDs (0-9). If the core ID exceeds 9, the idle task + * name will contain an incorrect ASCII character. This is + * acceptable as the task name is used mainly for debugging. */ + cIdleName[ xIdleTaskNameIndex ] = ( char ) ( xCoreID + '0' ); + cIdleName[ xIdleTaskNameIndex + 1U ] = '\0'; } #endif /* if ( configNUMBER_OF_CORES > 1 ) */ @@ -3637,7 +3661,7 @@ static BaseType_t prvCreateIdleTasks( void ) #endif /* configSUPPORT_STATIC_ALLOCATION */ /* Break the loop if any of the idle task is failed to be created. */ - if( xReturn == pdFAIL ) + if( xReturn != pdPASS ) { break; } @@ -3731,6 +3755,8 @@ void vTaskStartScheduler( void ) traceTASK_SWITCHED_IN(); + traceSTARTING_SCHEDULER( xIdleTaskHandles ); + /* Setting up the timer tick is hardware specific and thus in the * portable interface. */ @@ -3815,9 +3841,30 @@ void vTaskSuspendAll( void ) #if ( configNUMBER_OF_CORES == 1 ) { /* A critical section is not required as the variable is of type - * BaseType_t. Please read Richard Barry's reply in the following link to a - * post in the FreeRTOS support forum before reporting this as a bug! - - * https://goo.gl/wu4acr */ + * BaseType_t. Each task maintains its own context, and a context switch + * cannot occur if the variable is non zero. So, as long as the writing + * from the register back into the memory is atomic, it is not a + * problem. + * + * Consider the following scenario, which starts with + * uxSchedulerSuspended at zero. + * + * 1. load uxSchedulerSuspended into register. + * 2. Now a context switch causes another task to run, and the other + * task uses the same variable. The other task will see the variable + * as zero because the variable has not yet been updated by the + * original task. Eventually the original task runs again. **That can + * only happen when uxSchedulerSuspended is once again zero**. When + * the original task runs again, the contents of the CPU registers + * are restored to exactly how they were when it was switched out - + * therefore the value it read into the register still matches the + * value of the uxSchedulerSuspended variable. + * + * 3. increment register. + * 4. store register into uxSchedulerSuspended. The value restored to + * uxSchedulerSuspended will be the correct value of 1, even though + * the variable was used by other tasks in the mean time. + */ /* portSOFTWARE_BARRIER() is only implemented for emulated/simulated ports that * do not otherwise exhibit real time behaviour. */ @@ -3834,6 +3881,7 @@ void vTaskSuspendAll( void ) #else /* #if ( configNUMBER_OF_CORES == 1 ) */ { UBaseType_t ulState; + BaseType_t xCoreID; /* This must only be called from within a task. */ portASSERT_IF_IN_ISR(); @@ -3847,14 +3895,16 @@ void vTaskSuspendAll( void ) * uxSchedulerSuspended since that will prevent context switches. */ ulState = portSET_INTERRUPT_MASK(); + xCoreID = ( BaseType_t ) portGET_CORE_ID(); + /* This must never be called from inside a critical section. */ - configASSERT( portGET_CRITICAL_NESTING_COUNT() == 0 ); + configASSERT( portGET_CRITICAL_NESTING_COUNT( xCoreID ) == 0 ); - /* portSOFRWARE_BARRIER() is only implemented for emulated/simulated ports that + /* portSOFTWARE_BARRIER() is only implemented for emulated/simulated ports that * do not otherwise exhibit real time behaviour. */ portSOFTWARE_BARRIER(); - portGET_TASK_LOCK(); + portGET_TASK_LOCK( xCoreID ); /* uxSchedulerSuspended is increased after prvCheckForRunStateChange. The * purpose is to prevent altering the variable when fromISR APIs are readying @@ -3868,12 +3918,17 @@ void vTaskSuspendAll( void ) mtCOVERAGE_TEST_MARKER(); } - portGET_ISR_LOCK(); + /* Query the coreID again as prvCheckForRunStateChange may have + * caused the task to get scheduled on a different core. The correct + * task lock for the core is acquired in prvCheckForRunStateChange. */ + xCoreID = ( BaseType_t ) portGET_CORE_ID(); + + portGET_ISR_LOCK( xCoreID ); /* The scheduler is suspended if uxSchedulerSuspended is non-zero. An increment * is used to allow calls to vTaskSuspendAll() to nest. */ ++uxSchedulerSuspended; - portRELEASE_ISR_LOCK(); + portRELEASE_ISR_LOCK( xCoreID ); portCLEAR_INTERRUPT_MASK( ulState ); } @@ -3894,9 +3949,9 @@ void vTaskSuspendAll( void ) static TickType_t prvGetExpectedIdleTime( void ) { TickType_t xReturn; - UBaseType_t uxHigherPriorityReadyTasks = pdFALSE; + BaseType_t xHigherPriorityReadyTasks = pdFALSE; - /* uxHigherPriorityReadyTasks takes care of the case where + /* xHigherPriorityReadyTasks takes care of the case where * configUSE_PREEMPTION is 0, so there may be tasks above the idle priority * task that are in the Ready state, even though the idle task is * running. */ @@ -3904,7 +3959,7 @@ void vTaskSuspendAll( void ) { if( uxTopReadyPriority > tskIDLE_PRIORITY ) { - uxHigherPriorityReadyTasks = pdTRUE; + xHigherPriorityReadyTasks = pdTRUE; } } #else @@ -3918,7 +3973,7 @@ void vTaskSuspendAll( void ) * care of the case where the co-operative scheduler is in use. */ if( uxTopReadyPriority > uxLeastSignificantBit ) { - uxHigherPriorityReadyTasks = pdTRUE; + xHigherPriorityReadyTasks = pdTRUE; } } #endif /* if ( configUSE_PORT_OPTIMISED_TASK_SELECTION == 0 ) */ @@ -3934,7 +3989,7 @@ void vTaskSuspendAll( void ) * processed. */ xReturn = 0; } - else if( uxHigherPriorityReadyTasks != pdFALSE ) + else if( xHigherPriorityReadyTasks != pdFALSE ) { /* There are tasks in the Ready state that have a priority above the * idle priority. This path can only be reached if @@ -3971,15 +4026,14 @@ BaseType_t xTaskResumeAll( void ) * tasks from this list into their appropriate ready list. */ taskENTER_CRITICAL(); { - BaseType_t xCoreID; - xCoreID = ( BaseType_t ) portGET_CORE_ID(); + const BaseType_t xCoreID = ( BaseType_t ) portGET_CORE_ID(); /* If uxSchedulerSuspended is zero then this function does not match a * previous call to vTaskSuspendAll(). */ configASSERT( uxSchedulerSuspended != 0U ); uxSchedulerSuspended = ( UBaseType_t ) ( uxSchedulerSuspended - 1U ); - portRELEASE_TASK_LOCK(); + portRELEASE_TASK_LOCK( xCoreID ); if( uxSchedulerSuspended == ( UBaseType_t ) 0U ) { @@ -4178,7 +4232,7 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /* If null is passed in here then the name of the calling task is being * queried. */ pxTCB = prvGetTCBFromHandle( xTaskToQuery ); - configASSERT( pxTCB ); + configASSERT( pxTCB != NULL ); traceRETURN_pcTaskGetName( &( pxTCB->pcTaskName[ 0 ] ) ); @@ -4341,6 +4395,7 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) configASSERT( ppxTaskBuffer != NULL ); pxTCB = prvGetTCBFromHandle( xTask ); + configASSERT( pxTCB != NULL ); #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE == 1 ) { @@ -4580,7 +4635,7 @@ BaseType_t xTaskCatchUpTicks( TickType_t xTicksToCatchUp ) traceENTER_xTaskAbortDelay( xTask ); - configASSERT( pxTCB ); + configASSERT( pxTCB != NULL ); vTaskSuspendAll(); { @@ -4673,10 +4728,6 @@ BaseType_t xTaskIncrementTick( void ) TickType_t xItemValue; BaseType_t xSwitchRequired = pdFALSE; - #if ( configUSE_PREEMPTION == 1 ) && ( configNUMBER_OF_CORES > 1 ) - BaseType_t xYieldRequiredForCore[ configNUMBER_OF_CORES ] = { pdFALSE }; - #endif /* #if ( configUSE_PREEMPTION == 1 ) && ( configNUMBER_OF_CORES > 1 ) */ - traceENTER_xTaskIncrementTick(); /* Called by the portable layer each time a tick interrupt occurs. @@ -4828,7 +4879,7 @@ BaseType_t xTaskIncrementTick( void ) { if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ pxCurrentTCBs[ xCoreID ]->uxPriority ] ) ) > 1U ) { - xYieldRequiredForCore[ xCoreID ] = pdTRUE; + xYieldPendings[ xCoreID ] = pdTRUE; } else { @@ -4880,7 +4931,7 @@ BaseType_t xTaskIncrementTick( void ) if( pxCurrentTCBs[ xCoreID ]->xPreemptionDisable == pdFALSE ) #endif { - if( ( xYieldRequiredForCore[ xCoreID ] != pdFALSE ) || ( xYieldPendings[ xCoreID ] != pdFALSE ) ) + if( xYieldPendings[ xCoreID ] != pdFALSE ) { if( xCoreID == xCurrentCoreID ) { @@ -4966,6 +5017,7 @@ BaseType_t xTaskIncrementTick( void ) /* If xTask is NULL then set the calling task's hook. */ pxTCB = prvGetTCBFromHandle( xTask ); + configASSERT( pxTCB != NULL ); /* Save the hook function in the TCB. A critical section is required as * the value can be accessed from an interrupt. */ @@ -4995,6 +5047,7 @@ BaseType_t xTaskIncrementTick( void ) /* If xTask is NULL then set the calling task's hook. */ pxTCB = prvGetTCBFromHandle( xTask ); + configASSERT( pxTCB != NULL ); /* Save the hook function in the TCB. A critical section is required as * the value can be accessed from an interrupt. */ @@ -5150,13 +5203,13 @@ BaseType_t xTaskIncrementTick( void ) * and move on if another core suspended the scheduler. We should only * do that if the current core has suspended the scheduler. */ - portGET_TASK_LOCK(); /* Must always acquire the task lock first. */ - portGET_ISR_LOCK(); + portGET_TASK_LOCK( xCoreID ); /* Must always acquire the task lock first. */ + portGET_ISR_LOCK( xCoreID ); { /* vTaskSwitchContext() must never be called from within a critical section. * This is not necessarily true for single core FreeRTOS, but it is for this * SMP port. */ - configASSERT( portGET_CRITICAL_NESTING_COUNT() == 0 ); + configASSERT( portGET_CRITICAL_NESTING_COUNT( xCoreID ) == 0 ); if( uxSchedulerSuspended != ( UBaseType_t ) 0U ) { @@ -5232,8 +5285,8 @@ BaseType_t xTaskIncrementTick( void ) #endif } } - portRELEASE_ISR_LOCK(); - portRELEASE_TASK_LOCK(); + portRELEASE_ISR_LOCK( xCoreID ); + portRELEASE_TASK_LOCK( xCoreID ); traceRETURN_vTaskSwitchContext(); } @@ -5972,6 +6025,8 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters ) ( xIndex < ( BaseType_t ) configNUM_THREAD_LOCAL_STORAGE_POINTERS ) ) { pxTCB = prvGetTCBFromHandle( xTaskToQuery ); + configASSERT( pxTCB != NULL ); + pvReturn = pxTCB->pvThreadLocalStoragePointers[ xIndex ]; } else @@ -5999,6 +6054,7 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters ) /* If null is passed in here then we are modifying the MPU settings of * the calling task. */ pxTCB = prvGetTCBFromHandle( xTaskToModify ); + configASSERT( pxTCB != NULL ); vPortStoreTaskMPUSettings( &( pxTCB->xMPUSettings ), pxRegions, NULL, 0 ); @@ -6129,6 +6185,7 @@ static void prvCheckTasksWaitingTermination( void ) /* xTask is NULL then get the state of the calling task. */ pxTCB = prvGetTCBFromHandle( xTask ); + configASSERT( pxTCB != NULL ); pxTaskStatus->xHandle = pxTCB; pxTaskStatus->pcTaskName = ( const char * ) &( pxTCB->pcTaskName[ 0 ] ); @@ -6158,7 +6215,7 @@ static void prvCheckTasksWaitingTermination( void ) #if ( configGENERATE_RUN_TIME_STATS == 1 ) { - pxTaskStatus->ulRunTimeCounter = pxTCB->ulRunTimeCounter; + pxTaskStatus->ulRunTimeCounter = ulTaskGetRunTimeCounter( xTask ); } #else { @@ -6345,6 +6402,7 @@ static void prvCheckTasksWaitingTermination( void ) * type. */ pxTCB = prvGetTCBFromHandle( xTask ); + configASSERT( pxTCB != NULL ); #if portSTACK_GROWTH < 0 { @@ -6377,6 +6435,7 @@ static void prvCheckTasksWaitingTermination( void ) traceENTER_uxTaskGetStackHighWaterMark( xTask ); pxTCB = prvGetTCBFromHandle( xTask ); + configASSERT( pxTCB != NULL ); #if portSTACK_GROWTH < 0 { @@ -6474,7 +6533,7 @@ static void prvResetNextTaskUnblockTime( void ) } /*-----------------------------------------------------------*/ -#if ( ( INCLUDE_xTaskGetCurrentTaskHandle == 1 ) || ( configUSE_MUTEXES == 1 ) ) || ( configNUMBER_OF_CORES > 1 ) +#if ( ( INCLUDE_xTaskGetCurrentTaskHandle == 1 ) || ( configUSE_RECURSIVE_MUTEXES == 1 ) ) || ( configNUMBER_OF_CORES > 1 ) #if ( configNUMBER_OF_CORES == 1 ) TaskHandle_t xTaskGetCurrentTaskHandle( void ) @@ -6532,7 +6591,7 @@ static void prvResetNextTaskUnblockTime( void ) return xReturn; } -#endif /* ( ( INCLUDE_xTaskGetCurrentTaskHandle == 1 ) || ( configUSE_MUTEXES == 1 ) ) */ +#endif /* ( ( INCLUDE_xTaskGetCurrentTaskHandle == 1 ) || ( configUSE_RECURSIVE_MUTEXES == 1 ) ) */ /*-----------------------------------------------------------*/ #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) ) @@ -6900,16 +6959,24 @@ static void prvResetNextTaskUnblockTime( void ) */ void vTaskYieldWithinAPI( void ) { + UBaseType_t ulState; + traceENTER_vTaskYieldWithinAPI(); - if( portGET_CRITICAL_NESTING_COUNT() == 0U ) + ulState = portSET_INTERRUPT_MASK(); { - portYIELD(); - } - else - { - xYieldPendings[ portGET_CORE_ID() ] = pdTRUE; + const BaseType_t xCoreID = ( BaseType_t ) portGET_CORE_ID(); + + if( portGET_CRITICAL_NESTING_COUNT( xCoreID ) == 0U ) + { + portYIELD(); + } + else + { + xYieldPendings[ xCoreID ] = pdTRUE; + } } + portCLEAR_INTERRUPT_MASK( ulState ); traceRETURN_vTaskYieldWithinAPI(); } @@ -6958,40 +7025,43 @@ static void prvResetNextTaskUnblockTime( void ) traceENTER_vTaskEnterCritical(); portDISABLE_INTERRUPTS(); - - if( xSchedulerRunning != pdFALSE ) { - if( portGET_CRITICAL_NESTING_COUNT() == 0U ) - { - portGET_TASK_LOCK(); - portGET_ISR_LOCK(); - } - - portINCREMENT_CRITICAL_NESTING_COUNT(); + const BaseType_t xCoreID = ( BaseType_t ) portGET_CORE_ID(); - /* This is not the interrupt safe version of the enter critical - * function so assert() if it is being called from an interrupt - * context. Only API functions that end in "FromISR" can be used in an - * interrupt. Only assert if the critical nesting count is 1 to - * protect against recursive calls if the assert function also uses a - * critical section. */ - if( portGET_CRITICAL_NESTING_COUNT() == 1U ) + if( xSchedulerRunning != pdFALSE ) { - portASSERT_IF_IN_ISR(); + if( portGET_CRITICAL_NESTING_COUNT( xCoreID ) == 0U ) + { + portGET_TASK_LOCK( xCoreID ); + portGET_ISR_LOCK( xCoreID ); + } + + portINCREMENT_CRITICAL_NESTING_COUNT( xCoreID ); - if( uxSchedulerSuspended == 0U ) + /* This is not the interrupt safe version of the enter critical + * function so assert() if it is being called from an interrupt + * context. Only API functions that end in "FromISR" can be used in an + * interrupt. Only assert if the critical nesting count is 1 to + * protect against recursive calls if the assert function also uses a + * critical section. */ + if( portGET_CRITICAL_NESTING_COUNT( xCoreID ) == 1U ) { - /* The only time there would be a problem is if this is called - * before a context switch and vTaskExitCritical() is called - * after pxCurrentTCB changes. Therefore this should not be - * used within vTaskSwitchContext(). */ - prvCheckForRunStateChange(); + portASSERT_IF_IN_ISR(); + + if( uxSchedulerSuspended == 0U ) + { + /* The only time there would be a problem is if this is called + * before a context switch and vTaskExitCritical() is called + * after pxCurrentTCB changes. Therefore this should not be + * used within vTaskSwitchContext(). */ + prvCheckForRunStateChange(); + } } } - } - else - { - mtCOVERAGE_TEST_MARKER(); + else + { + mtCOVERAGE_TEST_MARKER(); + } } traceRETURN_vTaskEnterCritical(); @@ -7006,6 +7076,7 @@ static void prvResetNextTaskUnblockTime( void ) UBaseType_t vTaskEnterCriticalFromISR( void ) { UBaseType_t uxSavedInterruptStatus = 0; + const BaseType_t xCoreID = ( BaseType_t ) portGET_CORE_ID(); traceENTER_vTaskEnterCriticalFromISR(); @@ -7013,12 +7084,12 @@ static void prvResetNextTaskUnblockTime( void ) { uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR(); - if( portGET_CRITICAL_NESTING_COUNT() == 0U ) + if( portGET_CRITICAL_NESTING_COUNT( xCoreID ) == 0U ) { - portGET_ISR_LOCK(); + portGET_ISR_LOCK( xCoreID ); } - portINCREMENT_CRITICAL_NESTING_COUNT(); + portINCREMENT_CRITICAL_NESTING_COUNT( xCoreID ); } else { @@ -7082,31 +7153,33 @@ static void prvResetNextTaskUnblockTime( void ) void vTaskExitCritical( void ) { + const BaseType_t xCoreID = ( BaseType_t ) portGET_CORE_ID(); + traceENTER_vTaskExitCritical(); if( xSchedulerRunning != pdFALSE ) { /* If critical nesting count is zero then this function * does not match a previous call to vTaskEnterCritical(). */ - configASSERT( portGET_CRITICAL_NESTING_COUNT() > 0U ); + configASSERT( portGET_CRITICAL_NESTING_COUNT( xCoreID ) > 0U ); /* This function should not be called in ISR. Use vTaskExitCriticalFromISR * to exit critical section from ISR. */ portASSERT_IF_IN_ISR(); - if( portGET_CRITICAL_NESTING_COUNT() > 0U ) + if( portGET_CRITICAL_NESTING_COUNT( xCoreID ) > 0U ) { - portDECREMENT_CRITICAL_NESTING_COUNT(); + portDECREMENT_CRITICAL_NESTING_COUNT( xCoreID ); - if( portGET_CRITICAL_NESTING_COUNT() == 0U ) + if( portGET_CRITICAL_NESTING_COUNT( xCoreID ) == 0U ) { BaseType_t xYieldCurrentTask; /* Get the xYieldPending stats inside the critical section. */ - xYieldCurrentTask = xYieldPendings[ portGET_CORE_ID() ]; + xYieldCurrentTask = xYieldPendings[ xCoreID ]; - portRELEASE_ISR_LOCK(); - portRELEASE_TASK_LOCK(); + portRELEASE_ISR_LOCK( xCoreID ); + portRELEASE_TASK_LOCK( xCoreID ); portENABLE_INTERRUPTS(); /* When a task yields in a critical section it just sets @@ -7143,21 +7216,25 @@ static void prvResetNextTaskUnblockTime( void ) void vTaskExitCriticalFromISR( UBaseType_t uxSavedInterruptStatus ) { + BaseType_t xCoreID; + traceENTER_vTaskExitCriticalFromISR( uxSavedInterruptStatus ); if( xSchedulerRunning != pdFALSE ) { + xCoreID = ( BaseType_t ) portGET_CORE_ID(); + /* If critical nesting count is zero then this function * does not match a previous call to vTaskEnterCritical(). */ - configASSERT( portGET_CRITICAL_NESTING_COUNT() > 0U ); + configASSERT( portGET_CRITICAL_NESTING_COUNT( xCoreID ) > 0U ); - if( portGET_CRITICAL_NESTING_COUNT() > 0U ) + if( portGET_CRITICAL_NESTING_COUNT( xCoreID ) > 0U ) { - portDECREMENT_CRITICAL_NESTING_COUNT(); + portDECREMENT_CRITICAL_NESTING_COUNT( xCoreID ); - if( portGET_CRITICAL_NESTING_COUNT() == 0U ) + if( portGET_CRITICAL_NESTING_COUNT( xCoreID ) == 0U ) { - portRELEASE_ISR_LOCK(); + portRELEASE_ISR_LOCK( xCoreID ); portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus ); } else @@ -7622,24 +7699,27 @@ TickType_t uxTaskResetEventItemValue( void ) configASSERT( uxIndexToWaitOn < configTASK_NOTIFICATION_ARRAY_ENTRIES ); - /* We suspend the scheduler here as prvAddCurrentTaskToDelayedList is a - * non-deterministic operation. */ - vTaskSuspendAll(); + /* If the notification count is zero, and if we are willing to wait for a + * notification, then block the task and wait. */ + if( ( pxCurrentTCB->ulNotifiedValue[ uxIndexToWaitOn ] == 0U ) && ( xTicksToWait > ( TickType_t ) 0 ) ) { - /* We MUST enter a critical section to atomically check if a notification - * has occurred and set the flag to indicate that we are waiting for - * a notification. If we do not do so, a notification sent from an ISR - * will get lost. */ - taskENTER_CRITICAL(); + /* We suspend the scheduler here as prvAddCurrentTaskToDelayedList is a + * non-deterministic operation. */ + vTaskSuspendAll(); { - /* Only block if the notification count is not already non-zero. */ - if( pxCurrentTCB->ulNotifiedValue[ uxIndexToWaitOn ] == 0U ) + /* We MUST enter a critical section to atomically check if a notification + * has occurred and set the flag to indicate that we are waiting for + * a notification. If we do not do so, a notification sent from an ISR + * will get lost. */ + taskENTER_CRITICAL(); { - /* Mark this task as waiting for a notification. */ - pxCurrentTCB->ucNotifyState[ uxIndexToWaitOn ] = taskWAITING_NOTIFICATION; - - if( xTicksToWait > ( TickType_t ) 0 ) + /* Only block if the notification count is not already non-zero. */ + if( pxCurrentTCB->ulNotifiedValue[ uxIndexToWaitOn ] == 0U ) { + /* Mark this task as waiting for a notification. */ + pxCurrentTCB->ucNotifyState[ uxIndexToWaitOn ] = taskWAITING_NOTIFICATION; + + /* Arrange to wait for a notification. */ xShouldBlock = pdTRUE; } else @@ -7647,37 +7727,33 @@ TickType_t uxTaskResetEventItemValue( void ) mtCOVERAGE_TEST_MARKER(); } } + taskEXIT_CRITICAL(); + + /* We are now out of the critical section but the scheduler is still + * suspended, so we are safe to do non-deterministic operations such + * as prvAddCurrentTaskToDelayedList. */ + if( xShouldBlock == pdTRUE ) + { + traceTASK_NOTIFY_TAKE_BLOCK( uxIndexToWaitOn ); + prvAddCurrentTaskToDelayedList( xTicksToWait, pdTRUE ); + } else { mtCOVERAGE_TEST_MARKER(); } } - taskEXIT_CRITICAL(); + xAlreadyYielded = xTaskResumeAll(); - /* We are now out of the critical section but the scheduler is still - * suspended, so we are safe to do non-deterministic operations such - * as prvAddCurrentTaskToDelayedList. */ - if( xShouldBlock == pdTRUE ) + /* Force a reschedule if xTaskResumeAll has not already done so. */ + if( ( xShouldBlock == pdTRUE ) && ( xAlreadyYielded == pdFALSE ) ) { - traceTASK_NOTIFY_TAKE_BLOCK( uxIndexToWaitOn ); - prvAddCurrentTaskToDelayedList( xTicksToWait, pdTRUE ); + taskYIELD_WITHIN_API(); } else { mtCOVERAGE_TEST_MARKER(); } } - xAlreadyYielded = xTaskResumeAll(); - - /* Force a reschedule if xTaskResumeAll has not already done so. */ - if( ( xShouldBlock == pdTRUE ) && ( xAlreadyYielded == pdFALSE ) ) - { - taskYIELD_WITHIN_API(); - } - else - { - mtCOVERAGE_TEST_MARKER(); - } taskENTER_CRITICAL(); { @@ -7726,28 +7802,31 @@ TickType_t uxTaskResetEventItemValue( void ) configASSERT( uxIndexToWaitOn < configTASK_NOTIFICATION_ARRAY_ENTRIES ); - /* We suspend the scheduler here as prvAddCurrentTaskToDelayedList is a - * non-deterministic operation. */ - vTaskSuspendAll(); + /* If the task hasn't received a notification, and if we are willing to wait + * for it, then block the task and wait. */ + if( ( pxCurrentTCB->ucNotifyState[ uxIndexToWaitOn ] != taskNOTIFICATION_RECEIVED ) && ( xTicksToWait > ( TickType_t ) 0 ) ) { - /* We MUST enter a critical section to atomically check and update the - * task notification value. If we do not do so, a notification from - * an ISR will get lost. */ - taskENTER_CRITICAL(); + /* We suspend the scheduler here as prvAddCurrentTaskToDelayedList is a + * non-deterministic operation. */ + vTaskSuspendAll(); { - /* Only block if a notification is not already pending. */ - if( pxCurrentTCB->ucNotifyState[ uxIndexToWaitOn ] != taskNOTIFICATION_RECEIVED ) + /* We MUST enter a critical section to atomically check and update the + * task notification value. If we do not do so, a notification from + * an ISR will get lost. */ + taskENTER_CRITICAL(); { - /* Clear bits in the task's notification value as bits may get - * set by the notifying task or interrupt. This can be used - * to clear the value to zero. */ - pxCurrentTCB->ulNotifiedValue[ uxIndexToWaitOn ] &= ~ulBitsToClearOnEntry; + /* Only block if a notification is not already pending. */ + if( pxCurrentTCB->ucNotifyState[ uxIndexToWaitOn ] != taskNOTIFICATION_RECEIVED ) + { + /* Clear bits in the task's notification value as bits may get + * set by the notifying task or interrupt. This can be used + * to clear the value to zero. */ + pxCurrentTCB->ulNotifiedValue[ uxIndexToWaitOn ] &= ~ulBitsToClearOnEntry; - /* Mark this task as waiting for a notification. */ - pxCurrentTCB->ucNotifyState[ uxIndexToWaitOn ] = taskWAITING_NOTIFICATION; + /* Mark this task as waiting for a notification. */ + pxCurrentTCB->ucNotifyState[ uxIndexToWaitOn ] = taskWAITING_NOTIFICATION; - if( xTicksToWait > ( TickType_t ) 0 ) - { + /* Arrange to wait for a notification. */ xShouldBlock = pdTRUE; } else @@ -7755,37 +7834,33 @@ TickType_t uxTaskResetEventItemValue( void ) mtCOVERAGE_TEST_MARKER(); } } + taskEXIT_CRITICAL(); + + /* We are now out of the critical section but the scheduler is still + * suspended, so we are safe to do non-deterministic operations such + * as prvAddCurrentTaskToDelayedList. */ + if( xShouldBlock == pdTRUE ) + { + traceTASK_NOTIFY_WAIT_BLOCK( uxIndexToWaitOn ); + prvAddCurrentTaskToDelayedList( xTicksToWait, pdTRUE ); + } else { mtCOVERAGE_TEST_MARKER(); } } - taskEXIT_CRITICAL(); + xAlreadyYielded = xTaskResumeAll(); - /* We are now out of the critical section but the scheduler is still - * suspended, so we are safe to do non-deterministic operations such - * as prvAddCurrentTaskToDelayedList. */ - if( xShouldBlock == pdTRUE ) + /* Force a reschedule if xTaskResumeAll has not already done so. */ + if( ( xShouldBlock == pdTRUE ) && ( xAlreadyYielded == pdFALSE ) ) { - traceTASK_NOTIFY_WAIT_BLOCK( uxIndexToWaitOn ); - prvAddCurrentTaskToDelayedList( xTicksToWait, pdTRUE ); + taskYIELD_WITHIN_API(); } else { mtCOVERAGE_TEST_MARKER(); } } - xAlreadyYielded = xTaskResumeAll(); - - /* Force a reschedule if xTaskResumeAll has not already done so. */ - if( ( xShouldBlock == pdTRUE ) && ( xAlreadyYielded == pdFALSE ) ) - { - taskYIELD_WITHIN_API(); - } - else - { - mtCOVERAGE_TEST_MARKER(); - } taskENTER_CRITICAL(); { @@ -8055,6 +8130,22 @@ TickType_t uxTaskResetEventItemValue( void ) { listREMOVE_ITEM( &( pxTCB->xStateListItem ) ); prvAddTaskToReadyList( pxTCB ); + + #if ( configUSE_TICKLESS_IDLE != 0 ) + { + /* If a task is blocked waiting for a notification then + * xNextTaskUnblockTime might be set to the blocked task's time + * out time. If the task is unblocked for a reason other than + * a timeout xNextTaskUnblockTime is normally left unchanged, + * because it will automatically get reset to a new value when + * the tick count equals xNextTaskUnblockTime. However if + * tickless idling is used it might be more important to enter + * sleep mode at the earliest possible time - so reset + * xNextTaskUnblockTime here to ensure it is updated at the + * earliest possible time. */ + prvResetNextTaskUnblockTime(); + } + #endif } else { @@ -8173,6 +8264,22 @@ TickType_t uxTaskResetEventItemValue( void ) { listREMOVE_ITEM( &( pxTCB->xStateListItem ) ); prvAddTaskToReadyList( pxTCB ); + + #if ( configUSE_TICKLESS_IDLE != 0 ) + { + /* If a task is blocked waiting for a notification then + * xNextTaskUnblockTime might be set to the blocked task's time + * out time. If the task is unblocked for a reason other than + * a timeout xNextTaskUnblockTime is normally left unchanged, + * because it will automatically get reset to a new value when + * the tick count equals xNextTaskUnblockTime. However if + * tickless idling is used it might be more important to enter + * sleep mode at the earliest possible time - so reset + * xNextTaskUnblockTime here to ensure it is updated at the + * earliest possible time. */ + prvResetNextTaskUnblockTime(); + } + #endif } else { @@ -8244,6 +8351,7 @@ TickType_t uxTaskResetEventItemValue( void ) /* If null is passed in here then it is the calling task that is having * its notification state cleared. */ pxTCB = prvGetTCBFromHandle( xTask ); + configASSERT( pxTCB != NULL ); taskENTER_CRITICAL(); { @@ -8283,6 +8391,7 @@ TickType_t uxTaskResetEventItemValue( void ) /* If null is passed in here then it is the calling task that is having * its notification state cleared. */ pxTCB = prvGetTCBFromHandle( xTask ); + configASSERT( pxTCB != NULL ); taskENTER_CRITICAL(); { @@ -8306,14 +8415,37 @@ TickType_t uxTaskResetEventItemValue( void ) configRUN_TIME_COUNTER_TYPE ulTaskGetRunTimeCounter( const TaskHandle_t xTask ) { TCB_t * pxTCB; + configRUN_TIME_COUNTER_TYPE ulTotalTime = 0, ulTimeSinceLastSwitchedIn = 0, ulTaskRunTime = 0; traceENTER_ulTaskGetRunTimeCounter( xTask ); pxTCB = prvGetTCBFromHandle( xTask ); + configASSERT( pxTCB != NULL ); + + taskENTER_CRITICAL(); + { + if( taskTASK_IS_RUNNING( pxTCB ) == pdTRUE ) + { + #ifdef portALT_GET_RUN_TIME_COUNTER_VALUE + portALT_GET_RUN_TIME_COUNTER_VALUE( ulTotalTime ); + #else + ulTotalTime = portGET_RUN_TIME_COUNTER_VALUE(); + #endif + + #if ( configNUMBER_OF_CORES == 1 ) + ulTimeSinceLastSwitchedIn = ulTotalTime - ulTaskSwitchedInTime[ 0 ]; + #else + ulTimeSinceLastSwitchedIn = ulTotalTime - ulTaskSwitchedInTime[ pxTCB->xTaskRunState ]; + #endif + } - traceRETURN_ulTaskGetRunTimeCounter( pxTCB->ulRunTimeCounter ); + ulTaskRunTime = pxTCB->ulRunTimeCounter + ulTimeSinceLastSwitchedIn; + } + taskEXIT_CRITICAL(); - return pxTCB->ulRunTimeCounter; + traceRETURN_ulTaskGetRunTimeCounter( ulTaskRunTime ); + + return ulTaskRunTime; } #endif /* if ( configGENERATE_RUN_TIME_STATS == 1 ) */ @@ -8324,11 +8456,17 @@ TickType_t uxTaskResetEventItemValue( void ) configRUN_TIME_COUNTER_TYPE ulTaskGetRunTimePercent( const TaskHandle_t xTask ) { TCB_t * pxTCB; - configRUN_TIME_COUNTER_TYPE ulTotalTime, ulReturn; + configRUN_TIME_COUNTER_TYPE ulTotalTime, ulReturn, ulTaskRunTime; traceENTER_ulTaskGetRunTimePercent( xTask ); - ulTotalTime = ( configRUN_TIME_COUNTER_TYPE ) portGET_RUN_TIME_COUNTER_VALUE(); + ulTaskRunTime = ulTaskGetRunTimeCounter( xTask ); + + #ifdef portALT_GET_RUN_TIME_COUNTER_VALUE + portALT_GET_RUN_TIME_COUNTER_VALUE( ulTotalTime ); + #else + ulTotalTime = ( configRUN_TIME_COUNTER_TYPE ) portGET_RUN_TIME_COUNTER_VALUE(); + #endif /* For percentage calculations. */ ulTotalTime /= ( configRUN_TIME_COUNTER_TYPE ) 100; @@ -8337,7 +8475,9 @@ TickType_t uxTaskResetEventItemValue( void ) if( ulTotalTime > ( configRUN_TIME_COUNTER_TYPE ) 0 ) { pxTCB = prvGetTCBFromHandle( xTask ); - ulReturn = pxTCB->ulRunTimeCounter / ulTotalTime; + configASSERT( pxTCB != NULL ); + + ulReturn = ulTaskRunTime / ulTotalTime; } else { @@ -8356,19 +8496,42 @@ TickType_t uxTaskResetEventItemValue( void ) configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimeCounter( void ) { - configRUN_TIME_COUNTER_TYPE ulReturn = 0; + configRUN_TIME_COUNTER_TYPE ulTotalTime = 0, ulTimeSinceLastSwitchedIn = 0, ulIdleTaskRunTime = 0; BaseType_t i; traceENTER_ulTaskGetIdleRunTimeCounter(); - for( i = 0; i < ( BaseType_t ) configNUMBER_OF_CORES; i++ ) + taskENTER_CRITICAL(); { - ulReturn += xIdleTaskHandles[ i ]->ulRunTimeCounter; + #ifdef portALT_GET_RUN_TIME_COUNTER_VALUE + portALT_GET_RUN_TIME_COUNTER_VALUE( ulTotalTime ); + #else + ulTotalTime = portGET_RUN_TIME_COUNTER_VALUE(); + #endif + + for( i = 0; i < ( BaseType_t ) configNUMBER_OF_CORES; i++ ) + { + if( taskTASK_IS_RUNNING( xIdleTaskHandles[ i ] ) == pdTRUE ) + { + #if ( configNUMBER_OF_CORES == 1 ) + ulTimeSinceLastSwitchedIn = ulTotalTime - ulTaskSwitchedInTime[ 0 ]; + #else + ulTimeSinceLastSwitchedIn = ulTotalTime - ulTaskSwitchedInTime[ xIdleTaskHandles[ i ]->xTaskRunState ]; + #endif + } + else + { + ulTimeSinceLastSwitchedIn = 0; + } + + ulIdleTaskRunTime += ( xIdleTaskHandles[ i ]->ulRunTimeCounter + ulTimeSinceLastSwitchedIn ); + } } + taskEXIT_CRITICAL(); - traceRETURN_ulTaskGetIdleRunTimeCounter( ulReturn ); + traceRETURN_ulTaskGetIdleRunTimeCounter( ulIdleTaskRunTime ); - return ulReturn; + return ulIdleTaskRunTime; } #endif /* if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) ) */ @@ -8380,11 +8543,16 @@ TickType_t uxTaskResetEventItemValue( void ) { configRUN_TIME_COUNTER_TYPE ulTotalTime, ulReturn; configRUN_TIME_COUNTER_TYPE ulRunTimeCounter = 0; - BaseType_t i; traceENTER_ulTaskGetIdleRunTimePercent(); - ulTotalTime = portGET_RUN_TIME_COUNTER_VALUE() * configNUMBER_OF_CORES; + #ifdef portALT_GET_RUN_TIME_COUNTER_VALUE + portALT_GET_RUN_TIME_COUNTER_VALUE( ulTotalTime ); + #else + ulTotalTime = ( configRUN_TIME_COUNTER_TYPE ) portGET_RUN_TIME_COUNTER_VALUE(); + #endif + + ulTotalTime *= configNUMBER_OF_CORES; /* For percentage calculations. */ ulTotalTime /= ( configRUN_TIME_COUNTER_TYPE ) 100; @@ -8392,11 +8560,7 @@ TickType_t uxTaskResetEventItemValue( void ) /* Avoid divide by zero errors. */ if( ulTotalTime > ( configRUN_TIME_COUNTER_TYPE ) 0 ) { - for( i = 0; i < ( BaseType_t ) configNUMBER_OF_CORES; i++ ) - { - ulRunTimeCounter += xIdleTaskHandles[ i ]->ulRunTimeCounter; - } - + ulRunTimeCounter = ulTaskGetIdleRunTimeCounter(); ulReturn = ulRunTimeCounter / ulTotalTime; } else @@ -8540,6 +8704,7 @@ static void prvAddCurrentTaskToDelayedList( TickType_t xTicksToWait, traceENTER_xTaskGetMPUSettings( xTask ); pxTCB = prvGetTCBFromHandle( xTask ); + configASSERT( pxTCB != NULL ); traceRETURN_xTaskGetMPUSettings( &( pxTCB->xMPUSettings ) ); @@ -8613,7 +8778,7 @@ static void prvAddCurrentTaskToDelayedList( TickType_t xTicksToWait, #endif /* #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configKERNEL_PROVIDED_STATIC_MEMORY == 1 ) && ( portUSING_MPU_WRAPPERS == 0 ) ) */ /*-----------------------------------------------------------*/ -#if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configKERNEL_PROVIDED_STATIC_MEMORY == 1 ) && ( portUSING_MPU_WRAPPERS == 0 ) ) +#if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configKERNEL_PROVIDED_STATIC_MEMORY == 1 ) && ( portUSING_MPU_WRAPPERS == 0 ) && ( configUSE_TIMERS == 1 ) ) /* * This is the kernel provided implementation of vApplicationGetTimerTaskMemory() @@ -8634,7 +8799,7 @@ static void prvAddCurrentTaskToDelayedList( TickType_t xTicksToWait, *puxTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH; } -#endif /* #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configKERNEL_PROVIDED_STATIC_MEMORY == 1 ) && ( portUSING_MPU_WRAPPERS == 0 ) ) */ +#endif /* #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configKERNEL_PROVIDED_STATIC_MEMORY == 1 ) && ( portUSING_MPU_WRAPPERS == 0 ) && ( configUSE_TIMERS == 1 ) ) */ /*-----------------------------------------------------------*/ /* diff --git a/third-party/freertos/timers.c b/third-party/freertos/timers.c index d499db2b..1bc40bc4 100644 --- a/third-party/freertos/timers.c +++ b/third-party/freertos/timers.c @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V11.1.0 + * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * SPDX-License-Identifier: MIT @@ -257,7 +257,7 @@ configSTACK_DEPTH_TYPE uxTimerTaskStackSize; vApplicationGetTimerTaskMemory( &pxTimerTaskTCBBuffer, &pxTimerTaskStackBuffer, &uxTimerTaskStackSize ); - xTimerTaskHandle = xTaskCreateStaticAffinitySet( prvTimerTask, + xTimerTaskHandle = xTaskCreateStaticAffinitySet( &prvTimerTask, configTIMER_SERVICE_TASK_NAME, uxTimerTaskStackSize, NULL, @@ -273,7 +273,7 @@ } #else /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */ { - xReturn = xTaskCreateAffinitySet( prvTimerTask, + xReturn = xTaskCreateAffinitySet( &prvTimerTask, configTIMER_SERVICE_TASK_NAME, configTIMER_TASK_STACK_DEPTH, NULL, @@ -292,7 +292,7 @@ configSTACK_DEPTH_TYPE uxTimerTaskStackSize; vApplicationGetTimerTaskMemory( &pxTimerTaskTCBBuffer, &pxTimerTaskStackBuffer, &uxTimerTaskStackSize ); - xTimerTaskHandle = xTaskCreateStatic( prvTimerTask, + xTimerTaskHandle = xTaskCreateStatic( &prvTimerTask, configTIMER_SERVICE_TASK_NAME, uxTimerTaskStackSize, NULL, @@ -307,7 +307,7 @@ } #else /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */ { - xReturn = xTaskCreate( prvTimerTask, + xReturn = xTaskCreate( &prvTimerTask, configTIMER_SERVICE_TASK_NAME, configTIMER_TASK_STACK_DEPTH, NULL, @@ -458,11 +458,9 @@ traceENTER_xTimerGenericCommandFromTask( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait ); - configASSERT( xTimer ); - /* Send a message to the timer service task to perform a particular action * on a particular timer definition. */ - if( xTimerQueue != NULL ) + if( ( xTimerQueue != NULL ) && ( xTimer != NULL ) ) { /* Send a command to the timer service task to start the xTimer timer. */ xMessage.xMessageID = xCommandID; @@ -509,11 +507,9 @@ traceENTER_xTimerGenericCommandFromISR( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait ); - configASSERT( xTimer ); - /* Send a message to the timer service task to perform a particular action * on a particular timer definition. */ - if( xTimerQueue != NULL ) + if( ( xTimerQueue != NULL ) && ( xTimer != NULL ) ) { /* Send a command to the timer service task to start the xTimer timer. */ xMessage.xMessageID = xCommandID; @@ -601,7 +597,7 @@ traceENTER_xTimerGetReloadMode( xTimer ); configASSERT( xTimer ); - taskENTER_CRITICAL(); + portBASE_TYPE_ENTER_CRITICAL(); { if( ( pxTimer->ucStatus & tmrSTATUS_IS_AUTORELOAD ) == 0U ) { @@ -614,7 +610,7 @@ xReturn = pdTRUE; } } - taskEXIT_CRITICAL(); + portBASE_TYPE_EXIT_CRITICAL(); traceRETURN_xTimerGetReloadMode( xReturn ); @@ -974,109 +970,116 @@ * software timer. */ pxTimer = xMessage.u.xTimerParameters.pxTimer; - if( listIS_CONTAINED_WITHIN( NULL, &( pxTimer->xTimerListItem ) ) == pdFALSE ) + if( pxTimer != NULL ) { - /* The timer is in a list, remove it. */ - ( void ) uxListRemove( &( pxTimer->xTimerListItem ) ); - } - else - { - mtCOVERAGE_TEST_MARKER(); - } + if( listIS_CONTAINED_WITHIN( NULL, &( pxTimer->xTimerListItem ) ) == pdFALSE ) + { + /* The timer is in a list, remove it. */ + ( void ) uxListRemove( &( pxTimer->xTimerListItem ) ); + } + else + { + mtCOVERAGE_TEST_MARKER(); + } - traceTIMER_COMMAND_RECEIVED( pxTimer, xMessage.xMessageID, xMessage.u.xTimerParameters.xMessageValue ); + traceTIMER_COMMAND_RECEIVED( pxTimer, xMessage.xMessageID, xMessage.u.xTimerParameters.xMessageValue ); - /* In this case the xTimerListsWereSwitched parameter is not used, but - * it must be present in the function call. prvSampleTimeNow() must be - * called after the message is received from xTimerQueue so there is no - * possibility of a higher priority task adding a message to the message - * queue with a time that is ahead of the timer daemon task (because it - * pre-empted the timer daemon task after the xTimeNow value was set). */ - xTimeNow = prvSampleTimeNow( &xTimerListsWereSwitched ); + /* In this case the xTimerListsWereSwitched parameter is not used, but + * it must be present in the function call. prvSampleTimeNow() must be + * called after the message is received from xTimerQueue so there is no + * possibility of a higher priority task adding a message to the message + * queue with a time that is ahead of the timer daemon task (because it + * pre-empted the timer daemon task after the xTimeNow value was set). */ + xTimeNow = prvSampleTimeNow( &xTimerListsWereSwitched ); - switch( xMessage.xMessageID ) - { - case tmrCOMMAND_START: - case tmrCOMMAND_START_FROM_ISR: - case tmrCOMMAND_RESET: - case tmrCOMMAND_RESET_FROM_ISR: - /* Start or restart a timer. */ - pxTimer->ucStatus |= ( uint8_t ) tmrSTATUS_IS_ACTIVE; - - if( prvInsertTimerInActiveList( pxTimer, xMessage.u.xTimerParameters.xMessageValue + pxTimer->xTimerPeriodInTicks, xTimeNow, xMessage.u.xTimerParameters.xMessageValue ) != pdFALSE ) - { - /* The timer expired before it was added to the active - * timer list. Process it now. */ - if( ( pxTimer->ucStatus & tmrSTATUS_IS_AUTORELOAD ) != 0U ) + switch( xMessage.xMessageID ) + { + case tmrCOMMAND_START: + case tmrCOMMAND_START_FROM_ISR: + case tmrCOMMAND_RESET: + case tmrCOMMAND_RESET_FROM_ISR: + /* Start or restart a timer. */ + pxTimer->ucStatus |= ( uint8_t ) tmrSTATUS_IS_ACTIVE; + + if( prvInsertTimerInActiveList( pxTimer, xMessage.u.xTimerParameters.xMessageValue + pxTimer->xTimerPeriodInTicks, xTimeNow, xMessage.u.xTimerParameters.xMessageValue ) != pdFALSE ) { - prvReloadTimer( pxTimer, xMessage.u.xTimerParameters.xMessageValue + pxTimer->xTimerPeriodInTicks, xTimeNow ); + /* The timer expired before it was added to the active + * timer list. Process it now. */ + if( ( pxTimer->ucStatus & tmrSTATUS_IS_AUTORELOAD ) != 0U ) + { + prvReloadTimer( pxTimer, xMessage.u.xTimerParameters.xMessageValue + pxTimer->xTimerPeriodInTicks, xTimeNow ); + } + else + { + pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_ACTIVE ); + } + + /* Call the timer callback. */ + traceTIMER_EXPIRED( pxTimer ); + pxTimer->pxCallbackFunction( ( TimerHandle_t ) pxTimer ); } else { - pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_ACTIVE ); + mtCOVERAGE_TEST_MARKER(); } - /* Call the timer callback. */ - traceTIMER_EXPIRED( pxTimer ); - pxTimer->pxCallbackFunction( ( TimerHandle_t ) pxTimer ); - } - else - { - mtCOVERAGE_TEST_MARKER(); - } - - break; - - case tmrCOMMAND_STOP: - case tmrCOMMAND_STOP_FROM_ISR: - /* The timer has already been removed from the active list. */ - pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_ACTIVE ); - break; - - case tmrCOMMAND_CHANGE_PERIOD: - case tmrCOMMAND_CHANGE_PERIOD_FROM_ISR: - pxTimer->ucStatus |= ( uint8_t ) tmrSTATUS_IS_ACTIVE; - pxTimer->xTimerPeriodInTicks = xMessage.u.xTimerParameters.xMessageValue; - configASSERT( ( pxTimer->xTimerPeriodInTicks > 0 ) ); - - /* The new period does not really have a reference, and can - * be longer or shorter than the old one. The command time is - * therefore set to the current time, and as the period cannot - * be zero the next expiry time can only be in the future, - * meaning (unlike for the xTimerStart() case above) there is - * no fail case that needs to be handled here. */ - ( void ) prvInsertTimerInActiveList( pxTimer, ( xTimeNow + pxTimer->xTimerPeriodInTicks ), xTimeNow, xTimeNow ); - break; - - case tmrCOMMAND_DELETE: - #if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) - { - /* The timer has already been removed from the active list, - * just free up the memory if the memory was dynamically - * allocated. */ - if( ( pxTimer->ucStatus & tmrSTATUS_IS_STATICALLY_ALLOCATED ) == ( uint8_t ) 0 ) + break; + + case tmrCOMMAND_STOP: + case tmrCOMMAND_STOP_FROM_ISR: + /* The timer has already been removed from the active list. */ + pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_ACTIVE ); + break; + + case tmrCOMMAND_CHANGE_PERIOD: + case tmrCOMMAND_CHANGE_PERIOD_FROM_ISR: + pxTimer->ucStatus |= ( uint8_t ) tmrSTATUS_IS_ACTIVE; + pxTimer->xTimerPeriodInTicks = xMessage.u.xTimerParameters.xMessageValue; + configASSERT( ( pxTimer->xTimerPeriodInTicks > 0 ) ); + + /* The new period does not really have a reference, and can + * be longer or shorter than the old one. The command time is + * therefore set to the current time, and as the period cannot + * be zero the next expiry time can only be in the future, + * meaning (unlike for the xTimerStart() case above) there is + * no fail case that needs to be handled here. */ + ( void ) prvInsertTimerInActiveList( pxTimer, ( xTimeNow + pxTimer->xTimerPeriodInTicks ), xTimeNow, xTimeNow ); + break; + + case tmrCOMMAND_DELETE: + #if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) { - vPortFree( pxTimer ); + /* The timer has already been removed from the active list, + * just free up the memory if the memory was dynamically + * allocated. */ + if( ( pxTimer->ucStatus & tmrSTATUS_IS_STATICALLY_ALLOCATED ) == ( uint8_t ) 0 ) + { + vPortFree( pxTimer ); + } + else + { + pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_ACTIVE ); + } } - else + #else /* if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) */ { + /* If dynamic allocation is not enabled, the memory + * could not have been dynamically allocated. So there is + * no need to free the memory - just mark the timer as + * "not active". */ pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_ACTIVE ); } - } - #else /* if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) */ - { - /* If dynamic allocation is not enabled, the memory - * could not have been dynamically allocated. So there is - * no need to free the memory - just mark the timer as - * "not active". */ - pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_ACTIVE ); - } - #endif /* configSUPPORT_DYNAMIC_ALLOCATION */ - break; + #endif /* configSUPPORT_DYNAMIC_ALLOCATION */ + break; - default: - /* Don't expect to get here. */ - break; + default: + /* Don't expect to get here. */ + break; + } + } + else + { + mtCOVERAGE_TEST_MARKER(); } } } @@ -1169,7 +1172,7 @@ configASSERT( xTimer ); /* Is the timer in the list of active timers? */ - taskENTER_CRITICAL(); + portBASE_TYPE_ENTER_CRITICAL(); { if( ( pxTimer->ucStatus & tmrSTATUS_IS_ACTIVE ) == 0U ) { @@ -1180,7 +1183,7 @@ xReturn = pdTRUE; } } - taskEXIT_CRITICAL(); + portBASE_TYPE_EXIT_CRITICAL(); traceRETURN_xTimerIsTimerActive( xReturn ); diff --git a/third-party/libmetal/include.mk b/third-party/libmetal/include.mk index 2fc728e5..03ce3597 100644 --- a/third-party/libmetal/include.mk +++ b/third-party/libmetal/include.mk @@ -8,12 +8,12 @@ ifdef CONFIG_USE_FREERTOS endif - BUILD_INC_PATH_DIR += $(SDK_DIR)/third-party/libmetal \ - $(SDK_DIR)/third-party/libmetal/metal/compiler/gcc + BUILD_INC_PATH_DIR += $(SDK_DIR)/third-party/libmetal \ + $(SDK_DIR)/third-party/libmetal/metal/compiler/gcc ifdef CONFIG_TARGET_ARMV8_AARCH32 - BUILD_INC_PATH_DIR += $(SDK_DIR)/third-party/libmetal/metal/processor/arm + BUILD_INC_PATH_DIR += $(SDK_DIR)/third-party/libmetal/metal/processor/generic endif ifdef CONFIG_TARGET_ARMV8_AARCH64 diff --git a/third-party/libmetal/metal/system/freertos/CMakeLists.txt b/third-party/libmetal/metal/system/freertos/CMakeLists.txt deleted file mode 100644 index 98ca318c..00000000 --- a/third-party/libmetal/metal/system/freertos/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -collect (PROJECT_LIB_HEADERS alloc.h) -collect (PROJECT_LIB_HEADERS assert.h) -collect (PROJECT_LIB_HEADERS cache.h) -collect (PROJECT_LIB_HEADERS condition.h) -collect (PROJECT_LIB_HEADERS io.h) -collect (PROJECT_LIB_HEADERS irq.h) -collect (PROJECT_LIB_HEADERS log.h) -collect (PROJECT_LIB_HEADERS mutex.h) -collect (PROJECT_LIB_HEADERS sleep.h) -collect (PROJECT_LIB_HEADERS sys.h) - -collect (PROJECT_LIB_SOURCES condition.c) -collect (PROJECT_LIB_SOURCES device.c) -collect (PROJECT_LIB_SOURCES init.c) -collect (PROJECT_LIB_SOURCES io.c) -collect (PROJECT_LIB_SOURCES irq.c) -collect (PROJECT_LIB_SOURCES shmem.c) -collect (PROJECT_LIB_SOURCES time.c) - -if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_MACHINE}) - add_subdirectory(${PROJECT_MACHINE}) -endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_MACHINE}) - -# vim: expandtab:ts=2:sw=2:smartindent diff --git a/third-party/libmetal/metal/system/freertos/alloc.h b/third-party/libmetal/metal/system/freertos/alloc.h deleted file mode 100644 index deea3017..00000000 --- a/third-party/libmetal/metal/system/freertos/alloc.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file freertos/alloc.c - * @brief FreeRTOS libmetal memory allocattion definitions. - */ - -#ifndef __METAL_ALLOC__H__ -#error "Include metal/alloc.h instead of metal/freertos/alloc.h" -#endif - -#ifndef __METAL_FREERTOS_ALLOC__H__ -#define __METAL_FREERTOS_ALLOC__H__ - -#include "FreeRTOS.h" - -#ifdef __cplusplus -extern "C" { -#endif - -static inline void *metal_allocate_memory(unsigned int size) -{ - return pvPortMalloc(size); -} - -static inline void metal_free_memory(void *ptr) -{ - vPortFree(ptr); -} - -#ifdef __cplusplus -} -#endif - -#endif /* __METAL_FREERTOS_ALLOC__H__ */ diff --git a/third-party/libmetal/metal/system/freertos/assert.h b/third-party/libmetal/metal/system/freertos/assert.h deleted file mode 100644 index 49a80bf6..00000000 --- a/third-party/libmetal/metal/system/freertos/assert.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2018, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file assert.h - * @brief FreeRTOS assertion support. - */ -#ifndef __METAL_ASSERT__H__ -#error "Include metal/assert.h instead of metal/freertos/assert.h" -#endif - -#ifndef __METAL_FREERTOS_ASSERT__H__ -#define __METAL_FREERTOS_ASSERT__H__ - -#include - -/** - * @brief Assertion macro for FreeRTOS applications. - * @param cond Condition to evaluate. - */ -#define metal_sys_assert(cond) assert(cond) - -#endif /* __METAL_FREERTOS_ASSERT__H__ */ - diff --git a/third-party/libmetal/metal/system/freertos/cache.h b/third-party/libmetal/metal/system/freertos/cache.h deleted file mode 100644 index a14d9bfe..00000000 --- a/third-party/libmetal/metal/system/freertos/cache.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2018, Linaro Limited. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file freertos/cache.h - * @brief FreeRTOS cache operation primitives for libmetal. - */ - -#ifndef __METAL_CACHE__H__ -#error "Include metal/cache.h instead of metal/freertos/cache.h" -#endif - -#ifndef __METAL_FREERTOS_CACHE__H__ -#define __METAL_FREERTOS_CACHE__H__ - -#ifdef __cplusplus -extern "C" { -#endif - -extern void metal_machine_cache_flush(void *addr, unsigned int len); -extern void metal_machine_cache_invalidate(void *addr, unsigned int len); - -static inline void __metal_cache_flush(void *addr, unsigned int len) -{ - metal_machine_cache_flush(addr, len); -} - -static inline void __metal_cache_invalidate(void *addr, unsigned int len) -{ - metal_machine_cache_invalidate(addr, len); -} - -#ifdef __cplusplus -} -#endif - -#endif /* __METAL_FREERTOS_CACHE__H__ */ diff --git a/third-party/libmetal/metal/system/freertos/condition.c b/third-party/libmetal/metal/system/freertos/condition.c deleted file mode 100644 index e3bebc9d..00000000 --- a/third-party/libmetal/metal/system/freertos/condition.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file generic/condition.c - * @brief Generic libmetal condition variable handling. - */ - -#include - -int metal_condition_wait(struct metal_condition *cv, - metal_mutex_t *m) -{ - /* TODO: Implement condition variable for FreeRTOS */ - (void)cv; - (void)m; - return 0; -} diff --git a/third-party/libmetal/metal/system/freertos/condition.h b/third-party/libmetal/metal/system/freertos/condition.h deleted file mode 100644 index 87f13748..00000000 --- a/third-party/libmetal/metal/system/freertos/condition.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file generic/condition.h - * @brief Generic condition variable primitives for libmetal. - */ - -#ifndef __METAL_CONDITION__H__ -#error "Include metal/condition.h instead of metal/freertos/condition.h" -#endif - -#ifndef __METAL_FREERTOS_CONDITION__H__ -#define __METAL_FREERTOS_CONDITION__H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct metal_condition { - metal_mutex_t *m; /**< mutex. - * The condition variable is attached to this mutex - * when it is waiting. It is also used to check - * correctness in case there are multiple waiters. - */ - - atomic_int v; /**< condition variable value. */ -}; - -/** Static metal condition variable initialization. */ -#define METAL_CONDITION_INIT { NULL, ATOMIC_VAR_INIT(0) } - -static inline void metal_condition_init(struct metal_condition *cv) -{ - /* TODO: Implement condition variable for FreeRTOS */ - (void)cv; -} - -static inline int metal_condition_signal(struct metal_condition *cv) -{ - /* TODO: Implement condition variable for FreeRTOS */ - (void)cv; - return 0; -} - -static inline int metal_condition_broadcast(struct metal_condition *cv) -{ - /* TODO: Implement condition variable for FreeRTOS */ - (void)cv; - return 0; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __METAL_FREERTOS_CONDITION__H__ */ diff --git a/third-party/libmetal/metal/system/freertos/device.c b/third-party/libmetal/metal/system/freertos/device.c deleted file mode 100644 index 97246b89..00000000 --- a/third-party/libmetal/metal/system/freertos/device.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2017, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file freertos/device.c - * @brief FreeRTOS device operations. - */ - -#include -#include -#include - -int metal_generic_dev_sys_open(struct metal_device *dev) -{ - struct metal_io_region *io; - unsigned int i; - - /* map I/O memory regions */ - for (i = 0; i < dev->num_regions; i++) { - io = &dev->regions[i]; - if (!io->size) - break; - metal_sys_io_mem_map(io); - } - - return 0; -} - diff --git a/third-party/libmetal/metal/system/freertos/init.c b/third-party/libmetal/metal/system/freertos/init.c deleted file mode 100644 index 66418244..00000000 --- a/third-party/libmetal/metal/system/freertos/init.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file freertos/init.c - * @brief FreeRTOS libmetal initialization. - */ - -#include -#include -#include - -struct metal_state _metal; - -int metal_sys_init(const struct metal_init_params *params) -{ - metal_unused(params); - metal_bus_register(&metal_generic_bus); - return 0; -} - -void metal_sys_finish(void) -{ - metal_bus_unregister(&metal_generic_bus); -} diff --git a/third-party/libmetal/metal/system/freertos/io.c b/third-party/libmetal/metal/system/freertos/io.c deleted file mode 100644 index 842b66e9..00000000 --- a/third-party/libmetal/metal/system/freertos/io.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2017, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file freertos/io.c - * @brief FreeRTOS libmetal io operations - */ - -#include - -void metal_sys_io_mem_map(struct metal_io_region *io) -{ - unsigned long p; - size_t psize; - void *va; - - va = io->virt; - psize = io->size; - if (psize) { - if (psize >> io->page_shift) - psize = (size_t)1 << io->page_shift; - for (p = 0; p <= (io->size >> io->page_shift); p++) { - metal_machine_io_mem_map(va, io->physmap[p], - psize, io->mem_flags); - va += psize; - } - } -} diff --git a/third-party/libmetal/metal/system/freertos/io.h b/third-party/libmetal/metal/system/freertos/io.h deleted file mode 100644 index 06457898..00000000 --- a/third-party/libmetal/metal/system/freertos/io.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2017, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file freertos/io.h - * @brief FreeRTOS specific io definitions. - */ - -#ifndef __METAL_IO__H__ -#error "Include metal/io.h instead of metal/freertos/io.h" -#endif - -#ifndef __METAL_FREEROTS_IO__H__ -#define __METAL_FREEROTS_IO__H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#if 1 - -/** - * @brief memory mapping for an I/O region - */ -void metal_sys_io_mem_map(struct metal_io_region *io); - -/** - * @brief memory mapping - */ -void *metal_machine_io_mem_map(void *va, metal_phys_addr_t pa, - size_t size, unsigned int flags); - -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __METAL_FREEROTS_IO__H__ */ diff --git a/third-party/libmetal/metal/system/freertos/irq.c b/third-party/libmetal/metal/system/freertos/irq.c deleted file mode 100644 index 3955e3f8..00000000 --- a/third-party/libmetal/metal/system/freertos/irq.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2016 - 2017, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file freertos/irq.c - * @brief FreeRTOS libmetal irq definitions. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -unsigned int metal_irq_save_disable(void) -{ - return sys_irq_save_disable(); -} - -void metal_irq_restore_enable(unsigned int flags) -{ - sys_irq_restore_enable(flags); -} - diff --git a/third-party/libmetal/metal/system/freertos/irq.h b/third-party/libmetal/metal/system/freertos/irq.h deleted file mode 100644 index 72c11d42..00000000 --- a/third-party/libmetal/metal/system/freertos/irq.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file freertos/irq.c - * @brief FreeRTOS libmetal irq definitions. - */ - -#ifndef __METAL_IRQ__H__ -#error "Include metal/irq.h instead of metal/freertos/irq.h" -#endif - -#ifndef __METAL_FREERTOS_IRQ__H__ -#define __METAL_FREERTOS_IRQ__H__ - -#endif /* __METAL_FREERTOS_IRQ__H__ */ diff --git a/third-party/libmetal/metal/system/freertos/log.h b/third-party/libmetal/metal/system/freertos/log.h deleted file mode 100644 index f805c8d5..00000000 --- a/third-party/libmetal/metal/system/freertos/log.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2018, Linaro Limited. and Contributors. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Linaro nor the names of its contributors may be used - * to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * @file freertos/log.h - * @brief FreeRTOS libmetal log handler definition. - */ - -#ifndef __METAL_METAL_LOG__H__ -#error "Include metal/log.h instead of metal/freertos/log.h" -#endif - -#ifndef __METAL_FREERTOS_LOG__H__ -#define __METAL_FREERTOS_LOG__H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __METAL_FREERTOS_LOG__H__ */ diff --git a/third-party/libmetal/metal/system/freertos/mutex.h b/third-party/libmetal/metal/system/freertos/mutex.h deleted file mode 100644 index 4efaab25..00000000 --- a/third-party/libmetal/metal/system/freertos/mutex.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file freertos/mutex.h - * @brief FreeRTOS mutex primitives for libmetal. - */ - -#ifndef __METAL_MUTEX__H__ -#error "Include metal/mutex.h instead of metal/freertos/mutex.h" -#endif - -#ifndef __METAL_FREERTOS_MUTEX__H__ -#define __METAL_FREERTOS_MUTEX__H__ - -#include -#include "FreeRTOS.h" -#include "semphr.h" - - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - SemaphoreHandle_t m; -} metal_mutex_t; - -/* - * METAL_MUTEX_INIT - used for initializing an mutex element in a static struct - * or global - */ -#if defined(__GNUC__) -#define METAL_MUTEX_INIT(m) { NULL }; \ -_Pragma("GCC warning\"static initialisation of the mutex is deprecated\"") -#elif defined(__ICCARM__) -#define DO_PRAGMA(x) _Pragma(#x) -#define METAL_MUTEX_INIT(m) { NULL }; \ -DO_PRAGMA(message("Warning: static initialisation of the mutex is deprecated")) -#else -#define METAL_MUTEX_INIT(m) { NULL } -#endif - -/* - * METAL_MUTEX_DEFINE - used for defining and initializing a global or - * static singleton mutex - */ -#define METAL_MUTEX_DEFINE(m) metal_mutex_t m = METAL_MUTEX_INIT(m) - -static inline void __metal_mutex_init(metal_mutex_t *mutex) -{ - metal_assert(mutex); - mutex->m = xSemaphoreCreateMutex(); - metal_assert(mutex->m); -} - -static inline void __metal_mutex_deinit(metal_mutex_t *mutex) -{ - metal_assert(mutex && mutex->m); - vSemaphoreDelete(mutex->m); - mutex->m = NULL; -} - -static inline int __metal_mutex_try_acquire(metal_mutex_t *mutex) -{ - metal_assert(mutex && mutex->m); - return xSemaphoreTake(mutex->m, (TickType_t)0); -} - -static inline void __metal_mutex_acquire(metal_mutex_t *mutex) -{ - metal_assert(mutex && mutex->m); - xSemaphoreTake(mutex->m, portMAX_DELAY); -} - -static inline void __metal_mutex_release(metal_mutex_t *mutex) -{ - metal_assert(mutex && mutex->m); - xSemaphoreGive(mutex->m); -} - -static inline int __metal_mutex_is_acquired(metal_mutex_t *mutex) -{ - metal_assert(mutex && mutex->m); - return (!xSemaphoreGetMutexHolder(mutex->m)) ? 0 : 1; -} - -#ifdef __cplusplus -} -#endif - -#endif /* __METAL_FREERTOS_MUTEX__H__ */ diff --git a/third-party/libmetal/metal/system/freertos/shmem.c b/third-party/libmetal/metal/system/freertos/shmem.c deleted file mode 100644 index b0f29f60..00000000 --- a/third-party/libmetal/metal/system/freertos/shmem.c +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2015, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file freertos/shmem.c - * @brief FreeRTOS libmetal shared memory handling. - */ - -#include - -int metal_shmem_open(const char *name, size_t size, - struct metal_io_region **io) -{ - return metal_shmem_open_generic(name, size, io); -} diff --git a/third-party/libmetal/metal/system/freertos/sleep.h b/third-party/libmetal/metal/system/freertos/sleep.h deleted file mode 100644 index 60a58a17..00000000 --- a/third-party/libmetal/metal/system/freertos/sleep.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2018, Linaro Limited. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file freertos/sleep.h - * @brief FreeRTOS sleep primitives for libmetal. - */ - -#ifndef __METAL_SLEEP__H__ -#error "Include metal/sleep.h instead of metal/freertos/sleep.h" -#endif - -#ifndef __METAL_FREERTOS_SLEEP__H__ -#define __METAL_FREERTOS_SLEEP__H__ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -static inline int __metal_sleep_usec(unsigned int usec) -{ - const TickType_t xDelay = pdMS_TO_TICKS(usec/1000); - - vTaskDelay(xDelay ? xDelay : 1); - return 0; -} - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif /* __METAL_FREERTOS_SLEEP__H__ */ diff --git a/third-party/libmetal/metal/system/freertos/sys.h b/third-party/libmetal/metal/system/freertos/sys.h deleted file mode 100644 index 44592cdb..00000000 --- a/third-party/libmetal/metal/system/freertos/sys.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file freertos/sys.h - * @brief FreeRTOS system primitives for libmetal. - */ - -#ifndef __METAL_SYS__H__ -#error "Include metal/sys.h instead of metal/freertos/sys.h" -#endif - -#ifndef __METAL_FREERTOS_SYS__H__ -#define __METAL_FREERTOS_SYS__H__ - -#include "./ft_platform/sys.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef METAL_MAX_DEVICE_REGIONS -#define METAL_MAX_DEVICE_REGIONS 1 -#endif - -/** Structure for FreeRTOS libmetal runtime state. */ -struct metal_state { - - /** Common (system independent) data. */ - struct metal_common_state common; -}; - -#if 1 - -/** - * @brief restore interrupts to state before disable_global_interrupt() - */ -void sys_irq_restore_enable(unsigned int flags); - -/** - * @brief disable all interrupts - */ -unsigned int sys_irq_save_disable(void); - -#endif /* METAL_INTERNAL */ - -#ifdef __cplusplus -} -#endif - -#endif /* __METAL_FREERTOS_SYS__H__ */ diff --git a/third-party/libmetal/metal/system/freertos/time.c b/third-party/libmetal/metal/system/freertos/time.c deleted file mode 100644 index 03544eb3..00000000 --- a/third-party/libmetal/metal/system/freertos/time.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file freertos/time.c - * @brief freertos libmetal time handling. - */ - -#include -#include -#include - -unsigned long long metal_get_timestamp(void) -{ - return (unsigned long long)(1000 * portTICK_PERIOD_MS * xTaskGetTickCount()); -} - diff --git a/third-party/libmetal/src.mk b/third-party/libmetal/src.mk index dbe387d3..436a5b3d 100644 --- a/third-party/libmetal/src.mk +++ b/third-party/libmetal/src.mk @@ -1,22 +1,14 @@ ifdef CONFIG_USE_LIBMETAL +LIBMETAL_DIR = $(abspath $(SDK_DIR)/third-party/libmetal) ifdef CONFIG_USE_FREERTOS CSRCS_RELATIVE_FILES += $(wildcard metal/system/freertos/ft_platform/*.c) - - ifdef CONFIG_TARGET_ARMV8_AARCH32 - CSRCS_RELATIVE_FILES += $(wildcard metal/system/freertos/*.c) - endif - - ifdef CONFIG_TARGET_ARMV8_AARCH64 - CSRCS_RELATIVE_FILES += $(wildcard metal/system/freertos/*.c) - endif + ABSOLUTE_CFILES += $(wildcard $(LIBMETAL_DIR)/metal/system/freertos/*.c) endif -LIBMETAL_DIR = $(abspath $(SDK_DIR)/third-party/libmetal) - ABSOLUTE_CFILES +=$(wildcard $(LIBMETAL_DIR)/metal/*.c) diff --git a/third-party/openamp/include.mk b/third-party/openamp/include.mk index 853c4b26..3e76bace 100644 --- a/third-party/openamp/include.mk +++ b/third-party/openamp/include.mk @@ -15,7 +15,10 @@ BUILD_INC_PATH_DIR += $(SDK_DIR)/third-party/openamp/lib \ $(SDK_DIR)/third-party/openamp/lib/remoteproc \ $(SDK_DIR)/third-party/openamp/lib/rpmsg \ $(SDK_DIR)/third-party/openamp/lib/service/rpmsg/rpc \ - $(SDK_DIR)/third-party/openamp/lib/virtio + $(SDK_DIR)/third-party/openamp/lib/virtio \ + $(SDK_DIR)/third-party/openamp/openamp-system-reference/examples/legacy_apps/include \ + $(SDK_DIR)/third-party/openamp/openamp-system-reference/examples/legacy_apps/machine/phytium \ + $(SDK_DIR)/third-party/openamp/openamp-system-reference/examples/legacy_apps/system/generic/machine/phytium endif #CONFIG_USE_OPENAMP \ No newline at end of file diff --git a/third-party/openamp/ports/helper.h b/third-party/openamp/ports/helper.h deleted file mode 100644 index ec903e06..00000000 --- a/third-party/openamp/ports/helper.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2024, Phytium Technology Co., Ltd. All Rights Reserved. - * - * Licensed under the BSD 3-Clause License (the "License"); you may not use - * this file except in compliance with the License. You may obtain a copy of - * the License at - * - * https://opensource.org/licenses/BSD-3-Clause - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * - * FilePath: helper.h - * Created Date: 2024-07-03 11:19:49 - * Last Modified: 2024-07-10 17:05:29 - * Description: This file is for helper functions. - * - * Modify History: - * Ver Who Date Changes - * ----- ---------- -------- --------------------------------- - */ - -#ifndef HELPER_H_ -#define HELPER_H_ - -#include "ftypes.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -int init_system(void); -void cleanup_system(void); - -#ifdef __cplusplus -} -#endif - -#endif /* */ diff --git a/third-party/openamp/ports/phytium_os_rproc.c b/third-party/openamp/ports/phytium_os_rproc.c deleted file mode 100644 index 290cc9a0..00000000 --- a/third-party/openamp/ports/phytium_os_rproc.c +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Copyright (C) 2024, Phytium Technology Co., Ltd. All Rights Reserved. - * - * Licensed under the BSD 3-Clause License (the "License"); you may not use - * this file except in compliance with the License. You may obtain a copy of - * the License at - * - * https://opensource.org/licenses/BSD-3-Clause - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * - * FilePath: phytium_os_rproc.c - * Created Date: 2024-07-02 16:01:32 - * Last Modified: 2025-06-20 16:21:15 - * Description: This file is for - * - * Modify History: - * Ver Who Date Changes - * ----- ---------- -------- --------------------------------- - * 1.0 huanghe 2022/04/21 first release - * 2.0 liusm 2024/07/03 modify for phytium platform - */ - -/***************************** Include Files *********************************/ - -#include -#include -#include -#include -#include -#include -#include "platform_info.h" -#include "sdkconfig.h" -#include "fdebug.h" -#include "finterrupt.h" -#include "stdio.h" -#include "fmmu.h" -#include "ftypes.h" -#include "fcpu_info.h" -#include "fpsci.h" -#include "fcache.h" -#include "sdkconfig.h" -/************************** Constant Definitions *****************************/ - -/**************************** Type Definitions *******************************/ - -/************************** Variable Definitions *****************************/ - -/***************** Macros (Inline Functions) Definitions *********************/ - -#define PHYTIUM_RPROC_DEBUG_TAG "PHYTIUM_RPROC" -#define PHYTIUM_RPROC_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( PHYTIUM_RPROC_DEBUG_TAG, format, ##__VA_ARGS__) -#define PHYTIUM_RPROC_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( PHYTIUM_RPROC_DEBUG_TAG, format, ##__VA_ARGS__) -#define PHYTIUM_RPROC_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( PHYTIUM_RPROC_DEBUG_TAG, format, ##__VA_ARGS__) - -/************************** Function Prototypes ******************************/ - -#ifdef CONFIG_USE_OPENAMP_IPI - -static void PhytiumIrqhandler(s32 vector, void *param) -{ - struct remoteproc *rproc = param; - struct remoteproc_priv *prproc; - prproc = rproc->priv; - (void)vector; - - if(!rproc) - { - PHYTIUM_RPROC_DEBUG_E("rproc is empty.") ; - return ; - } - - if (prproc->src_table_ready_flag != 1) - { - goto exit; - } - - if (rproc_check_rsc_table_stop(rproc)) - { - PHYTIUM_RPROC_DEBUG_E("stop flag found, cpu down!.\n\r") ; - rproc_set_stop_flag(); - FPsciCpuOff(); - return; - } - -exit: - atomic_flag_clear(&prproc->ipi_nokick); -} - -#endif - -static struct remoteproc * -PhytiumProcInit(struct remoteproc *rproc,struct remoteproc_ops *ops, - void *arg) -{ - struct remoteproc_priv *prproc = arg; - struct metal_device *kick_dev; - unsigned int irq_vect; - int ret; - - if (!rproc || !prproc || !ops) - { - return NULL; - } - ret = metal_device_open(prproc->kick_dev_bus_name, - prproc->kick_dev_name, - &kick_dev); - if (ret) - { - PHYTIUM_RPROC_DEBUG_E("Failed to open polling device: %d.\r\n", ret); - return NULL; - } - rproc->priv = prproc; - prproc->kick_dev = kick_dev; - -#ifdef CONFIG_USE_OPENAMP_IPI - u32 cpu_id; - atomic_store(&prproc->ipi_nokick, 1); - GetCpuId(&cpu_id); - PHYTIUM_RPROC_DEBUG_I("CPU ID : %d.", cpu_id) ; - /* Register interrupt handler and enable interrupt */ - irq_vect = (uintptr_t)kick_dev->irq_info; - PHYTIUM_RPROC_DEBUG_I("irq_vect is %d .", irq_vect) ; - InterruptSetPriority(irq_vect, IRQ_PRIORITY_VALUE_0) ; - InterruptInstall(irq_vect, PhytiumIrqhandler, rproc, "phytium_rproc") ; - InterruptUmask(irq_vect) ; -#else - prproc->kick_io = metal_device_io_region(kick_dev, 0); - if (!prproc->kick_io) - { - goto err1; - } - (void)irq_vect; - metal_io_write32(prproc->kick_io, 0, !POLL_STOP); -#endif /* !CONFIG_USE_OPENAMP_IPI */ - - rproc->ops = ops; - - return rproc; -err1: - metal_device_close(kick_dev); - return NULL; -} - - -static void PhytiumProcRemove(struct remoteproc *rproc) -{ - struct remoteproc_priv *prproc; - struct metal_device *dev; - - if (!rproc) - { - return; - } - - prproc = rproc->priv; -#ifdef CONFIG_USE_OPENAMP_IPI - dev = prproc->kick_dev; - if (dev) - { - PHYTIUM_RPROC_DEBUG_I("Start to remove \r\n") ; - InterruptMask((uintptr_t)dev->irq_info); - } -#else /* RPMSG_NO_IPI */ - (void)dev; -#endif /* !RPMSG_NO_IPI */ - metal_device_close(prproc->kick_dev); - -} - -static void * -PhytiumProcMmap(struct remoteproc *rproc, metal_phys_addr_t *pa, - metal_phys_addr_t *da, size_t size, - unsigned int attribute, struct metal_io_region **io) -{ - struct remoteproc_mem *mem; - metal_phys_addr_t lpa, lda; - struct metal_io_region *tmpio; - - lpa = *pa; - lda = *da; - - if (lpa == METAL_BAD_PHYS && lda == METAL_BAD_PHYS) - return NULL; - if (lpa == METAL_BAD_PHYS) - lpa = lda; - if (lda == METAL_BAD_PHYS) - lda = lpa; - - if (!attribute) - attribute = (MT_NORMAL|MT_P_RW_U_NA); - - mem = metal_allocate_memory(sizeof(*mem)); - if (!mem) - { - return NULL; - } - tmpio = metal_allocate_memory(sizeof(*tmpio)); - if (!tmpio) - { - metal_free_memory(mem); - return NULL; - } - remoteproc_init_mem(mem, NULL, lpa, lda, size, tmpio); - /* va is the same as pa in this platform */ - metal_io_init(tmpio, (void *)lpa, &mem->pa, size, -1, attribute, NULL); - remoteproc_add_mem(rproc, mem); - *pa = lpa; - *da = lda; - if (io) - { - *io = tmpio; - } - return metal_io_phys_to_virt(tmpio, mem->pa); - -} - -static int PhytiumProcNotify(struct remoteproc *rproc, uint32_t id) -{ - struct remoteproc_priv *prproc; - - (void)id; - if (!rproc) - { - return -1; - } - - prproc = rproc->priv; - -#ifndef CONFIG_USE_OPENAMP_IPI - metal_io_write32(prproc->kick_io, 0, POLL_STOP); -#else -#ifdef CONFIG_USE_MASTER_VRING_DEFINE - InterruptCoreInterSend((uintptr)(prproc->kick_dev->irq_info), prproc->cpu_id); -#else - InterruptCoreInterSend((uintptr)(prproc->kick_dev->irq_info), 1 << prproc->cpu_id); -#endif -#endif /* RPMSG_NO_IPI */ - - return 0; -} - -static int Phytium_rproc_start(struct remoteproc *rproc) -{ - struct remoteproc_priv *priv; - FError ret; - - priv = rproc->priv; - FCacheDCacheFlush(); - ret = FPsciCpuMaskOn(1 << priv->cpu_id , (uintptr_t)rproc->bootaddr); - if (ret != 0) { - PHYTIUM_RPROC_DEBUG_E("Failed to start core id 0x%x, ret=0x%x\n\r", priv->cpu_id, ret); - return -1; - } - - return 0; -} - -static int PhytiumProcStop(struct remoteproc *rproc) -{ - /* It is lacking a stop operation in the libPM */ - (void)rproc; - return 0; -} - -static int PhytiumProcShutdown(struct remoteproc *rproc) -{ - struct remoteproc_priv *priv; - int ret; - struct remoteproc_mem *mem; - struct metal_list *node; - - priv = rproc->priv; - /* Delete all the registered remoteproc memories */ - metal_list_for_each(&rproc->mems, node) { - struct metal_list *tmpnode; - metal_phys_addr_t pa, pa_end; - - mem = metal_container_of(node, struct remoteproc_mem, node); - tmpnode = node; - node = tmpnode->prev; - metal_list_del(tmpnode); - metal_free_memory(mem->io); - metal_free_memory(mem); - } -/* - if (rproc->state == RPROC_RUNNING) - { - ret = XPm_ForcePowerDown(priv->cpu_id, REQUEST_ACK_NO); - if (ret != XST_SUCCESS) - return -1; - } -*/ - return 0; -} - -struct remoteproc_ops phytium_proc_ops = -{ - .init = PhytiumProcInit, - .remove = PhytiumProcRemove, - .mmap = PhytiumProcMmap, - .notify = PhytiumProcNotify, - .start = Phytium_rproc_start, - .stop = PhytiumProcStop, - .shutdown = PhytiumProcShutdown, -}; - diff --git a/third-party/openamp/ports/platform_info.c b/third-party/openamp/ports/platform_info.c deleted file mode 100644 index 46d01a8c..00000000 --- a/third-party/openamp/ports/platform_info.c +++ /dev/null @@ -1,288 +0,0 @@ -/* - * Copyright (C) 2022, Phytium Technology Co., Ltd. All Rights Reserved. - * - * Licensed under the BSD 3-Clause License (the "License"); you may not use - * this file except in compliance with the License. You may obtain a copy of - * the License at - * - * https://opensource.org/licenses/BSD-3-Clause - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * - * FilePath: platform_info.c - * Date: 2022-02-23 11:24:12 - * LastEditTime: 2022-02-23 11:43:44 - * Description:  This file is for defining platform specific data and implements APIs to set platform specific information for OpenAMP. - * - * Modify History: - * Ver   Who        Date         Changes - * ----- ------     --------    -------------------------------------- - * 1.0 huanghe 2022/04/21 first release - * 1.1 liusm 2024/07/05 modify for phytium platform - */ - -/***************************** Include Files *********************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "platform_info.h" -#include "rsc_table.h" -#include "sdkconfig.h" -#include "fdebug.h" -#include "helper.h" - -#define FT_PLAT_INFO_DEBUG_TAG "FT_PLAT_INFO" -#define FT_PLAT_INFO_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( FT_PLAT_INFO_DEBUG_TAG, format, ##__VA_ARGS__) -#define FT_PLAT_INFO_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( FT_PLAT_INFO_DEBUG_TAG, format, ##__VA_ARGS__) -#define FT_PLAT_INFO_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( FT_PLAT_INFO_DEBUG_TAG, format, ##__VA_ARGS__) - -#ifdef CONFIG_USE_OPENAMP_IPI - #define _rproc_wait() asm volatile("wfi") -#endif /* !RPMSG_NO_IPI */ - -/************************** Variable Definitions *****************************/ -static volatile unsigned int stop_flag = 0; -extern struct remoteproc_ops phytium_proc_ops ; - -#ifdef CONFIG_USE_MASTER_VRING_DEFINE -static metal_phys_addr_t linux_share_buffer; -#endif - -/************************** Function Prototypes ******************************/ -#ifdef CONFIG_USE_OPENAMP_IPI -unsigned int rproc_check_rsc_table_stop(struct remoteproc *rproc) -{ - if (!rproc) { - FT_PLAT_INFO_DEBUG_E("rproc NULL! \r\n"); - return 0; - } - struct remote_resource_table *table_ptr = rproc->rsc_table; - unsigned int *flag = table_ptr->reserved; - - if (*flag & REMOTE_PROC_STOP) { - return 1; - } else { - return 0; - } -} -#endif - -unsigned int rproc_get_stop_flag(void) -{ - return stop_flag; -} - -void rproc_set_stop_flag(void) -{ - stop_flag |= REMOTE_PROC_STOP; -} - -void rproc_clear_stop_flag(void) -{ - stop_flag &= ~REMOTE_PROC_STOP; -} - -struct remoteproc *platform_create_proc(struct remoteproc * rproc_inst,struct remoteproc_priv *priv ,struct metal_device *kick_dev) -{ - struct remoteproc * rproc; - - if (metal_register_generic_device(kick_dev)) - { - return NULL; - } - - /* Initialize remoteproc instance */ - /* metal_device_open(KICK_BUS_NAME,KICK_DEV_NAME,rproc_inst->priv->kick_dev) */ - /* rproc_inst->priv->kick_io = metal_device_io_region(rproc_inst->priv->kick_dev, 0); */ - rproc = remoteproc_init(rproc_inst, &phytium_proc_ops, priv) ; - - return rproc; -} - -int platform_setup_src_table(struct remoteproc *rproc_inst,metal_phys_addr_t *rsc_table) -{ - metal_phys_addr_t pa; - struct remoteproc_priv *priv = rproc_inst->priv; - int ret; - // metal_phys_addr_t *rsc_table = priv->src_table_va ; - size_t rsc_size = sizeof(struct remote_resource_table) ; - unsigned int attribute = priv->src_table_attribute ; - - pa = (metal_phys_addr_t)rsc_table; - /* rproc_inst.mems rproc_inst.rsc_io*/ - /* 在OpenAMP应用中,通常需要通过remoteproc_mmap()函数将远程处理器中的共享内存映射到本地主机中,以便应用程序进行读写操作。*/ - (void *)remoteproc_mmap(rproc_inst, &pa, NULL, rsc_size, attribute, &rproc_inst->rsc_io); - - ret = remoteproc_set_rsc_table(rproc_inst, (struct resource_table *)rsc_table, rsc_size); - if (ret) - { - FT_PLAT_INFO_DEBUG_E("Failed to intialize remoteproc %d \r\n",ret); - remoteproc_remove(rproc_inst); - return -1; - } - priv->src_table_ready_flag = 1;/* 标记src_table已经准备好了 */ - return 0 ; -} - -int platform_setup_share_mems(struct remoteproc *rproc_inst) -{ - int ret; - struct remoteproc_priv *priv = rproc_inst->priv; -#ifdef CONFIG_USE_MASTER_VRING_DEFINE - struct remote_resource_table *table_ptr = rproc_inst->rsc_table; - priv->share_mem_pa = table_ptr->rpmsg_vdev.vring[0].da;/* 默认kernel vring[0].da 的首地址是整个sharebuffer 的起始位置 */ - (void *)remoteproc_mmap(rproc_inst, &priv->share_mem_pa, NULL, priv->share_mem_size, priv->share_mem_attribute, NULL); -#else - (void *)remoteproc_mmap(rproc_inst, &priv->share_mem_pa, &priv->share_mem_va, priv->share_mem_size, priv->share_mem_attribute, NULL); -#endif - return 0 ; -} - -struct rpmsg_device *platform_create_rpmsg_vdev(void *platform, unsigned int vdev_index, unsigned int role, - void (*rst_cb)(struct virtio_device *vdev), rpmsg_ns_bind_cb ns_bind_cb) -{ - struct remoteproc *rproc = platform; - struct rpmsg_virtio_device *rpmsg_vdev; - struct virtio_device *vdev; - void *shbuf; - struct metal_io_region *shbuf_io; - struct remoteproc_priv *priv = rproc->priv; - int ret; - - rpmsg_vdev = metal_allocate_memory(sizeof(*rpmsg_vdev)); - if (!rpmsg_vdev) - return NULL; - - shbuf_io = remoteproc_get_io_with_pa(rproc, priv->share_mem_pa); - if (!shbuf_io) - goto err1; - FT_PLAT_INFO_DEBUG_I("share_mem_pa is %p \r\n",priv->share_mem_pa); - shbuf = metal_io_phys_to_virt(shbuf_io, priv->share_mem_pa + priv->share_buffer_offset); - /* TODO: can we have a wrapper for the following two functions? */ - vdev = remoteproc_create_virtio(rproc, vdev_index, role, rst_cb); - if (!vdev) { - FT_PLAT_INFO_DEBUG_E("failed remoteproc_create_virtio\r\n"); - goto err1; - } - - /* Only RPMsg virtio master needs to initialize the shared buffers pool */ - rpmsg_virtio_init_shm_pool(&priv->shpool, shbuf, priv->share_mem_size - priv->share_buffer_offset); - - /* RPMsg virtio slave can set shared buffers pool argument to NULL */ - ret = rpmsg_init_vdev(rpmsg_vdev, vdev, ns_bind_cb, shbuf_io, &priv->shpool); - if (ret) { - FT_PLAT_INFO_DEBUG_E("failed rpmsg_init_vdev ret is %d \r\n",ret); - goto err2; - } - FT_PLAT_INFO_DEBUG_I("initializing rpmsg vdev\r\n"); - return rpmsg_virtio_get_rpmsg_device(rpmsg_vdev); - -err2: - remoteproc_remove_virtio(rproc, vdev); -err1: - metal_free_memory(rpmsg_vdev); - return NULL; -} - -int platform_poll(void *priv) -{ - struct remoteproc *rproc = priv; - struct remoteproc_priv *prproc; - unsigned int flags; - int ret; - - prproc = rproc->priv; - while (1) - { -#ifndef CONFIG_USE_OPENAMP_IPI - if (metal_io_read32(prproc->kick_io, 0) & POLL_STOP) //RPROC_M2S_SHIFT - { - ret = remoteproc_get_notification(rproc,RSC_NOTIFY_ID_ANY); - if (ret) - return ret; - break; - } - (void)flags; -#else /* !RPMSG_NO_IPI */ - flags = metal_irq_save_disable(); - if (!(atomic_flag_test_and_set(&prproc->ipi_nokick))) - { - metal_irq_restore_enable(flags); - ret = remoteproc_get_notification(rproc,RSC_NOTIFY_ID_ANY); - if (ret) - return ret; - break; - } - _rproc_wait(); - metal_irq_restore_enable(flags); -#endif /* RPMSG_NO_IPI */ - } - return 0; -} - - -int platform_poll_nonblocking(void *priv) -{ - struct remoteproc *rproc = priv; - struct remoteproc_priv *prproc; - unsigned int flags; - int ret; - - prproc = rproc->priv; - -#ifndef CONFIG_USE_OPENAMP_IPI - if (metal_io_read32(prproc->kick_io, 0) & POLL_STOP) //RPROC_M2S_SHIFT - { - ret = remoteproc_get_notification(rproc,RSC_NOTIFY_ID_ANY); - if (ret) - return ret; - } - (void)flags; -#else /* !RPMSG_NO_IPI */ - flags = metal_irq_save_disable(); - if (!(atomic_flag_test_and_set(&prproc->ipi_nokick))) - { - metal_irq_restore_enable(flags); - ret = remoteproc_get_notification(rproc,RSC_NOTIFY_ID_ANY); - if (ret) - return ret; - } - metal_irq_restore_enable(flags); -#endif /* RPMSG_NO_IPI */ - return 0; -} - -void platform_release_rpmsg_vdev(struct rpmsg_device *rpdev, void *platform) -{ - struct rpmsg_virtio_device *rpvdev; - struct remoteproc *rproc; - - rpvdev = metal_container_of(rpdev, struct rpmsg_virtio_device, rdev); - rproc = platform; - - rpmsg_deinit_vdev(rpvdev); - remoteproc_remove_virtio(rproc, rpvdev->vdev); -} - -int platform_cleanup(void *platform) -{ - int ret = 0; - struct remoteproc *rproc = platform; - - if (rproc) - ret = remoteproc_remove(rproc); - cleanup_system(); - - return ret; -} \ No newline at end of file diff --git a/third-party/openamp/ports/platform_info.h b/third-party/openamp/ports/platform_info.h deleted file mode 100644 index d8081d82..00000000 --- a/third-party/openamp/ports/platform_info.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2022, Phytium Technology Co., Ltd. All Rights Reserved. - * - * Licensed under the BSD 3-Clause License (the "License"); you may not use - * this file except in compliance with the License. You may obtain a copy of - * the License at - * - * https://opensource.org/licenses/BSD-3-Clause - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * - * FilePath: platform_info.h - * Date: 2022-02-23 11:24:12 - * LastEditTime: 2022-02-23 11:43:53 - * Description:  This file is for - * - * Modify History: - * Ver   Who        Date         Changes - * ----- ------     --------    -------------------------------------- - */ - -#ifndef PLATFORM_INFO_H_ -#define PLATFORM_INFO_H_ - -/***************************** Include Files *********************************/ -#include -#include -#include -#include -#include "sdkconfig.h" -#include "ftypes.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -#define POLL_STOP 0x1U -/* 需要宇linux 进行沟通 */ -#define REMOTE_PROC_STOP 0x0001U - -/**************************** Type Definitions *******************************/ - -struct remoteproc_priv { - const char *kick_dev_name; - const char *kick_dev_bus_name; - struct metal_device *kick_dev; - struct metal_io_region *kick_io; -#ifdef CONFIG_USE_OPENAMP_IPI - atomic_int ipi_nokick; -#endif /* !RPMSG_NO_IPI */ - unsigned int cpu_id ; - /* remoteproc elf address */ - metal_phys_addr_t elf_addr; - unsigned int src_table_ready_flag ; - /* src_table memory */ - u32 src_table_attribute ; - /* share_mem_size = |tx vring|rx vring|share buffer| */ - metal_phys_addr_t share_mem_va ; - metal_phys_addr_t share_mem_pa ; - u32 share_mem_size ; - u32 share_buffer_offset ; - u32 share_mem_attribute ; - struct rpmsg_virtio_shm_pool shpool; -}; - -/************************** Function Prototypes ******************************/ - -struct remoteproc *platform_create_proc(struct remoteproc * rproc_inst,struct remoteproc_priv *priv ,struct metal_device *kick_dev) ; - -int platform_setup_src_table(struct remoteproc *rproc_inst,metal_phys_addr_t *rsc_table) ; - -int platform_setup_share_mems(struct remoteproc *rproc_inst); - -struct rpmsg_device *platform_create_rpmsg_vdev(void *platform, unsigned int vdev_index, unsigned int role, - void (*rst_cb)(struct virtio_device *vdev), rpmsg_ns_bind_cb ns_bind_cb) ; -int platform_poll(void *priv); - -int platform_poll_nonblocking(void *priv) ; - -void platform_release_rpmsg_vdev(struct rpmsg_device *rpdev, void *platform); - -int platform_cleanup(void *platform); - -#ifdef CONFIG_USE_OPENAMP_IPI -unsigned int rproc_check_rsc_table_stop(struct remoteproc *rproc); -#endif - -unsigned int rproc_get_stop_flag(void); - -void rproc_set_stop_flag(void); - -void rproc_clear_stop_flag(void); - -#ifdef __cplusplus -} -#endif - - -#endif diff --git a/third-party/openamp/src.mk b/third-party/openamp/src.mk index 7b28f2c3..06b8b943 100644 --- a/third-party/openamp/src.mk +++ b/third-party/openamp/src.mk @@ -12,6 +12,8 @@ ABSOLUTE_CFILES += $(wildcard $(OPENAMP_C_DIR)/lib/*.c \ $(OPENAMP_C_DIR)/lib/remoteproc/*.c \ $(OPENAMP_C_DIR)/lib/rpmsg/*.c \ $(OPENAMP_C_DIR)/lib/service/rpmsg/rpc/*.c \ - $(OPENAMP_C_DIR)/lib/virtio/*.c ) + $(OPENAMP_C_DIR)/lib/utils/*.c \ + $(OPENAMP_C_DIR)/lib/virtio/*.c \ + $(OPENAMP_C_DIR)/openamp-system-reference/examples/legacy_apps/machine/phytium/*.c ) endif #CONFIG_USE_OPENAMP \ No newline at end of file -- Gitee