148d80bdfSTim Lee*** Settings *** 248d80bdfSTim LeeDocumentation Module to test npcm750 JTAG Master. 348d80bdfSTim Lee 4bc284352SStanley ChuResource ../../lib/openbmc_ffdc.robot 5bc284352SStanley ChuResource ../../lib/connection_client.robot 648d80bdfSTim Lee 7*6fb70d98SMatt FischerTest Tags JTAG_Master 887dc442cSGeorge Keishing 948d80bdfSTim LeeSuite Setup Suite Setup Execution 1048d80bdfSTim Lee 1148d80bdfSTim Lee*** Variables *** 1248d80bdfSTim Lee${wrong_cpld} 0 1348d80bdfSTim Lee${program_cpld} 0 1448d80bdfSTim Lee 1548d80bdfSTim Lee*** Test Cases *** 1648d80bdfSTim Lee 1748d80bdfSTim LeeTest Read CPLD ID 1848d80bdfSTim Lee [Documentation] Test Read CPLD ID. 1948d80bdfSTim Lee [Tags] Test_Read_CPLD_ID 2048d80bdfSTim Lee 2148d80bdfSTim Lee ${cmd}= Catenate loadsvf -d ${jtag_dev} -s /var/${readid_svf} 2248d80bdfSTim Lee ${output} ${stderr} ${rc}= BMC Execute Command ${cmd} 2348d80bdfSTim Lee Set Global Variable ${wrong_cpld} 1 2448d80bdfSTim Lee Should Not Contain ${stderr} tdo check error 2548d80bdfSTim Lee Set Global Variable ${wrong_cpld} 0 2648d80bdfSTim Lee 2748d80bdfSTim Lee 2848d80bdfSTim LeeTest Program CPLD 2948d80bdfSTim Lee [Documentation] Test Program CPLD. 3048d80bdfSTim Lee [Tags] Test_Program_CPLD 3148d80bdfSTim Lee 3248d80bdfSTim Lee Pass Execution If ${wrong_cpld}==1 Wrong CPLD chip 3348d80bdfSTim Lee Pass Execution If ${program_cpld}==0 skip programming cpld 3448d80bdfSTim Lee 3548d80bdfSTim Lee Program CPLD ${cpld_firmware2} ${firmware_version2} 3648d80bdfSTim Lee Program CPLD ${cpld_firmware1} ${firmware_version1} 3748d80bdfSTim Lee 3848d80bdfSTim Lee*** Keywords *** 3948d80bdfSTim Lee 4048d80bdfSTim LeeGet File From SFTP Server 4148d80bdfSTim Lee [Documentation] SCP Get File. 4248d80bdfSTim Lee [Arguments] ${filename} 4348d80bdfSTim Lee 4448d80bdfSTim Lee # Description of argument(s): 4548d80bdfSTim Lee # filename The file to be downloaded. 4648d80bdfSTim Lee 4748d80bdfSTim Lee Shell Cmd 4848d80bdfSTim Lee ... scp ${SFTP_USER}@${SFTP_SERVER}:${SFTP_PATH}/${filename} ${filename} 4948d80bdfSTim Lee 5048d80bdfSTim Lee 5148d80bdfSTim LeePut File To BMC 5248d80bdfSTim Lee [Documentation] SCP Put File. 5348d80bdfSTim Lee [Arguments] ${filename} 5448d80bdfSTim Lee 5548d80bdfSTim Lee # Description of argument(s): 5648d80bdfSTim Lee # filename The file to be uploaded. 5748d80bdfSTim Lee 5848d80bdfSTim Lee scp.Put File ${filename} /var/${filename} 5948d80bdfSTim Lee 6048d80bdfSTim LeeSuite Setup Execution 613fb75582SGeorge Keishing [Documentation] Suite Setup Execution. 6248d80bdfSTim Lee 6348d80bdfSTim Lee ${status}= Run Keyword And Return Status Variable Should Exist 6448d80bdfSTim Lee ... ${TEST_PROGRAM_CPLD} 6548d80bdfSTim Lee ${value}= Set Variable if ${status} == ${TRUE} ${TEST_PROGRAM_CPLD} 0 6648d80bdfSTim Lee Set Global Variable ${program_cpld} ${value} 6748d80bdfSTim Lee 6848d80bdfSTim Lee ${code_base_dir_path}= Get Code Base Dir Path 6948d80bdfSTim Lee ${olympus_json}= Evaluate 7048d80bdfSTim Lee ... json.load(open('${code_base_dir_path}data/oem/nuvoton/olympus.json')) modules=json 7148d80bdfSTim Lee 7248d80bdfSTim Lee ${cpld_firmware1}= Set Variable ${olympus_json["npcm7xx"]["cpld"]["fw1"]} 7348d80bdfSTim Lee ${cpld_firmware2}= Set Variable ${olympus_json["npcm7xx"]["cpld"]["fw2"]} 7448d80bdfSTim Lee ${firmware_version1}= Set Variable ${olympus_json["npcm7xx"]["cpld"]["fw1ver"]} 7548d80bdfSTim Lee ${firmware_version2}= Set Variable ${olympus_json["npcm7xx"]["cpld"]["fw2ver"]} 7648d80bdfSTim Lee ${readusercode_svf}= Set Variable ${olympus_json["npcm7xx"]["cpld"]["readusercode"]} 7748d80bdfSTim Lee ${readid_svf}= Set Variable ${olympus_json["npcm7xx"]["cpld"]["readid"]} 7848d80bdfSTim Lee ${jtag_dev}= Set Variable ${olympus_json["npcm7xx"]["jtag_dev"]} 7948d80bdfSTim Lee ${power_cycle_cmd}= Set Variable ${olympus_json["npcm7xx"]["power_cycle_cmd"]} 8048d80bdfSTim Lee 8148d80bdfSTim Lee Set Suite Variable ${cpld_firmware1} 8248d80bdfSTim Lee Set Suite Variable ${cpld_firmware2} 8348d80bdfSTim Lee Set Suite Variable ${firmware_version1} 8448d80bdfSTim Lee Set Suite Variable ${firmware_version2} 8548d80bdfSTim Lee Set Suite Variable ${readusercode_svf} 8648d80bdfSTim Lee Set Suite Variable ${readid_svf} 8748d80bdfSTim Lee Set Suite Variable ${jtag_dev} 8848d80bdfSTim Lee Set Suite Variable ${power_cycle_cmd} 8948d80bdfSTim Lee 9048d80bdfSTim Lee Get File From SFTP Server ${readid_svf} 9148d80bdfSTim Lee Run KeyWord If ${program_cpld} == 1 Get File From SFTP Server ${readusercode_svf} 9248d80bdfSTim Lee Run KeyWord If ${program_cpld} == 1 Get File From SFTP Server ${cpld_firmware1} 9348d80bdfSTim Lee Run KeyWord If ${program_cpld} == 1 Get File From SFTP Server ${cpld_firmware2} 9448d80bdfSTim Lee 9548d80bdfSTim Lee scp.Open connection ${OPENBMC_HOST} username=${OPENBMC_USERNAME} 9648d80bdfSTim Lee ... password=${OPENBMC_PASSWORD} 9748d80bdfSTim Lee Put File To BMC ${readid_svf} 9848d80bdfSTim Lee Run KeyWord If ${program_cpld} == 1 Put File To BMC ${readusercode_svf} 9948d80bdfSTim Lee Run KeyWord If ${program_cpld} == 1 Put File To BMC ${cpld_firmware1} 10048d80bdfSTim Lee Run KeyWord If ${program_cpld} == 1 Put File To BMC ${cpld_firmware2} 10148d80bdfSTim Lee Sleep 5s 10248d80bdfSTim Lee scp.Close Connection 10348d80bdfSTim Lee 10448d80bdfSTim LeeProgram CPLD 10548d80bdfSTim Lee [Documentation] Program CPLD. 10648d80bdfSTim Lee [Arguments] ${svf_file} ${version} 10748d80bdfSTim Lee 10848d80bdfSTim Lee # Description of argument(s): 10948d80bdfSTim Lee # svf_file The firmware file. 11048d80bdfSTim Lee # version The firmware version. 11148d80bdfSTim Lee 11248d80bdfSTim Lee ${cmd}= Catenate loadsvf -d ${jtag_dev} -s /var/${svf_file} 11348d80bdfSTim Lee ${output} ${stderr} ${rc}= BMC Execute Command ${cmd} 11448d80bdfSTim Lee Should Not Contain ${stderr} tdo check error 11548d80bdfSTim Lee 11648d80bdfSTim Lee # control hot swap controller to power cycle whole system 11748d80bdfSTim Lee BMC Execute Command ${power_cycle_cmd} ignore_err=1 fork=1 11848d80bdfSTim Lee 11948d80bdfSTim Lee Sleep 10s 12048d80bdfSTim Lee Run Keyword Wait For Host To Ping ${OPENBMC_HOST} 5 mins 12148d80bdfSTim Lee ${cmd}= Catenate loadsvf -d ${jtag_dev} -s /var/${readusercode_svf} 12248d80bdfSTim Lee ${output} ${stderr} ${rc}= BMC Execute Command ${cmd} 12348d80bdfSTim Lee Should Contain ${output} ${version} 124