From 657585485671a0709b0ddb1fa38de46fe30d0cb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Wed, 1 Jan 2020 17:42:45 +0200 Subject: soc/intel/common: Split some SMBUS support file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is expected that smbuslib.c will be removed, leave the parts we want to keep in smbus_early.c. Change-Id: I21355fe95385d07c9f254fc80c90264a9539bb00 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/38049 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- src/soc/intel/common/block/smbus/smbus_early.c | 16 ---------------- src/soc/intel/common/block/smbus/smbuslib.c | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/soc/intel/common/block/smbus/smbus_early.c b/src/soc/intel/common/block/smbus/smbus_early.c index 76de352e54..9ecd7e086d 100644 --- a/src/soc/intel/common/block/smbus/smbus_early.c +++ b/src/soc/intel/common/block/smbus/smbus_early.c @@ -14,7 +14,6 @@ */ #include -#include #include #include #include @@ -35,21 +34,6 @@ static const struct reg_script smbus_init_script[] = { REG_SCRIPT_END, }; -u16 smbus_read_word(u32 smbus_dev, u8 addr, u8 offset) -{ - return smbus_read16(SMBUS_IO_BASE, addr, offset); -} - -u8 smbus_read_byte(u32 smbus_dev, u8 addr, u8 offset) -{ - return smbus_read8(SMBUS_IO_BASE, addr, offset); -} - -u8 smbus_write_byte(u32 smbus_dev, u8 addr, u8 offset, u8 value) -{ - return smbus_write8(SMBUS_IO_BASE, addr, offset, value); -} - void smbus_common_init(void) { reg_script_run_on_dev(PCH_DEV_SMBUS, smbus_init_script); diff --git a/src/soc/intel/common/block/smbus/smbuslib.c b/src/soc/intel/common/block/smbus/smbuslib.c index 0d3901fa2b..e2a0ed90ef 100644 --- a/src/soc/intel/common/block/smbus/smbuslib.c +++ b/src/soc/intel/common/block/smbus/smbuslib.c @@ -14,6 +14,7 @@ */ #include +#include #include #include #include "smbuslib.h" @@ -176,3 +177,18 @@ int smbus_read16(unsigned int smbus_base, unsigned int device, return data; } + +u16 smbus_read_word(u32 smbus_dev, u8 addr, u8 offset) +{ + return smbus_read16(SMBUS_IO_BASE, addr, offset); +} + +u8 smbus_read_byte(u32 smbus_dev, u8 addr, u8 offset) +{ + return smbus_read8(SMBUS_IO_BASE, addr, offset); +} + +u8 smbus_write_byte(u32 smbus_dev, u8 addr, u8 offset, u8 value) +{ + return smbus_write8(SMBUS_IO_BASE, addr, offset, value); +} -- cgit v1.2.3