29949e866e40b95795203f3ee46f44a197c946e4stevel * CDDL HEADER START
29949e866e40b95795203f3ee46f44a197c946e4stevel * The contents of this file are subject to the terms of the
29949e866e40b95795203f3ee46f44a197c946e4stevel * Common Development and Distribution License (the "License").
29949e866e40b95795203f3ee46f44a197c946e4stevel * You may not use this file except in compliance with the License.
29949e866e40b95795203f3ee46f44a197c946e4stevel * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
29949e866e40b95795203f3ee46f44a197c946e4stevel * See the License for the specific language governing permissions
29949e866e40b95795203f3ee46f44a197c946e4stevel * and limitations under the License.
29949e866e40b95795203f3ee46f44a197c946e4stevel * When distributing Covered Code, include this CDDL HEADER in each
29949e866e40b95795203f3ee46f44a197c946e4stevel * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
29949e866e40b95795203f3ee46f44a197c946e4stevel * If applicable, add the following below this CDDL HEADER, with the
29949e866e40b95795203f3ee46f44a197c946e4stevel * fields enclosed by brackets "[]" replaced with your own identifying
29949e866e40b95795203f3ee46f44a197c946e4stevel * information: Portions Copyright [yyyy] [name of copyright owner]
29949e866e40b95795203f3ee46f44a197c946e4stevel * CDDL HEADER END
29949e866e40b95795203f3ee46f44a197c946e4stevel * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
29949e866e40b95795203f3ee46f44a197c946e4stevel * Use is subject to license terms.
29949e866e40b95795203f3ee46f44a197c946e4stevel#pragma ident "%Z%%M% %I% %E% SMI"
29949e866e40b95795203f3ee46f44a197c946e4stevel "AC Control and Status reg = 0x", AC_BCSR(0), 0, 0, 0, 0,
29949e866e40b95795203f3ee46f44a197c946e4stevel "FHC Control and Status reg = 0x", FHC_CTRL(0), 0, 0, 0, 0,
29949e866e40b95795203f3ee46f44a197c946e4stevel "JTAG Control reg = 0x", FHC_JTAG_CTRL(0), 0, 0, 0, 0,
29949e866e40b95795203f3ee46f44a197c946e4stevel "Interrupt Group Number reg = 0x", FHC_IGN(0), 0, 0, 0, 0,
29949e866e40b95795203f3ee46f44a197c946e4stevel "System Interrupt Mapping reg = 0x", FHC_SIM(0), 0, 0, 0, 0,
29949e866e40b95795203f3ee46f44a197c946e4stevel "System Interrupt State reg = 0x", FHC_SSM(0), 0, 0, 0, 0,
29949e866e40b95795203f3ee46f44a197c946e4stevel "UART Interrupt Mapping reg = 0x", FHC_UIM(0), 0, 0, 0, 0,
29949e866e40b95795203f3ee46f44a197c946e4stevel "UART Interrupt State reg = 0x", FHC_USM(0), 0, 0, 0, 0
29949e866e40b95795203f3ee46f44a197c946e4stevel#define NUM_REG (sizeof (reg_tmpl)/sizeof (reg_tmpl[0]))
29949e866e40b95795203f3ee46f44a197c946e4stevelstatic void display_regdump(void);
29949e866e40b95795203f3ee46f44a197c946e4stevelstatic void boardstat_regdump(void);
29949e866e40b95795203f3ee46f44a197c946e4stevel#endif /* DEBUG */
29949e866e40b95795203f3ee46f44a197c946e4stevelextern void bd_remove_poll(struct sysctrl_soft_state *);
29949e866e40b95795203f3ee46f44a197c946e4stevelextern int sysctrl_getsystem_freq(void);
29949e866e40b95795203f3ee46f44a197c946e4stevelextern enum power_state compute_power_state(struct sysctrl_soft_state *, int);
29949e866e40b95795203f3ee46f44a197c946e4stevel/* Let user disable Sunfire Dynamic Reconfiguration */
29949e866e40b95795203f3ee46f44a197c946e4stevelstatic void sysc_dr_err_decode(sysc_dr_handle_t *, dev_info_t *, int);
29949e866e40b95795203f3ee46f44a197c946e4stevelsysc_policy_enough_cooling(struct sysctrl_soft_state *softsp,
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_cfga_stat_t *sysc_stat, uint_t ps_mutex_is_held);
29949e866e40b95795203f3ee46f44a197c946e4stevelsysc_policy_enough_precharge(struct sysctrl_soft_state *softsp,
29949e866e40b95795203f3ee46f44a197c946e4stevelsysc_policy_enough_power(struct sysctrl_soft_state *softsp,
29949e866e40b95795203f3ee46f44a197c946e4stevelsysc_policy_hardware_compatible(struct sysctrl_soft_state *softsp,
29949e866e40b95795203f3ee46f44a197c946e4stevelstatic void sysc_policy_connected_condition(struct sysctrl_soft_state *softsp,
29949e866e40b95795203f3ee46f44a197c946e4stevelstatic void sysc_policy_set_condition(void *sp, sysc_cfga_stat_t *sysc_stat,
29949e866e40b95795203f3ee46f44a197c946e4stevelstatic void sysc_policy_audit_messages(sysc_audit_evt_t event,
29949e866e40b95795203f3ee46f44a197c946e4stevelstatic void sysctrl_post_config_change(struct sysctrl_soft_state *softsp);
29949e866e40b95795203f3ee46f44a197c946e4stevelstatic int sysc_bd_disconnect(int, sysc_cfga_pkt_t *);
29949e866e40b95795203f3ee46f44a197c946e4stevelstatic int sysc_bd_unconfigure(int, sysc_cfga_pkt_t *);
29949e866e40b95795203f3ee46f44a197c946e4stevelstatic int sysc_dr_attach(sysc_dr_handle_t *handle, int board);
29949e866e40b95795203f3ee46f44a197c946e4stevelstatic int sysc_dr_detach(sysc_dr_handle_t *handle, int board);
29949e866e40b95795203f3ee46f44a197c946e4stevelstatic int sysc_prom_select(pnode_t pnode, void *arg, uint_t flag);
29949e866e40b95795203f3ee46f44a197c946e4stevelstatic void sysc_branch_callback(dev_info_t *rdip, void *arg, uint_t flags);
29949e866e40b95795203f3ee46f44a197c946e4stevelstatic int find_and_setup_cpu(int);
29949e866e40b95795203f3ee46f44a197c946e4stevelstatic int sysc_board_connect_supported(enum board_type);
29949e866e40b95795203f3ee46f44a197c946e4stevelstatic int find_and_setup_cpu_start(void *cpuid_arg, int has_changed);
29949e866e40b95795203f3ee46f44a197c946e4stevel * This function will basically do a prediction on the power state
29949e866e40b95795203f3ee46f44a197c946e4stevel * based on adding one additional load to the equation implemented
29949e866e40b95795203f3ee46f44a197c946e4stevel * by the function compute_power_state.
29949e866e40b95795203f3ee46f44a197c946e4stevel/*ARGSUSED*/
29949e866e40b95795203f3ee46f44a197c946e4stevelsysc_policy_enough_power(struct sysctrl_soft_state *softsp,
29949e866e40b95795203f3ee46f44a197c946e4stevel * note that we add one more load
29949e866e40b95795203f3ee46f44a197c946e4stevel * to the equation in compute_power_state
29949e866e40b95795203f3ee46f44a197c946e4stevel * and the answer better be REDUNDANT or
29949e866e40b95795203f3ee46f44a197c946e4stevel * MINIMUM before proceeding.
29949e866e40b95795203f3ee46f44a197c946e4stevel * This function gropes through the shadow registers in the sysctrl soft_state
29949e866e40b95795203f3ee46f44a197c946e4stevel * for the core power supply status, since fan status for them are ORed into
29949e866e40b95795203f3ee46f44a197c946e4stevel * the same status bit, and all other remaining fans.
29949e866e40b95795203f3ee46f44a197c946e4stevelsysc_policy_enough_cooling(struct sysctrl_soft_state *softsp,
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_cfga_stat_t *sysc_stat, uint_t ps_mutex_is_held)
29949e866e40b95795203f3ee46f44a197c946e4stevel * check the power supply in the slot in question
29949e866e40b95795203f3ee46f44a197c946e4stevel * for fans then check all the common fans.
29949e866e40b95795203f3ee46f44a197c946e4stevel retval = ((softsp->ps_stats[FHC_BOARD2PS(sysc_stat->board)].pshadow ==
29949e866e40b95795203f3ee46f44a197c946e4stevel (softsp->ps_stats[FHC_BOARD2PS(sysc_stat->board)].dcshadow ==
29949e866e40b95795203f3ee46f44a197c946e4stevel * This function will check all precharge voltage status.
29949e866e40b95795203f3ee46f44a197c946e4stevel/*ARGSUSED*/
29949e866e40b95795203f3ee46f44a197c946e4stevelsysc_policy_enough_precharge(struct sysctrl_soft_state *softsp,
29949e866e40b95795203f3ee46f44a197c946e4stevel * note that we always have to explicitly check
29949e866e40b95795203f3ee46f44a197c946e4stevel * the peripheral power supply for precharge since it
29949e866e40b95795203f3ee46f44a197c946e4stevel * supplies all of the precharge voltages.
29949e866e40b95795203f3ee46f44a197c946e4stevel ppsval = (softsp->ps_stats[SYS_PPS0_INDEX].pshadow == PRES_IN) &&
29949e866e40b95795203f3ee46f44a197c946e4stevel (softsp->ps_stats[SYS_PPS0_INDEX].dcshadow == PS_OK);
29949e866e40b95795203f3ee46f44a197c946e4stevel * check all the precharge status
29949e866e40b95795203f3ee46f44a197c946e4stevel retval = ((softsp->ps_stats[SYS_V3_PCH_INDEX].pshadow == PRES_IN) &&
29949e866e40b95795203f3ee46f44a197c946e4stevel (softsp->ps_stats[SYS_V3_PCH_INDEX].dcshadow == PS_OK) &&
29949e866e40b95795203f3ee46f44a197c946e4stevel (softsp->ps_stats[SYS_V5_PCH_INDEX].pshadow == PRES_IN) &&
29949e866e40b95795203f3ee46f44a197c946e4stevel (softsp->ps_stats[SYS_V5_PCH_INDEX].dcshadow == PS_OK));
29949e866e40b95795203f3ee46f44a197c946e4stevel * This function should only be called once as we may
29949e866e40b95795203f3ee46f44a197c946e4stevel * zero the clock board registers to indicate a configuration change.
29949e866e40b95795203f3ee46f44a197c946e4stevel * The code to calculate the bus frequency has been removed and we
29949e866e40b95795203f3ee46f44a197c946e4stevel * read the eeprom property instead. Another static Fmod (module
29949e866e40b95795203f3ee46f44a197c946e4stevel * frequency may be needed later but so far it is commented out.
29949e866e40b95795203f3ee46f44a197c946e4stevel (void) prom_getprop(root, "clock-frequency", (caddr_t)&clock_freq);
29949e866e40b95795203f3ee46f44a197c946e4stevel/*ARGSUSED*/
29949e866e40b95795203f3ee46f44a197c946e4stevelsysc_policy_hardware_compatible(struct sysctrl_soft_state *softsp,
29949e866e40b95795203f3ee46f44a197c946e4stevel /* Only allow DR operations on supported hardware */
29949e866e40b95795203f3ee46f44a197c946e4stevel for (i = 0; i < 2; i++) {
29949e866e40b95795203f3ee46f44a197c946e4stevel * XXX: Add jtag code which rescans disabled boards.
29949e866e40b95795203f3ee46f44a197c946e4stevel * For the time being disabled boards are not
29949e866e40b95795203f3ee46f44a197c946e4stevel * checked for compatibility when cpu_speed is 0.
29949e866e40b95795203f3ee46f44a197c946e4stevel "rated at %d Mhz, system freq %d Mhz",
29949e866e40b95795203f3ee46f44a197c946e4stevel if (sram_mode != sysc_stat->bd.cpu[i].cpu_sram_mode) {
29949e866e40b95795203f3ee46f44a197c946e4stevel "incompatible sram mode of %dx, "
29949e866e40b95795203f3ee46f44a197c946e4stevel#endif /* RFE_4174486 */
29949e866e40b95795203f3ee46f44a197c946e4stevel /* Check for Sunfire boards in a Sunfire+ system */
29949e866e40b95795203f3ee46f44a197c946e4stevel if (status == TRUE && Fsys > 84 && !fhc_bd_is_plus(sysc_stat->board)) {
29949e866e40b95795203f3ee46f44a197c946e4stevel "not 100 MHz capable ");
29949e866e40b95795203f3ee46f44a197c946e4stevel cmn_err(CE_WARN, "board %d, is not capable of running at "
29949e866e40b95795203f3ee46f44a197c946e4stevel "current system clock (%dMhz)", sysc_stat->board, Fsys);
29949e866e40b95795203f3ee46f44a197c946e4stevel * This function is called to check the policy for a request to transition
29949e866e40b95795203f3ee46f44a197c946e4stevel * to the connected state from the disconnected state. The generic policy
29949e866e40b95795203f3ee46f44a197c946e4stevel * is to do sanity checks again before going live.
29949e866e40b95795203f3ee46f44a197c946e4stevel/*ARGSUSED*/
29949e866e40b95795203f3ee46f44a197c946e4stevelsysc_policy_connect(struct sysctrl_soft_state *softsp,
29949e866e40b95795203f3ee46f44a197c946e4stevel DPRINTF(SYSC_DEBUG, ("Previous RState: %d\n", sysc_stat->rstate));
29949e866e40b95795203f3ee46f44a197c946e4stevel DPRINTF(SYSC_DEBUG, ("Previous OState: %d\n", sysc_stat->ostate));
29949e866e40b95795203f3ee46f44a197c946e4stevel * Safety policy: only allow connect if board is UNKNOWN cond.
29949e866e40b95795203f3ee46f44a197c946e4stevel * cold start board will be demoted to UNKNOWN cond when
29949e866e40b95795203f3ee46f44a197c946e4stevel * disconnected
29949e866e40b95795203f3ee46f44a197c946e4stevel if (sysc_stat->condition != SYSC_CFGA_COND_UNKNOWN) {
29949e866e40b95795203f3ee46f44a197c946e4stevel /* Check PROM support. */
29949e866e40b95795203f3ee46f44a197c946e4stevel if (!sysc_board_connect_supported(sysc_stat->type)) {
29949e866e40b95795203f3ee46f44a197c946e4stevel " is not supported by firmware.",
29949e866e40b95795203f3ee46f44a197c946e4stevel if (!sysc_policy_enough_power(softsp, TRUE, FALSE)) {
29949e866e40b95795203f3ee46f44a197c946e4stevel if (!sysc_policy_enough_precharge(softsp, sysc_stat)) {
29949e866e40b95795203f3ee46f44a197c946e4stevel if (!sysc_policy_enough_cooling(softsp, sysc_stat, FALSE)) {
29949e866e40b95795203f3ee46f44a197c946e4stevel if (!sysc_policy_hardware_compatible(softsp, sysc_stat, pkt)) {
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_policy_audit_messages(SYSC_AUDIT_RSTATE_CONNECT,
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_policy_audit_messages(SYSC_AUDIT_RSTATE_SUCCEEDED,
29949e866e40b95795203f3ee46f44a197c946e4stevel DPRINTF(SYSC_DEBUG, ("Current RState: %d\n", sysc_stat->rstate));
29949e866e40b95795203f3ee46f44a197c946e4stevel DPRINTF(SYSC_DEBUG, ("Current OState: %d\n", sysc_stat->ostate));
29949e866e40b95795203f3ee46f44a197c946e4stevel DPRINTF(SYSC_DEBUG, ("Current Condition: %d\n", sysc_stat->condition));
29949e866e40b95795203f3ee46f44a197c946e4stevel * This function is called to check the policy for a request to transition
29949e866e40b95795203f3ee46f44a197c946e4stevel * to the disconnected state from the connected/unconfigured state only.
29949e866e40b95795203f3ee46f44a197c946e4stevel * All other requests are invalid.
29949e866e40b95795203f3ee46f44a197c946e4stevel/*ARGSUSED*/
29949e866e40b95795203f3ee46f44a197c946e4stevelsysc_policy_disconnect(struct sysctrl_soft_state *softsp,
29949e866e40b95795203f3ee46f44a197c946e4stevel DPRINTF(SYSC_DEBUG, ("Previous RState: %d\n", sysc_stat->rstate));
29949e866e40b95795203f3ee46f44a197c946e4stevel DPRINTF(SYSC_DEBUG, ("Previous OState: %d\n", sysc_stat->ostate));
29949e866e40b95795203f3ee46f44a197c946e4stevel /* Check PROM support. */
29949e866e40b95795203f3ee46f44a197c946e4stevel if (!sysc_board_connect_supported(sysc_stat->type)) {
29949e866e40b95795203f3ee46f44a197c946e4stevel " is not supported by firmware.",
29949e866e40b95795203f3ee46f44a197c946e4stevel " is not yet supported.",
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_policy_audit_messages(SYSC_AUDIT_RSTATE_DISCONNECT,
29949e866e40b95795203f3ee46f44a197c946e4stevel ("disconnect starting bd_remove_poll()"));
29949e866e40b95795203f3ee46f44a197c946e4stevel "board %d is ready to remove",
29949e866e40b95795203f3ee46f44a197c946e4stevel DPRINTF(SYSC_DEBUG, ("Current RState: %d\n", sysc_stat->rstate));
29949e866e40b95795203f3ee46f44a197c946e4stevel DPRINTF(SYSC_DEBUG, ("Current OState: %d\n", sysc_stat->ostate));
29949e866e40b95795203f3ee46f44a197c946e4stevel DPRINTF(SYSC_DEBUG, ("Current Condition: %d\n", sysc_stat->condition));
29949e866e40b95795203f3ee46f44a197c946e4stevel * This function is called to check the policy for a request to transition
29949e866e40b95795203f3ee46f44a197c946e4stevel * from the connected/configured state to the connected/unconfigured state only.
29949e866e40b95795203f3ee46f44a197c946e4stevel * All other requests are invalid.
29949e866e40b95795203f3ee46f44a197c946e4stevel/*ARGSUSED*/
29949e866e40b95795203f3ee46f44a197c946e4stevelsysc_policy_unconfigure(struct sysctrl_soft_state *softsp,
29949e866e40b95795203f3ee46f44a197c946e4stevel DPRINTF(SYSC_DEBUG, ("Previous RState: %d\n", sysc_stat->rstate));
29949e866e40b95795203f3ee46f44a197c946e4stevel DPRINTF(SYSC_DEBUG, ("Previous OState: %d\n", sysc_stat->ostate));
29949e866e40b95795203f3ee46f44a197c946e4stevel if (!sysc_policy_hardware_compatible(softsp, sysc_stat, pkt)) {
29949e866e40b95795203f3ee46f44a197c946e4stevel " is not yet supported.",
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_policy_audit_messages(SYSC_AUDIT_OSTATE_UNCONFIGURE,
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_policy_connected_condition(softsp, sysc_stat, FALSE);
29949e866e40b95795203f3ee46f44a197c946e4stevel DPRINTF(SYSC_DEBUG, ("Current RState: %d\n", sysc_stat->rstate));
29949e866e40b95795203f3ee46f44a197c946e4stevel DPRINTF(SYSC_DEBUG, ("Current OState: %d\n", sysc_stat->ostate));
29949e866e40b95795203f3ee46f44a197c946e4stevel DPRINTF(SYSC_DEBUG, ("Current Condition: %d\n", sysc_stat->condition));
29949e866e40b95795203f3ee46f44a197c946e4stevel * This function is called to check the policy for a requested transition
29949e866e40b95795203f3ee46f44a197c946e4stevel * from either the connected/unconfigured state or the connected/configured
29949e866e40b95795203f3ee46f44a197c946e4stevel * state to the connected/configured state. The redundant state transition
29949e866e40b95795203f3ee46f44a197c946e4stevel * is permitted for partially configured set of devices. Basically, we
29949e866e40b95795203f3ee46f44a197c946e4stevel * retry the configure.
29949e866e40b95795203f3ee46f44a197c946e4stevel/*ARGSUSED*/
29949e866e40b95795203f3ee46f44a197c946e4stevelsysc_policy_configure(struct sysctrl_soft_state *softsp,
29949e866e40b95795203f3ee46f44a197c946e4stevel DPRINTF(SYSC_DEBUG, ("Previous RState: %d\n", sysc_stat->rstate));
29949e866e40b95795203f3ee46f44a197c946e4stevel DPRINTF(SYSC_DEBUG, ("Previous OState: %d\n", sysc_stat->ostate));
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_policy_audit_messages(SYSC_AUDIT_OSTATE_CONFIGURE,
29949e866e40b95795203f3ee46f44a197c946e4stevel DPRINTF(SYSC_DEBUG, ("Current RState: %d\n", sysc_stat->rstate));
29949e866e40b95795203f3ee46f44a197c946e4stevel DPRINTF(SYSC_DEBUG, ("Current OState: %d\n", sysc_stat->ostate));
29949e866e40b95795203f3ee46f44a197c946e4stevel DPRINTF(SYSC_DEBUG, ("Current Condition: %d\n", sysc_stat->condition));
29949e866e40b95795203f3ee46f44a197c946e4stevel/*ARGSUSED*/
29949e866e40b95795203f3ee46f44a197c946e4stevelsysc_policy_empty_condition(struct sysctrl_soft_state *softsp,
29949e866e40b95795203f3ee46f44a197c946e4stevel /* nothing in the slot so just check power supplies */
29949e866e40b95795203f3ee46f44a197c946e4stevel/*ARGSUSED*/
29949e866e40b95795203f3ee46f44a197c946e4stevelsysc_policy_disconnected_condition(struct sysctrl_soft_state *softsp,
29949e866e40b95795203f3ee46f44a197c946e4stevel * if unknown, we have come from hotplug case so do a quick
29949e866e40b95795203f3ee46f44a197c946e4stevel * reevaluation.
29949e866e40b95795203f3ee46f44a197c946e4stevel * if ok, we have come from connected to disconnected and we stay
29949e866e40b95795203f3ee46f44a197c946e4stevel * ok until removed or reevaluate when reconnect. We might have
29949e866e40b95795203f3ee46f44a197c946e4stevel * experienced a ps fail so reevaluate the condition.
29949e866e40b95795203f3ee46f44a197c946e4stevel * if unsuable, either power supply was missing or
29949e866e40b95795203f3ee46f44a197c946e4stevel * hardware was not compatible. Check to see if
29949e866e40b95795203f3ee46f44a197c946e4stevel * this is still true.
29949e866e40b95795203f3ee46f44a197c946e4stevel * failing must transition in the disconnected state
29949e866e40b95795203f3ee46f44a197c946e4stevel * to either unusable or unknown. We may have come here
29949e866e40b95795203f3ee46f44a197c946e4stevel * from cfgadm -f -c disconnect after a power supply failure
29949e866e40b95795203f3ee46f44a197c946e4stevel * in an attempt to protect the board.
29949e866e40b95795203f3ee46f44a197c946e4stevel * if failed, we have failed POST and must stay in this
29949e866e40b95795203f3ee46f44a197c946e4stevel * condition until the board has been removed
29949e866e40b95795203f3ee46f44a197c946e4stevel * before ever coming back into another condition
29949e866e40b95795203f3ee46f44a197c946e4stevel/*ARGSUSED*/
29949e866e40b95795203f3ee46f44a197c946e4stevelsysc_policy_connected_condition(struct sysctrl_soft_state *softsp,
29949e866e40b95795203f3ee46f44a197c946e4stevelsysc_policy_set_condition(void *sp, sysc_cfga_stat_t *sysc_stat,
29949e866e40b95795203f3ee46f44a197c946e4stevel struct sysctrl_soft_state *softsp = (struct sysctrl_soft_state *)sp;
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_policy_disconnected_condition(softsp, sysc_stat,
29949e866e40b95795203f3ee46f44a197c946e4stevelsysc_policy_update(void *softsp, sysc_cfga_stat_t *sysc_stat,
29949e866e40b95795203f3ee46f44a197c946e4stevel ASSERT(event == SYSC_EVT_BD_HP_DISABLED || fhc_bdlist_locked());
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_policy_empty_condition(softsp, sysc_stat, FALSE, FALSE);
29949e866e40b95795203f3ee46f44a197c946e4stevel "disabled %s board in slot %d",
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_policy_disconnected_condition(softsp, sysc_stat,
29949e866e40b95795203f3ee46f44a197c946e4stevel "failed %s board in slot %d",
29949e866e40b95795203f3ee46f44a197c946e4stevel sysc_policy_set_condition((void *)softsp, sysc_stat, FALSE);
29949e866e40b95795203f3ee46f44a197c946e4stevel for (list = fhc_bd_first(); list; list = fhc_bd_next(list)) {
29949e866e40b95795203f3ee46f44a197c946e4stevel cmn_err(CE_NOTE, "%s board has been inserted into slot %d",
29949e866e40b95795203f3ee46f44a197c946e4stevel /* now it is ok to free the ac pa memory database */
29949e866e40b95795203f3ee46f44a197c946e4stevel /* reinitialize sysc_cfga_stat structure */
29949e866e40b95795203f3ee46f44a197c946e4stevel sizeof (union bd_un));
29949e866e40b95795203f3ee46f44a197c946e4stevel cmn_err(CE_NOTE, "Hot Plug not supported in this system");
29949e866e40b95795203f3ee46f44a197c946e4stevel cmn_err(CE_WARN, "board %d cannot be disconnected because it"
29949e866e40b95795203f3ee46f44a197c946e4stevel * signal to POST that the system has been reconfigured and that
29949e866e40b95795203f3ee46f44a197c946e4stevel * the system configuration status information should be invalidated
29949e866e40b95795203f3ee46f44a197c946e4stevel * the next time through POST
29949e866e40b95795203f3ee46f44a197c946e4stevelsysctrl_post_config_change(struct sysctrl_soft_state *softsp)
29949e866e40b95795203f3ee46f44a197c946e4stevel * We are heading into a configuration change!
29949e866e40b95795203f3ee46f44a197c946e4stevel * Tell post to invalidate its notion of the system configuration.
29949e866e40b95795203f3ee46f44a197c946e4stevel * This is done by clearing the clock registers...
29949e866e40b95795203f3ee46f44a197c946e4stevel ~(CLOCK_FREQ_8 | CLOCK_DIV_1 | CLOCK_RANGE | CLOCK_DIV_0);
29949e866e40b95795203f3ee46f44a197c946e4stevel /* find gap for largest supported simm in advance */
29949e866e40b95795203f3ee46f44a197c946e4stevel mempa = fhc_find_memloc_gap(BANKS_PER_BOARD * MAX_BANK_SIZE_MB);
29949e866e40b95795203f3ee46f44a197c946e4stevel /* TODO: Is mempa vulnerable to re-use here? */
29949e866e40b95795203f3ee46f44a197c946e4stevel /* ASSERT(jtag not held) */
29949e866e40b95795203f3ee46f44a197c946e4stevel /* attempt to program the memory while frozen */
29949e866e40b95795203f3ee46f44a197c946e4stevel * Must not delete kstat used by prtdiag until the PROM
29949e866e40b95795203f3ee46f44a197c946e4stevel * has successfully connected to board.
29949e866e40b95795203f3ee46f44a197c946e4stevel /* it is important to have fhc_bdlist_lock() earlier */
29949e866e40b95795203f3ee46f44a197c946e4stevel#endif /* DEBUG */
29949e866e40b95795203f3ee46f44a197c946e4stevel#endif /* DEBUG */
29949e866e40b95795203f3ee46f44a197c946e4stevel#endif /* DEBUG */
29949e866e40b95795203f3ee46f44a197c946e4stevel * Value of error gets lost for CPU boards.
29949e866e40b95795203f3ee46f44a197c946e4stevel retval_b = find_and_setup_cpu(FHC_BOARD2CPU_B(board));
29949e866e40b95795203f3ee46f44a197c946e4stevel if (bdp->sc.type == CPU_BOARD || bdp->sc.type == MEM_BOARD) {
29949e866e40b95795203f3ee46f44a197c946e4stevel * Check that any memory on board is not in use.
29949e866e40b95795203f3ee46f44a197c946e4stevel * This must be done while the board list lock is held
29949e866e40b95795203f3ee46f44a197c946e4stevel * as memory state can change while fhc_bd_busy() is true
29949e866e40b95795203f3ee46f44a197c946e4stevel * even though a memory operation cannot be started
29949e866e40b95795203f3ee46f44a197c946e4stevel * if fhc_bd_busy() is true.
29949e866e40b95795203f3ee46f44a197c946e4stevel if ((acsp = (struct ac_soft_state *)bdp->ac_softsp) != NULL) {
29949e866e40b95795203f3ee46f44a197c946e4stevel "memory bank %d in use",
29949e866e40b95795203f3ee46f44a197c946e4stevel "memory bank %d in use",
29949e866e40b95795203f3ee46f44a197c946e4stevel * Nothing more to do here. The memory interface
29949e866e40b95795203f3ee46f44a197c946e4stevel * will not make any transitions while
29949e866e40b95795203f3ee46f44a197c946e4stevel * fhc_bd_busy() is true. Once the ostate
29949e866e40b95795203f3ee46f44a197c946e4stevel * becomes unconfigured, the memory becomes
29949e866e40b95795203f3ee46f44a197c946e4stevel * invisible.
29949e866e40b95795203f3ee46f44a197c946e4stevel if (error != 0) {
29949e866e40b95795203f3ee46f44a197c946e4stevel "processor %d unconfigure failed",
29949e866e40b95795203f3ee46f44a197c946e4stevel if (error != 0) {
29949e866e40b95795203f3ee46f44a197c946e4stevel "processor %d unconfigure failed",
29949e866e40b95795203f3ee46f44a197c946e4stevel * Attaching devices on a board.
29949e866e40b95795203f3ee46f44a197c946e4stevel handle->error = e_ddi_branch_create(ddi_root_node(), &b,
29949e866e40b95795203f3ee46f44a197c946e4stevel * Error only if we fail for fhc dips
29949e866e40b95795203f3ee46f44a197c946e4stevel return (0);
29949e866e40b95795203f3ee46f44a197c946e4stevel/*ARGSUSED*/
29949e866e40b95795203f3ee46f44a197c946e4stevel rdip = wp->handle->dip_list[wp->handle->dip_list_len] =
29949e866e40b95795203f3ee46f44a197c946e4stevel * Branch rooted at dip already held, so
29949e866e40b95795203f3ee46f44a197c946e4stevel * release hold acquired in e_ddi_nodeid_to_dip
29949e866e40b95795203f3ee46f44a197c946e4stevel " e_ddi_nodeid_to_dip() failed for"
29949e866e40b95795203f3ee46f44a197c946e4stevel return (0);
29949e866e40b95795203f3ee46f44a197c946e4stevel * Detaching devices on a board.
29949e866e40b95795203f3ee46f44a197c946e4stevel handle->error = prom_tree_access(sysc_make_list, &arg, NULL);
29949e866e40b95795203f3ee46f44a197c946e4stevel return (0);
29949e866e40b95795203f3ee46f44a197c946e4stevel handle->dip_list = kmem_zalloc(sizeof (dev_info_t *) * SYSC_DR_MAX_NODE,
29949e866e40b95795203f3ee46f44a197c946e4stevel/*ARGSUSED2*/
29949e866e40b95795203f3ee46f44a197c946e4stevelsysc_prom_select(pnode_t pnode, void *arg, uint_t flag)
29949e866e40b95795203f3ee46f44a197c946e4stevel * Get board id for EXXXX platforms where
29949e866e40b95795203f3ee46f44a197c946e4stevel * 0x1c0 is EXXXX platform specific data to
29949e866e40b95795203f3ee46f44a197c946e4stevel * acquire board id.
29949e866e40b95795203f3ee46f44a197c946e4stevel/*ARGSUSED*/
29949e866e40b95795203f3ee46f44a197c946e4stevelsysc_branch_callback(dev_info_t *rdip, void *arg, uint_t flags)
29949e866e40b95795203f3ee46f44a197c946e4stevel cmn_err(CE_PANIC, "sysc_branch_callback: list overflow");
29949e866e40b95795203f3ee46f44a197c946e4stevel * Uninitialize devices for the state of a board.
29949e866e40b95795203f3ee46f44a197c946e4stevelsysc_dr_err_decode(sysc_dr_handle_t *handle, dev_info_t *dip, int attach)
29949e866e40b95795203f3ee46f44a197c946e4stevelstatic char *
29949e866e40b95795203f3ee46f44a197c946e4stevelsysc_rstate_typestr(sysc_cfga_rstate_t rstate, sysc_audit_evt_t event)
29949e866e40b95795203f3ee46f44a197c946e4stevelstatic char *
29949e866e40b95795203f3ee46f44a197c946e4stevelsysc_ostate_typestr(sysc_cfga_ostate_t ostate, sysc_audit_evt_t event)
29949e866e40b95795203f3ee46f44a197c946e4stevelsysc_policy_audit_messages(sysc_audit_evt_t event, sysc_cfga_stat_t *sysc_stat)
29949e866e40b95795203f3ee46f44a197c946e4stevel "%s %s board in slot %d",
29949e866e40b95795203f3ee46f44a197c946e4stevel "%s %s board in slot %d",
29949e866e40b95795203f3ee46f44a197c946e4stevel "%s board in slot %d is %s",
29949e866e40b95795203f3ee46f44a197c946e4stevel "%s board in slot %d failed to %s",
29949e866e40b95795203f3ee46f44a197c946e4stevel "%s board in slot %d failed to %s",
29949e866e40b95795203f3ee46f44a197c946e4stevel "%s %s board in slot %d",
29949e866e40b95795203f3ee46f44a197c946e4stevel "%s %s board in slot %d",
29949e866e40b95795203f3ee46f44a197c946e4stevel "%s board in slot %d is %s",
29949e866e40b95795203f3ee46f44a197c946e4stevel "%s board in slot %d partially %s",
29949e866e40b95795203f3ee46f44a197c946e4stevel "%s board in slot %d partially %s",
29949e866e40b95795203f3ee46f44a197c946e4stevel "unknown audit of a %s %s board in"
29949e866e40b95795203f3ee46f44a197c946e4stevel " slot %d",
29949e866e40b95795203f3ee46f44a197c946e4stevel return (prom_tree_access(find_and_setup_cpu_start, &cpuid, NULL));
29949e866e40b95795203f3ee46f44a197c946e4stevel/* ARGSUSED */
29949e866e40b95795203f3ee46f44a197c946e4stevelfind_and_setup_cpu_start(void *cpuid_arg, int has_changed)
29949e866e40b95795203f3ee46f44a197c946e4stevel if (prom_getproplen(nodeid, "device_type") < MAX_PROP_LEN)
29949e866e40b95795203f3ee46f44a197c946e4stevel (void) prom_getprop(nodeid, "upa-portid", (caddr_t)&upaid);
29949e866e40b95795203f3ee46f44a197c946e4stevel if ((strcmp(type, "cpu") == 0) && (upaid == cpuid)) {
29949e866e40b95795203f3ee46f44a197c946e4stevel return (0);
29949e866e40b95795203f3ee46f44a197c946e4stevel /* Check the firmware for Dynamic Reconfiguration support */
29949e866e40b95795203f3ee46f44a197c946e4stevel if (prom_test("SUNW,Ultra-Enterprise,rm-brd") != 0) {
29949e866e40b95795203f3ee46f44a197c946e4stevel /* The message was printed in platmod:set_platform_defaults */
29949e866e40b95795203f3ee46f44a197c946e4stevel "add-brd-supported-types",
29949e866e40b95795203f3ee46f44a197c946e4stevel * This is an old prom which may cause a fatal reset,
29949e866e40b95795203f3ee46f44a197c946e4stevel * so don't allow any DR operations.
29949e866e40b95795203f3ee46f44a197c946e4stevel * If enable_dynamic_reconfiguration is 0
29949e866e40b95795203f3ee46f44a197c946e4stevel * we have already printed a similar message.
29949e866e40b95795203f3ee46f44a197c946e4stevel " Dynamic Reconfiguration");
29949e866e40b95795203f3ee46f44a197c946e4stevel for (i = 0; i < proplen; i++) {
29949e866e40b95795203f3ee46f44a197c946e4stevel switch (sup_list[i]) {
29949e866e40b95795203f3ee46f44a197c946e4stevel /* Ignore other characters. */
29949e866e40b95795203f3ee46f44a197c946e4stevel cmn_err(CE_NOTE, "!Firmware supports Dynamic Reconfiguration"
29949e866e40b95795203f3ee46f44a197c946e4stevel " of CPU/Memory boards.");
29949e866e40b95795203f3ee46f44a197c946e4stevel " Reconfiguration of CPU/Memory boards.");
29949e866e40b95795203f3ee46f44a197c946e4stevel /* Skip leading ", " using &tstr[2]. */
29949e866e40b95795203f3ee46f44a197c946e4stevel cmn_err(CE_NOTE, "!Firmware supports Dynamic Reconfiguration"
29949e866e40b95795203f3ee46f44a197c946e4stevel " Reconfiguration of I/O boards.");
29949e866e40b95795203f3ee46f44a197c946e4stevel for (bd_idx = 0; bd_idx < fhc_max_boards(); bd_idx++) {
29949e866e40b95795203f3ee46f44a197c946e4stevel bcopy((void *) reg_tmpl, (void *) ®_dt[bd_idx][0],
29949e866e40b95795203f3ee46f44a197c946e4stevel if (curr_bdp->sc.rstate == SYSC_CFGA_RSTATE_CONNECTED) {
29949e866e40b95795203f3ee46f44a197c946e4stevel for (bd_idx = 0; bd_idx < fhc_max_boards(); bd_idx++) {
29949e866e40b95795203f3ee46f44a197c946e4stevel for (bd_idx = 0; bd_idx < fhc_max_boards(); bd_idx++) {
29949e866e40b95795203f3ee46f44a197c946e4stevel " SISM UIM USM\n");
29949e866e40b95795203f3ee46f44a197c946e4stevel " %08x %04x %08x %04x\n",
29949e866e40b95795203f3ee46f44a197c946e4stevel for (bd_idx = 0; bd_idx < fhc_max_boards(); bd_idx++) {
29949e866e40b95795203f3ee46f44a197c946e4stevel for (bd_idx = 0; bd_idx < fhc_max_boards(); bd_idx++) {
29949e866e40b95795203f3ee46f44a197c946e4stevel " SISM UIM USM\n");
29949e866e40b95795203f3ee46f44a197c946e4stevel " %08x %04x %08x %04x\n",
29949e866e40b95795203f3ee46f44a197c946e4stevel " %08x %04x %08x %04x\n",
29949e866e40b95795203f3ee46f44a197c946e4stevel " disconnected)-------------------"
29949e866e40b95795203f3ee46f44a197c946e4stevel "---------------\n");
29949e866e40b95795203f3ee46f44a197c946e4stevel#endif /* DEBUG */