Skip to contentSkip to conversation

Describe interrupts-extended property

PATCH In review Florian Fainelli 5 participants 11 messages Jan 3, 2017 – Jan 13, 2017 7 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Describe interrupts-extended property

The interrupts-extended property is a common property used when interrupt generating devices having interrupt lines in several interrupt controllers with possibly distinct interrupt specifiers.

---
 source/devicetree-basics.rst | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
source/devicetree-basics.rst +34 -0
index be80af3d825b..1bda0fa54e7a 100644
@@ -955,6 +955,40 @@ Description:
    to the interrupt parent. If this property is missing from a device, its
    interrupt parent is assumed to be its devicetree parent.
 
+interrupts-extended
+^^^^^^^^^^^^^^^^^^^
+
+Property: ``interrupts-extended``
+
+Value type: ``<phandle> <prop-encoded-array>``
+
+Description:
+
+   The *interrupts-extended* property of a device node defines the interrupt or
+   the interrupts that are generated by the device. In case where an interrupt
+   generating devices has several interrupt lines, some of them having distinct
+   interrupt parents, the *interrupts-extended* property should be used to
+   fully describe the interrupts of this device, relative to the interrupt
+   controller(s), which is encoded by the phandle part of the property. The non
+   phandle part of the property encodes the interrupt specifiers and obeys to
+   the *interrupts* property description.
+
+   If both *interrupts-extended* and *interrupts* properties are present, the
+   *interrupts-extended* properties takes precedence, and the *interrupts*
+   property may be provided to a client program for compatibility purposes.
+
+Example:
+
+   A device with several interrupt lines in distinct interrupt controllers,
+   having different interrupt specifiers is illustrated below. In this example
+   ``pic`` is an interrupt controller with an *#interrupt-cells* specifier
+   of 2, while ``gic`` is an interrupt controller with an *#interrupts-cells*
+   specifier of 1.
+
+
+      ``interrupts-extended = <&pic 0xA 8>, <&gic 0xda>;``
+
+
 Properties for Interrupt Controllers
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Signature · 1 line
2.9.3

A message that is not in the archive (sent off-list or not yet received): 20170103192423.5838-1-f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#2 lore raw

Correcting Grant's email.

Quoted 5 lines · Florian Fainelli

The interrupts-extended property is a common property used when interrupt generating devices having interrupt lines in several interrupt controllers with possibly distinct interrupt specifiers.

I assume this is mostly copied from the kernel documentation. This needs Grant's ack as the kernel documentation license is ambiguous (default GPL) and the spec is Apache.

Quoted 13 lines
---
 source/devicetree-basics.rst | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
source/devicetree-basics.rst +1 -0
index be80af3d825b..1bda0fa54e7a 100644
@@ -955,6 +955,40 @@ Description:
    to the interrupt parent. If this property is missing from a device, its
    interrupt parent is assumed to be its devicetree parent.
 
+interrupts-extended

source/devicetree-basics.rst Description: · line 968

Quoted 10 lines
source/devicetree-basics.rst +10 -0
+^^^^^^^^^^^^^^^^^^^
+
+Property: ``interrupts-extended``
+
+Value type: ``<phandle> <prop-encoded-array>``
+
+Description:
+
+   The *interrupts-extended* property of a device node defines the interrupt or
+   the interrupts that are generated by the device. In case where an interrupt

In the case...

source/devicetree-basics.rst Description: · line 969

Quoted 1 line
source/devicetree-basics.rst +1 -0
+   generating devices has several interrupt lines, some of them having distinct

s/devices/device/

Quoted 28 lines
source/devicetree-basics.rst +22 -1
+   interrupt parents, the *interrupts-extended* property should be used to
+   fully describe the interrupts of this device, relative to the interrupt
+   controller(s), which is encoded by the phandle part of the property. The non
+   phandle part of the property encodes the interrupt specifiers and obeys to
+   the *interrupts* property description.
+
+   If both *interrupts-extended* and *interrupts* properties are present, the
+   *interrupts-extended* properties takes precedence, and the *interrupts*
+   property may be provided to a client program for compatibility purposes.
+
+Example:
+
+   A device with several interrupt lines in distinct interrupt controllers,
+   having different interrupt specifiers is illustrated below. In this example
+   ``pic`` is an interrupt controller with an *#interrupt-cells* specifier
+   of 2, while ``gic`` is an interrupt controller with an *#interrupts-cells*
+   specifier of 1.
+
+
+      ``interrupts-extended = <&pic 0xA 8>, <&gic 0xda>;``
+
+
 Properties for Interrupt Controllers
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
--

