Search code examples
linux-device-driverqemugpiodevice-tree

"/pl061@9030000:clocks: cell 0 is not a phandle reference" when compiling a dts file


I used "-machine dumpdtb=dtb.dtb" in qemu command to extract dtb file of the arm 'virt' machine. Then I converted the dtb file to dts file using dtc. And I tried to make that dts file backto dtb. But I'm seeing a warning message like this (only showing the first warning).

dtb.dts:284.3-21: Warning (clocks_property): /pl061@9030000:clocks: cell 0 is not a phandle reference

The warning comes from the line in the dts

pl061@9030000 {
    phandle = <0x8003>;
    clock-names = "apb_pclk";
    clocks = <0x8000>;               <==== this line
    interrupts = <0x00 0x07 0x04>;
    gpio-controller;
    #gpio-cells = <0x02>;
    compatible = "arm,pl061\0arm,primecell";
    reg = <0x00 0x9030000 0x00 0x1000>;
};

I've looked at Documentation/devicetree/bindings/gpio/pl061-gpio.yaml but there is no explanation about the property clocks. I guess it's the clock frequency for the gpio but somehow the dtc program thinks it is a phandle. and I couldn't find any use of 'clocks' in the pl061 driver. Can I just safely ignore that error?


Solution

  • This is a phandle to the /apb-pclk node elsewhere in the dtb. The "clocks" property is part of the "arm,primecell" binding, documented here: https://www.kernel.org/doc/Documentation/devicetree/bindings/arm/primecell.txt