//****************************************************************************
//
//                          Intel Corporation
//                    Jones Farm, Hillsboro, Oregon
//                           (503) 696-8080
//
//                Intel Corporation Proprietary Information
//        Copyright (c) 2006 Intel Corporation, All Rights Reserved
//****************************************************************************


//SET "FRUSDR_Where_Detect"  // Use for checking whether Detect.

	// **********************
	// SET PROBE FLAG AREA
	// **********************
			//SET "DO_PROBE"
			SET "DO_PROBE_CPU"
			SET "DO_PROBE_PS"
			//SET "DO_PROBE_FP"		
	// **********************

PROBE		"BMC_TYPE"
FOUND		"BMC_TYPEFOUND"  "BMC_TYPENONFOUND"

IFSET "BMC_TYPENONFOUND"
  DISPLAY "BMC was not found"
ENDIF

IFSET "BMC_TYPEFOUND"
	
	CONFIGURATION 	"S5000PAL/S5000XAL Master.Cfg"
	DISPLAY     	"Intel(R) Server Board S5000PAL/S5000XAL FRU & SDR Package version 37"
	DISPLAY     	"Copyright (c) 2006 Intel Corporation"
	DISPLAY     	" "
	
	// ****************
	// Detect platform
	// ****************
	IFSET "FRUSDR_Where_Detect"
		DISPLAY "Start platform detection"
	ENDIF
	
	PROBE           "SYSTEM" "S5000PAL0"
	FOUND           "AL"  ""	
	
	PROBE           "SYSTEM" "S5000XAL0"
	FOUND           "ALX"  ""	
		
	
	IFSET "AL"
	  SET "ENTRY"
	ELSE
	  IFSET "ALX"
	 	SET "ENTRY"
	  ELSE
	  	DISPLAY "This is the wrong FRU/SDR package for this system"
    	  	SET "EXIT1"
 	  ENDIF
	ENDIF

	// ****END Detect Platform********
	

ENDIF // ENDIFSET "BMC_TYPEFOUND"


IFSET "ENTRY"
	MENUTITLE   "Select the function you want to perform:"
		MENU    "BOTH"  "Update both the FRUs and the SDR repository"
		MENU    "SDR"  "Update only the SDR repository"
		MENU    "FRU"  "Update only the FRU repository"
		MENU    "ASSET"  "Modify the Asset tag"
		MENU    "EXIT1"  "Exit"
	MENUPROMPT
ENDIF // ENDIFSET "ENTRY"

IFSET "EXIT1"
	DISPLAY "Exiting without making any changes"	
ELSE // Not Exiting want to perform FRU and SDR update
  IFSET       "ASSET"    
	  FRUNAME     "SYSTEM"
    FRUADDRESS  "IMBDEVICE" FF 20
    FRUAREA     "PRODUCT"  
    FRUFIELD    "AT" "@STDIN:ASCII"
  ELSE // Need to perform FRU / SDR update
		SET "ENTRY_CHASSIS"
	ENDIF // End of ASSET
ENDIF // End of EXIT1

IFSET "ENTRY_CHASSIS"
		DISPLAY     " "
		MENUTITLE   "Select the System Type:"
				MENU    "SR2500BRP"    "Intel(R) Server System SR2500AL with three system fans" // Driskill2
				MENU    "SR2500LX"     "Intel(R) Server System SR2500AL with six system fans"  // Driskill2
				MENU    "SR1500"       "Intel(R) Server System SR1500AL"    // Dowling2
				MENU    "SR1550"       "Intel(R) Server System SR1550AL"    // Petrof Bay
				MENU    "OTHER"        "Other non-Intel chassis"
				//MENU    "SHP"          "Only Shipping use"	// This is only for shipping
				//MENU    "FCT"          "Only for FCT use" // This is only be used for boards when they are going through FCT
				//MENU    "OQM"          "Only for OQM use" // This is olny be used for boards when they are going through OQM
		MENUPROMPT
		
		IFSET "BOTH"
				SET "FRU"
				SET "SDR"
		ENDIF

ENDIF // EndIFSET "ENTRY_CHASSIS"

