From c59b8f6f3180a9843b0e7ebaa413b0cae6ad4bd6 Mon Sep 17 00:00:00 2001 From: liushengming1118 Date: Thu, 11 Apr 2024 09:46:18 +0800 Subject: [PATCH] update sdk --- docs/ChangeLog.md | 18 ++++ drivers/gpio/fgpio/fgpio_os.c | 3 +- drivers/include.mk | 4 +- drivers/makefile | 1 + drivers/port/fdrivers_port.c | 63 +++++++++++++ drivers/port/fdrivers_port.h | 90 +++++++++++++++++++ drivers/port/src.mk | 2 + .../system/amp/openamp_for_linux/README.md | 1 + example/system/amp/openamp_for_linux/main.c | 2 +- install.py | 2 +- 10 files changed, 182 insertions(+), 4 deletions(-) create mode 100644 drivers/port/fdrivers_port.c create mode 100644 drivers/port/fdrivers_port.h create mode 100644 drivers/port/src.mk diff --git a/docs/ChangeLog.md b/docs/ChangeLog.md index e404f78b..ebe84f9e 100644 --- a/docs/ChangeLog.md +++ b/docs/ChangeLog.md @@ -1,5 +1,23 @@ +# Phytium FreeRTOS SDK 2024-04-10 ChangeLog + +Change Log since 2024-04-10 + +## drivers + +- add port drivers + +# Phytium FreeRTOS SDK 2024-04-10 ChangeLog + +Change Log since 2024-04-08 + +## driver + +- solve gpio interrupt can not select the type + # Phytium FreeRTOS SDK 2024-04-08 ChangeLog +Change Log since 2024-04-01 + ## driver - solve gpio interrupt can not work diff --git a/drivers/gpio/fgpio/fgpio_os.c b/drivers/gpio/fgpio/fgpio_os.c index 1e6f5f41..96c38781 100644 --- a/drivers/gpio/fgpio/fgpio_os.c +++ b/drivers/gpio/fgpio/fgpio_os.c @@ -220,6 +220,7 @@ FError FFreeRTOSSetupPin(FFreeRTOSFGpio *const instance, const FFreeRTOSGpioPinC FGpioPin *const pin = &instance->pins[pin_id.port][pin_id.pin]; FError err = FT_SUCCESS; boolean irq_one_time = TRUE; + FGpioIrqType irq_type = config->irq_type; err = FGpioOsTakeSema(instance->locker); if (FFREERTOS_GPIO_OK != err) @@ -266,7 +267,7 @@ FError FFreeRTOSSetupPin(FFreeRTOSFGpio *const instance, const FFreeRTOSGpioPinC } FGpioRegisterInterruptCB(pin, config->irq_handler, config->irq_args, irq_one_time); /* register intr callback */ } - + FGpioSetInterruptType(pin, irq_type); err_exit: FGpioOsGiveSema(instance->locker); return err; diff --git a/drivers/include.mk b/drivers/include.mk index 95953015..fc6cf46b 100644 --- a/drivers/include.mk +++ b/drivers/include.mk @@ -118,4 +118,6 @@ endif ifdef CONFIG_USE_I2S BUILD_INC_PATH_DIR += $(OS_DRV_CUR_DIR)/i2s -endif \ No newline at end of file +endif + +BUILD_INC_PATH_DIR += $(OS_DRV_CUR_DIR)/port \ No newline at end of file diff --git a/drivers/makefile b/drivers/makefile index 47fe0a6f..74276bd8 100644 --- a/drivers/makefile +++ b/drivers/makefile @@ -14,6 +14,7 @@ include spi/src.mk include timer/src.mk include wdt/src.mk include i2s/src.mk +include port/src.mk CSRCS_RELATIVE_FILES := $(foreach file, $(DRIVERS_CSRCS), $(file)) ASRCS_RELATIVE_FILES := $(foreach file, $(DRIVERS_ASRCS),$(file)) diff --git a/drivers/port/fdrivers_port.c b/drivers/port/fdrivers_port.c new file mode 100644 index 00000000..75bb3e3f --- /dev/null +++ b/drivers/port/fdrivers_port.c @@ -0,0 +1,63 @@ +/* + * Copyright : (C) 2023 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: fdrivers_port.c + * Created Date: 2023-10-17 08:29:18 + * Last Modified: 2023-11-21 17:03:55 + * Description: This file is for drive layer code decoupling + * + * Modify History: + * Ver Who Date Changes + * ----- ---------- -------- --------------------------------- + * 1.0 huanghe 2023/10/17 first release + */ +#include "fdrivers_port.h" + +#include "fcache.h" +#include "fsleep.h" + +/* cache */ +void FDriverDCacheRangeFlush(uintptr_t adr,size_t len) +{ + FCacheDCacheFlushRange(adr,len); +} + +void FDriverDCacheRangeInvalidate(uintptr_t adr,size_t len) +{ + FCacheDCacheInvalidateRange(adr,len); +} + + +void FDriverICacheRangeInvalidate(void) +{ + FCacheICacheInvalidate(); +} + + +/* time delay */ + +void FDriverUdelay(u32 usec) +{ + fsleep_microsec(usec); +} + +void FDriverMdelay(u32 msec) +{ + fsleep_millisec(msec); +} + +void FDriverSdelay(u32 sec) +{ + fsleep_seconds(sec); +} + diff --git a/drivers/port/fdrivers_port.h b/drivers/port/fdrivers_port.h new file mode 100644 index 00000000..460c6887 --- /dev/null +++ b/drivers/port/fdrivers_port.h @@ -0,0 +1,90 @@ +/* + * Copyright : (C) 2023 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: fdrivers_port.h + * Created Date: 2023-10-16 17:02:35 + * Last Modified: 2023-11-21 17:03:55 + * Description: This file is for drive layer code decoupling + * + * Modify History: + * Ver Who Date Changes + * ----- ---------- -------- --------------------------------- + * 1.0 huanghe 2023/10/17 first release + */ + +#ifndef FDRIVERS_PORT_H +#define FDRIVERS_PORT_H + +#include "ftypes.h" +#include "faarch.h" + +#include "fkernel.h" +#include "fdebug.h" +#include "sdkconfig.h" + +/***************************** Include Files *********************************/ +#ifdef __cplusplus +extern "C" +{ +#endif + +/* cache */ +void FDriverDCacheRangeFlush(uintptr_t adr,size_t len); + +void FDriverDCacheRangeInvalidate(uintptr_t adr,size_t len); + +void FDriverICacheRangeInvalidate(void); + + +/* memory barrier */ + +#define FDRIVER_DSB() DSB() + +#define FDRIVER_DMB() DMB() + +#define FDRIVER_ISB() ISB() + +/* time delay */ + +void FDriverUdelay(u32 usec); + +void FDriverMdelay(u32 msec); + +void FDriverSdelay(u32 sec); + +#ifndef FT_DEBUG_PRINT_I +#define FT_DEBUG_PRINT_I(TAG, format, ...) +#endif + +#ifndef FT_DEBUG_PRINT_I +#define FT_DEBUG_PRINT_E(TAG, format, ...) +#endif + +#ifndef FT_DEBUG_PRINT_I +#define FT_DEBUG_PRINT_D(TAG, format, ...) +#endif + +#ifndef FT_DEBUG_PRINT_W +#define FT_DEBUG_PRINT_W(TAG, format, ...) +#endif + +#ifndef FT_DEBUG_PRINT_V +#define FT_DEBUG_PRINT_V(TAG, format, ...) +#endif + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/drivers/port/src.mk b/drivers/port/src.mk new file mode 100644 index 00000000..f4fa5890 --- /dev/null +++ b/drivers/port/src.mk @@ -0,0 +1,2 @@ + +DRIVERS_CSRCS += port/fdrivers_port.c \ No newline at end of file diff --git a/example/system/amp/openamp_for_linux/README.md b/example/system/amp/openamp_for_linux/README.md index 541cb5ee..62b952cb 100644 --- a/example/system/amp/openamp_for_linux/README.md +++ b/example/system/amp/openamp_for_linux/README.md @@ -15,6 +15,7 @@ [OpenAMP](https://github.com/OpenAMP/open-amp.git) - 本例程主要提供了D2000/FT2004/E2000D/E2000Q/PHYTIUMPI Linux与RTOS之间的测试例程 - 本例程演示rpmsg用法的示例演示应用程序。此应用core0 中的程序为从机程序,core1 中的程序为主机linux程序,其目标是从核程序工作在echo 模式下,主核主动发送数据之后,从机程序会将收到的数据重新回复发送回去 +- 如果需要添加其他应用任务,则要求应用任务优先级比RpmsgEchoTask优先级(默认是4)高,否则应用任务无法执行。 - 参阅《飞腾嵌入式OpenAMP技术解决方案与用户操作手册v1.0》配置好linux环境,本例程只提供编译镜像 [手册链接](https://gitee.com/phytium_embedded/phytium-embedded-docs/tree/master/open-amp) diff --git a/example/system/amp/openamp_for_linux/main.c b/example/system/amp/openamp_for_linux/main.c index 0d575ac9..def6248f 100644 --- a/example/system/amp/openamp_for_linux/main.c +++ b/example/system/amp/openamp_for_linux/main.c @@ -13,7 +13,7 @@ * * FilePath: main.c * Created Date: 2022-02-24 16:56:46 - * Last Modified: 2024-03-04 19:50:56 + * Last Modified: 2024-04-11 09:36:01 * Description: This file is for This file is for AMP example that running rpmsg_echo_task and open scheduler * * Modify History: diff --git a/install.py b/install.py index ace33609..f42702a4 100755 --- a/install.py +++ b/install.py @@ -36,7 +36,7 @@ freertos_sdk_path = install_path print("Standalone SDK at {}".format(freertos_sdk_path)) # Add standalone sdk -standalone_sdk_v="14b5871f36fe95638c390c81a959641f62bee761" +standalone_sdk_v="cd15b23000d0c52968dc322b6d99025195bbf446" if (install_platform == windows_x64): standalone_path=freertos_sdk_path + '\\standalone' else: -- Gitee