summaryrefslogtreecommitdiff
path: root/usr/src/uts/sun4/sys/platform_module.h
blob: 8f96b014c7df71b228007425e3d5e53962bbba09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License (the "License").
 * You may not use this file except in compliance with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
/*
 * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef _SYS_PLATFORM_MODULE_H
#define	_SYS_PLATFORM_MODULE_H

#pragma ident	"%Z%%M%	%I%	%E% SMI"

#include <sys/async.h>
#include <sys/sunddi.h>

#ifdef	__cplusplus
extern "C" {
#endif


#ifdef _KERNEL

/*
 * The functions that are expected of the platform modules.
 */

#pragma	weak	startup_platform
#pragma	weak	set_platform_tsb_spares
#pragma	weak	set_platform_defaults
#pragma	weak	load_platform_drivers
#pragma	weak	plat_cpu_poweron
#pragma	weak	plat_cpu_poweroff
#pragma	weak	plat_freelist_process
#pragma	weak	plat_lpkmem_is_supported

extern void startup_platform(void);
extern int set_platform_tsb_spares(void);
extern void set_platform_defaults(void);
extern void load_platform_drivers(void);
extern void load_platform_modules(void);
extern int plat_cpu_poweron(struct cpu *cp);	/* power on CPU */
extern int plat_cpu_poweroff(struct cpu *cp);	/* power off CPU */
extern void plat_freelist_process(int mnode);
extern void plat_build_mem_nodes(u_longlong_t *, size_t);
extern void plat_slice_add(pfn_t, pfn_t);
extern void plat_slice_del(pfn_t, pfn_t);
extern int plat_lpkmem_is_supported(void);

/*
 * Data structures expected of the platform modules.
 */
extern char *platform_module_list[];

#pragma	weak	plat_get_cpu_unum
#pragma	weak	plat_get_mem_unum

extern int plat_get_cpu_unum(int cpuid, char *buf, int buflen, int *len);
extern int plat_get_mem_unum(int synd_code, uint64_t flt_addr, int flt_bus_id,
    int flt_in_memory, ushort_t flt_status, char *buf, int buflen, int *len);

#pragma	weak	plat_get_mem_sid
#pragma	weak	plat_get_mem_offset
#pragma	weak	plat_get_mem_addr

extern int plat_get_mem_sid(char *unum, char *buf, int buflen, int *len);
extern int plat_get_mem_offset(uint64_t paddr, uint64_t *offp);
extern int plat_get_mem_addr(char *unum, char *sid, uint64_t offset,
    uint64_t *paddr);

#pragma weak	plat_log_fruid_error

extern void plat_log_fruid_error(int synd_code, struct async_flt *ecc,
    char *unum, uint64_t afsr_bit);

#pragma	weak	plat_log_fruid_error2

struct plat_ecc_ch_async_flt;
struct rmc_comm_msg;

extern void plat_log_fruid_error2(int msg_type, char *unum,
    struct async_flt *aflt, struct plat_ecc_ch_async_flt *plat_ecc_ch_flt);

#pragma weak plat_ecc_capability_sc_get

extern int plat_ecc_capability_sc_get(int type);

#pragma weak	plat_blacklist

extern int plat_blacklist(int cmd, const char *scheme, nvlist_t *fmri,
    const char *class);

extern caddr_t plat_startup_memlist(caddr_t alloc_base);
extern int starcat_dr_name(char *name);

#pragma	weak	plat_setprop_enter
#pragma	weak	plat_setprop_exit
#pragma	weak	plat_shared_i2c_enter
#pragma	weak	plat_shared_i2c_exit
#pragma weak	plat_fan_blast
#pragma weak    plat_rmc_comm_req

extern	void plat_setprop_enter(void);
extern	void plat_setprop_exit(void);
extern	void plat_shared_i2c_enter(dev_info_t *);
extern	void plat_shared_i2c_exit(dev_info_t *);
extern	void plat_fan_blast(void);
extern  void plat_rmc_comm_req(struct rmc_comm_msg *);

/*
 * Used to communicate DR updates to platform lgroup framework
 */
typedef struct {
	int		u_board;
	uint64_t	u_base;
	uint64_t	u_len;
} update_membounds_t;

#endif /* _KERNEL */

#ifdef	__cplusplus
}
#endif

#endif /* _SYS_PLATFORM_MODULE_H */