Commit graph

232 commits

Author SHA1 Message Date
Lucien Zhao
beb7114f0d soc: nxp: imxrt: add c parts for RT1180
add c parts for RT1180

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2025-09-25 14:18:16 -04:00
Lucien Zhao
c503850cd4 boards: nxp: rt1180: migrate mpu setting under board folder
- add NXP_BOARD_SPECIFIC_MPU_SETTINGS kconfig to provide a switch
  for developer if they want to use private mpu settings
    CONFIG_NXP_BOARD_SPECIFIC_MPU_SETTINGS==1  | NXP default setting
    CONFIG_NXP_BOARD_SPECIFIC_MPU_SETTINGS==0  | User specific

- Use DT function to get memory base address and region size for cm7

- CM33 use dts to set mpu settings

- Add REGION_CUSTOMED_MEMORY_SIZE macro provide a common mapping ways
  to map actual memory_size_kb to "region_size"

-  The settings of the unified memory on cm33/cm7 cores:
    ocram1/flexspi2 -> REGION_RAM_NOCACHE_ATTR
    ocram2/dtcm -> REGION_RAM_NOCACHE_ATTR
    flexspi/itcm -> REGION_FLASH_ATTR

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2025-09-25 14:17:57 -04:00
Tomas Galbicka
4a6a969bbe soc: RT700 add custom MPU regions for non-cache memory
This commit adds custom MPU regions for RT700 CM33 CPU0 to
define non-cachable region for SRAM.

Signed-off-by: Tomas Galbicka <tomas.galbicka@nxp.com>
2025-09-25 10:58:01 +02:00
Tomas Galbicka
5dd659ebc0 soc: NXP RT700 add support to boot CM33 CPU1
This commit adds multicore support to copy CM33 CPU1 image
from flash to RAM where it will boot from.

Also added NXP_IMXRT_BOOT_HEADER=y for CPU0 so it can be booted
from FlexSPI Flash.

Signed-off-by: Tomas Galbicka <tomas.galbicka@nxp.com>
2025-09-25 10:58:01 +02:00
Zhaoxiang Jin
39f6b5e9e3 soc: nxp: imxrt: Convert camel case to snake case
Convert camel case to snake case

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-09-20 11:10:05 +02:00
Mahesh Mahadevan
b0624af741 soc: nxp: Add Macros to handle variation in managing Wakeup IRQ
The SDK code to handle managing Wakeup IRQ's for low power mode
varies between SoC's.
Add a MACRO that can be called by the Zephyr drivers so we
can manage these variations without adding SoC specific code
to the drivers.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2025-09-20 11:09:00 +02:00
Mahesh Mahadevan
fd040a40c0 soc: nxp: Add common folder to the include path
This will allow us to add header files to the
common folder

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2025-09-20 11:09:00 +02:00
Albort Xue
d5f4976f71 soc: nxp: imxrt10xx: update range of DCDC output voltage.
According to the datasheet, NXP recommands a DCDC output
voltage range of 0.925V to 1.3V.

Signed-off-by: Albort Xue <yao.xue@nxp.com>
2025-09-17 08:44:07 +02:00
Jason Yu
bd10f9301e drivers: hwinfo: mcux_src_rev2: Change to use dts as dependency
Originally the driver is selected if `HAS_MCUX_SRC_V2` is
selected in SOC level kConfig.
Change to use dts to mark the driver is avaiable for some SOC.

Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
2025-09-17 08:43:16 +02:00
Lucien Zhao
30d5243ed4 samples: drivers: i2s_codec: support sai1 codec function on RT1180
- add imxrt_audio_codec_pll_init function in soc.c
- add sai1 pin configuration
- Verify i2s_codec case on cm33/cm7 core

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2025-09-17 08:42:44 +02:00
Maciej Kusio
df40dff6fb arch: xtensa: clean up interrupt handling
Simplifying flow of handling interrupts:
- removing all _soc_inthandlers.h
- removing xtensa_intgen*
- removing XTENSA_GEN_HANDLERS Kconfig
- keeping optimized irq detection
- single handler with irq level as parameter

