Friday, June 28, 2024

device-tree aliases

From https://elinux.org/Device_Tree_Mysteries#Label_vs_aliases_node_property

  • The "/aliases" node contains properties that are aliases
  • The name of each property is the name of the alias
  • The value of the property is the full path to a node in the device tree
  • The aliases are not used directly in the device tree source, but are instead dereferenced by the Linux kernel
aliases {
<property name> = <property value>
:
};


As described in https://elinux.org/Device_Tree_Linux#Linux_vs_ePAPR_Version_1.1

property name is the combination of stem and the numeric id


property name=<stem><numeric id>


e.g.

aliases {
gpio0 = &gpio1;
gpio1 = &gpio2;
i2c0 = &i2c1;
i2c1 = &i2c2;
};


soc@0 {
compatible = "fsl,imx8mp-soc", "simple-bus";
aips1: bus@30000000 {
compatible = "fsl,aips-bus", "simple-bus";
gpio1: gpio@30200000 {
compatible = "fsl,imx8mp-gpio", "fsl,imx35-gpio";
};
gpio2: gpio@30210000 {
compatible = "fsl,imx8mp-gpio", "fsl,imx35-gpio";
};
};
aips3: bus@30800000 {
compatible = "fsl,aips-bus", "simple-bus";
i2c1: i2c@30a20000 {
compatible = "fsl,imx8mp-i2c", "fsl,imx21-i2c";
};
i2c2: i2c@30a30000 {
compatible = "fsl,imx8mp-i2c", "fsl,imx21-i2c";
};
};
};

No comments: