xref: /titanic_52/usr/src/uts/sun4/sys/platform_module.h (revision bdfc6d18da790deeec2e0eb09c625902defe2498)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _SYS_PLATFORM_MODULE_H
28 #define	_SYS_PLATFORM_MODULE_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/async.h>
33 #include <sys/sunddi.h>
34 
35 #ifdef	__cplusplus
36 extern "C" {
37 #endif
38 
39 
40 #ifdef _KERNEL
41 
42 /*
43  * The functions that are expected of the platform modules.
44  */
45 
46 #pragma	weak	startup_platform
47 #pragma	weak	set_platform_tsb_spares
48 #pragma	weak	set_platform_defaults
49 #pragma	weak	load_platform_drivers
50 #pragma	weak	plat_cpu_poweron
51 #pragma	weak	plat_cpu_poweroff
52 #pragma	weak	plat_freelist_process
53 #pragma	weak	plat_lpkmem_is_supported
54 
55 extern void startup_platform(void);
56 extern int set_platform_tsb_spares(void);
57 extern void set_platform_defaults(void);
58 extern void load_platform_drivers(void);
59 extern void load_platform_modules(void);
60 extern int plat_cpu_poweron(struct cpu *cp);	/* power on CPU */
61 extern int plat_cpu_poweroff(struct cpu *cp);	/* power off CPU */
62 extern void plat_freelist_process(int mnode);
63 extern void plat_build_mem_nodes(u_longlong_t *, size_t);
64 extern void plat_slice_add(pfn_t, pfn_t);
65 extern void plat_slice_del(pfn_t, pfn_t);
66 extern int plat_lpkmem_is_supported(void);
67 
68 /*
69  * Data structures expected of the platform modules.
70  */
71 extern char *platform_module_list[];
72 
73 #pragma	weak	plat_get_cpu_unum
74 #pragma	weak	plat_get_mem_unum
75 
76 extern int plat_get_cpu_unum(int cpuid, char *buf, int buflen, int *len);
77 extern int plat_get_mem_unum(int synd_code, uint64_t flt_addr, int flt_bus_id,
78     int flt_in_memory, ushort_t flt_status, char *buf, int buflen, int *len);
79 
80 #pragma weak	plat_log_fruid_error
81 
82 extern void plat_log_fruid_error(int synd_code, struct async_flt *ecc,
83     char *unum, uint64_t afsr_bit);
84 
85 #pragma	weak	plat_log_fruid_error2
86 
87 struct plat_ecc_ch_async_flt;
88 
89 extern void plat_log_fruid_error2(int msg_type, char *unum,
90     struct async_flt *aflt, struct plat_ecc_ch_async_flt *plat_ecc_ch_flt);
91 
92 #pragma weak plat_ecc_capability_sc_get
93 
94 extern int plat_ecc_capability_sc_get(int type);
95 
96 #pragma weak	plat_blacklist
97 
98 extern int plat_blacklist(int cmd, const char *scheme, nvlist_t *fmri,
99     const char *class);
100 
101 extern caddr_t starcat_startup_memlist(caddr_t alloc_base);
102 extern int starcat_dr_name(char *name);
103 
104 #pragma	weak	plat_setprop_enter
105 #pragma	weak	plat_setprop_exit
106 #pragma	weak	plat_shared_i2c_enter
107 #pragma	weak	plat_shared_i2c_exit
108 #pragma weak	plat_fan_blast
109 
110 extern	void plat_setprop_enter(void);
111 extern	void plat_setprop_exit(void);
112 extern	void plat_shared_i2c_enter(dev_info_t *);
113 extern	void plat_shared_i2c_exit(dev_info_t *);
114 extern	void plat_fan_blast(void);
115 
116 /*
117  * Used to communicate DR updates to platform lgroup framework
118  */
119 typedef struct {
120 	int		u_board;
121 	uint64_t	u_base;
122 	uint64_t	u_len;
123 } update_membounds_t;
124 
125 #endif /* _KERNEL */
126 
127 #ifdef	__cplusplus
128 }
129 #endif
130 
131 #endif /* _SYS_PLATFORM_MODULE_H */
132