Commit Graph

7 Commits

Author SHA1 Message Date
Laurentiu Mihalcea e2872c002a drivers: intc: irqstr: initialize 'enabled' variable
Initialize the 'enabled' variable before using it.
This fixes the following compilation warning:

"warning: 'enabled' may be used uninitialized [-Wmaybe-uninitialized]"

issued when compiling with `CONFIG_DEBUG` enabled.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Tested-by: Daniel Baluta <daniel.baluta@nxp.com>
2024-10-18 14:16:21 +02:00
Laurentiu Mihalcea 202794273d drivers: intc: irqstr: add PM support
Add support for PM. The strategy is as follows:

	1) For level 1 interrupts: don't care, these don't
	require the PM domain of irqsteer to be turned on
	since they are, well, direct.

	2) For level 2 interrupts: use the reference count
	of the dispatchers.

Upon doing a get() on a dispatcher with its reference count
set to 0, before enabling the IRQ (meaning accessing the
reg. space) increment the reference count of the irqstr device
(which will result in the PM domain being enabled if 0).

Upon doin a put() on a dispatcher with its reference count
set to 1, after disabling the IRQ (meaning accessing the
reg. space) decrement the reference count of the irqstr device
(which will result in the PM domain being disabled if 0).

In summary, the PM domain of the device will be enabled if
at least one dispatcher is in use. On the other hand, the
PM domain of the device will be disabled if there's no
dispatchers in use (assuming there's no other dependencies).

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-11 09:27:57 +02:00
Laurentiu Mihalcea c7be48aae4 drivers: intc: irqstr: manage dispatchers dynamically
Currently, all dispatcher interrupts are enabled during
the driver init() function, which will cause a bus fault
unless the PM domain associated with irqsteer is powered on.

Since PM will be done during irq_enable()/irq_disable(),
add support for dynamically enabling/disabling dispatchers.
This way, the reg. space of the dispatchers will be accessed
when the PM domain is powered on.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-11 09:27:57 +02:00
Laurentiu Mihalcea d274cabf83 drivers: intc: irqstr: add reference count for IRQs
Currently, shared interrupts pose a big problem because
irq_disable() doesn't keep track of the number of clients
using that interrupt line. As such, add a reference count
mechanism which will stop the interrupt from being disabled
if there's still clients using it.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-11 09:27:57 +02:00
Yong Cong Sin 5d9e266d13 drivers: interrupt_controller: irq_steer: use new multilevel irq impl
Update the NXP's irq_steer driver to use the new multi-level
interrupt implementation.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-25 11:24:32 +03:00
Daniel Leung 6d5e0c25a6 xtensa: rename z_xtensa_irq to simple xtensa_irq
This gets rid of the z_ prefix.

Note that z_xt_*() are being used by the HAL so they cannot be
renamed.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-12-13 09:41:24 +01:00
Laurentiu Mihalcea fd8ac9e6cd drivers: interrupt_controller: Add driver for NXP's IRQ_STEER IP
This commit introduces a new interrupt controller driver used
for NXP's IRQ_STEER IP.

Apart from introducing the driver itself, this commit contains
the following changes:
	1) Switch i.MX8MP to using the XTENSA core interrupt
	controller instead of the dummy irqsteer one.
		* this is required because the binding for the
		irqsteer driver is no longer a dummy one
		(since it's being used by the irqsteer driver).
		As such, to avoid having problems, switch to
		using another dummy binding.
	2) Modify the irqsteer dummy binding such that it
	serves the IRQ_STEER driver's needs.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-12-04 09:52:38 -06:00