@@ -164,6 +164,13 @@ properties:req_gpr is the gpr register offset for ENET stop request.req_bit is the gpr bit offset for ENET stop request.+fsl,wakeup-irq:+$ref:/schemas/types.yaml#/definitions/uint32+description:+The property defines the wakeup irq index in enet irq source, the default+value is 0 if not specified.+enum:[0,1,2,3]+mdio:type:objectdescription:
Add "fsl,wakeup-irq" property for FEC controller to select wakeup irq
source.
Signed-off-by: Fugang Duan <redacted>
Signed-off-by: Joakim Zhang <redacted>
Why are not you making use of the standard interrupts-extended property
which allows different interrupt lines to be originating from different
interrupt controllers, e.g.:
interrupts-extended = <&gic GIC_SPI 112 4>, <&wakeup_intc 0>;
--
Florian
Add "fsl,wakeup-irq" property for FEC controller to select wakeup irq
source.
Signed-off-by: Fugang Duan <redacted>
Signed-off-by: Joakim Zhang <redacted>
Why are not you making use of the standard interrupts-extended property
which allows different interrupt lines to be originating from different interrupt
controllers, e.g.:
interrupts-extended = <&gic GIC_SPI 112 4>, <&wakeup_intc 0>;
Thanks.
AFAIK, interrupts-extended should be used instead of interrupts when a device is connected to multiple interrupt controllers
as it encodes a parent phandle with each interrupt specifier. However, for FEC controller, all interrupt lines are originating from
the same interrupt controllers.
1) FEC controller has up to 4 interrupt lines and all of these are routed to GIC interrupt controller.
2) FEC has a wakeup interrupt signal and always are mixed with other interrupt signals, and then output to one interrupt line.
3) For legacy SoCs, wakeup interrupt are mixed to int0 line, but for i.MX8M serials, are mixed to int2 line.
4) Now driver treat int0 as the wakeup source by default, it is broken for i.MX8M.
Best Regards,
Joakim Zhang
Add "fsl,wakeup-irq" property for FEC controller to select wakeup irq
source.
Signed-off-by: Fugang Duan <redacted>
Signed-off-by: Joakim Zhang <redacted>
Why are not you making use of the standard interrupts-extended property
which allows different interrupt lines to be originating from different interrupt
controllers, e.g.:
interrupts-extended = <&gic GIC_SPI 112 4>, <&wakeup_intc 0>;
Thanks.
AFAIK, interrupts-extended should be used instead of interrupts when a device is connected to multiple interrupt controllers
as it encodes a parent phandle with each interrupt specifier. However, for FEC controller, all interrupt lines are originating from
the same interrupt controllers.
OK, so why this custom property then?
1) FEC controller has up to 4 interrupt lines and all of these are routed to GIC interrupt controller.
2) FEC has a wakeup interrupt signal and always are mixed with other interrupt signals, and then output to one interrupt line.
3) For legacy SoCs, wakeup interrupt are mixed to int0 line, but for i.MX8M serials, are mixed to int2 line.
4) Now driver treat int0 as the wakeup source by default, it is broken for i.MX8M.
I don't really know what to make of your response, it seems to me that
you are carrying some legacy Device Tree properties that were invented
when interrupts-extended did not exist and we did not know any better.
--
Florian
Add "fsl,wakeup-irq" property for FEC controller to select wakeup
irq source.
Signed-off-by: Fugang Duan <redacted>
Signed-off-by: Joakim Zhang <redacted>
Why are not you making use of the standard interrupts-extended
property which allows different interrupt lines to be originating
from different interrupt controllers, e.g.:
interrupts-extended = <&gic GIC_SPI 112 4>, <&wakeup_intc 0>;
Thanks.
AFAIK, interrupts-extended should be used instead of interrupts when a
device is connected to multiple interrupt controllers as it encodes a
parent phandle with each interrupt specifier. However, for FEC controller, all
interrupt lines are originating from the same interrupt controllers.
OK, so why this custom property then?
quoted
1) FEC controller has up to 4 interrupt lines and all of these are routed to GIC
interrupt controller.
quoted
2) FEC has a wakeup interrupt signal and always are mixed with other
interrupt signals, and then output to one interrupt line.
quoted
3) For legacy SoCs, wakeup interrupt are mixed to int0 line, but for i.MX8M
serials, are mixed to int2 line.
quoted
4) Now driver treat int0 as the wakeup source by default, it is broken for
i.MX8M.
I don't really know what to make of your response, it seems to me that you are
carrying some legacy Device Tree properties that were invented when
interrupts-extended did not exist and we did not know any better.
As I described in former mail, it is not related to interrupts-extended property.
Let's take a look, e.g.
1) arch/arm/boot/dts/imx7d.dtsi
interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "int0", "int1", "int2", "pps";
For these 4 interrupts are originating from GIC interrupt controller, "int0" for queue 0 and other interrupt signals, containing wakeup;
"int1" for queue 1; "int2" for queue 2.
2) arch/arm64/boot/dts/freescale/imx8mq.dtsi
interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "int0", "int1", "int2", "pps";
For these 4 interrupts are also originating from GIC interrupt controller, "int0" for queue 0; "int1" for queue 1; "int2" for queue 2 and other
interrupt signals, containing wakeup.
If we want to use WoL feature, we need invoke enable_irq_wake() to let this specific interrupt line be a wakeup source. For FEC driver now,
it treats "int0" as wakeup interrupt by default. Obviously it's not fine for i.MX8M serials, since SoC mix wakeup interrupt signal into "int2",
so I add this "fsl,wakeup-irq" custom property to indicate which interrupt line contains wakeup signal.
Not sure if I have explained it clearly enough, from my point of view, I think interrupts-extended property can't fix this issue, right?
If there is any common properties can be used for it, please let me know. Or any other better solutions also be appreciated. Thanks.
Best Regards,
Joakim Zhang
From: Andrew Lunn <andrew@lunn.ch> Date: 2021-08-10 14:33:19
quoted
quoted
1) FEC controller has up to 4 interrupt lines and all of these are routed to GIC
interrupt controller.
quoted
2) FEC has a wakeup interrupt signal and always are mixed with other
interrupt signals, and then output to one interrupt line.
quoted
3) For legacy SoCs, wakeup interrupt are mixed to int0 line, but for i.MX8M
serials, are mixed to int2 line.
So you need to know which of the interrupts listed is the wake up
interrupt.
I can see a few ways to do this:
The FEC driver already has quirks. Add a quirk to fec_imx8mq_info and
fec_imx8qm_info to indicate these should use int2.
or
Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
b) two cells
------------
The #interrupt-cells property is set to 2 and the first cell defines the
index of the interrupt within the controller, while the second cell is used
to specify any of the following flags:
- bits[3:0] trigger type and level flags
1 = low-to-high edge triggered
2 = high-to-low edge triggered
4 = active high level-sensitive
8 = active low level-sensitive
You could add
18 = wakeup source
and extend to core to either do all the work for you, or tell you this
interrupt is flagged as being a wakeup source. This solution has the
advantage of it should be usable in other drivers.
Andrew
Add "fsl,wakeup-irq" property for FEC controller to select wakeup
irq source.
Signed-off-by: Fugang Duan <redacted>
Signed-off-by: Joakim Zhang <redacted>
Why are not you making use of the standard interrupts-extended
property which allows different interrupt lines to be originating
from different interrupt controllers, e.g.:
interrupts-extended = <&gic GIC_SPI 112 4>, <&wakeup_intc 0>;
Thanks.
AFAIK, interrupts-extended should be used instead of interrupts when a
device is connected to multiple interrupt controllers as it encodes a
parent phandle with each interrupt specifier. However, for FEC controller, all
interrupt lines are originating from the same interrupt controllers.
OK, so why this custom property then?
quoted
1) FEC controller has up to 4 interrupt lines and all of these are routed to GIC
interrupt controller.
quoted
2) FEC has a wakeup interrupt signal and always are mixed with other
interrupt signals, and then output to one interrupt line.
quoted
3) For legacy SoCs, wakeup interrupt are mixed to int0 line, but for i.MX8M
serials, are mixed to int2 line.
quoted
4) Now driver treat int0 as the wakeup source by default, it is broken for
i.MX8M.
I don't really know what to make of your response, it seems to me that you are
carrying some legacy Device Tree properties that were invented when
interrupts-extended did not exist and we did not know any better.
As I described in former mail, it is not related to interrupts-extended property.
Let's take a look, e.g.
1) arch/arm/boot/dts/imx7d.dtsi
interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "int0", "int1", "int2", "pps";
For these 4 interrupts are originating from GIC interrupt controller, "int0" for queue 0 and other interrupt signals, containing wakeup;
"int1" for queue 1; "int2" for queue 2.
2) arch/arm64/boot/dts/freescale/imx8mq.dtsi
interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "int0", "int1", "int2", "pps";
For these 4 interrupts are also originating from GIC interrupt controller, "int0" for queue 0; "int1" for queue 1; "int2" for queue 2 and other
interrupt signals, containing wakeup.
If we want to use WoL feature, we need invoke enable_irq_wake() to let this specific interrupt line be a wakeup source. For FEC driver now,
it treats "int0" as wakeup interrupt by default. Obviously it's not fine for i.MX8M serials, since SoC mix wakeup interrupt signal into "int2",
so I add this "fsl,wakeup-irq" custom property to indicate which interrupt line contains wakeup signal.
Not sure if I have explained it clearly enough, from my point of view, I think interrupts-extended property can't fix this issue, right?
This is clearer, and indeed interrupts-extended won't fix that, however
it seems to me that this is a problem that ought to be fixed at the
interrupt controller/irq_chip level which should know and be told which
interrupt lines can be made wake-up interrupts or not. From there on,
the driver can test with enable_irq_wake() whether this has a chance of
working or not.
It seems to me that the 'fsl,wakeup-irq' property ought to be within the
interrupt controller Device Tree node (where it would be easier to
validate that the specific interrupt line is correct) as opposed to
within the consumer (FEC) Device Tree node.
If there is any common properties can be used for it, please let me know. Or any other better solutions also be appreciated. Thanks.
There is a standard 'wakeup-source' boolean property that can be added
to any Device Tree node to indicate it can be a wake-up source, but what
you need here is a bitmask, so introducing a custom property may be
appropriate here.
--
Florian
1) FEC controller has up to 4 interrupt lines and all of these are
routed to GIC
interrupt controller.
quoted
2) FEC has a wakeup interrupt signal and always are mixed with
other
interrupt signals, and then output to one interrupt line.
quoted
3) For legacy SoCs, wakeup interrupt are mixed to int0 line, but
for i.MX8M
serials, are mixed to int2 line.
So you need to know which of the interrupts listed is the wake up interrupt.
I can see a few ways to do this:
The FEC driver already has quirks. Add a quirk to fec_imx8mq_info and
fec_imx8qm_info to indicate these should use int2.
or
Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
b) two cells
------------
The #interrupt-cells property is set to 2 and the first cell defines the
index of the interrupt within the controller, while the second cell is used
to specify any of the following flags:
- bits[3:0] trigger type and level flags
1 = low-to-high edge triggered
2 = high-to-low edge triggered
4 = active high level-sensitive
8 = active low level-sensitive
You could add
18 = wakeup source
and extend to core to either do all the work for you, or tell you this interrupt is
flagged as being a wakeup source. This solution has the advantage of it should
be usable in other drivers.
Thanks a lot for your comments first!
I just look into the irq code, if we extend bit[5] to carry wakeup info ( due to bit[4] is used for IRQ_TYPE_PROBE),
then configure it in the TYPE field of 'interrupts' property, so that interrupt controller would know which interrupt
is wakeup capable.
I think there is no much work core would do, may just set this interrupt wakup capable. Another functionality is
driver side get this info to identify which mixed interrupt has wakeup capability, we can export symbol from kernel/irq/irqdomain.c.
The intention is to let driver know which interrupt is wakeup capable, I would choose to provider this in specific driver,
instead of interrupt controller, it seems to me that others may all choose this solution for wakeup mixed interrupt.
So I would prefer solution 1, it's easier and under-control. I can have a try if you strongly recommend solution 2.
Best Regards,
Joakim Zhang
Add "fsl,wakeup-irq" property for FEC controller to select wakeup
irq source.
Signed-off-by: Fugang Duan <redacted>
Signed-off-by: Joakim Zhang <redacted>
Why are not you making use of the standard interrupts-extended
property which allows different interrupt lines to be originating
from different interrupt controllers, e.g.:
interrupts-extended = <&gic GIC_SPI 112 4>, <&wakeup_intc 0>;
Thanks.
AFAIK, interrupts-extended should be used instead of interrupts when
a device is connected to multiple interrupt controllers as it
encodes a parent phandle with each interrupt specifier. However, for
FEC controller, all
interrupt lines are originating from the same interrupt controllers.
OK, so why this custom property then?
quoted
1) FEC controller has up to 4 interrupt lines and all of these are
routed to GIC
interrupt controller.
quoted
2) FEC has a wakeup interrupt signal and always are mixed with other
interrupt signals, and then output to one interrupt line.
quoted
3) For legacy SoCs, wakeup interrupt are mixed to int0 line, but for
i.MX8M
serials, are mixed to int2 line.
quoted
4) Now driver treat int0 as the wakeup source by default, it is
broken for
i.MX8M.
I don't really know what to make of your response, it seems to me
that you are carrying some legacy Device Tree properties that were
invented when interrupts-extended did not exist and we did not know any
better.
quoted
As I described in former mail, it is not related to interrupts-extended
property.
quoted
Let's take a look, e.g.
1) arch/arm/boot/dts/imx7d.dtsi
interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "int0", "int1", "int2", "pps";
For these 4 interrupts are originating from GIC interrupt controller,
"int0" for queue 0 and other interrupt signals, containing wakeup; "int1" for
queue 1; "int2" for queue 2.
quoted
2) arch/arm64/boot/dts/freescale/imx8mq.dtsi
interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "int0", "int1", "int2", "pps";
For these 4 interrupts are also originating from GIC interrupt
controller, "int0" for queue 0; "int1" for queue 1; "int2" for queue 2 and other
interrupt signals, containing wakeup.
quoted
If we want to use WoL feature, we need invoke enable_irq_wake() to let
this specific interrupt line be a wakeup source. For FEC driver now,
it treats "int0" as wakeup interrupt by default. Obviously it's not fine for
i.MX8M serials, since SoC mix wakeup interrupt signal into "int2", so I add this
"fsl,wakeup-irq" custom property to indicate which interrupt line contains
wakeup signal.
quoted
Not sure if I have explained it clearly enough, from my point of view, I think
interrupts-extended property can't fix this issue, right?
This is clearer, and indeed interrupts-extended won't fix that, however it seems
to me that this is a problem that ought to be fixed at the interrupt
controller/irq_chip level which should know and be told which interrupt lines
can be made wake-up interrupts or not. From there on, the driver can test with
enable_irq_wake() whether this has a chance of working or not.
How can we test with enable_irq_wake()? I agree that interrupt controller can recognize
wakeup interrupt is better.
It seems to me that the 'fsl,wakeup-irq' property ought to be within the
interrupt controller Device Tree node (where it would be easier to validate that
the specific interrupt line is correct) as opposed to within the consumer (FEC)
Device Tree node.
Not quite understand, could you explain more?
quoted
If there is any common properties can be used for it, please let me know. Or
any other better solutions also be appreciated. Thanks.
There is a standard 'wakeup-source' boolean property that can be added
to any Device Tree node to indicate it can be a wake-up source, but what
you need here is a bitmask, so introducing a custom property may be
appropriate here.
Yes, I know 'wakeup-source' boolean property that identify this DEVICE
can be a wakeup source, it's not related to interrupt.
Best Regards,
Joakim Zhang
Add "fsl,wakeup-irq" property for FEC controller to select wakeup
irq source.
Signed-off-by: Fugang Duan <redacted>
Signed-off-by: Joakim Zhang <redacted>
Why are not you making use of the standard interrupts-extended
property which allows different interrupt lines to be originating
from different interrupt controllers, e.g.:
interrupts-extended = <&gic GIC_SPI 112 4>, <&wakeup_intc 0>;
Thanks.
AFAIK, interrupts-extended should be used instead of interrupts when
a device is connected to multiple interrupt controllers as it
encodes a parent phandle with each interrupt specifier. However, for
FEC controller, all
interrupt lines are originating from the same interrupt controllers.
OK, so why this custom property then?
quoted
1) FEC controller has up to 4 interrupt lines and all of these are
routed to GIC
interrupt controller.
quoted
2) FEC has a wakeup interrupt signal and always are mixed with other
interrupt signals, and then output to one interrupt line.
quoted
3) For legacy SoCs, wakeup interrupt are mixed to int0 line, but for
i.MX8M
serials, are mixed to int2 line.
quoted
4) Now driver treat int0 as the wakeup source by default, it is
broken for
i.MX8M.
I don't really know what to make of your response, it seems to me
that you are carrying some legacy Device Tree properties that were
invented when interrupts-extended did not exist and we did not know any
better.
quoted
As I described in former mail, it is not related to interrupts-extended
property.
quoted
Let's take a look, e.g.
1) arch/arm/boot/dts/imx7d.dtsi
interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "int0", "int1", "int2", "pps";
For these 4 interrupts are originating from GIC interrupt controller,
"int0" for queue 0 and other interrupt signals, containing wakeup; "int1" for
queue 1; "int2" for queue 2.
quoted
2) arch/arm64/boot/dts/freescale/imx8mq.dtsi
interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "int0", "int1", "int2", "pps";
For these 4 interrupts are also originating from GIC interrupt
controller, "int0" for queue 0; "int1" for queue 1; "int2" for queue 2 and other
interrupt signals, containing wakeup.
quoted
If we want to use WoL feature, we need invoke enable_irq_wake() to let
this specific interrupt line be a wakeup source. For FEC driver now,
it treats "int0" as wakeup interrupt by default. Obviously it's not fine for
i.MX8M serials, since SoC mix wakeup interrupt signal into "int2", so I add this
"fsl,wakeup-irq" custom property to indicate which interrupt line contains
wakeup signal.
quoted
Not sure if I have explained it clearly enough, from my point of view, I think
interrupts-extended property can't fix this issue, right?
This is clearer, and indeed interrupts-extended won't fix that, however it seems
to me that this is a problem that ought to be fixed at the interrupt
controller/irq_chip level which should know and be told which interrupt lines
can be made wake-up interrupts or not. From there on, the driver can test with
enable_irq_wake() whether this has a chance of working or not.
How can we test with enable_irq_wake()? I agree that interrupt controller can recognize
wakeup interrupt is better.
If enable_irq_wake() returns -ENOTSUPP you would know that wake-up for
that interrupt controller's line is not capable of wake-up?
quoted
It seems to me that the 'fsl,wakeup-irq' property ought to be within the
interrupt controller Device Tree node (where it would be easier to validate that
the specific interrupt line is correct) as opposed to within the consumer (FEC)
Device Tree node.
Not quite understand, could you explain more?
What I mean is that if you need to express which interrupt lines within
an interrupt controller are capable of wake-up, then there should be a
property that tells us that and that property needs to be within the
interrupt controller, not within the consumer of that interrupt since
the consumer has no idea how the system is wired up. Andrew's suggestion
is sort of the same thing, except that it punts the responsibility of
specifying the interrupt's capability towards the consumer of that
interrupt.
--
Florian
1) FEC controller has up to 4 interrupt lines and all of these are
routed to GIC
interrupt controller.
quoted
2) FEC has a wakeup interrupt signal and always are mixed with
other
interrupt signals, and then output to one interrupt line.
quoted
3) For legacy SoCs, wakeup interrupt are mixed to int0 line, but
for i.MX8M
serials, are mixed to int2 line.
So you need to know which of the interrupts listed is the wake up interrupt.
We already have a way to do this by using 'wakeup' for the
interrupt-names entry. But I guess that ship has sailed here and that
wouldn't work well if not just a wakeup source (though you could repeat
an interrupt line that's the wakeup source).
quoted
I can see a few ways to do this:
The FEC driver already has quirks. Add a quirk to fec_imx8mq_info and
fec_imx8qm_info to indicate these should use int2.
Bingo!
Note that if the device is wakeup capable, it should have a
'wakeup-source' property in this case.
quoted
or
Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
b) two cells
------------
The #interrupt-cells property is set to 2 and the first cell defines the
index of the interrupt within the controller, while the second cell is used
to specify any of the following flags:
- bits[3:0] trigger type and level flags
1 = low-to-high edge triggered
2 = high-to-low edge triggered
4 = active high level-sensitive
8 = active low level-sensitive
You could add
18 = wakeup source
I'd be okay with this (though it should be a power of 2 number).
quoted
and extend to core to either do all the work for you, or tell you this interrupt is
flagged as being a wakeup source. This solution has the advantage of it should
be usable in other drivers.
Another option is couldn't you just enable all the interrupts as wakeup
sources? Presumably, only one of them would trigger a wakeup.
Thanks a lot for your comments first!
I just look into the irq code, if we extend bit[5] to carry wakeup info ( due to bit[4] is used for IRQ_TYPE_PROBE),
then configure it in the TYPE field of 'interrupts' property, so that interrupt controller would know which interrupt
is wakeup capable.
I think there is no much work core would do, may just set this interrupt wakup capable. Another functionality is
driver side get this info to identify which mixed interrupt has wakeup capability, we can export symbol from kernel/irq/irqdomain.c.
The intention is to let driver know which interrupt is wakeup capable, I would choose to provider this in specific driver,
instead of interrupt controller, it seems to me that others may all choose this solution for wakeup mixed interrupt.
So I would prefer solution 1, it's easier and under-control. I can have a try if you strongly recommend solution 2.
Best Regards,
Joakim Zhang
1) FEC controller has up to 4 interrupt lines and all of these
are routed to GIC
interrupt controller.
quoted
2) FEC has a wakeup interrupt signal and always are mixed with
other
interrupt signals, and then output to one interrupt line.
quoted
3) For legacy SoCs, wakeup interrupt are mixed to int0 line,
but for i.MX8M
serials, are mixed to int2 line.
So you need to know which of the interrupts listed is the wake up interrupt.
We already have a way to do this by using 'wakeup' for the interrupt-names
entry. But I guess that ship has sailed here and that wouldn't work well if not
just a wakeup source (though you could repeat an interrupt line that's the
wakeup source).
Yes, I am not sure whether it's a common solution, such as:
interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
interrupt-names = "int0", "int1", "int2", "pps", "wakeup";
Where we repeat interrupt 120 for both "int2" and "wakeup", does you mean this?
quoted
quoted
I can see a few ways to do this:
The FEC driver already has quirks. Add a quirk to fec_imx8mq_info
and fec_imx8qm_info to indicate these should use int2.
Bingo!
Note that if the device is wakeup capable, it should have a 'wakeup-source'
property in this case.
quoted
quoted
or
Documentation/devicetree/bindings/interrupt-controller/interrupts.tx
t
b) two cells
------------
The #interrupt-cells property is set to 2 and the first cell defines the
index of the interrupt within the controller, while the second cell is used
to specify any of the following flags:
- bits[3:0] trigger type and level flags
1 = low-to-high edge triggered
2 = high-to-low edge triggered
4 = active high level-sensitive
8 = active low level-sensitive
You could add
18 = wakeup source
I'd be okay with this (though it should be a power of 2 number).
quoted
quoted
and extend to core to either do all the work for you, or tell you
this interrupt is flagged as being a wakeup source. This solution
has the advantage of it should be usable in other drivers.
Another option is couldn't you just enable all the interrupts as wakeup sources?
Presumably, only one of them would trigger a wakeup.
Yes, another solution, I thought it but not implemented it as we had better let users know which
interrupt is wakeup capable.
Best Regards,
Joakim Zhang
quoted
Thanks a lot for your comments first!
I just look into the irq code, if we extend bit[5] to carry wakeup
info ( due to bit[4] is used for IRQ_TYPE_PROBE), then configure it in
the TYPE field of 'interrupts' property, so that interrupt controller would know
which interrupt is wakeup capable.
quoted
I think there is no much work core would do, may just set this
interrupt wakup capable. Another functionality is driver side get this info to
identify which mixed interrupt has wakeup capability, we can export symbol
from kernel/irq/irqdomain.c.
quoted
The intention is to let driver know which interrupt is wakeup capable,
I would choose to provider this in specific driver, instead of interrupt
controller, it seems to me that others may all choose this solution for wakeup
mixed interrupt.
quoted
So I would prefer solution 1, it's easier and under-control. I can have a try if