//****************************************************************************
//                   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) 2009 Intel Corporation. All Rights Reserved.
//****************************************************************************

CONFIGURATION   "Revision 18"
DISPLAY         "FRU & SDR Update Package for Intel(R) Server Board S5520UR"
DISPLAY         "Copyright (c) 2009 Intel Corporation"
DISPLAY         ""


// Detect baseboard by looking at the BMC product ID

PROBE           "BASEBOARD_PRODID" "01"
FOUND           "UR"  ""

IFSET "UR"
// {
    DISPLAY ""
    DISPLAY "Intel(R) Server Board S5520UR detected"
ELSE
    DISPLAY ""
    DISPLAY "This is the incorrect FRU/SDR pacakge for this baseboard"
    DISPLAY "or your platform ID is incorrectly programmed."
    DISPLAY ""
// }
ENDIF


IFSET "UR"
// {
    DISPLAY ""
    MENUTITLE   "Select the function you want to perform:"
    MENU        "SDR"       "Update only the SDR"
    MENU        "FRU"       "Update only the FRU"
    MENU        "BOTH"      "Update both the SDR and the FRU"
    MENU        "ASSET"     "Modify the Asset Tag"  
//  MENU        "FCT"       "Functional Test"
//  MENU        "FOQM"      "Functional Outgoing Manufacturing Test"
//  MENU        "SHIPPING"  "Default shipping configuration"
    MENU        "EXIT1"     "Exit FRU/SDR update"
    MENUPROMPT
    DISPLAY     " "

IFSET "BOTH"
// {
    SET "SDR"
    SET "FRU"
// }
ENDIF


// Skip HW probing if using any of the manufacturing specific configuration are selected
IFSET   "FCT"
    SET "MFG_CONFIG"
ENDIF

IFSET   "FOQM"
    SET "MFG_CONFIG"
ENDIF

IFSET   "SHIPPING"
    SET "MFG_CONFIG"
ENDIF 

