//****************************************************************************
//                   INTEL CORPORATION PROPRIETARY INFORMATION
//       This software is supplied under the terms of a license agreement or
//       nondisclosure agreement with Intel Corporation and may not be copied
//       or disclosed except in accordance with the terms of that agreement.
//         Copyright (c) 2013 - 2014 Intel Corporation. All Rights Reserved.
//****************************************************************************
//
//  TITLE: Master.CFG             DATE CREATED:  02/14/2014
//****************************************************************************
//  Revision History:
//
//****************************************************************************

CONFIGURATION   "Master.cfg, Rev 1.12"
DISPLAY         "S2600IP/W2600CR platform FRU & SDR package version 1.12"

// Detect Product ID***********************************************************
PROBE           "BASEBOARD_PRODID" "55"
FOUND           "S2600IP"  ""
PROBE           "BASEBOARD_PRODID" "56"
FOUND           "W2600CR"  ""



IFSET "W2600CR"
    DISPLAY "Intel(R) Server Board W2600CR platform"
ELSE
    IFSET "S2600IP"
         DISPLAY "Intel(R) Server Board S2600IP platform"
    ELSE
         DISPLAY ""
         DISPLAY "This is either the incorrect FRU/SDR package for this baseboard"
         DISPLAY "or your platform ID is incorrectly programmed."
         ERRORLEVEL 01
    ENDIF
ENDIF

DISPLAY         "Copyright (c) 2011 - 2014 Intel Corporation"
DISPLAY         " "

//If it's for factory use, please un-comment FACTORY_MODE tag
//SET "FACTORY_MODE"

IFSET "FACTORY_MODE"
    SET "SDR"
ELSE
    //Set auto-detection tag, now comment it before auto-detection implemented
    SET "AUTO_DETECTION"

    //Set user selection
    //SET "USER_SELECT"

    MENUTITLE   "Select the function you desire to perform:"
    MENU        "SDR"   "Update only the SDR repository"
    MENU        "FRU"   "Update only the FRU repository"
    MENU        "BOTH"  "Update both the FRU and the SDR repository"
    MENU        "ASSET" "Modify the Product Asset Tag"
    MENU        "EXIT1" "Exit"
    MENUPROMPT
    DISPLAY " "
ENDIF
IFSET "EXIT1"
    DISPLAY "Exit without making any changes"
ELSE
    // Set both FRU and SDR
    IFSET "BOTH"
        SET "SDR"
        SET "FRU"
    ENDIF
    IFSET   "ASSET"
        FRUNAME     "SYSTEM"
        FRUADDRESS  "IMBDEVICE" FF 20
        FRUAREA     "PRODUCT"
        FRUFIELD    "AT" "@STDIN:ASCII"
    ELSE
        IFSET "SDR"
            // Set auto-detection
            IFSET "AUTO_DETECTION"

                // Check SKUS
                // Check Front Panel FRU
                PROBE "IMBDEVICE" "04"
                FOUND "FP_CK2" ""
                IFSET "FP_CK2"
                    FRUNAME "SYSTEM"
                    FRUADDRESS 04
                    FRUAREA "BOARD" VALIDATE FP_CK3
                    IFSET FP_CK3
                        FRUAREA "BOARD"
                        PROBE FRUFIELD "PN" "FFPANEL"
                        FOUND   "SKUS" ""
                        
                        //R2000 supports another FP
                        IFSET "S2600IP"
                            //It's for R2000 storage SKUs only.
                            FRUAREA "BOARD"
                            PROBE FRUFIELD "PN" "F2USTOPANEL"
                            FOUND "FP_STORAGE"
                            IFSET "FP_STORAGE"
                                SET "SKUS"
                            ENDIF
                        ENDIF
                        
                    ENDIF // FP_CK3
                ELSE
                    DISPLAY ""
                    DISPLAY "Front Panel FRU is not detected"
                ENDIF

                // Check all fans
                IFSET "SKUS"
                    DISPLAY ""
                    IFSET "W2600CR"
                        // Detect fan speed by tachometer
                        PROBE "FAN_SIGNAL" 06
                        FOUND "CPU_FAN_1" "NO_CPU_FAN_1"
                        PROBE "FAN_SIGNAL" 07
                        FOUND "CPU_FAN_2" "NO_CPU_FAN_2"
                        PROBE "FAN_SIGNAL" 00
                        FOUND "FAN_P1" "NO_FAN_P1"
                        PROBE "FAN_SIGNAL" 01
                        FOUND "FAN_P2" "NO_FAN_P2"
                        PROBE "FAN_SIGNAL" 02
                        FOUND "FAN_P3" "NO_FAN_P3"
                        PROBE "FAN_SIGNAL" 03
                        FOUND "FAN_P4" "NO_FAN_P4"
                        PROBE "FAN_SIGNAL" 04
                        FOUND "FAN_P5" "NO_FAN_P5"
                        PROBE "FAN_SIGNAL" 05
                        FOUND "FAN_P6" "NO_FAN_P6"

                         // Work-around for hardware register to be reset by detecting twice
                        PROBE "FAN_SIGNAL" 00
                        FOUND "FAN_P1" "NO_FAN_P1"
                        PROBE "FAN_SIGNAL" 01
                        FOUND "FAN_P2" "NO_FAN_P2"
                        PROBE "FAN_SIGNAL" 02
                        FOUND "FAN_P3" "NO_FAN_P3"
                        PROBE "FAN_SIGNAL" 03
                        FOUND "FAN_P4" "NO_FAN_P4"
                        PROBE "FAN_SIGNAL" 04
                        FOUND "FAN_P5" "NO_FAN_P5"
                        PROBE "FAN_SIGNAL" 05
                        FOUND "FAN_P6" "NO_FAN_P6"
                        PROBE "FAN_SIGNAL" 06
                        FOUND "CPU_FAN_1" "NO_CPU_FAN_1"
                        PROBE "FAN_SIGNAL" 07
                        FOUND "CPU_FAN_2" "NO_CPU_FAN_2"
                        
                        IFSET "FAN_P1" "FAN_P2" "CPU_FAN_1"
                            DISPLAY "Intel(R) Workstation System P4000CR Non Redundant Fan SKU is detected"
                            SET "P4000CR"
                        ELSE
                            //In case, make sure it's not probe issue
                            IFSET "CPU_FAN_1"
                                DISPLAY ""
                            ELSE
                                PROBE "FAN_SIGNAL" 06
                                FOUND "CPU_FAN_1" "NO_CPU_FAN_1"
                            ENDIF
                            IFSET "CPU_FAN_2"
                                DISPLAY ""
                            ELSE
                                PROBE "FAN_SIGNAL" 07
                                FOUND "CPU_FAN_2" "NO_CPU_FAN_2"
                            ENDIF
                            
                            IFSET "FAN_P1" "FAN_P2" "CPU_FAN_1"
                                DISPLAY "Intel(R) Workstation System P4000CR Non Redundant Fan SKU is detected"
                                SET "P4000CR"
                            ELSE
                                DISPLAY ""
                                DISPLAY "Fan configuration is not valid, falling back to user selection as auto-detection is not possible."
                                SET "USER_SELECT"
                            ENDIF
                        ENDIF
                        
                        //Clear uncessary fan tag
                        CLEAR "FAN_P3"
                        CLEAR "FAN_P4"
                        CLEAR "FAN_P5"
                        CLEAR "FAN_P6"
                    ENDIF // IFSET "W2600CR"

                    IFSET "S2600IP"
                        PROBE "FAN_SIGNAL" 00 01
                        FOUND "FAN_P1" "NO_FAN_P1"
                        PROBE "FAN_SIGNAL" 01 01
                        FOUND "FAN_P2" "NO_FAN_P2"
                        PROBE "FAN_SIGNAL" 02 01
                        FOUND "FAN_P3" "NO_FAN_P3"
                        PROBE "FAN_SIGNAL" 03 01
                        FOUND "FAN_P4" "NO_FAN_P4"
                        PROBE "FAN_SIGNAL" 04 01
                        FOUND "FAN_P5" "NO_FAN_P5"
                        PROBE "FAN_SIGNAL" 05 01
                        FOUND "FAN_P6" "NO_FAN_P6"

                        IFSET "FAN_P1" "FAN_P3" "FAN_P5" "FAN_P2" "FAN_P4"
                            DISPLAY ""
                            IFSET "FAN_P6"
                                DISPLAY "Intel(R) Server System R2000IP Redundant Fan SKU is detected"
                                SET "R2000IP_RED"
                            ELSE
                                DISPLAY "Intel(R) Server System P4000IP Redundant Fan SKU is detected"
                                SET "P4000IP_RED"
                            ENDIF
                        ELSE
                            // Detect fan speed by tachometer
                            PROBE "FAN_SIGNAL" 00
                            FOUND "FAN_P1" "NO_FAN_P1"
                            PROBE "FAN_SIGNAL" 01
                            FOUND "FAN_P2" "NO_FAN_P2"
                            PROBE "FAN_SIGNAL" 02
                            FOUND "FAN_P3" "NO_FAN_P3"
                            PROBE "FAN_SIGNAL" 04
                            FOUND "FAN_P5" "NO_FAN_P5"
                            
                            // Work-around for hardware register to be reset by detecting twice
                            PROBE "FAN_SIGNAL" 00
                            FOUND "FAN_P1" "NO_FAN_P1"
                            PROBE "FAN_SIGNAL" 01
                            FOUND "FAN_P2" "NO_FAN_P2"
                            PROBE "FAN_SIGNAL" 02
                            FOUND "FAN_P3" "NO_FAN_P3"
                            PROBE "FAN_SIGNAL" 04
                            FOUND "FAN_P5" "NO_FAN_P5"

                            IFSET "FAN_P1" "FAN_P2" "NO_FAN_P3" "NO_FAN_P4" "NO_FAN_P5" "NO_FAN_P6"
                                DISPLAY "Intel(R) Server System P4000IP Non Redundant Fan SKU is detected"
                                SET "P4000IP_NON_RED"
                            ELSE
                                IFSET "FAN_P1" "FAN_P3" "FAN_P5" "NO_FAN_P2" "NO_FAN_P4" "NO_FAN_P6"
                                    DISPLAY "Intel(R) Server System R2000IP Non Redundant Fan SKU is detected"
                                    SET "R2000IP_NON_RED"
                                ELSE
                                    DISPLAY ""
                                    DISPLAY "Fan configuration is not valid, falling back to user selection as auto-detection is not possible."
                                    SET "USER_SELECT"
                                ENDIF
                            ENDIF
                        ENDIF //"FAN_P1" "FAN_P3" "FAN_P5"
                    ENDIF //IFSET "S2600IP"
                ELSE
                    DISPLAY ""
                    DISPLAY "Falling back to user selection as auto-detection is not possible."
                    SET "USER_SELECT"
                ENDIF //"SKUS"

            ENDIF // "AUTO_DETECTION"

            // Set User select
            IFSET "USER_SELECT"

                IFSET "W2600CR"
                   DISPLAY ""
                   MENUTITLE   "Select the SKUs:"
                   MENU    "P4000CR"                    "Intel(R) Workstation System P4000CR Non Redundant Fan SKU"
                   MENU    "OTHER"                      "Other Chassis"
                   MENUPROMPT
                   DISPLAY ""
                ENDIF //IFSET "W2600CR"

                IFSET "S2600IP"
                   DISPLAY ""
                   MENUTITLE   "Select the SKUs:"
                   MENU    "P4000IP_NON_RED"            "Intel(R) Server System P4000IP Non Redundant Fan SKU"
                   MENU    "P4000IP_RED"                "Intel(R) Server System P4000IP Redundant Fan SKU"
                   MENU    "R2000IP_NON_RED"            "Intel(R) Server System R2000IP Non Redundant Fan SKU"
                   MENU    "R2000IP_RED"                "Intel(R) Server System R2000IP Redundant Fan SKU"
                   MENU    "OTHER"                      "Other Chassis"
                   MENUPROMPT
                   DISPLAY ""
                ENDIF //IFSET "S2600IP"

            ENDIF //"USER_SELECT"

            IFSET "OTHER"
                DISPLAY     ""
                DISPLAY     "The options provided are intended for OEMs and system integrators to allow the"
                DISPLAY     "thermal control of fans in a third-party chassis. OEMs and system integrators"
                DISPLAY     "must perform their own thermal testing for any changes made using these"
                DISPLAY     "options. Intel cannot provide support for any changes made to fan settings to"
                DISPLAY     "support third-party chassis. Third-party chassis vendors may have recommended"
                DISPLAY     "settings for these configuration options for specific chassis."
                DISPLAY     " "
                DISPLAY     "INTEL ASSUMES NO RESPONSIBILITY FOR UNDESIRED RESULTS WHEN USING ANY CUSTOM FAN CONTROL CONFIGURATION ON INTEL(R) SERVER PRODUCTS"
                DISPLAY     " "
                MENUTITLE   "Select the fan speed for the chassis"
                MENU    "OTHER_SR"     "Slow Ramp"
                MENU    "OTHER_MR"     "Medium Ramp"
                MENU    "OTHER_FR"     "Fast Ramp"
                MENUPROMPT
                DISPLAY ""
            ENDIF //"OTHER"

            IFSET "FACTORY_MODE"
                DISPLAY     ""
                MENUTITLE   "Select the Chassis:"
                MENU        "SHIP"      "Only Shipping use"
                MENU        "FCT"       "Only for FCT use"
                MENU        "FCT2"      "Only for FCT2 use"
                MENUPROMPT
                DISPLAY     ""
            ELSE  //If not factory mode, scan sensors and fru devices
                //Probe for sensors and FRU devices
                DISPLAY ""
                DISPLAY "Probing system for sensors and FRU device hardware..."
                DISPLAY ""

                //Processor Check -----------------------------------------------------------------------------------
                SET "PROC_1"
                PROBE "PROCESSOR" 2
                FOUND "PROC_2" ""
                IFSET "PROC_2"
                    IFSET "S2600IP"
                        SET "S2600IP_PROC_2"
                    ELSE
                        IFSET "W2600CR"
                            SET "W2600CR_PROC_2"
                        ENDIF
                    ENDIF
                ENDIF

                // CPU TDP Check -------------------------------------------------------------------------------------

                //CPU 130W power consumption checking
                PROBE PROCESSOR_TDC "01" "82"
                FOUND "CPU_130_135W"

                //CPU 135W power consumption checking
                PROBE PROCESSOR_TDC "01" "87"
                FOUND "CPU_130_135W"


                //Class them into 130/135W category and other TDP category
                IFSET "CPU_130_135W"
                    //130/135W TDP category
                ELSE
                    //Other TDP category
                    SET "NON_CPU_130_135W"
                ENDIF

                // Power Supply Check -------------------------------------------------------------------------------------
                // Detect PS1
                PROBE "PING" "0F" "B0"
                FOUND "PS1" ""
                IFSET "PS1"
                    PROBE "IMBDEVICE" "02"
                    FOUND "PS1_FRU" "PS1_NO_FRU"
                    IFSET "PS1_FRU"
                        FRUNAME "SYSTEM"
                        FRUADDRESS 02
                        FRUAREA "PRODUCT" VALIDATE PS1_FRU_IPMI
                        IFSET PS1_FRU_IPMI
                            FRUAREA "PRODUCT"

                            PROBE FRUFIELD "PN" "DPS-750XB A"
                            FOUND "750W_PS1" ""

                            PROBE FRUFIELD "PN" "DPS-1200TB A"
                            FOUND "1200W_PS1" ""

                            PROBE FRUFIELD "PN" "FS750HS1-00"
                            FOUND "750W_PS1_ERP" ""
                            
                            // Only used in PSU Rev X05
                            PROBE FRUFIELD "PN" "FPS-S-0750ADU00-301"
                            FOUND "750W_PS1_ERP" ""
                            
                            PROBE FRUFIELD "PN" "IS162F22"
                            FOUND "1600W_PS1" ""
                            
                        ENDIF
                    ENDIF
                ENDIF

                // Detect PS2
                PROBE "PING" "0F" "B2"
                FOUND "PS2" ""
                IFSET "PS2"
                    PROBE "IMBDEVICE" "03"
                    FOUND "PS2_FRU" "PS2_NO_FRU"
                    IFSET "PS2_FRU"
                        FRUNAME "SYSTEM"
                        FRUADDRESS 03
                        FRUAREA "PRODUCT" VALIDATE PS2_FRU_IPMI
                        IFSET PS2_FRU_IPMI
                            FRUAREA "PRODUCT"

                            PROBE FRUFIELD "PN" "DPS-750XB A"
                            FOUND "750W_PS2" ""

                            PROBE FRUFIELD "PN" "DPS-1200TB A"
                            FOUND "1200W_PS2" ""

                            PROBE FRUFIELD "PN" "FS750HS1-00"
                            FOUND "750W_PS2_ERP" ""
                            
                            // Only used in PSU Rev X05
                            PROBE FRUFIELD "PN" "FPS-S-0750ADU00-301"
                            FOUND "750W_PS2_ERP" ""
                            
                            PROBE FRUFIELD "PN" "IS162F22"
                            FOUND "1600W_PS2" ""
                        ENDIF
                    ENDIF
                ENDIF

                // Display msg for PS---------------------------------------------------------------------------------------------
                // Detect PS1
                IFSET "PS1"
                    IFSET "750W_PS1"
                        DISPLAY ""
                        DISPLAY "750W Power Supply 1 is detected."
                    ELSE
                        IFSET "1200W_PS1"
                            DISPLAY ""
                            DISPLAY "1200W Power Supply 1 is detected."
                        ELSE
                            IFSET "750W_PS1_ERP"
                                DISPLAY ""
                                DISPLAY "750W ERP Power Supply 1 is detected."
                            ELSE
                                IFSET "1600W_PS1"
                                    DISPLAY ""
                                    DISPLAY "1600W Power Supply 1 is detected."
                                ELSE
                                    DISPLAY ""
                                    DISPLAY "Power supply 1 FRU is invalid."
                                ENDIF
                            ENDIF
                        ENDIF
                    ENDIF
                ENDIF //"PS1"

                // Detect PS2
                IFSET "PS2"
                    IFSET "750W_PS2"
                        DISPLAY ""
                        DISPLAY "750W Power Supply 2 is detected."
                    ELSE
                        IFSET "1200W_PS2"
                            DISPLAY ""
                            DISPLAY "1200W Power Supply 2 is detected."
                        ELSE
                            IFSET "750W_PS2_ERP"
                                DISPLAY ""
                                DISPLAY "750W ERP Power Supply 2 is detected."
                            ELSE
                                IFSET "1600W_PS2"
                                    DISPLAY ""
                                    DISPLAY "1600W Power Supply 2 is detected."
                                ELSE
                                    DISPLAY ""
                                    DISPLAY "Power supply 2 FRU is invalid."
                                ENDIF
                            ENDIF
                        ENDIF
                    ENDIF
                ENDIF //"PS2"

                IFSET   "PS1"
                    //Power Supply 1 is detected.
                    IFSET "PS2"
                        //If both PS are installed, load PS redundancy sensor
                        SET "PS_REDUNDANCY"
                    ENDIF
                ELSE
                    IFSET "PS2"
                        //Power Supply 2 is detected.
                    ELSE
                        DISPLAY "Power Supply is not detected."
                    ENDIF
                ENDIF //"PS1" "PS2"

                // HSBP Check----------------------------------------------------------------------------------------------
                // Detect HSBP1
                PROBE "PING" "0B" "D0"
                FOUND "HSBP1_PR" ""
                IFSET "HSBP1_PR"
                    FRUNAME "SYSTEM"
                    FRUADDRESS 05
                    FRUAREA "BOARD" VALIDATE HSBP_CK11
                    IFSET HSBP_CK11
                        FRUAREA "BOARD"
                        PROBE FRUFIELD "PN" "FUP4X35HSBP"
                        FOUND "HSBP_1_BP4" ""
                        IFSET "HSBP_1_BP4"
                            DISPLAY ""
                            DISPLAY "4 X 3.5 Hot Swap Backplane 1 is detected."
                        ENDIF
                        PROBE FRUFIELD "PN" "FUP8X35HSBP"
                        FOUND "HSBP_1_BP8" ""
                        IFSET "HSBP_1_BP8"
                            //4U BP8x3.5 is Found
                        ELSE
                            //Check 2U BP8x3.5
                            PROBE FRUFIELD "PN" "F2U8X35HSBP"
                            FOUND "HSBP_1_BP8" ""
                        ENDIF
                        IFSET "HSBP_1_BP8"
                            DISPLAY ""
                            DISPLAY "8 X 3.5 Hot Swap Backplane 1 is detected."
                        ENDIF

                        PROBE FRUFIELD "PN" "FXX8X25HSBP"
                        FOUND "HSBP_1_25DT" ""
                        IFSET "HSBP_1_25DT"
                            DISPLAY ""
                            DISPLAY "8 X 2.5 Hot Swap Backplane 1 is detected."
                        ENDIF
                        PROBE FRUFIELD "PN" "F2U12X35HSBP"
                        FOUND "HSBP_1_BP12" ""
                        IFSET "HSBP_1_BP12"
                            DISPLAY ""
                            DISPLAY "12 X 3.5 Hot Swap Backplane 1 is detected."
                        ENDIF

                    ENDIF

                    // Detect HSBP2
                    IFSET "HSBP_1_BP12"
                        //Do not detect HSBP2
                    ELSE
                        PROBE "PING" "0B" "D2"
                        FOUND "HSBP2_PR" ""
                    ENDIF
                    IFSET   "HSBP2_PR"
                        FRUNAME "SYSTEM"
                        FRUADDRESS 06
                        FRUAREA "BOARD" VALIDATE HSBP_CK21
                        IFSET HSBP_CK21
                            FRUAREA "BOARD"
                            PROBE FRUFIELD "PN" "FUP4X35HSBP"
                            FOUND "HSBP_2_BP4" ""
                            IFSET "HSBP_2_BP4"
                                DISPLAY ""
                                DISPLAY "4 X 3.5 Hot Swap Backplane 2 is detected."
                            ENDIF
                            PROBE FRUFIELD "PN" "FUP8X35HSBP"
                            FOUND "HSBP_2_BP8" ""
                            IFSET "HSBP_2_BP8"
                                //4U BP8x3.5 is Found
                            ELSE
                                //Check 2U BP8x3.5
                                PROBE FRUFIELD "PN" "F2U8X35HSBP"
                                FOUND "HSBP_2_BP8" ""
                            ENDIF
                            IFSET "HSBP_2_BP8"
                                DISPLAY ""
                                DISPLAY "8 X 3.5 Hot Swap Backplane 2 is detected."
                            ENDIF
                            PROBE FRUFIELD "PN" "FXX8X25HSBP"
                            FOUND "HSBP_2_25DT" ""
                            IFSET "HSBP_2_25DT"
                                DISPLAY ""
                                DISPLAY "8 X 2.5 Hot Swap Backplane 2 is detected."
                            ENDIF
                            PROBE FRUFIELD "PN" "F2U12X35HSBP"
                            FOUND "HSBP_2_BP12" ""
                            IFSET "HSBP_2_BP12"
                                DISPLAY ""
                                DISPLAY "12 X 3.5 Hot Swap Backplane 2 is detected."
                            ENDIF
                        ENDIF

                        // Detect HSBP3
                        PROBE "PING"    "0B"    "D4"
                        FOUND "HSBP3_PR"     ""
                        IFSET   "HSBP3_PR"
                            FRUNAME "SYSTEM"
                            FRUADDRESS 07
                            FRUAREA "BOARD" VALIDATE HSBP_CK31
                            IFSET HSBP_CK31
                                FRUAREA "BOARD"
                                PROBE FRUFIELD "PN" "FUP4X35HSBP"
                                FOUND "HSBP_3_BP4"
                                IFSET "HSBP_3_BP4"
                                    DISPLAY ""
                                    DISPLAY "4 X 3.5 Hot Swap Backplane 3 is detected."
                                ENDIF
                                PROBE FRUFIELD "PN" "FUP8X35HSBP"
                                FOUND "HSBP_3_BP8" ""
                                IFSET "HSBP_3_BP8"
                                    //4U BP8x3.5 is Found
                                ELSE
                                    //Check 2U BP8x3.5
                                    PROBE FRUFIELD "PN" "F2U8X35HSBP"
                                    FOUND "HSBP_3_BP8" ""
                                ENDIF
                                IFSET "HSBP_3_BP8"
                                    DISPLAY ""
                                    DISPLAY "8 X 3.5 Hot Swap Backplane 3 is detected."
                                ENDIF
                                PROBE FRUFIELD "PN" "FXX8X25HSBP"
                                FOUND "HSBP_3_25DT" ""
                                IFSET "HSBP_3_25DT"
                                    DISPLAY ""
                                    DISPLAY "8 X 2.5 Hot Swap Backplane 3 is detected."
                                ENDIF
                            ENDIF
                        ENDIF //ENDIF "HSBP3_PR"
                    ENDIF //ENDIF "HSBP2_PR"
                ENDIF //ENDIF "HSBP1_PR"
				
				// Detect IO Module & SAS Monule
				// Due to an issue with some IO Module temperature sensor devices, do not probe for it.
				// Is a I/O (LAN) module installed with a temperature sensor on it?
				// PROBE "PING" "0D" "94"
				// FOUND "IO_MODULE"
				
				// Is there a FRU storage device on the I/O (LAN) module?
				PROBE "PING" "0D" "A4"
				FOUND "IO_MODULE_FRU"
				
				// If the FRU device is present, assume the temperature device is present also.
				IFSET "IO_MODULE_FRU"
					SET "IO_MODULE"
				ENDIF
				
				IFSET "IO_MODULE"
					DISPLAY "I/O module is Detected"
		        ENDIF
				
                // Is a SAS module installed with a temperature sensor on it?
                PROBE "PING" "0D" "98"
                FOUND "SAS_MODULE"
                IFSET "SAS_MODULE"
                    DISPLAY ""
                    DISPLAY "SAS module is Detected."
                ENDIF

                // And is a FRU storage device on the SAS module?
                PROBE "PING" "0D" "A8"
                FOUND "SAS_MODULE_FRU"

                DISPLAY ""
            ENDIF //"FACTORY_MODE"

            //Set SDR tags for items that are standard on specific SKU *******************************

            //Intel(R) Server System P4000IP Non Redundant Fan SKU ----------------------------------------------------
            //only S2600IP use now
            IFSET "P4000IP_NON_RED"
                //System Fans
                SET "S2600IP_FIX_FAN1"
                SET "S2600IP_FIX_FAN2"
                CLEAR "CPU_FAN_1"
                CLEAR "CPU_FAN_2"

                //Front Panel Temp
                SET "FP_TEMP"
                SET "FP_NMI"

                //Exit Air Temp
                SET "S2600IP_EATEMP"

                //Chassis intrusion
                SET "CHASSIS_INTRU"
            ENDIF //IFSET "P4000IP_NON_RED"

            //Intel(R) Workstation System P4000CR Non Redundant Fan SKU ----------------------------------------------------
            IFSET "P4000CR"
                SET "W2600CR_FIX_FAN1"
                SET "W2600CR_FIX_FAN2"

                //CPU FAN
                SET "CPU_FAN_1"
                IFSET "PROC_2"
                    SET "CPU_FAN_2"
                ENDIF

                //Front Panel Temp
                SET "FP_TEMP"
                SET "FP_NMI"

                //Exit Air Temp
                SET "W2600CR_EATEMP"

                //Chassis intrusion
                SET "CHASSIS_INTRU"
            ENDIF //"P4000CR"

             //Intel(R) Server System P4000IP Redundant Fan SKU ----------------------------------------------------
            IFSET "P4000IP_RED"
                SET "SYS_FAN_HS_4U_1"
                SET "SYS_FAN_HS_4U_2"
                SET "SYS_FAN_HS_4U_3"
                SET "SYS_FAN_HS_4U_4"
                SET "SYS_FAN_HS_4U_5"
                CLEAR "CPU_FAN_1"
                CLEAR "CPU_FAN_2"

                //Front Panel Temp
                SET "FP_TEMP"
                SET "FP_NMI"

                //Exit Air Temp
                SET "S2600IP_EATEMP"

                //Chassis intrusion
                SET "CHASSIS_INTRU"

                //Load special tag for system airflow formula/fans-off sub-record.
                IFSET "HSBP2_PR"
                    //If two or more HSBP installed, load P4xxx
                    SET "P4XXX"
                ELSE
                    IFSET "HSBP1_PR"
                        IFSET "HSBP_1_25DT"
                            SET "P4208"
                        ELSE
                            SET "P4XXX"
                        ENDIF
                    ELSE
                        //No HSBP installed
                        SET "P4208"
                    ENDIF
                ENDIF

            ENDIF //"P4000IP_RED"

            //Intel(R) Server System R2000IP Non Redundant Fan SKU ----------------------------------------------------
            IFSET "R2000IP_NON_RED"
                SET "SYS_FAN_FIX_2U_1"
                SET "SYS_FAN_FIX_2U_3"
                SET "SYS_FAN_FIX_2U_5"
                CLEAR "CPU_FAN_1"
                CLEAR "CPU_FAN_2"

                //Front Panel Temp
                IFSET "FP_STORAGE"
                    DISPLAY ""
                ELSE
                    SET "FP_TEMP"
                ENDIF
                SET "FP_NMI"

                //Exit Air Temp
                SET "S2600IP_EATEMP"

                //NO Chassis intrusion for R2000 chassis
                SET "NO_CHASSIS_INTRU"

                CLEAR "1200W_PS1"
                CLEAR "1200W_PS2"

            ENDIF //"R2000IP_NON_RED"

            //Intel(R) Server System R2000IP Redundant Fan SKU ----------------------------------------------------
            IFSET "R2000IP_RED"
                SET "SYS_FAN_HS_2U_1"
                SET "SYS_FAN_HS_2U_2"
                SET "SYS_FAN_HS_2U_3"
                SET "SYS_FAN_HS_2U_4"
                SET "SYS_FAN_HS_2U_5"
                SET "SYS_FAN_HS_2U_6"
                CLEAR "CPU_FAN_1"
                CLEAR "CPU_FAN_2"

                //Front Panel Temp
                IFSET "FP_STORAGE"
                    DISPLAY ""
                ELSE
                    SET "FP_TEMP"
                ENDIF
                SET "FP_NMI"

                //Exit Air Temp
                SET "S2600IP_EATEMP"

                //NO Chassis intrusion for R2000 chassis
                SET "NO_CHASSIS_INTRU"

                CLEAR "1200W_PS1"
                CLEAR "1200W_PS2"

                //Load special tag for system airflow formula/fans-off sub-record.
                IFSET "HSBP2_PR"
                    //If two or more HSBP installed, load P4xxx
                    SET "R2XXX"
                ELSE
                    IFSET "HSBP1_PR"
                        IFSET "HSBP_1_25DT"
                            SET "R2208"
                        ELSE
                            SET "R2XXX"
                        ENDIF
                    ELSE
                        //No HSBP installed
                        SET "R2208"
                    ENDIF
                ENDIF

            ENDIF //"R2000IP_RED"

            //OTHER chassis ----------------------------------------------------------------------------
            IFSET "OTHER"
                //System Fans
                DISPLAY ""
                PROMPT "Is System Fan 1 installed?"
                YES "OTHER_FAN_1"
                NO ""
                DISPLAY ""
                PROMPT "Is System Fan 2 installed?"
                YES "OTHER_FAN_2"
                NO ""
                DISPLAY ""
                PROMPT "Is System Fan 3 installed?"
                YES "OTHER_FAN_3"
                NO ""
                DISPLAY ""
                PROMPT "Is System Fan 4 installed?"
                YES "OTHER_FAN_4"
                NO ""
                DISPLAY ""
                PROMPT "Is System Fan 5 installed?"
                YES "OTHER_FAN_5"
                NO ""
                DISPLAY ""
                PROMPT "Is System Fan 6 installed?"
                YES "OTHER_FAN_6"
                NO ""
                DISPLAY ""
                PROMPT "Is CPU Fan 1 installed?"
                YES "OTHER_CPU1_FAN"
                NO ""
                DISPLAY ""
                PROMPT "Is CPU Fan 2 installed?"
                YES "OTHER_CPU2_FAN"
                NO ""
                DISPLAY ""
                PROMPT "Is Rear Fan installed?"
                YES "OTHER_REAR_FAN"
                NO ""

                //For fan redundancy sensor
                IFSET "OTHER_FAN_1" "OTHER_FAN_2" "OTHER_FAN_3" "OTHER_FAN_4"
                    IFSET "OTHER_FAN_5" "OTHER_FAN_6"
                        SET "FAN_REDUN_FLAG"
                    ENDIF
                ENDIF

                //Power Supply Module 1 & 2
                CLEAR "750W_PS1"
                CLEAR "750W_PS2"
                CLEAR "1200W_PS1"
                CLEAR "1200W_PS2"
                CLEAR "750W_PS1_ERP"
                CLEAR "750W_PS2_ERP"
                CLEAR "PS_REDUNDANCY"

                //Chassis intrusion
                DISPLAY ""
                PROMPT "Does the system have chassis intrusion?"
                YES "CHASSIS_INTRU"
                NO "NO_CHASSIS_INTRU"

                DISPLAY ""
                PROMPT "Does the front panel support a NMI button?"
                YES "FP_NMI"
                NO  ""

                //Set tag for FSC
                IFSET "W2600CR"
                    IFSET "OTHER_SR"
                        SET "W2600CR_OTHER_SR"
                    ELSE
                        IFSET "OTHER_MR"
                            SET "W2600CR_OTHER_MR"
                        ELSE
                            IFSET "OTHER_FR"
                                SET "W2600CR_OTHER_FR"
                            ENDIF
                        ENDIF
                    ENDIF
                ELSE
                    IFSET S2600IP
                        IFSET "OTHER_SR"
                            SET "S2600IP_OTHER_SR"
                        ELSE
                            IFSET "OTHER_MR"
                                SET "S2600IP_OTHER_MR"
                            ELSE
                                IFSET "OTHER_FR"
                                    SET "S2600IP_OTHER_FR"
                                ENDIF
                            ENDIF
                        ENDIF
                    ENDIF
                ENDIF

            ENDIF //IFSET "OTHER"

            //Shipping ---------------------------------------------------------------------------------
            IFSET "SHIP"
                //Power Supply Module 1 & 2
                CLEAR "750W_PS1"
                CLEAR "750W_PS2"
                CLEAR "1200W_PS1"
                CLEAR "1200W_PS2"
                CLEAR "750W_PS1_ERP"
                CLEAR "750W_PS2_ERP"
                CLEAR "PS_REDUNDANCY"

                //HSBP 1/2/3
                CLEAR "HSBP_1_BP4"
                CLEAR "HSBP_1_BP8"
                CLEAR "HSBP_1_25DT"
                CLEAR "HSBP_1_BP12"
                CLEAR "HSBP_2_BP4"
                CLEAR "HSBP_2_BP8"
                CLEAR "HSBP_2_25DT"
                CLEAR "HSBP_2_BP12"
                CLEAR "HSBP_3_BP4"
                CLEAR "HSBP_3_BP8"
                CLEAR "HSBP_3_25DT"

                //Physical Security Sensor with lan leash lost event mask only
                SET "NO_CHASSIS_INTRU"

                //Remove stepwise curve record
                CLEAR S2600IP
                CLEAR "W2600CR"

            ENDIF //IFSET "SHIP"

            //FCT --------------------------------------------------------------------------------------
            IFSET "FCT"
                //System Fans
                SET "FCT_FAN_6"
                SET "OTHER_CPU1_FAN"
                SET "OTHER_CPU2_FAN"
                SET "OTHER_REAR_FAN"
                SET "SYS_FAN_HS_4U_1"
                SET "SYS_FAN_HS_4U_2"
                SET "SYS_FAN_HS_4U_3"
                SET "SYS_FAN_HS_4U_4"
                SET "SYS_FAN_HS_4U_5"

                //Power Supply Module 1 & 2
                SET "PS_REDUNDANCY"
                SET "750W_PS1"
                SET "750W_PS2"

                //Chassis intrusion
                SET "CHASSIS_INTRU"

                //IO Module & SAS Module
                SET "IO_MODULE"
                SET "SAS_MODULE"

                //Remove stepwise curve record
                CLEAR S2600IP
                CLEAR "W2600CR"

            ENDIF //IFSET "FCT"

            //FCT2 -------------------------------------------------------------------------------------
            IFSET "FCT2"
                //System Fans
                SET "FCT_FAN_6"
                SET "OTHER_CPU1_FAN"
                SET "OTHER_CPU2_FAN"
                SET "OTHER_REAR_FAN"
                SET "SYS_FAN_HS_4U_1"
                SET "SYS_FAN_HS_4U_2"
                SET "SYS_FAN_HS_4U_3"
                SET "SYS_FAN_HS_4U_4"
                SET "SYS_FAN_HS_4U_5"

                //Power Supply Module 1 & 2
                SET "750W_PS1"
                CLEAR "PS_REDUNDANCY"
                CLEAR "750W_PS2"
                CLEAR "1200W_PS1"
                CLEAR "1200W_PS2"
                CLEAR "750W_PS1_ERP"
                CLEAR "750W_PS2_ERP"

                //HSBP 1/2/3
                CLEAR "HSBP_1_BP4"
                CLEAR "HSBP_1_BP8"
                CLEAR "HSBP_1_25DT"
                CLEAR "HSBP_1_BP12"
                CLEAR "HSBP_2_BP4"
                CLEAR "HSBP_2_BP8"
                CLEAR "HSBP_2_25DT"
                CLEAR "HSBP_2_BP12"
                CLEAR "HSBP_3_BP4"
                CLEAR "HSBP_3_BP8"
                CLEAR "HSBP_3_25DT"

                //Chassis intrusion
                SET "CHASSIS_INTRU"

                //Remove stepwise curve record
                CLEAR "S2600IP"
                CLEAR "W2600CR"

            ENDIF //IFSET "FCT2"

            SDRNAME "S2600IPCR.sdr"        // Update SDR Repository
            BMC_REFRESH
        ENDIF     // IFSET "SDR"

        IFSET "FRU"

            // ******************************
            //   Update Base Board FRU areas
            // ******************************

                IFSET "W2600CR"
                    DISPLAY     ""
                    DISPLAY     "Updating W2600CR FRU areas"

                    //Update Baseboard FRU data
                    FRUNAME     "W2600CR.FRU"
                    FRUAREA     "HEADER"
                    FRUAREA     "INTERNALUSE"
                    FRUAREA     "CHASSIS"
                    FRUFIELD    "CT"
                ENDIF

                IFSET "S2600IP"
                    DISPLAY     ""
                    DISPLAY     "Updating S2600IP FRU areas"

                    //Update Baseboard FRU data
                    FRUNAME     "S2600IP.FRU"
                    FRUAREA     "HEADER"
                    FRUAREA     "INTERNALUSE"
                    FRUAREA     "CHASSIS"
                    FRUFIELD    "CT"
                ENDIF


                PROMPT      "Do you want to update the chassis info area of the FRU?"
                YES         "UPD_CHS"
                NO          ""
                IFSET   "UPD_CHS"

//                    IFSET "OTHER"
//                        DISPLAY     ""
//                        PROMPT      "Do you want to enter chassis type (HEX byte)? 03h: Desktop; 11h Main Server Chassis; 17h: Rackmount chassis"
//                            YES     "CHASS_T"
//                            NO      ""
//
//                        IFSET "CHASS_T"
//                            FRUFIELD    "CT" "@STDIN:ASCII"
//                        ENDIF
//                    ENDIF

                    PROMPT      "Do you want to enter the chassis serial number?"
                    YES         "CHASSN"
                    NO          ""
                    DISPLAY     ""
                    IFSET       "CHASSN"
                        FRUFIELD    "S#" "@STDIN:ASCII"
                    ENDIF

                    PROMPT      "Do you want to enter the chassis part number?"
                    YES         "CHASPN"
                    NO          ""
                    DISPLAY     " "
                    IFSET       "CHASPN"
                        FRUFIELD    "P#" "@STDIN:ASCII"
                    ENDIF
                ENDIF //END IFSET "UPD_CHS"

                PROMPT      "Do you want to enter the chassis manufacturer name (Additional Field 1)?"
                YES         "CHASMN"
                NO          ""
                DISPLAY     ""
                IFSET       "CHASMN"
                    FRUFIELD     "AM1" "@STDIN:ASCII"
                ENDIF

                FRUAREA     "BOARD"
                FRUFIELD    "MN"
                FRUFIELD    "PN"
                FRUFIELD    "ID"
                DISPLAY     ""

                FRUAREA     "PRODUCT"
                PROMPT      "Do you want to update the system info area of the FRU?"
                YES         "UPD_PRD"
                NO          ""
                IFSET       "UPD_PRD"
                     FRUFIELD    "MN"
                     FRUFIELD    "PN"
                     FRUFIELD    "PV"
                     PROMPT     "Do you want to enter system part number?"
                     YES        "PROD_PN"
                     NO         ""
                     IFSET      "PROD_PN"
                        FRUFIELD    "P#" "@STDIN:ASCII"
                     ENDIF

                     PROMPT     "Do you want to enter the system serial number?"
                     YES        "PROD_SN"
                     NO         ""
                     IFSET      "PROD_SN"
                        FRUFIELD    "S#" "@STDIN:ASCII"
                     ENDIF

                     PROMPT      "Do you want to enter the product asset tag?"
                     YES         "ASSET"
                     NO          ""
                     DISPLAY     ""
                     IFSET   "ASSET"
                         FRUFIELD    "AT" "@STDIN:ASCII"
                     ENDIF
               ENDIF // END IFSET "UPD_PRD"

        ENDIF   //END IFSET "FRU"
    ENDIF // ASSET TAG
ENDIF // IFSET "EXIT1"