//****************************************************************************
//                   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 - 2011 Intel Corporation. All Rights Reserved.
//****************************************************************************
//
//  TITLE: Master.CFG             DATE CREATED:  26/10/2010
//****************************************************************************
//  Revision History:
//
//****************************************************************************

CONFIGURATION   "Master.cfg, Rev 2.2"
DISPLAY         "S5500WB Server Platform FRU & SDR package version 16"
DISPLAY         "Intel(R) Server Board S5500WB"
DISPLAY         "Copyright (c) 2009-2010 Intel Corporation"
DISPLAY         " "

//********************
//Detect baseboard
//********************

// Needs support from the Monolithic BMC OEM command to retreive the board ID
PROBE           "BASEBOARD_PRODID" "07"
FOUND           "WB"  ""


IFSET "WB"
	DISPLAY ""
	DISPLAY "Intel(R) Server Board S5500WB detected"
ELSE
	DISPLAY ""
	DISPLAY "This is either the incorrect FRU/SDR pacakge for this baseboard"
	DISPLAY "or the baseboard FRU has not been programmed."
	DISPLAY ""
ENDIF


IFSET "WB"
// {
//	DISPLAY ""
//	MENUTITLE   "Select the function you want 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        "FCT"   		"Functional Test"
//  	MENU        "FCT2"         	"Functional Outgoing Manufacturing Test"
// 	MENU        "SHIPPING"     	"Default shipping configuration"
//	MENU        "EXIT1" "Exit"
//	MENUPROMPT
	DISPLAY     " "