Signed-off-by: Maciej Kusio <rysiof@gmail.com>
2025-09-14 17:02:20 +02:00
Vit Stanicek
84373c4c64 soc: mimxrt685s/hifi4: Fix HW cycle count
Change hardware cycle count (CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC) to 594
MHz. Move that value to the SoC layer's DT.

Validated with the amp_blinky example - the period of the blinking LED
is exactly 2 seconds, like was programmed.

Signed-off-by: Vit Stanicek <vit.stanicek@nxp.com>
2025-09-12 13:21:24 +02:00
Clark Kim
4f948f15af soc: nxp: imxrt7xx: Add pmic interrupt APIs
Add pmic interrupt enable/disable/clear APIs

Signed-off-by: Clark Kim <clark.kim@nxp.com>
2025-09-10 22:44:33 -04:00
Pieter De Gendt
c2a2f99202 soc: nxp: imxrt10xx: Configurable DCDC voltages
Allow users to configure the DCDC target voltages for low power and normal
mode.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-08-29 18:20:08 +02:00
Declan Snyder
8167efa28b soc: nxp: imxrt7xx: Split soc code files
Instead of one soc.c with all the code, split into files for each area
of concern.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-22 06:52:51 +02:00
Declan Snyder
6cb2bf551d soc: imxrt7xx: Split Kconfig files to CPU folders
For better organization, split the Kconfig files into one per each CPU.

Also, there was a bug where MFD was made to depend on flexcomm being
enabled, when really it probably meant to just default y if flexcomm is
enabled.

Leave Kconfig.soc in one file for the SOC.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-22 06:52:51 +02:00
Yangbo Lu
2be724d0ce soc: nxp: imxrt118x: keep AHB clock running when CM7 is sleeping
Keep AHB clock running when CM7 is sleeping and TCM is accessible.
Otherwise, NETC transmission will fail.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-08-15 15:34:17 +02:00
Declan Snyder
b70e761d42 modules: hal_nxp: Remove HAS_MCUX_FLEXSPI/SEMC
Remove these legacy kconfig, not necessary.

The DT already has the bindings and nodes required to represent if there
is a FlexSPI and/or SEMC.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-15 10:10:32 +03:00
Declan Snyder
5e3a432fed adc: Remove CONFIG_ADC_MCUX_ETC
This Kconfig does not belong in the ADC folder, because there is not
actually a zephyr ADC driver for this. Also, remove HAS_MCUX_ADC_ETC as
well because it is a useless config.

The cmake line to pull in this driver from the SDK in the zephyr repo is
totally unnecessary. If a user wants to use this SDK driver they can add
it to their build like any other SDK driver or any other
external code module. Zephyr should not be a cesspool of random build
glue for random pieces of code.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-15 10:10:32 +03:00
Declan Snyder
e8c6275949 soc: imxrt: Remove HAS_MCUX_ DCDC, GPC, PMU
Remove these kconfigs and substitute with equivalent series configs.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-15 10:10:32 +03:00
Declan Snyder
7ff0038921 modules: Remove HAS_MCUX_TPM
The only code change to remove this was a redundant usage in the rt1180
soc.c which was not needed because it was redundant, if you catch my
drift.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-15 10:10:32 +03:00
Declan Snyder
5ae654eeef modules: hal_nxp: Removed unused HAS_MCUX_* configs
Remove the configs that are not actually used for anything anymore or
never were, or that are redundant with other configs, and don't have any
code changes outside of Kconfig to remove.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-15 10:10:32 +03:00
Declan Snyder
83420a7139 modules: hal_nxp: Remove CONFIG_HAS_MCUX_FLEXCOMM
The presence of the flexcomm should be driven by DT, not this legacy
kconfig.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-15 10:10:32 +03:00
Tomas Galbicka
001633c13d boards: nxp: mimxrt1180_evk: Add support for CM7 flash execution
Add support for executing the CM7 core directly from flash memory
(XIP - eXecute In Place) instead of copying to ITCM. This provides
the following benefits:

- Allows for larger code size than the 512KB ITCM limit
- Simplifies memory management for large applications
- Reduces boot time by eliminating the need to copy code to ITCM

The implementation includes:

1. A new Kconfig option CM7_BOOT_FROM_FLASH (default: n) to control
   the execution mode
