2 * This file is part of the coreboot project.
4 * Copyright (C) 2007 Rudolf Marek <r.marek@assembler.cz>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef SOUTHBRIDGE_VIA_VT8237R_VT8237R_H
21 #define SOUTHBRIDGE_VIA_VT8237R_VT8237R_H
25 /* Static resources for the VT8237R southbridge */
27 #define VT8237R_APIC_ID 0x2
28 #define VT8237R_ACPI_IO_BASE 0x500
29 #define VT8237R_SMBUS_IO_BASE 0x400
30 /* 0x0 disabled, 0x2 reserved, 0xf = IRQ15 */
31 #define VT8237R_ACPI_IRQ 0x9
33 #define VT8237S_SPI_MEM_BASE 0xfed02000ULL
35 #define VT8237S_SPI_MEM_BASE 0xfed02000UL
37 #define VT8237R_HPET_ADDR 0xfed00000ULL
38 #define VT8237R_APIC_BASE 0xfec00000ULL
42 #define IDE_CONF_I 0x41
43 #define IDE_CONF_II 0x42
44 #define IDE_CONF_FIFO 0x43
45 #define IDE_MISC_I 0x44
46 #define IDE_MISC_II 0x45
50 #define VT8237R_PSON 0x82
51 #define VT8237R_POWER_WELL 0x94
52 #define VT8237R_SMBUS_IO_BASE_REG 0xd0
53 #define VT8237R_SMBUS_HOST_CONF 0xd2
55 #define SMBHSTSTAT (VT8237R_SMBUS_IO_BASE + 0x0)
56 #define SMBSLVSTAT (VT8237R_SMBUS_IO_BASE + 0x1)
57 #define SMBHSTCTL (VT8237R_SMBUS_IO_BASE + 0x2)
58 #define SMBHSTCMD (VT8237R_SMBUS_IO_BASE + 0x3)
59 #define SMBXMITADD (VT8237R_SMBUS_IO_BASE + 0x4)
60 #define SMBHSTDAT0 (VT8237R_SMBUS_IO_BASE + 0x5)
62 #define HOST_RESET 0xff
63 /* 1 in the 0 bit of SMBHSTADD states to READ. */
65 #define SMBUS_TIMEOUT (100 * 1000 * 10)
66 #define I2C_TRANS_CMD 0x40
67 #define CLOCK_SLAVE_ADDRESS 0x69
69 #if CONFIG_DEBUG_SMBUS
70 #define PRINT_DEBUG(x) print_debug(x)
71 #define PRINT_DEBUG_HEX16(x) print_debug_hex16(x)
73 #define PRINT_DEBUG(x)
74 #define PRINT_DEBUG_HEX16(x)
77 #define SMBUS_DELAY() inb(0x80)
79 struct vt8237_network_rom {
102 #if defined(__GNUC__)
103 __attribute__ ((packed))
109 u8 smbus_read_byte(u8 dimm, u8 offset);
110 void enable_smbus(void);
111 void smbus_fixup(const struct mem_controller *ctrl);
112 // these are in vt8237_early_smbus.c - do they really belong there?
113 void vt8237_sb_enable_fid_vid(void);
114 void enable_rom_decode(void);
115 void vt8237_early_spi_init(void);
116 int vt8237_early_network_init(struct vt8237_network_rom *rom);
119 #include <device/device.h>
120 void writeback(struct device *dev, u16 where, u8 what);
121 void dump_south(device_t dev);