Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/42345 )
Change subject: [WIP] sb/amd: Change to common early SMBus prototypes ......................................................................
[WIP] sb/amd: Change to common early SMBus prototypes
Change-Id: I923984bb6c6073a7e0d88183e2cabb2d6e4caba8 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/mainboard/asus/f2a85-m/romstage.c M src/southbridge/amd/agesa/hudson/sm.c M src/southbridge/amd/agesa/hudson/smbus.c M src/southbridge/amd/agesa/hudson/smbus.h M src/southbridge/amd/cimx/sb800/smbus.c M src/southbridge/amd/cimx/sb800/smbus.h M src/southbridge/amd/pi/hudson/sm.c M src/southbridge/amd/pi/hudson/smbus.c M src/southbridge/amd/pi/hudson/smbus.h 9 files changed, 19 insertions(+), 30 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/42345/1
diff --git a/src/mainboard/asus/f2a85-m/romstage.c b/src/mainboard/asus/f2a85-m/romstage.c index d4b11fc..f40f00c 100644 --- a/src/mainboard/asus/f2a85-m/romstage.c +++ b/src/mainboard/asus/f2a85-m/romstage.c @@ -3,7 +3,7 @@ #include <amdblocks/acpimmio.h> #include <arch/io.h> #include <northbridge/amd/agesa/state_machine.h> -#include <southbridge/amd/agesa/hudson/smbus.h> +#include <device/smbus_host.h> #include <stdint.h>
void board_BeforeAgesa(struct sysinfo *cb) diff --git a/src/southbridge/amd/agesa/hudson/sm.c b/src/southbridge/amd/agesa/hudson/sm.c index a6b1464..eed68e3 100644 --- a/src/southbridge/amd/agesa/hudson/sm.c +++ b/src/southbridge/amd/agesa/hudson/sm.c @@ -4,6 +4,7 @@ #include <device/pci.h> #include <device/pci_ids.h> #include <device/smbus.h> +#include <device/smbus_host.h> #include <arch/ioapic.h>
#include "hudson.h" diff --git a/src/southbridge/amd/agesa/hudson/smbus.c b/src/southbridge/amd/agesa/hudson/smbus.c index c418492..4b878ff 100644 --- a/src/southbridge/amd/agesa/hudson/smbus.c +++ b/src/southbridge/amd/agesa/hudson/smbus.c @@ -4,6 +4,7 @@ #define _HUDSON_SMBUS_C_
#include <arch/io.h> +#include <device/smbus_host.h> #include <stdint.h> #include "smbus.h"
@@ -43,7 +44,7 @@ return -3; /* timeout */ }
-int do_smbus_recv_byte(u32 smbus_io_base, u32 device) +int do_smbus_recv_byte(uintptr_t smbus_io_base, u8 device) { u8 byte;
@@ -70,7 +71,7 @@ return byte; }
-int do_smbus_send_byte(u32 smbus_io_base, u32 device, u8 val) +int do_smbus_send_byte(uintptr_t smbus_io_base, u8 device, u8 val) { u8 byte;
@@ -97,8 +98,7 @@ return 0; }
-int do_smbus_read_byte(u32 smbus_io_base, u32 device, - u32 address) +int do_smbus_read_byte(uintptr_t smbus_io_base, u8 device, u8 address) { u8 byte;
@@ -128,8 +128,7 @@ return byte; }
-int do_smbus_write_byte(u32 smbus_io_base, u32 device, - u32 address, u8 val) +int do_smbus_write_byte(uintptr_t smbus_io_base, u8 device, u8 address, u8 val) { u8 byte;
diff --git a/src/southbridge/amd/agesa/hudson/smbus.h b/src/southbridge/amd/agesa/hudson/smbus.h index 5850f2b..2ce0b46 100644 --- a/src/southbridge/amd/agesa/hudson/smbus.h +++ b/src/southbridge/amd/agesa/hudson/smbus.h @@ -47,10 +47,6 @@ #define rcindxp_reg(reg, port, mask, val) \ alink_rc_indx((RC_INDXP), (reg), (port), (mask), (val))
-int do_smbus_read_byte(u32 smbus_io_base, u32 device, u32 address); -int do_smbus_write_byte(u32 smbus_io_base, u32 device, u32 address, u8 val); -int do_smbus_recv_byte(u32 smbus_io_base, u32 device); -int do_smbus_send_byte(u32 smbus_io_base, u32 device, u8 val); void alink_rc_indx(u32 reg_space, u32 reg_addr, u32 port, u32 mask, u32 val); void alink_ab_indx(u32 reg_space, u32 reg_addr, u32 mask, u32 val); void alink_ax_indx(u32 space /*c or p? */ , u32 axindc, u32 mask, u32 val); diff --git a/src/southbridge/amd/cimx/sb800/smbus.c b/src/southbridge/amd/cimx/sb800/smbus.c index 86bde26..c51029b 100644 --- a/src/southbridge/amd/cimx/sb800/smbus.c +++ b/src/southbridge/amd/cimx/sb800/smbus.c @@ -2,8 +2,9 @@
#include <arch/io.h> +#include <console/console.h> +#include <device/smbus_host.h> #include "smbus.h" -#include <console/console.h> /* printk */
static int smbus_wait_until_ready(u32 smbus_io_base) { @@ -45,7 +46,7 @@ return -3; /* timeout */ }
-int do_smbus_recv_byte(u32 smbus_io_base, u32 device) +int do_smbus_recv_byte(uintptr_t smbus_io_base, u8 device) { u8 byte;
@@ -75,7 +76,7 @@ return byte; }
-int do_smbus_send_byte(u32 smbus_io_base, u32 device, u8 val) +int do_smbus_send_byte(uintptr_t smbus_io_base, u8 device, u8 val) { u8 byte;
@@ -105,7 +106,7 @@ return 0; }
-int do_smbus_read_byte(u32 smbus_io_base, u32 device, u32 address) +int do_smbus_read_byte(uintptr_t smbus_io_base, u8 device, u8 address) { u8 byte;
@@ -138,7 +139,7 @@ return byte; }
-int do_smbus_write_byte(u32 smbus_io_base, u32 device, u32 address, u8 val) +int do_smbus_write_byte(uintptr_t smbus_io_base, u8 device, u8 address, u8 val) { u8 byte;
diff --git a/src/southbridge/amd/cimx/sb800/smbus.h b/src/southbridge/amd/cimx/sb800/smbus.h index 0a1b279..58dfeb3 100644 --- a/src/southbridge/amd/cimx/sb800/smbus.h +++ b/src/southbridge/amd/cimx/sb800/smbus.h @@ -49,10 +49,6 @@ #define rcindxp_reg(reg, port, mask, val) \ alink_rc_indx((RC_INDXP), (reg), (port), (mask), (val))
-int do_smbus_read_byte(u32 smbus_io_base, u32 device, u32 address); -int do_smbus_write_byte(u32 smbus_io_base, u32 device, u32 address, u8 val); -int do_smbus_recv_byte(u32 smbus_io_base, u32 device); -int do_smbus_send_byte(u32 smbus_io_base, u32 device, u8 val); void alink_rc_indx(u32 reg_space, u32 reg_addr, u32 port, u32 mask, u32 val); void alink_ab_indx(u32 reg_space, u32 reg_addr, u32 mask, u32 val); void alink_ax_indx(u32 space /*c or p? */ , u32 axindc, u32 mask, u32 val); diff --git a/src/southbridge/amd/pi/hudson/sm.c b/src/southbridge/amd/pi/hudson/sm.c index 6f9e03c..31a1c67 100644 --- a/src/southbridge/amd/pi/hudson/sm.c +++ b/src/southbridge/amd/pi/hudson/sm.c @@ -4,6 +4,7 @@ #include <device/pci.h> #include <device/pci_ids.h> #include <device/smbus.h> +#include <device/smbus_host.h> #include <arch/ioapic.h>
#include "hudson.h" diff --git a/src/southbridge/amd/pi/hudson/smbus.c b/src/southbridge/amd/pi/hudson/smbus.c index c418492..4b878ff 100644 --- a/src/southbridge/amd/pi/hudson/smbus.c +++ b/src/southbridge/amd/pi/hudson/smbus.c @@ -4,6 +4,7 @@ #define _HUDSON_SMBUS_C_
#include <arch/io.h> +#include <device/smbus_host.h> #include <stdint.h> #include "smbus.h"
@@ -43,7 +44,7 @@ return -3; /* timeout */ }
-int do_smbus_recv_byte(u32 smbus_io_base, u32 device) +int do_smbus_recv_byte(uintptr_t smbus_io_base, u8 device) { u8 byte;
@@ -70,7 +71,7 @@ return byte; }
-int do_smbus_send_byte(u32 smbus_io_base, u32 device, u8 val) +int do_smbus_send_byte(uintptr_t smbus_io_base, u8 device, u8 val) { u8 byte;
@@ -97,8 +98,7 @@ return 0; }
-int do_smbus_read_byte(u32 smbus_io_base, u32 device, - u32 address) +int do_smbus_read_byte(uintptr_t smbus_io_base, u8 device, u8 address) { u8 byte;
@@ -128,8 +128,7 @@ return byte; }
-int do_smbus_write_byte(u32 smbus_io_base, u32 device, - u32 address, u8 val) +int do_smbus_write_byte(uintptr_t smbus_io_base, u8 device, u8 address, u8 val) { u8 byte;
diff --git a/src/southbridge/amd/pi/hudson/smbus.h b/src/southbridge/amd/pi/hudson/smbus.h index a367caa..432c8a5 100644 --- a/src/southbridge/amd/pi/hudson/smbus.h +++ b/src/southbridge/amd/pi/hudson/smbus.h @@ -47,10 +47,6 @@ #define rcindxp_reg(reg, port, mask, val) \ alink_rc_indx((RC_INDXP), (reg), (port), (mask), (val))
-int do_smbus_read_byte(u32 smbus_io_base, u32 device, u32 address); -int do_smbus_write_byte(u32 smbus_io_base, u32 device, u32 address, u8 val); -int do_smbus_recv_byte(u32 smbus_io_base, u32 device); -int do_smbus_send_byte(u32 smbus_io_base, u32 device, u8 val); void alink_rc_indx(u32 reg_space, u32 reg_addr, u32 port, u32 mask, u32 val); void alink_ab_indx(u32 reg_space, u32 reg_addr, u32 mask, u32 val); void alink_ax_indx(u32 space /*c or p? */ , u32 axindc, u32 mask, u32 val);