2.9.3

A message that is not in the archive (sent off-list or not yet received): CAL_Jsq+2TVHGS2onm50rG_AxesJEBUhEGLZNEJN8XAGo4CbMgA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#4 lore raw
Quoted 7 lines · Rob Herring

Correcting Grant's email.

Quoted 4 lines · Florian Fainelli

The interrupts-extended property is a common property used when interrupt generating devices having interrupt lines in several interrupt controllers with possibly distinct interrupt specifiers.

Quoted 5 lines
Quoted 1 line

I assume this is mostly copied from the kernel documentation. This needs Grant's ack as the kernel documentation license is ambiguous (default GPL) and the spec is Apache.

Sort of, I did look at the changes submitted to the documentation, but this was kind of rewritten from scratch, nonetheless, having some clarification on the documentation would indeed be a good thing.

Quoted 27 lines
Quoted 14 lines
---
 source/devicetree-basics.rst | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
source/devicetree-basics.rst +1 -0
index be80af3d825b..1bda0fa54e7a 100644
@@ -955,6 +955,40 @@ Description:
    to the interrupt parent. If this property is missing from a device, its
    interrupt parent is assumed to be its devicetree parent.
 
+interrupts-extended

source/devicetree-basics.rst Description: · line 968

Quoted 10 lines
source/devicetree-basics.rst +10 -0
+^^^^^^^^^^^^^^^^^^^
+
+Property: ``interrupts-extended``
+
+Value type: ``<phandle> <prop-encoded-array>``
+
+Description:
+
+   The *interrupts-extended* property of a device node defines the interrupt or
+   the interrupts that are generated by the device. In case where an interrupt

In the case...

Quoted 3 lines

source/devicetree-basics.rst Description: · line 969

Quoted 1 line
source/devicetree-basics.rst +1 -0
+   generating devices has several interrupt lines, some of them having distinct

s/devices/device/

Whoops, thanks, anything else that needs fixing in the wording used below?

Quoted 29 lines
Quoted 29 lines
source/devicetree-basics.rst +22 -1
+   interrupt parents, the *interrupts-extended* property should be used to
+   fully describe the interrupts of this device, relative to the interrupt
+   controller(s), which is encoded by the phandle part of the property. The non
+   phandle part of the property encodes the interrupt specifiers and obeys to
+   the *interrupts* property description.
+
+   If both *interrupts-extended* and *interrupts* properties are present, the
+   *interrupts-extended* properties takes precedence, and the *interrupts*
+   property may be provided to a client program for compatibility purposes.
+
+Example:
+
+   A device with several interrupt lines in distinct interrupt controllers,
+   having different interrupt specifiers is illustrated below. In this example
+   ``pic`` is an interrupt controller with an *#interrupt-cells* specifier
+   of 2, while ``gic`` is an interrupt controller with an *#interrupts-cells*
+   specifier of 1.
+
+
+      ``interrupts-extended = <&pic 0xA 8>, <&gic 0xda>;``
+
+
 Properties for Interrupt Controllers
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
--

2.9.3

Signature · 1 line
Florian
#5 lore raw
In reply to a message not in the archive
Quoted 7 lines · Rob Herring

Correcting Grant's email.

Quoted 4 lines · Florian Fainelli

The interrupts-extended property is a common property used when interrupt generating devices having interrupt lines in several interrupt controllers with possibly distinct interrupt specifiers.

Quoted 5 lines
Quoted 1 line

I assume this is mostly copied from the kernel documentation. This needs Grant's ack as the kernel documentation license is ambiguous (default GPL) and the spec is Apache.

Looks fine to me. I've pulled it in.

Thanks,
g.

Quoted 59 lines
Quoted 14 lines
---
 source/devicetree-basics.rst | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
source/devicetree-basics.rst +1 -0
index be80af3d825b..1bda0fa54e7a 100644
@@ -955,6 +955,40 @@ Description:
    to the interrupt parent. If this property is missing from a device, its
    interrupt parent is assumed to be its devicetree parent.
 
+interrupts-extended

source/devicetree-basics.rst Description: · line 968

