Skip to content

Commit a84257c

Browse files
AndreHeinemans-NXPxiaoxiang781216
authored andcommitted
arch/arm: add support for imx95 m7 core
- Add support for i.MX95 M7 core - Interprocessor communication by RPMSG and SCMI - Drivers available for UART, SPI, I2C, CAN, IO and timers
1 parent 5db6767 commit a84257c

Some content is hidden

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

70 files changed

+34946
-0
lines changed

arch/arm/Kconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,20 @@ config ARCH_CHIP_IMX6
183183
---help---
184184
Freescale iMX.6 architectures (Cortex-A9)
185185

186+
config ARCH_CHIP_IMX9_CORTEX_M
187+
bool "NXP iMX.9 Cortex-M7"
188+
select ARCH_CORTEXM7
189+
select ARCH_HAVE_MPU
190+
select ARCH_HAVE_FETCHADD
191+
select ARCH_HAVE_RAMFUNCS
192+
select ARCH_HAVE_TICKLESS
193+
select ARCH_HAVE_I2CRESET
194+
select ARCH_HAVE_SPI_CS_CONTROL
195+
select ARM_HAVE_MPU_UNIFIED
196+
select ARMV7M_HAVE_STACKCHECK
197+
---help---
198+
iMX.9 architectures (Cortex-M7)
199+
186200
config ARCH_CHIP_IMXRT
187201
bool "NXP/Freescale iMX.RT"
188202
select ARCH_CORTEXM7
@@ -1124,6 +1138,7 @@ config ARCH_CHIP
11241138
default "gd32f4" if ARCH_CHIP_GD32F4
11251139
default "imx1" if ARCH_CHIP_IMX1
11261140
default "imx6" if ARCH_CHIP_IMX6
1141+
default "imx9" if ARCH_CHIP_IMX9_CORTEX_M
11271142
default "imxrt" if ARCH_CHIP_IMXRT
11281143
default "kinetis" if ARCH_CHIP_KINETIS
11291144
default "kl" if ARCH_CHIP_KL
@@ -1536,6 +1551,9 @@ endif
15361551
if ARCH_CHIP_IMX6
15371552
source "arch/arm/src/imx6/Kconfig"
15381553
endif
1554+
if ARCH_CHIP_IMX9_CORTEX_M
1555+
source "arch/arm/src/imx9/Kconfig"
1556+
endif
15391557
if ARCH_CHIP_IMXRT
15401558
source "arch/arm/src/imxrt/Kconfig"
15411559
endif

arch/arm/include/imx9/chip.h

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/****************************************************************************
2+
* arch/arm/include/imx9/chip.h
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
* SPDX-FileCopyrightText: 2024 NXP
6+
*
7+
* Licensed to the Apache Software Foundation (ASF) under one or more
8+
* contributor license agreements. See the NOTICE file distributed with
9+
* this work for additional information regarding copyright ownership. The
10+
* ASF licenses this file to you under the Apache License, Version 2.0 (the
11+
* "License"); you may not use this file except in compliance with the
12+
* License. You may obtain a copy of the License at
13+
*
14+
* http://www.apache.org/licenses/LICENSE-2.0
15+
*
16+
* Unless required by applicable law or agreed to in writing, software
17+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
19+
* License for the specific language governing permissions and limitations
20+
* under the License.
21+
*
22+
****************************************************************************/
23+
24+
#ifndef __ARCH_ARM_INCLUDE_IMX9_CHIP_H
25+
#define __ARCH_ARM_INCLUDE_IMX9_CHIP_H
26+
27+
/****************************************************************************
28+
* Included Files
29+
****************************************************************************/
30+
31+
#include <nuttx/config.h>
32+
33+
/****************************************************************************
34+
* Pre-processor Definitions
35+
****************************************************************************/
36+
37+
/* NVIC priority levels *****************************************************/
38+
39+
/* Each priority field holds an 8-bit priority value, 0-15. The lower the
40+
* value, the greater the priority of the corresponding interrupt. The i.MX
41+
* RT processor implements only bits[7:4] of each field, bits[3:0] read as
42+
* zero and ignore writes.
43+
*/
44+
45+
#define NVIC_SYSH_PRIORITY_MIN 0xf0 /* All bits[7:4] set is min pri */
46+
#define NVIC_SYSH_PRIORITY_DEFAULT 0x80 /* Midpoint is the default */
47+
#define NVIC_SYSH_PRIORITY_MAX 0x00 /* Zero is maximum priority */
48+
#define NVIC_SYSH_PRIORITY_STEP 0x40 /* Two bits of interrupt pri used */
49+
50+
#define IMX9_GPIO_NPORTS 4
51+
52+
#endif /* __ARCH_ARM_INCLUDE_IMX9_CHIP_H */

arch/arm/include/imx9/imx95_irq.h

Lines changed: 420 additions & 0 deletions
Large diffs are not rendered by default.

