xref: /titanic_50/usr/src/uts/sun4/sys/platform_module.h (revision bf30efa4af94cd71664f6c1be0e6e950b1d7a0f4)
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 struct rmc_comm_msg;
89 
90 extern void plat_log_fruid_error2(int msg_type, char *unum,
91     struct async_flt *aflt, struct plat_ecc_ch_async_flt *plat_ecc_ch_flt);
92 
93 #pragma weak plat_ecc_capability_sc_get
94 
95 extern int plat_ecc_capability_sc_get(int type);
96 
97 #pragma weak	plat_blacklist
98 
99 extern int plat_blacklist(int cmd, const char *scheme, nvlist_t *fmri,
100     const char *class);
101 
102 extern caddr_t starcat_startup_memlist(caddr_t alloc_base);
103 extern int starcat_dr_name(char *name);
104 
105 #pragma	weak	plat_setprop_enter
106 #pragma	weak	plat_setprop_exit
107 #pragma	weak	plat_shared_i2c_enter
108 #pragma	weak	plat_shared_i2c_exit
109 #pragma weak	plat_fan_blast
110 #pragma weak    plat_rmc_comm_req
111 
112 extern	void plat_setprop_enter(void);
113 extern	void plat_setprop_exit(void);
114 extern	void plat_shared_i2c_enter(dev_info_t *);
115 extern	void plat_shared_i2c_exit(dev_info_t *);
116 extern	void plat_fan_blast(void);
117 extern  void plat_rmc_comm_req(struct rmc_comm_msg *);
118 
119 /*
120  * Used to communicate DR updates to platform lgroup framework
121  */
122 typedef struct {
123 	int		u_board;
124 	uint64_t	u_base;
125 	uint64_t	u_len;
126 } update_membounds_t;
127 
128 #endif /* _KERNEL */
129 
130 #ifdef	__cplusplus
131 }
132 #endif
133 
134 #endif /* _SYS_PLATFORM_MODULE_H */
135