Skip to content

Conversation

@biwenli
Copy link
Contributor

@biwenli biwenli commented Nov 11, 2025

Change irqsteer driver as a zephyr native driver.

There are two irqsteer drivers in mcux sdk(mcux-sdk-ng/drivers/irqsteer and mcux-sdk-ng/drivers/irqsteer_1) and the APIs are not compatible. mcux-sdk-ng/drivers/irqsteer_1 just likes a native irqsteer driver(Refer to the linux irqsteer driver: drivers/irqchip/irq-imx-irqsteer.c). So change it as a native driver directly.

Copy link
Contributor

@LaurentiuM1234 LaurentiuM1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some initial comments below.

Most importantly: please don't change anything in the driver unless it's related to the fact that you're dropping the HAL API. This is an important change and by doing so you're making the review harder and easier to miss out the important stuff.

If you really want to make some unrelated changes then please do so in a separate commit with the appropriate justification.

Also, please make sure you don't break bisectability (see comment from binding). Make sure that after you apply each commit, the affected boards will still compile.

reg:
required: true

irq_offset:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we still need this?

CC: @yongxu-wang15

@biwenli
Copy link
Contributor Author

biwenli commented Nov 13, 2025

Some initial comments below.

Most importantly: please don't change anything in the driver unless it's related to the fact that you're dropping the HAL API. This is an important change and by doing so you're making the review harder and easier to miss out the important stuff.

If you really want to make some unrelated changes then please do so in a separate commit with the appropriate justification.

Also, please make sure you don't break bisectability (see comment from binding). Make sure that after you apply each commit, the affected boards will still compile.

sure, np.

@biwenli biwenli force-pushed the imx943-change-irqsteer-driver-as-native-driver branch from 900da9d to 4268eb0 Compare November 13, 2025 10:06
@biwenli biwenli force-pushed the imx943-change-irqsteer-driver-as-native-driver branch 3 times, most recently from 121c460 to c1686ee Compare November 13, 2025 10:40
@github-actions
Copy link

github-actions bot commented Nov 17, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@github-actions github-actions bot added manifest manifest-hal_nxp DNM (manifest) This PR should not be merged (controlled by action-manifest) labels Nov 17, 2025
@biwenli biwenli force-pushed the imx943-change-irqsteer-driver-as-native-driver branch from e71bd4f to fa891fd Compare December 5, 2025 03:34
This adds priority attribute to irqsteer in order to
support multi level interrupts.

We need to make this change atomic so that we don't break
the build.

So, we introduce a new property named 'priority' to
`interrupt-cells` and we increase the number of cells.
Then we update all instances of interrupts
using irqsteer (for imx95, imx8m, imx8qm, imx8qxp and also
update the overlay(imx8mp_evk_mimx8ml8_adsp) for tests.

Signed-off-by: Biwen Li <[email protected]>
Supporting irqsteer using NXP HAL becomes increasingly harder with new
SoCs.

For example now there are two incompatible HAL drivers for IRQ steer
(mcux-sdk-ng/drivers/irqsteer and mcux-sdk-ng/drivers/irqsteer_1).

In order to avoid overcomplicating code and better scaling code for
newer SoCs just drop using the NXP HAL and implement an IRQ Steer native
Zephyr driver

Use irqsteer node of imx943 as example.

New features:
- Support multiple irqsteer instances.
- Indroduce new properties(nxp,irq-offset, nxp,num-irqs).

Signed-off-by: Biwen Li <[email protected]>
This commit enables multi level interrupts:
- Enable multi level interrupts
  imx943 is a two level interrupts system and
  some interrupts(eg. edma interrupts) depend on irqsteer.
- Increase irq number from 405 to 790
  Actually there are 407(IRQ 0 ~ IRQ 406) interrupts
  from nvic(first level interrupts),
  The second level interrupts are extended by irqsteer,
  it extends 32 x 12 = 384 interrupts,
  So first level interrupts + second level interrupts
  = 407 + 384 = 791(IRQ 0 ~ IRQ 790) interrupts

Signed-off-by: Biwen Li <[email protected]>
Enable edma4 by default for lpuart8 of m33(in NETCMIX)
of imx943_evk

Signed-off-by: Biwen Li <[email protected]>
Add config for imx943_evk_mimx94398_m33
- Use the sample to test the irqsteer driver

Signed-off-by: Biwen Li <[email protected]>
This commit fixes build issue when multi level interrupts feature
is enabled, define new macro TEST_1ST_LEVEL_INTERRUPTS_MAX to
support multi level interrupts case.
  - error: array subscript 24 is above array bounds of 'volatile
    uint32_t[16]' {aka 'volatile unsigned int[16]'}
    [-Werror=array-bounds])

Signed-off-by: Biwen Li <[email protected]>
Fix build issue when multi level interrupts is enabled,
define new macro TEST_1ST_LEVEL_INTERRUPTS_MAX to support multi
level interrupts case.
  - core_cm33.h:2559:47: error: iteration 496 invokes undefined behavior
    [-Werror=aggressive-loop-optimizations]

Signed-off-by: Biwen Li <[email protected]>
Exclude imx943,
  - multi level interrupts feature is enabled defaultly,
    so irqsteer1 driver is enabled, then the test case
    report the build issue:
    multiple definition of z_soc_irq_enable,
    tests/arch/arm/arm_custom_interrupt/src/arm_custom_interrupt.c:47
    first defined here.

Signed-off-by: Biwen Li <[email protected]>
Add irqsteer node for m7_0.

Signed-off-by: Biwen Li <[email protected]>
Add irqsteer node for m7_1.

Signed-off-by: Biwen Li <[email protected]>
Add edma2 node for lpuart3.

Signed-off-by: Biwen Li <[email protected]>
Enable edma2 defaultly.

Signed-off-by: Biwen Li <[email protected]>
Add more irqsteer masters.

Signed-off-by: Biwen Li <[email protected]>
Add disp_irqsteer node(this is another irqsteer instance).

Signed-off-by: Biwen Li <[email protected]>
This commit enables tests/driver/uart/async_api demo
for m33 in NETCMIX of imx943_evk.
- build command as follows,
  west build -p always -b imx943_evk/mimx94398/m33
  tests/drivers/uart/uart_async_api

Signed-off-by: Biwen Li <[email protected]>
Fix build issues,
- error: format %x expects argument of type
  unsigned int, but argument 7 has type ssize_t
  {aka long int} [-Werror=format=]
  zassert_false(ret < 0, "attr->read returned unexpected (err 0x%02x)"
  , BT_GATT_ERR(ret));

Signed-off-by: Biwen Li <[email protected]>
@biwenli biwenli force-pushed the imx943-change-irqsteer-driver-as-native-driver branch from fa891fd to 796126b Compare December 5, 2025 08:45
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 5, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants