1*29949e86Sstevel /* 2*29949e86Sstevel * CDDL HEADER START 3*29949e86Sstevel * 4*29949e86Sstevel * The contents of this file are subject to the terms of the 5*29949e86Sstevel * Common Development and Distribution License (the "License"). 6*29949e86Sstevel * You may not use this file except in compliance with the License. 7*29949e86Sstevel * 8*29949e86Sstevel * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*29949e86Sstevel * or http://www.opensolaris.org/os/licensing. 10*29949e86Sstevel * See the License for the specific language governing permissions 11*29949e86Sstevel * and limitations under the License. 12*29949e86Sstevel * 13*29949e86Sstevel * When distributing Covered Code, include this CDDL HEADER in each 14*29949e86Sstevel * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*29949e86Sstevel * If applicable, add the following below this CDDL HEADER, with the 16*29949e86Sstevel * fields enclosed by brackets "[]" replaced with your own identifying 17*29949e86Sstevel * information: Portions Copyright [yyyy] [name of copyright owner] 18*29949e86Sstevel * 19*29949e86Sstevel * CDDL HEADER END 20*29949e86Sstevel */ 21*29949e86Sstevel 22*29949e86Sstevel /* 23*29949e86Sstevel * Copyright 1998 Sun Microsystems, Inc. All rights reserved. 24*29949e86Sstevel * Use is subject to license terms. 25*29949e86Sstevel */ 26*29949e86Sstevel 27*29949e86Sstevel #ifndef _SYS_ENVCTRL_UE450_H 28*29949e86Sstevel #define _SYS_ENVCTRL_UE450_H 29*29949e86Sstevel 30*29949e86Sstevel #pragma ident "%Z%%M% %I% %E% SMI" 31*29949e86Sstevel 32*29949e86Sstevel #ifdef __cplusplus 33*29949e86Sstevel extern "C" { 34*29949e86Sstevel #endif 35*29949e86Sstevel 36*29949e86Sstevel /* 37*29949e86Sstevel * envctrl_ue450.h 38*29949e86Sstevel * 39*29949e86Sstevel * This header file contains environmental control definitions specific 40*29949e86Sstevel * to the UltraEnterprise-450 (aka. Ultra-4) platform. 41*29949e86Sstevel */ 42*29949e86Sstevel 43*29949e86Sstevel #define OVERTEMP_TIMEOUT_USEC 60 * MICROSEC 44*29949e86Sstevel #define BLINK_TIMEOUT_USEC 500 * (MICROSEC / MILLISEC) 45*29949e86Sstevel 46*29949e86Sstevel #define MAX_TAZ_CONTROLLERS 0x02 47*29949e86Sstevel #define ENVCTRL_TAZCPU_STRING "SUNW,UltraSPARC" 48*29949e86Sstevel #define ENVCTRL_TAZBLKBRDCPU_STRING "SUNW,UltraSPARC-II" 49*29949e86Sstevel 50*29949e86Sstevel /* 51*29949e86Sstevel * MACROS 52*29949e86Sstevel */ 53*29949e86Sstevel 54*29949e86Sstevel #define S1 &unitp->bus_ctl_regs->s1 55*29949e86Sstevel #define S0 &unitp->bus_ctl_regs->s0 56*29949e86Sstevel 57*29949e86Sstevel /* 58*29949e86Sstevel * I2c Sensor Types 59*29949e86Sstevel */ 60*29949e86Sstevel 61*29949e86Sstevel #define PCD8584 0x00 /* Bus Controller Master */ 62*29949e86Sstevel #define PCF8591 0x01 /* Temp Sensor 8bit A/D, D/A */ 63*29949e86Sstevel #define PCF8574 0x02 /* PS, FAN, LED, Fail and Control */ 64*29949e86Sstevel #define TDA8444T 0x03 /* Fan Speed Control, 8 bit D/A */ 65*29949e86Sstevel #define PCF8574A 0x04 /* 8574A chip */ 66*29949e86Sstevel #define PCF8583 0x05 /* PCF8583 clock chip */ 67*29949e86Sstevel 68*29949e86Sstevel /* 69*29949e86Sstevel * Max number of a particular 70*29949e86Sstevel * device on 1 bus. 71*29949e86Sstevel */ 72*29949e86Sstevel #define MAX_DEVS 0x10 73*29949e86Sstevel #define I2C_NODEV 0xFF 74*29949e86Sstevel #define MIN_FAN_BANKS 0x02 75*29949e86Sstevel #define INSTANCE_0 0x00 76*29949e86Sstevel 77*29949e86Sstevel /* 78*29949e86Sstevel * Defines for the PCF8583 Clock Calendar Chip 79*29949e86Sstevel * We use this chip as a watchdog timer for the fans 80*29949e86Sstevel * should the kernel thread controling the fans get 81*29949e86Sstevel * wedged. If it does, the alarm wil go off and 82*29949e86Sstevel * set the fans to max speed. 83*29949e86Sstevel * Valid addresses for this chip are A0, A2. 84*29949e86Sstevel * We use the address at A0. 85*29949e86Sstevel * To address this chip the format is as folows (write mode) 86*29949e86Sstevel * | SLaveaddress |MEMORY LOCATION| DATA| 87*29949e86Sstevel * Wgere memory location is the internal location from 88*29949e86Sstevel * 0x00 - 0x0F. 0x00 is the CSR and MUST be addressed 89*29949e86Sstevel * directly. 90*29949e86Sstevel */ 91*29949e86Sstevel 92*29949e86Sstevel #define PCF8583_BASE_ADDR 0xA0 93*29949e86Sstevel #define PCF8583_READ_BIT 0x01 94*29949e86Sstevel 95*29949e86Sstevel #define CLOCK_CSR_REG 0x00 96*29949e86Sstevel 97*29949e86Sstevel #define ALARM_CTRL_REG 0x07 98*29949e86Sstevel #define EGG_TIMER_VAL 0x96 99*29949e86Sstevel #define DIAG_MAX_TIMER_VAL 0x00 100*29949e86Sstevel #define MAX_CL_VAL 59 101*29949e86Sstevel #define MIN_DIAG_TEMPR 0x00 102*29949e86Sstevel #define MAX_DIAG_TEMPR 70 103*29949e86Sstevel #define MAX_AMB_TEMP 50 104*29949e86Sstevel #define MAX_CPU_TEMP 80 105*29949e86Sstevel #define MAX_PS_TEMP 100 106*29949e86Sstevel #define MAX_PS_ADVAL 0xfd 107*29949e86Sstevel #define PS_DEFAULT_VAL 17 /* corresponds to 90 C in lookup table */ 108*29949e86Sstevel #define PS_TEMP_WARN 95 109*29949e86Sstevel #define CPU_AMB_RISE 20 /* cpu runs avg of 20 above amb */ 110*29949e86Sstevel #define PS_AMB_RISE 30 /* cpu runs avg of 30 above amb */ 111*29949e86Sstevel 112*29949e86Sstevel #define CLOCK_ALARM_REG_A 0x08 113*29949e86Sstevel #define CLOCK_ENABLE_TIMER 0xCB 114*29949e86Sstevel #define CLOCK_ENABLE_TIMER_S 0xCA 115*29949e86Sstevel 116*29949e86Sstevel #define CLOCK_DISABLE 0xA0 117*29949e86Sstevel #define CLOCK_ENABLE 0x04 118*29949e86Sstevel 119*29949e86Sstevel /* Keyswitch Definitions */ 120*29949e86Sstevel #define ENVCTRL_FSP_KEYMASK 0xC0 121*29949e86Sstevel #define ENVCTRL_FSP_POMASK 0x20 122*29949e86Sstevel #define ENVCTRL_FSP_KEYLOCKED 0x00 123*29949e86Sstevel #define ENVCTRL_FSP_KEYOFF 0x40 124*29949e86Sstevel #define ENVCTRL_FSP_KEYDIAG 0x80 125*29949e86Sstevel #define ENVCTRL_FSP_KEYON 0xC0 126*29949e86Sstevel 127*29949e86Sstevel /* Front Status Panel Definitions */ 128*29949e86Sstevel #define ENVCTRL_FSP_DISK_ERR 0x01 129*29949e86Sstevel #define ENVCTRL_FSP_PS_ERR 0x02 130*29949e86Sstevel #define ENVCTRL_FSP_TEMP_ERR 0x04 131*29949e86Sstevel #define ENVCTRL_FSP_GEN_ERR 0x08 132*29949e86Sstevel #define ENVCTRL_FSP_ACTIVE 0x10 133*29949e86Sstevel #define ENVCTRL_FSP_POWER 0x20 134*29949e86Sstevel #define ENVCTRL_FSP_USRMASK (ENVCTRL_FSP_DISK_ERR | ENVCTRL_FSP_GEN_ERR) 135*29949e86Sstevel 136*29949e86Sstevel #define ENVCTRL_ENCL_FSP 0x00 137*29949e86Sstevel #define ENVCTRL_ENCL_AMBTEMPR 0x01 138*29949e86Sstevel #define ENVCTRL_ENCL_CPUTEMPR 0x02 139*29949e86Sstevel #define ENVCTRL_ENCL_BACKPLANE4 0x03 140*29949e86Sstevel #define ENVCTRL_ENCL_BACKPLANE8 0x04 141*29949e86Sstevel 142*29949e86Sstevel #define ENVCTRL_FSP_OFF 0x4F 143*29949e86Sstevel 144*29949e86Sstevel /* 145*29949e86Sstevel * configuration registers 146*29949e86Sstevel * Register S1 Looks like the following: 147*29949e86Sstevel * WRITE MODE ONLY 148*29949e86Sstevel * 149*29949e86Sstevel * MSB -------------------------------------> LSB 150*29949e86Sstevel * ---------------------------------------------- 151*29949e86Sstevel * | X | ESO | ES1 | ES2 | ENI | STA | STO | ACK | 152*29949e86Sstevel * ---------------------------------------------- 153*29949e86Sstevel * Low order bits 154*29949e86Sstevel */ 155*29949e86Sstevel 156*29949e86Sstevel #define CSRS1_ENI 0x08 /* Enable interrupts */ 157*29949e86Sstevel #define CSRS1_STA 0x04 /* Packet Start */ 158*29949e86Sstevel #define CSRS1_STO 0x02 /* Packet Stop */ 159*29949e86Sstevel #define CSRS1_ACK 0x01 /* Packet ACK */ 160*29949e86Sstevel 161*29949e86Sstevel /* Hight order bits */ 162*29949e86Sstevel #define CSRS1_PIN 0x80 /* READ and WRITE mode Enable Serial Output */ 163*29949e86Sstevel #define CSRS1_ESO 0x40 /* Enable Serial Output */ 164*29949e86Sstevel #define CSRS1_ES1 0x20 165*29949e86Sstevel #define CSRS1_ES2 0x10 166*29949e86Sstevel 167*29949e86Sstevel /* 168*29949e86Sstevel * configuration registers 169*29949e86Sstevel * Register S1 Looks like the following: 170*29949e86Sstevel * READ MODE ONLY 171*29949e86Sstevel * 172*29949e86Sstevel * MSB -------------------------------------> LSB 173*29949e86Sstevel * ---------------------------------------------- 174*29949e86Sstevel * | PIN | 0 | STS | BER | AD0/LRB | AAS | LAB | BB| 175*29949e86Sstevel * ---------------------------------------------- 176*29949e86Sstevel */ 177*29949e86Sstevel 178*29949e86Sstevel #define CSRS1_STS 0x20 /* For Slave receiv mode stop */ 179*29949e86Sstevel #define CSRS1_BER 0x10 /* Bus Error */ 180*29949e86Sstevel 181*29949e86Sstevel #define CSRS1_LRB 0x08 /* Last Received Bit */ 182*29949e86Sstevel #define CSRS1_AAS 0x04 /* Addressed as Slave */ 183*29949e86Sstevel #define CSRS1_LAB 0x02 /* Lost Arbitration Bit */ 184*29949e86Sstevel #define CSRS1_BB 0x01 /* Bus Busy */ 185*29949e86Sstevel 186*29949e86Sstevel #define START CSRS1_PIN | CSRS1_ESO | CSRS1_STA | CSRS1_ACK 187*29949e86Sstevel #define STOP CSRS1_PIN | CSRS1_ESO | CSRS1_STO | CSRS1_ACK 188*29949e86Sstevel /* 189*29949e86Sstevel * A read wants to have an NACK on the bus to stop 190*29949e86Sstevel * transmitting data from the slave. If you don't 191*29949e86Sstevel * NACK the SDA line will get stuck low. After this you 192*29949e86Sstevel * can send the stop with the ack. 193*29949e86Sstevel */ 194*29949e86Sstevel #define NACK CSRS1_PIN | CSRS1_ESO 195*29949e86Sstevel 196*29949e86Sstevel /* 197*29949e86Sstevel * ESO = Enable Serial output 198*29949e86Sstevel * ES1 and ES2 have different meanings based upon ES0. 199*29949e86Sstevel * The following table explains this association. 200*29949e86Sstevel * 201*29949e86Sstevel * ES0 = 0 = serial interface off. 202*29949e86Sstevel * --------------------------------------------------------- 203*29949e86Sstevel * | A0 | ES1 | ES1 | iACK | OPERATION 204*29949e86Sstevel * --------------------------------------------------------- 205*29949e86Sstevel * | H | X | X | X | Read/write CSR1 (S1) Status n/a 206*29949e86Sstevel * | | | | | 207*29949e86Sstevel * | L | 0 | 0 | X | R/W Own Address S0' 208*29949e86Sstevel * | | | | | 209*29949e86Sstevel * | L | 0 | 1 | X | R/W Intr Vector S3 210*29949e86Sstevel * | | | | | 211*29949e86Sstevel * | L | 1 | 0 | X | R/W Clock Register S2 212*29949e86Sstevel * --------------------------------------------------------- 213*29949e86Sstevel * 214*29949e86Sstevel * ES0 = 1 = serial interface ON. 215*29949e86Sstevel * --------------------------------------------------------- 216*29949e86Sstevel * | A0 | ES1 | ES1 | iACK | OPERATION 217*29949e86Sstevel * --------------------------------------------------------- 218*29949e86Sstevel * | H | X | X | H | Write Control Register (S1) 219*29949e86Sstevel * | | | | | 220*29949e86Sstevel * | H | X | X | H | Read Status Register (S1) 221*29949e86Sstevel * | | | | | 222*29949e86Sstevel * | L | X | 0 | H | R/W Data Register (S0) 223*29949e86Sstevel * | | | | | 224*29949e86Sstevel * | L | X | 1 | H | R/W Interrupt Vector (S3) 225*29949e86Sstevel * | | | | | 226*29949e86Sstevel * | X | 0 | X | L | R Interrupt Vector (S3) ack cycle 227*29949e86Sstevel * | | | | | 228*29949e86Sstevel * | X | 1 | X | L | long distance mode 229*29949e86Sstevel * --------------------------------------------------------- 230*29949e86Sstevel * 231*29949e86Sstevel */ 232*29949e86Sstevel 233*29949e86Sstevel #ifdef TESTBED 234*29949e86Sstevel struct envctrl_pcd8584_regs { 235*29949e86Sstevel uchar_t s0; /* Own Address S0' */ 236*29949e86Sstevel uchar_t pad[3]; /* Padding XXX Will go away in FCS */ 237*29949e86Sstevel uchar_t s1; /* Control Status register */ 238*29949e86Sstevel uchar_t pad1[3]; 239*29949e86Sstevel uchar_t clock_s2; /* Clock programming register */ 240*29949e86Sstevel }; 241*29949e86Sstevel #else 242*29949e86Sstevel struct envctrl_pcd8584_regs { 243*29949e86Sstevel uchar_t s0; /* Own Address S0' */ 244*29949e86Sstevel uchar_t s1; /* Control Status register */ 245*29949e86Sstevel uchar_t clock_s2; /* Clock programming register */ 246*29949e86Sstevel }; 247*29949e86Sstevel #endif 248*29949e86Sstevel #define ENVCTRL_BUS_INIT0 0x80 249*29949e86Sstevel #define ENVCTRL_BUS_INIT1 0x55 250*29949e86Sstevel #define ENVCTRL_BUS_CLOCK0 0xA0 251*29949e86Sstevel #define ENVCTRL_BUS_CLOCK1 0x1C 252*29949e86Sstevel #define ENVCTRL_BUS_ESI 0xC1 253*29949e86Sstevel 254*29949e86Sstevel 255*29949e86Sstevel /* 256*29949e86Sstevel * PCF8591 Chip Used for temperature sensors 257*29949e86Sstevel * 258*29949e86Sstevel * Check with bob to see if singled ended inputs are true 259*29949e86Sstevel * for the pcf8591 temp sensors.. 260*29949e86Sstevel * 261*29949e86Sstevel * Addressing Register definition. 262*29949e86Sstevel * A0-A2 valid range is 0-7 263*29949e86Sstevel * 264*29949e86Sstevel * 7 6 5 4 3 2 1 0 265*29949e86Sstevel * ------------------------------------------------ 266*29949e86Sstevel * | 1 | 0 | 0 | 1 | A2 | A1 | A0 | R/W | 267*29949e86Sstevel * ------------------------------------------------ 268*29949e86Sstevel */ 269*29949e86Sstevel 270*29949e86Sstevel 271*29949e86Sstevel #define PCF8591_BASE_ADDR 0x90 272*29949e86Sstevel #define PCF8501_MAX_DEVS 0x08 273*29949e86Sstevel 274*29949e86Sstevel #define MAXPS 0x02 /* 0 based array */ 275*29949e86Sstevel 276*29949e86Sstevel #define PSTEMP0 0x00 /* DUMMY PS */ 277*29949e86Sstevel #define PSTEMP1 0x94 278*29949e86Sstevel #define PSTEMP2 0x92 279*29949e86Sstevel #define PSTEMP3 0x90 280*29949e86Sstevel #define ENVCTRL_CPU_PCF8591_ADDR (PCF8591_BASE_ADDR | PCF8591_DEV7) 281*29949e86Sstevel 282*29949e86Sstevel #define PCF8591_DEV0 0x00 283*29949e86Sstevel #define PCF8591_DEV1 0x02 284*29949e86Sstevel #define PCF8591_DEV2 0x04 285*29949e86Sstevel #define PCF8591_DEV3 0x06 286*29949e86Sstevel #define PCF8591_DEV4 0x08 287*29949e86Sstevel #define PCF8591_DEV5 0x0A 288*29949e86Sstevel #define PCF8591_DEV6 0x0C 289*29949e86Sstevel #define PCF8591_DEV7 0x0E 290*29949e86Sstevel 291*29949e86Sstevel 292*29949e86Sstevel /* 293*29949e86Sstevel * For the LM75 thermal watchdog chip by TI 294*29949e86Sstevel */ 295*29949e86Sstevel 296*29949e86Sstevel #define LM75_BASE_ADDR 0x9A 297*29949e86Sstevel #define LM75_READ_BIT 0x01 298*29949e86Sstevel #define LM75_CONFIG_ADDR2 0x02 299*29949e86Sstevel #define LM75_CONFIG_ADDR4 0x04 300*29949e86Sstevel #define LM75_CONFIG_ADDR6 0x06 301*29949e86Sstevel #define LM75_CONFIG_ADDR8 0x08 302*29949e86Sstevel #define LM75_CONFIG_ADDRA 0x0A 303*29949e86Sstevel #define LM75_CONFIG_ADDRC 0x0C 304*29949e86Sstevel #define LM75_CONFIG_ADDRE 0x0E 305*29949e86Sstevel #define LM75_COMP_MASK 0x100 306*29949e86Sstevel #define LM75_COMP_MASK_UPPER 0xFF 307*29949e86Sstevel 308*29949e86Sstevel /* 309*29949e86Sstevel * CONTROL OF CHIP 310*29949e86Sstevel * PCF8591 Temp sensing control register definitions 311*29949e86Sstevel * 312*29949e86Sstevel * 7 6 5 4 3 2 1 0 313*29949e86Sstevel * --------------------------------------------- 314*29949e86Sstevel * | 0 | AOE | X | X | 0 | AIF | X | X | 315*29949e86Sstevel * --------------------------------------------- 316*29949e86Sstevel * AOE = Analog out enable.. not used on out implementation 317*29949e86Sstevel * 5 & 4 = Analog Input Programming.. see data sheet for bits.. 318*29949e86Sstevel * 319*29949e86Sstevel * AIF = Auto increment flag 320*29949e86Sstevel * bits 1 & 0 are for the Chennel number. 321*29949e86Sstevel */ 322*29949e86Sstevel 323*29949e86Sstevel #define PCF8591_ANALOG_OUTPUT_EN 0x40 324*29949e86Sstevel #define PCF8591_ANALOG_INPUT_EN 0x00 325*29949e86Sstevel #define PCF8591_READ_BIT 0x01 326*29949e86Sstevel 327*29949e86Sstevel 328*29949e86Sstevel #define PCF8591_AUTO_INCR 0x04 329*29949e86Sstevel #define PCF8591_OSCILATOR 0x40 330*29949e86Sstevel 331*29949e86Sstevel #define PCF8591_MAX_PORTS 0x04 332*29949e86Sstevel 333*29949e86Sstevel #define PCF8591_CH_0 0x00 334*29949e86Sstevel #define PCF8591_CH_1 0x01 335*29949e86Sstevel #define PCF8591_CH_2 0x02 336*29949e86Sstevel #define PCF8591_CH_3 0x03 337*29949e86Sstevel 338*29949e86Sstevel struct envctrl_pcf8591_chip { 339*29949e86Sstevel uchar_t chip_num; /* valid values are 0-7 */ 340*29949e86Sstevel int type; /* type is PCF8591 */ 341*29949e86Sstevel uchar_t sensor_num; /* AIN0, AIN1, AIN2 AIN3 */ 342*29949e86Sstevel uchar_t temp_val; /* value of temp probe */ 343*29949e86Sstevel }; 344*29949e86Sstevel 345*29949e86Sstevel 346*29949e86Sstevel /* 347*29949e86Sstevel * PCF8574 Fan Fail, Power Supply Fail Detector 348*29949e86Sstevel * This device is driven by interrupts. Each time it interrupts 349*29949e86Sstevel * you must look at the CSR to see which ports caused the interrupt 350*29949e86Sstevel * they are indicated by a 1. 351*29949e86Sstevel * 352*29949e86Sstevel * Address map of this chip 353*29949e86Sstevel * 354*29949e86Sstevel * ------------------------------------------- 355*29949e86Sstevel * | 0 | 1 | 1 | 1 | A2 | A1 | A0 | 0 | 356*29949e86Sstevel * ------------------------------------------- 357*29949e86Sstevel * 358*29949e86Sstevel */ 359*29949e86Sstevel 360*29949e86Sstevel #define PCF8574A_BASE_ADDR 0x70 361*29949e86Sstevel #define PCF8574_BASE_ADDR 0x40 362*29949e86Sstevel 363*29949e86Sstevel #define PCF8574_READ_BIT 0x01 364*29949e86Sstevel 365*29949e86Sstevel #define ENVCTRL_PCF8574_DEV0 0x00 366*29949e86Sstevel #define ENVCTRL_PCF8574_DEV1 0x02 367*29949e86Sstevel #define ENVCTRL_PCF8574_DEV2 0x04 368*29949e86Sstevel #define ENVCTRL_PCF8574_DEV3 0x06 369*29949e86Sstevel #define ENVCTRL_PCF8574_DEV4 0x08 370*29949e86Sstevel #define ENVCTRL_PCF8574_DEV5 0x0A 371*29949e86Sstevel #define ENVCTRL_PCF8574_DEV6 0x0C 372*29949e86Sstevel #define ENVCTRL_PCF8574_DEV7 0x0E 373*29949e86Sstevel #define ENVCTRL_INTR_CHIP PCF8574_DEV7 374*29949e86Sstevel 375*29949e86Sstevel #define PS1 PCF8574A_BASE_ADDR | ENVCTRL_PCF8574_DEV3 376*29949e86Sstevel #define PS2 PCF8574A_BASE_ADDR | ENVCTRL_PCF8574_DEV2 377*29949e86Sstevel #define PS3 PCF8574A_BASE_ADDR | ENVCTRL_PCF8574_DEV1 378*29949e86Sstevel 379*29949e86Sstevel #define ENVCTRL_PCF8574_PORT0 0x01 380*29949e86Sstevel #define ENVCTRL_PCF8574_PORT1 0x02 381*29949e86Sstevel #define ENVCTRL_PCF8574_PORT2 0x04 382*29949e86Sstevel #define ENVCTRL_PCF8574_PORT3 0x08 383*29949e86Sstevel #define ENVCTRL_PCF8574_PORT4 0x10 384*29949e86Sstevel #define ENVCTRL_PCF8574_PORT5 0x20 385*29949e86Sstevel #define ENVCTRL_PCF8574_PORT6 0x40 386*29949e86Sstevel #define ENVCTRL_PCF8574_PORT7 0x80 387*29949e86Sstevel 388*29949e86Sstevel #define ENVCTRL_DFLOP_INIT0 0x77 389*29949e86Sstevel #define ENVCTRL_DFLOP_INIT1 0x7F 390*29949e86Sstevel 391*29949e86Sstevel #define ENVCTRL_DEVINTR_INTI0 0xF7 392*29949e86Sstevel #define ENVCTRL_DEVINTR_INTI1 0xFF 393*29949e86Sstevel 394*29949e86Sstevel #define CPU_FAN_1 0x01 395*29949e86Sstevel #define CPU_FAN_2 0x02 396*29949e86Sstevel #define CPU_FAN_3 0x03 397*29949e86Sstevel 398*29949e86Sstevel #define PS_FAN_1 CPU_FAN_1 399*29949e86Sstevel #define PS_FAN_2 CPU_FAN_2 400*29949e86Sstevel #define PS_FAN_3 CPU_FAN_3 401*29949e86Sstevel 402*29949e86Sstevel #define AFB_FAN_1 0x00 403*29949e86Sstevel 404*29949e86Sstevel struct envctrl_pcf8574_chip { 405*29949e86Sstevel uchar_t chip_num; /* valid values are 0-7 */ 406*29949e86Sstevel int type; /* type is PCF8574 */ 407*29949e86Sstevel uint_t val; 408*29949e86Sstevel }; 409*29949e86Sstevel 410*29949e86Sstevel 411*29949e86Sstevel /* 412*29949e86Sstevel * TDA8444T chip structure 413*29949e86Sstevel * FAN Speed Control 414*29949e86Sstevel */ 415*29949e86Sstevel 416*29949e86Sstevel /* ADDRESSING */ 417*29949e86Sstevel 418*29949e86Sstevel #define TDA8444T_BASE_ADDR 0x40 419*29949e86Sstevel 420*29949e86Sstevel 421*29949e86Sstevel #define ENVCTRL_TDA8444T_DEV0 0x00 422*29949e86Sstevel #define ENVCTRL_TDA8444T_DEV1 0x02 423*29949e86Sstevel #define ENVCTRL_TDA8444T_DEV2 0x04 424*29949e86Sstevel #define ENVCTRL_TDA8444T_DEV3 0x06 425*29949e86Sstevel #define ENVCTRL_TDA8444T_DEV4 0x08 426*29949e86Sstevel #define ENVCTRL_TDA8444T_DEV5 0x0A 427*29949e86Sstevel #define ENVCTRL_TDA8444T_DEV6 0x0C 428*29949e86Sstevel #define ENVCTRL_TDA8444T_DEV7 0x0E 429*29949e86Sstevel 430*29949e86Sstevel #define ENVCTRL_FAN_ADDR_MIN ENVCTRL_TDA8444T_DEV0 431*29949e86Sstevel #define ENVCTRL_FAN_ADDR_MAX ENVCTRL_TDA8444T_DEV7 432*29949e86Sstevel 433*29949e86Sstevel /* Control information and port addressing */ 434*29949e86Sstevel 435*29949e86Sstevel #define NO_AUTO_PORT_INCR 0xF0 436*29949e86Sstevel #define AUTO_PORT_INCR 0x00 437*29949e86Sstevel #define TDA8444T_READ_BIT 0x01 438*29949e86Sstevel 439*29949e86Sstevel #define ENVCTRL_CPU_FANS 0x00 440*29949e86Sstevel #define ENVCTRL_PS_FANS 0x01 441*29949e86Sstevel #define ENVCTRL_AFB_FANS 0x02 442*29949e86Sstevel 443*29949e86Sstevel #define MAX_FAN_SPEED 0x3f 444*29949e86Sstevel #define MIN_FAN_VAL 0x00 445*29949e86Sstevel #define MAX_FAN_VAL 0x3f 446*29949e86Sstevel #define AFB_MAX 0x3f 447*29949e86Sstevel #define AFB_MIN 0x1d 448*29949e86Sstevel 449*29949e86Sstevel struct envctrl_tda8444t_chip { 450*29949e86Sstevel uchar_t chip_num; /* valid values are 0-7 */ 451*29949e86Sstevel int type; /* type is TDA8444T */ 452*29949e86Sstevel uchar_t fan_num; /* Ao0-Ao7 */ 453*29949e86Sstevel uchar_t val; /* for fan speed */ 454*29949e86Sstevel }; 455*29949e86Sstevel 456*29949e86Sstevel /* 457*29949e86Sstevel * This table converts an A/D value from the cpu thermistor to a 458*29949e86Sstevel * temperature in degrees C. Usable range is typically 35-135. 459*29949e86Sstevel */ 460*29949e86Sstevel 461*29949e86Sstevel static short cpu_temps[] = { 462*29949e86Sstevel 150, 150, 150, 150, 150, 150, 150, 150, /* 0-7 */ 463*29949e86Sstevel 150, 150, 150, 150, 150, 150, 150, 150, /* 8-15 */ 464*29949e86Sstevel 150, 150, 150, 150, 150, 150, 150, 150, /* 16-23 */ 465*29949e86Sstevel 150, 150, 150, 148, 146, 144, 143, 142, /* 24-31 */ 466*29949e86Sstevel 141, 140, 138, 136, 135, 134, 133, 132, /* 32-39 */ 467*29949e86Sstevel 131, 130, 129, 128, 127, 126, 125, 124, /* 40-47 */ 468*29949e86Sstevel 123, 122, 121, 121, 120, 120, 119, 118, /* 48-55 */ 469*29949e86Sstevel 117, 116, 115, 114, 113, 112, 112, 111, /* 56-63 */ 470*29949e86Sstevel 111, 110, 110, 110, 109, 109, 108, 107, /* 64-71 */ 471*29949e86Sstevel 106, 106, 105, 105, 104, 103, 102, 101, /* 72-79 */ 472*29949e86Sstevel 101, 100, 100, 100, 99, 99, 98, 98, /* 80-87 */ 473*29949e86Sstevel 97, 97, 96, 96, 95, 95, 94, 94, /* 88-95 */ 474*29949e86Sstevel 93, 93, 92, 92, 91, 91, 91, 90, /* 96-103 */ 475*29949e86Sstevel 90, 90, 89, 89, 88, 88, 87, 87, /* 104-111 */ 476*29949e86Sstevel 86, 86, 85, 85, 84, 84, 83, 83, /* 112-119 */ 477*29949e86Sstevel 82, 82, 82, 81, 81, 80, 80, 80, /* 120-127 */ 478*29949e86Sstevel 80, 79, 79, 79, 78, 78, 78, 77, /* 128-135 */ 479*29949e86Sstevel 77, 77, 76, 76, 76, 75, 75, 75, /* 136-143 */ 480*29949e86Sstevel 74, 74, 74, 73, 73, 73, 72, 72, /* 144-151 */ 481*29949e86Sstevel 72, 71, 71, 71, 70, 70, 70, 70, /* 142-159 */ 482*29949e86Sstevel 69, 69, 69, 68, 68, 68, 68, 67, /* 160-167 */ 483*29949e86Sstevel 67, 67, 67, 66, 66, 66, 66, 65, /* 168-175 */ 484*29949e86Sstevel 65, 65, 64, 64, 64, 63, 63, 63, /* 176-183 */ 485*29949e86Sstevel 62, 62, 62, 61, 61, 61, 61, 60, /* 184-191 */ 486*29949e86Sstevel 60, 60, 60, 59, 59, 59, 58, 58, /* 192-199 */ 487*29949e86Sstevel 58, 57, 57, 57, 56, 56, 56, 56, /* 200-207 */ 488*29949e86Sstevel 55, 55, 55, 55, 54, 54, 54, 53, /* 208-215 */ 489*29949e86Sstevel 53, 53, 52, 52, 52, 51, 51, 51, /* 216-223 */ 490*29949e86Sstevel 51, 50, 50, 50, 49, 49, 49, 48, /* 224-231 */ 491*29949e86Sstevel 48, 48, 47, 47, 47, 46, 46, 46, /* 232-239 */ 492*29949e86Sstevel 45, 45, 45, 44, 44, 44, 43, 43, /* 240-247 */ 493*29949e86Sstevel 43, 42, 42, 42, 41, 41, 41, 40, /* 248-255 */ 494*29949e86Sstevel 40, /* 256 */ 495*29949e86Sstevel }; 496*29949e86Sstevel 497*29949e86Sstevel static short ps_temps[] = { 498*29949e86Sstevel 160, 155, 154, 150, 130, 125, 120, 115, /* 0-7 */ 499*29949e86Sstevel 110, 110, 106, 103, 101, 100, 97, 94, /* 8-15 */ 500*29949e86Sstevel 92, 90, 88, 86, 84, 83, 82, 81, /* 16-23 */ 501*29949e86Sstevel 80, 79, 78, 77, 76, 74, 72, 71, /* 24-31 */ 502*29949e86Sstevel 70, 69, 68, 67, 66, 65, 64, 63, /* 32-39 */ 503*29949e86Sstevel 62, 62, 61, 61, 60, 60, 60, 59, /* 40-47 */ 504*29949e86Sstevel 59, 58, 58, 57, 56, 56, 55, 55, /* 48-55 */ 505*29949e86Sstevel 54, 54, 53, 53, 52, 52, 51, 51, /* 56-63 */ 506*29949e86Sstevel 50, 50, 50, 49, 49, 49, 49, 48, /* 64-71 */ 507*29949e86Sstevel 48, 48, 48, 47, 47, 47, 47, 46, /* 72-79 */ 508*29949e86Sstevel 46, 46, 45, 44, 43, 42, 41, 41, /* 80-87 */ 509*29949e86Sstevel 40, 40, 40, 40, 39, 39, 39, 38, /* 88-95 */ 510*29949e86Sstevel 38, 38, 37, 37, 36, 36, 36, 35, /* 96-103 */ 511*29949e86Sstevel 35, 35, 35, 34, 34, 34, 33, 33, /* 104-111 */ 512*29949e86Sstevel 32, 32, 32, 32, 32, 32, 31, 31, /* 112-119 */ 513*29949e86Sstevel 31, 31, 31, 30, 30, 30, 29, 29, /* 120-127 */ 514*29949e86Sstevel 29, 29, 29, 29, 28, 28, 28, 28, /* 128-135 */ 515*29949e86Sstevel 28, 28, 27, 27, 27, 27, 27, 26, /* 136-143 */ 516*29949e86Sstevel 26, 26, 26, 26, 26, 26, 26, 26, /* 144-151 */ 517*29949e86Sstevel 25, 25, 25, 25, 24, 24, 23, 23, /* 142-159 */ 518*29949e86Sstevel 22, 22, 21, 21, 21, 21, 21, 21, /* 160-167 */ 519*29949e86Sstevel 20, 20, 20, 20, 19, 19, 19, 19, /* 168-175 */ 520*29949e86Sstevel 19, 18, 18, 18, 18, 18, 17, 17, /* 176-183 */ 521*29949e86Sstevel 17, 17, 17, 16, 16, 16, 16, 15, /* 184-191 */ 522*29949e86Sstevel 15, 15, 15, 15, 15, 14, 14, 14, /* 192-199 */ 523*29949e86Sstevel 14, 14, 13, 13, 13, 13, 12, 12, /* 200-207 */ 524*29949e86Sstevel 12, 12, 12, 11, 11, 11, 11, 11, /* 208-215 */ 525*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 216-223 */ 526*29949e86Sstevel 9, 9, 9, 9, 9, 9, 8, 8, /* 224-231 */ 527*29949e86Sstevel 8, 8, 8, 7, 7, 7, 7, 7, /* 232-239 */ 528*29949e86Sstevel 7, 6, 6, 6, 6, 6, 6, 6, /* 240-247 */ 529*29949e86Sstevel 5, 5, 5, 5, 5, 5, 5, 4, /* 248-255 */ 530*29949e86Sstevel 4, /* 256 */ 531*29949e86Sstevel }; 532*29949e86Sstevel 533*29949e86Sstevel /* 534*29949e86Sstevel * This is the lookup table used for P1 and FCS systems to convert a temperature 535*29949e86Sstevel * to a fanspeed for the CPU side of the machine. 536*29949e86Sstevel */ 537*29949e86Sstevel 538*29949e86Sstevel static short acme_cpu_fanspd[] = { 539*29949e86Sstevel 31, 31, 31, 31, 31, 31, 31, 31, /* 0-7 */ 540*29949e86Sstevel 31, 31, 31, 31, 31, 31, 31, 31, /* 8-15 */ 541*29949e86Sstevel 31, 31, 31, 31, 31, 31, 31, 31, /* 16-23 */ 542*29949e86Sstevel 31, 31, 31, 31, 32, 33, 34, 35, /* 24-31 */ 543*29949e86Sstevel 36, 37, 38, 39, 40, 42, 43, 45, /* 32-39 */ 544*29949e86Sstevel 48, 49, 50, 51, 52, 53, 54, 55, /* 40-47 */ 545*29949e86Sstevel 56, 57, 58, 59, 60, 61, 62, 63, /* 48-55 */ 546*29949e86Sstevel 63, 63, 63, 63, 63, 63, 63, 63, /* 56-63 */ 547*29949e86Sstevel 63, 63, 63, 63, 63, 63, 63, 63, /* 64-71 */ 548*29949e86Sstevel 63, 63, 63, 63, 63, 63, 63, 63, /* 72-79 */ 549*29949e86Sstevel 63, 63, 63, 63, 63, 63, 63, 63, /* 80-87 */ 550*29949e86Sstevel 63, 63, 63, 63, 63, 63, 63, 63, /* 88-95 */ 551*29949e86Sstevel 63, 63, 63, 63, 63, 63, 63, 63, /* 96-103 */ 552*29949e86Sstevel 63, 63, 63, 63, 63, 63, 63, 63, /* 104-111 */ 553*29949e86Sstevel }; 554*29949e86Sstevel 555*29949e86Sstevel /* 556*29949e86Sstevel * This is the lookup table used for P1 and FCS systems to convert a temperature 557*29949e86Sstevel * to a fanspeed for the CPU side of the machine. 558*29949e86Sstevel */ 559*29949e86Sstevel 560*29949e86Sstevel static short acme_ps_fanspd[] = { 561*29949e86Sstevel 31, 31, 31, 31, 31, 31, 31, 31, /* 0-7 */ 562*29949e86Sstevel 31, 31, 31, 31, 31, 31, 31, 31, /* 8-15 */ 563*29949e86Sstevel 31, 31, 31, 31, 31, 31, 31, 31, /* 16-23 */ 564*29949e86Sstevel 31, 31, 31, 31, 31, 33, 34, 35, /* 24-31 */ 565*29949e86Sstevel 36, 37, 38, 38, 39, 40, 41, 42, /* 32-39 */ 566*29949e86Sstevel 43, 45, 46, 47, 48, 48, 48, 48, /* 40-47 */ 567*29949e86Sstevel 48, 48, 49, 50, 51, 52, 53, 54, /* 48-55 */ 568*29949e86Sstevel 55, 56, 57, 58, 59, 60, 61, 62, /* 56-63 */ 569*29949e86Sstevel 63, 63, 63, 63, 63, 63, 63, 63, /* 64-71 */ 570*29949e86Sstevel 63, 63, 63, 63, 63, 63, 63, 63, /* 72-79 */ 571*29949e86Sstevel 63, 63, 63, 63, 63, 63, 63, 63, /* 80-87 */ 572*29949e86Sstevel 63, 63, 63, 63, 63, 63, 63, 63, /* 88-95 */ 573*29949e86Sstevel 63, 63, 63, 63, 63, 63, 63, 63, /* 96-103 */ 574*29949e86Sstevel 63, 63, 63, 63, 63, 63, 63, 63, /* 104-111 */ 575*29949e86Sstevel }; 576*29949e86Sstevel 577*29949e86Sstevel static short ps_fans[] = { 578*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 0-7 */ 579*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 8-15 */ 580*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 16-23 */ 581*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 24-31 */ 582*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 32-39 */ 583*29949e86Sstevel 11, 12, 13, 14, 15, 16, 17, 18, /* 24-31 */ 584*29949e86Sstevel 19, 20, 21, 22, 23, 24, 25, 26, /* 32-39 */ 585*29949e86Sstevel 27, 28, 29, 30, 31, 32, 33, 34, /* 40-47 */ 586*29949e86Sstevel 35, 36, 37, 38, 39, 40, 41, 42, /* 48-55 */ 587*29949e86Sstevel 43, 44, 45, 46, 47, 48, 49, 50, /* 56-63 */ 588*29949e86Sstevel 50, 50, 50, 50, 50, 50, 50, 50, /* 56-63 */ 589*29949e86Sstevel 13, 12, 11, 10, 10, 10, 10, 10, /* 64-71 */ 590*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 72-79 */ 591*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 72-79 */ 592*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 72-79 */ 593*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 72-79 */ 594*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 72-79 */ 595*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 72-79 */ 596*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 72-79 */ 597*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 72-79 */ 598*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 72-79 */ 599*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 72-79 */ 600*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 72-79 */ 601*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 72-79 */ 602*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 72-79 */ 603*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 72-79 */ 604*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 72-79 */ 605*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 72-79 */ 606*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 72-79 */ 607*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 72-79 */ 608*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 72-79 */ 609*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 72-79 */ 610*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 72-79 */ 611*29949e86Sstevel 10, 10, 10, 10, 10, 10, 10, 10, /* 72-79 */ 612*29949e86Sstevel 10, 613*29949e86Sstevel }; 614*29949e86Sstevel 615*29949e86Sstevel /* 616*29949e86Sstevel * Get a fan speed setting based upon a temperature value 617*29949e86Sstevel * from the above lookup tables. 618*29949e86Sstevel * Less than zero ia a special case and greater than 70 is a 619*29949e86Sstevel * the operating range of the powersupply. The system operating 620*29949e86Sstevel * range is 5 - 40 Degrees C. 621*29949e86Sstevel * This may need some tuning. 622*29949e86Sstevel * The MAX_CPU_TEMP is set to 80 now, this table is used to set their 623*29949e86Sstevel * fans. 624*29949e86Sstevel */ 625*29949e86Sstevel static short fan_speed[] = { 626*29949e86Sstevel 30, 29, 28, 27, 26, 25, 24, 23, /* 0-7 */ 627*29949e86Sstevel 23, 23, 23, 23, 22, 21, 20, 20, /* 8-15 */ 628*29949e86Sstevel 20, 20, 20, 20, 20, 20, 20, 20, /* 16-23 */ 629*29949e86Sstevel 19, 18, 17, 16, 15, 14, 13, 12, /* 24-31 */ 630*29949e86Sstevel 11, 11, 11, 11, 11, 11, 11, 11, /* 32-39 */ 631*29949e86Sstevel 11, 11, 11, 10, 10, 10, 9, 8, /* 40-47 */ 632*29949e86Sstevel 7, 6, 5, 4, 3, 2, 1, 1, /* 48-55 */ 633*29949e86Sstevel 1, 1, 1, 1, 1, 1, 1, 1, /* 56-63 */ 634*29949e86Sstevel 1, 1, 1, 1, 1, 1, 1, 1, /* 64-71 */ 635*29949e86Sstevel 1, 1, 1, 1, 1, 1, 1, 1, /* 72-79 */ 636*29949e86Sstevel 1, 1, 1, 1, 1, 1, 1, 1, /* 80-87 */ 637*29949e86Sstevel }; 638*29949e86Sstevel 639*29949e86Sstevel 640*29949e86Sstevel #if defined(_KERNEL) 641*29949e86Sstevel 642*29949e86Sstevel struct envctrlunit { 643*29949e86Sstevel struct envctrl_pcd8584_regs *bus_ctl_regs; 644*29949e86Sstevel ddi_acc_handle_t ctlr_handle; 645*29949e86Sstevel kmutex_t umutex; /* lock for this structure */ 646*29949e86Sstevel int instance; 647*29949e86Sstevel dev_info_t *dip; /* device information */ 648*29949e86Sstevel struct envctrl_ps ps_kstats[MAX_DEVS]; /* kstats for powersupplies */ 649*29949e86Sstevel struct envctrl_fan fan_kstats[MAX_DEVS]; /* kstats for fans */ 650*29949e86Sstevel struct envctrl_encl encl_kstats[MAX_DEVS]; /* kstats for enclosure */ 651*29949e86Sstevel int cpu_pr_location[ENVCTRL_MAX_CPUS]; /* slot true if cpu present */ 652*29949e86Sstevel uint_t num_fans_present; 653*29949e86Sstevel uint_t num_ps_present; 654*29949e86Sstevel uint_t num_encl_present; 655*29949e86Sstevel uint_t num_cpus_present; 656*29949e86Sstevel kstat_t *psksp; 657*29949e86Sstevel kstat_t *fanksp; 658*29949e86Sstevel kstat_t *enclksp; 659*29949e86Sstevel ddi_iblock_cookie_t ic_trap_cookie; /* interrupt cookie */ 660*29949e86Sstevel queue_t *readq; /* pointer to readq */ 661*29949e86Sstevel queue_t *writeq; /* pointer to writeq */ 662*29949e86Sstevel mblk_t *msg; /* current message block */ 663*29949e86Sstevel /* CPR support */ 664*29949e86Sstevel boolean_t suspended; /* TRUE if driver suspended */ 665*29949e86Sstevel boolean_t oflag; /* already open */ 666*29949e86Sstevel int current_mode; /* NORMAL or DIAG_MODE */ 667*29949e86Sstevel int AFB_present; /* is the AFB present */ 668*29949e86Sstevel timeout_id_t timeout_id; /* timeout id */ 669*29949e86Sstevel timeout_id_t pshotplug_id; /* ps poll id */ 670*29949e86Sstevel int ps_present[MAXPS+1]; /* PS present t/f 0 not used */ 671*29949e86Sstevel int num_fans_failed; /* don't change fan speed if > 0 */ 672*29949e86Sstevel int activity_led_blink; 673*29949e86Sstevel int present_led_state; /* is it on or off?? */ 674*29949e86Sstevel timeout_id_t blink_timeout_id; 675*29949e86Sstevel int initting; /* 1 is TRUE , 0 is FALSE , used to mask intrs */ 676*29949e86Sstevel boolean_t shutdown; /* TRUE = power off in error event */ 677*29949e86Sstevel 678*29949e86Sstevel }; 679*29949e86Sstevel 680*29949e86Sstevel #endif /* _KERNEL */ 681*29949e86Sstevel 682*29949e86Sstevel #ifdef __cplusplus 683*29949e86Sstevel } 684*29949e86Sstevel #endif 685*29949e86Sstevel 686*29949e86Sstevel #endif /* _SYS_ENVCTRL_UE450_H */ 687