Skip to content

Commit 4edecbe

Browse files
committed
arch/tricore: support tc4evb board
add new chip named tc4xx and board tc4evb Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
1 parent fed5971 commit 4edecbe

69 files changed

Lines changed: 9021 additions & 4521 deletions

Some content is hidden

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

arch/tricore/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,13 @@ config HAVE_SECURITY_CORE
126126
if ARCH_CHIP_TC3XX
127127
source "arch/tricore/src/tc3xx/Kconfig"
128128
endif
129+
if ARCH_CHIP_TC4XX
130+
source "arch/tricore/src/tc4xx/Kconfig"
131+
endif
129132
if ARCH_CHIP_TC397
130133
source "arch/tricore/src/tc397/Kconfig"
131134
endif
135+
if ARCH_CHIP_TC4DA
136+
source "arch/tricore/src/tc4da/Kconfig"
137+
endif
132138
endif # ARCH_TRICORE

arch/tricore/include/irq.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ extern "C"
157157
/****************************************************************************
158158
* Public Types
159159
****************************************************************************/
160+
160161
struct xcptcontext
161162
{
162163
#ifdef CONFIG_ENABLE_ALL_SIGNALS

arch/tricore/include/tc4da/chip.h

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/****************************************************************************
2+
* arch/tricore/include/tc4da/chip.h
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Licensed to the Apache Software Foundation (ASF) under one or more
7+
* contributor license agreements. See the NOTICE file distributed with
8+
* this work for additional information regarding copyright ownership. The
9+
* ASF licenses this file to you under the Apache License, Version 2.0 (the
10+
* "License"); you may not use this file except in compliance with the
11+
* License. You may obtain a copy of the License at
12+
*
13+
* http://www.apache.org/licenses/LICENSE-2.0
14+
*
15+
* Unless required by applicable law or agreed to in writing, software
16+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18+
* License for the specific language governing permissions and limitations
19+
* under the License.
20+
*
21+
****************************************************************************/
22+
23+
#ifndef __ARCH_TRICORE_INCLUDE_TC4DA_CHIP_H
24+
#define __ARCH_TRICORE_INCLUDE_TC4DA_CHIP_H
25+
26+
/****************************************************************************
27+
* Included Files
28+
****************************************************************************/
29+
30+
#include <nuttx/config.h>
31+
32+
/****************************************************************************
33+
* Pre-processor Prototypes
34+
****************************************************************************/
35+
36+
/****************************************************************************
37+
* Public Types
38+
****************************************************************************/
39+
40+
/****************************************************************************
41+
* Public Data
42+
****************************************************************************/
43+
44+
/****************************************************************************
45+
* Public Functions Prototypes
46+
****************************************************************************/
47+
48+
#endif /* __ARCH_TRICORE_INCLUDE_TC4DA_CHIP_H */

arch/tricore/include/tc4da/irq.h

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/****************************************************************************
2+
* arch/tricore/include/tc4da/irq.h
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Licensed to the Apache Software Foundation (ASF) under one or more
7+
* contributor license agreements. See the NOTICE file distributed with
8+
* this work for additional information regarding copyright ownership. The
9+
* ASF licenses this file to you under the Apache License, Version 2.0 (the
10+
* "License"); you may not use this file except in compliance with the
11+
* License. You may obtain a copy of the License at
12+
*
13+
* http://www.apache.org/licenses/LICENSE-2.0
14+
*
15+
* Unless required by applicable law or agreed to in writing, software
16+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18+
* License for the specific language governing permissions and limitations
19+
* under the License.
20+
*
21+
****************************************************************************/
22+
23+
/* This file should never be included directly but, rather,
24+
* only indirectly through nuttx/irq.h
25+
*/
26+
27+
#ifndef __ARCH_TRICORE_INCLUDE_TC4DA_IRQ_H
28+
#define __ARCH_TRICORE_INCLUDE_TC4DA_IRQ_H
29+
30+
/****************************************************************************
31+
* Included Files
32+
****************************************************************************/
33+
34+
/****************************************************************************
35+
* Pre-processor Prototypes
36+
****************************************************************************/
37+
38+
#define TRICORE_UART_RX_IRQ 173
39+
40+
/****************************************************************************
41+
* Public Types
42+
****************************************************************************/
43+
44+
/****************************************************************************
45+
* Inline functions
46+
****************************************************************************/
47+
48+
/****************************************************************************
49+
* Public Data
50+
****************************************************************************/
51+
52+
/****************************************************************************
53+
* Public Function Prototypes
54+
****************************************************************************/
55+
56+
#ifndef __ASSEMBLY__
57+
#ifdef __cplusplus
58+
#define EXTERN extern "C"
59+
extern "C"
60+
{
61+
#else
62+
#define EXTERN extern
63+
#endif
64+
65+
#undef EXTERN
66+
#ifdef __cplusplus
67+
}
68+
#endif
69+
#endif
70+
71+
#endif /* __ARCH_TRICORE_INCLUDE_TC4DA_IRQ_H */

arch/tricore/src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
# the License.
2020
#
2121
# ##############################################################################
22+
2223
add_subdirectory(${ARCH_SUBDIR})
2324
add_subdirectory(${NUTTX_CHIP_ABS_DIR} EXCLUDE_FROM_ALL exclude_chip)
2425
add_subdirectory(common)

arch/tricore/src/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
include $(TOPDIR)/Make.defs
2424
include chip/Make.defs
25+
include common/Make.defs
2526

2627
ifeq ($(CONFIG_ARCH_CHIP_TC3XX),y)
2728
ARCH_SUBDIR = tc3xx

arch/tricore/src/cmake/ToolchainGnuc.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ elseif(CONFIG_ARCH_CHIP_TC4XX)
3131
set(ARCH_SUBDIR tc4xx)
3232
endif()
3333

34-
include(chip.cmake)
34+
include(${CMAKE_CURRENT_LIST_DIR}/chip.cmake)
3535

3636
set(TOOLCHAIN_PREFIX tricore-elf)
3737
set(CMAKE_LIBRARY_ARCHITECTURE ${TOOLCHAIN_PREFIX})

arch/tricore/src/common/tricore_cache.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <stdint.h>
2828

2929
#include "tricore_internal.h"
30+
#include "IfxCpu_cfg.h"
3031

3132
/****************************************************************************
3233
* Pre-processor Definitions

arch/tricore/src/common/tricore_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
# include <IfxCpu_reg.h>
4040
# include <Ifx_Ssw_Compilers.h>
41-
# include <Tricore/Compilers/Compilers.h>
41+
# include <Compilers/Compilers.h>
4242
# include <IfxCpu_Intrinsics.h>
4343
#endif
4444

arch/tricore/src/common/tricore_irq.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,12 @@ void up_affinity_irq(int irq, cpu_set_t cpuset)
216216
* so routing to the first cpu in cpuset.
217217
*/
218218

219+
#ifdef CONFIG_ARCH_CHIP_TC3XX
219220
IfxSrc_init(src, ffs(cpuset) - 1, irq_prio);
221+
#else
222+
IfxSrc_init(src, ffs(cpuset) - 1, irq_prio, IfxSrc_VmId_none);
223+
#endif
224+
220225
IfxSrc_enable(src);
221226
}
222227

0 commit comments

Comments
 (0)