Skip to content

Commit da6b9fc

Browse files
committed
[xuantie] 添加玄铁R,C全系列RTOS支持
1 parent 8903606 commit da6b9fc

File tree

174 files changed

+18974
-236
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+18974
-236
lines changed

bsp/xuantie/libraries/device_drivers/drv_usart.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <rtdbg.h>
2828

2929
#if !defined(BSP_USING_UART0) && !defined(BSP_USING_UART1) && !defined(BSP_USING_UART2) && !defined(BSP_USING_UART3) \
30-
&& !defined(BSP_USING_UART4) && !defined(BSP_USING_UART5) && !defined(BSP_USING_UART6) && !defined(BSP_USING_UART7)
30+
&& !defined(BSP_USING_UART4) && !defined(BSP_USING_UART5) && !defined(BSP_USING_UART6) && !defined(BSP_USING_UART7)
3131
#error "Please define at least one BSP_USING_UARTx"
3232
/* this driver can be disabled at menuconfig -> RT-Thread Components -> Device Drivers */
3333
#endif
@@ -62,7 +62,7 @@ static rt_err_t xuantie_configure(struct rt_serial_device *serial, struct serial
6262
ret = csi_uart_baud(&uart->uart, cfg->baud_rate);
6363
if (ret != CSI_OK)
6464
{
65-
return RT_ERROR;
65+
return -RT_ERROR;
6666
}
6767

6868
csi_uart_data_bits_t data_bits;
@@ -123,7 +123,7 @@ static rt_err_t xuantie_configure(struct rt_serial_device *serial, struct serial
123123
ret = csi_uart_format(&uart->uart, data_bits, parity, stop_bits);
124124
if (ret != CSI_OK)
125125
{
126-
return RT_ERROR;
126+
return -RT_ERROR;
127127
}
128128

129129
return RT_EOK;
@@ -136,7 +136,7 @@ static rt_err_t xuantie_control(struct rt_serial_device *serial, int cmd, void *
136136
case RT_DEVICE_CTRL_CONFIG:
137137
return xuantie_configure(serial, (struct serial_configure *)arg);
138138
default:
139-
return RT_ERROR;
139+
return -RT_ERROR;
140140
}
141141
}
142142

@@ -148,8 +148,8 @@ static int xuantie_putc(struct rt_serial_device *serial, char c)
148148
ret = csi_uart_send(&uart->uart, &c, 1, 50);
149149
if (ret == 1)
150150
return RT_EOK;
151-
152-
return RT_ERROR;
151+
152+
return -RT_ERROR;
153153
}
154154

155155
static int xuantie_getc(struct rt_serial_device *serial)
@@ -160,7 +160,7 @@ static int xuantie_getc(struct rt_serial_device *serial)
160160

161161
csi_uart_receive(&uart->uart, &c, 1, 0x5);
162162
dw_uart_enable_recv_irq(uart_base);
163-
return c;
163+
return c;
164164
}
165165

166166
static const struct rt_uart_ops xuantie_uart_ops =
@@ -192,7 +192,7 @@ int rt_hw_usart_init(void)
192192
if (result != CSI_OK)
193193
{
194194
LOG_E("Failed to initialize UART %d", uart_obj[i].config->idx);
195-
return RT_ERROR;
195+
return -RT_ERROR;
196196
}
197197

198198
/* Init UART object */
@@ -210,7 +210,7 @@ int rt_hw_usart_init(void)
210210
{
211211
LOG_E("Failed to register UART device %s", uart_obj[i].config->name);
212212
csi_uart_uninit(&uart_obj[i].uart);
213-
return RT_ERROR;
213+
return -RT_ERROR;
214214
}
215215
}
216216
return result;

bsp/xuantie/libraries/device_drivers/drv_usart.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2006-2022, RT-Thread Development Team
2+
* Copyright (c) 2006-2025, RT-Thread Development Team
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*

bsp/xuantie/libraries/xuantie_libraries/chip_riscv_dummy/include/asm/riscv_asm_macro.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/*
2020
* attention: don't modify this file as a suggest
2121
* you should copy from chip_riscv_dummy/include/asm/riscv_asm_macro.h and keep it newer
22-
* please contact xuantie-rtos os team if have question
22+
* please contact xuantie-rtos os team if have question
2323
*/
2424

2525
#ifndef __RISCV_ASM_MACRO_H__

bsp/xuantie/libraries/xuantie_libraries/chip_riscv_dummy/include/asm/riscv_csr.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,30 @@
1919
/*
2020
* attention: don't modify this file as a suggest
2121
* you should copy from chip_riscv_dummy/include/asm/riscv_csr.h and keep it newer
22-
* please contact xuantie-rtos os team if have question
22+
* please contact xuantie-rtos os team if have question
2323
*/
2424

2525
#ifndef __RISCV_CSR_H__
2626
#define __RISCV_CSR_H__
2727

2828
#if __riscv_xlen == 64
29-
#define portWORD_SIZE 8
30-
#define store_x sd
31-
#define load_x ld
29+
#define portWORD_SIZE 8
30+
#define store_x sd
31+
#define load_x ld
3232
#elif __riscv_xlen == 32
33-
#define store_x sw
34-
#define load_x lw
35-
#define portWORD_SIZE 4
33+
#define store_x sw
34+
#define load_x lw
35+
#define portWORD_SIZE 4
3636
#else
37-
#error Assembler did not define __riscv_xlen
37+
#error Assembler did not define __riscv_xlen
3838
#endif
3939

4040
#if __riscv_flen == 64
41-
#define fstore_x fsd
42-
#define fload_x fld
41+
#define fstore_x fsd
42+
#define fload_x fld
4343
#elif __riscv_flen == 32
44-
#define fstore_x fsw
45-
#define fload_x flw
44+
#define fstore_x fsw
45+
#define fload_x flw
4646
#endif
4747

4848
#if defined(CONFIG_RISCV_SMODE) && CONFIG_RISCV_SMODE
@@ -136,7 +136,7 @@
136136
#define MSTATUS_FS_SHIFT 13
137137
#define MSTATUS_MS_SHIFT 25
138138

139-
#define INSERT_FIELD(val, which, fieldval) (((val) & ~(which)) | ((fieldval) * ((which) & ~((which)-1))))
139+
#define INSERT_FIELD(val, which, fieldval) (((val) & ~(which)) | ((fieldval) * ((which) & ~((which)-1))))
140140

141141
#if CONFIG_CPU_XUANTIE_C906 || CONFIG_CPU_XUANTIE_C906FD || CONFIG_CPU_XUANTIE_C906FDV || CONFIG_CPU_XUANTIE_C908 || CONFIG_CPU_XUANTIE_C908V ||CONFIG_CPU_XUANTIE_C908I || CONFIG_CPU_XUANTIE_R910 || CONFIG_CPU_XUANTIE_R920
142142
#define ATTR_SO (1ull << 4)

bsp/xuantie/libraries/xuantie_libraries/chip_riscv_dummy/include/drv/dev_tag.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ typedef enum {
9090
DEV_RAMBUS_120SI_TAG,
9191
DEV_RAMBUS_120SII_TAG,
9292
DEV_RAMBUS_120SIII_TAG,
93-
DEV_WJ_AVFS_TAG,
93+
DEV_WJ_AVFS_TAG,
9494
DEV_WJ_BMU_TAG,
9595
} csi_dev_tag_t;
9696

bsp/xuantie/libraries/xuantie_libraries/chip_riscv_dummy/include/dw_timer_ll.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*
2-
* Copyright (C) 2017-2024 Alibaba Group Holding Limited
2+
* Copyright (C) 2017-2024 Alibaba Group Holding Limited
33
*/
44

55
/*******************************************************
6-
* @file dw_timer_ll.h
7-
* @brief header file for timer ll driver
6+
* @file dw_timer_ll.h
7+
* @brief header file for timer ll driver
88
* @version V1.0
9-
* @date 9. April 2020
9+
* @date 9. April 2020
1010
* ******************************************************/
1111

1212
#ifndef _DW_TIMER_LL_H_
@@ -21,7 +21,7 @@ extern "C"
2121
{
2222
#endif
2323

24-
/*! Timer1 Control Reg, offset: 0x08 */
24+
/*! Timer1 Control Reg, offset: 0x08 */
2525
#define DW_TIMER_CTL_ENABLE_SEL_Pos (0U)
2626
#define DW_TIMER_CTL_ENABLE_SEL_Msk (0x1U << DW_TIMER_CTL_ENABLE_SEL_Pos)
2727
#define DW_TIMER_CTL_ENABLE_SEL_EN DW_TIMER_CTL_ENABLE_SEL_Msk

bsp/xuantie/libraries/xuantie_libraries/chip_riscv_dummy/src/arch/c906/SConscript renamed to bsp/xuantie/libraries/xuantie_libraries/chip_riscv_dummy/src/arch/c906fd/SConscript

File renamed without changes.

bsp/xuantie/libraries/xuantie_libraries/chip_riscv_dummy/src/arch/c906/startup.S renamed to bsp/xuantie/libraries/xuantie_libraries/chip_riscv_dummy/src/arch/c906fd/startup.S

File renamed without changes.

bsp/xuantie/libraries/xuantie_libraries/chip_riscv_dummy/src/arch/c906/system.c renamed to bsp/xuantie/libraries/xuantie_libraries/chip_riscv_dummy/src/arch/c906fd/system.c

File renamed without changes.

bsp/xuantie/libraries/xuantie_libraries/chip_riscv_dummy/src/arch/c906/trap_c.c renamed to bsp/xuantie/libraries/xuantie_libraries/chip_riscv_dummy/src/arch/c906fd/trap_c.c

File renamed without changes.

0 commit comments

Comments
 (0)