2. A device tree overlay (cm7_flash_boot.overlay) that configures
   the flash memory for CM7 execution
3. Updates to soc.c to calculate the correct CM7 boot address
   based on the flash partition
5. Documentation updates with instructions for both execution modes

Signed-off-by: Tomas Galbicka <tomas.galbicka@nxp.com>
2025-08-14 15:48:33 +02:00
Vit Stanicek
30e053ca2c soc: mimxrt798s/hifi4: Disable GPIO support
Remove INPUTMUX interrupt assignments for PINT and GPIO peripherals.
Remove gpio0 DT node.

As the GPIO peripherals can be secured on the mimxrt798s, accesses from
the cm33_cpu0 and hifi4 are mutually exclusive, so the GPIO0 will stay
enabled in the cm33_cpu0 domain.

Signed-off-by: Vit Stanicek <vit.stanicek@nxp.com>
2025-08-13 11:09:32 +01:00
Felix Wang
02546580be soc: nxp: imxrt: clock update for LPIT instances on RT118X
1. Configure clock source for lpit3 for imxrt118x devices
2. Support lpit in clock driver

Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
2025-08-08 10:44:24 -05:00
Lucien Zhao
d61236ded2 tests: driver: pwm: pwm_api: Enable flexio_pwm function on pwm_api case
Enable flexio clock in soc.c file
Add mimxrt1180_evk_flexio_pwm.overlay:
- Configure flexio2_d2 pins
- enable flexio2_pwm
- disable default watchdog tpm5

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2025-08-08 11:53:18 +03:00
Vit Stanicek
8b1affbb49 soc: mimxrt798s/hifi4: Add soc.c
Add soc.c. Handle IRQ mapping (INPUTMUX) and clock setup.

Signed-off-by: Vit Stanicek <vit.stanicek@nxp.com>
2025-08-04 19:57:10 +01:00
Vit Stanicek
1a41cbc742 soc: mimxrt798s/hifi4: Rework linker and memory defs
Rename symbols so that they reflect purpose of defined memory regions.
Point region symbols to nodes in the DT. Move bogus IDT section before
DSP's ITCM. Move common ROM and RAM sections before the heap.

The move had to be done as these sections and the heap did overlap.

Signed-off-by: Vit Stanicek <vit.stanicek@nxp.com>
2025-08-04 19:57:10 +01:00
Vit Stanicek
7635d98bbb dt: mimxrt700_evk/hifi4: Add definitions
Add dummy interrupt controller, clock control, pin control, Flexcomm 0,
Flexcomm 2, SAI0, SAI1, SAI2 into SoC's DT. Enable relevant nodes in
board's DT and include pinctrl definitions. Add default LED and button
nodes. Set /hifi4's real frequency. Add memory nodes for device's main
SRAM.

Signed-off-by: Vit Stanicek <vit.stanicek@nxp.com>
2025-08-04 19:57:10 +01:00
Vit Stanicek
1521cb9bc8 soc: mimxrt798s: Expand definitions for /hifi4
Add desired Kconfig implications for the mimxrt798s/hifi4 domain. Add
pinctrl_soc.h and set up an include path for it.

Signed-off-by: Vit Stanicek <vit.stanicek@nxp.com>
2025-08-04 19:57:10 +01:00
Vit Stanicek
e679ef486a hal_nxp: Factorise inclusion of fsl_inputmux
Create Kconfig variable NXP_INPUTMUX, which selects the fsl_inputmux
driver. Imply the MCUX component symbol from it. Imply that variable
from the NXP PINT, SmartDMA and LPC DMA drivers and from the mimxrt685s
SoC.

This needed to be done for the mimxrt700_evk/mimxrt798s/hifi4 domain, as
the INPUTMUX peripheral handles IRQ assginments and its driver
(fsl_inputmux) is used directly by the domain's soc.c. Instantiating the
currently dependent drivers (for PINT and SmartDMA) isn's possible nor
reasonable on the said target.

