diff --git a/dts/arm/nuvoton/npcx/npcx.dtsi b/dts/arm/nuvoton/npcx/npcx.dtsi index 125ebb656334..2265596a1360 100644 --- a/dts/arm/nuvoton/npcx/npcx.dtsi +++ b/dts/arm/nuvoton/npcx/npcx.dtsi @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -549,7 +550,7 @@ compatible = "nuvoton,npcx-i2c-port"; #address-cells = <1>; #size-cells = <0>; - port = <0x00>; + port = ; controller = <&i2c_ctrl0>; status = "disabled"; }; @@ -558,7 +559,7 @@ compatible = "nuvoton,npcx-i2c-port"; #address-cells = <1>; #size-cells = <0>; - port = <0x10>; + port = ; controller = <&i2c_ctrl1>; status = "disabled"; }; @@ -567,7 +568,7 @@ compatible = "nuvoton,npcx-i2c-port"; #address-cells = <1>; #size-cells = <0>; - port = <0x20>; + port = ; controller = <&i2c_ctrl2>; status = "disabled"; }; @@ -576,7 +577,7 @@ compatible = "nuvoton,npcx-i2c-port"; #address-cells = <1>; #size-cells = <0>; - port = <0x30>; + port = ; controller = <&i2c_ctrl3>; status = "disabled"; }; @@ -585,7 +586,7 @@ compatible = "nuvoton,npcx-i2c-port"; #address-cells = <1>; #size-cells = <0>; - port = <0x41>; + port = ; controller = <&i2c_ctrl4>; status = "disabled"; }; @@ -594,7 +595,7 @@ compatible = "nuvoton,npcx-i2c-port"; #address-cells = <1>; #size-cells = <0>; - port = <0x50>; + port = ; controller = <&i2c_ctrl5>; status = "disabled"; }; @@ -603,7 +604,7 @@ compatible = "nuvoton,npcx-i2c-port"; #address-cells = <1>; #size-cells = <0>; - port = <0x51>; + port = ; controller = <&i2c_ctrl5>; status = "disabled"; }; @@ -612,7 +613,7 @@ compatible = "nuvoton,npcx-i2c-port"; #address-cells = <1>; #size-cells = <0>; - port = <0x60>; + port = ; controller = <&i2c_ctrl6>; status = "disabled"; }; @@ -621,7 +622,7 @@ compatible = "nuvoton,npcx-i2c-port"; #address-cells = <1>; #size-cells = <0>; - port = <0x61>; + port = ; controller = <&i2c_ctrl6>; status = "disabled"; }; @@ -630,7 +631,7 @@ compatible = "nuvoton,npcx-i2c-port"; #address-cells = <1>; #size-cells = <0>; - port = <0x70>; + port = ; controller = <&i2c_ctrl7>; status = "disabled"; }; diff --git a/dts/arm/nuvoton/npcx/npcx4.dtsi b/dts/arm/nuvoton/npcx/npcx4.dtsi index 6bc44daae1d2..130e752daa76 100644 --- a/dts/arm/nuvoton/npcx/npcx4.dtsi +++ b/dts/arm/nuvoton/npcx/npcx4.dtsi @@ -449,7 +449,7 @@ compatible = "nuvoton,npcx-i2c-port"; #address-cells = <1>; #size-cells = <0>; - port = <0x40>; + port = ; controller = <&i2c_ctrl4>; status = "disabled"; }; @@ -458,7 +458,7 @@ compatible = "nuvoton,npcx-i2c-port"; #address-cells = <1>; #size-cells = <0>; - port = <0x71>; + port = ; controller = <&i2c_ctrl7>; status = "disabled"; }; diff --git a/dts/bindings/i2c/nuvoton,npcx-i2c-port.yaml b/dts/bindings/i2c/nuvoton,npcx-i2c-port.yaml index 8f5f288705e8..76304f57374b 100644 --- a/dts/bindings/i2c/nuvoton,npcx-i2c-port.yaml +++ b/dts/bindings/i2c/nuvoton,npcx-i2c-port.yaml @@ -11,7 +11,13 @@ properties: port: type: int required: true - description: index of i2c port + description: | + Index of i2c port + This property is used to differentiate between multiple I2C ports controlled by the same + or different I2C controllers. + Bit[7:4] module id (controller). + Bit[3:0] port id. + Use the macro NPCX_I2C_CTRL_PORT(ctrl, port) to set this property. controller: type: phandle diff --git a/include/zephyr/dt-bindings/i2c/npcx-i2c.h b/include/zephyr/dt-bindings/i2c/npcx-i2c.h new file mode 100644 index 000000000000..fc46fbf55fd0 --- /dev/null +++ b/include/zephyr/dt-bindings/i2c/npcx-i2c.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2024 Nuvoton Technology Corporation. + * + * SPDX-License-Identifier: Apache-2.0 + */ +#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_I2C_NPCX_H_ +#define ZEPHYR_INCLUDE_DT_BINDINGS_I2C_NPCX_H_ + + +#define NPCX_I2C_CTRL_PORT(ctrl, port) (((ctrl & 0xf) << 4) | (port & 0xf)) + +#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_I2C_NPCX_H_ */