Skip to content

drivers: i2c: Add I2C driver of it51xxx #88292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions boards/ite/it515xx_evb/it515xx_evb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
compatible = "ite,it515xx-evb";

aliases {
i2c-0 = &i2c0;
led0 = &led0;
watchdog0 = &twd0;
};
Expand All @@ -38,6 +39,14 @@
};
};

&i2c0 {
status = "okay";
clock-frequency = <I2C_BITRATE_STANDARD>;
pinctrl-0 = <&i2c0_clk_gpf2_default
&i2c0_data_gpf3_default>;
pinctrl-names = "default";
};

&uart1 {
status = "okay";
current-speed = <115200>;
Expand Down
1 change: 1 addition & 0 deletions boards/ite/it515xx_evb/it515xx_evb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ram: 128
supported:
- flash
- gpio
- i2c
- pinctrl
- pm
- uart
Expand Down
1 change: 1 addition & 0 deletions drivers/i2c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ zephyr_library_sources_ifdef(CONFIG_I2C_INFINEON_CAT1 i2c_ifx_cat1.c)
zephyr_library_sources_ifdef(CONFIG_I2C_INFINEON_XMC4 i2c_ifx_xmc4.c)
zephyr_library_sources_ifdef(CONFIG_I2C_IPROC i2c_bcm_iproc.c)
zephyr_library_sources_ifdef(CONFIG_I2C_ITE_ENHANCE i2c_ite_enhance.c)
zephyr_library_sources_ifdef(CONFIG_I2C_ITE_IT51XXX i2c_ite_it51xxx.c)
zephyr_library_sources_ifdef(CONFIG_I2C_ITE_IT8XXX2 i2c_ite_it8xxx2.c)
zephyr_library_sources_ifdef(CONFIG_I2C_LITEX i2c_litex.c)
zephyr_library_sources_ifdef(CONFIG_I2C_LITEX_LITEI2C i2c_litex_litei2c.c)
Expand Down
1 change: 1 addition & 0 deletions drivers/i2c/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ source "drivers/i2c/Kconfig.gpio"
source "drivers/i2c/Kconfig.i2c_emul"
source "drivers/i2c/Kconfig.ifx_cat1"
source "drivers/i2c/Kconfig.ifx_xmc4"
source "drivers/i2c/Kconfig.it51xxx"
source "drivers/i2c/Kconfig.it8xxx2"
source "drivers/i2c/Kconfig.litex"
source "drivers/i2c/Kconfig.lpc11u6x"
Expand Down
51 changes: 51 additions & 0 deletions drivers/i2c/Kconfig.it51xxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Copyright (c) 2025 ITE Corporation. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

config I2C_ITE_IT51XXX
bool "ITE IT51XXX I2C driver"
default y
depends on DT_HAS_ITE_IT51XXX_I2C_ENABLED
select PINCTRL
select I2C_BITBANG
help
Enable I2C support on IT51XXX series.
Supports nine hosts and three targets and each one able to located
at I2C interface0~8.
Three I2C targets on design A, B and C. Support 16 bytes dedicated
FIFO mode for read/write.
Supported Speeds: 50kHz, 100kHz, 400kHz and 1MHz.
This driver supports repeated start.

if I2C_ITE_IT51XXX

config I2C_IT51XXX_FIFO_MODE
bool "IT51XXX I2C FIFO mode"
default y
help
This is an option to enable FIFO mode which can reduce the time
between each byte to improve the I2C bus clock stretching during
I2C transaction.
The I2C controller supports two 32-bytes FIFOs,
FIFO1 supports I2C 0, and FIFO2 supports other ports.
I2C FIFO mode of IT51XXX can support I2C APIs including:
i2c_write(), i2c_read(), i2c_burst_read.

endif # I2C_ITE_IT51XXX

if I2C_TARGET

config I2C_TARGET_IT51XXX_MAX_BUF_SIZE
int "It is allowed to configure the dedicated FIFO size up to 256 bytes."
default 256

config I2C_IT51XXX_MAX_SHARE_FIFO_SIZE
int "It is allowed to configure the shared FIFO size up to 256 bytes."
range 16 256
default 256

config SOC_IT51XXX_CPU_IDLE_GATING
default y
help
This option is used when the I2C target shared FIFO property is enabled.

endif # I2C_TARGET
Loading