Signed-off-by: Vit Stanicek <vit.stanicek@nxp.com>
2025-07-31 17:11:54 -04:00
Mike J. Chen
2dc6793261 soc: imxrt5xx: add fusion f1 dsp backtrace support
Add needed backtrace helpders routines and enable
backtrace for the Xtensa Fusion F1 DSP in the
IMXRT595S.

Signed-off-by: Mike J. Chen <mjchen@google.com>
2025-07-31 10:49:54 +01:00
Bas van Loon
d56f5f7b0e soc: mimxrt11xx: Allow to override SYS PLL2/3 output divider(s).
To reduce the SEMC clock to a usable speed we had to divide down
the output clock of System PLL2 PFD1. To do this I had to override
the hardcoded defaults. This commit adds the flexibility to
override them in your board files.

Signed-off-by: Bas van Loon <bas@arch-embedded.com>
2025-07-23 09:32:53 +02:00
Bas van Loon
70b96f43fb soc: mimxrt11xx: Work around USDHC errata.
Errata ERR050396 causes data corruption if writes happen to TCM memory
so work around it by not marking AXI transaction cacheable. Workaround
taken from NXP SDK example.

Signed-off-by: Bas van Loon <bas@arch-embedded.com>
2025-07-23 09:32:43 +02:00
Pisit Sawangvonganan
0ec49fa570 kconfig: fix typo in (soc, subsys)
Utilize a code spell-checking tool to scan for and correct spelling errors
in `Kconfig` files within the `soc` and `subsys` directory.
Additionally, incorporates a fix recommended by the reviewer.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2025-07-01 10:58:54 -10:00
Imran Sajjad
63ebb75083 soc: imxrt: mimxrt1011 i2s clock fix
Fix for compiling i2s drivers on the NXP mimxrt1010_evk board.
For mimxrt1011, the defines kCLOCK_Sai2... are not defined as the sai2
peripheral does not exist. Trying to compile gives error. Fixed by adding
check for device tree node around code that uses the defines. Also added
same for sai1 and sai3. Thanks @lucien-nxp, @ZhaoxiangJin from NXP.

Signed-off-by: Imran Sajjad <imran.sajjad@iconfitness.com>
2025-06-30 15:19:24 -05:00
Declan Snyder
1f315f1759 soc: nxp: imxrt: Clean up INIT_SYS_PLL
Don't force select INIT_SYS_PLL at SOC level. Instead use default y so
that board can unset it. Keep previous case where we would default y
which was only on RT1040. Also, this config is not used in RT1170 soc,
so move it to RT10xx series kconfig instead of family level. And it
appears to be on all the RT10xx, so ifdef is not needed.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-06-27 18:27:26 -05:00
Declan Snyder
ef2271ecab soc: imxrt: Clean up INIT_VIDEO_PLL config
Don't force select the INIT_VIDEO_PLL config so that board level can
unset it. Also clean up the code a bit in soc.c files.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-06-27 18:27:26 -05:00
Declan Snyder
79713a539f soc: imxrt11xx: Clean up LDO configs
The LDO config should not be forcefully selected at SOC level. Instead,
use soft default y so that board definition can unset it if desired.

Also, in the soc.c, the LDO code should be on both the rt1160 and
rt1170, so the definitions should exist, and ifdef is not needed. So can
switch to IS_ENABLED to decrease configuration complexity of the source
code.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-06-27 18:27:26 -05:00
Declan Snyder
305a7e6c8d soc: nxp: imxrt: Remove ifdef around DCDC
The DCDC should be on all the platforms and the functions and structs
should therefore be defined on all the platforms. So the ifdef is not
needed, we can remove it to increase code compilation coverage unity
across configurations slightly. Compiler should optimize out the block
when IS_ENABLED is false statically.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-06-27 18:27:26 -05:00
Declan Snyder
16e74b9249 soc: imxrt: Clean up INIT_ARM_PLL config
Don't forcefully select this config in SOC level. Make it softer default
y so board can unselect it.

The config should not be possible if there is no arm pll, namely on
RT101x and RT102x. So add dependency clause about this.

And of course, code for this was a mess, clean up a bit.