Quoted 10 lines
source/devicetree-basics.rst +10 -0
+^^^^^^^^^^^^^^^^^^^
+
+Property: ``interrupts-extended``
+
+Value type: ``<phandle> <prop-encoded-array>``
+
+Description:
+
+   The *interrupts-extended* property of a device node defines the interrupt or
+   the interrupts that are generated by the device. In case where an interrupt

In the case...

source/devicetree-basics.rst Description: · line 969

Quoted 1 line
source/devicetree-basics.rst +1 -0
+   generating devices has several interrupt lines, some of them having distinct

s/devices/device/

Quoted 28 lines
source/devicetree-basics.rst +22 -1
+   interrupt parents, the *interrupts-extended* property should be used to
+   fully describe the interrupts of this device, relative to the interrupt
+   controller(s), which is encoded by the phandle part of the property. The non
+   phandle part of the property encodes the interrupt specifiers and obeys to
+   the *interrupts* property description.
+
+   If both *interrupts-extended* and *interrupts* properties are present, the
+   *interrupts-extended* properties takes precedence, and the *interrupts*
+   property may be provided to a client program for compatibility purposes.
+
+Example:
+
+   A device with several interrupt lines in distinct interrupt controllers,
+   having different interrupt specifiers is illustrated below. In this example
+   ``pic`` is an interrupt controller with an *#interrupt-cells* specifier
+   of 2, while ``gic`` is an interrupt controller with an *#interrupts-cells*
+   specifier of 1.
+
+
+      ``interrupts-extended = <&pic 0xA 8>, <&gic 0xda>;``
+
+
 Properties for Interrupt Controllers
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
--

2.9.3

#6 lore raw
In reply to a message not in the archive
Quoted 5 lines · Florian Fainelli

The interrupts-extended property is a common property used when interrupt generating devices having interrupt lines in several interrupt controllers with possibly distinct interrupt specifiers.

Hmm. Is this actually used in the wild already?

I'm just wondering if it's really needed, since you can work around the limitations with the ordinary interrupts property by setting interrupt-parent to the node itself putting an interrupt nexus (interrupt-map and interrupt-map-mask properties) in there to redirect those to different interrupt controllers.

Quoted 49 lines
---
 source/devicetree-basics.rst | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
source/devicetree-basics.rst +34 -0
index be80af3d825b..1bda0fa54e7a 100644
@@ -955,6 +955,40 @@ Description:
    to the interrupt parent. If this property is missing from a device, its
    interrupt parent is assumed to be its devicetree parent.
 
+interrupts-extended
+^^^^^^^^^^^^^^^^^^^
+
+Property: ``interrupts-extended``
+
+Value type: ``<phandle> <prop-encoded-array>``
+
+Description:
+
+   The *interrupts-extended* property of a device node defines the interrupt or
+   the interrupts that are generated by the device. In case where an interrupt
+   generating devices has several interrupt lines, some of them having distinct
+   interrupt parents, the *interrupts-extended* property should be used to
+   fully describe the interrupts of this device, relative to the interrupt
+   controller(s), which is encoded by the phandle part of the property. The non
+   phandle part of the property encodes the interrupt specifiers and obeys to
+   the *interrupts* property description.
+
+   If both *interrupts-extended* and *interrupts* properties are present, the
+   *interrupts-extended* properties takes precedence, and the *interrupts*
+   property may be provided to a client program for compatibility purposes.
+
+Example:
+
+   A device with several interrupt lines in distinct interrupt controllers,
+   having different interrupt specifiers is illustrated below. In this example
+   ``pic`` is an interrupt controller with an *#interrupt-cells* specifier
+   of 2, while ``gic`` is an interrupt controller with an *#interrupts-cells*
+   specifier of 1.
+
+
+      ``interrupts-extended = <&pic 0xA 8>, <&gic 0xda>;``
+
+
 Properties for Interrupt Controllers
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw
Quoted 8 lines · David Gibson
Quoted 5 lines · Florian Fainelli

The interrupts-extended property is a common property used when interrupt generating devices having interrupt lines in several interrupt controllers with possibly distinct interrupt specifiers.

Hmm. Is this actually used in the wild already?

Yes, we have been using this for nearly 3 years now, primarily with devices that have a "main" interrupt and a "wake-up" interrupt in separate interrupt controllers. There are existing in kernel tree users of this as well.

Quoted 6 lines