IFSET "EXIT1"
// {
    DISPLAY "Exiting without performing any updates"
    ELSE
        // Skip all chassis and HW probing and program the selected manufacturing configuration
        IFSET "MFG_CONFIG"
            SDRNAME   "UR_BMC.sdr"	// Update SDR Repository
	    	BMC_REFRESH             // Refresh (cold reset) the BMC forcing it to read the new SDR data just written to flash
        ENDIF

        IFSET "SDR"
        //{
            DISPLAY "Auto detecting chassis type...."
            DISPLAY "This may take up to 1 minute to complete."
            PROBE "PING" "09" "A0"
                FOUND "PS1" ""
                
            PROBE "PING" "09" "A2"
                FOUND "PS2" ""

            IFSET "PS1"
            //{
                FRUNAME "SYSTEM"
                FRUADDRESS 02
                FRUAREA "PRODUCT" VALIDATE PS1_FRU_IPMI
                
                IFSET "PS1_FRU_IPMI"
					FRUAREA "PRODUCT"
                    PROBE FRUFIELD "PN" "TDPS-600EB A"
                    FOUND "SR1600UR" "NO_SR1600UR"

                    IFSET "NO_SR1600UR"
						FRUAREA "PRODUCT"
                        PROBE FRUFIELD "PN" "DPS-650QBA"
                        FOUND "SR1625UR" "NO_SR1625UR"

                        IFSET "NO_SR1625UR"
                            CLEAR   "NO_SR1625UR"
							FRUAREA "PRODUCT"
                            PROBE FRUFIELD "PN" "DPS-650QB A"
                            FOUND   "SR1625UR" "NO_SR1625UR"

                            IFSET "NO_SR1625UR"
								FRUAREA "PRODUCT"
                                PROBE FRUFIELD "PN" "DPS-750PBA"
                                FOUND "SR2600UR" "NO_SR2600UR"
        
                                IFSET "NO_SR2600UR"
                                    CLEAR   "NO_SR2600UR"
									FRUAREA "PRODUCT"
                                    PROBE FRUFIELD "PN" "DPS-750PB A"
                                    FOUND "SR2600UR" "NO_SR2600UR"

									IFSET "NO_SR2600UR"
										CLEAR   "NO_SR2600UR"
										FRUAREA "PRODUCT"
										PROBE FRUFIELD "PN" "DPS-750QB A"
										FOUND "SR2600UR" "NO_SR2600UR"

										IFSET "NO_SR2600UR"
											DISPLAY ""
											DISPLAY "Unable to detect Intel chassis."
											DISPLAY "Falling back to user selection as auto detection is not possible."
											SET "CHASSIS_MENU"
										ENDIF
									ENDIF
                                ENDIF
                            ENDIF
                        ENDIF
                    ENDIF
                ELSE
                    DISPLAY ""
                    DISPLAY "Power supply FRU is invalid."
					DISPLAY "Falling back to user selection as auto detection is not possible."
                    SET "CHASSIS_MENU"
                ENDIF

            ELSE
                IFSET "PS2"
                    DISPLAY ""
                    DISPLAY "Single power supply is installed in the incorrect slot."
                    DISPLAY "Please move supply to the other slot in the PDB and re-run this FRU/SDR pacakge installation."
                    SET "SKIP_UPDATE"
                    SET "SKIP_PROBE"
                ELSE
                    DISPLAY ""
                    DISPLAY "Unable to communicate with any power supply."
                    SET "CHASSIS_MENU"
                ENDIF
            //}
            ENDIF

			// Determine if SR2600UR chassis supports a hot-swappable fan #2, if so then then determine if 
			// it is an LX (Fan 1) or SAS (No Fan 1)
			// If no hot-swap fans are detected then it is a BRP.
            IFSET "SR2600UR"
                PROBE "FAN_SIGNAL" 01 01
                FOUND "FAN_2" 
         
				IFSET "FAN_2" 
					PROBE "FAN_SIGNAL" 00 01
					FOUND "FAN_1"
						
					IFSET "FAN_1"
						SET "SR2600URLX"
					ELSE
						SET "SR2600URSAS"
					ENDIF
					
				ELSE
					SET "SR2600URBRP"
				ENDIF
            ENDIF

    //****************************************************************************************************
    // Display chassis selection menu only if auto-detection fails
    //*****************************************************************************************************
    IFSET "CHASSIS_MENU"
    // {
        DISPLAY    " "
        MENUTITLE   "Select the Chassis"
        MENU        "SR1600UR"     "Intel(R) Server Chassis SR1600UR"
        MENU        "SR1625UR"     "Intel(R) Server Chassis SR1625UR"
        MENU        "SR2600URBRP"  "Intel(R) Server Chassis SR2600URBRP"
        MENU        "SR2600URLX"   "Intel(R) Server Chassis SR2600URLX"
		MENU		"SR2612UR"	   "Intel(R) Server Chassis SR2612UR"
        MENU        "SR2625URBRP"  "Intel(R) Server Chassis SR2625URBRP"
        MENU        "SR2625URLX"   "Intel(R) Server Chassis SR2625URLX"
		MENU        "SR2625URSAS"  "Intel(R) Server Chassis SR2625URSAS"
        MENU        "OTHER"        "Other Chassis"
        MENUPROMPT
		DISPLAY " "
		DISPLAY "Continuing to probe chassis hardware which may take up to 3 minutes."
    // }
    ENDIF
    
        IFSET   "SKIP_PROBE"
        //{
            // Skip probing the hardware 

        ELSE    // Probe the HW
        //{
			PROBE	"PROCESSOR"	1
                FOUND	"PROCESSOR_1"	""
                
			PROBE	"PROCESSOR"	2
                FOUND	"PROCESSOR_2"	""
                
            PROBE  "DEVICE_ID" "00" "C0" "A09"
                FOUND "DR235BP" ""
				
            PROBE  "DEVICE_ID" "00" "C0" "A0A"
                FOUND "DO235BP" ""
				
            PROBE  "DEVICE_ID" "00" "C0" "A0B"
                FOUND "DR225BP" ""
				
            PROBE "DEVICE_ID" "00" "22"
                FOUND "LCP" ""
				
            PROBE "PING" "03" "9A"
                FOUND "FP_TEMP" ""
                
            PROBE "PING" "09" "A0"
                FOUND "PS1" ""
                
            PROBE "PING" "09" "A2"
                FOUND "PS2" ""
                
            PROBE "PING" "09" "AC"
                FOUND "PDB_FRU" ""
				
			// Print out summary of detected HW
            DISPLAY ""
            DISPLAY "                                Detected Hardware"
			DISPLAY "********************************************************************************"

            IFSET   "SR1600UR"
                DISPLAY "SR1600UR Chassis"
            ENDIF
            
            IFSET   "SR1625UR"
                DISPLAY "SR1625UR Chassis"
            ENDIF
                
            IFSET   "SR2600URBRP"
                IFSET   "DR235BP"
                    DISPLAY "SR2600URBRP Chassis"
                ELSE
                    IFSET "DR225BP"
                        DISPLAY "SR2625URBRP Chassis"
                        CLEAR   "SR2600URBRP"
                        SET     "SR2625URBRP"
                    ENDIF
                ENDIF
            ENDIF

            IFSET   "SR2600URLX"
                IFSET   "DR235BP"
                    DISPLAY "SR2600URLX Chassis"
                ELSE
                    IFSET "DR225BP"
                        DISPLAY "SR2625URLX Chassis"
                        CLEAR   "SR2600URLX"
                        SET     "SR2625URLX"
                    ENDIF
                ENDIF
            ENDIF

            IFSET   "SR2600URSAS"
                IFSET "DR225BP"
					DISPLAY "SR2625URSAS Chassis"
					CLEAR   "SR2600URLX"
					SET     "SR2625URSAS"
				ENDIF
            ENDIF

            IFSET "DR235BP"
                DISPLAY "6 Drive Hotswap Backplane (HSBP)"
            ENDIF

            IFSET "DO235BP"
                DISPLAY "3 Drive Hotswap Backplane (HSBP)"
            ENDIF

            IFSET "DR225BP"
                DISPLAY "8 Drive Hotswap Backplane (HSBP)"
			ENDIF

			IFSET	"PROCESSOR_1"
   		        DISPLAY "Processor 1"
			ENDIF

			IFSET	"PROCESSOR_2"
		       	DISPLAY "Processor 2"			
			ENDIF
            
			IFSET	"LCP"
		        DISPLAY "Local Control Panel"			
			ENDIF

			IFSET	"FP_TEMP"
   		        DISPLAY "Front Panel Temperature Sensor"
			ENDIF

			IFSET	"PDB_FRU"
   		        DISPLAY "Power Distribution Board FRU Device"			
			ENDIF

			IFSET	"PS1"
   		        DISPLAY "Power Supply 1"			
			ENDIF

			IFSET	"PS2"
		        DISPLAY "Power Supply 2"			
			ENDIF

			IFSET   "PS1" "PS2"
                DISPLAY "Redundant Power Unit"			
			ENDIF
			DISPLAY "********************************************************************************"
        //}
        ENDIF        

			//*****************************************************************
			// Set additional chassis/HW specific SDR tags
			//*****************************************************************
            
			IFSET "SR1600UR"
			// {
				// Set SDR tags for items that cannot be probed but are standard on the SR1600UR chassis
				SET "NO_INTRUSION"
				SET "FP_NMI"
				IFSET "PS1"
				// {
					SET "PS1_FRU"
				// }
				ENDIF
                
                IFSET "PROCESSOR_2"
                // {
                    SET "SR1600UR_CPU2"
                // }
                ENDIF

			// }
			ENDIF
                
			IFSET "SR1625UR"
			// {
				// Set SDR tags for items that cannot be probed but are standard on the SR1625UR chassis
				SET "NO_INTRUSION"
				SET "FP_NMI"
                
				// Set addtional SDR tags based on the result of HW probing
				IFSET "PS1"
				// {
					SET "SR1625UR_PS1"
					SET "PS1_FRU"
				// }
				ENDIF
				
				IFSET "PS2"
				// {
					SET "SR1625UR_PS2"
					SET "PS2_FRU"
				// }
				ENDIF
				
				IFSET "PS1" "PS2"
				// {
					SET "REDUNDANT_PDB"
				// }
				ENDIF
                
                IFSET "PROCESSOR_2"
                // {
                    SET "SR1625UR_CPU2"
                // }
                ENDIF
                
			// }
			ENDIF
            
			IFSET "SR2600URBRP"
			// {
				// Set SDR tags for items that cannot be probed but are standard on the SR2600URBRP chassis
				SET "INTRUSION"
				SET "FP_NMI"
                
				// Set addtional SDR tags based on the result of HW probing
				IFSET "PS1"
				// {
					SET "SR2600URBRP_PS1"
					SET "PS1_FRU"
				// }
				ENDIF
				
				IFSET "PS2"
				// {
					SET "SR2600URBRP_PS2"
					SET "PS2_FRU"
				// }
				ENDIF
				
				IFSET "PS1" "PS2"
				// {
					SET "REDUNDANT_PDB"
				// }
				ENDIF
                
                IFSET "PROCESSOR_2"
                // {
                    SET "SR2600URBRP_CPU2"
                // }
                ENDIF
				
			// }
			ENDIF
            
			IFSET "SR2600URLX"
			// {
				// Set SDR tags for items that cannot be probed but are standard on the SR2600URLX chassis
				SET "INTRUSION"
				SET "FP_NMI"
              
				// Set addtional SDR tags based on the result of HW probing
				IFSET "PS1"
				// {
					SET "SR2600URLX_PS1"
					SET "PS1_FRU"
				// }
				ENDIF
				
				IFSET "PS2"
				// {
					SET "SR2600URLX_PS2"
					SET "PS2_FRU"
				// }
				ENDIF
				
				IFSET "PS1" "PS2"
				// {
					SET "REDUNDANT_PDB"
				// }
				ENDIF
                
                IFSET "PROCESSOR_2"
                // {
                    SET "SR2600URLX_CPU2"
                // }
                ENDIF
				
			// }
			ENDIF
            
			IFSET "SR2612UR"
			// {
				// Set SDR tags for items that cannot be probed but are standard on the SR2612UR chassis
				SET "NO_INTRUSION"
				SET "FP_NMI"
                
				// Set addtional SDR tags based on the result of HW probing
				IFSET "PS1"
				// {
					SET "SR2612UR_PS1"
					SET "PS1_FRU"
				// }
				ENDIF
				
				IFSET "PS2"
				// {
					SET "SR2612UR_PS2"
					SET "PS2_FRU"
				// }
				ENDIF
				
				IFSET "PS1" "PS2"
				// {
					SET "REDUNDANT_PDB"
				// }
				ENDIF
                
                IFSET "PROCESSOR_2"
                // {
                    SET "SR2612UR_CPU2"
                // }
                ENDIF
				
			// }
			ENDIF
				
			IFSET "SR2625URBRP"
			// {
				// Set SDR tags for items that cannot be probed but are standard on the SR2625URBRP chassis
				SET "INTRUSION"
				SET "FP_NMI"
                
				// Set addtional SDR tags based on the result of HW probing
				IFSET "PS1"
				// {
					SET "SR2625URBRP_PS1"
					SET "PS1_FRU"
				// }
				ENDIF
				
				IFSET "PS2"
				// {
					SET "SR2625URBRP_PS2"
					SET "PS2_FRU"
				// }
				ENDIF
				
				IFSET "PS1" "PS2"
				// {
					SET "REDUNDANT_PDB"
				// }
				ENDIF
                
                IFSET "PROCESSOR_2"
                // {
                    SET "SR2625URBRP_CPU2"
                // }
                ENDIF
				
			// }
			ENDIF
            
			IFSET "SR2625URLX"
			// {
				// Set SDR tags for items that cannot be probed but are standard on the SR2625URLX chassis
				SET "INTRUSION"
				SET "FP_NMI"
				SET "REDUNDANT_FANS"
                
				// Set addtional SDR tags based on the result of HW probing
				IFSET "PS1"
				// {
					SET "SR2625URLX_PS1"
					SET "PS1_FRU"
				// }
				ENDIF
				
				IFSET "PS2"
				// {
					SET "SR2625URLX_PS2"
					SET "PS2_FRU"
				// }
				ENDIF
				
				IFSET "PS1" "PS2"
				// {
					SET "REDUNDANT_PDB"
				// }
				ENDIF
                
                IFSET "PROCESSOR_2"
                // {
                    SET "SR2625URLX_CPU2"
                // }
                ENDIF
				
			// }
			ENDIF

			IFSET "SR2625URSAS"
			// {
				// Set SDR tags for items that cannot be probed but are standard on the SR2625URSAS chassis
				SET "INTRUSION"
				SET "FP_NMI"
				SET "REDUNDANT_FANS"
                
				// Set addtional SDR tags based on the result of HW probing
				IFSET "PS1"
				// {
					SET "SR2625URLX_PS1"
					SET "PS1_FRU"
				// }
				ENDIF
				
				IFSET "PS2"
				// {
					SET "SR2625URLX_PS2"
					SET "PS2_FRU"
				// }
				ENDIF
				
				IFSET "PS1" "PS2"
				// {
					SET "REDUNDANT_PDB"
				// }
				ENDIF
                
                IFSET "PROCESSOR_2"
                // {
                    SET "SR2625URSAS_CPU2"
                // }
                ENDIF
				
			// }
			ENDIF
             
			//****************************************************
			// If other chassis then query for configuration items
			//****************************************************
            
			IFSET "OTHER"
			// {
				PROMPT "Does the system detect chassis intrusion?"
				  	YES "INTRUSION"
					NO  "NO_INTRUSION"
			  
				PROMPT "Does the front panel support a NMI button?"
				  	YES "FP_NMI"
					NO  ""
                    
				PROMPT "Is CPU Fan 1 installed?"
					YES "OTHER_P1FAN"
					NO  ""
                    
                PROMPT "Is CPU Fan 2 installed?"
					YES "OTHER_P2FAN"
					NO  ""
                    
				PROMPT "Is Memory Fan 1 installed?"
					YES "OTHER_MEMFAN1"
					NO  ""
                    
                PROMPT "Is Memory Fan 2 installed?"
					YES "OTHER_MEMFAN2"
					NO  ""
                    
				PROMPT "Is System Fan 1 installed?"
					YES "OTHER_SYSFAN1"
					NO  ""
                    
				PROMPT "Is System Fan 2 installed?"
					YES "OTHER_SYSFAN2"
					NO  ""
                IFSET "PROCESSOR_2"
                // {
                    SET "OTHER_CPU2"
                // }
                ENDIF
			// }
	 	    ENDIF
		    
			// Update the SDR Repository with selected records
			
            IFSET "SKIP_UPDATE"
                // Do nothing
            ELSE
                SDRNAME   "UR_BMC.sdr"	// Update SDR Repository
	    		BMC_REFRESH	// Refresh (cold reset) the BMC forcing it to read the new SDR data just written to flash
            ENDIF
		// }
		ENDIF
		//*****************************************************************************
		// FRU file or asset tag programming
		//*****************************************************************************
	    // Process Asset tag if requested.  
	    IFSET "ASSET"
	    // {   
            FRUNAME     "SYSTEM"
            FRUADDRESS  "IMBDEVICE" FF 20
            FRUAREA     "PRODUCT"  
            FRUFIELD    "AT" "@STDIN:ASCII"
	    ELSE
            // Begin baseboard FRU update
            IFSET "FRU"
            // {
                DISPLAY     " "
                
                IFSET "UR"
                // {
                    FRUNAME     "UR_BMC.FRU"
                // }
                ENDIF
                
                FRUAREA     "HEADER"
                FRUAREA     "INTERNALUSE"
                FRUAREA     "CHASSIS"
                FRUFIELD    "CT" 
                
                PROMPT      "Do you want to update the chassis info area of the FRU (Y/N)?"
                    YES     "UPD_CHS"
                    NO      ""
                    
                IFSET "UPD_CHS"
                // {		    
                    DISPLAY     " "
                    
                    PROMPT      "Do you want to enter the chassis serial number (Y/N)?"
                        YES         "CHASS_SN"
                        NO          ""
                        
                    IFSET       "CHASS_SN"
                    // {
                        FRUFIELD    "S#" "@STDIN:ASCII"
                    // }
                    ENDIF
                    
                    DISPLAY     " "
                    
                    PROMPT      "Do you want to enter the chassis part number (Y/N)?"
                        YES         "CHASS_PN"
                        NO          ""
                        
                    IFSET       "CHASS_PN"
                    // {
                        FRUFIELD    "P#" "@STDIN:ASCII"
                    // }
                    ENDIF
                    
                    DISPLAY     " "
                    
					PROMPT		"Do you want to enter data into the additional chassis field 1 (Y/N)?"
                        YES         "CHASS_INFO_1"
                        NO          ""
                        
                    IFSET       "CHASS_INFo_1"
                    // {
                        FRUFIELD  "AM1" "@STDIN:ASCII"
                    // }
                    ENDIF
                        
                    DISPLAY		" "
					PROMPT		"Do you want to enter data into the additional chassis field 2 (Y/N)?"
                        YES         "CHASS_INFO_2"
                        NO          ""
                        
                    IFSET       "CHASS_INFo_2"
                    // {
                        FRUFIELD  "AM2" "@STDIN:ASCII"
                    // }
                    ENDIF
                // }
                ENDIF
                    
                // Update board area, S/N and P/N fields will not be written to.
                    
                FRUAREA     "BOARD"
                FRUFIELD    "MN"
                FRUFIELD    "PN"
                FRUFIELD    "ID"
                
                DISPLAY     " "
                
	            FRUAREA     "PRODUCT"
                PROMPT      "Do you want to update the product info area of the FRU (Y/N)?"
	                YES     "UPD_PRD"
	                NO      ""
                    
                IFSET "UPD_PRD"
                // {
                    FRUFIELD    "MN"
                    FRUFIELD    "PN"	      
                    FRUFIELD    "PV"
                    DISPLAY      " "
                    PROMPT      "Do you want to enter the product part number (Y/N)?"
                        YES         "PROD_PN"
                        NO          ""
                        
                    IFSET "PROD_PN"
                    // {
                        FRUFIELD    "P#" "@STDIN:ASCII"
                    // }
                    ENDIF
                    
                    DISPLAY     " "
                    PROMPT      "Do you want to enter the product serial number (Y/N)?"
                        YES         "PROD_SN"
                        NO          ""
                        
                     IFSET "PROD_SN"
                    // {
                        FRUFIELD    "S#" "@STDIN:ASCII"
                    // }
                    ENDIF
	                
                    DISPLAY     " "
                    PROMPT      "Do you want to enter an product asset tag (Y/N)?"
                        YES         "PROD_ASSET"
                        NO          ""
                        
                    IFSET "PROD_ASSET"
                    // {
                        FRUFIELD    "AT" "@STDIN:ASCII"
                    // }
                    ENDIF
                // }
                ENDIF
            // }
            ENDIF
        // }
        ENDIF
    // }
    ENDIF
// }
ENDIF

//---------------------------------------------------------------------------
