/* * Stop hardware timer and read time elapsed since last start. * * returns * The elapsed time since last start in units of 1 us. * */ SK_U32 SkHwtRead( SK_AC *pAC, /* Adapter Context */ SK_IOC IoC) /* I/O Context */ { SK_U32 TRead; SK_U32 IStatus; SK_U32 TimerInt; TimerInt = CHIP_ID_YUKON_2(pAC) ? Y2_IS_TIMINT : IS_TIMINT; if (pAC->Hwt.TActive) { SkHwtStop(pAC, IoC); SK_IN32(IoC, B2_TI_VAL, &TRead); TRead /= SK_HWT_FAC; SK_IN32(IoC, B0_ISRC, &IStatus); /* Check if timer expired (or wrapped around) */ if ((TRead > pAC->Hwt.TStart) || ((IStatus & TimerInt) != 0)) { SkHwtStop(pAC, IoC); pAC->Hwt.TStop = pAC->Hwt.TStart; } else { pAC->Hwt.TStop = pAC->Hwt.TStart - TRead; } } return(pAC->Hwt.TStop); }
/***************************************************************************** * * SkGeGetCoalesce - retrieves the IRQ moderation settings * * Description: * All current IRQ moderation settings of a selected adapter are placed * in the passed ethtool_coalesce structure and are returned. * * Returns: N/A * */ int SkGeGetCoalesce(struct net_device *dev, struct ethtool_coalesce *ecmd) { DEV_NET *pNet = PPRIV; SK_AC *pAC = pNet->pAC; DIM_INFO *Info = &pAC->DynIrqModInfo; SK_BOOL UseTxIrqModeration = SK_FALSE; SK_BOOL UseRxIrqModeration = SK_FALSE; if (Info->IntModTypeSelect != C_INT_MOD_NONE) { if (CHIP_ID_YUKON_2(pAC)) { UseRxIrqModeration = SK_TRUE; UseTxIrqModeration = SK_TRUE; } else { if ((Info->MaskIrqModeration == IRQ_MASK_RX_ONLY) || (Info->MaskIrqModeration == IRQ_MASK_SP_RX) || (Info->MaskIrqModeration == IRQ_MASK_RX_TX_SP)) { UseRxIrqModeration = SK_TRUE; } if ((Info->MaskIrqModeration == IRQ_MASK_TX_ONLY) || (Info->MaskIrqModeration == IRQ_MASK_SP_TX) || (Info->MaskIrqModeration == IRQ_MASK_RX_TX_SP)) { UseTxIrqModeration = SK_TRUE; } } if (UseRxIrqModeration) { ecmd->rx_coalesce_usecs = 1000000 / Info->MaxModIntsPerSec; } if (UseTxIrqModeration) { ecmd->tx_coalesce_usecs = 1000000 / Info->MaxModIntsPerSec; } if (Info->IntModTypeSelect == C_INT_MOD_DYNAMIC) { ecmd->rate_sample_interval = Info->DynIrqModSampleInterval; if (UseRxIrqModeration) { ecmd->use_adaptive_rx_coalesce = 1; ecmd->rx_coalesce_usecs_low = 1000000 / Info->MaxModIntsPerSecLowerLimit; ecmd->rx_coalesce_usecs_high = 1000000 / Info->MaxModIntsPerSecUpperLimit; } if (UseTxIrqModeration) { ecmd->use_adaptive_tx_coalesce = 1; ecmd->tx_coalesce_usecs_low = 1000000 / Info->MaxModIntsPerSecLowerLimit; ecmd->tx_coalesce_usecs_high = 1000000 / Info->MaxModIntsPerSecUpperLimit; } } } return(0); }
/***************************************************************************** * * SkGeSetTSO - set the TSO parameters * * Description: * This function sets the TSO parameters * * Returns: * ==0: everything fine, no error * !=0: the return value is the error code of the failure */ int SkGeSetTSO(struct net_device *dev, u32 data) { DEV_NET *pNet = PPRIV; SK_AC *pAC = pNet->pAC; if (CHIP_ID_YUKON_2(pAC)) { if (data) { if ((pAC->GIni.GIChipId == CHIP_ID_YUKON_EC_U) && (dev->mtu > ETH_MAX_MTU)) { dev->features &= ~NETIF_F_TSO; } else { dev->features |= NETIF_F_TSO; } } else { dev->features &= ~NETIF_F_TSO; } return 0; } return -EOPNOTSUPP; }
/* * waits for a completion of a TWSI transfer * * Returns * Nothing */ void SkI2cWaitIrq( SK_AC *pAC, /* Adapter Context */ SK_IOC IoC) /* I/O Context */ { SK_SENSOR *pSen; SK_U64 StartTime; SK_U32 IrqSrc; SK_U32 IsTwsiReadyBit; pSen = &pAC->I2c.SenTable[pAC->I2c.CurrSens]; if (pSen->SenState == SK_SEN_IDLE) { return; } IsTwsiReadyBit = CHIP_ID_YUKON_2(pAC) ? Y2_IS_TWSI_RDY : IS_I2C_READY; StartTime = SkOsGetTime(pAC); do { if (SkOsGetTime(pAC) - StartTime > SK_TICKS_PER_SEC / 8) { SK_I2C_STOP(IoC); #ifndef SK_DIAG SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_I2C_E016, SKERR_I2C_E016MSG); #endif /* !SK_DIAG */ return; } SK_IN32(IoC, B0_ISRC, &IrqSrc); } while ((IrqSrc & IsTwsiReadyBit) == 0); pSen->SenState = SK_SEN_IDLE; return; } /* SkI2cWaitIrq */
/***************************************************************************** * * SkGeSetCoalesce - configures the IRQ moderation of an adapter * * Description: * Depending on the desired IRQ moderation parameters, either a) static, * b) dynamic or c) no moderation is configured. * * Returns: * ==0: everything fine, no error * !=0: the return value is the error code of the failure * * Notes: * The supported timeframe for the coalesced interrupts ranges from * 33.333us (30 IntsPerSec) down to 25us (40.000 IntsPerSec). * Any requested value that is not in this range will abort the request! */ int SkGeSetCoalesce(struct net_device *dev, struct ethtool_coalesce *ecmd) { DEV_NET *pNet = PPRIV; SK_AC *pAC = pNet->pAC; DIM_INFO *Info = &pAC->DynIrqModInfo; int PrevModeration = Info->IntModTypeSelect; Info->IntModTypeSelect = C_INT_MOD_NONE; /* initial default */ if ((ecmd->rx_coalesce_usecs) || (ecmd->tx_coalesce_usecs)) { if (ecmd->rx_coalesce_usecs) { if ((ecmd->rx_coalesce_usecs < 25) || (ecmd->rx_coalesce_usecs > 33333)) { return -EINVAL; } } if (ecmd->tx_coalesce_usecs) { if ((ecmd->tx_coalesce_usecs < 25) || (ecmd->tx_coalesce_usecs > 33333)) { return -EINVAL; } } if (!CHIP_ID_YUKON_2(pAC)) { if ((Info->MaskIrqModeration == IRQ_MASK_SP_RX) || (Info->MaskIrqModeration == IRQ_MASK_SP_TX) || (Info->MaskIrqModeration == IRQ_MASK_RX_TX_SP)) { Info->MaskIrqModeration = IRQ_MASK_SP_ONLY; } } Info->IntModTypeSelect = C_INT_MOD_STATIC; if (ecmd->rx_coalesce_usecs) { Info->MaxModIntsPerSec = 1000000 / ecmd->rx_coalesce_usecs; if (!CHIP_ID_YUKON_2(pAC)) { if (Info->MaskIrqModeration == IRQ_MASK_TX_ONLY) { Info->MaskIrqModeration = IRQ_MASK_TX_RX; } if (Info->MaskIrqModeration == IRQ_MASK_SP_ONLY) { Info->MaskIrqModeration = IRQ_MASK_SP_RX; } if (Info->MaskIrqModeration == IRQ_MASK_SP_TX) { Info->MaskIrqModeration = IRQ_MASK_RX_TX_SP; } } else { Info->MaskIrqModeration = Y2_IRQ_MASK; } } if (ecmd->tx_coalesce_usecs) { Info->MaxModIntsPerSec = 1000000 / ecmd->tx_coalesce_usecs; if (!CHIP_ID_YUKON_2(pAC)) { if (Info->MaskIrqModeration == IRQ_MASK_RX_ONLY) { Info->MaskIrqModeration = IRQ_MASK_TX_RX; } if (Info->MaskIrqModeration == IRQ_MASK_SP_ONLY) { Info->MaskIrqModeration = IRQ_MASK_SP_TX; } if (Info->MaskIrqModeration == IRQ_MASK_SP_RX) { Info->MaskIrqModeration = IRQ_MASK_RX_TX_SP; } } else { Info->MaskIrqModeration = Y2_IRQ_MASK; } } } if ((ecmd->rate_sample_interval) || (ecmd->rx_coalesce_usecs_low) || (ecmd->tx_coalesce_usecs_low) || (ecmd->rx_coalesce_usecs_high)|| (ecmd->tx_coalesce_usecs_high)) { if (ecmd->rate_sample_interval) { if ((ecmd->rate_sample_interval < 1) || (ecmd->rate_sample_interval > 10)) { return -EINVAL; } } if (ecmd->rx_coalesce_usecs_low) { if ((ecmd->rx_coalesce_usecs_low < 25) || (ecmd->rx_coalesce_usecs_low > 33333)) { return -EINVAL; } } if (ecmd->rx_coalesce_usecs_high) { if ((ecmd->rx_coalesce_usecs_high < 25) || (ecmd->rx_coalesce_usecs_high > 33333)) { return -EINVAL; } } if (ecmd->tx_coalesce_usecs_low) { if ((ecmd->tx_coalesce_usecs_low < 25) || (ecmd->tx_coalesce_usecs_low > 33333)) { return -EINVAL; } } if (ecmd->tx_coalesce_usecs_high) { if ((ecmd->tx_coalesce_usecs_high < 25) || (ecmd->tx_coalesce_usecs_high > 33333)) { return -EINVAL; } } Info->IntModTypeSelect = C_INT_MOD_DYNAMIC; if (ecmd->rate_sample_interval) { Info->DynIrqModSampleInterval = ecmd->rate_sample_interval; } if (ecmd->rx_coalesce_usecs_low) { Info->MaxModIntsPerSecLowerLimit = 1000000 / ecmd->rx_coalesce_usecs_low; } if (ecmd->tx_coalesce_usecs_low) { Info->MaxModIntsPerSecLowerLimit = 1000000 / ecmd->tx_coalesce_usecs_low; } if (ecmd->rx_coalesce_usecs_high) { Info->MaxModIntsPerSecUpperLimit = 1000000 / ecmd->rx_coalesce_usecs_high; } if (ecmd->tx_coalesce_usecs_high) { Info->MaxModIntsPerSecUpperLimit = 1000000 / ecmd->tx_coalesce_usecs_high; } } if ((PrevModeration == C_INT_MOD_NONE) && (Info->IntModTypeSelect != C_INT_MOD_NONE)) { SkDimEnableModerationIfNeeded(pAC); } if (PrevModeration != C_INT_MOD_NONE) { SkDimDisableModeration(pAC, PrevModeration); if (Info->IntModTypeSelect != C_INT_MOD_NONE) { SkDimEnableModerationIfNeeded(pAC); } } return 0; }
/***************************************************************************** * * toggleLeds - Changes the LED state of an adapter * * Description: * This function changes the current state of all LEDs of an adapter so * that it can be located by a user. If the requested time interval for * this test has elapsed, this function cleans up everything that was * temporarily setup during the locate NIC test. This involves of course * also closing or opening any adapter so that the initial board state * is recovered. * * Returns: N/A * */ static void toggleLeds( unsigned long ptr) /* holds the pointer to adapter control context */ { DEV_NET *pNet = (DEV_NET*) ptr; SK_AC *pAC = pNet->pAC; int port = pNet->PortNr; SK_IOC IoC = pAC->IoBase; struct SK_NET_DEVICE *pDev = pAC->dev[port]; int OtherPort = (port) ? 0 : 1; struct SK_NET_DEVICE *pOtherDev = pAC->dev[OtherPort]; SK_U16 PageSelect; SK_BOOL YukLedState; SK_U16 YukLedOn = (PHY_M_LED_MO_DUP(MO_LED_ON) | PHY_M_LED_MO_10(MO_LED_ON) | PHY_M_LED_MO_100(MO_LED_ON) | PHY_M_LED_MO_1000(MO_LED_ON) | PHY_M_LED_MO_RX(MO_LED_ON)); SK_U16 YukLedOff = (PHY_M_LED_MO_DUP(MO_LED_OFF) | PHY_M_LED_MO_10(MO_LED_OFF) | PHY_M_LED_MO_100(MO_LED_OFF) | PHY_M_LED_MO_1000(MO_LED_OFF) | PHY_M_LED_MO_RX(MO_LED_OFF) | PHY_M_LED_MO_TX(MO_LED_OFF)); nbrBlinkQuarterSeconds--; if (nbrBlinkQuarterSeconds <= 0) { /* * We have to stop the device again in case the device has no * been up. */ if (!boardWasDown[0]) { /* * The board is already up as we bring it up in case it is not. */ } else { #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29) (*pDev->netdev_ops->ndo_stop)(pDev); #else (*pDev->stop)(pDev); #endif } if (isDualNetCard) { if (!boardWasDown[1]) { /* * The board is already up as we bring it up in case it is not. */ } else { #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29) (*pOtherDev->netdev_ops->ndo_stop)(pOtherDev); #else (*pOtherDev->stop)(pOtherDev); #endif } } isDualNetCard = SK_FALSE; isLocateNICrunning = SK_FALSE; return; } doSwitchLEDsOn = (doSwitchLEDsOn) ? SK_FALSE : SK_TRUE; if ( (doSwitchLEDsOn) && (nbrBlinkQuarterSeconds > 2) ){ if ( (pAC->GIni.GIChipId == CHIP_ID_YUKON_XL) || (pAC->GIni.GIChipId == CHIP_ID_YUKON_2(pAC)) || (pAC->GIni.GIChipId == CHIP_ID_YUKON_EC_U) ) { YukLedOn = 0; YukLedState = 1; YukLedOn |= PHY_M_LEDC_INIT_CTRL(YukLedState ? 9 : 8); YukLedState = 1; YukLedOn |= PHY_M_LEDC_STA1_CTRL(YukLedState ? 9 : 8); YukLedState = 1; YukLedOn |= PHY_M_LEDC_STA0_CTRL(YukLedState ? 9 : 8); YukLedState = 1; YukLedOn |= PHY_M_LEDC_LOS_CTRL(YukLedState ? 9 : 8); /* save page register */ SkGmPhyRead(pAC, IoC, port, PHY_MARV_EXT_ADR, &PageSelect); /* select page 3 for LED control */ SkGmPhyWrite(pAC, IoC, port, PHY_MARV_EXT_ADR, 3); SkGmPhyWrite(pAC, IoC, port, PHY_MARV_PHY_CTRL, YukLedOn); /* restore page register */ SkGmPhyWrite(pAC, IoC, port, PHY_MARV_EXT_ADR, PageSelect); } else { SkGmPhyWrite(pAC,IoC,port,PHY_MARV_LED_OVER,YukLedOn); } } else { if ( (pAC->GIni.GIChipId == CHIP_ID_YUKON_XL) || (pAC->GIni.GIChipId == CHIP_ID_YUKON_2(pAC)) || (pAC->GIni.GIChipId == CHIP_ID_YUKON_EC_U) ) { YukLedOn = 0; YukLedState = 1; YukLedOn |= PHY_M_LEDC_INIT_CTRL(YukLedState ? 9 : 8); YukLedState = 1; YukLedOn |= PHY_M_LEDC_STA1_CTRL(YukLedState ? 9 : 8); YukLedState = 1; YukLedOn |= PHY_M_LEDC_STA0_CTRL(YukLedState ? 9 : 8); YukLedState = 1; YukLedOn |= PHY_M_LEDC_LOS_CTRL(YukLedState ? 9 : 8); /* save page register */ SkGmPhyRead(pAC, IoC, port, PHY_MARV_EXT_ADR, &PageSelect); /* select page 3 for LED control */ SkGmPhyWrite(pAC, IoC, port, PHY_MARV_EXT_ADR, 3); SkGmPhyWrite(pAC, IoC, port, PHY_MARV_PHY_CTRL, YukLedOff); /* restore page register */ SkGmPhyWrite(pAC, IoC, port, PHY_MARV_EXT_ADR, PageSelect); } else { SkGmPhyWrite(pAC,IoC,port,PHY_MARV_LED_OVER,YukLedOff); } } locateNICtimer.function = toggleLeds; locateNICtimer.data = (unsigned long) pNet; locateNICtimer.expires = jiffies + (HZ/4); add_timer(&locateNICtimer); }
/* * Do the init state 1 initialization * * initialize the following register of the LM80: * Configuration register: * - START, noINT, activeLOW, noINT#Clear, noRESET, noCI, noGPO#, noINIT * * Interrupt Mask Register 1: * - all interrupts are Disabled (0xff) * * Interrupt Mask Register 2: * - all interrupts are Disabled (0xff) Interrupt modi doesn't matter. * * Fan Divisor/RST_OUT register: * - Divisors set to 1 (bits 00), all others 0s. * * OS# Configuration/Temperature resolution Register: * - all 0s * */ static int SkI2cInit1( SK_AC *pAC, /* Adapter Context */ SK_IOC IoC) /* I/O Context */ { int i; SK_U8 I2cSwCtrl; SK_GEPORT *pPrt; /* GIni Port struct pointer */ SK_SENSOR *pSen; if (pAC->I2c.InitLevel != SK_INIT_DATA) { /* Re-init not needed in TWSI module */ return(0); } if (pAC->GIni.GIChipId == CHIP_ID_YUKON_EC || pAC->GIni.GIChipId == CHIP_ID_YUKON_FE) { /* No sensors on Yukon-EC and Yukon-FE */ return(0); } /* Set the Direction of TWSI-Data Pin to IN */ SK_I2C_CLR_BIT(IoC, I2C_DATA_DIR | I2C_DATA); /* Check for 32-Bit Yukon with Low at TWSI-Data Pin */ SK_I2C_GET_SW(IoC, &I2cSwCtrl); if ((I2cSwCtrl & I2C_DATA) == 0) { /* this is a 32-Bit board */ pAC->GIni.GIYukon32Bit = SK_TRUE; return(0); } /* Check for 64 Bit Yukon without sensors */ if (SkI2cWrite(pAC, IoC, 0, LM80_ADDR, I2C_025K_DEV, LM80_CFG, 0) != 0) { return(0); } (void)SkI2cWrite(pAC, IoC, 0xffUL, LM80_ADDR, I2C_025K_DEV, LM80_IMSK_1, 0); (void)SkI2cWrite(pAC, IoC, 0xffUL, LM80_ADDR, I2C_025K_DEV, LM80_IMSK_2, 0); (void)SkI2cWrite(pAC, IoC, 0, LM80_ADDR, I2C_025K_DEV, LM80_FAN_CTRL, 0); (void)SkI2cWrite(pAC, IoC, 0, LM80_ADDR, I2C_025K_DEV, LM80_TEMP_CTRL, 0); (void)SkI2cWrite(pAC, IoC, (SK_U32)LM80_CFG_START, LM80_ADDR, I2C_025K_DEV, LM80_CFG, 0); /* * MaxSens has to be updated here, because PhyType is not * set when performing Init Level 0 */ pAC->I2c.MaxSens = 5; pPrt = &pAC->GIni.GP[0]; if (pAC->GIni.GIGenesis) { if (pPrt->PhyType == SK_PHY_BCOM) { if (pAC->GIni.GIMacsFound == 1) { pAC->I2c.MaxSens += 1; } else { pAC->I2c.MaxSens += 3; } } } else { pAC->I2c.MaxSens += 3; } for (i = 0; i < pAC->I2c.MaxSens; i++) { pSen = &pAC->I2c.SenTable[i]; switch (i) { case 0: pSen->SenDesc = "Temperature"; pSen->SenType = SK_SEN_TEMP; pSen->SenThreErrHigh = SK_SEN_TEMP_HIGH_ERR; pSen->SenThreWarnHigh = SK_SEN_TEMP_HIGH_WARN; pSen->SenThreWarnLow = SK_SEN_TEMP_LOW_WARN; pSen->SenThreErrLow = SK_SEN_TEMP_LOW_ERR; pSen->SenReg = LM80_TEMP_IN; break; case 1: pSen->SenDesc = "Voltage PCI"; pSen->SenType = SK_SEN_VOLT; pSen->SenThreErrHigh = SK_SEN_PCI_5V_HIGH_ERR; pSen->SenThreWarnHigh = SK_SEN_PCI_5V_HIGH_WARN; if (pAC->GIni.GIPciBus != SK_PEX_BUS) { pSen->SenThreWarnLow = SK_SEN_PCI_5V_LOW_WARN; pSen->SenThreErrLow = SK_SEN_PCI_5V_LOW_ERR; } else { pSen->SenThreWarnLow = 0; pSen->SenThreErrLow = 0; } pSen->SenReg = LM80_VT0_IN; break; case 2: pSen->SenDesc = "Voltage PCI-IO"; pSen->SenType = SK_SEN_VOLT; pSen->SenThreErrHigh = SK_SEN_PCI_IO_5V_HIGH_ERR; pSen->SenThreWarnHigh = SK_SEN_PCI_IO_5V_HIGH_WARN; if (pAC->GIni.GIPciBus != SK_PEX_BUS) { pSen->SenThreWarnLow = SK_SEN_PCI_IO_3V3_LOW_WARN; pSen->SenThreErrLow = SK_SEN_PCI_IO_3V3_LOW_ERR; } else { pSen->SenThreWarnLow = 0; pSen->SenThreErrLow = 0; } pSen->SenReg = LM80_VT1_IN; pSen->SenInit = SK_SEN_DYN_INIT_PCI_IO; break; case 3: if (pAC->GIni.GIGenesis) { pSen->SenDesc = "Voltage ASIC"; } else { pSen->SenDesc = "Voltage VMAIN"; } pSen->SenType = SK_SEN_VOLT; pSen->SenThreErrHigh = SK_SEN_VDD_HIGH_ERR; pSen->SenThreWarnHigh = SK_SEN_VDD_HIGH_WARN; pSen->SenThreWarnLow = SK_SEN_VDD_LOW_WARN; pSen->SenThreErrLow = SK_SEN_VDD_LOW_ERR; pSen->SenReg = LM80_VT2_IN; break; case 4: if (pAC->GIni.GIGenesis) { if (pPrt->PhyType == SK_PHY_BCOM) { pSen->SenDesc = "Voltage PHY A PLL"; pSen->SenThreErrHigh = SK_SEN_PLL_3V3_HIGH_ERR; pSen->SenThreWarnHigh = SK_SEN_PLL_3V3_HIGH_WARN; pSen->SenThreWarnLow = SK_SEN_PLL_3V3_LOW_WARN; pSen->SenThreErrLow = SK_SEN_PLL_3V3_LOW_ERR; } else { pSen->SenDesc = "Voltage PMA"; pSen->SenThreErrHigh = SK_SEN_PLL_3V3_HIGH_ERR; pSen->SenThreWarnHigh = SK_SEN_PLL_3V3_HIGH_WARN; pSen->SenThreWarnLow = SK_SEN_PLL_3V3_LOW_WARN; pSen->SenThreErrLow = SK_SEN_PLL_3V3_LOW_ERR; } } else { pSen->SenDesc = "Voltage VAUX"; pSen->SenThreErrHigh = SK_SEN_VAUX_3V3_HIGH_ERR; pSen->SenThreWarnHigh = SK_SEN_VAUX_3V3_HIGH_WARN; if (pAC->GIni.GIVauxAvail) { pSen->SenThreWarnLow = SK_SEN_VAUX_3V3_LOW_WARN; pSen->SenThreErrLow = SK_SEN_VAUX_3V3_LOW_ERR; } else { pSen->SenThreErrLow = 0; pSen->SenThreWarnLow = 0; } } pSen->SenType = SK_SEN_VOLT; pSen->SenReg = LM80_VT3_IN; break; case 5: if (CHIP_ID_YUKON_2(pAC)) { if (pAC->GIni.GIChipRev == CHIP_REV_YU_XL_A0) { pSen->SenDesc = "Voltage Core 1V3"; pSen->SenThreErrHigh = SK_SEN_CORE_1V3_HIGH_ERR; pSen->SenThreWarnHigh = SK_SEN_CORE_1V3_HIGH_WARN; pSen->SenThreWarnLow = SK_SEN_CORE_1V3_LOW_WARN; pSen->SenThreErrLow = SK_SEN_CORE_1V3_LOW_ERR; } else { pSen->SenDesc = "Voltage Core 1V2"; pSen->SenThreErrHigh = SK_SEN_CORE_1V2_HIGH_ERR; pSen->SenThreWarnHigh = SK_SEN_CORE_1V2_HIGH_WARN; pSen->SenThreWarnLow = SK_SEN_CORE_1V2_LOW_WARN; pSen->SenThreErrLow = SK_SEN_CORE_1V2_LOW_ERR; } } else { if (pAC->GIni.GIGenesis) { pSen->SenDesc = "Voltage PHY 2V5"; pSen->SenThreErrHigh = SK_SEN_PHY_2V5_HIGH_ERR; pSen->SenThreWarnHigh = SK_SEN_PHY_2V5_HIGH_WARN; pSen->SenThreWarnLow = SK_SEN_PHY_2V5_LOW_WARN; pSen->SenThreErrLow = SK_SEN_PHY_2V5_LOW_ERR; } else { pSen->SenDesc = "Voltage Core 1V5"; pSen->SenThreErrHigh = SK_SEN_CORE_1V5_HIGH_ERR; pSen->SenThreWarnHigh = SK_SEN_CORE_1V5_HIGH_WARN; pSen->SenThreWarnLow = SK_SEN_CORE_1V5_LOW_WARN; pSen->SenThreErrLow = SK_SEN_CORE_1V5_LOW_ERR; } } pSen->SenType = SK_SEN_VOLT; pSen->SenReg = LM80_VT4_IN; break; case 6: if (CHIP_ID_YUKON_2(pAC)) { pSen->SenDesc = "Voltage PHY 1V5"; pSen->SenThreErrHigh = SK_SEN_CORE_1V5_HIGH_ERR; pSen->SenThreWarnHigh = SK_SEN_CORE_1V5_HIGH_WARN; if (pAC->GIni.GIPciBus == SK_PEX_BUS) { pSen->SenThreWarnLow = SK_SEN_CORE_1V5_LOW_WARN; pSen->SenThreErrLow = SK_SEN_CORE_1V5_LOW_ERR; } else { pSen->SenThreWarnLow = 0; pSen->SenThreErrLow = 0; } } else { if (pAC->GIni.GIGenesis) { pSen->SenDesc = "Voltage PHY B PLL"; } else { pSen->SenDesc = "Voltage PHY 3V3"; } pSen->SenThreErrHigh = SK_SEN_PLL_3V3_HIGH_ERR; pSen->SenThreWarnHigh = SK_SEN_PLL_3V3_HIGH_WARN; pSen->SenThreWarnLow = SK_SEN_PLL_3V3_LOW_WARN; pSen->SenThreErrLow = SK_SEN_PLL_3V3_LOW_ERR; } pSen->SenType = SK_SEN_VOLT; pSen->SenReg = LM80_VT5_IN; break; case 7: if (pAC->GIni.GIGenesis) { pSen->SenDesc = "Speed Fan"; pSen->SenType = SK_SEN_FAN; pSen->SenThreErrHigh = SK_SEN_FAN_HIGH_ERR; pSen->SenThreWarnHigh = SK_SEN_FAN_HIGH_WARN; pSen->SenThreWarnLow = SK_SEN_FAN_LOW_WARN; pSen->SenThreErrLow = SK_SEN_FAN_LOW_ERR; pSen->SenReg = LM80_FAN2_IN; } else { pSen->SenDesc = "Voltage PHY 2V5"; pSen->SenType = SK_SEN_VOLT; pSen->SenThreErrHigh = SK_SEN_PHY_2V5_HIGH_ERR; pSen->SenThreWarnHigh = SK_SEN_PHY_2V5_HIGH_WARN; pSen->SenThreWarnLow = SK_SEN_PHY_2V5_LOW_WARN; pSen->SenThreErrLow = SK_SEN_PHY_2V5_LOW_ERR; pSen->SenReg = LM80_VT6_IN; } break; default: SK_ERR_LOG(pAC, SK_ERRCL_INIT | SK_ERRCL_SW, SKERR_I2C_E001, SKERR_I2C_E001MSG); break; } pSen->SenValue = 0; pSen->SenErrFlag = SK_SEN_ERR_OK; pSen->SenErrCts = 0; pSen->SenBegErrTS = 0; pSen->SenState = SK_SEN_IDLE; if (pSen->SenThreWarnLow != 0) { pSen->SenRead = SkLm80ReadSensor; } pSen->SenDev = LM80_ADDR; } #ifndef SK_DIAG pAC->I2c.DummyReads = pAC->I2c.MaxSens; #endif /* !SK_DIAG */ /* Clear TWSI IRQ */ SK_OUT32(IoC, B2_I2C_IRQ, I2C_CLR_IRQ); /* Now we are I/O initialized */ pAC->I2c.InitLevel = SK_INIT_IO; return(0); } /* SkI2cInit1 */