Skip to content

Commit 811f1ca

Browse files
Merge branch 'master' of https://github.com/RoRa96/hal_nxp
Merged enet driver
2 parents 088fecc + 30bdef6 commit 811f1ca

19 files changed

+887413
-2
lines changed

dts/nxp/nxp_imx/mimx9596avzxn-pinctrl.dtsi

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

mcux/hal_nxp.cmake

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ zephyr_compile_definitions_ifdef(
5858
ENET_ENHANCEDBUFFERDESCRIPTOR_MODE
5959
)
6060

61+
zephyr_compile_definitions_ifdef(
62+
CONFIG_SOC_MIMX9596
63+
FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL=1
64+
)
65+
6166
zephyr_library_compile_definitions_ifdef(
6267
CONFIG_HAS_MCUX_CACHE FSL_SDK_ENABLE_DRIVER_CACHE_CONTROL
6368
)
@@ -150,8 +155,6 @@ include_driver_ifdef(CONFIG_UART_MCUX_FLEXCOMM flexcomm/usart driver_flexcomm_u
150155
include_driver_ifdef(CONFIG_WDT_MCUX_WWDT wwdt driver_wwdt)
151156
include_driver_ifdef(CONFIG_ADC_MCUX_ADC12 adc12 driver_adc12)
152157
include_driver_ifdef(CONFIG_ADC_MCUX_ADC16 adc16 driver_adc16)
153-
include_driver_ifdef(CONFIG_IPM_IMX mu driver_mu)
154-
include_driver_ifdef(CONFIG_MBOX_NXP_IMX_MU mu driver_mu)
155158
include_driver_ifdef(CONFIG_CAN_MCUX_FLEXCAN flexcan driver_flexcan)
156159
include_driver_ifdef(CONFIG_CAN_MCUX_FLEXCAN_FD flexcan driver_flexcan)
157160
include_driver_ifdef(CONFIG_COUNTER_NXP_PIT pit driver_pit)
@@ -271,6 +274,14 @@ elseif(CONFIG_SOC_MIMXRT1189_CM33)
271274
include_driver_ifdef(CONFIG_HAS_MCUX_CACHE cache/xcache driver_cache_xcache)
272275
endif()
273276

277+
if (${MCUX_DEVICE} MATCHES "MIMX9596")
278+
include_driver_ifdef(CONFIG_IPM_IMX mu1 driver_mu1)
279+
include_driver_ifdef(CONFIG_MBOX_NXP_IMX_MU mu1 driver_mu1)
280+
else()
281+
include_driver_ifdef(CONFIG_IPM_IMX mu driver_mu)
282+
include_driver_ifdef(CONFIG_MBOX_NXP_IMX_MU mu driver_mu)
283+
endif()
284+
274285
if(CONFIG_CPU_CORTEX_A)
275286
include_driver_ifdef(CONFIG_HAS_MCUX_CACHE cache/armv8-a driver_cache_armv8a)
276287
endif()
@@ -309,6 +320,11 @@ endif()
309320
if("${CONFIG_SOC_FAMILY}" STREQUAL "nxp_mcx")
310321
if(CONFIG_SOC_SERIES_MCXC)
311322
include_driver_ifdef(CONFIG_SOC_FLASH_MCUX flash driver_flash)
323+
include(${CMAKE_CURRENT_LIST_DIR}/mcux-sdk/drivers/port/driver_port.cmake)
324+
zephyr_include_directories(${CMAKE_CURRENT_LIST_DIR}/mcux-sdk/drivers/port)
325+
elseif(CONFIG_SOC_SERIES_MCXA)
326+
zephyr_include_directories(${CMAKE_CURRENT_LIST_DIR}/mcux-sdk/drivers/mcxa_romapi)
327+
312328
include(${CMAKE_CURRENT_LIST_DIR}/mcux-sdk/drivers/port/driver_port.cmake)
313329
zephyr_include_directories(${CMAKE_CURRENT_LIST_DIR}/mcux-sdk/drivers/port)
314330
else()

mcux/mcux-sdk/devices/MIMX9596/MIMX9596_ca55.h

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

mcux/mcux-sdk/devices/MIMX9596/MIMX9596_ca55_features.h

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

mcux/mcux-sdk/devices/MIMX9596/MIMX9596_cm7.h

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

mcux/mcux-sdk/devices/MIMX9596/MIMX9596_cm7_features.h

Lines changed: 791 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#Description: device_CMSIS; user_visible: False
2+
include_guard(GLOBAL)
3+
message("device_CMSIS component is included.")
4+
5+
target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
6+
)
7+
8+
target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
9+
${CMAKE_CURRENT_LIST_DIR}/.
10+
)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#Description: Reset Driver; user_visible: False
2+
include_guard(GLOBAL)
3+
4+
message("driver_reset component is included.")
5+
6+
target_sources(${MCUX_SDK_PROJECT_NAME} PRIVATE
7+
)
8+
9+
target_include_directories(${MCUX_SDK_PROJECT_NAME} PUBLIC
10+
${CMAKE_CURRENT_LIST_DIR}/.
11+
)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*
2+
* Copyright 2024 NXP
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
#include "fsl_clock.h"
7+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright 2024 NXP
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#ifndef _FSL_CLOCK_H_
8+
#define _FSL_CLOCK_H_
9+
10+
/* Definition for delay API in clock driver, users can redefine it to the real application. */
11+
#ifndef SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY
12+
#define SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY \
13+
(800000000UL) /* When using Overdrive Voltage, the maximum frequency of cm7 is 800 MHz */
14+
#endif
15+
16+
#endif
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright 2014-2016 Freescale Semiconductor, Inc.
3+
* Copyright 2016-2024 NXP
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*
6+
*/
7+
8+
#ifndef __FSL_DEVICE_REGISTERS_H__
9+
#define __FSL_DEVICE_REGISTERS_H__
10+
11+
/*
12+
* Include the cpu specific register header files.
13+
*
14+
* The CPU macro should be declared in the project or makefile.
15+
*/
16+
#if (defined(CPU_MIMX9596AVTXN_ca55) || defined(CPU_MIMX9596AVZXN_ca55) || defined(CPU_MIMX9596DVTXQ_ca55) || \
17+
defined(CPU_MIMX9596DVYXQ_ca55) || defined(CPU_MIMX9596DVZXQ_ca55) || defined(CPU_MIMX9596XVTXL_ca55))
18+
19+
#define MIMX9596_ca55_SERIES
20+
21+
/* CMSIS-style register definitions */
22+
#include "MIMX9596_ca55.h"
23+
/* CPU specific feature definitions */
24+
#include "MIMX9596_ca55_features.h"
25+
26+
#elif (defined(CPU_MIMX9596AVTXN_cm7) || defined(CPU_MIMX9596AVZXN_cm7) || defined(CPU_MIMX9596DVTXQ_cm7) || \
27+
defined(CPU_MIMX9596DVYXQ_cm7) || defined(CPU_MIMX9596DVZXQ_cm7) || defined(CPU_MIMX9596XVTXL_cm7))
28+
29+
#define MIMX9596_cm7_SERIES
30+
31+
/* CMSIS-style register definitions */
32+
#include "MIMX9596_cm7.h"
33+
/* CPU specific feature definitions */
34+
#include "MIMX9596_cm7_features.h"
35+
36+
#else
37+
#error "No valid CPU defined!"
38+
#endif
39+
40+
#endif /* __FSL_DEVICE_REGISTERS_H__ */
41+
42+
/*******************************************************************************
43+
* EOF
44+
******************************************************************************/
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/*
2+
** ###################################################################
3+
** Processors: MIMX9596AVTXN_ca55
4+
** MIMX9596AVZXN_ca55
5+
** MIMX9596DVTXQ_ca55
6+
** MIMX9596DVYXQ_ca55
7+
** MIMX9596DVZXQ_ca55
8+
** MIMX9596XVTXL_ca55
9+
**
10+
** Compilers: GNU C Compiler
11+
** IAR ANSI C/C++ Compiler for ARM
12+
** Keil ARM C/C++ Compiler
13+
**
14+
** Reference manual: iMX95RM rev1 draftM
15+
** Version: rev. 1.0, 2023-01-10
16+
** Build: b240402
17+
**
18+
** Abstract:
19+
** Provides a system configuration function and a global variable that
20+
** contains the system frequency. It configures the device and initializes
21+
** the oscillator (PLL) that is part of the microcontroller device.
22+
**
23+
** Copyright 2016 Freescale Semiconductor, Inc.
24+
** Copyright 2016-2024 NXP
25+
** SPDX-License-Identifier: BSD-3-Clause
26+
**
27+
** http: www.nxp.com
28+
29+
**
30+
** Revisions:
31+
** - rev. 1.0 (2023-01-10)
32+
** Initial version.
33+
**
34+
** ###################################################################
35+
*/
36+
37+
/*!
38+
* @file MIMX9596_ca55
39+
* @version 1.0
40+
* @date 2023-01-10
41+
* @brief Device specific configuration file for MIMX9596_ca55 (implementation
42+
* file)
43+
*
44+
* Provides a system configuration function and a global variable that contains
45+
* the system frequency. It configures the device and initializes the oscillator
46+
* (PLL) that is part of the microcontroller device.
47+
*/
48+
49+
#include <stdint.h>
50+
#include "fsl_device_registers.h"
51+
52+
53+
54+
55+
56+
/* ----------------------------------------------------------------------------
57+
-- Core clock
58+
---------------------------------------------------------------------------- */
59+
60+
uint32_t SystemCoreClock = DEFAULT_SYSTEM_CLOCK;
61+
62+
/* ----------------------------------------------------------------------------
63+
-- SystemInit()
64+
---------------------------------------------------------------------------- */
65+
66+
void SystemInit (void) {
67+
#if ((__FPU_PRESENT == 1) && (__FPU_USED == 1))
68+
__ASM volatile("mov x0, #(3 << 20) \n\t"
69+
"msr cpacr_el1, x0");
70+
#endif /* ((__FPU_PRESENT == 1) && (__FPU_USED == 1)) */
71+
72+
73+
SystemInitHook();
74+
75+
ARM_TIMER_GetFreq(&SystemCoreClock);
76+
}
77+
78+
/* ----------------------------------------------------------------------------
79+
-- SystemCoreClockUpdate()
80+
---------------------------------------------------------------------------- */
81+
82+
void SystemCoreClockUpdate (void) {
83+
84+
85+
}
86+
87+
/* ----------------------------------------------------------------------------
88+
-- SystemInitHook()
89+
---------------------------------------------------------------------------- */
90+
91+
__attribute__ ((weak)) void SystemInitHook (void) {
92+
/* Void implementation of the weak function. */
93+
}
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/*
2+
** ###################################################################
3+
** Processors: MIMX9596AVTXN_ca55
4+
** MIMX9596AVZXN_ca55
5+
** MIMX9596DVTXQ_ca55
6+
** MIMX9596DVYXQ_ca55
7+
** MIMX9596DVZXQ_ca55
8+
** MIMX9596XVTXL_ca55
9+
**
10+
** Compilers: GNU C Compiler
11+
** IAR ANSI C/C++ Compiler for ARM
12+
** Keil ARM C/C++ Compiler
13+
**
14+
** Reference manual: iMX95RM rev1 draftM
15+
** Version: rev. 1.0, 2023-01-10
16+
** Build: b240402
17+
**
18+
** Abstract:
19+
** Provides a system configuration function and a global variable that
20+
** contains the system frequency. It configures the device and initializes
21+
** the oscillator (PLL) that is part of the microcontroller device.
22+
**
23+
** Copyright 2016 Freescale Semiconductor, Inc.
24+
** Copyright 2016-2024 NXP
25+
** SPDX-License-Identifier: BSD-3-Clause
26+
**
27+
** http: www.nxp.com
28+
29+
**
30+
** Revisions:
31+
** - rev. 1.0 (2023-01-10)
32+
** Initial version.
33+
**
34+
** ###################################################################
35+
*/
36+
37+
/*!
38+
* @file MIMX9596_ca55
39+
* @version 1.0
40+
* @date 2023-01-10
41+
* @brief Device specific configuration file for MIMX9596_ca55 (header file)
42+
*
43+
* Provides a system configuration function and a global variable that contains
44+
* the system frequency. It configures the device and initializes the oscillator
45+
* (PLL) that is part of the microcontroller device.
46+
*/
47+
48+
#ifndef _SYSTEM_MIMX9596_ca55_H_
49+
#define _SYSTEM_MIMX9596_ca55_H_ /**< Symbol preventing repeated inclusion */
50+
51+
#ifdef __cplusplus
52+
extern "C" {
53+
#endif
54+
55+
#include <stdint.h>
56+
57+
/* Define clock source values */
58+
#define DEFAULT_SYSTEM_CLOCK 24000000U /* Default System clock value */
59+
60+
/**
61+
* @brief System clock frequency (core clock)
62+
*
63+
* The system clock frequency supplied to the SysTick timer and the processor
64+
* core clock. This variable can be used by the user application to setup the
65+
* SysTick timer or configure other parameters. It may also be used by debugger to
66+
* query the frequency of the debug timer or configure the trace clock speed
67+
* SystemCoreClock is initialized with a correct predefined value.
68+
*/
69+
extern uint32_t SystemCoreClock;
70+
71+
/**
72+
* @brief Setup the microcontroller system.
73+
*
74+
* Typically this function configures the oscillator (PLL) that is part of the
75+
* microcontroller device. For systems with variable clock speed it also updates
76+
* the variable SystemCoreClock. SystemInit is called from startup_device file.
77+
*/
78+
void SystemInit (void);
79+
80+
/**
81+
* @brief Updates the SystemCoreClock variable.
82+
*
83+
* It must be called whenever the core clock is changed during program
84+
* execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates
85+
* the current core clock.
86+
*/
87+
void SystemCoreClockUpdate (void);
88+
89+
/**
90+
* @brief SystemInit function hook.
91+
*
92+
* This weak function allows to call specific initialization code during the
93+
* SystemInit() execution.This can be used when an application specific code needs
94+
* to be called as close to the reset entry as possible (for example the Multicore
95+
* Manager MCMGR_EarlyInit() function call).
96+
* NOTE: No global r/w variables can be used in this hook function because the
97+
* initialization of these variables happens after this function.
98+
*/
99+
void SystemInitHook (void);
100+
101+
#ifdef __cplusplus
102+
}
103+
#endif
104+
105+
#endif /* _SYSTEM_MIMX9596_ca55_H_ */

0 commit comments

Comments
 (0)