soc/intel/common: Split some SMBUS support file

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 <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38049
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Kyösti Mälkki 2020-01-01 17:42:45 +02:00
parent 9e83840bdc
commit 6575854856
2 changed files with 16 additions and 16 deletions

View File

@ -14,7 +14,6 @@
*/ */
#include <device/pci_def.h> #include <device/pci_def.h>
#include <device/early_smbus.h>
#include <intelblocks/smbus.h> #include <intelblocks/smbus.h>
#include <reg_script.h> #include <reg_script.h>
#include <soc/pci_devs.h> #include <soc/pci_devs.h>
@ -35,21 +34,6 @@ static const struct reg_script smbus_init_script[] = {
REG_SCRIPT_END, 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) void smbus_common_init(void)
{ {
reg_script_run_on_dev(PCH_DEV_SMBUS, smbus_init_script); reg_script_run_on_dev(PCH_DEV_SMBUS, smbus_init_script);

View File

@ -14,6 +14,7 @@
*/ */
#include <arch/io.h> #include <arch/io.h>
#include <device/early_smbus.h>
#include <device/smbus_def.h> #include <device/smbus_def.h>
#include <timer.h> #include <timer.h>
#include "smbuslib.h" #include "smbuslib.h"
@ -176,3 +177,18 @@ int smbus_read16(unsigned int smbus_base, unsigned int device,
return data; 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);
}