/* copy the firmware version */
memcpy(&ndev->hw.fw_name[0][0], ucode->version, (VERSION_LEN - 2));
ndev->hw.fw_name[0][VERSION_LEN - 1] = '\0';
/* Load SE Firmware on UCD Block 0 */
write_to_ucd_unit(ndev, ucode_size, ucode_data, 0);
release_firmware(fw);
/* put all SE cores in DEFAULT_SE_GROUP */
offset = POM_GRP_EXECMASKX(DEFAULT_SE_GROUP);
nitrox_write_csr(ndev, offset, (~0ULL));
/* write block number and firmware length * bit:<2:0> block number * bit:3 is set SE uses 32KB microcode * bit:3 is clear SE uses 64KB microcode
*/
core_2_eid_val.value = 0ULL;
core_2_eid_val.ucode_blk = 0; if (ucode_size <= CNN55XX_UCD_BLOCK_SIZE)
core_2_eid_val.ucode_len = 1; else
core_2_eid_val.ucode_len = 0;
for (i = 0; i < ndev->hw.se_cores; i++) {
offset = UCD_SE_EID_UCODE_BLOCK_NUMX(i);
nitrox_write_csr(ndev, offset, core_2_eid_val.value);
}
/** * nitrox_bist_check - Check NITROX BIST registers status * @ndev: NITROX device
*/ staticint nitrox_bist_check(struct nitrox_device *ndev)
{
u64 value = 0; int i;
for (i = 0; i < NR_CLUSTERS; i++) {
value += nitrox_read_csr(ndev, EMU_BIST_STATUSX(i));
value += nitrox_read_csr(ndev, EFL_CORE_BIST_REGX(i));
}
value += nitrox_read_csr(ndev, UCD_BIST_STATUS);
value += nitrox_read_csr(ndev, NPS_CORE_BIST_REG);
value += nitrox_read_csr(ndev, NPS_CORE_NPC_BIST_REG);
value += nitrox_read_csr(ndev, NPS_PKT_SLC_BIST_REG);
value += nitrox_read_csr(ndev, NPS_PKT_IN_BIST_REG);
value += nitrox_read_csr(ndev, POM_BIST_REG);
value += nitrox_read_csr(ndev, BMI_BIST_REG);
value += nitrox_read_csr(ndev, EFL_TOP_BIST_STAT);
value += nitrox_read_csr(ndev, BMO_BIST_REG);
value += nitrox_read_csr(ndev, LBC_BIST_STATUS);
value += nitrox_read_csr(ndev, PEM_BIST_STATUSX(0)); if (value) return -EIO; return 0;
}
staticint nitrox_pf_hw_init(struct nitrox_device *ndev)
{ int err;
err = nitrox_bist_check(ndev); if (err) {
dev_err(&ndev->pdev->dev, "BIST check failed\n"); return err;
} /* get cores information */
nitrox_get_hwinfo(ndev);
nitrox_config_nps_core_unit(ndev);
nitrox_config_aqm_unit(ndev);
nitrox_config_nps_pkt_unit(ndev);
nitrox_config_pom_unit(ndev);
nitrox_config_efl_unit(ndev); /* configure IO units */
nitrox_config_bmi_unit(ndev);
nitrox_config_bmo_unit(ndev); /* configure Local Buffer Cache */
nitrox_config_lbc_unit(ndev);
nitrox_config_rand_unit(ndev);
/* load firmware on cores */
err = nitrox_load_fw(ndev); if (err) return err;
nitrox_config_emu_unit(ndev);
return 0;
}
/** * nitrox_probe - NITROX Initialization function. * @pdev: PCI device information struct * @id: entry in nitrox_pci_tbl * * Return: 0, if the driver is bound to the device, or * a negative error if there is failure.
*/ staticint nitrox_probe(struct pci_dev *pdev, conststruct pci_device_id *id)
{ struct nitrox_device *ndev; int err;
dev_info_once(&pdev->dev, "%s driver version %s\n",
nitrox_driver_name, DRIVER_VERSION);
err = pci_enable_device_mem(pdev); if (err) return err;
/* do FLR */
err = nitrox_device_flr(pdev); if (err) {
dev_err(&pdev->dev, "FLR failed\n"); goto flr_fail;
}
if (!dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64))) {
dev_dbg(&pdev->dev, "DMA to 64-BIT address\n");
} else {
err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); if (err) {
dev_err(&pdev->dev, "DMA configuration failed\n"); goto flr_fail;
}
}
err = pci_request_mem_regions(pdev, nitrox_driver_name); if (err) goto flr_fail;
pci_set_master(pdev);
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.