1 /* $NetBSD: viapcibreg.h,v 1.1 2006/03/17 12:19:49 jmcneill Exp $ */
4 * Copyright (c) 2005, 2006 Jared D. McNeill <jmcneill@invisible.ca>
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions, and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
25 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 #ifndef _SYS_ARCH_I386_PCI_VIAPCIBREG_H
32 #define _SYS_ARCH_I386_PCI_VIAPCIBREG_H
34 /* PCI configuration registers for SMB base address; chip dependent */
35 #define SMB_BASE1 0x90
36 #define SMB_BASE2 0x80
37 #define SMB_BASE3 0xd0
39 #define SMB_HOST_CONFIG 0xd0 /* Lower word, actually */
40 #define SMB_REVISION (SMB_HOST_CONFIG + 4)
42 /* SMBus register offsets; from Linux and FreeBSD */
43 #define SMBHSTSTS 0x00
44 #define SMBHSTSTS_BUSY 0x01
45 #define SMBHSTSTS_INTR 0x02
46 #define SMBHSTSTS_ERROR 0x04
47 #define SMBHSTSTS_COLLISION 0x08
48 #define SMBHSTSTS_FAILED 0x10
49 #define SMBHSLVSTS 0x01
50 #define SMBHSTCNT 0x02
51 #define SMBHSTCNT_QUICK 0x00
52 #define SMBHSTCNT_KILL 0x02
53 #define SMBHSTCNT_SENDRECV 0x04
54 #define SMBHSTCNT_BYTE 0x08
55 #define SMBHSTCNT_WORD 0x0c
56 #define SMBHSTCNT_BLOCK 0x14
57 #define SMBHSTCNT_START 0x40
58 #define SMBHSTCMD 0x03
59 #define SMBHSTADD 0x04
60 #define SMBHSTDAT0 0x05
61 #define SMBHSTDAT1 0x06
62 #define SMBBLKDAT 0x07
63 #define SMBSLVCNT 0x08
64 #define SMBSHDWCMD 0x09
65 #define SMBSLVEVT 0x0a
66 #define SMBSLVDAT 0x0c
68 #endif /* !_SYS_ARCH_I386_PCI_VIAPCIBREG_H */