arch/arm/include/imx9/irq.h

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/****************************************************************************
2+
* arch/arm/include/imx9/irq.h
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
* SPDX-FileCopyrightText: 2024 NXP
6+
*
7+
* Licensed to the Apache Software Foundation (ASF) under one or more
8+
* contributor license agreements. See the NOTICE file distributed with
9+
* this work for additional information regarding copyright ownership. The
10+
* ASF licenses this file to you under the Apache License, Version 2.0 (the
11+
* "License"); you may not use this file except in compliance with the
12+
* License. You may obtain a copy of the License at
13+
*
14+
* http://www.apache.org/licenses/LICENSE-2.0
15+
*
16+
* Unless required by applicable law or agreed to in writing, software
17+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
19+
* License for the specific language governing permissions and limitations
20+
* under the License.
21+
*
22+
****************************************************************************/
23+
24+
/* This file should never be included directly but, rather,
25+
* only indirectly through nuttx/irq.h
26+
*/
27+
28+
#ifndef __ARCH_ARM_INCLUDE_IMX9_IRQ_H
29+
#define __ARCH_ARM_INCLUDE_IMX9_IRQ_H
30+
31+
/****************************************************************************
32+
* Included Files
33+
****************************************************************************/
34+
35+
#include <nuttx/config.h>
36+
37+
#if defined(CONFIG_ARCH_CHIP_IMX95_M7)
38+
# include <arch/imx9/imx95_irq.h>
39+
#else
40+
# error "Unrecognized i.MX9 architecture"
41+
#endif
42+
43+
/****************************************************************************
44+
* Pre-processor Definitions
45+
****************************************************************************/
46+
47+
/* IRQ numbers. The IRQ number corresponds vector number and hence map
48+
* directly to bits in the NVIC. This does, however, waste several words
49+
* of memory in the IRQ to handle mapping tables.
50+
*/
51+
52+
/* Common Processor Exceptions (vectors 0-15) */
53+
54+
#define IMX9_IRQ_RESERVED (0) /* Reserved vector .. only used with
55+
* CONFIG_DEBUG_FEATURES */
56+
57+
/* Vector 0: Reset stack pointer value */
58+
59+
/* Vector 1: Reset(not handled by IRQ) */
60+
61+
#define IMX9_IRQ_NMI (2) /* Vector 2: Non-Maskable Int (NMI) */
62+
#define IMX9_IRQ_HARDFAULT (3) /* Vector 3: Hard fault */
63+
#define IMX9_IRQ_MEMFAULT (4) /* Vector 4: Memory management (MPU) */
64+
#define IMX9_IRQ_BUSFAULT (5) /* Vector 5: Bus fault */
65+
#define IMX9_IRQ_USAGEFAULT (6) /* Vector 6: Usage fault */
66+
/* Vectors 7-10: Reserved */
67+
68+
#define IMX9_IRQ_SVCALL (11) /* Vector 11: SVC call */
69+
#define IMX9_IRQ_DBGMONITOR (12) /* Vector 12: Debug Monitor */
70+
/* Vector 13: Reserved */
71+
72+
#define IMX9_IRQ_PENDSV (14) /* Vector 14: Pendable SSR */
73+
#define IMX9_IRQ_SYSTICK (15) /* Vector 15: System tick */
74+
75+
/* Chip-Specific External interrupts */
76+
77+
#define IMX9_IRQ_EXTINT (16) /* Vector number of the first ext int */
78+
#define ARMV7M_PERIPHERAL_INTERRUPTS IMX9_IRQ_NEXTINT
79+
80+
#endif /* __ARCH_ARM_INCLUDE_IMX9_IRQ_H */

arch/arm/src/imx9/CMakeLists.txt

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# ##############################################################################
2+
# arch/arm/src/imx9/CMakeLists.txt
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
7+
# license agreements. See the NOTICE file distributed with this work for
8+
# additional information regarding copyright ownership. The ASF licenses this
9+
# file to you under the Apache License, Version 2.0 (the "License"); you may not
10+
# use this file except in compliance with the License. You may obtain a copy of
11+
# 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 under
19+
# the License.
20+
#
21+
# ##############################################################################
22+
23+
set(SRCS
24+
imx9_allocateheap.c
25+
imx9_start.c
26+
imx9_clockconfig.c
27+
imx9_gpio.c
28+
imx9_iomuxc.c
29+
imx9_irq.c
30+
imx9_timerisr.c
31+
imx9_idle.c)
32+
33+
if(CONFIG_IMX9_SCMI)
34+
list(APPEND SRCS imx9_scmi.c)
35+
# NXP SDK SCMI interface for pinctrl and clocking
36+
endif()
37+
38+
if(CONFIG_RPTUN)
39+
list(APPEND SRCS imx9_rsctable.c imx9_rptun.c)
40+
endif()
41+
42+
if(CONFIG_IMX9_MU)
43+
list(APPEND SRCS imx9_mu.c)
44+
endif()
45+
46+
if(CONFIG_ARM_MPU)
47+
list(APPEND SRCS imx9_mpuinit.c)
48+
endif()
49+
50+
if(CONFIG_IMX9_FLEXCAN)
51+
list(APPEND SRCS imx9_flexcan.c)
52+
endif()
53+
54+
if(CONFIG_IMX9_LPUART)
55+
list(APPEND SRCS imx9_lpuart.c imx9_lowputc.c)
56+
endif()
57+
58+
if(CONFIG_IMX9_GPIO_IRQ)
59+
list(APPEND SRCS imx9_gpioirq.c)
60+
endif()
61+
62+
if(CONFIG_IMX9_FLEXIO_PWM)
63+
list(APPEND SRCS imx9_flexio_pwm.c)
64+
endif()
65+
66+
if(CONFIG_IMX9_TPM_PWM)
67+
list(APPEND SRCS imx9_tpm_pwm.c)
68+
endif()
69+
70+
if(CONFIG_IMX9_USBDEV)
71+
list(APPEND SRCS imx9_usbdev.c)
72+
endif()
73+
74+
if(CONFIG_IMX9_LPI2C)
75+
list(APPEND SRCS imx9_lpi2c.c)
76+
endif()
77+
78+
if(CONFIG_IMX9_LPSPI)
79+
list(APPEND SRCS imx9_lpspi.c)
80+
endif()
81+
82+
if(CONFIG_IMX9_EDMA)
83+
list(APPEND SRCS imx9_edma.c)
84+
endif()
85+
86+
target_sources(arch PRIVATE ${SRCS})

0 commit comments

Comments
 (0)