//****************************************************************************
//                   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.
//****************************************************************************
//
//  TITLE: Master.CFG             DATE CREATED:  05/18/2009
//****************************************************************************
//  Revision History:
//
//****************************************************************************

CONFIGURATION   "Master.cfg, Rev 0.98"
DISPLAY         "S5500WB Server Platform FRU & SDR package version 9"
DISPLAY         "Intel(R) Server Board S5500WB"
DISPLAY         "Copyright (c) 2009 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     " "

	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® Server System SR1690WB"
			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 -----------------
      DISPLAY "Detecting Processor 2. Please wait..."
			PROBE	"PROCESSOR"	2
          FOUND	"PROCESSOR_2"	""
          
      // ----------------- Decide whether we need to include clamp records for CPU2 (zones 2 and 3)
      IFSET "CHENBRO_4" "PROCESSOR_2"
      	SET "CHENBRO_4_DUAL_CPU"
      ENDIF
      
      // For FoxConn
      IFSET "FOXCONN_4" "PROCESSOR_2"
      	SET "FOXCONN_4_DUAL_CPU"
      ENDIF
      
      IFSET "OTHER" "PROCESSOR_2"
      	SET "OTHER_DUAL_CPU"
      ENDIF      
            
      IFSET "PROCESSOR_2"
				DISPLAY "Processor 2 is present."
    	ELSE
				DISPLAY "Processor 2 is not present."
    	ENDIF         
			                
						
    		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 Detected"
				  ELSE
						DISPLAY "Front Panel Temperature sensor not found"
				//DISPLAY "Fan Speed Control (FSC) will not work properly without this sensor"
				  ENDIF
		ENDIF //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"
			//****************************************************
			// If other chassis then query for configuration items
			//****************************************************
			IFSET "OTHER"

				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

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