// *****************************
//   Update the SDR Repository
// *****************************
IFSET   "SDR"

    // ***********************
    //   Detect Processor
    // ***********************
    IFSET "FRUSDR_Where_Detect"
    	DISPLAY "Start detecting processor"
    ENDIF
    
    IFSET "DO_PROBE_CPU"
		    PROBE "PROCESSOR"  01
		    FOUND "PROC_1"     ""
		    PROBE "PROCESSOR"  02
		    FOUND "PROC_2"     ""
		ELSE
			 	PROMPT "Is processor 1 installed?" 
			 	YES  "PROC_1"
				NO   ""    
			 	PROMPT "Is processor 2 installed?" 
			 	YES  "PROC_2"
				NO   ""   				
		ENDIF
    
    PROBE "PROCESSOR" 01 B3 "0F" "61"
    FOUND "DP"    ""

    PROBE "PROCESSOR" 01 B3 "0F" "62"
    FOUND "DP"    ""
    
    PROBE "PROCESSOR" 01 B3 "0F" "63"
    FOUND "DP"    ""

    PROBE "PROCESSOR" 01 B3 "0F" "64"
    FOUND "DP"    ""
    
    PROBE "PROCESSOR" 01 B3 "0F" "65"
    FOUND "DP"    ""

    PROBE "PROCESSOR" 01 B3 "0F" "66"
    FOUND "DP"    ""

    PROBE "PROCESSOR" 01 B3 "0F" "67"
    FOUND "DP"    ""

    PROBE "PROCESSOR" 01 B3 "0F" "68"
    FOUND "DP"    ""

    PROBE "PROCESSOR" 01 B3 "0F" "69"
    FOUND "DP"    ""

    PROBE "PROCESSOR" 01 B3 "0F" "6A"
    FOUND "DP"    ""

    PROBE "PROCESSOR" 01 B3 "0F" "6B"
    FOUND "DP"    ""

    PROBE "PROCESSOR" 01 B3 "0F" "6C"
    FOUND "DP"    ""

    PROBE "PROCESSOR" 01 B3 "0F" "6D"
    FOUND "DP"    ""

    PROBE "PROCESSOR" 01 B3 "0F" "6E"
    FOUND "DP"    ""

    PROBE "PROCESSOR" 01 B3 "0F" "6F"
    FOUND "DP"    ""

    IFSET "DP"
    ELSE

      PROBE "PROCESSOR" 01 B3 "06" "F0"
      FOUND "WC" ""
      
      PROBE "PROCESSOR" 01 B3 "06" "F1"
      FOUND "WC" ""

      PROBE "PROCESSOR" 01 B3 "06" "F4"
      FOUND "WC" ""
      
      PROBE "PROCESSOR" 01 B3 "06" "F5"
      FOUND "WC" ""

      PROBE "PROCESSOR" 01 B3 "06" "F6"
      FOUND "WC" ""

      PROBE "PROCESSOR" 01 B3 "06" "F7"
      FOUND "WC" ""

      PROBE "PROCESSOR" 01 B3 "06" "F8"
      FOUND "WC" ""

      PROBE "PROCESSOR" 01 B3 "06" "F9"
      FOUND "WC" ""

      PROBE "PROCESSOR" 01 B3 "06" "FA"
      FOUND "WC" ""

      PROBE "PROCESSOR" 01 B3 "06" "FB"
      FOUND "WC" ""

      PROBE "PROCESSOR" 01 B3 "06" "FC"
      FOUND "WC" ""

      PROBE "PROCESSOR" 01 B3 "06" "FD"
      FOUND "WC" ""

      PROBE "PROCESSOR" 01 B3 "06" "FE"
      FOUND "WC" ""

      PROBE "PROCESSOR" 01 B3 "06" "FF"
      FOUND "WC" ""

		ENDIF
				
    IFSET "PROC_1"
    		IFSET "DP"
      			DISPLAY "Processor 1 present: Dual-Core Intel(R) Xeon(R) Processor 5000 Series"
      	ENDIF
      	IFSET "WC"
      			DISPLAY "Processor 1 present: Dual-Core Intel(R) Xeon(R) Processor 5100 or 5300 Series"
      	ENDIF
    ELSE
    		DISPLAY "Processor 1 not present"
    ENDIF
 
    IFSET "PROC_2"
    		IFSET "DP"
      			DISPLAY "Processor 2 present: Dual-Core Intel(R) Xeon(R) Processor 5000 Series"
      	ENDIF
      	IFSET "WC"
      			DISPLAY "Processor 2 present: Dual-Core Intel(R) Xeon(R) Processor 5100 or 5300 Series"
      	ENDIF
    ELSE
    		DISPLAY "Processor 2 not present"
    ENDIF

    // ****END Detect Processor********
    // ***********************
    //   Detect PowerSupply
    // ***********************
    IFSET "FRUSDR_Where_Detect"
      DISPLAY "Start detecting power supply"
    ENDIF

		IFSET "DO_PROBE_PS"
	    PROBE "PING" "07" "4A"
	    FOUND "PS_CAGE" ""
	    
	    PROBE "PING" "07" "B0"
	    FOUND "PS_1" ""	    
	    
	    PROBE "PING" "07" "B2"
	    FOUND "PS_2" ""	 
	    
	  ELSE
	  	IFSET "SR1500"
	  	ELSE
				PROMPT "Is power supply 2 installed?" 
			 		YES  "PS_2"
					NO   ""
			ENDIF
    ENDIF	
    
    IFSET "PS_CAGE"
      DISPLAY "Power distribution board is present"
    ENDIF
    IFSET "PS_1"
      DISPLAY "Power supply module 1 is present"
    ENDIF
    IFSET "PS_2"
      DISPLAY "Power supply module 2 is present"
    ENDIF
    // ****END Detect PowerSupply********

		IFSET "SR2500BRP"   // Driskill2
			SET "STD_FAN_S1"
			SET "FAN_RED"
			
			SET "FMC_3FAN"	
	
			SET "STD_700W_S1"
			
			IFSET  "PS_2"
				SET "OPT_700W_S1"
				
      	IFSET  "PS_1"	
					DISPLAY "Power supply sub-system is redundant"
					SET "RED_700W_S1"
      	ENDIF
			ENDIF

      IFSET "PROC_1"
        IFSET "DP"
          SET "DP_TEMP_S1_P1"
          SET "STD_TEMP_S1"
        ENDIF
      ENDIF
      
      IFSET "PROC_2"
        IFSET "DP"
          SET "DP_TEMP_S1_P2"
          SET "FSC_S1_PROC_2_DP"
          SET "OPT_TEMP_S1"
        ENDIF
      ENDIF
      
      IFSET "PROC_1"
			  IFSET "WC"
			    SET "WC_TEMP_S1_P1"
			    SET "STD_TEMP_S1"
			  ENDIF
			ENDIF

			IFSET "PROC_2"
			  IFSET "WC"
			    SET "WC_TEMP_S1_P2"
			    SET "FSC_S1_PROC_2_WC"
			    SET "OPT_TEMP_S1"
			  ENDIF
			ENDIF
			
			SET "INTRUSION"
			
			IFSET "DP"
			  SET "FSC_S1_DP"
			ELSE
				SET "FSC_S1_WC"
			ENDIF

			SET "2U_SAS_HSBP"

		ENDIF // ENDIFSET "SR2500BRP" 
		
		IFSET "SR2500LX"    // Driskill2
			SET "STD_FAN_S2"
      SET "FAN_RED"		
      
      SET "FMC_6FAN"
      	
			SET "STD_700W_S1"

			IFSET "PS_2"
				SET "OPT_700W_S1"

			  IFSET "PS_1"
			  	DISPLAY "Power supply sub-system is redundant"
			  	SET "RED_700W_S1"
				ENDIF

			ENDIF

			IFSET "PROC_1"
        IFSET "DP"
          SET "DP_TEMP_S1_P1"
          SET "STD_TEMP_S1"
        ENDIF
      ENDIF
      
      IFSET "PROC_2"
        IFSET "DP"
          SET "DP_TEMP_S1_P2"
          SET "FSC_S2_PROC_2_DP"
          SET "OPT_TEMP_S1"
        ENDIF
      ENDIF
      
      IFSET "PROC_1"
			  IFSET "WC"
			    SET "WC_TEMP_S1_P1"
			    SET "STD_TEMP_S1"
			  ENDIF
			ENDIF

			IFSET "PROC_2"
			  IFSET "WC"
			    SET "WC_TEMP_S1_P2"
			    SET "FSC_S2_PROC_2_WC"
			    SET "OPT_TEMP_S1"
			  ENDIF
			ENDIF

			SET "INTRUSION"
			
			IFSET "DP"
			  SET "FSC_S2_DP"
			ELSE
				SET "FSC_S2_WC"
			ENDIF

			SET "2U_SAS_HSBP"

		ENDIF // ENDIFSET "SR2500LX"
		
		IFSET "SR1500"      // Dowling2
			SET "STD_FAN_S3"

			SET "FMC_10FAN"

			SET "STD_600W_S3"


		  IFSET "PROC_1"
        IFSET "DP"
          SET "DP_TEMP_S3_P1"
          SET "STD_TEMP_S3"
        ENDIF
      ENDIF
      
      IFSET "PROC_2"
        IFSET "DP"
          SET "DP_TEMP_S3_P2"
          SET "FSC_S3_PROC_2_DP"
          SET "OPT_TEMP_S3"
        ENDIF
      ENDIF
      
      IFSET "PROC_1"
			  IFSET "WC"
			    SET "WC_TEMP_S3_P1"
			    SET "STD_TEMP_S3"
			  ENDIF
			ENDIF

			IFSET "PROC_2"
			  IFSET "WC"
			    SET "WC_TEMP_S3_P2"
			    SET "FSC_S3_PROC_2_WC"
			    SET "OPT_TEMP_S3"
			  ENDIF
			ENDIF

			SET "INTRUSION"			
			
			IFSET "DP"
			  SET "FSC_S3_DP"
			ELSE
				SET "FSC_S3_WC"
			ENDIF

			SET "1U_SAS_HSBP"

		ENDIF // ENDIFSET "SR1500"
		
		IFSET "SR1550"      // Petrof Bay
			SET "STD_FAN_S3"

			SET "FMC_10FAN"

			SET "STD_650W_S4"
			
			IFSET "PS_2"
				SET "OPT_650W_S4"
			  
			  IFSET "PS_1"
			  	DISPLAY "Power supply sub-system is redundant"
			    SET "RED_650W_S4"
				ENDIF
				
			ENDIF

      IFSET "PROC_1"
        IFSET "DP"
          SET "DP_TEMP_S3_P1"
          SET "STD_TEMP_S3"
        ENDIF
      ENDIF
      
      IFSET "PROC_2"
        IFSET "DP"
          SET "DP_TEMP_S3_P2"
          SET "FSC_S4_PROC_2_DP"
          SET "OPT_TEMP_S3"
        ENDIF
      ENDIF
      
      IFSET "PROC_1"
			  IFSET "WC"
			    SET "WC_TEMP_S3_P1"
			    SET "STD_TEMP_S3"
			  ENDIF
			ENDIF

			IFSET "PROC_2"
			  IFSET "WC"
			    SET "WC_TEMP_S3_P2"
			    SET "FSC_S4_PROC_2_WC"
			    SET "OPT_TEMP_S3"
			  ENDIF
			ENDIF		
			
			SET "INTRUSION"
			
			IFSET "DP"
			  SET "FSC_S4_DP"
			ELSE
				SET "FSC_S4_WC"
			ENDIF

			SET "PetrofSAS_HSBP"

		ENDIF // ENDIFSET "SR1550"
		
		IFSET "OTHER"      // Other Chassis
		
			PROMPT      "Is a fan connected to the Processor1 FAN connector?"
	    YES         "OPT_FAN_OTH_P1"
	    NO          ""
	    
	    PROMPT      "Is a fan connected to the Processor2 FAN connector?"
	    YES         "OPT_FAN_OTH_P2"
	    NO          ""

	    PROMPT      "Is a fan connected to the SYS FAN1 connector?"
	    YES         "OPT_FAN_OTHER1"
	    NO          ""
	    
	    PROMPT      "Is a fan connected to the SYS FAN2 connector?"
	    YES         "OPT_FAN_OTHER2"
	    NO          ""
	    
	    PROMPT      "Is a fan connected to the SYS FAN3 connector?"
	    YES         "OPT_FAN_OTHER3"
	    NO          ""	    

	    PROMPT      "Is a fan connected to the SYS FAN4 connector?"
	    YES         "OPT_FAN_OTHER4"
	    NO          ""
	    
	    SET "FMC_OTH_FAN"
	    
      IFSET "PROC_1"
        IFSET "DP"
          SET "DP_TEMP_OTH_P1"
          SET "STD_TEMP_OTHER"
        ENDIF
      ENDIF
      
      IFSET "PROC_2"
        IFSET "DP"
          SET "DP_TEMP_OTH_P2"
          SET "FSC_OT_PROC_2_DP"
          SET "OPT_TEMP_OTHER"
        ENDIF
      ENDIF
      
      IFSET "PROC_1"
			  IFSET "WC"
			    SET "WC_TEMP_OTH_P1"
			    SET "STD_TEMP_OTHER"
			  ENDIF
			ENDIF

			IFSET "PROC_2"
			  IFSET "WC"
			    SET "WC_TEMP_OTH_P2"
			    SET "FSC_OT_PROC_2_WC"
			    SET "OPT_TEMP_OTHER"
			  ENDIF
			ENDIF

	    PROMPT      "Does the system detect chassis intrusion?"
	    YES         "INTRUSION"
	    NO          "NO_INTRUSION"

			IFSET "DP"
			  SET "FSC_OTHER_DP"
			ELSE
				SET "FSC_OTHER_WC"
			ENDIF

    ENDIF // ENDIFSET "OTHER"
    
    IFSET "FCT"
      IFSET "PS_1"
        //SET "STD_700W_S1"
        SET "FCT_PS_1"
      ENDIF
      IFSET "PS_2"
        SET "OPT_700W_S1"
      ENDIF
      
      IFSET "DP"
        SET "FCT_DP"
        IFSET "PROC_2"
          SET "FCT_DP_2"
        ENDIF
      ENDIF
      
      IFSET "WC"
        SET "FCT_WC"
        IFSET "PROC_2"
          SET "FCT_WC_2"
        ENDIF
      ENDIF

    ENDIF
    
    IFSET "OQM"
      IFSET "PS_1"
        SET "STD_700W_S1"
      ENDIF
      IFSET "PS_2"
        SET "OPT_700W_S1"
      ENDIF
      
      IFSET "DP"
        SET "OQM_DP"
      ENDIF
      
      IFSET "WC"
        SET "OQM_WC"
      ENDIF

    ENDIF

    // ***********************
    //   Updating the SDR
    // ***********************
    IFSET "FRUSDR_Where_Detect"
    	DISPLAY "Updating the SDR"
    ENDIF				
		
		SDRNAME "AL_37.SDR"        // Update SDR Repository
		BMC_REFRESH		  // Refresh the BMC
