1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-02 22:43:17 +02:00

i2c_helper: Add support for the Linux I2C subsystem

See https://www.kernel.org/doc/Documentation/i2c/ for details.

This creates common interface for I2C access functions, and adds
implementation for linux I2C functions.

BUG=b:148746232
BRANCH=none
TEST=build success

Signed-off-by: Shiyu Sun <sshiyu@chromium.org>
Change-Id: Ie0487824dfb71970bede17f617dbbb30ddf78c12
Reviewed-on: https://review.coreboot.org/c/flashrom/+/39686
Tested-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
This commit is contained in:
Shiyu Sun
2020-03-19 16:59:52 +11:00
committed by Edward O'Callaghan
parent fe6b98b91c
commit dc2c83bbc7
4 changed files with 239 additions and 0 deletions

View File

@ -418,6 +418,10 @@ override CONFIG_RAYER_SPI = no
endif
endif
ifeq ($(TARGET_OS), Linux)
CONFIG_LINUX_I2C_HELPER = yes
endif
###############################################################################
# General architecture-specific settings.
# Like above for the OS, below we verify user-supplied options depending on the target architecture.
@ -1048,6 +1052,11 @@ LIBS += -lni845x
PROGRAMMER_OBJS += ni845x_spi.o
endif
ifeq ($(CONFIG_LINUX_I2C_HELPER), yes)
LIB_OBJS += i2c_helper_linux.o
FEATURE_CFLAGS += -D'CONFIG_I2C_SUPPORT=1'
endif
ifneq ($(NEED_SERIAL), )
LIB_OBJS += serial.o custom_baud.o
endif