I'm just wondering if it's really needed, since you can work around the limitations with the ordinary interrupts property by setting interrupt-parent to the node itself putting an interrupt nexus (interrupt-map and interrupt-map-mask properties) in there to redirect those to different interrupt controllers.

Well, sure you could do that, and this actually serves a similar, if not identical purpose, it just appeared that interrupts-extended got introduced to solve that problem, is supported by Linux, and therefore may deserve a documentation in the Device Tree spec. I'd have to double check, but it does not appear to me that the solution you are proposing is supported by Linux for instance.

Digression: I was actually wondering if we may not have a need to do the same thing for "reg" properties, where a given device may have memory mapped I/O registers in one place, and another address in another bus, with a different address space, this is actually pretty common for e.g:
PHY (Ethernet, PCIe, SATA or USB).

Thanks!

Quoted 51 lines
Quoted 50 lines
---
 source/devicetree-basics.rst | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
source/devicetree-basics.rst +34 -0
index be80af3d825b..1bda0fa54e7a 100644
@@ -955,6 +955,40 @@ Description:
    to the interrupt parent. If this property is missing from a device, its
    interrupt parent is assumed to be its devicetree parent.
 
+interrupts-extended
+^^^^^^^^^^^^^^^^^^^
+
+Property: ``interrupts-extended``
+
+Value type: ``<phandle> <prop-encoded-array>``
+
+Description:
+
+   The *interrupts-extended* property of a device node defines the interrupt or
+   the interrupts that are generated by the device. In case where an interrupt
+   generating devices has several interrupt lines, some of them having distinct
+   interrupt parents, the *interrupts-extended* property should be used to
+   fully describe the interrupts of this device, relative to the interrupt
+   controller(s), which is encoded by the phandle part of the property. The non
+   phandle part of the property encodes the interrupt specifiers and obeys to
+   the *interrupts* property description.
+
+   If both *interrupts-extended* and *interrupts* properties are present, the
+   *interrupts-extended* properties takes precedence, and the *interrupts*
+   property may be provided to a client program for compatibility purposes.
+
+Example:
+
+   A device with several interrupt lines in distinct interrupt controllers,
+   having different interrupt specifiers is illustrated below. In this example
+   ``pic`` is an interrupt controller with an *#interrupt-cells* specifier
+   of 2, while ``gic`` is an interrupt controller with an *#interrupts-cells*
+   specifier of 1.
+
+
+      ``interrupts-extended = <&pic 0xA 8>, <&gic 0xda>;``
+
+
 Properties for Interrupt Controllers
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Signature · 1 line
Florian

A message that is not in the archive (sent off-list or not yet received): f04c76d4-996b-6ffd-d59e-eb992d0a912d-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#10 lore raw
Quoted 6 lines · Florian Fainelli
Quoted 5 lines · David Gibson
Quoted 4 lines · Florian Fainelli

The interrupts-extended property is a common property used when interrupt generating devices having interrupt lines in several interrupt controllers with possibly distinct interrupt specifiers.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Hmm. Is this actually used in the wild already?

Yes, we have been using this for nearly 3 years now, primarily with devices that have a "main" interrupt and a "wake-up" interrupt in separate interrupt controllers. There are existing in kernel tree users of this as well.

Ok, fair enough then.

Quoted 6 lines
Quoted 5 lines

I'm just wondering if it's really needed, since you can work around the limitations with the ordinary interrupts property by setting interrupt-parent to the node itself putting an interrupt nexus (interrupt-map and interrupt-map-mask properties) in there to redirect those to different interrupt controllers.

Quoted 6 lines

Well, sure you could do that, and this actually serves a similar, if not identical purpose, it just appeared that interrupts-extended got introduced to solve that problem, is supported by Linux, and therefore may deserve a documentation in the Device Tree spec. I'd have to double check, but it does not appear to me that the solution you are proposing is supported by Linux for instance.

Right. The point is I used this workaround to avoid inventing something like interrupts-extended nearly 10 years ago (for the Bamboo 440EP board I think). Admittedly the workaround is pretty ugly.

Quoted 5 lines

Digression: I was actually wondering if we may not have a need to do the same thing for "reg" properties, where a given device may have memory mapped I/O registers in one place, and another address in another bus, with a different address space, this is actually pretty common for e.g:
PHY (Ethernet, PCIe, SATA or USB).

