imcsmb_reg.h revision 1.1 1 1.1 pgoyette /* $NetBSD: imcsmb_reg.h,v 1.1 2018/03/01 04:45:06 pgoyette Exp $ */
2 1.1 pgoyette
3 1.1 pgoyette /*-
4 1.1 pgoyette * Copyright (c) 2018 The NetBSD Foundation, Inc.
5 1.1 pgoyette * All rights reserved.
6 1.1 pgoyette *
7 1.1 pgoyette * This code is derived from software contributed to The NetBSD Foundation
8 1.1 pgoyette * by Paul Goyette
9 1.1 pgoyette *
10 1.1 pgoyette * Redistribution and use in source and binary forms, with or without
11 1.1 pgoyette * modification, are permitted provided that the following conditions
12 1.1 pgoyette * are met:
13 1.1 pgoyette * 1. Redistributions of source code must retain the above copyright
14 1.1 pgoyette * notice, this list of conditions and the following disclaimer.
15 1.1 pgoyette * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 pgoyette * notice, this list of conditions and the following disclaimer in the
17 1.1 pgoyette * documentation and/or other materials provided with the distribution.
18 1.1 pgoyette *
19 1.1 pgoyette * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 1.1 pgoyette * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 1.1 pgoyette * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 1.1 pgoyette * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 1.1 pgoyette * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 1.1 pgoyette * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 1.1 pgoyette * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 1.1 pgoyette * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 1.1 pgoyette * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 1.1 pgoyette * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 1.1 pgoyette * POSSIBILITY OF SUCH DAMAGE.
30 1.1 pgoyette */
31 1.1 pgoyette
32 1.1 pgoyette /*-
33 1.1 pgoyette * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
34 1.1 pgoyette *
35 1.1 pgoyette * Authors: Joe Kloss; Ravi Pokala (rpokala (at) freebsd.org)
36 1.1 pgoyette *
37 1.1 pgoyette * Copyright (c) 2017-2018 Panasas
38 1.1 pgoyette * All rights reserved.
39 1.1 pgoyette *
40 1.1 pgoyette * Redistribution and use in source and binary forms, with or without
41 1.1 pgoyette * modification, are permitted provided that the following conditions
42 1.1 pgoyette * are met:
43 1.1 pgoyette * 1. Redistributions of source code must retain the above copyright
44 1.1 pgoyette * notice, this list of conditions and the following disclaimer.
45 1.1 pgoyette * 2. Redistributions in binary form must reproduce the above copyright
46 1.1 pgoyette * notice, this list of conditions and the following disclaimer in the
47 1.1 pgoyette * documentation and/or other materials provided with the distribution.
48 1.1 pgoyette *
49 1.1 pgoyette * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
50 1.1 pgoyette * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
51 1.1 pgoyette * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
52 1.1 pgoyette * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
53 1.1 pgoyette * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
54 1.1 pgoyette * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
55 1.1 pgoyette * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56 1.1 pgoyette * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
57 1.1 pgoyette * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
58 1.1 pgoyette * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
59 1.1 pgoyette * SUCH DAMAGE.
60 1.1 pgoyette */
61 1.1 pgoyette
62 1.1 pgoyette #ifndef _DEV__IMCSMB__IMCSMB_REG_H_
63 1.1 pgoyette #define _DEV__IMCSMB__IMCSMB_REG_H_
64 1.1 pgoyette
65 1.1 pgoyette /* Intel (Sandy,Ivy)bridge and (Has,Broad)well CPUs have integrated memory
66 1.1 pgoyette * controllers (iMCs), each of which having up to two SMBus controllers. They
67 1.1 pgoyette * are programmed via sets of registers in the same PCI device, which are
68 1.1 pgoyette * identical other than the register numbers.
69 1.1 pgoyette *
70 1.1 pgoyette * The full documentation for these registers can be found in volume two of the
71 1.1 pgoyette * datasheets for the CPUs. Refer to the links in imcsmb_pci.c
72 1.1 pgoyette */
73 1.1 pgoyette
74 1.1 pgoyette #define IMCSMB_REG_STATUS0 0x0180
75 1.1 pgoyette #define IMCSMB_REG_STATUS1 0x0190
76 1.1 pgoyette #define IMCSMB_STATUS_BUSY_BIT 0x10000000
77 1.1 pgoyette #define IMCSMB_STATUS_BUS_ERROR_BIT 0x20000000
78 1.1 pgoyette #define IMCSMB_STATUS_WRITE_DATA_DONE 0x40000000
79 1.1 pgoyette #define IMCSMB_STATUS_READ_DATA_VALID 0x80000000
80 1.1 pgoyette
81 1.1 pgoyette #define IMCSMB_REG_COMMAND0 0x0184
82 1.1 pgoyette #define IMCSMB_REG_COMMAND1 0x0194
83 1.1 pgoyette #define IMCSMB_CMD_WORD_ACCESS 0x20000000
84 1.1 pgoyette #define IMCSMB_CMD_WRITE_BIT 0x08000000
85 1.1 pgoyette #define IMCSMB_CMD_TRIGGER_BIT 0x80000000
86 1.1 pgoyette
87 1.1 pgoyette #define IMCSMB_REG_CONTROL0 0x0188
88 1.1 pgoyette #define IMCSMB_REG_CONTROL1 0x0198
89 1.1 pgoyette #define IMCSMB_CNTL_POLL_EN 0x00000100
90 1.1 pgoyette #define IMCSMB_CNTL_CLK_OVERRIDE 0x08000000
91 1.1 pgoyette #define IMCSMB_CNTL_DTI_MASK 0xf0000000
92 1.1 pgoyette #define IMCSMB_CNTL_WRITE_DISABLE_BIT 0x04000000
93 1.1 pgoyette
94 1.1 pgoyette #endif /* _DEV__IMCSMB__IMCSMB_REG_H_ */
95