off-by-1 enumeration of some devices in .dts* files (what does ti,hwmods do?)

(I also posted to the Beaglebone Group; please advise which group is more appropriate)

Hello,

I’m trying to create a .dts file for a design based on the BBB, but using the am3352b-zce60 pinout. I’m confused about how to reference several of the devices in the Device Tree, and what “ti,hwmods” is used for.

I’m using the following files for reference (from linux-stable, and from Dr. Molloy’s “Exploring Beaglebone” book/chp06/deviceTree/DTSource3.8.13):

  • am33xx.dtsi
  • am335x-bone-common.dtsi
  • am335x-boneblack.dts
  1. Why the off-by-1 enumeration between the node name and the ti,hwmods property for some of the devices? Examples:

i2c2: i2c@4819c000 { /* i2c2 node name, but ti,hwmods = “i2c3”
compatible = “ti,omap4-i2c”;
#address-cells = <1>;
#size-cells = <0>;
ti,hwmods = “i2c3”; /* TODO: Fix hwmod */
reg = <0x4819c000 0x1000>;
interrupts = <30>;
status = “disabled”;
};

In Dr. Molloy’s version (3.8.13), this has been resolved for some devices; in linux-stable (am33xx.dtsi), it hasn’t:

uart1: serial@44e09000 { /* uart1 node name matches ti,hwmods */
compatible = “ti,omap3-uart”;
ti,hwmods = “uart1”; <<<<<<<<<<<<<<<<<<<<<<<<
clock-frequency = <48000000>;
reg = <0x44e09000 0x2000>;
interrupts = <72>;
status = “disabled”;
};

In linux-stable, here’s the corresponding entry in am33xx.dtsi:
uart1: serial@48022000 { /* uart1 node name, but ti,hwmods = "uart2 */
compatible = “ti,omap3-uart”;
ti,hwmods = “uart2”; <<<<<<<<<<<<<<<<<<<<<
clock-frequency = <48000000>;
reg = <0x48022000 0x2000>;
interrupts = <73>;
status = “disabled”;
};

  1. This also seems to be the case for the mmcs, where mmc0 isn’t explicitly defined, but &mmc2 maps to the emmc. Example:
  • mmc0 is referenced explicitly in linux-stable (am335x-bone-common.dtsi) for mapping the LEDs, but nowhere else.
  • How is the reference to mmc0 resolved, given that mmc references in am33xx.dtsi start at 1? (mmc1, mmc2, mmc3)

Thanks,

Jim

btw, don't use 3.8.x as the "set" in stone naming.. A few things such
as the gpio where mis-numbered and later corrected in mainline.

That aside.. In kernel land, most devices start with xyz0 where as
"marketing" people call this xyz1, i guess it's hard to sell something
to a customer labeled as xyz0..

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/am33xx.dtsi

Regards,