I've wondered about something like that for some time (my working name was 'bus-reg'). The use cases I encountered were on PPC4xx machines which had lots of things controlled (at least partially) by the sideband "DCR" (Device Control Register) bus. We did invent a 'dcr-reg' property to cover that specific case, and I think something similar has been done for some other sideband busses. Something like 'bus-reg' would be a more general solution to the problem.

I believe the "classic" IEEE1275 way of solving this is to have separate nodes on each of the relevant busses, with phandle pointers linking them together. The relevant driver would claim all the related nodes. Again, it gets pretty messy, though.

Quoted 52 lines
Quoted 50 lines
Quoted 49 lines
---
 source/devicetree-basics.rst | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
source/devicetree-basics.rst +34 -0
index be80af3d825b..1bda0fa54e7a 100644
@@ -955,6 +955,40 @@ Description:
    to the interrupt parent. If this property is missing from a device, its
    interrupt parent is assumed to be its devicetree parent.
 
+interrupts-extended
+^^^^^^^^^^^^^^^^^^^
+
+Property: ``interrupts-extended``
+
+Value type: ``<phandle> <prop-encoded-array>``
+
+Description:
+
+   The *interrupts-extended* property of a device node defines the interrupt or
+   the interrupts that are generated by the device. In case where an interrupt
+   generating devices has several interrupt lines, some of them having distinct
+   interrupt parents, the *interrupts-extended* property should be used to
+   fully describe the interrupts of this device, relative to the interrupt
+   controller(s), which is encoded by the phandle part of the property. The non
+   phandle part of the property encodes the interrupt specifiers and obeys to
+   the *interrupts* property description.
+
+   If both *interrupts-extended* and *interrupts* properties are present, the
+   *interrupts-extended* properties takes precedence, and the *interrupts*
+   property may be provided to a client program for compatibility purposes.
+
+Example:
+
+   A device with several interrupt lines in distinct interrupt controllers,
+   having different interrupt specifiers is illustrated below. In this example
+   ``pic`` is an interrupt controller with an *#interrupt-cells* specifier
+   of 2, while ``gic`` is an interrupt controller with an *#interrupts-cells*
+   specifier of 1.
+
+
+      ``interrupts-extended = <&pic 0xA 8>, <&gic 0xda>;``
+
+
 Properties for Interrupt Controllers
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

A message that is not in the archive (sent off-list or not yet received): [email protected]

#12 lore raw
Quoted 41 lines · David Gibson
Quoted 6 lines · Florian Fainelli
Quoted 5 lines · David Gibson
Quoted 4 lines · Florian Fainelli

The interrupts-extended property is a common property used when interrupt generating devices having interrupt lines in several interrupt controllers with possibly distinct interrupt specifiers.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Hmm. Is this actually used in the wild already?

Yes, we have been using this for nearly 3 years now, primarily with devices that have a "main" interrupt and a "wake-up" interrupt in separate interrupt controllers. There are existing in kernel tree users of this as well.

Ok, fair enough then.

Quoted 6 lines
Quoted 5 lines

I'm just wondering if it's really needed, since you can work around the limitations with the ordinary interrupts property by setting interrupt-parent to the node itself putting an interrupt nexus (interrupt-map and interrupt-map-mask properties) in there to redirect those to different interrupt controllers.

Quoted 6 lines

Well, sure you could do that, and this actually serves a similar, if not identical purpose, it just appeared that interrupts-extended got introduced to solve that problem, is supported by Linux, and therefore may deserve a documentation in the Device Tree spec. I'd have to double check, but it does not appear to me that the solution you are proposing is supported by Linux for instance.

Right. The point is I used this workaround to avoid inventing something like interrupts-extended nearly 10 years ago (for the Bamboo 440EP board I think). Admittedly the workaround is pretty ugly.

Quoted 5 lines

Digression: I was actually wondering if we may not have a need to do the same thing for "reg" properties, where a given device may have memory mapped I/O registers in one place, and another address in another bus, with a different address space, this is actually pretty common for e.g:
PHY (Ethernet, PCIe, SATA or USB).

Quoted 7 lines

I've wondered about something like that for some time (my working name was 'bus-reg'). The use cases I encountered were on PPC4xx machines which had lots of things controlled (at least partially) by the sideband "DCR" (Device Control Register) bus. We did invent a 'dcr-reg' property to cover that specific case, and I think something similar has been done for some other sideband busses. Something like 'bus-reg' would be a more general solution to the problem.

