- Bump the LinuxBIOS major version
[coreboot.git] / src / southbridge / amd / amd8111 / amd8111_early_smbus.c
1 #include "amd8111_smbus.h"
2
3 #define SMBUS_IO_BASE 0x0f00
4
5 static void enable_smbus(void)
6 {
7         device_t dev;
8         dev = pci_locate_device(PCI_ID(0x1022, 0x746b), 0);
9         if (dev == PCI_DEV_INVALID) {
10                 die("SMBUS controller not found\r\n");
11         }
12         uint8_t enable;
13         print_spew("SMBus controller enabled\r\n");
14         pci_write_config32(dev, 0x58, SMBUS_IO_BASE | 1);
15         enable = pci_read_config8(dev, 0x41);
16         pci_write_config8(dev, 0x41, enable | (1 << 7));
17         /* clear any lingering errors, so the transaction will run */
18         outw(inw(SMBUS_IO_BASE + SMBGSTATUS), SMBUS_IO_BASE + SMBGSTATUS);
19 }
20
21 static int smbus_recv_byte(unsigned device)
22 {
23         return do_smbus_recv_byte(SMBUS_IO_BASE, device);
24 }
25
26 static int smbus_send_byte(unsigned device, unsigned char val)
27 {
28         return do_smbus_send_byte(SMBUS_IO_BASE, device, val);
29 }
30
31 static int smbus_read_byte(unsigned device, unsigned address)
32 {
33         return do_smbus_read_byte(SMBUS_IO_BASE, device, address);
34 }
35
36 static int smbus_write_byte(unsigned device, unsigned address, unsigned char val)
37 {
38         return do_smbus_write_byte(SMBUS_IO_BASE, device, address, val);
39 }