7

I am looking at a DTS file which tries to specify different nodes, but interestingly I find a few nodes having different style of nomenclature.

/ {
    model = "TI AM335x BeagleBone Black";
    compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx";
};

&ldo3_reg {
    regulator-min-microvolt = <1800000>;
    regulator-max-microvolt = <1800000>;
    regulator-always-on;
};

&mmc1 {
    vmmc-supply = <&vmmcsd_fixed>;
};

&mmc2 {
    vmmc-supply = <&vmmcsd_fixed>;
    pinctrl-names = "default";
    pinctrl-0 = <&emmc_pins>;
    bus-width = <8>;
    status = "okay";
};

/ {
    hdmi {
        compatible = "ti,tilcdc,slave";
        i2c = <&i2c0>;
        pinctrl-names = "default", "off";
        pinctrl-0 = <&nxp_hdmi_bonelt_pins>;
        pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>;
        status = "okay";
    };
};

What does it convey if a node has & as its prefix? What is the necessity of separating them from root node, while they can be present in the root node itself? Interestingly, the above example also has two root nodes, how is that possible?

  • 1
    While searching for help with my problem I ran across this. I'm no expert (so this isn't an answer, but a comment, but I'll try). The two root nodes are okay, they are simply "merged" together. So, in the example you gave, hdmi, model, and compatible are at the same level in the tree. The & is a shorthand reference to an already existing node, which is probably defined in an include file. These sections are either overriding entries in the original definition or adding new nodes to the entry. – Steve Oct 14 '15 at 15:13
3

From: http://developer.toradex.com/device-tree-customization

Nodes can be referenced using the ampersand (&) character and the label.

Overwriting properties

To overwrite a property, the node needs to be referenced using the ampersand character and the label. Later device tree entries overwrite earlier entries (the sequence order of entries is what matters, hence the include order matters). Typically the higher layers (e.g. carrier board device tree) overwrite the lower layers (e.g. SoC device tree) since the higher layers include the lower layers at the very beginning.

E.g. for USB controllers which are capable to be device or host (dual-role), one can overwrite the default mode explicitly using the dr_mode property:

&usbdev0 {
    dr_mode = "host";
};

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.