10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 51772Sjl139090 * Common Development and Distribution License (the "License"). 61772Sjl139090 * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate /* 22*5648Ssetje * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 230Sstevel@tonic-gate * Use is subject to license terms. 240Sstevel@tonic-gate */ 250Sstevel@tonic-gate 260Sstevel@tonic-gate #ifndef _SYS_PLATFORM_MODULE_H 270Sstevel@tonic-gate #define _SYS_PLATFORM_MODULE_H 280Sstevel@tonic-gate 290Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 300Sstevel@tonic-gate 310Sstevel@tonic-gate #include <sys/async.h> 320Sstevel@tonic-gate #include <sys/sunddi.h> 33*5648Ssetje #include <sys/memlist_plat.h> 340Sstevel@tonic-gate 350Sstevel@tonic-gate #ifdef __cplusplus 360Sstevel@tonic-gate extern "C" { 370Sstevel@tonic-gate #endif 380Sstevel@tonic-gate 390Sstevel@tonic-gate 400Sstevel@tonic-gate #ifdef _KERNEL 410Sstevel@tonic-gate 420Sstevel@tonic-gate /* 430Sstevel@tonic-gate * The functions that are expected of the platform modules. 440Sstevel@tonic-gate */ 450Sstevel@tonic-gate 460Sstevel@tonic-gate #pragma weak startup_platform 470Sstevel@tonic-gate #pragma weak set_platform_tsb_spares 480Sstevel@tonic-gate #pragma weak set_platform_defaults 490Sstevel@tonic-gate #pragma weak load_platform_drivers 500Sstevel@tonic-gate #pragma weak plat_cpu_poweron 510Sstevel@tonic-gate #pragma weak plat_cpu_poweroff 520Sstevel@tonic-gate #pragma weak plat_freelist_process 530Sstevel@tonic-gate #pragma weak plat_lpkmem_is_supported 540Sstevel@tonic-gate 550Sstevel@tonic-gate extern void startup_platform(void); 560Sstevel@tonic-gate extern int set_platform_tsb_spares(void); 570Sstevel@tonic-gate extern void set_platform_defaults(void); 580Sstevel@tonic-gate extern void load_platform_drivers(void); 590Sstevel@tonic-gate extern void load_platform_modules(void); 600Sstevel@tonic-gate extern int plat_cpu_poweron(struct cpu *cp); /* power on CPU */ 610Sstevel@tonic-gate extern int plat_cpu_poweroff(struct cpu *cp); /* power off CPU */ 620Sstevel@tonic-gate extern void plat_freelist_process(int mnode); 63*5648Ssetje extern void plat_build_mem_nodes(prom_memlist_t *, size_t); 640Sstevel@tonic-gate extern void plat_slice_add(pfn_t, pfn_t); 650Sstevel@tonic-gate extern void plat_slice_del(pfn_t, pfn_t); 660Sstevel@tonic-gate extern int plat_lpkmem_is_supported(void); 670Sstevel@tonic-gate 680Sstevel@tonic-gate /* 690Sstevel@tonic-gate * Data structures expected of the platform modules. 700Sstevel@tonic-gate */ 710Sstevel@tonic-gate extern char *platform_module_list[]; 720Sstevel@tonic-gate 730Sstevel@tonic-gate #pragma weak plat_get_cpu_unum 740Sstevel@tonic-gate #pragma weak plat_get_mem_unum 750Sstevel@tonic-gate 760Sstevel@tonic-gate extern int plat_get_cpu_unum(int cpuid, char *buf, int buflen, int *len); 770Sstevel@tonic-gate extern int plat_get_mem_unum(int synd_code, uint64_t flt_addr, int flt_bus_id, 780Sstevel@tonic-gate int flt_in_memory, ushort_t flt_status, char *buf, int buflen, int *len); 790Sstevel@tonic-gate 801186Sayznaga #pragma weak plat_get_mem_sid 811186Sayznaga #pragma weak plat_get_mem_offset 821186Sayznaga #pragma weak plat_get_mem_addr 831186Sayznaga 841186Sayznaga extern int plat_get_mem_sid(char *unum, char *buf, int buflen, int *len); 851186Sayznaga extern int plat_get_mem_offset(uint64_t paddr, uint64_t *offp); 861186Sayznaga extern int plat_get_mem_addr(char *unum, char *sid, uint64_t offset, 871186Sayznaga uint64_t *paddr); 881186Sayznaga 890Sstevel@tonic-gate #pragma weak plat_log_fruid_error 900Sstevel@tonic-gate 910Sstevel@tonic-gate extern void plat_log_fruid_error(int synd_code, struct async_flt *ecc, 920Sstevel@tonic-gate char *unum, uint64_t afsr_bit); 930Sstevel@tonic-gate 940Sstevel@tonic-gate #pragma weak plat_log_fruid_error2 950Sstevel@tonic-gate 960Sstevel@tonic-gate struct plat_ecc_ch_async_flt; 97920Sjbeloro struct rmc_comm_msg; 980Sstevel@tonic-gate 990Sstevel@tonic-gate extern void plat_log_fruid_error2(int msg_type, char *unum, 1000Sstevel@tonic-gate struct async_flt *aflt, struct plat_ecc_ch_async_flt *plat_ecc_ch_flt); 1010Sstevel@tonic-gate 1020Sstevel@tonic-gate #pragma weak plat_ecc_capability_sc_get 1030Sstevel@tonic-gate 1040Sstevel@tonic-gate extern int plat_ecc_capability_sc_get(int type); 1050Sstevel@tonic-gate 1060Sstevel@tonic-gate #pragma weak plat_blacklist 1070Sstevel@tonic-gate 1080Sstevel@tonic-gate extern int plat_blacklist(int cmd, const char *scheme, nvlist_t *fmri, 1090Sstevel@tonic-gate const char *class); 1100Sstevel@tonic-gate 1111772Sjl139090 extern caddr_t plat_startup_memlist(caddr_t alloc_base); 1120Sstevel@tonic-gate extern int starcat_dr_name(char *name); 1130Sstevel@tonic-gate 1140Sstevel@tonic-gate #pragma weak plat_setprop_enter 1150Sstevel@tonic-gate #pragma weak plat_setprop_exit 1160Sstevel@tonic-gate #pragma weak plat_shared_i2c_enter 1170Sstevel@tonic-gate #pragma weak plat_shared_i2c_exit 1180Sstevel@tonic-gate #pragma weak plat_fan_blast 119920Sjbeloro #pragma weak plat_rmc_comm_req 1200Sstevel@tonic-gate 1210Sstevel@tonic-gate extern void plat_setprop_enter(void); 1220Sstevel@tonic-gate extern void plat_setprop_exit(void); 1230Sstevel@tonic-gate extern void plat_shared_i2c_enter(dev_info_t *); 1240Sstevel@tonic-gate extern void plat_shared_i2c_exit(dev_info_t *); 1250Sstevel@tonic-gate extern void plat_fan_blast(void); 126920Sjbeloro extern void plat_rmc_comm_req(struct rmc_comm_msg *); 1270Sstevel@tonic-gate 1280Sstevel@tonic-gate /* 1290Sstevel@tonic-gate * Used to communicate DR updates to platform lgroup framework 1300Sstevel@tonic-gate */ 1310Sstevel@tonic-gate typedef struct { 1320Sstevel@tonic-gate int u_board; 1330Sstevel@tonic-gate uint64_t u_base; 1340Sstevel@tonic-gate uint64_t u_len; 1350Sstevel@tonic-gate } update_membounds_t; 1360Sstevel@tonic-gate 1370Sstevel@tonic-gate #endif /* _KERNEL */ 1380Sstevel@tonic-gate 1390Sstevel@tonic-gate #ifdef __cplusplus 1400Sstevel@tonic-gate } 1410Sstevel@tonic-gate #endif 1420Sstevel@tonic-gate 1430Sstevel@tonic-gate #endif /* _SYS_PLATFORM_MODULE_H */ 144