Seems to me like syscon is pretty much what was invented in Linux to support that use case.

Quoted 5 lines

I believe the "classic" IEEE1275 way of solving this is to have separate nodes on each of the relevant busses, with phandle pointers linking them together. The relevant driver would claim all the related nodes. Again, it gets pretty messy, though.

Yes still pretty ugly.

Device Tree tends to list resources as properties of the node that consumes them, which is fine, although it can lead to duplicate values in a given DTB, but one could also imagine, say listing all register resources as properties of the bus that decodes these addresses, and then having child nodes of that bus node reference via phandle their relevant "reg" cells. Something like this for instance:

bus@deadbeef {
	reg = <0x10000000 0x100>, //UART 0
		<0x10000100 0x100> //UART 1

	uart@100 {
		compatible = "acme,uart";
		reg = <&bus 0>;
	};
};

You get the idea ;)

Quoted 54 lines
Quoted 53 lines
Quoted 51 lines
Quoted 50 lines
---
 source/devicetree-basics.rst | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
source/devicetree-basics.rst +34 -0
index be80af3d825b..1bda0fa54e7a 100644
@@ -955,6 +955,40 @@ Description:
    to the interrupt parent. If this property is missing from a device, its
    interrupt parent is assumed to be its devicetree parent.
 
+interrupts-extended
+^^^^^^^^^^^^^^^^^^^
+
+Property: ``interrupts-extended``
+
+Value type: ``<phandle> <prop-encoded-array>``
+
+Description:
+
+   The *interrupts-extended* property of a device node defines the interrupt or
+   the interrupts that are generated by the device. In case where an interrupt
+   generating devices has several interrupt lines, some of them having distinct
+   interrupt parents, the *interrupts-extended* property should be used to
+   fully describe the interrupts of this device, relative to the interrupt
+   controller(s), which is encoded by the phandle part of the property. The non
+   phandle part of the property encodes the interrupt specifiers and obeys to
+   the *interrupts* property description.
+
+   If both *interrupts-extended* and *interrupts* properties are present, the
+   *interrupts-extended* properties takes precedence, and the *interrupts*
+   property may be provided to a client program for compatibility purposes.
+
+Example:
+
+   A device with several interrupt lines in distinct interrupt controllers,
+   having different interrupt specifiers is illustrated below. In this example
+   ``pic`` is an interrupt controller with an *#interrupt-cells* specifier
+   of 2, while ``gic`` is an interrupt controller with an *#interrupts-cells*
+   specifier of 1.
+
+
+      ``interrupts-extended = <&pic 0xA 8>, <&gic 0xda>;``
+
+
 Properties for Interrupt Controllers
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Signature · 1 line
Florian

A message that is not in the archive (sent off-list or not yet received): 0d9b43f1-147c-5761-9fdd-8ba28c690df9-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#14 lore raw

Hi Florian,

Quoted 2 lines · On Tuesday 03 Jan 2017 16:47:03 Florian Fainelli wrote:
Quoted 1 line · David Gibson

On Tue, Jan 03, 2017 at 03:44:28PM -0800, Florian Fainelli wrote:

[snip]

Quoted 41 lines
Quoted 6 lines
Quoted 5 lines

Digression: I was actually wondering if we may not have a need to do the same thing for "reg" properties, where a given device may have memory mapped I/O registers in one place, and another address in another bus, with a different address space, this is actually pretty common for e.g:
PHY (Ethernet, PCIe, SATA or USB).

Quoted 7 lines

I've wondered about something like that for some time (my working name was 'bus-reg'). The use cases I encountered were on PPC4xx machines which had lots of things controlled (at least partially) by the sideband "DCR" (Device Control Register) bus. We did invent a 'dcr-reg' property to cover that specific case, and I think something similar has been done for some other sideband busses. Something like 'bus-reg' would be a more general solution to the problem.

Seems to me like syscon is pretty much what was invented in Linux to support that use case.

Quoted 4 lines

I believe the "classic" IEEE1275 way of solving this is to have separate nodes on each of the relevant busses, with phandle pointers linking them together. The relevant driver would claim all the related nodes. Again, it gets pretty messy, though.

Yes still pretty ugly.

Device Tree tends to list resources as properties of the node that consumes them, which is fine, although it can lead to duplicate values in a given DTB, but one could also imagine, say listing all register resources as properties of the bus that decodes these addresses, and then having child nodes of that bus node reference via phandle their relevant "reg" cells. Something like this for instance:

bus@deadbeef {
	reg = <0x10000000 0x100>, //UART 0
		<0x10000100 0x100> //UART 1

	uart@100 {
		compatible = "acme,uart";
		reg = <&bus 0>;
	};
};
Quoted 1 line

You get the idea ;)

/me shivers :-)

The problem you've raised comes down in my opinion to the fact that a tree simply can't represent a topology that isn't tree-like. The device tree more or less lays down nodes from the point of view of control buses. As soon as your device sits on multiple buses the device tree can't represent it accurately. So far this hasn't really been an issue (probably thank to the occasional hack), but with devices becoming more and more complex I wouldn't be surprised if we had to really tackle this problem in the not too distant future. A nasty example that comes to my mind is an SoC with two clusters of CPU of different architectures (namely ARM and SH) where some peripheral are accessible to both the ARM and SH side, but mapped at different addresses. So far we've only described the ARM view of the system, but wouldn't it be lovely to have a single DT that can cover both ? :-)

Signature · 3 lines
Regards,

Laurent Pinchart
#15 lore raw
Quoted 51 lines · Laurent Pinchart

Hi Florian,

Quoted 2 lines · On Tuesday 03 Jan 2017 16:47:03 Florian Fainelli wrote:
Quoted 1 line · David Gibson

On Tue, Jan 03, 2017 at 03:44:28PM -0800, Florian Fainelli wrote:

[snip]

Quoted 41 lines
Quoted 6 lines
Quoted 5 lines

Digression: I was actually wondering if we may not have a need to do the same thing for "reg" properties, where a given device may have memory mapped I/O registers in one place, and another address in another bus, with a different address space, this is actually pretty common for e.g:
PHY (Ethernet, PCIe, SATA or USB).

Quoted 7 lines

I've wondered about something like that for some time (my working name was 'bus-reg'). The use cases I encountered were on PPC4xx machines which had lots of things controlled (at least partially) by the sideband "DCR" (Device Control Register) bus. We did invent a 'dcr-reg' property to cover that specific case, and I think something similar has been done for some other sideband busses. Something like 'bus-reg' would be a more general solution to the problem.

Seems to me like syscon is pretty much what was invented in Linux to support that use case.

Quoted 4 lines

I believe the "classic" IEEE1275 way of solving this is to have separate nodes on each of the relevant busses, with phandle pointers linking them together. The relevant driver would claim all the related nodes. Again, it gets pretty messy, though.

Yes still pretty ugly.

Device Tree tends to list resources as properties of the node that consumes them, which is fine, although it can lead to duplicate values in a given DTB, but one could also imagine, say listing all register resources as properties of the bus that decodes these addresses, and then having child nodes of that bus node reference via phandle their relevant "reg" cells. Something like this for instance:

bus@deadbeef {
	reg = <0x10000000 0x100>, //UART 0
		<0x10000100 0x100> //UART 1

	uart@100 {
		compatible = "acme,uart";
		reg = <&bus 0>;
	};
};
Quoted 1 line

You get the idea ;)

Quoted 7 lines

/me shivers :-)

The problem you've raised comes down in my opinion to the fact that a tree simply can't represent a topology that isn't tree-like. The device tree more or less lays down nodes from the point of view of control buses. As soon as your device sits on multiple buses the device tree can't represent it accurately.

I partially agree with that statement, the accurately part is what I disagree with, you can represent it with some accuracy, just not necessarily using standard properties, you may have to cook your own, meaning the standard somehow failed to cover that part. The other part, is that with a tree, you may have some repetition and multiple references, which is far from ideal.

Quoted 8 lines

So far this hasn't really been an issue (probably thank to the occasional hack), but with devices becoming more and more complex I wouldn't be surprised if we had to really tackle this problem in the not too distant future. A nasty example that comes to my mind is an SoC with two clusters of CPU of different architectures (namely ARM and SH) where some peripheral are accessible to both the ARM and SH side, but mapped at different addresses. So far we've only described the ARM view of the system, but wouldn't it be lovely to have a single DT that can cover both ? :-)

An argument could be made that your cluster is most likely not running the same instance of the operating system (although there has been research on that done before, not sure where that stands in real life?) so while having a single blob would be nice, you most likely, for all practical reasons, would duplicate what is necessary (which should be reasonably easy with scripting/separate sources and include files) and provide separate blobs to each OS instance?