Also remove the ifdeffry for selecting a default value for the two SOCs,
because they already put the same default value in the SOC Devicetree
DTSI, so that code had no purpose as long as a board didn't completely
redefine the SOC DT.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-06-27 18:27:26 -05:00
Declan Snyder
d33f7feb64 soc: imxrt: Clean up INIT_ENET_PLL config
Initial motivation for this commit was to not force select
the INIT_ENET_PLL config from SOC level to allow for board level
configuration which might want it to be off.

While doing that, I discovered that RT11xx actually does not have
anything called by "ENET PLL" in the reference manual. So I have
removed the config for RT11xx. The default clock source for this soc.c
code for RT11xx is PLL1 DIV2, which I changed to just be configured if
ethernet is enabled, which was the reason to configure this pll as it
stands now, even though it is not specific to ethernet (although the
DIV2 output is mostly for ethernet). Another config is therefore not
needed.

For RT10xx, the situation is a lot more complicated. There is a lot of
discrepancy again between what is considered the "ENET PLL" both
conceptually and literally between the RM, SDK, and Zephyr config. And
also the code to define the config struct was a complete mess. So I have
simplified the code and changed it so that the config is only a soft
default to y instead of selected forcefully. Also, for the case of the
RT1010 and RT1020 series, the SDK is appearing to configure PLL6 (again
there is no clear ENET PLL meaning on these platforms) 500M output
through this "enet pll" configuration function. So similarly instead of
always enabling this output for those platforms, I added a new config
which can be set or unset by board level.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-06-27 18:27:26 -05:00
Raymond Lei
581e7ff2aa drivers: spi: nxp: flexiospi spi_loopback test failed on flexio spi
Several reason cause loopback test failed:
a) FlexIO input frequency is not correct, on RT11xx, input freq is 24M,
while max baud rate can reach 1/4 of input freq, so it can only support
6Mbps.
b) Flexio shift register depend on correct timer output to triggger TX
and RX, if timer comparison value is not accurate, RX error happens on
high baud rate. This is the reason why test fails on RT1060.

also fix a error on FlexIO clock ID calculation.

Signed-off-by: Raymond Lei <raymond.lei@nxp.com>
2025-06-27 09:05:47 -10:00
William Tambe
abeccfec28 xtensa: support for more than 32 interrupts
This change add support for using more than 32 interrupts.

Signed-off-by: William Tambe <williamt@cadence.com>
2025-06-27 08:59:56 -10:00
Raymond Lei
a93a80be82 drivers: nxp: flexspi: fix hyper flash hang issue
CS hold time parameter is not correct which may cause bus fault
randomly.
System hang during status register reading after flash progromming which
is caused by parameter accessing in XIP mode.
Add dummy delay for READ command according the flash datasheet which is
required for SDR mode.
Use FlexSPI internal divider for clock updating instead of register in
CCM to avoid potential risk caused by flash access during clock updating
procedure.

Signed-off-by: Raymond Lei <raymond.lei@nxp.com>
2025-06-26 22:14:38 -05:00
Lucien Zhao
2bcec4c67e soc: nxp: imxrt7xx: set I2S_HAS_PLL_SETTING as n
The existing SAI diver cannot initialize the PLL on the
board, so the PLL settings will not be performed in the
driver.

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2025-06-24 15:35:07 -05:00
Davi Herculano
c3dd356f1a soc: imxrt10xx: fix SAI3 pll clock config
Fix the sai3 case in imxrt_audio_codec_pll_init which
was using sai2 constants.

Signed-off-by: Davi Herculano <herculanodavi@gmail.com>
2025-06-24 14:19:43 +02:00
Declan Snyder
877fa975cc spi_nxp_lpspi: Remove MCUX branding
Since the LPSPI drivers no long use MCUX at all, remove the MCUX
branding, to avoid confusion. In the future if an implementation uses
the MCUX SDK driver, it should specifically be called by MCUX in the
name.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-06-18 17:51:19 -04:00
Mike J. Chen
2923504780 soc: nxp: imxrt: imxrt5xx: add Fusion F1 DSP selects
Add select for GEN_HANDLERS to use the more efficient
generated interrupt handlers.

Add select for HIFI3, which are the SIMD related registers.

Signed-off-by: Mike J. Chen <mjchen@google.com>
2025-06-06 08:43:52 +02:00