Skip to content

Commit c0aee5c

Browse files
JiafeiPannashif
authored andcommitted
soc: imx943: add imx943 soc support
This patch add i.MX 943 soc support. The i.MX 943 applications processors integrate up to four Arm Cortex-A55 cores and supports functional safety with built-in 2x Arm Cortex -M33 and -M7 cores which can be configured as a safety island. Optimizing performance and power efficiency for Industrial, IoT and automotive devices, i.MX 943 processors are built with NXP’s innovative Energy Flex architecture. Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
1 parent 9781a35 commit c0aee5c

File tree

11 files changed

+221
-0
lines changed

11 files changed

+221
-0
lines changed

soc/nxp/imx/imx9/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ if(CONFIG_SOC_MIMX9131)
55
add_subdirectory(imx91)
66
elseif(CONFIG_SOC_MIMX9352)
77
add_subdirectory(imx93)
8+
elseif(CONFIG_SOC_MIMX94398)
9+
add_subdirectory(imx943)
810
elseif(CONFIG_SOC_MIMX9596)
911
add_subdirectory(imx95)
1012
endif()
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright 2025 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
zephyr_include_directories(.)
5+
6+
if(CONFIG_SOC_MIMX94398_A55)
7+
add_subdirectory(a55)
8+
endif()

soc/nxp/imx/imx9/imx943/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright 2025 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_MIMX94398_A55
5+
select ARM64
6+
select CPU_CORTEX_A55
7+
select ARM_ARCH_TIMER if SYS_CLOCK_EXISTS
8+
select HAS_MCUX
9+
select HAS_MCUX_CACHE
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright 2025 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_SERIES_IMX9
5+
6+
rsource "Kconfig.defconfig.*"
7+
8+
endif # SOC_SERIES_IMX9
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright 2025 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_MIMX94398_A55
5+
6+
# Workaround for not being able to have commas in macro arguments
7+
DT_CHOSEN_Z_FLASH := zephyr,flash
8+
9+
config FLASH_SIZE
10+
default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_FLASH),0,K)
11+
12+
config FLASH_BASE_ADDRESS
13+
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))
14+
15+
# Enable GIC Safe Configuration to run multiple OSes on Cortex-A Cores
16+
config GIC_SAFE_CONFIG
17+
default y
18+
19+
config MCUX_CORE_SUFFIX
20+
default "_ca55" if SOC_MIMX94398_A55
21+
22+
config NUM_IRQS
23+
default 320
24+
25+
config SYS_CLOCK_HW_CYCLES_PER_SEC
26+
default 24000000
27+
28+
endif

soc/nxp/imx/imx9/imx943/Kconfig.soc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2025 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_MIMX94398
5+
bool
6+
select SOC_SERIES_IMX9
7+
8+
config SOC_MIMX94398_A55
9+
bool
10+
select SOC_MIMX94398
11+
help
12+
NXP i.MX943 A55
13+
14+
config SOC
15+
default "mimx94398" if SOC_MIMX94398
16+
17+
config SOC_PART_NUMBER_MIMX94398AVKM
18+
bool
19+
20+
config SOC_PART_NUMBER
21+
default "MIMX94398AVKM" if SOC_PART_NUMBER_MIMX94398AVKM
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright 2025 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
zephyr_include_directories(.)
5+
zephyr_sources_ifdef(CONFIG_ARM_MMU mmu_regions.c)
6+
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm64/scripts/linker.ld CACHE INTERNAL "")
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright 2025 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/arch/arm64/arm_mmu.h>
8+
#include <zephyr/devicetree.h>
9+
#include <zephyr/sys/util.h>
10+
11+
static const struct arm_mmu_region mmu_regions[] = {
12+
13+
MMU_REGION_FLAT_ENTRY("GIC", DT_REG_ADDR_BY_IDX(DT_NODELABEL(gic), 0),
14+
DT_REG_SIZE_BY_IDX(DT_NODELABEL(gic), 0),
15+
MT_DEVICE_nGnRnE | MT_P_RW_U_NA | MT_NS),
16+
17+
MMU_REGION_FLAT_ENTRY("GIC", DT_REG_ADDR_BY_IDX(DT_NODELABEL(gic), 1),
18+
DT_REG_SIZE_BY_IDX(DT_NODELABEL(gic), 1),
19+
MT_DEVICE_nGnRnE | MT_P_RW_U_NA | MT_NS),
20+
21+
MMU_REGION_DT_COMPAT_FOREACH_FLAT_ENTRY(nxp_mbox_imx_mu,
22+
(MT_DEVICE_nGnRnE | MT_P_RW_U_NA | MT_NS))
23+
24+
MMU_REGION_DT_COMPAT_FOREACH_FLAT_ENTRY(nxp_lpuart,
25+
(MT_DEVICE_nGnRnE | MT_P_RW_U_NA | MT_NS))
26+
};
27+
28+
const struct arm_mmu_config mmu_config = {
29+
.num_regions = ARRAY_SIZE(mmu_regions),
30+
.mmu_regions = mmu_regions,
31+
};

