Devicetree spec: Specifying /cpus/cpu@* unit address format?
Kyle Bonnici
kylebonnici at hotmail.com
Mon Apr 6 09:08:38 PDT 2026
> On 6 Apr 2026, at 14:48, Rob Herring <robh at kernel.org> wrote:
>
> On Sat, Apr 4, 2026 at 11:43 PM David Gibson
> <david at gibson.dropbear.id.au> wrote:
>>
>> On Fri, Apr 03, 2026 at 06:06:17PM +0800, Vivian Wang wrote:
>>> (Also posted at: https://github.com/devicetree-org/devicetree-specification/issues/86 )
>>>
>>> Hi all,
>>>
>>> Presently, there seems to be some confusion in the community about the
>>> format of unit addresses for "/cpus/cpu@*" nodes for a CPU with ID > 9, e.g.
>>>
>>> cpu@??? {
>>> reg = <10>;
>>> /* reg = <0xa>; */ /* This should be equivalent */
>>> }
>>>
>>>
>>> Should this be a decimal "cpu at 10", or hexadecimal "cpu at a"? I can't find
>>> any explicit specification.
>>
>> It should be hex. That's a general convention for unit addresses.
>> Before flattened trees, OF essentially never used decimal
>> representations of things.
I am also of the understanding that it should be in hex.
This understanding was developed after looking at the devicetree files in
Linux kernel and Zephyr project.
However this is not well defined in the spec. In addition the spec V0.4 has other contradictions
related to the node address. See
https://github.com/devicetree-org/devicetree-specification/issues/86#issuecomment-4193317641
>
> The only decimal usage in FDT were mistakes.
>
> Rather than worrying about what the spec says, please worry about what
> the tools check. Unfortunately, this is still only checked for
> specific bus types and the default is not checked.
>
> Rob
>
More information about the linux-riscv
mailing list