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

CONFIGURATION 	"Master.Cfg"
DISPLAY         "FRU & SDR Update Package Version FSH1_13 for"
DISPLAY         "Intel(R) Server Boards S3210SHLX, S3210SHLC and S3200SHV"
DISPLAY         "Copyright (c) 2007 Intel Corporation"
DISPLAY         " "

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

DISPLAY "Detecting Baseboard"
  
PROBE           "SYSTEM" "S3210SH"
FOUND           "SH"  ""


IFSET "SH"
	DISPLAY ""
	DISPLAY "Intel(R) Server Board S3210SH 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 "SH"
// {
	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        "EXIT1" "Exit FRU/SDR update"
//	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
    // {
		//*****************************
		// Start of SDR processing
		// Query user for chassis model
		//*****************************

		IFSET	"SDR"
		// {
			DISPLAY		" "
			MENUTITLE   "Select the Chassis"
			MENU        "SC5299UP"   "Intel(R) Server Chassis SC5299 UP"
			MENU        "SC5299UP"   "Intel(R) Server Chassis SC5299 DP"
			MENU        "SC5299UP"   "Intel(R) Server Chassis SC5299 BRP"
			MENU        "SR1530SH"   "Intel(R) Server Chassis SR1530 SH"
			MENU        "SR1530HSH"  "Intel(R) Server Chassis SR1530 HSH"
			MENU        "OTHER"      "Other Chassis"
			MENUPROMPT
			DISPLAY		" "

			IFSET "SC5299UP"
			// {
				PROMPT "Does the chassis have the optional system fan 2 (chassis front)?"
					YES "SC5299UP_OPT"
					NO  "SC5299UP_NO_OPT"

                // Check for Hot Swap Controller (HSC device)
				DISPLAY "Checking HW Configuration..."

				// Check for HSC present
				PROBE   "PING" "00" "C0"
				FOUND   "HSC"

                IFSET   "HSC"
                    DISPLAY "HSC Detected"
                ELSE
                    DISPLAY "HSC Not Detected"
                ENDIF
			// }
			ENDIF

			//*************************************************************************
			// If other chassis, then query for chassis intrusion and fan configuration
			//*************************************************************************

			IFSET "OTHER"
			// {
				PROMPT "Does the system have chassis intrusion?"
				  	YES "CHS_INT"
					NO  ""
			  
				PROMPT "Is CPU Fan 1 installed?"
					YES "CPUFAN1_TACH0"
					NO  ""
			  
				PROMPT "Is System Fan 1 installed?"
					YES "SYSFAN1_TACH3"
					NO  ""
			  
				PROMPT "Is System Fan 2 installed?"
					YES "SYSFAN2_TACH4"
					NO  ""          

				PROMPT "Is System Fan 3 installed?"
					YES "CPUFAN2_TACH1"
					NO  ""

				PROMPT "Is System Fan 4 installed?"
					YES "CPUFAN3_TACH2"
					NO  ""

                // Check for Hot Swap Controller (HSC device)
				DISPLAY "Checking HW Configuration..."

				// Check for HSC present
				PROBE   "PING" "00" "C0"
				FOUND   "HSC"

                IFSET   "HSC"
                    DISPLAY "HSC Detected"
                ELSE
                    DISPLAY "HSC Not Detected"
                ENDIF
			// }
	 	    ENDIF
		    
			// Update the SDR Repository with selected records
			
			SDRNAME   "3210SH13.sdr"	// Update SDR Repository
			BMC_REFRESH	// Refresh (cold reset) the BMC forcing it to read the new data

		// ifset "SDR"}
		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 "SH"
			    FRUNAME     "SH1_MB4.FRU"
			    ENDIF

	            FRUAREA     "HEADER"
	            FRUAREA     "INTERNALUSE"
	            DISPLAY     " "

	            FRUAREA     "CHASSIS"
			    FRUFIELD    "CT" 

		        PROMPT      "Would you like to update the chassis info area of the FRU?"
	            YES     "UPD_CHS"
	            NO      ""

		    IFSET "UPD_CHS"
		    // {
		    
                DISPLAY     " "
			    PROMPT      "Would you like to enter the chassis type (HEX byte)?"
			    YES         "CHASS_T"
			    NO          ""

			    IFSET       "CHASS_T"
	                FRUFIELD    "CT" "@STDIN:ASCII"
			    ENDIF			

			    DISPLAY     " "
			    PROMPT      "Would you like to enter the chassis serial number (12 char max)?"
			    YES         "CHASS_SN"
			    NO          ""

			    IFSET       "CHASS_SN"
	                FRUFIELD    "S#" "@STDIN:ASCII"
			    ENDIF			

			    DISPLAY     " "
			    PROMPT      "Would you like to enter the chassis part number (10 char max)?"
			    YES         "CHASS_PN"
			    NO          ""

			    IFSET       "CHASS_PN"
			        FRUFIELD    "P#" "@STDIN:ASCII"
			    ENDIF
	         
			    DISPLAY     " "
	            PROMPT      "Would you like to enter the chassis manufacturer name (27 char max)?"
                YES         "CHASMN"
                NO          ""
                IFSET       "CHASMN"
                    FRUFIELD  "AM1" "@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      "Would you like to update the product info area of the FRU?"
	                YES     "UPD_PRD"
	                NO      ""

		    IFSET "UPD_PRD"
		    // {
			FRUFIELD    "MN"
	                FRUFIELD    "PN"	      
			FRUFIELD    "PV"

	                DISPLAY      " "
			PROMPT      "Would you like to enter the product part number (10 char max)?"
 			    YES         "PROD_PN"
	 		    NO          ""

	                IFSET "PROD_PN"
	                    FRUFIELD    "P#" "@STDIN:ASCII"
	                ENDIF
	    
	                DISPLAY     " "
	                PROMPT      "Would you like to enter the product serial number (12 char max)?"
	                    YES         "PROD_SN"
	                    NO          ""
 
	                IFSET "PROD_SN"
	                    FRUFIELD    "S#" "@STDIN:ASCII"
	                ENDIF
	                
			DISPLAY     " "
			PROMPT      "Would you like to enter an product asset tag (20 char max)?"
			    YES         "PROD_ASSET"
			    NO          ""

			IFSET "PROD_ASSET"
			    FRUFIELD    "AT" "@STDIN:ASCII"
			ENDIF
	 	    // }
		    ENDIF
	    // }
	    ENDIF
	// }
	ENDIF
    // }
    ENDIF
// }
ENDIF

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