xref: /titanic_51/usr/src/uts/sun4/sys/platform_module.h (revision fd9e7635fa85e33de5aff912b955d797589f6f87)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef _SYS_PLATFORM_MODULE_H
27 #define	_SYS_PLATFORM_MODULE_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #include <sys/async.h>
32 #include <sys/sunddi.h>
33 #include <sys/memlist_plat.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(prom_memlist_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_get_mem_sid
81 #pragma	weak	plat_get_mem_offset
82 #pragma	weak	plat_get_mem_addr
83 
84 extern int plat_get_mem_sid(char *unum, char *buf, int buflen, int *len);
85 extern int plat_get_mem_offset(uint64_t paddr, uint64_t *offp);
86 extern int plat_get_mem_addr(char *unum, char *sid, uint64_t offset,
87     uint64_t *paddr);
88 
89 #pragma weak	plat_log_fruid_error
90 
91 extern void plat_log_fruid_error(int synd_code, struct async_flt *ecc,
92     char *unum, uint64_t afsr_bit);
93 
94 #pragma	weak	plat_log_fruid_error2
95 
96 struct plat_ecc_ch_async_flt;
97 struct rmc_comm_msg;
98 
99 extern void plat_log_fruid_error2(int msg_type, char *unum,
100     struct async_flt *aflt, struct plat_ecc_ch_async_flt *plat_ecc_ch_flt);
101 
102 #pragma weak plat_ecc_capability_sc_get
103 
104 extern int plat_ecc_capability_sc_get(int type);
105 
106 #pragma weak	plat_blacklist
107 
108 extern int plat_blacklist(int cmd, const char *scheme, nvlist_t *fmri,
109     const char *class);
110 
111 extern caddr_t plat_startup_memlist(caddr_t alloc_base);
112 extern int starcat_dr_name(char *name);
113 
114 #pragma	weak	plat_setprop_enter
115 #pragma	weak	plat_setprop_exit
116 #pragma	weak	plat_shared_i2c_enter
117 #pragma	weak	plat_shared_i2c_exit
118 #pragma weak	plat_fan_blast
119 #pragma weak    plat_rmc_comm_req
120 
121 extern	void plat_setprop_enter(void);
122 extern	void plat_setprop_exit(void);
123 extern	void plat_shared_i2c_enter(dev_info_t *);
124 extern	void plat_shared_i2c_exit(dev_info_t *);
125 extern	void plat_fan_blast(void);
126 extern  void plat_rmc_comm_req(struct rmc_comm_msg *);
127 
128 /*
129  * Used to communicate DR updates to platform lgroup framework
130  */
131 typedef struct {
132 	int		u_board;
133 	uint64_t	u_base;
134 	uint64_t	u_len;
135 } update_membounds_t;
136 
137 #endif /* _KERNEL */
138 
139 #ifdef	__cplusplus
140 }
141 #endif
142 
143 #endif /* _SYS_PLATFORM_MODULE_H */
144