xref: /titanic_44/usr/src/uts/sun4/sys/platform_module.h (revision 986fd29a0dc13f7608ef7f508f6e700bd7bc2720)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
525cf1a30Sjl139090  * Common Development and Distribution License (the "License").
625cf1a30Sjl139090  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*986fd29aSsetje  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef _SYS_PLATFORM_MODULE_H
277c478bd9Sstevel@tonic-gate #define	_SYS_PLATFORM_MODULE_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #include <sys/async.h>
327c478bd9Sstevel@tonic-gate #include <sys/sunddi.h>
33*986fd29aSsetje #include <sys/memlist_plat.h>
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
367c478bd9Sstevel@tonic-gate extern "C" {
377c478bd9Sstevel@tonic-gate #endif
387c478bd9Sstevel@tonic-gate 
397c478bd9Sstevel@tonic-gate 
407c478bd9Sstevel@tonic-gate #ifdef _KERNEL
417c478bd9Sstevel@tonic-gate 
427c478bd9Sstevel@tonic-gate /*
437c478bd9Sstevel@tonic-gate  * The functions that are expected of the platform modules.
447c478bd9Sstevel@tonic-gate  */
457c478bd9Sstevel@tonic-gate 
467c478bd9Sstevel@tonic-gate #pragma	weak	startup_platform
477c478bd9Sstevel@tonic-gate #pragma	weak	set_platform_tsb_spares
487c478bd9Sstevel@tonic-gate #pragma	weak	set_platform_defaults
497c478bd9Sstevel@tonic-gate #pragma	weak	load_platform_drivers
507c478bd9Sstevel@tonic-gate #pragma	weak	plat_cpu_poweron
517c478bd9Sstevel@tonic-gate #pragma	weak	plat_cpu_poweroff
527c478bd9Sstevel@tonic-gate #pragma	weak	plat_freelist_process
537c478bd9Sstevel@tonic-gate #pragma	weak	plat_lpkmem_is_supported
547c478bd9Sstevel@tonic-gate 
557c478bd9Sstevel@tonic-gate extern void startup_platform(void);
567c478bd9Sstevel@tonic-gate extern int set_platform_tsb_spares(void);
577c478bd9Sstevel@tonic-gate extern void set_platform_defaults(void);
587c478bd9Sstevel@tonic-gate extern void load_platform_drivers(void);
597c478bd9Sstevel@tonic-gate extern void load_platform_modules(void);
607c478bd9Sstevel@tonic-gate extern int plat_cpu_poweron(struct cpu *cp);	/* power on CPU */
617c478bd9Sstevel@tonic-gate extern int plat_cpu_poweroff(struct cpu *cp);	/* power off CPU */
627c478bd9Sstevel@tonic-gate extern void plat_freelist_process(int mnode);
63*986fd29aSsetje extern void plat_build_mem_nodes(prom_memlist_t *, size_t);
647c478bd9Sstevel@tonic-gate extern void plat_slice_add(pfn_t, pfn_t);
657c478bd9Sstevel@tonic-gate extern void plat_slice_del(pfn_t, pfn_t);
667c478bd9Sstevel@tonic-gate extern int plat_lpkmem_is_supported(void);
677c478bd9Sstevel@tonic-gate 
687c478bd9Sstevel@tonic-gate /*
697c478bd9Sstevel@tonic-gate  * Data structures expected of the platform modules.
707c478bd9Sstevel@tonic-gate  */
717c478bd9Sstevel@tonic-gate extern char *platform_module_list[];
727c478bd9Sstevel@tonic-gate 
737c478bd9Sstevel@tonic-gate #pragma	weak	plat_get_cpu_unum
747c478bd9Sstevel@tonic-gate #pragma	weak	plat_get_mem_unum
757c478bd9Sstevel@tonic-gate 
767c478bd9Sstevel@tonic-gate extern int plat_get_cpu_unum(int cpuid, char *buf, int buflen, int *len);
777c478bd9Sstevel@tonic-gate extern int plat_get_mem_unum(int synd_code, uint64_t flt_addr, int flt_bus_id,
787c478bd9Sstevel@tonic-gate     int flt_in_memory, ushort_t flt_status, char *buf, int buflen, int *len);
797c478bd9Sstevel@tonic-gate 
80d00f0155Sayznaga #pragma	weak	plat_get_mem_sid
81d00f0155Sayznaga #pragma	weak	plat_get_mem_offset
82d00f0155Sayznaga #pragma	weak	plat_get_mem_addr
83d00f0155Sayznaga 
84d00f0155Sayznaga extern int plat_get_mem_sid(char *unum, char *buf, int buflen, int *len);
85d00f0155Sayznaga extern int plat_get_mem_offset(uint64_t paddr, uint64_t *offp);
86d00f0155Sayznaga extern int plat_get_mem_addr(char *unum, char *sid, uint64_t offset,
87d00f0155Sayznaga     uint64_t *paddr);
88d00f0155Sayznaga 
897c478bd9Sstevel@tonic-gate #pragma weak	plat_log_fruid_error
907c478bd9Sstevel@tonic-gate 
917c478bd9Sstevel@tonic-gate extern void plat_log_fruid_error(int synd_code, struct async_flt *ecc,
927c478bd9Sstevel@tonic-gate     char *unum, uint64_t afsr_bit);
937c478bd9Sstevel@tonic-gate 
947c478bd9Sstevel@tonic-gate #pragma	weak	plat_log_fruid_error2
957c478bd9Sstevel@tonic-gate 
967c478bd9Sstevel@tonic-gate struct plat_ecc_ch_async_flt;
97d58fda43Sjbeloro struct rmc_comm_msg;
987c478bd9Sstevel@tonic-gate 
997c478bd9Sstevel@tonic-gate extern void plat_log_fruid_error2(int msg_type, char *unum,
1007c478bd9Sstevel@tonic-gate     struct async_flt *aflt, struct plat_ecc_ch_async_flt *plat_ecc_ch_flt);
1017c478bd9Sstevel@tonic-gate 
1027c478bd9Sstevel@tonic-gate #pragma weak plat_ecc_capability_sc_get
1037c478bd9Sstevel@tonic-gate 
1047c478bd9Sstevel@tonic-gate extern int plat_ecc_capability_sc_get(int type);
1057c478bd9Sstevel@tonic-gate 
1067c478bd9Sstevel@tonic-gate #pragma weak	plat_blacklist
1077c478bd9Sstevel@tonic-gate 
1087c478bd9Sstevel@tonic-gate extern int plat_blacklist(int cmd, const char *scheme, nvlist_t *fmri,
1097c478bd9Sstevel@tonic-gate     const char *class);
1107c478bd9Sstevel@tonic-gate 
11125cf1a30Sjl139090 extern caddr_t plat_startup_memlist(caddr_t alloc_base);
1127c478bd9Sstevel@tonic-gate extern int starcat_dr_name(char *name);
1137c478bd9Sstevel@tonic-gate 
1147c478bd9Sstevel@tonic-gate #pragma	weak	plat_setprop_enter
1157c478bd9Sstevel@tonic-gate #pragma	weak	plat_setprop_exit
1167c478bd9Sstevel@tonic-gate #pragma	weak	plat_shared_i2c_enter
1177c478bd9Sstevel@tonic-gate #pragma	weak	plat_shared_i2c_exit
1187c478bd9Sstevel@tonic-gate #pragma weak	plat_fan_blast
119d58fda43Sjbeloro #pragma weak    plat_rmc_comm_req
1207c478bd9Sstevel@tonic-gate 
1217c478bd9Sstevel@tonic-gate extern	void plat_setprop_enter(void);
1227c478bd9Sstevel@tonic-gate extern	void plat_setprop_exit(void);
1237c478bd9Sstevel@tonic-gate extern	void plat_shared_i2c_enter(dev_info_t *);
1247c478bd9Sstevel@tonic-gate extern	void plat_shared_i2c_exit(dev_info_t *);
1257c478bd9Sstevel@tonic-gate extern	void plat_fan_blast(void);
126d58fda43Sjbeloro extern  void plat_rmc_comm_req(struct rmc_comm_msg *);
1277c478bd9Sstevel@tonic-gate 
1287c478bd9Sstevel@tonic-gate /*
1297c478bd9Sstevel@tonic-gate  * Used to communicate DR updates to platform lgroup framework
1307c478bd9Sstevel@tonic-gate  */
1317c478bd9Sstevel@tonic-gate typedef struct {
1327c478bd9Sstevel@tonic-gate 	int		u_board;
1337c478bd9Sstevel@tonic-gate 	uint64_t	u_base;
1347c478bd9Sstevel@tonic-gate 	uint64_t	u_len;
1357c478bd9Sstevel@tonic-gate } update_membounds_t;
1367c478bd9Sstevel@tonic-gate 
1377c478bd9Sstevel@tonic-gate #endif /* _KERNEL */
1387c478bd9Sstevel@tonic-gate 
1397c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1407c478bd9Sstevel@tonic-gate }
1417c478bd9Sstevel@tonic-gate #endif
1427c478bd9Sstevel@tonic-gate 
1437c478bd9Sstevel@tonic-gate #endif /* _SYS_PLATFORM_MODULE_H */
144