All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC] ARM/IRQ-Crossbar: Make Xen aware of devices being statically mapped in the IRQ crossbar.
@ 2015-07-29 20:53 Brandon Perez
  2015-07-30 11:32 ` Ian Campbell
  0 siblings, 1 reply; 3+ messages in thread
From: Brandon Perez @ 2015-07-29 20:53 UTC (permalink / raw)
  To: xen-devel; +Cc: Tim Deegan, Stefano Stabellini, Ian Campbell

In general, Xen needs to own very few interrupts to run. Most of these are timer
PPIs, which do not involve the crossbar. The notable exception to this is the
serial device, which is an SPI. On the DRA7 chips, this involves going through
the interrupt crossbar.

As the device tree entry will contain the crossbar input number, and not the
IRQ line, Xen must be given the SPI input line number. This is achieved with
the "default-mapping" property, which contains the SPI number that the device
will correspond to in the mapping setup by the bootloader.

Signed-off-by: Brandon Perez <bperez-1@ti.com>
---
 xen/common/device_tree.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 31f169b..fc82eb4 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -1036,10 +1036,13 @@ int dt_device_get_raw_irq(const struct dt_device_node *device,
     dt_dprintk("dt_device_get_raw_irq: dev=%s, index=%u\n",
                device->full_name, index);

-    /* Get the interrupts property */
-    intspec = dt_get_property(device, "interrupts", &intlen);
-    if ( intspec == NULL )
-        return -EINVAL;
+    /* Get the appropiate interrupts property */
+    intspec = dt_get_property(device, "default-mapping", &intlen);
+    if (intspec == NULL) {
+        intspec = dt_get_property(device, "interrupts", &intlen);
+        if (intspec == NULL)
+            return -EINVAL;
+    }
     intlen /= sizeof(*intspec);

     dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen);
--
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH RFC] ARM/IRQ-Crossbar: Make Xen aware of devices being statically mapped in the IRQ crossbar.
  2015-07-29 20:53 [PATCH RFC] ARM/IRQ-Crossbar: Make Xen aware of devices being statically mapped in the IRQ crossbar Brandon Perez
@ 2015-07-30 11:32 ` Ian Campbell
  0 siblings, 0 replies; 3+ messages in thread
From: Ian Campbell @ 2015-07-30 11:32 UTC (permalink / raw)
  To: Brandon Perez, xen-devel; +Cc: Tim Deegan, Stefano Stabellini

On Wed, 2015-07-29 at 16:53 -0400, Brandon Perez wrote:
> In general, Xen needs to own very few interrupts to run. Most of these are timer
> PPIs, which do not involve the crossbar. The notable exception to this is the
> serial device, which is an SPI. On the DRA7 chips, this involves going through
> the interrupt crossbar.
> 
> As the device tree entry will contain the crossbar input number, and not the
> IRQ line, Xen must be given the SPI input line number. This is achieved with
> the "default-mapping" property, which contains the SPI number that the device
> will correspond to in the mapping setup by the bootloader.

Is the default-mapping property defined by a generic standard? I don't find
it in ePAPR for example. If it isn't a generic part of device tree then it
shouldn't be handled in device_tree.c, it would need to be handled in a
device specific place which has matched on the compatible string (probably
the one for your cross-bar) to determine the semantics of the properties.

I also don't any such property for any device in the device-tree bindings
docs[0], which we would want to see before committing to using an interface
.

Thanks,
Ian.

[0] in linux.git as Documentation/devicetree/bindings or separately in http
s://git.kernel.org/cgit/linux/kernel/git/devicetree/devicetree
-rebasing.git/

> 
> Signed-off-by: Brandon Perez <bperez-1@ti.com>
> ---
>  xen/common/device_tree.c |   11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 31f169b..fc82eb4 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -1036,10 +1036,13 @@ int dt_device_get_raw_irq(const struct 
> dt_device_node *device,
>      dt_dprintk("dt_device_get_raw_irq: dev=%s, index=%u\n",
>                 device->full_name, index);
> 
> -    /* Get the interrupts property */
> -    intspec = dt_get_property(device, "interrupts", &intlen);
> -    if ( intspec == NULL )
> -        return -EINVAL;
> +    /* Get the appropiate interrupts property */
> +    intspec = dt_get_property(device, "default-mapping", &intlen);
> +    if (intspec == NULL) {
> +        intspec = dt_get_property(device, "interrupts", &intlen);
> +        if (intspec == NULL)
> +            return -EINVAL;
> +    }
>      intlen /= sizeof(*intspec);
> 
>      dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), 
> intlen);
> --
> 1.7.9.5
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH RFC] ARM/IRQ-Crossbar: Make Xen aware of devices being statically mapped in the IRQ crossbar.
@ 2015-07-29 20:32 Brandon Perez
  0 siblings, 0 replies; 3+ messages in thread
From: Brandon Perez @ 2015-07-29 20:32 UTC (permalink / raw)
  To: xen-devel; +Cc: Tim Deegan, Stefano Stabellini, Ian Campbell

In general, Xen needs to own very few interrupts to run. Most of these are timer
PPIs, which do not involve the crossbar. The notable exception to this is the
serial device, which is an SPI. On the DRA7 chips, this involves going through
the interrupt crossbar.

As the device tree entry will contain the crossbar input number, and not the
IRQ line, Xen must be given the SPI input line number. This is achieved with
the "default-mapping" property, which contains the SPI number that the device
will correspond to in the mapping setup by the bootloader.

Signed-off-by: Brandon Perez <bperez-1@ti.com>
---
 xen/common/device_tree.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 31f169b..fc82eb4 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -1036,10 +1036,13 @@ int dt_device_get_raw_irq(const struct dt_device_node *device,
     dt_dprintk("dt_device_get_raw_irq: dev=%s, index=%u\n",
                device->full_name, index);

-    /* Get the interrupts property */
-    intspec = dt_get_property(device, "interrupts", &intlen);
-    if ( intspec == NULL )
-        return -EINVAL;
+    /* Get the appropiate interrupts property */
+    intspec = dt_get_property(device, "default-mapping", &intlen);
+    if (intspec == NULL) {
+        intspec = dt_get_property(device, "interrupts", &intlen);
+        if (intspec == NULL)
+            return -EINVAL;
+    }
     intlen /= sizeof(*intspec);

     dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen);
--
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-30 11:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-29 20:53 [PATCH RFC] ARM/IRQ-Crossbar: Make Xen aware of devices being statically mapped in the IRQ crossbar Brandon Perez
2015-07-30 11:32 ` Ian Campbell
  -- strict thread matches above, loose matches on Subject: below --
2015-07-29 20:32 Brandon Perez

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.