soc/nxp/imx/imx9/imx943/a55/soc.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Copyright 2025 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef _SOC_NXP_IMX_IMX943_A55_SOC_H_
8+
#define _SOC_NXP_IMX_IMX943_A55_SOC_H_
9+
10+
#include <fsl_device_registers.h>
11+
12+
#endif /* _SOC_NXP_IMX_IMX943_A55_SOC_H_ */

soc/nxp/imx/imx9/imx943/pinctrl_soc.h

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/*
2+
* Copyright 2025 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef ZEPHYR_SOC_ARM64_NXP_IMX943_PINCTRL_SOC_H_
8+
#define ZEPHYR_SOC_ARM64_NXP_IMX943_PINCTRL_SOC_H_
9+
10+
#include <zephyr/devicetree.h>
11+
#include <zephyr/types.h>
12+
#include "soc.h"
13+
14+
#ifdef __cplusplus
15+
extern "C" {
16+
#endif
17+
18+
#define PIN_CONFIG_TYPE_MUX 192
19+
#define PIN_CONFIG_TYPE_CONFIG 193
20+
#define PIN_CONFIG_TYPE_DAISY_ID 194
21+
#define PIN_CONFIG_TYPE_DAISY_CFG 195
22+
23+
#define IOMUXC_MUX_MODE(x) IOMUXC_SW_MUX_CTL_PAD_MUX_MODE(x)
24+
#define IOMUXC_SION(x) IOMUXC_SW_MUX_CTL_PAD_SION(x)
25+
26+
#define IOMUXC_MUXREG (IOMUXC_BASE)
27+
#define IOMUXC_CFGREG (IOMUXC_BASE + 0x304)
28+
#define IOMUXC_DAISYREG (IOMUXC_BASE + 0x608)
29+
30+
#define MCUX_IMX_INPUT_SCHMITT_ENABLE_SHIFT IOMUXC_SW_PAD_CTL_PAD_HYS_SHIFT
31+
#define MCUX_IMX_DRIVE_OPEN_DRAIN_SHIFT IOMUXC_SW_PAD_CTL_PAD_OD_SHIFT
32+
#define MCUX_IMX_BIAS_PULL_DOWN_SHIFT IOMUXC_SW_PAD_CTL_PAD_PD_SHIFT
33+
#define MCUX_IMX_BIAS_PULL_UP_SHIFT IOMUXC_SW_PAD_CTL_PAD_PU_SHIFT
34+
#define MCUX_IMX_SLEW_RATE_SHIFT IOMUXC_SW_PAD_CTL_PAD_FSEL1_SHIFT
35+
#define MCUX_IMX_DRIVE_STRENGTH_SHIFT IOMUXC_SW_PAD_CTL_PAD_DSE_SHIFT
36+
37+
#define IOMUXC_INPUT_ENABLE_SHIFT 23 /* Shift to a bit not used by IOMUXC_SW_PAD_CTL */
38+
#define IOMUXC_INPUT_ENABLE(x) ((x >> IOMUXC_INPUT_ENABLE_SHIFT) & 0x1)
39+
40+
#define Z_PINCTRL_IOMUXC_PINCFG_INIT(node_id) \
41+
((DT_PROP(node_id, input_schmitt_enable) << MCUX_IMX_INPUT_SCHMITT_ENABLE_SHIFT) | \
42+
(DT_PROP(node_id, drive_open_drain) << MCUX_IMX_DRIVE_OPEN_DRAIN_SHIFT) | \
43+
(DT_PROP(node_id, bias_pull_down) << MCUX_IMX_BIAS_PULL_DOWN_SHIFT) | \
44+
(DT_PROP(node_id, bias_pull_up) << MCUX_IMX_BIAS_PULL_UP_SHIFT) | \
45+
(DT_ENUM_IDX(node_id, slew_rate) << MCUX_IMX_SLEW_RATE_SHIFT) | \
46+
((~(0xffffffff << DT_ENUM_IDX(node_id, drive_strength))) \
47+
<< MCUX_IMX_DRIVE_STRENGTH_SHIFT) | \
48+
(DT_PROP(node_id, input_enable) << IOMUXC_INPUT_ENABLE_SHIFT))
49+
50+
/* This struct must be present. It is used by the mcux gpio driver */
51+
struct pinctrl_soc_pinmux {
52+
uint32_t mux_register; /*!< IOMUXC SW_PAD_MUX register */
53+
uint32_t config_register; /*!< IOMUXC SW_PAD_CTL register */
54+
uint32_t input_register; /*!< IOMUXC SELECT_INPUT DAISY register */
55+
uint8_t mux_mode: 4; /*!< Mux value for SW_PAD_MUX register */
56+
uint32_t input_daisy: 4; /*!< Mux value for SELECT_INPUT_DAISY register */
57+
};
58+
59+
struct pinctrl_soc_pin {
60+
struct pinctrl_soc_pinmux pinmux;
61+
uint32_t pin_ctrl_flags; /*!< value to write to IOMUXC_SW_PAD_CTL register */
62+
};
63+
64+
typedef struct pinctrl_soc_pin pinctrl_soc_pin_t;
65+
66+
/* This definition must be present. It is used by the mcux gpio driver */
67+
#define MCUX_IMX_PINMUX(node_id) \
68+
{ \
69+
.mux_register = DT_PROP_BY_IDX(node_id, pinmux, 0), \
70+
.config_register = DT_PROP_BY_IDX(node_id, pinmux, 4), \
71+
.input_register = DT_PROP_BY_IDX(node_id, pinmux, 2), \
72+
.mux_mode = DT_PROP_BY_IDX(node_id, pinmux, 1), \
73+
.input_daisy = DT_PROP_BY_IDX(node_id, pinmux, 3), \
74+
}
75+
76+
#define Z_PINCTRL_PINMUX(group_id, pin_prop, idx) \
77+
MCUX_IMX_PINMUX(DT_PHANDLE_BY_IDX(group_id, pin_prop, idx))
78+
79+
#define Z_PINCTRL_STATE_PIN_INIT(group_id, pin_prop, idx) \
80+
{ \
81+
.pinmux = Z_PINCTRL_PINMUX(group_id, pin_prop, idx), \
82+
.pin_ctrl_flags = Z_PINCTRL_IOMUXC_PINCFG_INIT(group_id), \
83+
},
84+
85+
#define Z_PINCTRL_STATE_PINS_INIT(node_id, prop) \
86+
{DT_FOREACH_CHILD_VARGS(DT_PHANDLE(node_id, prop), DT_FOREACH_PROP_ELEM, pinmux, \
87+
Z_PINCTRL_STATE_PIN_INIT)};
88+
89+
#ifdef __cplusplus
90+
}
91+
#endif
92+
93+
#endif /* ZEPHYR_SOC_ARM64_NXP_IMX943_PINCTRL_SOC_H_ */

0 commit comments

Comments
 (0)