dts: arm: mec1501hsz: rename I2C nodes

The I2C controllers on the MEC1501 SoC can be attached to
different I2C output line. For example, the I2C #0 controller
can be used with I2C7 physical lines out of SoC. The output
selection is done by the attribute "port_sel". This renames
the parent I2C nodes on the SoC side to refer to
the controller themselves instead of the output lines to
avoid confusion. The labels of these nodes are also renamed
to reflect the controllers.

On the board level, the DTS labels are overwritten to indicate
the actual output lines.

Aliases are also provided in both SoC and board levels to
provide shortcuts to the DTS nodes.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2019-12-08 14:42:52 -08:00 committed by Anas Nashif
commit 6ecb36cbe0
3 changed files with 48 additions and 20 deletions

View file

@ -21,6 +21,10 @@
aliases { aliases {
pwm-0 = &pwm0; pwm-0 = &pwm0;
i2c0 = &i2c_smb_0;
i2c1 = &i2c_smb_1;
i2c7 = &i2c_smb_2;
}; };
}; };
@ -33,18 +37,21 @@
status = "okay"; status = "okay";
}; };
&i2c0 { &i2c_smb_0 {
status = "okay"; status = "okay";
label = "I2C0";
port_sel = <0>; port_sel = <0>;
}; };
&i2c1 { &i2c_smb_1 {
status = "okay"; status = "okay";
label = "I2C1";
port_sel = <1>; port_sel = <1>;
}; };
&i2c2 { &i2c_smb_2 {
status = "okay"; status = "okay";
label = "I2C7";
port_sel = <7>; port_sel = <7>;
}; };

View file

@ -20,6 +20,10 @@
aliases { aliases {
pwm-0 = &pwm0; pwm-0 = &pwm0;
i2c0 = &i2c_smb_0;
i2c1 = &i2c_smb_1;
i2c7 = &i2c_smb_2;
}; };
}; };
@ -32,18 +36,21 @@
status = "okay"; status = "okay";
}; };
&i2c0 { &i2c_smb_0 {
status = "okay";
port_sel = <1>;
};
&i2c1 {
status = "okay"; status = "okay";
label = "I2C0";
port_sel = <0>; port_sel = <0>;
}; };
&i2c2 { &i2c_smb_1 {
status = "okay"; status = "okay";
label = "I2C1";
port_sel = <1>;
};
&i2c_smb_2 {
status = "okay";
label = "I2C7";
port_sel = <7>; port_sel = <7>;
}; };

View file

@ -29,6 +29,14 @@
reg = <0x00118000 0x8000>; reg = <0x00118000 0x8000>;
}; };
aliases {
i2c-smb-0 = &i2c_smb_0;
i2c-smb-1 = &i2c_smb_1;
i2c-smb-2 = &i2c_smb_2;
i2c-smb-3 = &i2c_smb_3;
i2c-smb-4 = &i2c_smb_4;
};
soc { soc {
rtimer: timer@40007400 { rtimer: timer@40007400 {
compatible = "microchip,xec-rtos-timer"; compatible = "microchip,xec-rtos-timer";
@ -117,51 +125,57 @@
label="GPIO240_276"; label="GPIO240_276";
#gpio-cells=<2>; #gpio-cells=<2>;
}; };
i2c0: i2c@40004000 {
i2c_smb_0: i2c@40004000 {
compatible = "microchip,xec-i2c"; compatible = "microchip,xec-i2c";
reg = <0x40004000 0x80>; reg = <0x40004000 0x80>;
clock-frequency = <I2C_BITRATE_STANDARD>; clock-frequency = <I2C_BITRATE_STANDARD>;
label = "I2C_0"; label = "I2C_SMB_0";
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
status = "disabled"; status = "disabled";
}; };
i2c1: i2c@40004400 {
i2c_smb_1: i2c@40004400 {
compatible = "microchip,xec-i2c"; compatible = "microchip,xec-i2c";
reg = <0x40004400 0x80>; reg = <0x40004400 0x80>;
clock-frequency = <I2C_BITRATE_STANDARD>; clock-frequency = <I2C_BITRATE_STANDARD>;
label = "I2C_1"; label = "I2C_SMB_1";
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
status = "disabled"; status = "disabled";
}; };
i2c2: i2c@40004800 {
i2c_smb_2: i2c@40004800 {
compatible = "microchip,xec-i2c"; compatible = "microchip,xec-i2c";
reg = <0x40004800 0x80>; reg = <0x40004800 0x80>;
clock-frequency = <I2C_BITRATE_STANDARD>; clock-frequency = <I2C_BITRATE_STANDARD>;
label = "I2C_2"; label = "I2C_SMB_2";
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
status = "disabled"; status = "disabled";
}; };
i2c3: i2c@40004c00 {
i2c_smb_3: i2c@40004c00 {
compatible = "microchip,xec-i2c"; compatible = "microchip,xec-i2c";
reg = <0x40004C00 0x80>; reg = <0x40004C00 0x80>;
clock-frequency = <I2C_BITRATE_STANDARD>; clock-frequency = <I2C_BITRATE_STANDARD>;
label = "I2C_3"; label = "I2C_SMB_3";
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
status = "disabled"; status = "disabled";
}; };
i2c4: i2c@40005000 {
i2c_smb_4: i2c@40005000 {
compatible = "microchip,xec-i2c"; compatible = "microchip,xec-i2c";
reg = <0x40005000 0x80>; reg = <0x40005000 0x80>;
clock-frequency = <I2C_BITRATE_STANDARD>; clock-frequency = <I2C_BITRATE_STANDARD>;
label = "I2C_4"; label = "I2C_SMB_4";
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
status = "disabled"; status = "disabled";
}; };
espi0: espi@400f3400 { espi0: espi@400f3400 {
compatible = "microchip,xec-espi"; compatible = "microchip,xec-espi";
reg = <0x400f3400 0x400>; reg = <0x400f3400 0x400>;