From 6ecb36cbe026f762a04a251d4fdb31afdd83b619 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Sun, 8 Dec 2019 14:42:52 -0800 Subject: [PATCH] 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 --- .../mec1501modular_assy6885.dts | 13 +++++-- .../mec15xxevb_assy6853.dts | 21 ++++++++---- dts/arm/microchip/mec1501hsz.dtsi | 34 +++++++++++++------ 3 files changed, 48 insertions(+), 20 deletions(-) diff --git a/boards/arm/mec1501modular_assy6885/mec1501modular_assy6885.dts b/boards/arm/mec1501modular_assy6885/mec1501modular_assy6885.dts index 5e5ebbb17c3..32b84c17a21 100644 --- a/boards/arm/mec1501modular_assy6885/mec1501modular_assy6885.dts +++ b/boards/arm/mec1501modular_assy6885/mec1501modular_assy6885.dts @@ -21,6 +21,10 @@ aliases { pwm-0 = &pwm0; + + i2c0 = &i2c_smb_0; + i2c1 = &i2c_smb_1; + i2c7 = &i2c_smb_2; }; }; @@ -33,18 +37,21 @@ status = "okay"; }; -&i2c0 { +&i2c_smb_0 { status = "okay"; + label = "I2C0"; port_sel = <0>; }; -&i2c1 { +&i2c_smb_1 { status = "okay"; + label = "I2C1"; port_sel = <1>; }; -&i2c2 { +&i2c_smb_2 { status = "okay"; + label = "I2C7"; port_sel = <7>; }; diff --git a/boards/arm/mec15xxevb_assy6853/mec15xxevb_assy6853.dts b/boards/arm/mec15xxevb_assy6853/mec15xxevb_assy6853.dts index dec1933cb30..2629de27a83 100644 --- a/boards/arm/mec15xxevb_assy6853/mec15xxevb_assy6853.dts +++ b/boards/arm/mec15xxevb_assy6853/mec15xxevb_assy6853.dts @@ -20,6 +20,10 @@ aliases { pwm-0 = &pwm0; + + i2c0 = &i2c_smb_0; + i2c1 = &i2c_smb_1; + i2c7 = &i2c_smb_2; }; }; @@ -32,18 +36,21 @@ status = "okay"; }; -&i2c0 { - status = "okay"; - port_sel = <1>; -}; - -&i2c1 { +&i2c_smb_0 { status = "okay"; + label = "I2C0"; port_sel = <0>; }; -&i2c2 { +&i2c_smb_1 { status = "okay"; + label = "I2C1"; + port_sel = <1>; +}; + +&i2c_smb_2 { + status = "okay"; + label = "I2C7"; port_sel = <7>; }; diff --git a/dts/arm/microchip/mec1501hsz.dtsi b/dts/arm/microchip/mec1501hsz.dtsi index 9c77bef628e..960b9a16faf 100644 --- a/dts/arm/microchip/mec1501hsz.dtsi +++ b/dts/arm/microchip/mec1501hsz.dtsi @@ -29,6 +29,14 @@ 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 { rtimer: timer@40007400 { compatible = "microchip,xec-rtos-timer"; @@ -117,51 +125,57 @@ label="GPIO240_276"; #gpio-cells=<2>; }; - i2c0: i2c@40004000 { + + i2c_smb_0: i2c@40004000 { compatible = "microchip,xec-i2c"; reg = <0x40004000 0x80>; clock-frequency = ; - label = "I2C_0"; + label = "I2C_SMB_0"; #address-cells = <1>; #size-cells = <0>; status = "disabled"; }; - i2c1: i2c@40004400 { + + i2c_smb_1: i2c@40004400 { compatible = "microchip,xec-i2c"; reg = <0x40004400 0x80>; clock-frequency = ; - label = "I2C_1"; + label = "I2C_SMB_1"; #address-cells = <1>; #size-cells = <0>; status = "disabled"; }; - i2c2: i2c@40004800 { + + i2c_smb_2: i2c@40004800 { compatible = "microchip,xec-i2c"; reg = <0x40004800 0x80>; clock-frequency = ; - label = "I2C_2"; + label = "I2C_SMB_2"; #address-cells = <1>; #size-cells = <0>; status = "disabled"; }; - i2c3: i2c@40004c00 { + + i2c_smb_3: i2c@40004c00 { compatible = "microchip,xec-i2c"; reg = <0x40004C00 0x80>; clock-frequency = ; - label = "I2C_3"; + label = "I2C_SMB_3"; #address-cells = <1>; #size-cells = <0>; status = "disabled"; }; - i2c4: i2c@40005000 { + + i2c_smb_4: i2c@40005000 { compatible = "microchip,xec-i2c"; reg = <0x40005000 0x80>; clock-frequency = ; - label = "I2C_4"; + label = "I2C_SMB_4"; #address-cells = <1>; #size-cells = <0>; status = "disabled"; }; + espi0: espi@400f3400 { compatible = "microchip,xec-espi"; reg = <0x400f3400 0x400>;