Skip to content

enable irqsteer for m33 of imx943 #93760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

biwenli
Copy link
Contributor

@biwenli biwenli commented Jul 28, 2025

enable irqsteer for imx943.

@@ -44,6 +44,7 @@ zephyr_library_sources_ifdef(CONFIG_NXP_PINT intc_nxp_pint.c)
zephyr_library_sources_ifdef(CONFIG_RENESAS_RX_ICU intc_renesas_rx_icu.c)
zephyr_library_sources_ifdef(CONFIG_RENESAS_RZ_EXT_IRQ intc_renesas_rz_ext_irq.c)
zephyr_library_sources_ifdef(CONFIG_NXP_IRQSTEER intc_nxp_irqsteer.c)
zephyr_library_sources_ifdef(CONFIG_NXP_IRQSTEER1 intc_nxp_irqsteer1.c)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please explain why do you need a new driver?
Why the intc_nxp_irqsteer.c driver is not enough?

In the commit message you state that the "old" intc_nxp_irqsteer driver can be replaced.
In this case, why don't you enhance the intc_nxp_irqsteer driver with the support that you need for i.MX943?

Copy link
Contributor Author

@biwenli biwenli Jul 29, 2025

Choose a reason for hiding this comment

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

Yes, it's a good question.

Because of the new structure of irqsteer(https://github.com/zephyrproject-rtos/hal_nxp/blob/master/mcux/mcux-sdk-ng/devices/i.MX/i.MX943/periph/PERI_IRQSTEER.h#L244) is different with the old structure of irqsteer(https://github.com/zephyrproject-rtos/hal_nxp/blob/master/mcux/mcux-sdk-ng/devices/i.MX/i.MX95/periph/PERI_IRQSTEER.h#L145),
image

The new driver doesn't depend on the structure IRQSTEER_TYPE. It can be used in all of platforms.(i.mx8, i.mx95, i.mx943. Include irqsteer instance dpu_irqsteer, m33_irqsteer, m7_irqsteer, a55_irqsteer, dsp_irqsteer, hdmi_irqsteer)

Copy link
Contributor

@dbaluta dbaluta Jul 29, 2025

Choose a reason for hiding this comment

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

@biwenli so your proposal is to replace the "old" irqsteer driver with the new one?

Usually, when such a thing is happening you need to update all the references to the old driver with the new one. And as last point remove the old driver.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@biwenli so your proposal is to replace the "old" irqsteer driver with the new one?

Usually, when such a thing is happening you need to update all the references to the old driver with the new one. And as last point remove the old driver.

Yes, the old driver will be phased out over time. New product will use the new driver directly.

Copy link
Contributor

Choose a reason for hiding this comment

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

@biwenli Could you please add a note indicating that the old irqsteer will be deprecated and should no longer be used in new samples or products?
Also, it would be helpful to include at least one commit where the old irqsteer is replaced with the new implementation, so others can refer to it as an example.
Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@biwenli Could you please add a note indicating that the old irqsteer will be deprecated and should no longer be used in new samples or products? Also, it would be helpful to include at least one commit where the old irqsteer is replaced with the new implementation, so others can refer to it as an example. Thanks.

@iuliana-prodan ,

Sure, np. Thanks.

@decsny decsny assigned JiafeiPan and unassigned decsny Jul 28, 2025
@biwenli biwenli force-pushed the imx943-add-new-irqsteer1-driver branch from 2112635 to 1f02269 Compare July 29, 2025 04:49
Copy link

github-actions bot commented Jul 29, 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.

@dbaluta
Copy link
Contributor

dbaluta commented Jul 30, 2025

@biwenli you will also need to convert at least 1 user of the old driver to test your new implemenation. Ideally would be to convert all users, but we can do it in phases as we don't want to slow you down.

@biwenli biwenli reopened this Aug 6, 2025
@biwenli
Copy link
Contributor Author

biwenli commented Aug 6, 2025

@biwenli you will also need to convert at least 1 user of the old driver to test your new implemenation. Ideally would be to convert all users, but we can do it in phases as we don't want to slow you down.

Sure, np.

@biwenli you will also need to convert at least 1 user of the old driver to test your new implemenation. Ideally would be to convert all users, but we can do it in phases as we don't want to slow you down.

The test case can be used to test the new irqsteer1 driver,
west build -p always -b imx943_evk/mimx94398/m33 samples/drivers/uart/async_api -d ./build_samples_uart_async_api

@biwenli biwenli force-pushed the imx943-add-new-irqsteer1-driver branch from 0d4c5c6 to f71c690 Compare August 6, 2025 10:00
@@ -22,23 +22,23 @@
compatible = "nxp,irqsteer-master";
reg = <0>;
interrupt-controller;
Copy link
Contributor

@dbaluta dbaluta Aug 7, 2025

Choose a reason for hiding this comment

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

Please provide more context in your commit messages. One year later a poor soul who tries to understand this patch wont find any useful info :)

A commit message should always explain why the changes was done, with a little bit of context of how if the code is complicated.

What is done like update interrrupt-cells should be obvious from the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please provide more context in your commit messages. One year later a poor soul who tries to understand this patch wont find any useful info :)

A commit message should always explain why the changes was done, with a little bit of context of how if the code is complicated.

What is done like update interrrupt-cells should be obvious from the code.

sure, np.

@biwenli biwenli force-pushed the imx943-add-new-irqsteer1-driver branch 2 times, most recently from d6a8381 to 0ebc560 Compare August 7, 2025 08:27
@biwenli biwenli mentioned this pull request Aug 7, 2025
@biwenli
Copy link
Contributor Author

biwenli commented Aug 7, 2025

zephyr/zephyr/samples/net/sockets/http_server/src/main.c:22: fatal error: sample_usbd.h: No such file or directory
22 | #include <sample_usbd.h>
|
compilation terminated.
ninja: build stopped: subcommand failed,
https://github.com/zephyrproject-rtos/zephyr/actions/runs/16799241884/job/47576926026?pr=93760

This build issue is blocked by the commit id,
3ffd167

image

@jfischer-no
any comments?

@biwenli biwenli force-pushed the imx943-add-new-irqsteer1-driver branch from 0ebc560 to 6ef6236 Compare August 8, 2025 06:34
Copy link
Member

@decsny decsny left a comment

Choose a reason for hiding this comment

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

driver looks like almost an exact copy paste of the other one. figure out how to reuse the code. this is not okay to be copy pasting drivers and ballooning the amount of code to maintain and duplicating the maintenance effort requirement across every chip.

@biwenli
Copy link
Contributor Author

biwenli commented Aug 11, 2025

driver looks like almost an exact copy paste of the other one. figure out how to reuse the code. this is not okay to be copy pasting drivers and ballooning the amount of code to maintain and duplicating the maintenance effort requirement across every chip.

Let's try to reuse the code.

@biwenli biwenli force-pushed the imx943-add-new-irqsteer1-driver branch from 6ef6236 to 8ca2ad2 Compare August 11, 2025 09:54
@biwenli biwenli changed the title Imx943 add new irqsteer1 driver enable irqsteer for m33 of imx943 Aug 11, 2025
@biwenli biwenli force-pushed the imx943-add-new-irqsteer1-driver branch 2 times, most recently from 45230fc to bd989b7 Compare August 14, 2025 02:46
biwenli added 13 commits August 15, 2025 12:34
Enable irqsteer for m33 of imx943

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

Signed-off-by: Biwen Li <[email protected]>
Update interrupt-cells of irqsteer master
  - DT_INST_IRQ_BY_IDX(n, idx, priority) is used to
    get priority attribute of interrupt in some drivers,
    so add priority for irqsteer master to align priority
    attribute.

Signed-off-by: Biwen Li <[email protected]>
Update interrupt-cells of imx8, imx8m, imx8qm, imx8qxp.
  - add priority attribute to fix build issue

Signed-off-by: Biwen Li <[email protected]>
Update interrupt-cells for imx95_m7
  - Add priority attribute to fix build issue.

Signed-off-by: Biwen Li <[email protected]>
Update interrupt-cells of imx8mp_evk_mimx8ml8_adsp
  - Add priority attribute to fix build issue.

Signed-off-by: Biwen Li <[email protected]>
Correct irq number for multi level interrupts

Signed-off-by: Biwen Li <[email protected]>
a. Convert address for dma, unless dma will
   access reserved address. It will cause lockup issue.
b. Print SADDR, DADDR for debugging.

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 is enabled,
define TEST_IRQ_NUM as (CONFIG_2ND_LVL_ISR_TBL_OFFSET - 1)
  - CMSIS/Core/Include/core_cm33.h:2438:15: error: array subscript 24
    is above array bounds of volatile uint32_t[16]

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]>
@biwenli biwenli force-pushed the imx943-add-new-irqsteer1-driver branch from bd989b7 to f33b470 Compare August 15, 2025 06:37
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: DMA Direct Memory Access area: Interrupt Controller area: Samples Samples area: UART Universal Asynchronous Receiver-Transmitter area: Xtensa Xtensa Architecture platform: NXP Drivers NXP Semiconductors, drivers platform: NXP MPU platform: NXP NXP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants