//****************************************************************************
//                   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) 2011 - 2013 Intel Corporation. All Rights Reserved.
//****************************************************************************
//
//  TITLE: Master.CFG             DATE CREATED:  12/06/2011
//****************************************************************************
//  Revision History:
//  Version 0.23                  DATE RELEASED: 11/05/2013
//****************************************************************************

CONFIGURATION   "Master.cfg, Rev 0.23"
DISPLAY         "S4600LH platform FRU & SDR package version 0.23"

// Detect Product ID***********************************************************
PROBE           "BASEBOARD_PRODID"  "5C"
FOUND           "S4600LH"   ""

IFSET "S4600LH"
    DISPLAY "Intel(R) Server Board S4600LH 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

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

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

IFSET "FACTORY_MODE"
    SET "SDR"
ELSE  // FACTORY_MODE
    // Set auto-detection tag
    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  // FACTORY_MODE

IFSET "EXIT1"
    DISPLAY "Exit without making any changes"
ELSE  // EXIT1
    // Sense auto-detection
    IFSET "AUTO_DETECTION"
        DISPLAY     "Auto detecting SKU type.... "
        DISPLAY     "This may take up to two minutes based on configuration."

        // Sense Product Name of Motherboard
        FRUNAME     "SYSTEM"
        FRUADDRESS  "IMBDEVICE" FF 20
        FRUAREA     "BOARD" VALIDATE BB_BOARD
        IFSET "BB_BOARD"
            // Sense Motherboard - ROW SKU
            PROBE   FRUFIELD "PN" "SVRBD-ROW_P"
            FOUND   "ROW_BOARD_P" ""
            PROBE   FRUFIELD "PN" "SVRBD-ROW_T"
            FOUND   "ROW_BOARD_T" ""

            IFSET   "ROW_BOARD_P"
                SET    "ROW_BOARD"
            ENDIF
            IFSET   "ROW_BOARD_T"
                SET    "ROW_BOARD"
            ENDIF

            // Sense Motherboard - LAN SKU
            PROBE   FRUFIELD "PN" "SVRBD-LAN_T"
            FOUND   "LAN_BOARD_T" ""

            IFSET   "LAN_BOARD_T"
                SET    "LAN_BOARD"
            ENDIF

        ENDIF  // BB_BOARD
        CLEAR    "BB_BOARD"

        // Sense Front Panel
        PROBE   "IMBDEVICE" "04"
        FOUND   "FP_FRU" ""
        IFSET   "FP_FRU"
            FRUNAME     "SYSTEM"
            FRUADDRESS  04
            FRUAREA     "BOARD" VALIDATE FP_BOARD
            IFSET "FP_BOARD"
                PROBE   FRUFIELD "MN" "McAfee Inc."
                FOUND   "MCAFEE_FP" ""
                PROBE   FRUFIELD "MN" "Intel Corporation"
                FOUND   "INTEL_FP" ""
            ENDIF  //FP_BOARD
        ELSE  // FP_FRU
            DISPLAY ""
            DISPLAY "Front panel FRU device is not detected."
        ENDIF  //FP_FRU
        // Message for Front panel FRU detected
        IFSET "INTEL_FP"
            DISPLAY ""
            DISPLAY "Intel front panel is detected."
        ELSE  // INTEL_FP
            IFSET "MCAFEE_FP"
                DISPLAY ""
                DISPLAY "McAfee front panel is detected."
            ELSE  // MCAFEE_FP
                DISPLAY ""
                DISPLAY "Front panel FRU device is detected but its FRU data is either corrupted or blank."
            ENDIF // MCAFEE_FP
        ENDIF // INTEL_FP

        // LAN_BOARD detected
        IFSET "LAN_BOARD"
            SET "LHP_LAN"
            DISPLAY "-- LHP 28 LAN Redundant Fan SKU is detected --"
        ELSE  // LAN_BOARD
            // ROW_BOARD detected
            IFSET "ROW_BOARD"
                // Intel Front panel FRU exist
                IFSET "INTEL_FP"
                    SET "LHP_ROW"
                    DISPLAY "-- LHP 28 ROW Redundant Fan SKU is detected --"
                ELSE  // INTEL_FP
                    SET "OTHER"
                    DISPLAY "-- Other Chassis is detected--"
                ENDIF  // INTEL_FP
            ELSE  // ROW_BOARD
                DISPLAY ""
                DISPLAY "Auto detection is failed."
                DISPLAY "Falling back to user selection as auto detection is not possible."
                CLEAR "AUTO_DETECTION"
                SET "USER_SELECT"
            ENDIF  // ROW_BOARD
            CLEAR    "ROW_BOARD"
        ENDIF // LAN_BOARD
        CLEAR    "LAN_BOARD"
    ENDIF // AUTO_DETECTION

    // 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 // ASSET
        IFSET "SDR"
            // Set User select
            IFSET "USER_SELECT"
                DISPLAY     ""

                MENUTITLE   "Select the SKUs:"
                MENU        "LHP_TP"        "LHP TestPlate "
                MENU        "LHP_ROW"       "LHP 28 ROW Redundant Fan SKU"
                MENU        "LHP_LAN"       "LHP 28 LAN Redundant Fan SKU"
                MENU        "OTHER"         "Other Chassis"
                MENUPROMPT

                DISPLAY     ""
            ENDIF  // USER_SELECT
            
            IFSET "FACTORY_MODE"
                DISPLAY     ""

                //modify fct mode to fct_row/fct_lan by "Lizard Head Pass FSC Config Sheet Rev0.6(v6).xlsm"
                MENUTITLE   "Select the Chassis:"
                MENU        "SHIP"      "Only Shipping use"
                MENU        "FCT"       "Only for FCT_ROW use"    
                MENU        "FCT_LAN"   "Only for FCT_LAN use"  
                MENU        "FCT2"      "Only for FCT2 use"
                MENUPROMPT
                
                // modify part1 //
                IFSET "FCT_LAN"
                    SET "FCT"
                ENDIF
                
                DISPLAY     ""
            ENDIF  // FACTORY_MODE

            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

            //Probe for sensors and FRU device
            DISPLAY ""
            DISPLAY "Probing system for sensors and FRU device hardware..."
            DISPLAY "This may take up to 2 minutes to complete."

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

                    IFSET "PS1_FRU_IPMI"
                    	PROBE FRUFIELD "PN" "DPS-1200TB A"
                        FOUND "1200_PS1" ""

                        IFSET "1200_PS1"
                        ELSE  // 1200_PS1
                            PROBE FRUFIELD "PN" "IS162F22"
                            FOUND "1600_PS1" ""                            
                              IFSET "1600_PS1"
                              ELSE  // 1600_PS1
                                  PROBE FRUFIELD "PN" "PSSW162201A"
                                  FOUND "1600DC_PS1" ""
                              ENDIF  // 1600_PS1
                        ENDIF  // 1200_PS1
                    ENDIF  // PS1_FRU_IPMI
                ENDIF  // PS1_FRU
	        ENDIF  // PS1
	          
	        //Detect PS2
	        PROBE "PING" "0F" "B2"
	        FOUND "PS2" ""
	        IFSET "PS2"
	            PROBE "IMBDEVICE" "03"
                FOUND "PS2_FRU" ""
                IFSET "PS2_FRU"
                    FRUNAME     "SYSTEM"
                    FRUADDRESS  03
                    FRUAREA     "PRODUCT" VALIDATE PS2_FRU_IPMI

                    IFSET "PS2_FRU_IPMI"
                        PROBE FRUFIELD "PN" "DPS-1200TB A"
                        FOUND "1200_PS2" ""

                        IFSET "1200_PS2"
                        ELSE   // 1200_PS2
                            PROBE FRUFIELD "PN" "IS162F22"
                            FOUND "1600_PS2" ""                                                       
                              IFSET "1600_PS2"
                              ELSE  // 1600_PS2
                                  PROBE FRUFIELD "PN" "PSSW162201A"
                                  FOUND "1600DC_PS2" ""
                              ENDIF  // 1600_PS2
                        ENDIF  // 1200_PS2
                    ENDIF  // PS2_FRU_IPMI
                ENDIF  // PS2_FRU
	        ENDIF  // 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" "FR1304HSBP"
                    FOUND "HSBP_1_BP4" ""
                    //PROBE FRUFIELD "PN" "FUP8X35HSBP"
                    //FOUND "HSBP_1_BP8" ""
                    PROBE FRUFIELD "PN" "F1U8X25HSBP"
                    FOUND "HSBP_1_25DT" ""
                ENDIF  // HSBP_CK11
            ENDIF // HSBP1_PR

            IFSET   "LHP_LAN"
                // OB Check------------------------------------------------------------------------------------------------
                // Is OB-CPU 0 Temp installed with a FRU device?
                PROBE "PING" "05" "A0"
                FOUND "OB_0" "" //OB CPU 0 FRU

                // Is OB-CPU 1 Temp installed with a FRU device?
                PROBE "PING" "05" "A2"
                FOUND "OB_1" "" //OB CPU 1 FRU

                // Is OB-CPU 2 Temp installed with a FRU device?
                PROBE "PING" "05" "A4"
                FOUND "OB_2" "" //OB CPU 2 FRU

                // Is OB-CPU 3 Temp installed with a FRU device?
                PROBE "PING" "05" "A6"
                FOUND "OB_3" "" //OB CPU 3 FRU
            ELSE    // LHP_LAN
                // Riser Check---------------------------------------------------------------------------------------------
                // Is riser 1 installed with a FRU device?
                PROBE "PING" "05" "A0"
                FOUND "RISER_1" "" // Riser 1 - Right Forward/Aft FRU device

                // Is riser 2 installed with a FRU device?
                PROBE "PING" "05" "A2"
                FOUND "RISER_2" "" // Riser 2 - Right Forward/Aft FRU device
                
            ENDIF   // LHP_LAN

            // GPGPU Check---------------------------------------------------------------------------------------------
            // To Do ~

	    DISPLAY ""
            DISPLAY "                                Detected Hardware"
            DISPLAY "********************************************************************************"

			// Detect Front Panel Tempature
            PROBE "PING" "03" "9A"
            FOUND "FP_TEMP" ""

            IFSET	"FP_TEMP"
                DISPLAY ""
                DISPLAY "Front Panel Temperature Sensor is detected."
            ELSE    // FP_TEMP
                // All Intel(R) chassis have a front panel intel temp sensor
                DISPLAY ""
                DISPLAY "Front Panel Temperature sensor device hardware not found."
                DISPLAY "Chassis fan Speed Control (FSC) will not work properly without this sensor!"
                DISPLAY ""
            ENDIF    // FP_TEMP
			
            // Power Supply show prompt--------------------------------------------------------------------------------
            // Power Supply Module 1
            IFSET "PS1"
                //Power Supply 1 is detected.
                IFSET "PS1_FRU_IPMI"
                    IFSET "1200_PS1"
                        SET "PS_REDUNDANCY"
                        DISPLAY ""
                        DISPLAY "1200W Power Supply 1 is detected."
                    ELSE  // 1200_PS1
                        // To Do 1600W AC PSU
                        IFSET "1600_PS1"
                            SET "PS_REDUNDANCY"
                            DISPLAY ""
                            DISPLAY "1600W AC Power Supply 1 is detected."
                        ELSE   // 1600_PS1
                            // To Do 1600W DC PSU
                            IFSET "1600DC_PS1"
                                SET "PS_REDUNDANCY"
                                DISPLAY ""
                                DISPLAY "1600W DC Power Supply 1 is detected."
                            ELSE   // 1600DC_PS1
                                DISPLAY ""
                                DISPLAY "Power supply 1 is detected but its FRU data is either corrupted or blank."
                                DISPLAY "Sensors for power supply 1 will not be installed."
                            ENDIF  // 1600DC_PS1
                        ENDIF  // 1600_PS1
                    ENDIF  // 1200_PS1
                ELSE   // PS1_FRU_IPMI
                    DISPLAY ""
                    DISPLAY "Power supply 1 is detected but its FRU data is invalid."
                    DISPLAY "Sensors for power supply 1 will not be installed."
                ENDIF  // PS1_FRU_IPMI
            ELSE   // PS1
                DISPLAY ""
                DISPLAY "Power supply 1 is not detected."
                DISPLAY "Sensors for power supply 1 will not be installed."
            ENDIF  // PS1

            // Power Supply Module 2
            IFSET "PS2"
                IFSET "PS2_FRU_IPMI"
                    IFSET "1200_PS2"
                        SET "PS_REDUNDANCY"
                        DISPLAY ""
                        DISPLAY "1200W Power Supply 2 is detected."
                    ELSE
                        // To Do 1600W AC PSU
                        IFSET "1600_PS2"
                            SET "PS_REDUNDANCY"
                            DISPLAY ""
                            DISPLAY "1600W AC Power Supply 2 is detected."
                        ELSE   // 1600_PS2
                            // To Do 1600W DC PSU                   
                            IFSET "1600DC_PS2"
                                SET "PS_REDUNDANCY"
                                DISPLAY ""
                                DISPLAY "1600W DC Power Supply 2 is detected."
                            ELSE   // 1600DC_PS2
                                DISPLAY ""
                                DISPLAY "Power supply 2 is detected but its FRU data is either corrupted or blank."
                                DISPLAY "Sensors for power supply 2 will not be installed."
                            ENDIF  // 1600DC_PS2
                        ENDIF  // 1600_PS2
                    ENDIF
                ELSE    // PS2_FRU_IPMI
                    DISPLAY ""
                    DISPLAY "Power supply 2 is detected but its FRU data is invalid."
                    DISPLAY "Sensors for power supply 2 will not be installed."
                ENDIF   // PS2_FRU_IPMI
            ELSE   // PS2
                DISPLAY ""
                DISPLAY "Power supply 2 is not detected."
                DISPLAY "Sensors for power supply 2 will not be installed."
            ENDIF  // PS2

            // No power supply detected
            IFSET "PS_REDUNDANCY"
            ELSE  // PS_REDUNDANCY
                IFSET "OTHER"
                    // can not show power supply is not detected.
                ELSE  // OTHER
                    DISPLAY ""
                    DISPLAY "Unable to communicate with any power supply modules."
                    DISPLAY "Please resolve this issue and then re-install this SDR update."
                    DISPLAY ""
                ENDIF  // OTHER
            ENDIF  // PS_REDUNDANCY

            // HSBP show prompt----------------------------------------------------------------------------------------
            IFSET "HSBP1_PR"
                //HSBP1 is detected.
                IFSET "HSBP_1_BP4"
                    DISPLAY ""
                    DISPLAY "1U 4 X 3.5 Hot-swap HDD backplane is detected."
                ELSE  // HSBP_1_BP4
                    IFSET "HSBP_1_25DT"
                        DISPLAY ""
                        DISPLAY "1U 8 X 2.5 Hot-swap HDD backplane is detected."
                        SET     "HSBP_1_BP8"
                    ELSE  // HSBP_1_25DT
                        DISPLAY ""
                        DISPLAY "Hot-swap HDD backplane is detected but its FRU data is either corrupted or blank."
                    ENDIF  // HSBP_1_25DT
                ENDIF  // HSBP_1_BP4
            ELSE  // HSBP1_PR
                DISPLAY ""
                DISPLAY "Hot-swap HDD backplane is not detected."
            ENDIF  // HSBP1_PR

            IFSET   "LHP_LAN"
                // Orange Beach PCIe card show prompt----------------------------------------------------------------------
                // Orange Beach 0 PCIe card
                IFSET   "OB_0"
                    DISPLAY ""
                    DISPLAY "Orange Beach 0 PCIe card is detected."
                ELSE    // OB_0
                    DISPLAY ""
                    DISPLAY "Orange Beach 0 PCIe card is not detected."
                    DISPLAY "Sensors for Orange Beach 0 PCIe card will not be installed."
                ENDIF   // OB_0

                // Orange Beach 1 PCIe card
                IFSET   "OB_1"
                    DISPLAY ""
                    DISPLAY "Orange Beach 1 PCIe card is detected."
                ELSE    // OB_1
                    DISPLAY ""
                    DISPLAY "Orange Beach 1 PCIe card is not detected."
                    DISPLAY "Sensors for Orange Beach 1 PCIe card will not be installed."
                ENDIF   // OB_1

                // Orange Beach 2 PCIe card
                IFSET   "OB_2"
                    DISPLAY ""
                    DISPLAY "Orange Beach 2 PCIe card is detected."
                ELSE    // OB_2
                    DISPLAY ""
                    DISPLAY "Orange Beach 2 PCIe card is not detected."
                    DISPLAY "Sensors for Orange Beach 2 PCIe card will not be installed."
                ENDIF   // OB_2

                // Orange Beach 3 PCIe card
                IFSET   "OB_3"
                    DISPLAY ""
                    DISPLAY "Orange Beach 3 PCIe card is detected."
                ELSE    // OB_3
                    DISPLAY ""
                    DISPLAY "Orange Beach 3 PCIe card is not detected."
                    DISPLAY "Sensors for Orange Beach 3 PCIe card will not be installed."
                ENDIF   // OB_3
            ELSE    // LHP_LAN
                // Riser show prompt---------------------------------------------------------------------------------------
                // PCI Riser 1 FRU
                IFSET   "RISER_1" 
                    DISPLAY ""
                    DISPLAY "PCI Riser 1 is detected."
                ELSE    // RISER_1
                    DISPLAY ""
                    DISPLAY "PCI Riser 1 is not detected."
                    DISPLAY "Sensors for PCI Riser 1 will not be installed."
                ENDIF   // RISER_1

                // PCI Riser 2 FRU
                IFSET   "RISER_2" 
                    DISPLAY ""
                    DISPLAY "PCI Riser 2 is detected."
                ELSE    // RISER_2
                    DISPLAY ""
                    DISPLAY "PCI Riser 2 is not detected."
                    DISPLAY "Sensors for PCI Riser 2 will not be installed."
                ENDIF   // RISER_2
            ENDIF   // LHP_LAN

            // GPGPU show prompt---------------------------------------------------------------------------------------
            // To Do ~

            // I/O module show prompt----------------------------------------------------------------------------------
            // Is a I/O (module installed with a FRU device on it?
            PROBE "PING" "0D" "A4"
            FOUND "IO_MODULE_1" ""
            IFSET "IO_MODULE_1"
                DISPLAY ""
                DISPLAY "IO Module 1 is detected."
            ENDIF

            PROBE "PING" "0D" "A6"
            FOUND "IO_MODULE_2" ""
            IFSET "IO_MODULE_2"
                DISPLAY ""
                DISPLAY "IO Module 2 is detected."
            ENDIF

            // CPU show prompt-----------------------------------------------------------------------------------------
            //CPU sensors detection
            // Detect Processor 1
            PROBE "PROCESSOR" 1
            FOUND "PROC_1" ""
            IFSET "PROC_1"
                DISPLAY ""
                DISPLAY "Processor 1 is detected."
            ENDIF
            //SET "PROC_1"

            // Detect Processor 2
            PROBE "PROCESSOR" 2
            FOUND "PROC_2" ""
            IFSET "PROC_2"
                DISPLAY ""
                DISPLAY "Processor 2 is detected."
            ENDIF

            // Detect Processor 3
            PROBE "PROCESSOR" 3
            FOUND "PROC_3" ""
            IFSET "PROC_3"
                DISPLAY ""
                DISPLAY "Processor 3 is detected."
            ENDIF

            // Detect Processor 4
            PROBE "PROCESSOR" 4
            FOUND "PROC_4" ""
            IFSET "PROC_4"
                DISPLAY ""
                DISPLAY "Processor 4 is detected."
            ENDIF

            DISPLAY ""
            DISPLAY "********************************************************************************"

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

            IFSET "LHP_TP"
                //System Fans
                DISPLAY     ""
                MENUTITLE   "Select the system fan type"
                MENU        "SYSTEM_FAN_4P"     "4 pin"
                MENU        "SYSTEM_FAN_10P"    "10 pin"
                MENUPROMPT
                DISPLAY ""

                IFSET "SYSTEM_FAN_4P"
                        //System Fans 4P
                        SET     "SYSTEM_FAN_01_SINGLE_4P"
                        SET     "SYSTEM_FAN_02_SINGLE_4P"
                        SET     "SYSTEM_FAN_04_SINGLE_4P"
                        SET     "SYSTEM_FAN_05_SINGLE_4P"
                ENDIF  // SYSTEM_FAN_4P

                IFSET "SYSTEM_FAN_10P"
                        //System Fans 10P
                        DISPLAY ""
                        PROMPT  "Is System Fan 1 installed?"
                        YES     "SYSTEM_FAN_01_SINGLE_10P"
                        NO      ""

                        DISPLAY ""
                        PROMPT  "Is System Fan 2 installed?"
                        YES     "SYSTEM_FAN_02_SINGLE_10P"
                        NO      ""

                        DISPLAY ""
                        PROMPT  "Is System Fan 3 installed?"
                        YES     "SYSTEM_FAN_03_SINGLE_10P"
                        NO      ""

                        DISPLAY ""
                        PROMPT  "Is System Fan 4 installed?"
                        YES     "SYSTEM_FAN_04_SINGLE_10P"
                        NO      ""

                        DISPLAY ""
                        PROMPT  "Is System Fan 5 installed?"
                        YES     "SYSTEM_FAN_05_SINGLE_10P"
                        NO      ""

                        DISPLAY ""
                        PROMPT  "Is System Fan 6 installed?"
                        YES     "SYSTEM_FAN_06_SINGLE_10P"
                        NO      ""

                        DISPLAY ""
                        PROMPT  "Is System Fan 7 installed?"
                        YES     "SYSTEM_FAN_07_SINGLE_10P"
                        NO      ""
                ENDIF  // SYSTEM_FAN_10P

                DISPLAY ""
                PROMPT  "Is Base Board Fan 1 installed?"
                YES     "SYSTEM_FAN_FCT_1_SINGLE"
                NO      ""

                DISPLAY ""
                PROMPT  "Is Base Board Fan 2 installed?"
                YES     "SYSTEM_FAN_FCT_2_SINGLE"
                NO      ""

                //CPU Fans
                DISPLAY ""
                PROMPT  "Is CPU1 FAN installed?"
                YES     "CPU1_FAN_SINGLE"
                NO      ""

                DISPLAY ""
                PROMPT  "Is CPU2 FAN installed?"
                YES     "CPU2_FAN_SINGLE"
                NO      ""

                DISPLAY ""
                PROMPT  "Is CPU3 FAN installed?"
                YES     "CPU3_FAN_SINGLE"
                NO      ""

                DISPLAY ""
                PROMPT  "Is CPU4 FAN installed?"
                YES     "CPU4_FAN_SINGLE"
                NO      ""

                
                SET "R2000"
                SET "CHASSIS_INTRU"
                SET     "FP_TEMP"
                SET     "HSBP_1_BP4"
                SET     "HSBP_1_BP8"
            ENDIF  // LHP_TP

            //Lizard Head Pass Row SKU --------------------------------------------------------------------------------
            IFSET "LHP_ROW"
                //System Fans
                SET     "R2000_SYS_FAN"             		// System Fan 1A~11B
                SET     "R2000"
                SET     "CHASSIS_INTRU"
                SET     "FP_TEMP"
                SET     "HSBP_1_BP4"
                SET     "HSBP_1_BP8"
            ENDIF  // LHP_ROW

            //Lizard Head Pass LAN SKU --------------------------------------------------------------------------------
            IFSET "LHP_LAN"
                //System Fans
                SET     "R2000_SYS_FAN"             		// System Fan 1A~11B
                SET     "R2000"
                CLEAR   "HSBP_1_BP4"
                CLEAR   "HSBP_1_BP8"
            ENDIF // LHP_LAN

            //OTHER chassis -------------------------------------------------------------------------------------------
            IFSET "OTHER"
                
                DISPLAY     ""
                MENUTITLE   "Select the system fan type"
                MENU        "DUAL_ROTOR"     "Dual Rotor Hotswap"
                MENU        "SINGLE_ROTOR"    "Single Rotor Fixed"
                MENUPROMPT
                DISPLAY ""
                
                IFSET "DUAL_ROTOR"
                    //System Fans
                    DISPLAY ""
                    PROMPT  "Is System Fan 1 installed?"
                    YES     "SYSTEM_FAN_1"
                    NO      ""
    
                    DISPLAY ""
                    PROMPT  "Is System Fan 2 installed?"
                    YES     "SYSTEM_FAN_2"
                    NO      ""
    
                    DISPLAY ""
                    PROMPT  "Is System Fan 3 installed?"
                    YES     "SYSTEM_FAN_3"
                    NO      ""
    
                    DISPLAY ""
                    PROMPT  "Is System Fan 4 installed?"
                    YES     "SYSTEM_FAN_4"
                    NO      ""
    
                    DISPLAY ""
                    PROMPT  "Is System Fan 5 installed?"
                    YES     "SYSTEM_FAN_5"
                    NO      ""
    
                    DISPLAY ""
                    PROMPT  "Is System Fan 6 installed?"
                    YES     "SYSTEM_FAN_6"
                    NO      ""
    
                    DISPLAY ""
                    PROMPT  "Is System Fan 7 installed?"
                    YES     "SYSTEM_FAN_7"
                    NO      ""
    
                    DISPLAY ""
                    PROMPT  "Is System Fan 8 installed?"
                    YES     "SYSTEM_FAN_8"
                    NO      ""
    
                    DISPLAY ""
                    PROMPT  "Is System Fan 9 installed?"
                    YES     "SYSTEM_FAN_9"
                    NO      ""
    
                    DISPLAY ""
                    PROMPT  "Is System Fan 10 installed?"
                    YES     "SYSTEM_FAN_10"
                    NO      ""
    
                    DISPLAY ""
                    PROMPT  "Is System Fan 11 installed?"
                    YES     "SYSTEM_FAN_11"
                    NO      ""
    
                    DISPLAY ""
                    PROMPT  "Is Base Board Fan 1 installed?"
                    YES     "SYSTEM_FAN_FCT_1"
                    NO      ""
    
                    DISPLAY ""
                    PROMPT  "Is Base Board Fan 2 installed?"
                    YES     "SYSTEM_FAN_FCT_2"
                    NO      ""
    
                    //CPU Fans
                    DISPLAY ""
                    PROMPT  "Is CPU1 FAN installed?"
                    YES     "CPU1_FAN"
                    NO      ""
    
                    DISPLAY ""
                    PROMPT  "Is CPU2 FAN installed?"
                    YES     "CPU2_FAN"
                    NO      ""
    
                    DISPLAY ""
                    PROMPT  "Is CPU3 FAN installed?"
                    YES     "CPU3_FAN"
                    NO      ""
    
                    DISPLAY ""
                    PROMPT "Is CPU4 FAN installed?"
                    YES "CPU4_FAN"
                    NO ""                

                    //for fan redundancy sensor
                    IFSET "SYSTEM_FAN_1" "SYSTEM_FAN_2" "SYSTEM_FAN_3" "SYSTEM_FAN_4" "SYSTEM_FAN_5" "SYSTEM_FAN_6" "SYSTEM_FAN_7" "SYSTEM_FAN_8" "SYSTEM_FAN_9" "SYSTEM_FAN_10" "SYSTEM_FAN_11"
                        SET "FAN_REDUN_FLAG"
                    ENDIF

                    //SET "RISER"

                    //IFSET "HSBP1_PR"
                      //  SET "HSBP_1"
                    //ENDIF

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

                    //Power Supply Module 1 & 2
                    CLEAR   "PS_REDUNDANCY"
                    CLEAR   "1200_PS1"
                    CLEAR   "1200_PS2"
                    CLEAR   "1600_PS1"
                    CLEAR   "1600_PS2"
                    CLEAR   "1600DC_PS1"
                    CLEAR   "1600DC_PS2"
                ELSE//"DUAL_ROTOR"
                    IFSET "SINGLE_ROTOR"
                        DISPLAY ""
                        PROMPT  "Is Base Board Fan 1 installed?"
                        YES     "SYSTEM_FAN_FCT_1_SINGLE"
                        NO      ""

                        DISPLAY ""
                        PROMPT  "Is Base Board Fan 2 installed?"
                        YES     "SYSTEM_FAN_FCT_2_SINGLE"
                        NO      ""

                        //CPU Fans
                        DISPLAY ""
                        PROMPT  "Is CPU1 FAN installed?"
                        YES     "CPU1_FAN_SINGLE"
                        NO      ""

                        DISPLAY ""
                        PROMPT  "Is CPU2 FAN installed?"
                        YES     "CPU2_FAN_SINGLE"
                        NO      ""

                        DISPLAY ""
                        PROMPT  "Is CPU3 FAN installed?"
                        YES     "CPU3_FAN_SINGLE"
                        NO      ""

                        DISPLAY ""
                        PROMPT  "Is CPU4 FAN installed?"
                        YES     "CPU4_FAN_SINGLE"
                        NO      ""

                        //for fan redundancy sensor
                        IFSET "SYSTEM_FAN_1" "SYSTEM_FAN_2" "SYSTEM_FAN_3" "SYSTEM_FAN_4" "SYSTEM_FAN_5" "SYSTEM_FAN_6" "SYSTEM_FAN_7" "SYSTEM_FAN_8" "SYSTEM_FAN_9" "SYSTEM_FAN_10" "SYSTEM_FAN_11"
                            SET "FAN_REDUN_FLAG"
                        ENDIF

                        //SET "RISER"

                        //IFSET "HSBP1_PR"
                          //  SET "HSBP_1"
                        //ENDIF

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

                        //Power Supply Module 1 & 2
                        CLEAR   "PS_REDUNDANCY"
                        CLEAR   "1200_PS1"
                        CLEAR   "1200_PS2"
                        CLEAR   "1600_PS1"
                        CLEAR   "1600_PS2"
                        CLEAR   "1600DC_PS1"
                        CLEAR   "1600DC_PS2"
                    ENDIF  // "SINGLE_ROTOR"
                ENDIF  // "DUAL_ROTOR"
            ENDIF  // OTHER

            //Shipping ------------------------------------------------------------------------------------------------
            IFSET "SHIP"
                CLEAR   "PROC_1"
                CLEAR   "PROC_2"
                CLEAR   "PROC_3"
                CLEAR   "PROC_4"

                CLEAR   "HSBP_1"
                CLEAR   "HSBP_1_BP4"
                CLEAR   "HSBP_1_BP8"
                CLEAR   "HSBP_1_25DT"

                CLEAR   "RISER_1"
                CLEAR   "RISER_2"
              
                CLEAR   "FP_TEMP"

                CLEAR   "IO_MODULE_1"
                CLEAR   "IO_MODULE_2"

                CLEAR   "PS_REDUNDANCY"
                CLEAR   "1200_PS1"
                CLEAR   "1200_PS2"
                CLEAR   "1600_PS1"
                CLEAR   "1600_PS2"
                CLEAR   "1600DC_PS1"
                CLEAR   "1600DC_PS2"
            ENDIF  // SHIP

            //FCT -----------------------------------------------------------------------------------------------------
            IFSET "FCT"
                //System Fans
                SET     "SYSTEM_FAN_FCT_1_SINGLE"
                SET     "SYSTEM_FAN_FCT_2_SINGLE"
                SET     "CPU1_FAN_SINGLE"
                SET     "CPU2_FAN_SINGLE"
                SET     "CPU3_FAN_SINGLE"
                SET     "CPU4_FAN_SINGLE"

                CLEAR   "PROC_1"
                CLEAR   "PROC_2"
                CLEAR   "PROC_3"
                CLEAR   "PROC_4"

                CLEAR   "HSBP_1"
                CLEAR   "HSBP_1_25DT"

                SET     "FP_TEMP"

                SET     "IO_MODULE_1"
                SET     "IO_MODULE_2"

                SET     "RISER_1"
                SET     "RISER_2"
              
                //Chassis intrusion
                SET     "CHASSIS_INTRU"

                SET     "1200_PS1"
                SET     "1200_PS2"
                SET     "HSBP_1_BP4"
                SET     "HSBP_1_BP8"
                CLEAR   "1600_PS1"
                CLEAR   "1600_PS2"
                CLEAR   "1600DC_PS1"
                CLEAR   "1600DC_PS2"
            ENDIF  // "FCT"
            
            //modify part2
            IFSET "FCT_LAN"
                CLEAR     "FP_TEMP"
                CLEAR     "HSBP_1_BP4"
                CLEAR     "HSBP_1_BP8"
                CLEAR     "IO_MODULE_2"
                CLEAR     "SYSTEM_FAN_FCT_1_SINGLE"
                CLEAR     "SYSTEM_FAN_FCT_2_SINGLE"
                CLEAR     "CPU1_FAN_SINGLE"
                CLEAR     "CPU2_FAN_SINGLE"
                CLEAR     "CPU3_FAN_SINGLE"
                CLEAR     "CPU4_FAN_SINGLE"
            ENDIF  // "FCT_LAN"
            
            //FCT2 ---------------------------------------------------------------------------------------------------
            IFSET "FCT2"
                //System Fans
                SET     "SYSTEM_FAN_FCT_1_SINGLE"
                SET     "SYSTEM_FAN_FCT_2_SINGLE"
                SET     "CPU1_FAN_SINGLE"

                SET     "FP_TEMP"

                //Processor
                SET     "PROC_1"
                CLEAR   "PROC_2"
                CLEAR   "PROC_3"
                CLEAR   "PROC_4"

                CLEAR   "HSBP_1"
                CLEAR   "HSBP_1_BP4"
                CLEAR   "HSBP_1_BP8"
                CLEAR   "HSBP_1_25DT"

                CLEAR   "RISER_1"
                CLEAR   "RISER_2"

                CLEAR   "IO_MODULE_1"
                CLEAR   "IO_MODULE_2"

                SET     "1200_PS1"
                CLEAR   "1200_PS2"
            ENDIF  // "FCT2"

            SDRNAME "S4600LH.sdr"        // Update SDR Repository
            BMC_REFRESH
        ENDIF  // SDR

        IFSET "FRU"
            // ******************************
            //   Update Base Board FRU areas
            // ******************************
            IFSET "S4600LH"
                DISPLAY     ""
                DISPLAY     "Updating FRU areas"

                //Update Baseboard FRU data
                //IFSET    "AUTO_DETECTION"
                    IFSET    "LHP_LAN"
                        IFSET    "LAN_BOARD_T"
                            FRUNAME     "SVRBD-LAN_T.fru"
                        ELSE 
                            //FRUNAME     "S4600LH.fru"
			    SET "EXIT2"
                            DISPLAY "FRU Board Product name is invalid or FRU is empty."
                        ENDIF // LAN_BOARD_T
                    ELSE  // LHP_LAN
                        IFSET    "LHP_ROW"
                            IFSET    "ROW_BOARD_P"
                                FRUNAME     "SVRBD-ROW_P.fru"
                            ELSE
                                IFSET    "ROW_BOARD_T"
                                    FRUNAME     "SVRBD-ROW_T.fru"
                                ELSE
                                    //FRUNAME     "S4600LH.fru"
				    SET "EXIT2"
                                    DISPLAY "FRU Board Product name is invalid or FRU is empty."
                                ENDIF // ROW_BOARD_T
                            ENDIF // ROW_BOARD_P
                        ELSE
                            //FRUNAME     "S4600LH.fru"
			    SET "EXIT2"
                            DISPLAY "FRU Board Product name is invalid or FRU is empty."
                        ENDIF  // LHP_ROW
                    ENDIF  // LHP_LAN
                //ENDIF // AUTO_DETECTION
    	      IFSET "EXIT2"
        	  DISPLAY "Exit without making any FRU changes"
    	      ELSE  // EXIT2

                FRUAREA     "HEADER"
                FRUAREA     "INTERNALUSE"
                FRUAREA     "CHASSIS"
                FRUFIELD    "CT"
                
                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 // IFSET "EXIT2"
          ENDIF //END IFSET "S4600LH"

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