[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [RFC PATCH 0/2] Add ability to handle nodes with interrupts-extended property



From: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>

Hello, all.

The purpose of this small series is to add minimal required support for Xen to 
be able to
handle device-tree nodes with "interrupts-extended" property [1].

The reason:
Xen expects to see "interrupts" property when parsing host device-tree.
But, there are cases when some device nodes contain "interrupts-extended" 
property instead.
    
The good example here is arch timer node for R-Car Gen3/Gen2 family [2], which 
is mandatory device
for Xen usage on ARM. And without ability to handle such nodes, Xen fails to 
operate:
    
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Timer: Unable to retrieve IRQ 0 from the device tree
(XEN) ****************************************

----------

Preliminary tested on R-Car Gen3 based board. Log (with debug enabled) shows 
that Xen recognized arch timer
interrupts represented with "interrupts-extended" property:

timer {
        compatible = "arm,armv8-timer";
        interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(8) | 
IRQ_TYPE_LEVEL_LOW)>,
                              <&gic GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(8) | 
IRQ_TYPE_LEVEL_LOW)>,
                              <&gic GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(8) | 
IRQ_TYPE_LEVEL_LOW)>,
                              <&gic GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(8) | 
IRQ_TYPE_LEVEL_LOW)>;
};

...
(XEN) dt_device_get_raw_irq: dev=/timer, index=0
(XEN)  intspec=1 intsize=3
(XEN) dt_irq_map_raw: 
par=/soc/interrupt-controller@f1010000,intspec=[0x00000001 
0x0000000d...],ointsize=3
(XEN) dt_irq_map_raw: ipar=/soc/interrupt-controller@f1010000, size=3
(XEN)  -> addrsize=0
(XEN)  -> got it !
(XEN) dt_device_get_raw_irq: dev=/timer, index=1
(XEN)  intspec=1 intsize=3
(XEN) dt_irq_map_raw: 
par=/soc/interrupt-controller@f1010000,intspec=[0x00000001 
0x0000000e...],ointsize=3
(XEN) dt_irq_map_raw: ipar=/soc/interrupt-controller@f1010000, size=3
(XEN)  -> addrsize=0
(XEN)  -> got it !
(XEN) dt_device_get_raw_irq: dev=/timer, index=2
(XEN)  intspec=1 intsize=3
(XEN) dt_irq_map_raw: 
par=/soc/interrupt-controller@f1010000,intspec=[0x00000001 
0x0000000b...],ointsize=3
(XEN) dt_irq_map_raw: ipar=/soc/interrupt-controller@f1010000, size=3
(XEN)  -> addrsize=0
(XEN)  -> got it !
(XEN) dt_device_get_raw_irq: dev=/timer, index=3
(XEN)  intspec=1 intsize=3
(XEN) dt_irq_map_raw: 
par=/soc/interrupt-controller@f1010000,intspec=[0x00000001 
0x0000000a...],ointsize=3
(XEN) dt_irq_map_raw: ipar=/soc/interrupt-controller@f1010000, size=3
(XEN)  -> addrsize=0
(XEN)  -> got it !
(XEN) Generic Timer IRQ: phys=30 hyp=26 virt=27 Freq: 8333 KHz
...

----------
The first patch had Julien's R-B some time ago, but I dropped it.  


[1]
https://elixir.bootlin.com/linux/v5.1-rc7/source/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt

[2]
https://elixir.bootlin.com/linux/v5.1-rc7/source/arch/arm64/boot/dts/renesas/r8a7795.dtsi#L3185
https://elixir.bootlin.com/linux/v5.1-rc7/source/arch/arm/boot/dts/r8a7790.dtsi#L1856

Oleksandr Tyshchenko (2):
  xen/device-tree: Add dt_count_phandle_with_args helper
  xen/device-tree: Add ability to handle nodes with interrupts-extended
    prop

 xen/common/device_tree.c      | 39 ++++++++++++++++++++++++++++++++++++---
 xen/include/xen/device_tree.h | 19 +++++++++++++++++++
 2 files changed, 55 insertions(+), 3 deletions(-)

-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.