MMP interrupt controller DT layout

Daniel Drake dsd at laptop.org
Tue Jun 11 10:21:40 EDT 2013


Hi,

I am looking at upstreaming these patches:

http://dev.laptop.org/~dsd/20130611/0003-ARM-mmp-Fix-MMP2-interrupt-controller-DT-nodes.patch

http://dev.laptop.org/~dsd/20130611/0004-ARM-mmp-irq-Use-of_get_address-instead-of-of_address.patch

Could one of you summarise the background here, and confirm my
understanding below?

Here is the upstream mmp2 DT which the first patch applies against:

http://lxr.linux.no/linux+v3.9.5/arch/arm/boot/dts/mmp2.dtsi#L34

I can see why this is a strange design. The intc-mux registers clearly
sit inside the intc range, but is this actually forbidden by DT?

The reg values seem to refer to memory address 0x150 and so on (in the
traditional DT sense), which is obviously odd.

As strange as it may be, all of this is documented reasonably well at
http://lxr.linux.no/linux+v3.9.5/Documentation/devicetree/bindings/arm/mrvl/intc.txt

Given the oddness here, I can understand OLPC's desires to "go against
spec" and fix this up in OLPCs DT. But the end result is not entirely
clear to me. The OLPC DT can be viewed here:
http://dev.laptop.org/~dsd/20130611/0002-ARM-dts-Add-xo-1-75-mmp2-and-xo-4-mmp3-dts.patch

To me, the logical design here would be to have intc as a parent
device and treat it almost like a bus, with:

  reg = <0xd4282000 0x1000>;
  #address-cells = <0x1>;
  #size-cells = <0x1>;
  ranges = <0x0 0xd4282000 0x1000>;

Then that would have child devices like:

  interrupt-controller at 1d0 {
    compatible = "mrvl,mmp2-mux-intc";
    reg = <0x1d0 0x4 0x1b8 0x4>;
  };

And the 0x1d0 would be translated to real memory address 0xd42821d0,
thanks to the ranges property.

What we have in the OLPC DT is almost this, but it is missing the
ranges prop. According to booting-without-of.txt this suggests that
the registers of the child device are not accessible to the parent. As
the address cannot be translated, of_address_to_resource() cannot be
used, which leads to the 0004 patch above.

I am really just interested in clarifying my understand of DT address
mapping and the background here. For compatibility reasons, I will try
to go upstream with what we ship in the DT at the moment. Which leads
to one final question...

The 0004 patch says: This patch depends on "ARM: mmp: Fix MMP2
interrupt controller DT nodes".

I can't see why this is true. As far as I can see, of_get_address()
will work OK for both the current upstream mmp2.dtsi, and for the OLPC
intc DT layout which is missing the ranges property. Any hints?

Thanks
Daniel



More information about the Devel mailing list