-//#include <arch/io.h>
-//#include <device/device.h>
-//#include <device/pci.h>
-//#include <device/pci_ids.h>
-//#include <device/pci_ops.h>
-//#include <device/smbus_def.h>
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2008 Advanced Micro Devices, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
#include "sb600_smbus.h"
static inline void smbus_delay(void)
static int smbus_wait_until_ready(u32 smbus_io_base)
{
- unsigned long loops;
+ u32 loops;
loops = SMBUS_TIMEOUT;
do {
u8 val;
static int smbus_wait_until_done(u32 smbus_io_base)
{
- unsigned long loops;
+ u32 loops;
loops = SMBUS_TIMEOUT;
do {
u8 val;
return 0;
}
-static int do_smbus_read_byte(u32 smbus_io_base, u32 device,
+int do_smbus_read_byte(u32 smbus_io_base, u32 device,
u32 address)
{
u8 byte;
return byte;
}
-static int do_smbus_write_byte(u32 smbus_io_base, u32 device,
+int do_smbus_write_byte(u32 smbus_io_base, u32 device,
u32 address, u8 val)
{
u8 byte;
return 0;
}
-static void alink_ab_indx(unsigned int reg_space, unsigned int reg_addr,
- unsigned int mask, unsigned int val)
+static void alink_ab_indx(u32 reg_space, u32 reg_addr,
+ u32 mask, u32 val)
{
- unsigned int tmp;
+ u32 tmp;
+
outl((reg_space & 0x3) << 30 | reg_addr, AB_INDX);
tmp = inl(AB_DATA);
tmp &= ~mask;
tmp |= val;
- /* printk_debug("about write %x, index=%x", tmp, (reg_space&0x3)<<30 | reg_addr); */
+ /* printk(BIOS_DEBUG, "about write %x, index=%x", tmp, (reg_space&0x3)<<30 | reg_addr); */
outl((reg_space & 0x3) << 30 | reg_addr, AB_INDX); /* probably we dont have to do it again. */
outl(tmp, AB_DATA);
}
/* space = 0: AX_INDXC, AX_DATAC
* space = 1: AX_INDXP, AX_DATAP
*/
-static void alink_ax_indx(unsigned int space /*c or p? */ , unsigned int axindc,
- unsigned int mask, unsigned int val)
+static void alink_ax_indx(u32 space /*c or p? */ , u32 axindc,
+ u32 mask, u32 val)
{
- unsigned int tmp;
+ u32 tmp;
/* read axindc to tmp */
outl(space << 30 | space << 3 | 0x30, AB_INDX);
outl(space << 30 | space << 3 | 0x34, AB_INDX);
outl(tmp, AB_DATA);
}
-
-
-