Lines Matching +full:firmware +full:- +full:reset
1 // SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause
3 * Copyright(c) 2015 - 2017 Intel Corporation.
6 #include <linux/firmware.h>
16 * Make it easy to toggle firmware file name and if it gets loaded by
40 /* Firmware file names get set in hfi1_firmware_init() based on the above */
52 * Firmware security header.
90 u8 firmware[]; member
100 u8 firmware[]; member
104 #define AUGMENT_SIZE (sizeof(struct augmented_firmware_file) - \
109 const struct firmware *fw;
218 * Read a single 64-bit value from 8051 data memory.
225 * ignored - i.e. the hardware will always do aligned 8-byte reads as if
228 * Return 0 on success, -ENXIO on a read error (timeout).
251 return -ENXIO; in __read_8051_data()
263 * Read 8051 data starting at addr, for len bytes. Will read in 8-byte chunks.
264 * Return 0 on success, -errno on error.
272 spin_lock_irqsave(&dd->dc8051_memlock, flags); in read_8051_data()
274 /* data read set-up, no auto-increment */ in read_8051_data()
286 spin_unlock_irqrestore(&dd->dc8051_memlock, flags); in read_8051_data()
304 /* write set-up */ in write_8051()
316 int bytes = len - offset; in write_8051()
336 return -ENXIO; in write_8051()
349 /* return 0 if values match, non-zero and complain otherwise */
357 "invalid firmware header field %s: expected 0x%x, actual 0x%x\n", in invalid_header()
368 if (invalid_header(dd, "module_type", css->module_type, in verify_css_header()
370 invalid_header(dd, "header_len", css->header_len, in verify_css_header()
372 invalid_header(dd, "header_version", css->header_version, in verify_css_header()
374 invalid_header(dd, "module_vendor", css->module_vendor, in verify_css_header()
376 invalid_header(dd, "key_size", css->key_size, KEY_SIZE / 4) || in verify_css_header()
377 invalid_header(dd, "modulus_size", css->modulus_size, in verify_css_header()
379 invalid_header(dd, "exponent_size", css->exponent_size, in verify_css_header()
381 return -EINVAL; in verify_css_header()
395 "firmware \"%s\", size %ld, must be larger than %ld bytes\n", in payload_check()
397 return -EINVAL; in payload_check()
404 * Request the firmware from the system. Extract the pieces and fill in
406 * Returns 0 on success, -ERRNO on error.
416 ret = request_firmware(&fdet->fw, name, &dd->pcidev->dev); in obtain_one_firmware()
418 dd_dev_warn(dd, "cannot find firmware \"%s\", err %d\n", in obtain_one_firmware()
423 /* verify the firmware */ in obtain_one_firmware()
424 if (fdet->fw->size < sizeof(struct css_header)) { in obtain_one_firmware()
425 dd_dev_err(dd, "firmware \"%s\" is too small\n", name); in obtain_one_firmware()
426 ret = -EINVAL; in obtain_one_firmware()
429 css = (struct css_header *)fdet->fw->data; in obtain_one_firmware()
431 hfi1_cdbg(FIRMWARE, "Firmware %s details:", name); in obtain_one_firmware()
432 hfi1_cdbg(FIRMWARE, "file size: 0x%lx bytes", fdet->fw->size); in obtain_one_firmware()
433 hfi1_cdbg(FIRMWARE, "CSS structure:"); in obtain_one_firmware()
434 hfi1_cdbg(FIRMWARE, " module_type 0x%x", css->module_type); in obtain_one_firmware()
435 hfi1_cdbg(FIRMWARE, " header_len 0x%03x (0x%03x bytes)", in obtain_one_firmware()
436 css->header_len, 4 * css->header_len); in obtain_one_firmware()
437 hfi1_cdbg(FIRMWARE, " header_version 0x%x", css->header_version); in obtain_one_firmware()
438 hfi1_cdbg(FIRMWARE, " module_id 0x%x", css->module_id); in obtain_one_firmware()
439 hfi1_cdbg(FIRMWARE, " module_vendor 0x%x", css->module_vendor); in obtain_one_firmware()
440 hfi1_cdbg(FIRMWARE, " date 0x%x", css->date); in obtain_one_firmware()
441 hfi1_cdbg(FIRMWARE, " size 0x%03x (0x%03x bytes)", in obtain_one_firmware()
442 css->size, 4 * css->size); in obtain_one_firmware()
443 hfi1_cdbg(FIRMWARE, " key_size 0x%03x (0x%03x bytes)", in obtain_one_firmware()
444 css->key_size, 4 * css->key_size); in obtain_one_firmware()
445 hfi1_cdbg(FIRMWARE, " modulus_size 0x%03x (0x%03x bytes)", in obtain_one_firmware()
446 css->modulus_size, 4 * css->modulus_size); in obtain_one_firmware()
447 hfi1_cdbg(FIRMWARE, " exponent_size 0x%03x (0x%03x bytes)", in obtain_one_firmware()
448 css->exponent_size, 4 * css->exponent_size); in obtain_one_firmware()
449 hfi1_cdbg(FIRMWARE, "firmware size: 0x%lx bytes", in obtain_one_firmware()
450 fdet->fw->size - sizeof(struct firmware_file)); in obtain_one_firmware()
460 * Note: css->size is in DWORDs, multiply by 4 to get bytes. in obtain_one_firmware()
465 } else if ((css->size * 4) == fdet->fw->size) { in obtain_one_firmware()
466 /* non-augmented firmware file */ in obtain_one_firmware()
468 fdet->fw->data; in obtain_one_firmware()
471 ret = payload_check(dd, name, fdet->fw->size, in obtain_one_firmware()
474 fdet->css_header = css; in obtain_one_firmware()
475 fdet->modulus = ff->modulus; in obtain_one_firmware()
476 fdet->exponent = ff->exponent; in obtain_one_firmware()
477 fdet->signature = ff->signature; in obtain_one_firmware()
478 fdet->r2 = fdet->dummy_header.r2; /* use dummy space */ in obtain_one_firmware()
479 fdet->mu = fdet->dummy_header.mu; /* use dummy space */ in obtain_one_firmware()
480 fdet->firmware_ptr = ff->firmware; in obtain_one_firmware()
481 fdet->firmware_len = fdet->fw->size - in obtain_one_firmware()
484 * Header does not include r2 and mu - generate here. in obtain_one_firmware()
487 …dd_dev_err(dd, "driver is unable to validate firmware without r2 and mu (not in firmware file)\n"); in obtain_one_firmware()
488 ret = -EINVAL; in obtain_one_firmware()
490 } else if ((css->size * 4) + AUGMENT_SIZE == fdet->fw->size) { in obtain_one_firmware()
491 /* augmented firmware file */ in obtain_one_firmware()
493 (struct augmented_firmware_file *)fdet->fw->data; in obtain_one_firmware()
496 ret = payload_check(dd, name, fdet->fw->size, in obtain_one_firmware()
499 fdet->css_header = css; in obtain_one_firmware()
500 fdet->modulus = aff->modulus; in obtain_one_firmware()
501 fdet->exponent = aff->exponent; in obtain_one_firmware()
502 fdet->signature = aff->signature; in obtain_one_firmware()
503 fdet->r2 = aff->r2; in obtain_one_firmware()
504 fdet->mu = aff->mu; in obtain_one_firmware()
505 fdet->firmware_ptr = aff->firmware; in obtain_one_firmware()
506 fdet->firmware_len = fdet->fw->size - in obtain_one_firmware()
510 /* css->size check failed */ in obtain_one_firmware()
512 "invalid firmware header field size: expected 0x%lx or 0x%lx, actual 0x%x\n", in obtain_one_firmware()
513 fdet->fw->size / 4, in obtain_one_firmware()
514 (fdet->fw->size - AUGMENT_SIZE) / 4, in obtain_one_firmware()
515 css->size); in obtain_one_firmware()
517 ret = -EINVAL; in obtain_one_firmware()
529 release_firmware(fdet->fw); in dispose_one_firmware()
536 * at all. If called with the firmware state in FW_TRY, use alternate names.
537 * On exit, this routine will have set the firmware state to one of FW_TRY,
558 dd_dev_warn(dd, "using alternate firmware names\n"); in __obtain_firmware()
560 * Let others run. Some systems, when missing firmware, does in __obtain_firmware()
579 * Add a delay before obtaining and loading debug firmware. in __obtain_firmware()
580 * Authorization will fail if the delay between firmware in __obtain_firmware()
614 /* oops, had problems obtaining a firmware */ in __obtain_firmware()
615 if (fw_state == FW_EMPTY && dd->icode == ICODE_RTL_SILICON) { in __obtain_firmware()
620 dd_dev_err(dd, "unable to obtain working firmware\n"); in __obtain_firmware()
622 fw_err = -ENOENT; in __obtain_firmware()
626 dd->icode != ICODE_FUNCTIONAL_SIMULATOR) in __obtain_firmware()
634 * Called by all HFIs when loading their firmware - i.e. device probe time.
635 * The first one will do the actual firmware load. Use a mutex to resolve
648 /* 40s delay due to long delay on missing firmware on some systems */ in obtain_firmware()
652 * Another device is trying the firmware. Wait until it in obtain_firmware()
657 dd_dev_err(dd, "Timeout waiting for firmware try"); in obtain_firmware()
659 fw_err = -ETIMEDOUT; in obtain_firmware()
680 * firmware is being disposed. The mutexes can be moved to do that
681 * safely, but then the firmware would be requested from the OS multiple
700 * Called with the result of a firmware download.
702 * Return 1 to retry loading the firmware, 0 to stop.
719 /* load failed, obtain alternate firmware */ in retry_firmware()
768 for (; qw_size > 0; qw_size--, ptr++) in write_streamed_rsa_data()
798 dd_dev_err(dd, "%s security engine not idle - giving up\n", in run_rsa()
800 return -EBUSY; in run_rsa()
816 * Firmware authorization failed. This can be cleared by in run_rsa()
817 * re-initializing the RSA engine, then clearing the status bit. in run_rsa()
818 * Do not re-init the RSA angine immediately after a successful in run_rsa()
819 * run - this will reset the current authorization. in run_rsa()
835 dd_dev_err(dd, "%s firmware security bad idle state\n", in run_rsa()
837 ret = -EINVAL; in run_rsa()
844 ret = -EINVAL; in run_rsa()
851 * Timed out while active. We can't reset the engine in run_rsa()
855 dd_dev_err(dd, "%s firmware security time out\n", who); in run_rsa()
856 ret = -ETIMEDOUT; in run_rsa()
865 * errors. All current errors will stick - the RSA logic is keeping in run_rsa()
866 * error high. All previous errors will clear - the RSA logic in run_rsa()
874 * authorization failure details, if any. Firmware authorization in run_rsa()
880 dd_dev_warn(dd, "%s firmware authorization failed\n", in run_rsa()
883 dd_dev_warn(dd, "%s firmware key mismatch\n", who); in run_rsa()
893 write_rsa_data(dd, MISC_CFG_RSA_MODULUS, fdet->modulus, KEY_SIZE); in load_security_variables()
895 write_rsa_data(dd, MISC_CFG_RSA_R2, fdet->r2, KEY_SIZE); in load_security_variables()
897 write_rsa_data(dd, MISC_CFG_RSA_MU, fdet->mu, MU_SIZE); in load_security_variables()
900 (u8 *)fdet->css_header, in load_security_variables()
904 /* return the 8051 firmware state */
914 * Wait until the firmware is up and ready to take host requests.
915 * Return 0 on success, -ETIMEDOUT on timeout.
922 if (dd->icode == ICODE_FUNCTIONAL_SIMULATOR) in wait_fm_ready()
930 return -ETIMEDOUT; in wait_fm_ready()
931 usleep_range(1950, 2050); /* sleep 2ms-ish */ in wait_fm_ready()
936 * Load the 8051 firmware.
948 * DC Reset sequence in load_8051_firmware()
949 * Load DC 8051 firmware in load_8051_firmware()
952 * DC reset step 1: Reset DC8051 in load_8051_firmware()
962 * DC reset step 2 (optional): Load 8051 data memory with link in load_8051_firmware()
967 * DC reset step 3: Load DC8051 firmware in load_8051_firmware()
969 /* release all but the core reset */ in load_8051_firmware()
973 /* Firmware load step 1 */ in load_8051_firmware()
977 * Firmware load step 2. Clear MISC_CFG_FW_CTRL.FW_8051_LOADED in load_8051_firmware()
981 /* Firmware load steps 3-5 */ in load_8051_firmware()
982 ret = write_8051(dd, 1/*code*/, 0, fdet->firmware_ptr, in load_8051_firmware()
983 fdet->firmware_len); in load_8051_firmware()
988 * DC reset step 4. Host starts the DC8051 firmware in load_8051_firmware()
991 * Firmware load step 6. Set MISC_CFG_FW_CTRL.FW_8051_LOADED in load_8051_firmware()
995 /* Firmware load steps 7-10 */ in load_8051_firmware()
996 ret = run_rsa(dd, "8051", fdet->signature); in load_8051_firmware()
1000 /* clear all reset bits, releasing the 8051 */ in load_8051_firmware()
1004 * DC reset step 5. Wait for firmware to be ready to accept host in load_8051_firmware()
1011 return -ETIMEDOUT; in load_8051_firmware()
1015 dd_dev_info(dd, "8051 firmware version %d.%d.%d\n", in load_8051_firmware()
1017 dd->dc8051_ver = dc8051_ver(ver_major, ver_minor, ver_patch); in load_8051_firmware()
1023 return -EIO; in load_8051_firmware()
1032 * No need for masking - the arguments are sized exactly.
1088 * + Must be called before the 8051 is loaded - assumes 8051 is not loaded
1109 sbus_request(dd, fabric_serdes_broadcast[dd->hfi1_id], in turn_off_spicos()
1115 * Reset all of the fabric serdes for this HFI in preparation to take the
1118 * To do a reset, we need to write to to the serdes registers. Unfortunately,
1120 * off the firmware validation on this HFI. This means we can't write to the
1121 * registers to reset the serdes. Work around this by performing a complete
1122 * re-download and validation of the fabric serdes firmware. This, as a
1123 * by-product, will reset the serdes. NOTE: the re-download requires that
1138 "Cannot acquire SBus resource to reset fabric SerDes - perhaps you should reboot\n"); in fabric_serdes_reset()
1144 /* A0 serdes do not work with a re-download */ in fabric_serdes_reset()
1145 u8 ra = fabric_serdes_broadcast[dd->hfi1_id]; in fabric_serdes_reset()
1147 /* place SerDes in reset and disable SPICO */ in fabric_serdes_reset()
1151 /* remove SerDes reset */ in fabric_serdes_reset()
1158 * No need for firmware retry - what to download has already in fabric_serdes_reset()
1160 * No need to pay attention to the load return - the only in fabric_serdes_reset()
1198 return -ETIMEDOUT; in sbus_request_slow()
1209 return -ETIME; in sbus_request_slow()
1220 const u8 ra = fabric_serdes_broadcast[dd->hfi1_id]; /* receiver addr */ in load_fabric_serdes_firmware()
1222 dd_dev_info(dd, "Downloading fabric firmware\n"); in load_fabric_serdes_firmware()
1226 /* step 2: place SerDes in reset and disable SPICO */ in load_fabric_serdes_firmware()
1230 /* step 3: remove SerDes reset */ in load_fabric_serdes_firmware()
1235 for (i = 0; i < fdet->firmware_len; i += 4) { in load_fabric_serdes_firmware()
1237 *(u32 *)&fdet->firmware_ptr[i]); in load_fabric_serdes_firmware()
1244 /* steps 8-11: run the RSA engine */ in load_fabric_serdes_firmware()
1245 err = run_rsa(dd, "fabric serdes", fdet->signature); in load_fabric_serdes_firmware()
1263 dd_dev_info(dd, "Downloading SBus firmware\n"); in load_sbus_firmware()
1267 /* step 2: place SPICO into reset and enable off */ in load_sbus_firmware()
1269 /* step 3: remove reset, enable off, IMEM_CNTRL_EN on */ in load_sbus_firmware()
1274 for (i = 0; i < fdet->firmware_len; i += 4) { in load_sbus_firmware()
1276 *(u32 *)&fdet->firmware_ptr[i]); in load_sbus_firmware()
1283 /* steps 8-11: run the RSA engine */ in load_sbus_firmware()
1284 err = run_rsa(dd, "SBus", fdet->signature); in load_sbus_firmware()
1300 dd_dev_info(dd, "Downloading PCIe firmware\n"); in load_pcie_serdes_firmware()
1308 /* step 4: load firmware into SBus Master XDMEM */ in load_pcie_serdes_firmware()
1310 * NOTE: the dmem address, write_en, and wdata are all pre-packed, in load_pcie_serdes_firmware()
1313 for (i = 0; i < fdet->firmware_len; i += 4) { in load_pcie_serdes_firmware()
1315 *(u32 *)&fdet->firmware_ptr[i]); in load_pcie_serdes_firmware()
1323 * steps 7-11: run RSA, if it succeeds, firmware is available to in load_pcie_serdes_firmware()
1326 return run_rsa(dd, "PCIe serdes", fdet->signature); in load_pcie_serdes_firmware()
1335 while (--count >= 0) { in set_serdes_broadcast()
1338 * defaults for everything else. Do not read-modify-write, in set_serdes_broadcast()
1343 * ----- --------------------------------- in set_serdes_broadcast()
1357 u8 mask = 1 << dd->hfi1_id; in acquire_hw_mutex()
1391 return -EBUSY; in acquire_hw_mutex()
1396 u8 mask = 1 << dd->hfi1_id; in release_hw_mutex()
1417 "%s: hardware mutex stuck - suggest rebooting the machine\n", in fail_mutex_acquire_message()
1424 * Return 0 on success, -EBUSY if resource busy, -EIO if mutex acquire failed.
1433 if (dd->pcidev->device == PCI_DEVICE_ID_INTEL0 && in __acquire_chip_resource()
1442 my_bit = resource_mask(dd->hfi1_id, resource); in __acquire_chip_resource()
1444 /* non-dynamic resources are not split between HFIs */ in __acquire_chip_resource()
1450 mutex_lock(&dd->asic_data->asic_resource_mutex); in __acquire_chip_resource()
1455 ret = -EIO; in __acquire_chip_resource()
1461 ret = -EBUSY; in __acquire_chip_resource()
1471 mutex_unlock(&dd->asic_data->asic_resource_mutex); in __acquire_chip_resource()
1479 * Return 0 on success, -EBUSY if busy (even after wait), -EIO if mutex
1490 if (ret != -EBUSY) in acquire_chip_resource()
1494 return -EBUSY; in acquire_chip_resource()
1512 bit = resource_mask(dd->hfi1_id, resource); in release_chip_resource()
1515 mutex_lock(&dd->asic_data->asic_resource_mutex); in release_chip_resource()
1530 __func__, dd->hfi1_id, resource); in release_chip_resource()
1536 mutex_unlock(&dd->asic_data->asic_resource_mutex); in release_chip_resource()
1549 bit = resource_mask(dd->hfi1_id, resource); in check_chip_resource()
1558 func, dd->hfi1_id, resource); in check_chip_resource()
1569 mutex_lock(&dd->asic_data->asic_resource_mutex); in clear_chip_resources()
1578 scratch0 &= ~resource_mask(dd->hfi1_id, CR_DYN_MASK); in clear_chip_resources()
1586 mutex_unlock(&dd->asic_data->asic_resource_mutex); in clear_chip_resources()
1634 fabric_serdes_broadcast[dd->hfi1_id], in load_firmware()
1635 fabric_serdes_addrs[dd->hfi1_id], in load_firmware()
1663 if (dd->icode != ICODE_RTL_SILICON) { in hfi1_firmware_init()
1670 if (dd->icode == ICODE_FUNCTIONAL_SIMULATOR) in hfi1_firmware_init()
1674 if (dd->icode == ICODE_RTL_SILICON) in hfi1_firmware_init()
1699 struct platform_config_cache *pcfgcache = &dd->pcfg_cache; in check_meta_version()
1702 return -EINVAL; in check_meta_version()
1705 *(pcfgcache->config_tables[PLATFORM_CONFIG_SYSTEM_TABLE].table_metadata in check_meta_version()
1708 mask = ((1 << METADATA_TABLE_FIELD_START_LEN_BITS) - 1); in check_meta_version()
1713 mask = ((1 << METADATA_TABLE_FIELD_LEN_LEN_BITS) - 1); in check_meta_version()
1717 meta_ver = *((u8 *)system_table + ver_start) & ((1 << ver_len) - 1); in check_meta_version()
1722 return -EINVAL; in check_meta_version()
1729 struct platform_config_cache *pcfgcache = &dd->pcfg_cache; in parse_platform_config()
1730 struct hfi1_pportdata *ppd = dd->pport; in parse_platform_config()
1734 int ret = -EINVAL; /* assume failure */ in parse_platform_config()
1742 if (ppd->config_from_scratch) in parse_platform_config()
1745 if (!dd->platform_config.data) { in parse_platform_config()
1749 ptr = (u32 *)dd->platform_config.data; in parse_platform_config()
1775 if (file_length > dd->platform_config.size) { in parse_platform_config()
1779 } else if (file_length < dd->platform_config.size) { in parse_platform_config()
1787 * In both cases where we proceed, using the self-reported file length in parse_platform_config()
1791 while (ptr < (u32 *)(dd->platform_config.data + file_length)) { in parse_platform_config()
1796 __func__, (ptr - (u32 *) in parse_platform_config()
1797 dd->platform_config.data)); in parse_platform_config()
1802 ((1 << PLATFORM_CONFIG_HEADER_RECORD_IDX_LEN_BITS) - 1); in parse_platform_config()
1806 ((1 << PLATFORM_CONFIG_HEADER_TABLE_LENGTH_LEN_BITS) - 1); in parse_platform_config()
1809 ((1 << PLATFORM_CONFIG_HEADER_TABLE_TYPE_LEN_BITS) - 1); in parse_platform_config()
1818 pcfgcache->config_tables[table_type].num_table = in parse_platform_config()
1825 pcfgcache->config_tables[table_type].num_table = in parse_platform_config()
1832 pcfgcache->config_tables[table_type].num_table = in parse_platform_config()
1839 (ptr - (u32 *) in parse_platform_config()
1840 dd->platform_config.data)); in parse_platform_config()
1843 pcfgcache->config_tables[table_type].table = ptr; in parse_platform_config()
1858 (ptr - in parse_platform_config()
1859 (u32 *)dd->platform_config.data)); in parse_platform_config()
1862 pcfgcache->config_tables[table_type].table_metadata = in parse_platform_config()
1875 __func__, (ptr - in parse_platform_config()
1876 (u32 *)dd->platform_config.data)); in parse_platform_config()
1877 ret = -EINVAL; in parse_platform_config()
1884 pcfgcache->cache_valid = 1; in parse_platform_config()
1896 struct hfi1_pportdata *ppd = dd->pport; in get_integrated_platform_config_field()
1897 u8 *cache = ppd->qsfp_info.cache; in get_integrated_platform_config_field()
1903 *data = ppd->max_power_class; in get_integrated_platform_config_field()
1905 *data = ppd->default_atten; in get_integrated_platform_config_field()
1909 *data = ppd->port_type; in get_integrated_platform_config_field()
1911 *data = ppd->local_atten; in get_integrated_platform_config_field()
1913 *data = ppd->remote_atten; in get_integrated_platform_config_field()
1917 *data = (ppd->rx_preset & QSFP_RX_CDR_APPLY_SMASK) >> in get_integrated_platform_config_field()
1920 *data = (ppd->rx_preset & QSFP_RX_EMP_APPLY_SMASK) >> in get_integrated_platform_config_field()
1923 *data = (ppd->rx_preset & QSFP_RX_AMP_APPLY_SMASK) >> in get_integrated_platform_config_field()
1926 *data = (ppd->rx_preset & QSFP_RX_CDR_SMASK) >> in get_integrated_platform_config_field()
1929 *data = (ppd->rx_preset & QSFP_RX_EMP_SMASK) >> in get_integrated_platform_config_field()
1932 *data = (ppd->rx_preset & QSFP_RX_AMP_SMASK) >> in get_integrated_platform_config_field()
1937 tx_preset = ppd->tx_preset_eq; in get_integrated_platform_config_field()
1939 tx_preset = ppd->tx_preset_noeq; in get_integrated_platform_config_field()
1973 struct platform_config_cache *pcfgcache = &dd->pcfg_cache; in get_platform_fw_field_metadata()
1976 if (!pcfgcache->cache_valid) in get_platform_fw_field_metadata()
1977 return -EINVAL; in get_platform_fw_field_metadata()
1988 pcfgcache->config_tables[table].table_metadata + field; in get_platform_fw_field_metadata()
1996 return -EINVAL; in get_platform_fw_field_metadata()
2000 ((1 << METADATA_TABLE_FIELD_START_LEN_BITS) - 1); in get_platform_fw_field_metadata()
2004 & ((1 << METADATA_TABLE_FIELD_LEN_LEN_BITS) - 1); in get_platform_fw_field_metadata()
2014 * The non-obvious parameters:
2032 struct platform_config_cache *pcfgcache = &dd->pcfg_cache; in get_platform_config_field()
2033 struct hfi1_pportdata *ppd = dd->pport; in get_platform_config_field()
2038 return -EINVAL; in get_platform_config_field()
2040 if (ppd->config_from_scratch) { in get_platform_config_field()
2053 return -EINVAL; in get_platform_config_field()
2061 src_ptr = pcfgcache->config_tables[table_type].table; in get_platform_config_field()
2065 return -EINVAL; in get_platform_config_field()
2082 src_ptr = dd->hfi1_id ? in get_platform_config_field()
2083 pcfgcache->config_tables[table_type].table + 4 : in get_platform_config_field()
2084 pcfgcache->config_tables[table_type].table; in get_platform_config_field()
2090 src_ptr = pcfgcache->config_tables[table_type].table; in get_platform_config_field()
2093 pcfgcache->config_tables[table_type].num_table) in get_platform_config_field()
2104 return -EINVAL; in get_platform_config_field()
2108 ((1 << field_len_bits) - 1); in get_platform_config_field()
2114 * Download the firmware needed for the Gen3 PCIe SerDes. An update
2115 * to the SBus firmware is needed before updating the PCIe firmware.
2123 /* both firmware loads below use the SBus */ in load_pcie_firmware()
2138 pcie_serdes_broadcast[dd->hfi1_id], in load_pcie_firmware()
2139 pcie_serdes_addrs[dd->hfi1_id], in load_pcie_firmware()
2159 /* Take the DC out of reset to get a valid GUID value */ in read_guid()
2163 dd->base_guid = read_csr(dd, DC_DC8051_CFG_LOCAL_GUID); in read_guid()
2165 (unsigned long long)dd->base_guid); in read_guid()
2168 /* read and display firmware version info */
2181 dd_dev_err(dd, "Unable to acquire SBus to read firmware versions\n"); in dump_fw_version()
2194 dd_dev_info(dd, "SBus Master firmware version 0x%08x\n", sbus_vers); in dump_fw_version()
2200 rcv_addr = pcie_serdes_addrs[dd->hfi1_id][i]; in dump_fw_version()
2210 dd_dev_info(dd, "PCIe SerDes firmware version 0x%x\n", in dump_fw_version()
2213 dd_dev_warn(dd, "PCIe SerDes do not have the same firmware version\n"); in dump_fw_version()
2216 "PCIe SerDes lane %d firmware version 0x%x\n", in dump_fw_version()
2225 rcv_addr = fabric_serdes_addrs[dd->hfi1_id][i]; in dump_fw_version()
2235 dd_dev_info(dd, "Fabric SerDes firmware version 0x%x\n", in dump_fw_version()
2238 dd_dev_warn(dd, "Fabric SerDes do not have the same firmware version\n"); in dump_fw_version()
2241 "Fabric SerDes lane %d firmware version 0x%x\n", in dump_fw_version()