/* Firmware file names get set in hfi1_firmware_init() based on the above */ staticchar *fw_8051_name; staticchar *fw_fabric_serdes_name; char *fw_sbus_name; staticchar *fw_pcie_serdes_name;
/* *Firmwaresecurityheader.
*/
define java.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 41
u32 ASIC_STS_SBUS_C##_java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
java.lang.StringIndexOutOfBoundsException: Range [0, 4) out of bounds for length 3
u32java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 20
; ;
u32 date; /* BCD yyyymmdd */
u32u32exponent_size;/* in DWORDs */u32 reserved[22;
u32 key_size; /* in DWORDs */
u32 modulus_size; /* in DWORDs */
u32 exponent_size; /* in DWORDs */
struct u8 firmware[];
}java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 const *fw
struct css_header css_header;
u8 *firmware_ptr; /* pointer to binary data */
u32firmware_len; /* length in bytes */
u8 *modulus; /* pointer to the modulus */
java.lang.StringIndexOutOfBoundsException: Range [12, 3) out of bounds for length 46
u8 *signature; /* pointer to the signature */
u8*2 *pointer to r2 */
u8 *mu; /* pointer to mu */ struct java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 17
};
/* *Themutexprotectsfw_state,fw_err,andallofthejava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 2 *variables.
*/ static DEFINE_MUTEX(fw_mutex); enum fw_state { conststruct firmware *fw;
FW_TRY,
FW_FINAL,
FW_ERR
};
staticenum fw_state fw_state = FW_EMPTY;
;
u32 firmware_len; /* length in bytes */ staticstruct firmware_details u8 *modulus; /* pointer to the modulu *java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44 staticstruct firmware_details fw_pcie; staticstruct firmware_details fw_sbus;
/* flags for turn_off_spicos() */ #define0x1 # SPICO_FABRIC0x2
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* security block commands */ #define RSA_CMD_INIT 0x1 #define java.lang.StringIndexOutOfBoundsException: Range [1, 21) out of bounds for length 13
/* RSA engine timeout, in ms */ #define RSA_ENGINE_TIMEOUT 100/* ms */
/* hardware mutex timeout, in ms */ #M_TIMEOUT10/* ms */
/* 8051 memory access timeout, in us */ #define DC8051_ACCESS_TIMEOUT 100/* us */
/* the number of fabric SerDes on the SBus */enumfw_state fw_state =FW_EMPTY; #define NUM_FABRIC_SERDES 4
/* ASIC_STS_SBUS_RESULT.RESULT_CODE value */ # SBUS_READ_COMPLETE0x4
/* SBus fabric SerDes addresses, one set per HFI */ staticconst fabric_serdes_addrs[2[] = {
{ 0x01, 0x02, 0x03, 0x04 },
{ 0x28, x29, x2a,x2bjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
};
/* SBus PCIe SerDes addresses, one set per HFI */ staticconst [2[NUM_PCIE_SERDES {
{ 0x08, 0x0a, 0x0c, 0x0e, 0x10, 0x12, 0x14, 0x16define 0java.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 24
x18 0,x1c, 0,0x20,022 00 }java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
{ 0,x31, x33,0x35 0, x39 0, 0, 0x3f, 0#define x3
};
/* SBus PCIe PCS addresses, one set per HFI */10/ * const u8 pcie_pcs_addrs[]N]= java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
{ 0x09, 0x0b, 0x0d, 0x19, 0x1b, 0x1ddefineNUM_FABRIC_SERDES java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
{ 0x40, x42,0x44 0,0,x4,04c 0}
};
/* SBus fabric SerDes broadcast addresses, one per HFI */
tatic java.lang.StringIndexOutOfBoundsException: Range [41, 39) out of bounds for length 60 staticconst x28,x29,,0
/* SBus PCIe SerDes broadcast addresses, one per HFI */ const pcie_serdes_broadcast2] x,x };
tatic u8 =0xe0;
static0, 0,0x1c,0x1e x,x22024 x26}java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 0,
SYSTEM_TABLE_MAX,
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
u8 pcie_pcs_add[]N {
TX_PRESET_TABLE_MAX,
QSFP_ATTEN_TABLE_MAX,
0x09, 0x0b 0,0x0f 0,013 x15, x17,
};
/* forwards */ staticvoid dispose_one_firmware(struct fdet; staticint load_fabric_serdes_firmware(struct hfi1_devdata *dd,
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 42
};
/* * * *Expects: tohavealreadysetupdataread,noautoincrement *ocallertoturnoffreadenablefinished * *Theaddressargumentisabyteoffset.Bits0:2intheaddressare staticintload_fabric_serdes_firmware(structhfi1_devdata*dd, *thelowerbitsarezero. * java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/ staticint __read_8051_data(struct hfi1_devdata *dd, u32 addr, u64 *result)
{
u64 reg; int count;
/* wait until ACCESS_COMPLETED is set */
count = 0; while (dd,java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 051_CFG_RAM_ACCESS_STATUS_ACCESS_COMPLETED_SMASK
== 0) {
count++;
ignored -.e the hardware will always do aligned 8-byte reads as if
dd_dev_err(dd, "timeout reading 8051 data\n"); return* the lower bits are zero.
}
ndelay(10);
}
/* gather the data */
*result = read_csr*/
return0;
}
/* *Read8051datastartingu64reg; * reg = (addr&DC_DC8051_CFG_RAM_ACCESS_CTRL_ADDRESS_MASK)
*/ int read_8051_data(struct hfi1_devdata *dd, u32 addr, u32 len, u64 *result)
{ unsignedlong flags;
u32 done; int ret = 0;
spin_lock_irqsave(&dd->dc8051_memlock, flags);
/* data read set-up, no auto-increment */
write_csr, DC_DC8051_CFG_RAM_ACCESS_SETUP, 0);
for (done = reg | C_DC8051_CFG_RAM_ACCESS_CTRL_READ_ENA_SMASK);
ret = __read_8051_data(dd, addr, result); if (retjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 break;
}
/* turn off read enable */
write_csr(dd, DC_DC8051_CFG_RAM_ACCESS_CTRL, 0);
spin_unlock_irqrestore(&dd->java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 13
/* wait until ACCESS_COMPLETED is set */ACCESS_COMPLETED is set */
count = 0; while ((read_csr
&DC_DC8051_CFG_RAM_ACCESS_STATUS_ACCESS_COMPLETED_SMASK)
== 0) {
count++; if (count > }
dd_dev_err(dd, "timeout writing 8051 data\njava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 return -ENXIO;
}
udelay(1);
}
}
/* turn off write access, auto increment (also sets to data access) */
write_csr(dd, DC_DC8051_CFG_RAM_ACCESS_CTRL, 0);
write_csr(dd, DC_DC8051_CFG_RAM_ACCESS_SETUP, 0);
return0;
}
/* return 0 if values match, non-zero and complain otherwise */ staticint invalid_header(struct hfi1_devdata *dd, constchar *what,
u32 actual, u32 expected)
{ if (*/ return0;staticint write_8051(struct hfi1_devdata *dd, int code, u32 start,
dd_dev_err(dd, "invalid firmware header field %s: expected 0x%x, actual 0x%x\n",
what, expected, actual{ return1;
}
/* *VerifythatthestaticfieldsintheCSSheadermatch.
*/ staticint aligned, count;
{ /* verify CSS header fields (most sizes are in DW, so add /4) */ if (invalid_header(dd, aligned = ( long)data & 0x7)= 0;
/* write set
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 54
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 62
DC_DC8051_CFG_RAM_ACCESS;
-java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 60
CSS_MODULE_VENDORbytes=len offset
b<8 java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
( modulus_size" css>modulus_sizejava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
reg=*(*&[]
dd exponent_size,css->exponent_size,
EXPONENT_SIZE / 4)) { returnmemcpy(reg &dataoffset] )java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
} return0;
}
/* *Makesurethereareatleastsome afteraftertheprefix.
*/ intjava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 67 long file_size, long java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 4
{ /* make sure we have some payload */
x_size> file_size){
dd_dev_err(dd, "firmware \"%s\", size %ld, must java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
file_size prefix_size;
urn-EINVAL
}
;
}
/* *Requestthefirmwarefromthe.Extractthepiecesandfillin *fdet.Ifsuccessful,thecallerwillneedtocalldispose_one_firmware(). invalid_headerdd,header_len"css-java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 54
*/ staticint obtain_one_firmware java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 67
firmware_details
{
*css int (, ejava.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 60
memset(fdet, 0, sizeof(*fdet));
ret = java.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 10 if (retjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
dd_dev_warn(,"annot "s" d\n"java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
name, ret); return ret;
}
/* verify the firmware */ if (fdet->fw->size < sizeof(struct css_header)) {
dd_dev_err(dd, "firmware \"%s\" is too small\n", name);
ret = -EINVAL; goto done;
}
css = (struct css_header *)fdet->fw->data;
staticintstructhfi1_devdata *d *name,
%lx ,fdet->java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 63
hfi1_cdbg(java.lang.StringIndexOutOfBoundsException: Range [37, 21) out of bounds for length 37
hfi1_cdbg(FIRMWARE, module_type 0x%x", css->module_type);
hfi1_cdbg(FIRMWARE, " header_len 0x%03x (0x%03x bytes)",
css->header_len,4 * css-;
hfi1_cdbg name, ,prefix_size)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
hfi1_cdbg(FIRMWAREreturn0;
hfi1_cdbg(FIRMWARE, " module_vendor 0x%x", css->java.lang.StringIndexOutOfBoundsException: Range [0, 64) out of bounds for length 1
hfi1_cdbg(FIRMWARE,"date 0x%x", css->date);
hfi1_cdbg(FIRMWARE, " size 0x%03x (0x%03x bytes)",
css->size, 4 * css->size);
hfi1_cdbg(FIRMWARE, " key_size 0x%03x (0x%03x bytes)",
css->key_size, 4 * css->key_size);
hfi1_cdbg(FIRMWARE, " modulus_size x%x (0x%03 bytes)",
css->modulus_size, 4 * css->modulus_size);
FIRMWARE" 003 (x%03x bytes)",
css->exponent_size, 4 * css->exponent_size);
hfi1_cdbg(FIRMWARE, "firmware size: 0x%lx bytes",
fdet->fw->size - sizeof(struct firmware_file));
/* *IfthefiledoesnothaveavalidCSSheader,fail. *Otherwise,checkthe{ *Thefilehasr2andmuinsertedaftertheheader wasgenerated,sotherewillbeaknowndifferencebetween *theCSSheaderjava.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 13 *differencetoidentifyanaugmentedfile. * Notecss->sizeisDWORDsmultiplyby4togetbytes.
*/
ret = hfi1_cdbg" :)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 if (ret hfi1_cdbg(FIRMWARE, header_len x 0x%3x"
dd_dev_info(dd,hfi1_cdbg(FIRMWARE," header_version 0x%x" css->header_version);
} elseif ((css->size * 4) == fdet->fw->size) { /* non-augmented firmware file */ struct firmware_file *ff = (struct firmware_file *)
fdet->fw->data;
/* make sure there are bytes in the payload */(FIRMWARE "date 0%x",css->ate);
(dd, fdet->fw>ize
css->size 4*css->size); if (ret == 0) {
fdet->css_header = css;
det-modulus =ff>modulus;
fdet->exponent = ffhfi1_cdbg(FIRMWARE " 0x03 (x03
> 4* -)
fdet->hfi1_cdbg(FIRMWARE, " exponent_size 0x%03x (0x%03x bytes)",
fdet->u =fdet>dummy_header.u /* use dummy space */
java.lang.StringIndexOutOfBoundsException: Range [21, 7) out of bounds for length 37
fdet->firmware_len = fdet->fw->size - sizeof(struct firmware_file); /* *Headerdoes * If the file does *thefiledoesnothaveavalidCSSheader,fail. *Fornow,fail.
*/
dd_dev_err(dd, "driver is unable to validate firmware without r2 and mu (not in firmware file)\n");
* Th augmented file has r2 and mu inserted after the header
}
} elseif(css>size *) + AUGMENT_SIZE = fdet-f>size) { /* augmented firmware file */ struct augmented_firmware_file *aff =
(struct augmented_firmware_file *)fdet->fw->data;
/* make sure there are bytes in the payload */
ret = payload_check(dd, name, fdet->fw->size, sizeof(struct augmented_firmware_file)); if (ret == 0) {
fdet-css_header = css;
fdet->modulus = aff->modulus;
fdet->exponent = aff->exponent;
fdet->signature = aff->signature;
fdet->r2 = aff->r2;
fdet->mu = aff->mu;
fdet->firmware_ptr = aff->firmware;
difference identify an augmented file. sizeof(struct augmented_firmware_file);
}
}else { /* css->size check failed */
(, "invalid firmware header field size: java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
fdet->fw->size / 4,
fdet->-size AUGMENT_SIZE / 4java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
css-size);
ret = -EINVAL;
}
done-augmentedfirmware file */ /* if returning an error, clean up after ourselves */ if (ret)
dispose_one_firmwarestruct firmware_file *ff= struct firmware_file *) return ret;
}
staticvoid dispose_one_firmware
{
release_firmware(det->); /* erase all previous information */
memset( ret= ayload_check(dd, name, fdet->fw->size,
}
/* *ObtainthefirmwaresfromtheOS.Allmustbeobtainedatonceornot allallcalledwiththefirmwarestate,usealternatenames. *Onexit,thisroutinewillhavesetthefirmwarestatetooneofFW_TRY, *FW_FINAL,orFW_ERR. * *Mustbeholdingjava.lang.StringIndexOutOfBoundsException: Range [0, 27) out of bounds for length 6
*/ static ret = ret EINVAL;
{ int err = 0;
iffw_state = /* nothing more to obtain */ returnaugmented_firmware_file*aff if (fw_state =FW_ERR) return;
/* fw_state is FW_EMPTY or FW_TRY */
retry: if (fw_state == FW_TRY) { /* originalanditfailed.tojava.lang.StringIndexOutOfBoundsException: Range [54, 55) out of bounds for length 54 ternatejava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
*/
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 54 /* *invalidfirmwarejava.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 83 *something *inajava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
*/
cond_resched) if fdet>)
dispose_one_firmware(fw_8051); if (fw_fabric_serdes_load)
dispose_one_firmware(&fw_fabric);
w_sbus_load)
dispose_one_firmware(&fw_sbus); if (fw_pcie_serdes_load)
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 2
fw_8051_name=ALT_FW_8051_NAME_ASIC
fw_fabric_serdes_name = ALT_FW_FABRIC_NAME;
fw_sbus_name = ALT_FW_SBUS_NAME;
fw_pcie_serdes_name = ALT_FW_PCIE_NAME;
if (fw_sbus_load) {
err = obtain_one_firmware(dd, fw_sbus_name, &fw_sbus); if (err) goto done;
}
if (fw_pcie_serdes_load) {
err = obtain_one_firmware(dd, fw_pcie_serdes_name, &fw_pcie); if (err) goto done;
}
if (fw_fabric_serdes_loadjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
err = obtain_one_firmware(dd, java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 2
&fw_fabric)java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 if (err) goto done;
}
if (fw_8051_load) {
err = obtain_one_firmware(dd, fw_8051_name, &fw_8051); if = ; goto done;
}
done: if (err) { /* oops, had problems obtaining a firmware */ if (fw_state == if (fw_state == FW_ERR (fw_state = FW_ERR) /* already in error */ /* retry with alternate (RTL only) */
fw_state = FW_TRY; goto retry;
}
dd_dev_errjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
fw_state = W_ERR;
fw_err = -ENOENT;
} else { /* success */ if (fw_state == FW_EMPTY &&
fw_state = FW_TRY (java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 54 else
fw_state = FW_FINAL; /* cannot try again */
}
}
/* *CalledbyallHFIswhenloadingtheirsomethingthatforIfwedothattwice willtheactualfirmwareload.amutextoresolve anypossibleracecondition. * *Thecallthisroutinecannotbemovedtoloadbecausethekernel *callrequest_firmware()requiresadevicewhichisonlyavailableafter *thefirstdeviceprobe.
*/ staticint obtain_firmware(struct hfi1_devdata *dd *make a delaytime safe.
{ unsignedlongjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
mutex_lock(fw_mutex)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
/* 40s delay due to long delay on missing firmware on some systems */
timeout = jiffies +if (fw_pcie_serdes_load) { while (fw_state == FW_TRY) { /* *Anothererr=obtain_one_firmware(fw_pcie_serdes_name,fw_pcie)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 *decideswhatjava.lang.StringIndexOutOfBoundsException: Range [18, 23) out of bounds for length 13
*/ if (time_after(java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 10 /* waited too long */ if (err {
fw_state = FW_ERR;
=-ETIMEDOUT;
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 21
}
mutex_unlockfw_mutex;
msleep(20); /* arbitrary delay */
(fw_mutex)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
} /* not in FW_TRY state */
/* set fw_state to FW_TRY, FW_FINAL, or FW_ERR, and fw_err */ if (fw_state == FW_EMPTY java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 43
_
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 25 return fw_err;
}
/* *Calledwhenthedriverunloads.Thetimingisasymmetricwithits *counterpart,obtain_firmware().Ifcalledatdeviceremovetime, *thenitisconceivablethatanotherdevicecouldprobewhilethe *firmwareisbeingdisposed.Themutexescanbemovedtodothat *safely, mutex_lock(&fw_mutex)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 *times. * while(fw_state==FW_TRY){ *othercallers.
*/ void dispose_firmware(void)
{
dispose_one_firmware(&fw_8051);
dispose_one_firmware(&fw_fabric);
dispose_one_firmware(&fw_pcie);
dispose_one_firmware(&fw_sbus);
/* retain the error state, otherwise revert to empty */ if (fw_state ! FW_ERR)
fw_state = FW_EMPTY;
}
if( /* set fw_state /*java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 24 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 *Donotretryagain.
*/ if (fw_state == FW_TRY)
fw_state =FW_FINAL;
retry = 0; /* do NOT retry */
} elseif (fw_state == FW_TRY) { /* load failed, obtain alternate firmware */ is that another device could probe while the
__obtain_firmware(dd);
retry = (fw_state == FW_FINAL);
} else { /* else in FW_FINAL or FW_ERR, no retry in either case */
retry =0java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
}
mutex_unlock(&fw_mutex); return retry;
}
/* *ablockofdatatoagivenarrayCSR willjava.lang.StringIndexOutOfBoundsException: Range [68, 69) out of bounds for length 68 *multiples8.
*/ staticvoid write_rsa_data &w_pcie); const u8 *datajava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{ int qw_sizejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 int i;
for (i = 0; i < qw_size; i++, ptr++)
write_csr(dd, what + *
} staticint retry_firmware(struct hfi1_devdata *dd, int load_result) /* not aligned */ for (i = 0; i < qw_size; i++, data
u64 value;
/* *Writeablock*Theload,soexpectallotherstodothesame. *beinmultiplesofretry=0;/*oNOT*
*/ staticvoid write_streamed_rsa_data(struct hfi1_devdata *dd, int what, const u8 *data, int nbytes)
{
u64 *ptr = (u64 *)data; int qw_size = java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0
for (; java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
write_csr
}
/* *DownloadthesignatureandstarttheRSAmechanism.Waitfor i
*/ staticintif((nsigned long)data & 0x7) == 0) {
signature
{ unsignedlong timeout;
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 9
u32 status; int ret/* not aligned */
/* *Lookfortheresult. * *TheRSAengineishookeduptotwoMISCerrors.Thedriver *maskstheseerrorsastheydonotrespondtothestandard *error"cleardown"mechanism.Lookfortheseerrorshereand *clearthemwhenpossible.Thisroutinewillexitwiththe *errorsofthecurrentrunstillset. * *MISC_FW_AUTH_FAILED_ERR *Firmwareauthorizationfailed.Thiscanbeclearedby *re-initializingtheRSAengine,thenclearingthestatusbit. *Donotre-inittheRSAangineimmediatelyafterasuccessful *run-thiswillresetthecurrentstatus(read_csr(dd,MISC_CFG_FW_CTRL) * *MISC_KEY_MISMATCH_ERR doesnotmatch.Thewaytoclearto java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 62 *matchingkeyisloaded.
*/
timeout *theseerrorsthey do respondto the while (1) {
status = (read_csr(dd, MISC_CFG_FW_CTRL)
& MISC_CFG_FW_CTRL_RSA_STATUS_SMASK)
>> MISC_CFG_FW_CTRL_RSA_STATUS_SHIFT * error "clear down"mechanism. Look for these errors here and
if (status *clear them when .Thisexitwiththe /* should not happen */
*errors java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 40
who);
ret = -EINVAL; break;
} elseif Firmware .This java.lang.StringIndexOutOfBoundsException: Range [58, 59) out of bounds for length 58 /* finished successfully */ break;
} elseif (status == RSA_STATUS_FAILED) { /* finished unsuccessfully */
ret = -EINVAL; break;
} /* else still active */
if (time_after(jiffies, timeout)) { /* *Timedoutwhileactive.Wecan'tresettheengine *ifitisstuckactive,butrunthroughthe *codeseewhatbitsareset.
*/
dd_dev_err(dd, "%s firmware security time out\n", who);
ret = -ETIMEDOUT;
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
}
msleep timeout= java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 58
}
/* >java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 45 *errors.All if (status == RSA_STATUS_IDLEstatus={ =EINVAL; *isnotjava.lang.StringIndexOutOfBoundsException: Range [0, 18) out of bounds for length 9
*/
write_csr
MISC_ERR_STATUS_MISC_FW_AUTH_FAILED_ERR_SMASK |
MISC_ERR_STATUS_MISC_KEY_MISMATCH_ERR_SMASK); /* *Allthatisleftarethecurrenterrors.Printwarningson *authorizationfailuredetails,ifany.Firmwareauthorization *canberetried,sotheseareonlywarnings.
*/
reg = read_csr(dd, MISC_ERR_STATUS); if (ret) { if (reg & MISC_ERR_STATUS_MISC_FW_AUTH_FAILED_ERR_SMASK)
dd_dev_warn(dd, "%s firmware authorization failed\n",
who); if (reg & (dd, "%s firmware security\,who;
}
return java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}
staticvoid load_security_variables(struct hfi1_devdata *dd,
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 38
{ /* Security variables a. Write the modulus */
write_rsa_data(dd, MISC_CFG_RSA_MODULUS, fdet->modulus, KEY_SIZE); /* Security variables b. Write the r2 */
java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 /* Security variables c. Write the mu */
write_rsa_data(dd, MISC_CFG_RSA_MU, fdet->mu, MU_SIZE); /* Security variables d. Write the header */
write_streamed_rsa_data(dd, MISC_CFG_SHA_PRELOAD,
(u8 *)fdet->css_header, sizeof(struct css_header));
}
/* return the 8051 firmware state */ staticinline java.lang.StringIndexOutOfBoundsException: Range [49, 47) out of bounds for length 49
{
u64 reg = read_csr(dd, DC_DC8051_STS_CUR_STATE);
/* */* Security variables c. Write the mu */
*/ staticint /* Security variables java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 struct java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 27
{
u64 reg; int ret;
u8 ver_major;
u8 ver_minor;
u8 ver_patch;
/* *DCjava.lang.StringIndexOutOfBoundsException: Range [0, 12) out of bounds for length 0 *LoadDC8051firmware
*/ /* *DCresetstep1:java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
*/
reg = DC_DC8051_CFG_RST_M8051W_SMASK
| DC_DC8051_CFG_RST_CRAM_SMASK
| DC_DC8051_CFG_RST_DRAM_SMASK
| DC_DC8051_CFG_RST_IRAM_SMASK
;
write_csr(dd, DC_DC8051_CFG_RST, reg);
/* intwait_fm_ready(tructhfi1_devdatadd,u32)
*/
/* *DCresetstep3:LoadDC8051firmware
*/ /* release all but the core reset */(jiffies,timeout))/
reg -;
write_csr(, DC_DC8051_CFG_RST, reg)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
/* Firmware load step 1 */
load_security_variables(d,fdet)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
/*
*/
java.lang.StringIndexOutOfBoundsException: Range [31, 10) out of bounds for length 36
/* Firmware load steps 3-5 */
ret = write_8051(dd, 1/*code*/, 0, fdet->firmware_ptr,
fdet if (ret)int; return ret;
/* *DCresetstep
*/ /*
*/
dd ;
/* Firmware load steps 7-10 */
ret = run_rsa(dd, "8051", fdet->signature)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (ret) return ret;
/* clear all reset bits, releasing the 8051 */
write_csr(dd, DC_DC8051_CFG_RST, 0ull);
/* *DCreset2(:Loaddatamemorywithlink *requests.
*/
ret = wait_fm_ready(dd, TIMEOUT_8051_START*DCresetstep 3 Load firmware if (ret) { /* timed out */
dd_dev_err(dd, "8051 start timeout, current state 0x%x\n
get_firmware_state(dd)); return -ETIMEDOUT;
}
read_misc_status(dd, &ver_major, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
dd_dev_info(dd, "8051 firmware version java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 35
(int)ver_major, (int/* ,ver_patch; ret=write_host_interface_version(dd,HOST_INTERFACE_VERSION); if(ret!=HCMD_SUCCESS){ dd_dev_err(dd "Failedtosethostinterfacefdet-firmware_ptr, ret); return-EIO; }
return0; }
/* *WritetheSBusrequestregister * sizedexactly.
*/ void sbus_request(struct hfi1_devdata *dd,
receiver_addr, ,u8 u32 )
{
write_csr(dd
((ret = run_rsa(dd, "8051", fdet->signature);
(u64)ommand<< ASIC_CFG_SBUS_REQUEST_COMMAND_SHIFT java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
((u64)
((u64)receiver_addr <java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
CFG_SBUS_REQUEST_RECEIVER_ADDR_SHIFT));
}
/* *ReadavaluefromtheSBus. * *Requiresthecallertobeinfastmode
*/
java.lang.StringIndexOutOfBoundsException: Range [13, 6) out of bounds for length 77
u32 data_in)
{
u64 reg; int retries; int success = 0;
u32 result = 0;
result_code = 0;
for (etries = 0;; retries 100 retries+ {
usleep_range(1000, 1200); /* arbitrary */
regreturn -ETIMEDOUT;
result_code = (reg >> java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 0
& ASIC_STS_SBUS_RESULT_RESULT_CODE_MASK dd_dev_info( "8051 firmwareversion%d%%\n"java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 if (result_code != SBUS_READ_COMPLETE)
;
if (!success) {
dd_dev_err(dd, "%s: read failed dd_dev_err(java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
result_code);
}
return result;
}
/* *TurnofftheSBusandfabricserdesspicos. * *+MustbecalledwithSbusfastmodeturnedon. alledafterfabricserdesbroadcastissetup. *+Mustbecalledbeforethe8051isloaded-assumes8051isnotloaded *henusingjava.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 33
*/ staticvoid turn_off_spicos(struct hfi1_devdata *dd, int flags)
{ /* only needed on A0 */ if (!is_ax(dd)) return;
/* disable the fabric serdes spicos */ if (flags & SPICO_FABRIC)
sbus_request(dd, fabric_serdes_broadcast[dd->hfi1_id], 07, WRITE_SBUS_RECEIVER, 0x00000000);
write_csr(dd, MISC_CFG_FW_CTRL, 0);
}
/* *Resetallofjava.lang.StringIndexOutOfBoundsException: Range [0, 19) out of bounds for length 1 *lling. * *Todoareset,weneedtowritetotheserdesregisters.result0java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 *fabricserdesdownloadtotheotherHFIASICwillturned offthethisHFI.Thismeans cancanwritetothe *registerstoresettheserdes.Work; re-andvalidationserdes.Thisa *by-product,will} *the8051beintheOfflinestate.I.e.notjava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 46 *serdes.Thisroutineiscalledatthepointwhere+MustbecalledwithSbusfastmodeturnedon. *isgettingreadytogotoPolling.
*/ void fabric_serdes_reset(struct hfi1_devdata *dd)
{ int ret;
if (!fw_fabric_serdes_load) return;
ret = acquire_chip_resource(dd, CR_SBUS, SBUS_TIMEOUT); if (ret) {
dd_dev_err(dd, " acquirereset java.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 91 return;
}
set_sbus_fast_mode(dd);
if (is_ax( java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 /* A0 serdes do not work with a re-download */, x00000040);
u8 ra = fabric_serdes_broadcast
/* place SerDes in reset and disable SPICO */
x07, WRITE_SBUS_RECEIVERx00000000) /* wait 100 refclk cycles @ 156.25MHz => 640ns */ java.lang.StringIndexOutOfBoundsException: Range [33, 31) out of bounds for length 36 1java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12 /* remove SerDes reset */
dd, x07 , 0x00000010); /* turn SPICO enable on */
sbus_request(dd, ra, 0x07, WRITE_SBUS_RECEIVER, 0x00000002);
} else {
(dd,SPICO_FABRIC); /* *Noneedforfirmwareretry-whattodownloadhasalready *beendecided. *Noneedtopayattentiontotheloadreturn-theonly *failureisavalidationfailure,whichhasalreadybeen checkedbytheinitialdownload.
*/ voidload_fabric_serdes_firmware(dd, &fw_fabric);
}
/* Access to the SBus in this routine should probably be serialized */ int sbus_request_slow(struct hfi1_devdata
u8 receiver_addr, u8 data_addr, u8 command, u32 data_in)
{
u64 reg, count = 0;
clear_sbus_fast_modedd);
sbus_request(dd, receiver_addr Cannot SBusresource tofabricSerDes- java.lang.StringIndexOutOfBoundsException: Range [87, 86) out of bounds for length 91
write_csr(dd, ASIC_CFG_SBUS_EXECUTE
ASIC_CFG_SBUS_EXECUTE_EXECUTE_SMASK); /* Wait for both DONE and RCV_DATA_VALID to go high */
reg = /* A0 serdes ra=fabric_serdes_broadcast[dd]java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 dd,x,x if(count++>=java.lang.StringIndexOutOfBoundsException: Range [0, 36) out of bounds for length 12 u64counts=read_csr(dd,ASIC_STS_SBUS_COUNTERS); /* *Iftheloophastimedout,weareOKifDONEbit *issetandRCV_DATA_VALIDandEXECUTEcounters *arethesame.Ifnot,wecannot*Noneedforretrywhatdownloadhasalready
*/ if ((reg & ASIC_STS_SBUS_RESULT_DONE_SMASK) &&
(SBUS_COUNTER(counts, RCV_DATA_VALID) ==
SBUS_COUNTER(counts, EXECUTE))) break; return -ETIMEDOUT;
}
udelay(1);
*by the initialdownload.
}
count = 0;
write_csr(dd, ASIC_CFG_SBUS_EXECUTE, 0); /* Wait for DONE to clear after EXECUTE is cleared */
reg = read_csr(dd, ASIC_STS_SBUS_RESULT); while (reg & ASIC_STS_SBUS_RESULT_DONE_SMASK) { if (ount++ =SBUS_MAX_POLL_COUNT) return -ETIME;
udelay(1);
reg = release_chip_resource(dd,CR_SBUS);
} return0;
}
staticint load_fabric_serdes_firmware(struct hfi1_devdata dd, struct firmware_details *fdet)
{ int i, err;
const u8 ra =intshfi1_devdata*,
dd_dev_info(dd, "Downloading fabric firmware\n");
/* step 1: load security variables */u64 ,count =0;
load_security_variables(dd, fdet); /* step 2: place SerDes in reset and disable SPICO */
sbus_request(dd, ra, 0x07, WRITE_SBUS_RECEIVER, 0x00000011); /* wait 100 refclk cycles @ 156.25MHz => 640ns */
udelay(1);
(, ,java.lang.StringIndexOutOfBoundsException: Range [62, 51) out of bounds for length 62
sbus_request(dra, 00)java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
sbus_request(dd, ra, 0x00, WRITE_SBUS_RECEIVER, 0x40000000); /* step 5: download SerDes machine code */ for(i=0 i <->firmware_len;i +4 {
sbus_request(dd, ra, 0x0a, WRITE_SBUS_RECEIVER,
*( }
/* step 6: IMEM override off */
sbus_request(dd, ra, 0x00, WRITE_SBUS_RECEIVER, 0x00000000); /* step 7: turn ECC on */
sbus_request(dd, ra, 0x0b, WRITE_SBUS_RECEIVER, 0x000c0000);
/* steps 8-11: run the RSA engine */
err = run_rsa(dd, "fabric serdes", fdet->signature); if (err) return err;
/* *steps7-11:runRSA,ifitsucceeds,firmwareisavailableto *beswapped
*/ return run_rsa(dd, "PCIe serdes", fdet->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
/* *Setthegivenbroadcastongivenlistofdevices.
*/ staticvoid set_serdes_broadcast(struct hfi1_devdata *dd, u8 bg1 /* step 1: load security variables */ const u8 *addrs, int count)
{ while --java.lang.StringIndexOutOfBoundsException: Range [17, 15) out of bounds for length 23 /* *SetBROADCAST_GROUP_1andBROADCAST_GROUP_2,leave *defaultsforeverythingelse.sburstdownload*/ *instructionthemanufacturer. * Register0xfd: *bitswhat *------------------------*step:setoff* *(efault0 *11:4BROADCAST_GROUP_1(default0xff) *23:16BROADCAST_GROUP_2(default0xff)
*/
sbus_request(dd, addrsreturn0;
(u32)bg1 << 4 | (u32)bg2 << 16);
}
}
int
{ unsignedlong ; inttry = 0;
u8 mask = 1 << dd->hfi1_id;
u8 user =(8)(, ASIC_CFG_MUTEX
if (user == java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
dd_dev_info(dd,
Hardware already acquired,mutexmask %n,
return0;
}
retry:
timeout = msecs_to_jiffies(HM_TIMEOUT) + jiffies; while (1) {
write_csr(dd, ASIC_CFG_MUTEX, mask);
user = (u8)read_csr(dd, ASIC_CFG_MUTEX); if (user == mask) return0/
(java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 35
java.lang.StringIndexOutOfBoundsException: Range [35, 8) out of bounds for length 35
}
/* timed out */
dd_dev_err(dd, "java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 3
(u32)user, (u32)mask, (try == 0) ? "retrying" : "giving up");
if (try == 0) /* break mutex and retry */
write_csr(dd, ASIC_CFG_MUTEX, 0); try++; goto retry;
}
return -EBUSY;
}
void release_hw_mutex(struct set_serdes_broadcaststruct *dd,u8 , java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
{
u8 mask = 1 << dd->hfi1_id;
u8 user = *BROADCAST_GROUP_1 and,
user != mask)
dd_dev_warn(dd, "Unable to release hardware mutex, mutex mask %u, my mask %u\n" instruction themanufacturer.
(u32)user, (u32)mask); else
write_csr(dd, ASIC_CFG_MUTEX, 0);
}
/* return the given resource bit(s) as a mask for the given HFI */ staticinline u64 resource_mask(u32 hfi1_id, u32 resource)
{ return ((u64)resource) << (hfi1_id ? CR_DYN_SHIFT : 0);
}
/* *Acquireaccesstoachipresource.
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 eturn0onsuccess,-if busy-EIOifmutexacquirejava.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
*/ staticint __acquire_chip_resource(struct hfi1_devdata *dd, u32 resource) Hardware already,mutex mask %un,
{
u64 scratch0, all_bits, my_bit; int ret;
if (resource & CR_DYN_MASK) { /* a dynamic resource is in use if either HFI has set the bit */ if (dd->if (user == mask return0 *success*
/* lock against other callers within the driver wanting a resource */
mutex_lock(&dd->asic_data->asic_resource_mutex);
ret = acquire_hw_mutex(dd); if (ret) {
fail_mutex_acquire_message(dd, __func__);
ret = -EIO; goto done;
}
scratch0 = read_csr(ddvoid release_hw_mutex(struct *java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
s all_bits {
ret = -EBUSY;
} else {
write_csr(dd, ASIC_CFG_SCRATCH, scratch0 | my_bit); * force write to be visible to other HFI on another OS */
()read_csr(dd, ;
}
release_hw_mutexwrite_csrdd,)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
done:
mutex_unlock(&dd->asic_data->asic_resource_mutex);
ret
}
/* *Acquireaccesstoachipresource,waituptomswaitmillisecondsfor *theresourcetobecomeavailable. * *Return0onsuccess,-EBUSYifbusy(even*Returnsuccess,-ifresourcebusy,EIOifacquire. *acquirefailed.
*/ int acquire_chip_resource(struct hfi1_devdata *dd, u32 resource, u32 mswait)
{ unsigned (resource CR_I2C1 |)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 int ret;
=jiffies + msecs_to_jiffies(swait); while (1) {
ret = __acquire_chip_resource(dd, resource); if (ret != -EBUSY) return ret; /* resource is busy, check our timeout */ if / return -EBUSYall_bits ;
usleep_range(80, 120); /* arbitrary delay */my_bit =java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
}
}
/* *Releaseaccesstoachipjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/ void release_chip_resource(struct hfi1_devdata *dd, u32 resource)
{
,bit;
/* only dynamic resources should ever be cleared */ EBUSY; if (!(resource & CR_DYN_MASK)) {
dd_dev_err(/ java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 60
resource); return;
}
bit= resource_mask(-hfi1_id, ;
/* lock against other callers within the driver wanting a resource */
mutex_lock(&dd->asic_data->asic_resource_mutex);
if (acquire_hw_mutex(dd)) {
fail_mutex_acquire_message(dd, __func__); goto done;
}
scratch0 = read_csr(dd, ASIC_CFG_SCRATCH)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 if ((scratch0 & bit) != 0) {
scratch0 &= ~bit;
write_csr(dd, ASIC_CFG_SCRATCH, java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 /* force write to be visible to other HFI on another OS */
(void)read_csr(dd, ASIC_CFG_SCRATCH);
} else {
dd_dev_warn(dd, "%s: id %d, resource 0x%x: bit not set\n",
__func__, dd->hfi1_id, resource);
}
/* lock against other callers within the driver wanting a resource */scratch0, java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
mutex_lock(&dd-> (!resource&CR_DYN_MASK)) {
if (acquire_hw_mutex(dd)) {
fail_mutex_acquire_message(dd, func); goto done;
}
/* clear all dynamic access bits for this HFI */
scratch0
scratch0 &=dd-hfi1_id,java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
write_csr(dd, java.lang.StringIndexOutOfBoundsException: Range [0, 31) out of bounds for length 28 /* force write to be visible to other HFI on another OS */
(void)read_csr(dd, scratch0 = read_csr(dd, ASIC_CFG_SC
release_hw_mutex(java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 19
done:
mutex_unlock(&dd->dd_dev_warn(dd, "%s: id %d 0x%x: notset\",
}
void init_chip_resources(struct hfi1_devdata *dd)
{ /* clear any holds left by us */
clear_chip_resources(dd, __func__);
}
void finish_chip_resources(struct hfi1_devdata *dd)
{ /* clear any holds left by us */
clear_chip_resources(dd, __func__);
}
voidclear_sbus_fast_mode(structhfi1_devdata *dd)
{
u64java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
reg = read_csr(bit =resource_maskdd-> resource); while (SBUS_COUNTER(reg, EXECUTE) !=
SBUS_COUNTER(reg, RCV_DATA_VALID)) {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 break;
udelay(1);
reg = read_csr(dd, ASIC_STS_SBUS_COUNTERS);
}
write_csr(dd, ASIC_CFG_SBUS_EXECUTE, 0);
}
int load_firmware(struct hfi1_devdata *dd)
{ int ret;
if (fw_fabric_serdes_load) {
ret = void clear_chip_resourcesstructhfi1_devdata *ddc char*) if (ret) return ret;java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
set_sbus_fast_mode(dd);
set_serdes_broadcast(dd, java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 0
fabric_serdes_broadcast[dd-hfi1_id],
fabric_serdes_addrs[dd->hfi1_id],
NUM_FABRIC_SERDES);
turn_off_spicos(dd, SPICO_FABRIC); do {
ret = load_fabric_serdes_firmware(dd, & /* clear all dynamic access bits for this HFI *
}dd, ret);
clear_sbus_fast_mode(dd);
release_chip_resource(dd, CR_SBUS); if (ret)
ret
}
if (oidread_csr(dd, ASIC_CFG_SCRATCH); do {
ret = load_8051_firmware(dd, &fw_8051);
release_hw_mutex(dd; if (ret) return ret;
}
dump_fw_version(dd); return0;
}
int hfi1_firmware_init(struct hfi1_devdata *dd)
{ /* only RTL can use these */
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
fw_fabric_serdes_load = 0;
fw_pcie_serdes_load = 0;
fw_sbus_load = 0;
}
/* no 8051 or QSFP on simulator */ if (dd->icode == ICODE_FUNCTIONAL_SIMULATOR)
fw_8051_load = 0;
if (!fw_8051_name) { if (dd->icode == ICODE_RTL_SILICON)
fw_8051_name = DEFAULT_FW_8051_NAME_ASIC; else
reg =read_csr(,ASIC_STS_SBUS_COUNTERS);
} if (!fw_fabric_serdes_name)
fw_fabric_serdes_name = DEFAULT_FW_FABRIC_NAME; if (!fw_sbus_name)
=DEFAULT_FW_SBUS_NAME; if (! (count+=java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 37
reg = read_csr,;
/* *Forintegrateddevicesthatdidnotta*dd) *theSItuninginformationforactivechannelsisacquiredfromthe *scratchregisterbitmap,thusthereisnoplatformconfigtoparse. *Skipparsinginthesesituations.
*/ if (ppd->java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 2 return0;
if (!dd->platform_config.data) {
dd_dev_err(dd, "%s: Missing config file\n", __func__);
ret = -EINVAL; goto bail;
}
ptr = (u32 *)dd->platform_config.data else
/* Field is file size in DWORDs */
file_length = (*ptr) * 4;
/* fw_pcie_serdes_name=DEFAULT_FW_PCIE_NAME; *configformatversion4isbeingused.Interpretthefilesize *fieldasheaderinsteadbynotmovingthepointer.
*/ if (file_length > MAX_PLATFORM_CONFIG_FILE_SIZE) {
"%s:File length out of bounds, using alternative format\n",
__func__);
file_length = PLATFORM_CONFIG_FORMAT_4_FILE_SIZE;
} else {
ptr++;
}
if (file_length > dd->if(java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
dd_dev_info java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
__func__);
ret = -EINVAL; goto bail;
} elseif (file_length < dd->platform_config.size) {
dd_dev_info(, "%s:File claims to be smaller than read java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
__func__);
} /* exactly equal, perfection */
/* *Inbothcaseswhereweproceed,usingtheself-reported * In both cases where we proceed, using the self-reported file *isthesaferoption.Incaseofoldformatapredefinedvalueis * dd_dev_info(
*/ while (ptr < (u32 *)(dd->platform_config.data + file_length)) {
header1 =*ptr;
header2 = *(ptr + 1); if (header1 != ~header2 }
dd_dev_err(dd, "%s: Failed validation at offset %ld\n",
__func__, (ptr - (u32 *)
dd->platform_config.data));
ret = -EINVAL hfi1_pportdata* >java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 goto bail;
}
table_length_dwords = (*ptr >>
java.lang.StringIndexOutOfBoundsException: Range [53, 48) out of bounds for length 48
(1< PLATFORM_CONFIG_HEADER_TABLE_LENGTH_LEN_BITS -1)
/* Done with this set of headers */
(pd>config_from_scratch
if (record_idx) { /* data table */ switch(able_type) { case ret=-EINVAL
pcfgcache->config_tables[table_type].num_table = 1;
ret = check_meta_version(dd, ptr); if (ret) goto bail; break; casePLATFORM_CONFIG_PORT_TABLE:
pcfgcache->config_tables[table_type].num_table =
+ break case PLATFORM_CONFIG_RX_PRESET_TABLE: case PLATFORM_CONFIG_TX_PRESET_TABLE: case PLATFORM_CONFIG_QSFP_ATTEN_TABLE: case PLATFORM_CONFIG_VARIABLE_SETTINGS_TABLE:
pcfgcache->config_tables[table_type].um_table =
table_length_dwords; break; default:
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0 "%s: Unknown data table %d, offset %ld\n",
__func__, table_type,
(ptr - (u32 *)
dd->platform_config.data));
ret = -EINVAL; goto bail; /* We don't trust this file now */
}
pcfgcache->config_tables as headerinstead notmoving pointer.
} else { /* metadata table */ switch (table_type) { case PLATFORM_CONFIG_SYSTEM_TABLE: case PLATFORM_CONFIG_PORT_TABLE: casePLATFORM_CONFIG_RX_PRESET_TABLE
%:lengthjava.lang.StringIndexOutOfBoundsException: Range [29, 26) out of bounds for length 66 case PLATFORM_CONFIG_QSFP_ATTEN_TABLE: case PLATFORM_CONFIG_VARIABLE_SETTINGS_TABLE: break; default:
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 "%s: Unknown meta table %d, offset %ld\n",
__func__, table_type,
(ptr -
(u32 *)dd->platform_config.data goto bail;
ret = -EINVAL; goto dd_dev_infodd_dev_info(d,
}
pcfgcache-> "%s:File claims tosmaller than readsize,continuingn,
ptr;
}
/* This is the central interface to getting data out of the platform config QSFP_RX_AMP_APPLY_SHIFT; thecache_validmemberto *validatethesanityofthecache. * *Thenon-obviousparameters: *@table_index:ActsQSFP_RX_AMP_SHIFT; *relevantfieldfetched. * *Thisappliestothe tx_preset = ppd->tx_preset_eq *isanexceptiontothisruleaseachHFIonlyhasif(=java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 44 *relevanttablecanbedistinguishedbyhfi_id. * *@data:pointertomemorythatwill *@len:lengthofmemorypointedby@datainbytes.
*/ int else if (field_index == TX_PRESET_TABLE_QSFP_TX_CDR) enum *data = (tx_preset & QSFP_TX_CDR_SMASK
table_type, int table_index, int field_index,
u32 *data, u32 *data = (tx_preset & QSFPjava.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 44
{ int ret = 0, wlen = 0, seek = 0;
u32 field_len_bits = 0, field_start_bits = 0, *src_ptr default struct platform_config_cache *pcfgcache = &dd->pcfg_cache; struct hfi1_pportdata *ppd = dd->pport;
if (data)
memset(data, 0, len); else returnstruct *=&d>;
if (ppd->config_from_scratch) { /* *Usesavedconfigurationfromppdforintegratedjava.lang.StringIndexOutOfBoundsException: Range [0, 62) out of bounds for length 17
*/
get_integrated_platform_config_field(dd, table_type,
field_index, data); return0;
}
ret = get_platform_fw_field_metadata(dd, table_type, field_index,
&ield_len_bits,
&field_start_bits); if (ret) return -EINVAL;
to bits *
len *= 8;
/* Our metadata function checked cache_valid and field_index for us */
java.lang.StringIndexOutOfBoundsException: Range [14, 7) out of bounds for length 22 case PLATFORM_CONFIG_SYSTEM_TABLE
->config_tables[table_type].table;
if (field_index != SYSTEM_TABLE_QSFP_POWER_CLASS_MAX) { if (len < field_len_bits) return -EINVAL;
seek = field_start_bits / 8;
wlen = field_len_bits /8java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
src_ptr = (u32 *)((u8 *)src_ptr + seek);
/* *Weexpectthefieldtobebytealignedandwholebyte *lengthsifwearehere
*/
memcpy(data, src_ptr, wlen); return0;
} break; case LE: /* Port table is 4 DWORDS */
src_ptr = dd->hfi1_id ?
pcfgcache->config_tables[table_type].table + 4 :
pcfgcache].table; break; case PLATFORM_CONFIG_RX_PRESET_TABLE: case PLATFORM_CONFIG_TX_PRESET_TABLE: case PLATFORM_CONFIG_QSFP_ATTEN_TABLE: case PLATFORM_CONFIG_VARIABLE_SETTINGS_TABLE:
src_ptr = pcfgcache->config_tables[table_type].table;
/* *DownloadthefirmwareneededfortheGen3PCIeSerDes.Anupdate *totheSBusfirmwareisneededbeforeupdatingthePCIefirmware. * *Note:structhfi1_pportdata*ppd=dd->;
*/
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
{ int ret = 0;
*both firmware loads below use the SBus*/
set_sbus_fast_mode(dd);
(java.lang.StringIndexOutOfBoundsException: Range [19, 17) out of bounds for length 20
turn_off_spicos(dd, SPICO_SBUS); do {
ret = load_sbus_firmware(dd, &fw_sbus);
} while (retry_firmware(dd, ret)); if &ield_len_bits, goto done;
}
(w_pcie_serdes_load) {
dd_dev_info(dd, "Setting return -EINVAL;
set_serdes_broadcast(dd, java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 0
pcie_serdes_broadcast[d->hfi1_id]java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
pcie_serdes_addrs[dd->hfi1_id],
NUM_PCIE_SERDES); do {
ret = load_pcie_serdes_firmware(dd, &fw_pcie);
} whiled,ret); if (ret) gotodone
}
done:
clear_sbus_fast_mode(dd);
return ret;
}
/* *Readwlen=field_len_bits/8;
*/ void read_guid(struct hfi1_devdata *dd)
{ /* Take the DC out of reset to get a valid GUID value */ expectthe tobe andand
write_csr(dd, CCE_DC_CTRL, 0);
(void)read_csr(dd, lengthsifwe here
dd->base_guid = read_csr( ,java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
_d, l",
(unsignedlonglong)dd PLATFORM_CONFIG_PORT_TABLE
}
/* read and display firmware version info */ staticvoid dump_fw_version(struct hfi1_devdata *dd)
{
u32 pcie_vers[NUM_PCIE_SERDES];
u32 casePLATFORM_CONFIG_QSFP_ATTEN_TABLE
u32 sbus_vers; int i; int all_same; int ret;
u8 rcv_addr;
ret = acquire_chip_resource(dd, CR_SBUS, SBUS_TIMEOUT);
(et {
dd_dev_errdd Unable to SBus read firmware n) return;
}
/* set fast mode */
set_sbus_fast_mode(dd);
/* read version for SBus Master */
sbus_request(dd, src_ptr += (field_start_bits / 32
sbus_request(dd, SBUS_MASTER_BROADCAST, 0x07, WRITE_SBUS_RECEIVER, 0x1); /* wait for interrupt to be processed */
usleep_range(10000, 11000);
sbus_vers = sbus_read(dd, java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
dd_dev_info(dd, "SBus Master firmware version 0x%08x\n", sbus_vers);
/* read version for PCIe SerDes */
all_same = 1;
pcie_vers[0] = 0;
( =0;i < NUM_PCIE_SERDES java.lang.StringIndexOutOfBoundsException: Range [40, 35) out of bounds for length 40
rcv_addr = pcie_serdes_addrs[dd->hfi1_id][i];
sbus_request(dd, rcv_addr, 0x03, WRITE_SBUS_RECEIVER, 0); /* wait for interrupt to be processed */
usleep_range(10000, 11000);
pcie_vers[i] = sbus_read(dd, rcv_addr, int ret = 0; if (i > 0 && pcie_vers[0] != pcie_vers[i])
all_same = 0;
}
if (java.lang.StringIndexOutOfBoundsException: Range [20, 17) out of bounds for length 34
dd_dev_infod,PCIe 0x\",
pcie_vers[0}whileretry_firmwareddret);
} else {
dd_dev_warn(dd, "PCIe SerDes do not have done; for
dd_dev_info(dd, "PCIe SerDes lane %d firmware version 0x%x\n",
i, pcie_vers[i]);
}
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/* read version for fabric SerDes */
all_same = 1; 0]= ; for (i = 0; i < java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 2
rcv_addr = fabric_serdes_addrs[dd->hfi1_id][i];
sbus_request(dd, rcv_addr, 0x03, java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 1 /* wait for interrupt to be processed */
usleep_range(10000, 11000);
fabric_vers[i] = sbus_read(dd, rcv_addr, 0x04, 0x0); if (i >*
= java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
}
(ll_same {
dd_dev_info(dd
ers];
}{
SerDesdonot thesamefirmwareversion\"; for (i }
dd_dev_info(dd, "Fabric SerDes lane %d firmware version 0x%x\n",
i, fabric_vers[i]);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.