opl.c revision 72b9fce97841381c0dae054e0dddd25d76672405
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * CDDL HEADER START
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * The contents of this file are subject to the terms of the
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * Common Development and Distribution License (the "License").
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * You may not use this file except in compliance with the License.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * See the License for the specific language governing permissions
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * and limitations under the License.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * When distributing Covered Code, include this CDDL HEADER in each
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov * If applicable, add the following below this CDDL HEADER, with the
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * fields enclosed by brackets "[]" replaced with your own identifying
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov * information: Portions Copyright [yyyy] [name of copyright owner]
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov * CDDL HEADER END
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * Use is subject to license terms.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#pragma ident "%Z%%M% %I% %E% SMI"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweint (*opl_get_mem_unum)(int, uint64_t, char *, int, int *);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweint (*opl_get_mem_sid)(char *unum, char *buf, int buflen, int *lenp);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweint (*opl_get_mem_offset)(uint64_t paddr, uint64_t *offp);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe/* Memory for fcode claims. 16k times # maximum possible IO units */
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define EFCODE_SIZE (OPL_MAX_BOARDS * OPL_MAX_IO_UNITS_PER_BOARD * 0x4000)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#define OPL_MC_MEMBOARD_SHIFT 38 /* Boards on 256BG boundary */
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe/* Set the maximum number of boards for DR */
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowevoid sgn_update_all_cpus(ushort_t, uchar_t, uchar_t);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweint opl_tsb_spares = (OPL_MAX_BOARDS) * (OPL_MAX_PCICH_UNITS_PER_BOARD) *
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe { "FF1", OPL_MAX_BOARDS_FF1, FF1, STD_DISPATCH_TABLE },
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe { "FF2", OPL_MAX_BOARDS_FF2, FF2, STD_DISPATCH_TABLE },
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe { "DC1", OPL_MAX_BOARDS_DC1, DC1, STD_DISPATCH_TABLE },
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe { "DC2", OPL_MAX_BOARDS_DC2, DC2, EXT_DISPATCH_TABLE },
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe { "DC3", OPL_MAX_BOARDS_DC3, DC3, EXT_DISPATCH_TABLE },
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowestatic int opl_num_models = sizeof (opl_models)/sizeof (opl_model_info_t);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * opl_cur_model
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankovstatic struct memlist *opl_memlist_per_board(struct memlist *ml);
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov return (OPL_MAX_CPU_PER_BOARD * OPL_MAX_BOARDS);
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov * Get model name from the root node.
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov * We are using the prom device tree since, at this point,
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov * the Solaris device tree is not yet setup.
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov (void) prom_getprop(prom_rootnode(), "model", (caddr_t)name);
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov for (i = 0; i < opl_num_models; i++) {
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov if (strncmp(name, opl_models[i].model_name, MAXSYSNAME) == 0) {
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov if ((opl_cur_model->model_cmds & EXT_DISPATCH_TABLE) &&
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov * Based on a platform model, select a dispatch table.
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov * Only DC2 and DC3 systems uses the alternate/extended
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov * TS dispatch table.
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov * FF1, FF2 and DC1 systems used standard dispatch tables.
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov * From the model, get the maximum number of boards
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov * supported and set the value accordingly. If the model
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov * could not be determined or recognized, we assume the max value.
set_platform_defaults(void)
extern char *tod_module_name;
if (&mmu_init_large_pages)
int circ;
if (root_dip) {
return (psb_id);
return (psb_id);
static struct memlist *
if (tail) {
return (head);
set_platform_cage_params(void)
int ret;
if (kernel_cage_enable) {
if (ret == 0)
if (kcage_on)
return (ENOTSUP);
return (ENOTSUP);
plat_max_boards(void)
return (OPL_MAX_BOARDS);
return (OPL_MAX_CPU_PER_BOARD);
return (OPL_MAX_MEM_UNITS_PER_BOARD);
return (OPL_MAX_IO_UNITS_PER_BOARD);
return (OPL_MAX_CMP_UNITS_PER_BOARD);
return (OPL_MAX_CORE_UNITS_PER_BOARD);
mem_node_physalign = 0;
int board;
int memnode;
} mem_range;
nodeid);
extern int mpo_disabled;
if (mpo_disabled) {
return (plathand);
plat_lgrp_init(void)
if (mpo_disabled)
switch (evt) {
case LGRP_CONFIG_MEM_ADD:
case LGRP_CONFIG_MEM_DEL:
case LGRP_CONFIG_MEM_RENAME:
plat_lgrp_root_hand(void)
if (mpo_disabled)
return (lgrp_default_handle);
return (LGRP_DEFAULT_HANDLE);
load_platform_drivers(void)
char *platform_module_list[] = {
static void (*scf_panic_callback)(int);
static void (*scf_shutdown_callback)(int);
scf_panic_callback = (void (*)(int))
scf_shutdown_callback = (void (*)(int))
switch (sub_state) {
case SIGSUBST_PANIC:
case SIGSUBST_HALT:
case SIGSUBST_ENVIRON:
case SIGSUBST_REBOOT:
if (flt_in_memory) {
return (ENOTSUP);
return (ENOTSUP);
int ret = 0;
int plen;
return (ENXIO);
case FF1:
case FF2:
case DC1:
case DC2:
case DC3:
return (ENODEV);
if (lenp)
return (ret);
#define SCF_PUTINFO(f, s, p) \
plat_nodename_set(void)
void *datap;
datap =
if (counter == 0)
return (tmp_alloc_base);
startup_platform(void)
int impl;
return (ENOTSUP);
return (ENOTSUP);
return (ENOTSUP);