ENDIF        // End of SDR program
// ****Update the SDR Repository END********

// ***********************
// Update FRU areas	
// ***********************
IFSET "FRU"
    IFSET "FRUSDR_Where_Detect"
    	DISPLAY "Updating the FRU" 
    ENDIF		
		// ******************************
		//   Update BaseBoard FRU areas	
		// ******************************
  IFSET "AL"
    FRUNAME     "ALMBD_05.FRU"
  ELSE
    IFSET "ALX"
       FRUNAME   "ALXMBD_3.FRU"
    ENDIF
  ENDIF
    FRUAREA     "HEADER"
    FRUAREA     "INTERNALUSE"
    FRUAREA     "CHASSIS"
    FRUFIELD    "CT" 			// Chassis Type

    PROMPT      "Do you want to enter the chassis serial number?"
    YES         "CHASSN"
    NO          ""

    IFSET       "CHASSN"
      FRUFIELD  "S#" "@STDIN:ASCII"	// Enter Chassis Serial Number
    ENDIF

    PROMPT      "Do you want to enter the chassis part number?"
    YES         "CHASPN"
    NO          ""

    IFSET       "CHASPN"
      FRUFIELD  "P#" "@STDIN:ASCII" // Enter Chassis Part Number         
    ENDIF         
    
    IFSET "SR2500BRP"
      FRUFIELD  "AM1" "SR2500BRP"
    ENDIF
    IFSET "SR2500LX"
      FRUFIELD  "AM1" "SR2500LX"
    ENDIF
    IFSET "SR1500"
      FRUFIELD  "AM1" "SR1500"
    ENDIF       
    IFSET "SR1550"
      FRUFIELD  "AM1" "SR1550"
    ENDIF
    IFSET "OTHER"
      FRUFIELD  "AM1" "OTHER"
    ENDIF
    
    FRUAREA     "BOARD" 
    //FRUFIELD    "MD"
    IFSET "AL"
    FRUFIELD    "PN" "S5000PAL0"
    ELSE
      IFSET "ALX"
    	FRUFIELD    "PN" "S5000XAL0"
      ENDIF
    ENDIF 
    
    FRUFIELD    "ID"
   
    FRUAREA     "PRODUCT"
    IFSET "AL"
      FRUFIELD    "PN" "S5000PAL"
    ELSE
      IFSET "ALX"
         FRUFIELD  "PN" "S5000XAL"
      ENDIF
    ENDIF
    
    PROMPT      "Do you want to enter the system serial number?"
    YES         "SYSSN"
    NO          ""

    IFSET       "SYSSN"
      FRUFIELD  "S#" "@STDIN:ASCII" // Enter System Serial Number
    ENDIF

    PROMPT      "Do you want to enter the system part number?"
    YES         "SYSPN"
    NO          ""

    IFSET       "SYSPN"
      FRUFIELD  "P#" "@STDIN:ASCII" // Enter System Part Number
    ENDIF
    
    PROMPT      "Do you want to enter the asset tag?"
    YES         "CHASAT"
    NO          ""
    IFSET       "CHASAT"
      FRUFIELD  "AT" "@STDIN:ASCII" // Enter Asset Tag
    ENDIF 
    DISPLAY     " " 

    // ********************************
		// Add HSBP code
    // ********************************		
		PROBE "DEVICE_ID" "00" "C0" "A09"
		FOUND "Driskill_HSBP" ""

		PROBE "DEVICE_ID" "00" "C0" "A0A"
		FOUND "Dowling_HSBP" ""

		PROBE "DEVICE_ID" "00" "C0" "A0B"
		FOUND "Petrofbay_HSBP" ""

		IFSET "Driskill_HSBP"
			SET "HAVE_HSBP"
			DISPLAY "Server System SR2500AL HSBP detected"
		ENDIF

		IFSET "Dowling_HSBP"
  		SET "HAVE_HSBP"
			DISPLAY "Server System SR1500AL HSBP detected"
		ENDIF

		IFSET "Petrofbay_HSBP"
			SET "HAVE_HSBP"
			DISPLAY "Server System SR1550AL HSBP detected"
		ENDIF

		IFSET "HAVE_HSBP"
		ELSE
			DISPLAY    "Hot-swap backplane was not detected" 
		ENDIF
		
		IFSET "Driskill_HSBP"      
			FRUNAME     "SR2500BP.FRU"
			FRUAREA     "HEADER"
			FRUAREA     "INTERNALUSE"
			FRUAREA     "BOARD"
			FRUFIELD    "MD" 
			FRUFIELD    "MN" 
			FRUFIELD    "PN" "SR2500BP HSBP"
			FRUFIELD    "ID" 
		ENDIF // END Driskill_HSBP

		IFSET "Dowling_HSBP"      
			FRUNAME     "SR1500BP.FRU"
			FRUAREA     "HEADER"
			FRUAREA     "INTERNALUSE"
			FRUAREA     "BOARD"
			FRUFIELD    "MD" 
			FRUFIELD    "MN" 
			FRUFIELD    "PN" "SR1500BP HSBP"
			FRUFIELD    "ID" 
		ENDIF // End Dowling_HSBP

		IFSET "Petrofbay_HSBP"      
			FRUNAME     "SR1550BP.FRU"
			FRUAREA     "HEADER"
			FRUAREA     "INTERNALUSE"
			FRUAREA     "BOARD"
			FRUFIELD    "MD" 
			FRUFIELD    "MN" 
			FRUFIELD    "PN" "SR1550 HSBP"
			FRUFIELD    "ID" 
		ENDIF // End Petrofbay_HSBP

EndIF // End of FRU Program

// ================================END of File============================