Intel 82801dx: compile early_smbus as separate object
Add early_smbus.c for romstage-y list and remove respective include on mainboard romstage.c files. Tested on AOpen board. Change-Id: I1c7e6cb32e3a9d7cc9b6037dc27e59149d492001 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/909 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
committed by
Stefan Reinauer
parent
0a19ddc36d
commit
1d89f14355
@@ -31,3 +31,5 @@ ramstage-y += reset.c
|
||||
ramstage-$(CONFIG_HAVE_SMI_HANDLER) += smi.c
|
||||
|
||||
smm-$(CONFIG_HAVE_SMI_HANDLER) += smihandler.c
|
||||
|
||||
romstage-y += early_smbus.c
|
||||
|
@@ -18,26 +18,14 @@
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <arch/io.h>
|
||||
#include <arch/romcc_io.h>
|
||||
#include <device/pci_def.h>
|
||||
#include <console/console.h>
|
||||
|
||||
#include "i82801dx.h"
|
||||
|
||||
#define SMBHSTSTAT 0x0
|
||||
#define SMBHSTCTL 0x2
|
||||
#define SMBHSTCMD 0x3
|
||||
#define SMBXMITADD 0x4
|
||||
#define SMBHSTDAT0 0x5
|
||||
#define SMBHSTDAT1 0x6
|
||||
#define SMBBLKDAT 0x7
|
||||
#define SMBTRNSADD 0x9
|
||||
#define SMBSLVDATA 0xa
|
||||
#define SMLINK_PIN_CTL 0xe
|
||||
#define SMBUS_PIN_CTL 0xf
|
||||
|
||||
/* Between 1-10 seconds, We should never timeout normally
|
||||
* Longer than this is just painful when a timeout condition occurs.
|
||||
*/
|
||||
//#define SMBUS_TIMEOUT (100*1000*10)
|
||||
|
||||
static void enable_smbus(void)
|
||||
void enable_smbus(void)
|
||||
{
|
||||
device_t dev = PCI_DEV(0x0, 0x1f, 0x3);
|
||||
|
||||
@@ -112,7 +100,7 @@ static int smbus_wait_until_done(void)
|
||||
return loops ? 0 : -3;
|
||||
}
|
||||
|
||||
static int smbus_read_byte(unsigned device, unsigned address)
|
||||
int smbus_read_byte(unsigned device, unsigned address)
|
||||
{
|
||||
unsigned char global_status_register;
|
||||
unsigned char byte;
|
||||
|
@@ -31,9 +31,14 @@
|
||||
#ifndef I82801DX_H
|
||||
#define I82801DX_H
|
||||
|
||||
#if !defined(__ASSEMBLER__) && !defined(__ROMCC__)
|
||||
#if !defined(__PRE_RAM__)
|
||||
#include "chip.h"
|
||||
extern void i82801dx_enable(device_t dev);
|
||||
#else
|
||||
void enable_smbus(void);
|
||||
int smbus_read_byte(unsigned device, unsigned address);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user