1 /*
   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License, Version 1.0 only
   6  * (the "License").  You may not use this file except in compliance
   7  * with the License.
   8  *
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 /*
  23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 
  27 #ifndef _PICLDR_H
  28 #define _PICLDR_H
  29 
  30 #pragma ident   "%Z%%M% %I%     %E% SMI"
  31 
  32 #ifdef  __cplusplus
  33 extern "C" {
  34 #endif
  35 
  36 typedef enum picl_smc_event {
  37         NO_EVENT = 0,
  38         TEMPERATURE_SENSOR_EVENT,
  39         CPU_NODE_STATE_CHANGE_NOTIFICATION,
  40         CHANGE_CPCI_STATE,      /* request to config/unconfig cpci i/f */
  41         CHANGE_CPU_NODE_STATE,  /* request on online/offline node */
  42         SMC_LOCAL_EVENT
  43 } picl_smc_event_t;
  44 
  45 #define SMC_NODE                                "/dev/ctsmc"
  46 #define SMC_BMC_ADDR                            0x20
  47 #define CPU_NODE_STATE_ONLINE                   1
  48 #define CPU_NODE_STATE_OFFLINE                  0
  49 
  50 /* event messages */
  51 #define EVENT_MSG_AC_STATE_CHANGE               0xf5
  52 #define EVENT_MSG_CHANGE_CPCI_STATE             0x65
  53 #define EVENT_MSG_CHANGE_CPU_NODE_STATE         0x62
  54 #define EVENT_MSG_ASYNC_EVENT_NOTIFICATION      0x82
  55 #define MSG_GET_CPU_NODE_STATE                  0x61
  56 #define SMC_LOCAL_EVENT_BRIDGE_IN_RESET         0x00
  57 #define SMC_LOCAL_EVENT_BRIDGE_OUT_OF_RESET     0x01
  58 #define SMC_LOCAL_EVENT_LATCH_OPENED            0x06
  59 
  60 #define CPCI_STATE_OFFLINE                      0
  61 #define CPCI_STATE_ONLINE                       1
  62 #define SATCPU_STATE_ONLINE                     0x7
  63 #define SATCPU_STATE_OFFLINE                    0x8
  64 #define HEALTHY_ASSERT                          1
  65 #define HEALTHY_DEASSERT                        2
  66 
  67 #define SMC_MASTER_RW_CMD                       0x90
  68 #define ENV_CONFIG_FILE "/usr/platform/%s/lib/picl/plugins/envmond.conf"
  69 #define RECORD_MAXSIZE                          (256)
  70 #define RECORD_WHITESPACE                       (": \t")
  71 #define SERVICE_PROCESSOR                       "alarmcard"
  72 
  73 /* packet lengths */
  74 #define ENV_RTM_PKT_LEN                         3
  75 #define ENV_SET_GLOBAL_PKT_LEN                  2
  76 #define ENV_SENSOR_EV_ENABLE_PKT_LEN            2
  77 #define ENV_IPMI_SMC_ENABLE_PKT_LEN             3
  78 
  79 /* rtm pkt data */
  80 #define ENV_RTM_BUS_ID                          7
  81 #define ENV_RTM_SLAVE_ADDR                      0xa0
  82 #define ENV_RTM_READ_SIZE                       0xa
  83 
  84 /* global enables data */
  85 #define ENV_IPMI_ENABLE_MASK                    0x10
  86 #define ENV_IPMI_DISABLE_MASK                   0xef
  87 #define ENV_SENSOR_ENABLE_MASK                  0xfb
  88 #define ENV_SENSOR_DISABLE_MASK                 0x04
  89 
  90 #ifdef  __cplusplus
  91 }
  92 #endif
  93 
  94 #endif  /* _PICLDR_H */