mbox series

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

Message ID 1556806436-26283-1-git-send-email-olekstysh@gmail.com (mailing list archive)
Headers show
Series Add ability to handle nodes with interrupts-extended property | expand

Message

Oleksandr Tyshchenko May 2, 2019, 2:13 p.m. UTC
From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

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(-)

Comments

Oleksandr Tyshchenko May 10, 2019, 3:29 p.m. UTC | #1
Hello, all


gentle reminder...
Julien Grall May 10, 2019, 3:45 p.m. UTC | #2
On 10/05/2019 16:29, Oleksandr wrote:
> 
> Hello, all
> 
> 
> gentle reminder...

This is on my long queue of patches to review. Any help reviewing the on-going 
series will help.

Cheers,
Oleksandr Tyshchenko May 10, 2019, 5:02 p.m. UTC | #3
On 10.05.19 18:45, Julien Grall wrote:

Hi, Julien

>
>
> On 10/05/2019 16:29, Oleksandr wrote:
>>
>> Hello, all
>>
>>
>> gentle reminder...
>
> This is on my long queue of patches to review. Any help reviewing the 
> on-going series will help.

Oh, I see. Fair enough.


>
> Cheers,
>