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
41 #define IDE_CONF_I 0x41
42 #define IDE_CONF_II 0x42
43 #define IDE_CONF_FIFO 0x43
44 #define IDE_MISC_I 0x44
45 #define IDE_MISC_II 0x45
49 #define VT8237R_PSON 0x82
50 #define VT8237R_POWER_WELL 0x94
51 #define VT8237R_SMBUS_IO_BASE_REG 0xd0
52 #define VT8237R_SMBUS_HOST_CONF 0xd2
54 #define SMBHSTSTAT (VT8237R_SMBUS_IO_BASE + 0x0)
55 #define SMBSLVSTAT (VT8237R_SMBUS_IO_BASE + 0x1)
56 #define SMBHSTCTL (VT8237R_SMBUS_IO_BASE + 0x2)
57 #define SMBHSTCMD (VT8237R_SMBUS_IO_BASE + 0x3)
58 #define SMBXMITADD (VT8237R_SMBUS_IO_BASE + 0x4)
59 #define SMBHSTDAT0 (VT8237R_SMBUS_IO_BASE + 0x5)
61 #define HOST_RESET 0xff
62 /* 1 in the 0 bit of SMBHSTADD states to READ. */
64 #define SMBUS_TIMEOUT (100 * 1000 * 10)
65 #define I2C_TRANS_CMD 0x40
66 #define CLOCK_SLAVE_ADDRESS 0x69
68 #if CONFIG_DEBUG_SMBUS
69 #define PRINT_DEBUG(x) print_debug(x)
70 #define PRINT_DEBUG_HEX16(x) print_debug_hex16(x)
72 #define PRINT_DEBUG(x)
73 #define PRINT_DEBUG_HEX16(x)
76 #define SMBUS_DELAY() inb(0x80)
78 struct vt8237_network_rom {
101 #if defined(__GNUC__)
102 __attribute__ ((packed))
108 u8 smbus_read_byte(u8 dimm, u8 offset);
109 void enable_smbus(void);
110 void smbus_fixup(const struct mem_controller *ctrl);
111 // these are in vt8237_early_smbus.c - do they really belong there?
112 void vt8237_sb_enable_fid_vid(void);
113 void enable_rom_decode(void);
114 void vt8237_early_spi_init(void);
115 int vt8237_early_network_init(struct vt8237_network_rom *rom);
118 #include <device/device.h>
119 void writeback(struct device *dev, u16 where, u8 what);
120 void dump_south(device_t dev);