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@10, or hexadecimal cpu@a? I can't find any explicit specification:
As of current usage:
It could be a good idea to have this standardized, like all other unit addresses.
DTSpec says:
The binding for a particular bus may specify additional, more specific requirements for the format of reg and the unit-address.
Since /cpus and /cpus/cpu@* are generically defined in DTSpec and specialized for various architectures, I believe this is the right place to start standardizing this. Even if arch-specific definitions are required, at least DTSpec can give a recommendation on whether to use decimal or hexadecimal.
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.Should this be a decimal
cpu@10, or hexadecimalcpu@a? I can't find any explicit specification:/cpusin IEEE 1275^cpu@[0-9a-f]+$, seemingly intending to use hexadecimal, but not forbidding decimal. https://github.com/devicetree-org/dt-schema/blob/v2025.12/dtschema/schemas/cpus.yaml#L52-L54/cpusschemas in Linux (Documentation/devicetree/bindings/{arm,mips,riscv,loongarch}/cpus.yaml), none mention the node unit address. https://github.com/torvalds/linux/blob/v7.0-rc1/Documentation/devicetree/bindings/arm/cpus.yamlAs of current usage:
arch/riscv/boot/dts/sophgo/{sg2042,sg2044}-cpus.dtsihttps://github.com/torvalds/linux/blob/v7.0-rc1/arch/riscv/boot/dts/sophgo/sg2042-cpus.dtsDocumentation/devicetree/bindings/opp/opp-v2.yamlhttps://github.com/torvalds/linux/blob/v7.0-rc1/Documentation/devicetree/bindings/opp/opp-v2.yaml#L194-L215It could be a good idea to have this standardized, like all other unit addresses.
DTSpec says:
Since
/cpusand/cpus/cpu@*are generically defined in DTSpec and specialized for various architectures, I believe this is the right place to start standardizing this. Even if arch-specific definitions are required, at least DTSpec can give a recommendation on whether to use decimal or hexadecimal.