SET "SDR"

	IFSET "BOTH"
		SET "SDR"
		SET "FRU"
	ENDIF


	IFSET "EXIT1"
		DISPLAY "Exiting without performing any updates"
	ELSE	// Proceed further with SDR and/or FRU programming
	
		IFSET "FCT"							//Functional Test option
		  SDRNAME   "WB_BMC.sdr"
			BMC_REFRESH
		ENDIF
		
		IFSET "FCT2"						//Functional Outgoing Manufacturing Test option
		  SDRNAME   "WB_BMC.sdr"
			BMC_REFRESH
		ENDIF
		
		IFSET "SHIPPING"			 	//Default shipping configuration
		  SDRNAME   "WB_BMC.sdr"
			BMC_REFRESH
		ENDIF			
        	
	
		//****************************************************************************************************
		// Start of SDR processing
		// Query user for chassis model
		//
		// Chassis model, SKU and configuration will eventually be auto-detected.
		//*****************************************************************************************************
		IFSET	"SDR"
			DISPLAY		" "
			MENUTITLE   "Select the Chassis"
			MENU        "CHENBRO_4"    "Chenbro RM13204 (4 fans)"
			MENU        "FOXCONN_4"    "Intel(R) Server System SR1690WB"
			MENU        "GARDEN_ISLAND" "Intel(R) Server system SR1695WB"
			MENU        "OTHER"        "Other Chassis"
    		        MENUPROMPT
			DISPLAY		" "
		     
			SET "NO_INTRUSION"	//This SDR supports LAN leash. WB has no intrusion support.

			// Probe for sensor and FRU device hardware
			DISPLAY "Probing system for sensor and FRU device hardware."
			DISPLAY " "
      
      // ----------------- PROBING PROCESSOR 2 -----------------
      // Check for Processor ********************************************************

            DISPLAY "Detecting Processors. Please wait..."                                          

            //Probe CPU type
        PROBE PROCESSOR 01 B3 06 A4
	FOUND "NHM" "NO_NHM"
	IFSET "NO_NHM"
		CLEAR "NO_NHM"
		PROBE PROCESSOR 01 B3 06 A5
		FOUND "NHM" "NO_NHM"
	
		IFSET "NO_NHM"
			PROBE PROCESSOR 01 B3 06 C0
			FOUND "WSM" "NO_WSM"

			IFSET "NO_WSM"
				CLEAR "NO_WSM"
				PROBE PROCESSOR 01 B3 06 C1
				FOUND "WSM"	"NO_WSM"
			ENDIF
			
			IFSET "NO_WSM"
				CLEAR "NO_WSM"
				PROBE PROCESSOR 01 B3 06 C2
				FOUND "WSM"	"NO_WSM"
			ENDIF		
			
			IFSET "NO_WSM"
				DISPLAY "Unable to determine processor model."
				// Assume WSM processor(s) installed
				SET "WSM"
			ENDIF
		ENDIF
	ENDIF //IFSET "NO_NHM"

	// If WSM detected then probe to see if it is a 130 watt part
	IFSET "WSM"
		PROBE PROCESSOR_TDC 01 6E
		FOUND "WSM_130W"
				
			IFSET "WSM_130W"
				CLEAR "WSM"
			ENDIF
	ENDIF
		
	IFSET "NHM"
		DISPLAY "Processor 1: Intel(R) Xeon(R) Processor 5500 Series Present."
	ELSE
		IFSET "WSM"
			DISPLAY "Processor 1: Intel(R) Xeon(R) Processor 5600 Series Present."
		ELSE
			IFSET "WSM_130W"
				DISPLAY "Processor 1: Intel(R) Xeon(R) Processor 5600 Series 130 watt present"
			ENDIF
		ENDIF
	ENDIF //IFSET "NHM"
	 
	PROBE	"PROCESSOR"	2
	FOUND	"PROCESSOR_2"	""
	IFSET "PROCESSOR_2"
		
		IFSET "NHM"
			DISPLAY "Processor 2: Intel(R) Xeon(R) Processor 5500 Series Present."
		ELSE
			IFSET "WSM"
				DISPLAY "Processor 2: Intel(R) Xeon(R) Processor 5600 Series Present."
			ELSE
				IFSET "WSM_130W"
					DISPLAY "Processor 2: Intel(R) Xeon(R) Processor 5600 Series 130 watt present"
				ENDIF
			ENDIF
		ENDIF
	ELSE
		DISPLAY "Processor 2 is not present."
	ENDIF //IFSET "PROCESSOR_2"
		

          
      // ----------------- Decide whether we need to include clamp records for CPU1 and CPU2 (zones 2 and 3)
      IFSET "CHENBRO_4" 
		IFSET "WSM"
			SET "CHENBRO_4_WSM_CPU"
		ELSE //NHM
			SET "CHENBRO_4_NHM_CPU"
		ENDIF // IFSET "WSM"
		
		IFSET "PROCESSOR_2"
			IFSET "WSM"
				SET "CHENBRO_4_WSM_DUAL_CPU"
			ELSE //NHM
				SET "CHENBRO_4_NHM_DUAL_CPU"
			ENDIF // IFSET "WSM"
		ENDIF // IFSET "PROCESSOR_2"
			
      ENDIF //IFSET "CHENBRO_4"
      
      // For FoxConn
      IFSET "FOXCONN_4" 
		IFSET "WSM"
	      	SET "FOXCONN_4_WSM_CPU"
		ELSE //NHM
			SET "FOXCONN_4_NHM_CPU"
		ENDIF // IFSET "WSM"
		IFSET "PROCESSOR_2"
			IFSET "WSM"
	      		SET "FOXCONN_4_WSM_DUAL_CPU"
			ELSE //NHM
				SET "FOXCONN_4_NHM_DUAL_CPU"
			ENDIF // IFSET "WSM"
		ENDIF // IFSET "PROCESSOR_2"
      ENDIF //IFSET "FOXCONN_4" 
      
       // For Garden Island
            IFSET "GARDEN_ISLAND" 
      		IFSET "WSM"
      	      	SET "GARDEN_ISLAND_WSM_CPU"
      		ELSE //NHM
      			SET "GARDEN_ISLAND_NHM_CPU"
      		ENDIF // IFSET "WSM"
      		IFSET "PROCESSOR_2"
      			IFSET "WSM"
      	      		SET "GARDEN_ISLAND_WSM_DUAL_CPU"
      			ELSE //NHM
      				SET "GARDEN_ISLAND_NHM_DUAL_CPU"
      			ENDIF // IFSET "WSM"
      		ENDIF // IFSET "PROCESSOR_2"
      ENDIF //IFSET "GARDEN_ISLAND" 
      
    
                 
				
    		IFSET "CHENBRO_4"
			//Chenbro chassis does not support FP temp sensor, don't probe
		ELSE
      			// ----------------- PROBING Temp sensor -----------------
			PROBE "PING" "03" "9A"
 		 	FOUND "FP_TEMP" ""

			IFSET     "FP_TEMP"
                		DISPLAY "Front Panel Temperature Sensor is found"
            		ELSE
              			IFSET "OTHER"
                 			DISPLAY ""
                 			DISPLAY "Front Panel Temperature sensor device hardware is not found."
                 			DISPLAY ""
              			ELSE
                 			DISPLAY ""
                 			DISPLAY "Front Panel Temperature sensor device hardware is not found."
                 			DISPLAY "Chassis fan Speed Control (FSC) will not work properly without this sensor!"
                 			DISPLAY ""
                 			PROMPT      "Front Panel Temperature sensor device hardware is not found, do you want to still Continue (Y/N)?"
                 			YES         "FP_TEMP"    //Load the FP Temp SDR and Continue update 
                 			NO          "EXIT"      //Display below messages and EXIT update 
                                                              
                 			IFSET "EXIT"        //Exit the FRUSDR tool and do not perform any SDR changes
                    				DISPLAY ""
                    				DISPLAY "Investigate the problem and then rerun the FRUSDR update."
                    				DISPLAY "Exiting without performing any updates."
                    				DISPLAY ""
                    				ERRORLEVEL 00 
                 			ENDIF
              			ENDIF
            		ENDIF
		
		ENDIF	//IFSET "CHENBRO_4"					

			// ----------------- PROBING PSU 1 -----------------
			PROBE "PING" "09" "B0"
			    FOUND "PS1" ""
			    
      IFSET "PS1"
				DISPLAY "Power Supply 1 is present."
    	ELSE
				DISPLAY "Power Supply 1 is not present."
    	ENDIF
			                
			// ----------------- PROBING PSU 2 -----------------
			PROBE "PING" "09" "B2"
			    FOUND "PS2" ""
			    
      IFSET "PS2"
				DISPLAY "Power Supply 2 is present."
    	ELSE
				DISPLAY "Power Supply 2 is not present."
    	ENDIF			    
			                
			// ----------------- PROBING Power Distribution Board -----------------
			PROBE "PING" "09" "AC"
			    FOUND "PDB_FRU" ""
			
			IFSET "PDB_FRU"
			    DISPLAY "Power Distribution Board FRU Device found."
			ENDIF
                   
			DISPLAY ""

			//****************************************************
			// Set CHENBRO power supply specific tags
			//****************************************************
			IFSET "CHENBRO_4"
				IFSET "PS1"
					SET "CHENBRO_PS1"
				ENDIF
				
				IFSET "PS2"
					SET "CHENBRO_PS2"
				ENDIF	
				
				IFSET "PS1" "PS2"
					SET "REDUNDANT_PDB"
				ENDIF										
			ENDIF //"CHENBRO_4"
            
			//****************************************************
			// Set FOXCONN power supply specific tags
			//****************************************************
			IFSET "FOXCONN_4"
				IFSET "PS1"
					SET "FOXCONN_PS1"
				ENDIF
				
				IFSET "PS2"
					SET "FOXCONN_PS2"
				ENDIF	
				
				IFSET "PS1" "PS2"
					SET "REDUNDANT_PDB"
				ENDIF										
			ENDIF //"FOXCONN_4"
			
			//****************************************************
			// Set Garden Island power supply specific tags
			//****************************************************
			IFSET "GARDEN_ISLAND"
					IFSET "PS1"
						SET "GARDEN_ISLAND_PS1"
					ENDIF
				
					IFSET "PS2"
						SET "GARDEN_ISLAND_PS2"
					ENDIF	
							
					IFSET "PS1" "PS2"
						SET "REDUNDANT_PDB"
					ENDIF										
			ENDIF //"GARDEN_ISLAND"
			
			//****************************************************
			// If other chassis then query for configuration items
			//****************************************************
			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 a fan speed control profile for your chassis"

				   
					       MENU        "OTHER_SR"   "Slow ramp"
					       MENU        "OTHER_MR"   "Medium ramp"
					       MENU        "OTHER_FR"   "Fast ramp"
					       MENU        "OTHER_FS"   "Full Speed"
		       	       MENUPROMPT
				
				IFSET "OTHER_FS"
					IFSET "WSM"
						SET "OTHER_FS_WSM_CPU"
						ELSE //NHM
						SET "OTHER_FS_NHM_CPU"
					ENDIF // IFSET "WSM"

					IFSET "PROCESSOR_2"
						IFSET "WSM"
						SET "OTHER_FS_WSM_DUAL_CPU"
						ELSE //NHM
						SET "OTHER_FS_NHM_DUAL_CPU"
						ENDIF // IFSET "WSM"
					ENDIF // IFSET "PROCESSOR_2"    
				ENDIF // OTHER_FS
				
				
				
				IFSET "OTHER_SR"
					IFSET "WSM"
						SET "OTHER_SR_WSM_CPU"
						ELSE //NHM
						SET "OTHER_SR_NHM_CPU"
					ENDIF // IFSET "WSM"

					IFSET "PROCESSOR_2"
						IFSET "WSM"
						SET "OTHER_SR_WSM_DUAL_CPU"
						ELSE //NHM
						SET "OTHER_SR_NHM_DUAL_CPU"
						ENDIF // IFSET "WSM"
					ENDIF // IFSET "PROCESSOR_2"    
				ENDIF // OTHER_SR				
				
				
				
				IFSET "OTHER_MR"
					IFSET "WSM"
						SET "OTHER_MR_WSM_CPU"
						ELSE //NHM
						SET "OTHER_MR_NHM_CPU"
					ENDIF // IFSET "WSM"

					IFSET "PROCESSOR_2"
						IFSET "WSM"
						SET "OTHER_MR_WSM_DUAL_CPU"
						ELSE //NHM
						SET "OTHER_MR_NHM_DUAL_CPU"
						ENDIF // IFSET "WSM"
					ENDIF // IFSET "PROCESSOR_2"    
				ENDIF // OTHER_MR					
				
				
				IFSET "OTHER_FR"
					IFSET "WSM"
						SET "OTHER_FR_WSM_CPU"
						ELSE //NHM
						SET "OTHER_FR_NHM_CPU"
					ENDIF // IFSET "WSM"

					IFSET "PROCESSOR_2"
						IFSET "WSM"
						SET "OTHER_FR_WSM_DUAL_CPU"
						ELSE //NHM
						SET "OTHER_FR_NHM_DUAL_CPU"
						ENDIF // IFSET "WSM"
					ENDIF // IFSET "PROCESSOR_2"    
				ENDIF // OTHER_FR					
				
					
				
				PROMPT "Does the front panel support a NMI button?"
				  YES "FP_NMI"
					NO  ""
                    
				PROMPT "Is a fan connected to the Processor1 FAN connector?"
					YES "OTHER_P1FAN"
					NO  ""
					
				PROMPT "Is a fan connected to the Processor1A (redundant) connector?"
					YES "OTHER_P1AFAN"
					NO  ""					
                    
        			PROMPT "Is a fan connected to the Processor2 FAN connector?"
					YES "OTHER_P2FAN"
					NO  ""
                    
				PROMPT "Is a fan connected to the Processor2A (redundant) connector?"
					YES "OTHER_P2AFAN"
					NO  ""
					
        			PROMPT "Is a fan connected to the Memory1 FAN connector?"
					YES "OTHER_MEMFAN1"
					NO  ""
					
				PROMPT "Is a fan connected to the Memory1A (redundant) connector?"
					YES "OTHER_MEMFAN1A"
					NO  ""					
                    
        			PROMPT "Is a fan connected to the Memory2 FAN connector?"
					YES "OTHER_MEMFAN2"
					NO  ""
					
				PROMPT "Is a fan connected to the Memory2A (redundant) connector?"
					YES "OTHER_MEMFAN2A"
					NO  ""					
					
        IFSET "PROCESSOR_2"
            SET "OTHER_CPU2"
        ENDIF
	 	  ENDIF	//"OTHER"
		    
			// Update the SDR Repository with selected records
			
			SDRNAME   "WB_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  //"SDR"
		
		//*****************************************************************************
		// 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     " "
                
                PROMPT      "Do you have SSI power supplies installed?"
                    YES     "SSI"
                    NO      ""                
                
                IFSET "SSI"
                    FRUNAME     "WB_BMC.fru"
                ELSE
                		FRUNAME     "WBV_BMC.fru"
                ENDIF
                
                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"
                    DISPLAY     " "
                    PROMPT      "Do you want to enter the chassis type (HEX byte)?"
                        YES         "CHASS_T"
                        NO          ""
                        
                    IFSET       "CHASS_T"
                        FRUFIELD    "CT" "@STDIN:ASCII"
                    ENDIF
                    
                    DISPLAY     " "
                    
                    PROMPT      "Do you want to enter the chassis serial number?"
                        YES         "CHASS_SN"
                        NO          ""
                        
                    IFSET       "CHASS_SN"
                        FRUFIELD    "S#" "@STDIN:ASCII"
                    ENDIF
                    
                    DISPLAY     " "
                    
                    PROMPT      "Do you want to enter the chassis part number?"
                        YES         "CHASS_PN"
                        NO          ""
                        
                    IFSET       "CHASS_PN"
                        FRUFIELD    "P#" "@STDIN:ASCII"
                    ENDIF
                    
                    DISPLAY     " "
                    
                    PROMPT      "Do you want to enter the 31 byte chassis manufacturer name?"
                        YES         "CHASS_INFO_1"
                        NO          ""
                        
                    IFSET       "CHASS_INFo_1"
                        FRUFIELD  "AM1" "@STDIN:ASCII"
                    ENDIF
                        
                    PROMPT      "Do you want to enter data into the 31 byte custom chassis info field?"
                        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?"
	                YES     "UPD_PRD"
	                NO      ""
                    
                IFSET "UPD_PRD"
                    FRUFIELD    "MN"
                    FRUFIELD    "PN"	      
                    FRUFIELD    "PV"
                    DISPLAY      " "
                    PROMPT      "Do you want to enter the product part number?"
                        YES         "PROD_PN"
                        NO          ""
                        
                    IFSET "PROD_PN"
                        FRUFIELD    "P#" "@STDIN:ASCII"
                    ENDIF
                    
                    DISPLAY     " "
                    PROMPT      "Do you want to enter the product serial number?"
                        YES         "PROD_SN"
                        NO          ""
                        
                     IFSET "PROD_SN"
                        FRUFIELD    "S#" "@STDIN:ASCII"
                    ENDIF
	                
                    DISPLAY     " "
                    PROMPT      "Do you want to enter an product asset tag?"
                        YES         "PROD_ASSET"
                        NO          ""
                        
                    IFSET "PROD_ASSET"
                        FRUFIELD    "AT" "@STDIN:ASCII"
                    ENDIF
                ENDIF
            ENDIF
        ENDIF
    ENDIF
ENDIF

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