Cheers

Signature · 1 line
Florian

A message that is not in the archive (sent off-list or not yet received): 663f501c-4646-8f15-cb90-0477ceff3daf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#17 lore raw

Hi Florian,

Quoted 57 lines · On Tuesday 03 Jan 2017 17:19:29 Florian Fainelli wrote:
Quoted 48 lines · Laurent Pinchart
Quoted 2 lines · On Tuesday 03 Jan 2017 16:47:03 Florian Fainelli wrote:
Quoted 1 line · David Gibson

On Tue, Jan 03, 2017 at 03:44:28PM -0800, Florian Fainelli wrote:

[snip]

Quoted 40 lines
Quoted 6 lines
Quoted 5 lines

Digression: I was actually wondering if we may not have a need to do the same thing for "reg" properties, where a given device may have memory mapped I/O registers in one place, and another address in another bus, with a different address space, this is actually pretty common for e.g: PHY (Ethernet, PCIe, SATA or USB).

Quoted 7 lines

I've wondered about something like that for some time (my working name was 'bus-reg'). The use cases I encountered were on PPC4xx machines which had lots of things controlled (at least partially) by the sideband "DCR" (Device Control Register) bus. We did invent a 'dcr-reg' property to cover that specific case, and I think something similar has been done for some other sideband busses. Something like 'bus-reg' would be a more general solution to the problem.

Seems to me like syscon is pretty much what was invented in Linux to support that use case.

Quoted 4 lines

I believe the "classic" IEEE1275 way of solving this is to have separate nodes on each of the relevant busses, with phandle pointers linking them together. The relevant driver would claim all the related nodes. Again, it gets pretty messy, though.

Yes still pretty ugly.

Device Tree tends to list resources as properties of the node that consumes them, which is fine, although it can lead to duplicate values in a given DTB, but one could also imagine, say listing all register resources as properties of the bus that decodes these addresses, and then having child nodes of that bus node reference via phandle their relevant "reg" cells. Something like this for instance:

bus@deadbeef {
	reg = <0x10000000 0x100>, //UART 0
		<0x10000100 0x100> //UART 1
	uart@100 {
		compatible = "acme,uart";
		reg = <&bus 0>;
	};
};
Quoted 1 line

You get the idea ;)

Quoted 7 lines

/me shivers :-)

The problem you've raised comes down in my opinion to the fact that a tree simply can't represent a topology that isn't tree-like. The device tree more or less lays down nodes from the point of view of control buses. As soon as your device sits on multiple buses the device tree can't represent it accurately.

Quoted 4 lines

I partially agree with that statement, the accurately part is what I disagree with, you can represent it with some accuracy, just not necessarily using standard properties, you may have to cook your own, meaning the standard somehow failed to cover that part.

Of course, I meant using standard properties, or rather the DT core node model. We now have bindings (named OF graph) that can represent a graph of connected nodes using phandles.

Quoted 13 lines

The other part, is that with a tree, you may have some repetition and multiple references, which is far from ideal.

Quoted 9 lines

So far this hasn't really been an issue (probably thank to the occasional hack), but with devices becoming more and more complex I wouldn't be surprised if we had to really tackle this problem in the not too distant future. A nasty example that comes to my mind is an SoC with two clusters of CPU of different architectures (namely ARM and SH) where some peripheral are accessible to both the ARM and SH side, but mapped at different addresses. So far we've only described the ARM view of the system, but wouldn't it be lovely to have a single DT that can cover both ? :-)

Quoted 3 lines

An argument could be made that your cluster is most likely not running the same instance of the operating system (although there has been research on that done before, not sure where that stands in real life?)

In all practical use cases, yes, they would be running separate OS instances (of either the same or different OSes).

Quoted 4 lines

so while having a single blob would be nice, you most likely, for all practical reasons, would duplicate what is necessary (which should be reasonably easy with scripting/separate sources and include files) and provide separate blobs to each OS instance?

Sure, I'm not blocked here, it was more of a theoretical example, not something for which I'm in need of a solution.

Another possibly more useful class of examples is related to multi-master buses. For instance, the existing DT bindings can't represent an I2C bus that has two masters inside the SoC, as I2C slaves have to be children of the I2C bus master. Similarly we don't really have a good way to represent multi- master I2S buses.

Signature · 3 lines
Regards,

Laurent Pinchart