summaryrefslogtreecommitdiff
path: root/src/soc/amd/stoneyridge/sm.c
diff options
context:
space:
mode:
authorRichard Spiegel <richard.spiegel@silverbackltd.com>2017-11-08 14:58:30 -0700
committerAaron Durbin <adurbin@chromium.org>2017-11-10 19:11:12 +0000
commitcd04e31c8beaecb2e4c95ab47934b32b2b5e3b06 (patch)
tree6c429c36fba38a110f5a85bdab3b28ab784d33a1 /src/soc/amd/stoneyridge/sm.c
parent3f6c400310a930d226e85e77f29c51f03578f0f1 (diff)
downloadcoreboot-cd04e31c8beaecb2e4c95ab47934b32b2b5e3b06.tar.xz
soc/amd/stoneyridge: Simplify and fix SMBUS code
Solve issues left from Change-Id Ib88a868e654ad127be70ecc506f6b90b784f8d1b Unify code: smbus.c to have the actual execution code, sm.c and smbus_spd.c call functions within smbus.c. Fix some functions that wrongly use SMBHSTCTRL as the register for the data being transfered. The correct register is SMBHSTDAT0. Include file smbus.h should only be used by sm.c, smbus.c and smbus_spd.c. BUG=b:62200225 Change-Id: Ibd55560c95b6752652a4f255b04198e7a4e77d05 Signed-off-by: Richard Spiegel <richard.spiegel@silverbackltd.com> Reviewed-on: https://review.coreboot.org/21887 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin Roth <martinroth@google.com> Reviewed-by: Marc Jones <marc@marcjonesconsulting.com>
Diffstat (limited to 'src/soc/amd/stoneyridge/sm.c')
-rw-r--r--src/soc/amd/stoneyridge/sm.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/soc/amd/stoneyridge/sm.c b/src/soc/amd/stoneyridge/sm.c
index 0c31a3ed8e..9456cbffcf 100644
--- a/src/soc/amd/stoneyridge/sm.c
+++ b/src/soc/amd/stoneyridge/sm.c
@@ -48,7 +48,7 @@ static void sm_init(device_t dev)
static int lsmbus_recv_byte(device_t dev)
{
- u32 device;
+ u8 device;
struct resource *res;
struct bus *pbus;
@@ -62,7 +62,7 @@ static int lsmbus_recv_byte(device_t dev)
static int lsmbus_send_byte(device_t dev, u8 val)
{
- u32 device;
+ u8 device;
struct resource *res;
struct bus *pbus;
@@ -76,7 +76,7 @@ static int lsmbus_send_byte(device_t dev, u8 val)
static int lsmbus_read_byte(device_t dev, u8 address)
{
- u32 device;
+ u8 device;
struct resource *res;
struct bus *pbus;
@@ -90,7 +90,7 @@ static int lsmbus_read_byte(device_t dev, u8 address)
static int lsmbus_write_byte(device_t dev, u8 address, u8 val)
{
- u32 device;
+ u8 device;
struct resource *res;
struct bus *pbus;
@@ -108,20 +108,12 @@ static struct smbus_bus_operations lops_smbus_bus = {
.write_byte = lsmbus_write_byte,
};
-static void sm_read_resources(device_t dev)
-{
-}
-
-static void sm_set_resources(struct device *dev)
-{
-}
-
static struct pci_operations lops_pci = {
.set_subsystem = pci_dev_set_subsystem,
};
static struct device_operations smbus_ops = {
- .read_resources = sm_read_resources,
- .set_resources = sm_set_resources,
+ .read_resources = DEVICE_NOOP,
+ .set_resources = DEVICE_NOOP,
.enable_resources = pci_dev_enable_resources,
.init = sm_init,
.scan_bus = scan_smbus,