1e3d60c9bSAdrian Frost /*
2e3d60c9bSAdrian Frost  * CDDL HEADER START
3e3d60c9bSAdrian Frost  *
4e3d60c9bSAdrian Frost  * The contents of this file are subject to the terms of the
5e3d60c9bSAdrian Frost  * Common Development and Distribution License (the "License").
6e3d60c9bSAdrian Frost  * You may not use this file except in compliance with the License.
7e3d60c9bSAdrian Frost  *
8e3d60c9bSAdrian Frost  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9e3d60c9bSAdrian Frost  * or http://www.opensolaris.org/os/licensing.
10e3d60c9bSAdrian Frost  * See the License for the specific language governing permissions
11e3d60c9bSAdrian Frost  * and limitations under the License.
12e3d60c9bSAdrian Frost  *
13e3d60c9bSAdrian Frost  * When distributing Covered Code, include this CDDL HEADER in each
14e3d60c9bSAdrian Frost  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15e3d60c9bSAdrian Frost  * If applicable, add the following below this CDDL HEADER, with the
16e3d60c9bSAdrian Frost  * fields enclosed by brackets "[]" replaced with your own identifying
17e3d60c9bSAdrian Frost  * information: Portions Copyright [yyyy] [name of copyright owner]
18e3d60c9bSAdrian Frost  *
19e3d60c9bSAdrian Frost  * CDDL HEADER END
20e3d60c9bSAdrian Frost  */
21e3d60c9bSAdrian Frost 
22e3d60c9bSAdrian Frost /*
23*f657cd55SCheng Sean Ye  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24e3d60c9bSAdrian Frost  * Use is subject to license terms.
25e3d60c9bSAdrian Frost  */
26e3d60c9bSAdrian Frost 
27e3d60c9bSAdrian Frost #ifndef _NHM_LOG_H
28e3d60c9bSAdrian Frost #define	_NHM_LOG_H
29e3d60c9bSAdrian Frost 
30e3d60c9bSAdrian Frost #ifdef __cplusplus
31e3d60c9bSAdrian Frost extern "C" {
32e3d60c9bSAdrian Frost #endif
33e3d60c9bSAdrian Frost 
34e3d60c9bSAdrian Frost #include <sys/cpu_module.h>
35e3d60c9bSAdrian Frost 
36e3d60c9bSAdrian Frost typedef struct nhm_dimm {
37e3d60c9bSAdrian Frost 	uint64_t dimm_size;
38e3d60c9bSAdrian Frost 	uint8_t nranks;
39e3d60c9bSAdrian Frost 	uint8_t nbanks;
40e3d60c9bSAdrian Frost 	uint8_t ncolumn;
41e3d60c9bSAdrian Frost 	uint8_t nrow;
42e3d60c9bSAdrian Frost 	uint8_t width;
43e3d60c9bSAdrian Frost 	char manufacturer[64];
44e3d60c9bSAdrian Frost 	char serial_number[64];
45e3d60c9bSAdrian Frost 	char part_number[16];
46e3d60c9bSAdrian Frost 	char revision[2];
47e3d60c9bSAdrian Frost 	char label[64];
48e3d60c9bSAdrian Frost } nhm_dimm_t;
49e3d60c9bSAdrian Frost 
50e3d60c9bSAdrian Frost extern nhm_dimm_t **nhm_dimms;
51e3d60c9bSAdrian Frost extern uint32_t nhm_chipset;
52e3d60c9bSAdrian Frost 
53e3d60c9bSAdrian Frost extern errorq_t *nhm_queue;
54e3d60c9bSAdrian Frost extern kmutex_t nhm_mutex;
55e3d60c9bSAdrian Frost 
56e3d60c9bSAdrian Frost extern void nhm_drain(void *, const void *, const errorq_elem_t *);
57e3d60c9bSAdrian Frost 
58e3d60c9bSAdrian Frost extern int nhm_init(void);
59e3d60c9bSAdrian Frost extern int nhm_dev_init(void);
60e3d60c9bSAdrian Frost extern void nhm_dev_reinit(void);
61e3d60c9bSAdrian Frost extern void nhm_unload(void);
62e3d60c9bSAdrian Frost extern void nhm_dev_unload(void);
63e3d60c9bSAdrian Frost 
64e3d60c9bSAdrian Frost extern int inhm_mc_register(cmi_hdl_t, void *, void *, void *);
65e3d60c9bSAdrian Frost extern void nhm_scrubber_enable(void);
66e3d60c9bSAdrian Frost extern void nhm_error_trap(cmi_hdl_t, boolean_t, boolean_t);
67e3d60c9bSAdrian Frost 
68e3d60c9bSAdrian Frost extern void nhm_pci_cfg_setup(dev_info_t *);
69e3d60c9bSAdrian Frost extern void nhm_pci_cfg_free(void);
70e3d60c9bSAdrian Frost 
71e3d60c9bSAdrian Frost extern uint8_t nhm_pci_getb(int, int, int, int, int *);
72e3d60c9bSAdrian Frost extern uint16_t nhm_pci_getw(int, int, int, int, int *);
73e3d60c9bSAdrian Frost extern uint32_t nhm_pci_getl(int, int, int, int, int *);
74e3d60c9bSAdrian Frost extern void nhm_pci_putb(int, int, int, int, uint8_t);
75e3d60c9bSAdrian Frost extern void nhm_pci_putw(int, int, int, int, uint16_t);
76e3d60c9bSAdrian Frost extern void nhm_pci_putl(int, int, int, int, uint32_t);
77e3d60c9bSAdrian Frost 
78e3d60c9bSAdrian Frost extern uint64_t dimm_to_addr(int, int, int, uint64_t, uint64_t *, uint64_t *,
79e3d60c9bSAdrian Frost     uint32_t *, uint32_t *, uint32_t *, uint32_t *, uint32_t *, uint32_t *);
80e3d60c9bSAdrian Frost 
81e3d60c9bSAdrian Frost #ifdef __cplusplus
82e3d60c9bSAdrian Frost }
83e3d60c9bSAdrian Frost #endif
84e3d60c9bSAdrian Frost 
85e3d60c9bSAdrian Frost #endif /* _NHM_LOG_H */