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 (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
23 */
24
25 #include <sys/cpuvar.h>
26 #include <sys/systm.h>
27 #include <sys/sysmacros.h>
28 #include <sys/promif.h>
29 #include <sys/platform_module.h>
30 #include <sys/cmn_err.h>
31 #include <sys/errno.h>
32 #include <sys/machsystm.h>
33 #include <sys/bootconf.h>
34 #include <sys/nvpair.h>
35 #include <sys/kobj.h>
36 #include <sys/mem_cage.h>
37 #include <sys/opl.h>
38 #include <sys/scfd/scfostoescf.h>
39 #include <sys/cpu_sgnblk_defs.h>
40 #include <sys/utsname.h>
41 #include <sys/ddi.h>
42 #include <sys/sunndi.h>
204 extern char *tod_module_name;
205 extern void cpu_sgn_update(ushort_t, uchar_t, uchar_t, int);
206 extern void mmu_init_large_pages(size_t);
207
208 /* Set the CPU signature function pointer */
209 cpu_sgn_func = cpu_sgn_update;
210
211 /* Set appropriate tod module for OPL platform */
212 ASSERT(tod_module_name == NULL);
213 tod_module_name = "todopl";
214
215 if ((mmu_page_sizes == max_mmu_page_sizes) &&
216 (mmu_ism_pagesize != DEFAULT_ISM_PAGESIZE)) {
217 if (&mmu_init_large_pages)
218 mmu_init_large_pages(mmu_ism_pagesize);
219 }
220
221 tsb_lgrp_affinity = 1;
222
223 set_max_mmu_ctxdoms();
224
225 /* set OPL threshold for compressed dumps */
226 dump_plat_mincpu_default = DUMP_PLAT_SUN4U_OPL_MINCPU;
227 }
228
229 /*
230 * Convert logical a board number to a physical one.
231 */
232
233 #define LSBPROP "board#"
234 #define PSBPROP "physical-board#"
235
236 int
237 opl_get_physical_board(int id)
238 {
239 dev_info_t *root_dip, *dip = NULL;
240 char *dname = NULL;
241 int circ;
242
243 pnode_t pnode;
244 char pname[MAXSYSNAME] = {0};
245
246 int lsb_id; /* Logical System Board ID */
844 return;
845 }
846 scf_shutdown_callback(SIGSUBST_ENVIRON);
847 break;
848
849 case SIGSUBST_REBOOT:
850 if (scf_shutdown_callback == NULL) {
851 cmn_err(CE_NOTE, "!cpu_sgn_update: "
852 "scf_shutdown_callb not found\n");
853 return;
854 }
855 scf_shutdown_callback(SIGSUBST_REBOOT);
856 break;
857 }
858 }
859 }
860
861 /*ARGSUSED*/
862 int
863 plat_get_mem_unum(int synd_code, uint64_t flt_addr, int flt_bus_id,
864 int flt_in_memory, ushort_t flt_status,
865 char *buf, int buflen, int *lenp)
866 {
867 /*
868 * check if it's a Memory error.
869 */
870 if (flt_in_memory) {
871 if (opl_get_mem_unum != NULL) {
872 return (opl_get_mem_unum(synd_code, flt_addr, buf,
873 buflen, lenp));
874 } else {
875 return (ENOTSUP);
876 }
877 } else {
878 return (ENOTSUP);
879 }
880 }
881
882 /*ARGSUSED*/
883 int
884 plat_get_cpu_unum(int cpuid, char *buf, int buflen, int *lenp)
885 {
|
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 (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright 2018 Nexenta Systems, Inc. All rights reserved.
24 */
25
26 #include <sys/cpuvar.h>
27 #include <sys/systm.h>
28 #include <sys/sysmacros.h>
29 #include <sys/promif.h>
30 #include <sys/platform_module.h>
31 #include <sys/cmn_err.h>
32 #include <sys/errno.h>
33 #include <sys/machsystm.h>
34 #include <sys/bootconf.h>
35 #include <sys/nvpair.h>
36 #include <sys/kobj.h>
37 #include <sys/mem_cage.h>
38 #include <sys/opl.h>
39 #include <sys/scfd/scfostoescf.h>
40 #include <sys/cpu_sgnblk_defs.h>
41 #include <sys/utsname.h>
42 #include <sys/ddi.h>
43 #include <sys/sunndi.h>
205 extern char *tod_module_name;
206 extern void cpu_sgn_update(ushort_t, uchar_t, uchar_t, int);
207 extern void mmu_init_large_pages(size_t);
208
209 /* Set the CPU signature function pointer */
210 cpu_sgn_func = cpu_sgn_update;
211
212 /* Set appropriate tod module for OPL platform */
213 ASSERT(tod_module_name == NULL);
214 tod_module_name = "todopl";
215
216 if ((mmu_page_sizes == max_mmu_page_sizes) &&
217 (mmu_ism_pagesize != DEFAULT_ISM_PAGESIZE)) {
218 if (&mmu_init_large_pages)
219 mmu_init_large_pages(mmu_ism_pagesize);
220 }
221
222 tsb_lgrp_affinity = 1;
223
224 set_max_mmu_ctxdoms();
225 }
226
227 /*
228 * Convert logical a board number to a physical one.
229 */
230
231 #define LSBPROP "board#"
232 #define PSBPROP "physical-board#"
233
234 int
235 opl_get_physical_board(int id)
236 {
237 dev_info_t *root_dip, *dip = NULL;
238 char *dname = NULL;
239 int circ;
240
241 pnode_t pnode;
242 char pname[MAXSYSNAME] = {0};
243
244 int lsb_id; /* Logical System Board ID */
842 return;
843 }
844 scf_shutdown_callback(SIGSUBST_ENVIRON);
845 break;
846
847 case SIGSUBST_REBOOT:
848 if (scf_shutdown_callback == NULL) {
849 cmn_err(CE_NOTE, "!cpu_sgn_update: "
850 "scf_shutdown_callb not found\n");
851 return;
852 }
853 scf_shutdown_callback(SIGSUBST_REBOOT);
854 break;
855 }
856 }
857 }
858
859 /*ARGSUSED*/
860 int
861 plat_get_mem_unum(int synd_code, uint64_t flt_addr, int flt_bus_id,
862 int flt_in_memory, ushort_t flt_status, char *buf, int buflen, int *lenp)
863 {
864 /*
865 * check if it's a Memory error.
866 */
867 if (flt_in_memory) {
868 if (opl_get_mem_unum != NULL) {
869 return (opl_get_mem_unum(synd_code, flt_addr, buf,
870 buflen, lenp));
871 } else {
872 return (ENOTSUP);
873 }
874 } else {
875 return (ENOTSUP);
876 }
877 }
878
879 /*ARGSUSED*/
880 int
881 plat_get_cpu_unum(int cpuid, char *buf, int buflen, int *lenp)
882 {
|