Lines Matching +full:0 +full:x1ff80
35 wrt_reg_word(®->u.isp2300.host_semaphore, 0x1); in qla2x00_lock_nvram_access()
39 while ((data & BIT_0) == 0) { in qla2x00_lock_nvram_access()
42 wrt_reg_word(®->u.isp2300.host_semaphore, 0x1); in qla2x00_lock_nvram_access()
60 wrt_reg_word(®->u.isp2300.host_semaphore, 0); in qla2x00_unlock_nvram_access()
98 * Bit 15-0 = write data
107 uint16_t data = 0; in qla2x00_nvram_request()
112 for (cnt = 0; cnt < 11; cnt++) { in qla2x00_nvram_request()
116 qla2x00_nv_write(ha, 0); in qla2x00_nvram_request()
121 for (cnt = 0; cnt < 16; cnt++) { in qla2x00_nvram_request()
194 qla2x00_nv_write(ha, 0); in qla2x00_write_nvram_word()
195 qla2x00_nv_write(ha, 0); in qla2x00_write_nvram_word()
197 for (word = 0; word < 8; word++) in qla2x00_write_nvram_word()
206 for (count = 0; count < 27; count++) { in qla2x00_write_nvram_word()
210 qla2x00_nv_write(ha, 0); in qla2x00_write_nvram_word()
223 ql_dbg(ql_dbg_user, vha, 0x708d, in qla2x00_write_nvram_word()
229 } while ((word & NVR_DATA_IN) == 0); in qla2x00_write_nvram_word()
235 for (count = 0; count < 10; count++) in qla2x00_write_nvram_word()
236 qla2x00_nv_write(ha, 0); in qla2x00_write_nvram_word()
253 qla2x00_nv_write(ha, 0); in qla2x00_write_nvram_word_tmo()
254 qla2x00_nv_write(ha, 0); in qla2x00_write_nvram_word_tmo()
256 for (word = 0; word < 8; word++) in qla2x00_write_nvram_word_tmo()
265 for (count = 0; count < 27; count++) { in qla2x00_write_nvram_word_tmo()
269 qla2x00_nv_write(ha, 0); in qla2x00_write_nvram_word_tmo()
286 } while ((word & NVR_DATA_IN) == 0); in qla2x00_write_nvram_word_tmo()
292 for (count = 0; count < 10; count++) in qla2x00_write_nvram_word_tmo()
293 qla2x00_nv_write(ha, 0); in qla2x00_write_nvram_word_tmo()
318 cpu_to_le16(0x1234), 100000); in qla2x00_clear_nvram_protection()
320 if (stat != QLA_SUCCESS || wprot != cpu_to_le16(0x1234)) { in qla2x00_clear_nvram_protection()
323 qla2x00_nv_write(ha, 0); in qla2x00_clear_nvram_protection()
324 qla2x00_nv_write(ha, 0); in qla2x00_clear_nvram_protection()
325 for (word = 0; word < 8; word++) in qla2x00_clear_nvram_protection()
334 for (word = 0; word < 8; word++) in qla2x00_clear_nvram_protection()
343 for (word = 0; word < 8; word++) in qla2x00_clear_nvram_protection()
354 ql_dbg(ql_dbg_user, vha, 0x708e, in qla2x00_clear_nvram_protection()
360 } while ((word & NVR_DATA_IN) == 0); in qla2x00_clear_nvram_protection()
383 qla2x00_nv_write(ha, 0); in qla2x00_set_nvram_protection()
384 qla2x00_nv_write(ha, 0); in qla2x00_set_nvram_protection()
385 for (word = 0; word < 8; word++) in qla2x00_set_nvram_protection()
394 for (word = 0; word < 8; word++) in qla2x00_set_nvram_protection()
403 for (word = 0; word < 8; word++) in qla2x00_set_nvram_protection()
414 ql_dbg(ql_dbg_user, vha, 0x708f, in qla2x00_set_nvram_protection()
420 } while ((word & NVR_DATA_IN) == 0); in qla2x00_set_nvram_protection()
469 ql_log(ql_log_warn, pci_get_drvdata(ha->pdev), 0x7090, in qla24xx_read_flash_dword()
471 *data = 0xDEADDEAD; in qla24xx_read_flash_dword()
485 for (i = 0; i < dwords; i++, faddr++, dwptr++) { in qla24xx_read_flash_data()
511 ql_log(ql_log_warn, pci_get_drvdata(ha->pdev), 0x7090, in qla24xx_write_flash_dword()
520 uint32_t faddr, ids = 0; in qla24xx_get_flash_manufacturer()
522 *man_id = *flash_id = 0; in qla24xx_get_flash_manufacturer()
524 faddr = flash_conf_addr(ha, 0x03ab); in qla24xx_get_flash_manufacturer()
531 if (ids != 0xDEADDEAD && (*man_id == 0 || *flash_id == 0)) { in qla24xx_get_flash_manufacturer()
532 /* Read information using 0x9f opcode in qla24xx_get_flash_manufacturer()
535 * Example: ATMEL 0x00 01 45 1F in qla24xx_get_flash_manufacturer()
538 faddr = flash_conf_addr(ha, 0x009f); in qla24xx_get_flash_manufacturer()
554 struct req_que *req = ha->req_q_map[0]; in qla2xxx_find_flt_start()
565 loc = locations[0]; in qla2xxx_find_flt_start()
566 *start = 0; in qla2xxx_find_flt_start()
585 pcihdr = 0; in qla2xxx_find_flt_start()
588 rc = qla24xx_read_flash_data(vha, dcode, pcihdr >> 2, 0x20); in qla2xxx_find_flt_start()
590 ql_log(ql_log_info, vha, 0x016d, in qla2xxx_find_flt_start()
595 if (bcode[0x0] != 0x55 || bcode[0x1] != 0xaa) in qla2xxx_find_flt_start()
599 pcids = pcihdr + ((bcode[0x19] << 8) | bcode[0x18]); in qla2xxx_find_flt_start()
600 rc = qla24xx_read_flash_data(vha, dcode, pcids >> 2, 0x20); in qla2xxx_find_flt_start()
602 ql_log(ql_log_info, vha, 0x0179, in qla2xxx_find_flt_start()
609 if (bcode[0x0] != 'P' || bcode[0x1] != 'C' || in qla2xxx_find_flt_start()
610 bcode[0x2] != 'I' || bcode[0x3] != 'R') in qla2xxx_find_flt_start()
613 last_image = bcode[0x15] & BIT_7; in qla2xxx_find_flt_start()
616 pcihdr += ((bcode[0x11] << 8) | bcode[0x10]) * 512; in qla2xxx_find_flt_start()
622 ql_log(ql_log_info, vha, 0x017a, in qla2xxx_find_flt_start()
631 for (chksum = 0; cnt--; wptr++) in qla2xxx_find_flt_start()
634 ql_log(ql_log_fatal, vha, 0x0045, in qla2xxx_find_flt_start()
635 "Inconsistent FLTL detected: checksum=0x%x.\n", chksum); in qla2xxx_find_flt_start()
636 ql_dump_buffer(ql_dbg_init + ql_dbg_buffer, vha, 0x010e, in qla2xxx_find_flt_start()
646 ql_dbg(ql_dbg_init, vha, 0x0046, in qla2xxx_find_flt_start()
647 "FLTL[%s] = 0x%x.\n", in qla2xxx_find_flt_start()
663 { 0, 0, FA_VPD0_ADDR_81 }; in qla2xxx_get_flt_info()
665 { 0, 0, FA_VPD1_ADDR_81 }; in qla2xxx_get_flt_info()
667 { 0, 0, FA_NVRAM0_ADDR_81 }; in qla2xxx_get_flt_info()
669 { 0, 0, FA_NVRAM1_ADDR_81 }; in qla2xxx_get_flt_info()
681 0 }; in qla2xxx_get_flt_info()
684 0 }; in qla2xxx_get_flt_info()
687 uint32_t def = IS_QLA81XX(ha) ? 2 : IS_QLA25XX(ha) ? 1 : 0; in qla2xxx_get_flt_info()
689 struct qla_flt_region *region = &flt->region[0]; in qla2xxx_get_flt_info()
697 ha->flt_region_fcp_prio = (ha->port_no == 0) ? in qla2xxx_get_flt_info()
705 if (le16_to_cpu(*wptr) == 0xffff) in qla2xxx_get_flt_info()
708 ql_log(ql_log_warn, vha, 0x0047, in qla2xxx_get_flt_info()
709 "Unsupported FLT detected: version=0x%x length=0x%x checksum=0x%x.\n", in qla2xxx_get_flt_info()
716 for (chksum = 0; cnt--; wptr++) in qla2xxx_get_flt_info()
719 ql_log(ql_log_fatal, vha, 0x0048, in qla2xxx_get_flt_info()
720 "Inconsistent FLT detected: version=0x%x length=0x%x checksum=0x%x.\n", in qla2xxx_get_flt_info()
730 ql_dbg(ql_dbg_init, vha, 0x0049, in qla2xxx_get_flt_info()
736 ql_log(ql_dbg_init, vha, 0xffff, in qla2xxx_get_flt_info()
759 if (ha->port_no == 0) in qla2xxx_get_flt_info()
783 if (ha->port_no == 0) in qla2xxx_get_flt_info()
808 if (ha->port_no == 0) in qla2xxx_get_flt_info()
819 if (ha->port_no == 0) in qla2xxx_get_flt_info()
853 if (ha->port_no == 0) in qla2xxx_get_flt_info()
888 if (ha->port_no == 0) in qla2xxx_get_flt_info()
910 if (ha->port_no == 0) in qla2xxx_get_flt_info()
938 loc = locations[0]; in qla2xxx_get_flt_info()
942 ha->flt_region_vpd = (ha->port_no == 0) ? in qla2xxx_get_flt_info()
944 ha->flt_region_nvram = (ha->port_no == 0) ? in qla2xxx_get_flt_info()
947 ha->flt_region_npiv_conf = (ha->port_no == 0) ? in qla2xxx_get_flt_info()
950 ql_dbg(ql_dbg_init, vha, 0x004a, in qla2xxx_get_flt_info()
951 "FLT[%s]: boot=0x%x fw=0x%x vpd_nvram=0x%x vpd=0x%x nvram=0x%x " in qla2xxx_get_flt_info()
952 "fdt=0x%x flt=0x%x npiv=0x%x fcp_prif_cfg=0x%x.\n", in qla2xxx_get_flt_info()
962 #define FLASH_BLK_SIZE_4K 0x1000 in qla2xxx_get_fdt_info()
963 #define FLASH_BLK_SIZE_32K 0x8000 in qla2xxx_get_fdt_info()
964 #define FLASH_BLK_SIZE_64K 0x10000 in qla2xxx_get_fdt_info()
967 struct req_que *req = ha->req_q_map[0]; in qla2xxx_get_fdt_info()
972 uint16_t mid = 0, fid = 0; in qla2xxx_get_fdt_info()
976 if (le16_to_cpu(*wptr) == 0xffff) in qla2xxx_get_fdt_info()
981 for (cnt = 0, chksum = 0; cnt < sizeof(*fdt) >> 1; cnt++, wptr++) in qla2xxx_get_fdt_info()
984 ql_dbg(ql_dbg_init, vha, 0x004c, in qla2xxx_get_fdt_info()
986 " checksum=0x%x id=%c version0x%x.\n", chksum, in qla2xxx_get_fdt_info()
987 fdt->sig[0], le16_to_cpu(fdt->version)); in qla2xxx_get_fdt_info()
988 ql_dump_buffer(ql_dbg_init + ql_dbg_buffer, vha, 0x0113, in qla2xxx_get_fdt_info()
1003 flash_conf_addr(ha, 0x0300 | fdt->erase_cmd); in qla2xxx_get_fdt_info()
1006 ha->fdt_unprotect_sec_cmd = flash_conf_addr(ha, 0x0300 | in qla2xxx_get_fdt_info()
1009 flash_conf_addr(ha, 0x0300 | fdt->protect_sec_cmd) : in qla2xxx_get_fdt_info()
1010 flash_conf_addr(ha, 0x0336); in qla2xxx_get_fdt_info()
1014 loc = locations[0]; in qla2xxx_get_fdt_info()
1022 ha->fdt_wrt_disable = 0x9c; in qla2xxx_get_fdt_info()
1023 ha->fdt_erase_cmd = flash_conf_addr(ha, 0x03d8); in qla2xxx_get_fdt_info()
1025 case 0xbf: /* STT flash. */ in qla2xxx_get_fdt_info()
1026 if (flash_id == 0x8e) in qla2xxx_get_fdt_info()
1031 if (flash_id == 0x80) in qla2xxx_get_fdt_info()
1032 ha->fdt_erase_cmd = flash_conf_addr(ha, 0x0352); in qla2xxx_get_fdt_info()
1034 case 0x13: /* ST M25P80. */ in qla2xxx_get_fdt_info()
1037 case 0x1f: /* Atmel 26DF081A. */ in qla2xxx_get_fdt_info()
1039 ha->fdt_erase_cmd = flash_conf_addr(ha, 0x0320); in qla2xxx_get_fdt_info()
1040 ha->fdt_unprotect_sec_cmd = flash_conf_addr(ha, 0x0339); in qla2xxx_get_fdt_info()
1041 ha->fdt_protect_sec_cmd = flash_conf_addr(ha, 0x0336); in qla2xxx_get_fdt_info()
1049 ql_dbg(ql_dbg_init, vha, 0x004d, in qla2xxx_get_fdt_info()
1050 "FDT[%s]: (0x%x/0x%x) erase=0x%x " in qla2xxx_get_fdt_info()
1051 "pr=%x wrtd=0x%x blk=0x%x.\n", in qla2xxx_get_fdt_info()
1061 #define QLA82XX_IDC_PARAM_ADDR 0x003e885c in qla2xxx_get_idc_param()
1064 struct req_que *req = ha->req_q_map[0]; in qla2xxx_get_idc_param()
1072 if (*wptr == cpu_to_le32(0xffffffff)) { in qla2xxx_get_idc_param()
1080 ql_dbg(ql_dbg_init, vha, 0x004e, in qla2xxx_get_idc_param()
1134 if (hdr.version == cpu_to_le16(0xffff)) in qla2xxx_flash_npiv_conf()
1137 ql_dbg(ql_dbg_user, vha, 0x7090, in qla2xxx_flash_npiv_conf()
1139 "detected: version=0x%x entries=0x%x checksum=0x%x.\n", in qla2xxx_flash_npiv_conf()
1147 ql_log(ql_log_warn, vha, 0x7091, in qla2xxx_flash_npiv_conf()
1156 for (wptr = data, chksum = 0; cnt--; wptr++) in qla2xxx_flash_npiv_conf()
1159 ql_dbg(ql_dbg_user, vha, 0x7092, in qla2xxx_flash_npiv_conf()
1161 "detected: version=0x%x entries=0x%x checksum=0x%x.\n", in qla2xxx_flash_npiv_conf()
1169 for (i = 0; cnt; cnt--, entry++, i++) { in qla2xxx_flash_npiv_conf()
1177 if (flags == 0xffff) in qla2xxx_flash_npiv_conf()
1179 if ((flags & BIT_0) == 0) in qla2xxx_flash_npiv_conf()
1182 memset(&vid, 0, sizeof(vid)); in qla2xxx_flash_npiv_conf()
1189 ql_dbg(ql_dbg_user, vha, 0x7093, in qla2xxx_flash_npiv_conf()
1196 vport = fc_vport_create(vha->host, 0, &vid); in qla2xxx_flash_npiv_conf()
1198 ql_log(ql_log_warn, vha, 0x7094, in qla2xxx_flash_npiv_conf()
1225 qla24xx_write_flash_dword(ha, flash_conf_addr(ha, 0x101), 0); in qla24xx_unprotect_flash()
1227 qla24xx_write_flash_dword(ha, flash_conf_addr(ha, 0x101), 0); in qla24xx_unprotect_flash()
1241 return qla81xx_fac_do_write_enable(vha, 0); in qla24xx_protect_flash()
1247 faddr = flash_conf_addr(ha, 0x101); in qla24xx_protect_flash()
1249 faddr = flash_conf_addr(ha, 0x5); in qla24xx_protect_flash()
1280 (fdata & 0xff00) | ((fdata << 16) & 0xff0000) | in qla24xx_erase_sector()
1281 ((fdata >> 16) & 0xff)); in qla24xx_erase_sector()
1304 ql_log(ql_log_warn, vha, 0x7095, in qla24xx_write_flash_data()
1309 ql_log(ql_log_warn + ql_dbg_verbose, vha, 0x7095, in qla24xx_write_flash_data()
1313 ql_log(ql_log_warn, vha, 0x7096, in qla24xx_write_flash_data()
1320 for (liter = 0; liter < dwords; liter++, faddr++, dwptr++) { in qla24xx_write_flash_data()
1325 ql_log(ql_log_warn + ql_dbg_verbose, vha, 0x7095, in qla24xx_write_flash_data()
1330 ql_dbg(ql_dbg_user, vha, 0x7007, in qla24xx_write_flash_data()
1345 ql_log(ql_log_warn + ql_dbg_verbose, vha, 0x7095, in qla24xx_write_flash_data()
1356 ql_log(ql_log_warn, vha, 0x7097, in qla24xx_write_flash_data()
1366 ql_log(ql_log_warn, vha, 0x7098, in qla24xx_write_flash_data()
1374 ql_dbg(ql_dbg_user, vha, 0x7006, in qla24xx_write_flash_data()
1380 ql_log(ql_log_warn + ql_dbg_verbose, vha, 0x7095, in qla24xx_write_flash_data()
1384 ql_log(ql_log_warn, vha, 0x7099, in qla24xx_write_flash_data()
1405 for (i = 0; i < bytes >> 1; i++, naddr++) in qla2x00_read_nvram_data()
1427 for (i = 0; i < bytes; i++, naddr++, dwptr++) { in qla24xx_read_nvram_data()
1455 for (i = 0; i < bytes >> 1; i++, naddr++) { in qla2x00_write_nvram_data()
1491 qla24xx_write_flash_dword(ha, nvram_conf_addr(ha, 0x101), 0); in qla24xx_write_nvram_data()
1492 qla24xx_write_flash_dword(ha, nvram_conf_addr(ha, 0x101), 0); in qla24xx_write_nvram_data()
1497 for (i = 0; i < bytes; i++, naddr++, dwptr++) { in qla24xx_write_nvram_data()
1499 ql_dbg(ql_dbg_user, vha, 0x709a, in qla24xx_write_nvram_data()
1507 qla24xx_write_flash_dword(ha, nvram_conf_addr(ha, 0x101), 0x8c); in qla24xx_write_nvram_data()
1528 for (i = 0; i < bytes; i++, naddr++, dwptr++) { in qla25xx_read_nvram_data()
1565 ha->beacon_color_state = 0; in qla2x00_flip_colors()
1576 ha->beacon_color_state = 0; in qla2x00_flip_colors()
1593 uint16_t led_color = 0; in qla2x00_beacon_blink()
1654 ql_log(ql_log_warn, vha, 0x709b, in qla2x00_beacon_on()
1693 ha->beacon_color_state = 0; in qla2x00_beacon_on()
1704 ha->beacon_blink_led = 0; in qla2x00_beacon_off()
1719 ql_log(ql_log_warn, vha, 0x709c, in qla2x00_beacon_off()
1731 ha->beacon_color_state = 0; in qla24xx_flip_colors()
1732 *pflags = 0; in qla24xx_flip_colors()
1743 uint16_t led_color = 0; in qla24xx_beacon_blink()
1777 uint32_t led_select_value = 0; in qla83xx_select_led_port()
1782 if (ha->port_no == 0) in qla83xx_select_led_port()
1808 qla2x00_write_ram_word(vha, 0x1003, 0x40000230); in qla83xx_beacon_blink()
1809 qla2x00_write_ram_word(vha, 0x1004, 0x40000230); in qla83xx_beacon_blink()
1813 qla83xx_wr_reg(vha, led_select_value, 0x40000230); in qla83xx_beacon_blink()
1814 qla83xx_wr_reg(vha, led_select_value + 4, 0x40000230); in qla83xx_beacon_blink()
1819 qla83xx_rd_reg(vha, led_select_value + 0x10, &led_43_value); in qla83xx_beacon_blink()
1820 qla83xx_wr_reg(vha, led_select_value, 0x01f44000); in qla83xx_beacon_blink()
1822 qla83xx_wr_reg(vha, led_select_value, 0x400001f4); in qla83xx_beacon_blink()
1825 qla83xx_wr_reg(vha, led_select_value + 0x10, led_43_value); in qla83xx_beacon_blink()
1834 led_cfg[0] = 0x4000; in qla83xx_beacon_blink()
1835 led_cfg[1] = 0x2000; in qla83xx_beacon_blink()
1836 led_cfg[2] = 0; in qla83xx_beacon_blink()
1837 led_cfg[3] = 0; in qla83xx_beacon_blink()
1838 led_cfg[4] = 0; in qla83xx_beacon_blink()
1839 led_cfg[5] = 0; in qla83xx_beacon_blink()
1841 led_cfg[0] = 0x4000; in qla83xx_beacon_blink()
1842 led_cfg[1] = 0x4000; in qla83xx_beacon_blink()
1843 led_cfg[2] = 0x4000; in qla83xx_beacon_blink()
1844 led_cfg[3] = 0x2000; in qla83xx_beacon_blink()
1845 led_cfg[4] = 0; in qla83xx_beacon_blink()
1846 led_cfg[5] = 0x2000; in qla83xx_beacon_blink()
1851 led_cfg[0] = 0x4000; in qla83xx_beacon_blink()
1852 led_cfg[1] = 0x2000; in qla83xx_beacon_blink()
1853 led_cfg[2] = 0; in qla83xx_beacon_blink()
1855 led_cfg[0] = 0x4000; in qla83xx_beacon_blink()
1856 led_cfg[1] = 0x2000; in qla83xx_beacon_blink()
1857 led_cfg[2] = 0x4000; in qla83xx_beacon_blink()
1858 led_cfg[3] = 0x4000; in qla83xx_beacon_blink()
1859 led_cfg[4] = 0; in qla83xx_beacon_blink()
1860 led_cfg[5] = 0x2000; in qla83xx_beacon_blink()
1883 if (ha->beacon_blink_led == 0) { in qla24xx_beacon_on()
1892 ql_log(ql_log_warn, vha, 0x7009, in qla24xx_beacon_on()
1912 ha->beacon_color_state = 0; in qla24xx_beacon_on()
1935 ha->beacon_blink_led = 0; in qla24xx_beacon_off()
1961 ql_log(ql_log_warn, vha, 0x704d, in qla24xx_beacon_off()
1967 ql_log(ql_log_warn, vha, 0x704e, in qla24xx_beacon_off()
2033 bank_select &= ~0xf8; in qla2x00_read_flash_byte()
2034 bank_select |= addr >> 12 & 0xf0; in qla2x00_read_flash_byte()
2046 if ((addr & BIT_16) && ((bank_select & CSR_FLASH_64K_BANK) == 0)) { in qla2x00_read_flash_byte()
2050 } else if (((addr & BIT_16) == 0) && in qla2x00_read_flash_byte()
2092 bank_select &= ~0xf8; in qla2x00_write_flash_byte()
2093 bank_select |= addr >> 12 & 0xf0; in qla2x00_write_flash_byte()
2107 if ((addr & BIT_16) && ((bank_select & CSR_FLASH_64K_BANK) == 0)) { in qla2x00_write_flash_byte()
2111 } else if (((addr & BIT_16) == 0) && in qla2x00_write_flash_byte()
2143 * Returns 0 on success, else non-zero.
2160 status = 0; in qla2x00_poll_flash()
2164 if (man_id != 0x40 && man_id != 0xda) { in qla2x00_poll_flash()
2183 * Returns 0 on success, else non-zero.
2191 qla2x00_write_flash_byte(ha, 0xaaa, 0xaa); in qla2x00_program_flash_address()
2192 qla2x00_write_flash_byte(ha, 0x555, 0x55); in qla2x00_program_flash_address()
2193 qla2x00_write_flash_byte(ha, 0xaaa, 0xa0); in qla2x00_program_flash_address()
2196 if (man_id == 0xda && flash_id == 0xc1) { in qla2x00_program_flash_address()
2198 if (addr & 0x7e) in qla2x00_program_flash_address()
2199 return 0; in qla2x00_program_flash_address()
2201 qla2x00_write_flash_byte(ha, 0x5555, 0xaa); in qla2x00_program_flash_address()
2202 qla2x00_write_flash_byte(ha, 0x2aaa, 0x55); in qla2x00_program_flash_address()
2203 qla2x00_write_flash_byte(ha, 0x5555, 0xa0); in qla2x00_program_flash_address()
2220 * Returns 0 on success, else non-zero.
2227 qla2x00_write_flash_byte(ha, 0xaaa, 0xaa); in qla2x00_erase_flash()
2228 qla2x00_write_flash_byte(ha, 0x555, 0x55); in qla2x00_erase_flash()
2229 qla2x00_write_flash_byte(ha, 0xaaa, 0x80); in qla2x00_erase_flash()
2230 qla2x00_write_flash_byte(ha, 0xaaa, 0xaa); in qla2x00_erase_flash()
2231 qla2x00_write_flash_byte(ha, 0x555, 0x55); in qla2x00_erase_flash()
2232 qla2x00_write_flash_byte(ha, 0xaaa, 0x10); in qla2x00_erase_flash()
2234 qla2x00_write_flash_byte(ha, 0x5555, 0xaa); in qla2x00_erase_flash()
2235 qla2x00_write_flash_byte(ha, 0x2aaa, 0x55); in qla2x00_erase_flash()
2236 qla2x00_write_flash_byte(ha, 0x5555, 0x80); in qla2x00_erase_flash()
2237 qla2x00_write_flash_byte(ha, 0x5555, 0xaa); in qla2x00_erase_flash()
2238 qla2x00_write_flash_byte(ha, 0x2aaa, 0x55); in qla2x00_erase_flash()
2239 qla2x00_write_flash_byte(ha, 0x5555, 0x10); in qla2x00_erase_flash()
2245 return qla2x00_poll_flash(ha, 0x00, 0x80, man_id, flash_id); in qla2x00_erase_flash()
2256 * Returns 0 on success, else non-zero.
2263 qla2x00_write_flash_byte(ha, 0x5555, 0xaa); in qla2x00_erase_flash_sector()
2264 qla2x00_write_flash_byte(ha, 0x2aaa, 0x55); in qla2x00_erase_flash_sector()
2265 qla2x00_write_flash_byte(ha, 0x5555, 0x80); in qla2x00_erase_flash_sector()
2266 qla2x00_write_flash_byte(ha, 0x5555, 0xaa); in qla2x00_erase_flash_sector()
2267 qla2x00_write_flash_byte(ha, 0x2aaa, 0x55); in qla2x00_erase_flash_sector()
2268 if (man_id == 0x1f && flash_id == 0x13) in qla2x00_erase_flash_sector()
2269 qla2x00_write_flash_byte(ha, addr & sec_mask, 0x10); in qla2x00_erase_flash_sector()
2271 qla2x00_write_flash_byte(ha, addr & sec_mask, 0x30); in qla2x00_erase_flash_sector()
2276 return qla2x00_poll_flash(ha, addr, 0x80, man_id, flash_id); in qla2x00_erase_flash_sector()
2289 qla2x00_write_flash_byte(ha, 0x5555, 0xaa); in qla2x00_get_flash_manufacturer()
2290 qla2x00_write_flash_byte(ha, 0x2aaa, 0x55); in qla2x00_get_flash_manufacturer()
2291 qla2x00_write_flash_byte(ha, 0x5555, 0x90); in qla2x00_get_flash_manufacturer()
2292 *man_id = qla2x00_read_flash_byte(ha, 0x0000); in qla2x00_get_flash_manufacturer()
2293 *flash_id = qla2x00_read_flash_byte(ha, 0x0001); in qla2x00_get_flash_manufacturer()
2294 qla2x00_write_flash_byte(ha, 0x5555, 0xaa); in qla2x00_get_flash_manufacturer()
2295 qla2x00_write_flash_byte(ha, 0x2aaa, 0x55); in qla2x00_get_flash_manufacturer()
2296 qla2x00_write_flash_byte(ha, 0x5555, 0xf0); in qla2x00_get_flash_manufacturer()
2309 wrt_reg_word(®->nvram, 0); in qla2x00_read_flash_data()
2311 for (ilength = 0; ilength < length; saddr++, ilength++, tmp_buf++) { in qla2x00_read_flash_data()
2342 for (cnt = 0; cnt < 30000; cnt++) { in qla2x00_suspend_hba()
2343 if ((rd_reg_word(®->hccr) & HCCR_RISC_PAUSE) != 0) in qla2x00_suspend_hba()
2382 wrt_reg_word(®->nvram, 0); in qla2x00_read_optrom_data()
2416 sec_number = 0; in qla2x00_write_optrom_data()
2428 man_id = flash_id = 0; in qla2x00_write_optrom_data()
2429 rest_addr = 0xffff; in qla2x00_write_optrom_data()
2430 sec_mask = 0x10000; in qla2x00_write_optrom_data()
2435 case 0x20: /* ST flash. */ in qla2x00_write_optrom_data()
2436 if (flash_id == 0xd2 || flash_id == 0xe3) { in qla2x00_write_optrom_data()
2440 * 0xf0000. in qla2x00_write_optrom_data()
2442 rest_addr = 0xffff; in qla2x00_write_optrom_data()
2443 sec_mask = 0x10000; in qla2x00_write_optrom_data()
2450 rest_addr = 0x3fff; in qla2x00_write_optrom_data()
2451 sec_mask = 0x1c000; in qla2x00_write_optrom_data()
2453 case 0x40: /* Mostel flash. */ in qla2x00_write_optrom_data()
2455 rest_addr = 0x1ff; in qla2x00_write_optrom_data()
2456 sec_mask = 0x1fe00; in qla2x00_write_optrom_data()
2458 case 0xbf: /* SST flash. */ in qla2x00_write_optrom_data()
2460 rest_addr = 0xfff; in qla2x00_write_optrom_data()
2461 sec_mask = 0x1f000; in qla2x00_write_optrom_data()
2463 case 0xda: /* Winbond flash. */ in qla2x00_write_optrom_data()
2465 rest_addr = 0x7f; in qla2x00_write_optrom_data()
2466 sec_mask = 0x1ff80; in qla2x00_write_optrom_data()
2468 case 0xc2: /* Macronix flash. */ in qla2x00_write_optrom_data()
2470 if (flash_id == 0x38 || flash_id == 0x4f) { in qla2x00_write_optrom_data()
2471 rest_addr = 0xffff; in qla2x00_write_optrom_data()
2472 sec_mask = 0x10000; in qla2x00_write_optrom_data()
2477 case 0x1f: /* Atmel flash. */ in qla2x00_write_optrom_data()
2479 if (flash_id == 0x13) { in qla2x00_write_optrom_data()
2480 rest_addr = 0x7fffffff; in qla2x00_write_optrom_data()
2481 sec_mask = 0x80000000; in qla2x00_write_optrom_data()
2486 case 0x01: /* AMD flash. */ in qla2x00_write_optrom_data()
2487 if (flash_id == 0x38 || flash_id == 0x40 || in qla2x00_write_optrom_data()
2488 flash_id == 0x4f) { in qla2x00_write_optrom_data()
2491 rest_addr = 0xffff; in qla2x00_write_optrom_data()
2492 sec_mask = 0x10000; in qla2x00_write_optrom_data()
2494 } else if (flash_id == 0x3e) { in qla2x00_write_optrom_data()
2500 rest_addr = 0xffff; in qla2x00_write_optrom_data()
2501 sec_mask = 0x10000; in qla2x00_write_optrom_data()
2503 } else if (flash_id == 0x20 || flash_id == 0x6e) { in qla2x00_write_optrom_data()
2508 rest_addr = 0x3fff; in qla2x00_write_optrom_data()
2509 sec_mask = 0x1c000; in qla2x00_write_optrom_data()
2511 } else if (flash_id == 0x6d) { in qla2x00_write_optrom_data()
2513 rest_addr = 0x1fff; in qla2x00_write_optrom_data()
2514 sec_mask = 0x1e000; in qla2x00_write_optrom_data()
2520 rest_addr = 0x3fff; in qla2x00_write_optrom_data()
2521 sec_mask = 0x1c000; in qla2x00_write_optrom_data()
2533 for (addr = offset, liter = 0; liter < length; liter++, in qla2x00_write_optrom_data()
2537 if ((addr & rest_addr) == 0) { in qla2x00_write_optrom_data()
2539 if (addr >= 0x10000UL) { in qla2x00_write_optrom_data()
2540 if (((addr >> 12) & 0xf0) && in qla2x00_write_optrom_data()
2541 ((man_id == 0x01 && in qla2x00_write_optrom_data()
2542 flash_id == 0x3e) || in qla2x00_write_optrom_data()
2543 (man_id == 0x20 && in qla2x00_write_optrom_data()
2544 flash_id == 0xd2))) { in qla2x00_write_optrom_data()
2548 0x7fff; in qla2x00_write_optrom_data()
2550 0x18000; in qla2x00_write_optrom_data()
2555 0x1fff; in qla2x00_write_optrom_data()
2557 0x1e000; in qla2x00_write_optrom_data()
2561 0x3fff; in qla2x00_write_optrom_data()
2563 0x1c000; in qla2x00_write_optrom_data()
2572 if (flash_id == 0xda && man_id == 0xc1) { in qla2x00_write_optrom_data()
2573 qla2x00_write_flash_byte(ha, 0x5555, in qla2x00_write_optrom_data()
2574 0xaa); in qla2x00_write_optrom_data()
2575 qla2x00_write_flash_byte(ha, 0x2aaa, in qla2x00_write_optrom_data()
2576 0x55); in qla2x00_write_optrom_data()
2577 qla2x00_write_flash_byte(ha, 0x5555, in qla2x00_write_optrom_data()
2578 0xa0); in qla2x00_write_optrom_data()
2587 if (man_id == 0x01 && flash_id == 0x6d) in qla2x00_write_optrom_data()
2592 if (man_id == 0x01 && flash_id == 0x6d) { in qla2x00_write_optrom_data()
2595 rest_addr = 0x0fff; in qla2x00_write_optrom_data()
2596 sec_mask = 0x1f000; in qla2x00_write_optrom_data()
2597 } else if (sec_number == 3 && (addr & 0x7ffe)) { in qla2x00_write_optrom_data()
2598 rest_addr = 0x3fff; in qla2x00_write_optrom_data()
2599 sec_mask = 0x1c000; in qla2x00_write_optrom_data()
2610 } while (0); in qla2x00_write_optrom_data()
2633 ql_log(ql_log_info, vha, 0x01a0, in qla24xx_read_optrom_data()
2648 uint32_t check_sum = 0; in qla28xx_extract_sfub_and_verify()
2658 for (i = 0; i < (sizeof(struct secure_flash_update_block) >> 2); i++) in qla28xx_extract_sfub_and_verify()
2664 ql_log(ql_log_warn, vha, 0x7097, in qla28xx_extract_sfub_and_verify()
2665 "SFUB checksum failed, 0x%x, 0x%x\n", in qla28xx_extract_sfub_and_verify()
2679 struct qla_flt_region *flt_reg = &flt->region[0]; in qla28xx_get_flash_region()
2713 uint32_t buf_size_without_sfub = 0; in qla28xx_write_flash_data()
2716 uint32_t risc_size, risc_attr = 0; in qla28xx_write_flash_data()
2723 ql_log(ql_log_warn, vha, 0xffff, in qla28xx_write_flash_data()
2733 ql_log(ql_log_warn, vha, 0x7095, in qla28xx_write_flash_data()
2745 ql_log(ql_log_warn + ql_dbg_verbose, vha, 0xffff, in qla28xx_write_flash_data()
2799 0xffff, "Secure region %x not supported\n", in qla28xx_write_flash_data()
2809 ql_log(ql_log_warn, vha, 0xffff, in qla28xx_write_flash_data()
2821 ql_log(ql_log_warn + ql_dbg_verbose, vha, 0xffff, in qla28xx_write_flash_data()
2831 ql_log(ql_log_warn, vha, 0xffff, in qla28xx_write_flash_data()
2836 ql_log(ql_log_warn + ql_dbg_verbose, vha, 0x7095, in qla28xx_write_flash_data()
2841 ql_log(ql_log_warn, vha, 0x7096, "Failed unprotect flash\n"); in qla28xx_write_flash_data()
2845 for (liter = 0; liter < dwords; liter++, faddr++) { in qla28xx_write_flash_data()
2850 ql_log(ql_log_warn + ql_dbg_verbose, vha, 0x7095, in qla28xx_write_flash_data()
2854 ql_dbg(ql_dbg_user, vha, 0x7007, in qla28xx_write_flash_data()
2868 ql_log(ql_log_warn + ql_dbg_verbose, vha, 0xffff, in qla28xx_write_flash_data()
2874 ql_log(ql_log_warn, vha, 0xffff, in qla28xx_write_flash_data()
2879 ql_log(ql_log_warn + ql_dbg_verbose, vha, 0xffff, in qla28xx_write_flash_data()
2886 ql_log(ql_log_warn, vha, 0xffff, in qla28xx_write_flash_data()
2891 ha->flags.fac_supported = 0; in qla28xx_write_flash_data()
2893 ql_log(ql_log_warn + ql_dbg_verbose, vha, 0xffff, in qla28xx_write_flash_data()
2896 FLASH_SEMAPHORE_REGISTER_ADDR, 0x00020002); in qla28xx_write_flash_data()
2898 ql_log(ql_log_warn, vha, 0xffff, in qla28xx_write_flash_data()
2904 ql_log(ql_log_warn + ql_dbg_verbose, vha, 0xffff, in qla28xx_write_flash_data()
2906 rval = qla2x00_write_ram_word(vha, 0x7ffd0101, 0); in qla28xx_write_flash_data()
2908 ql_log(ql_log_warn, vha, 0x7096, in qla28xx_write_flash_data()
2916 ql_log(ql_log_warn + ql_dbg_verbose, vha, 0xffff, in qla28xx_write_flash_data()
2918 rval = qla28xx_secure_flash_update(vha, 0, in qla28xx_write_flash_data()
2923 ql_log(ql_log_warn, vha, 0xffff, in qla28xx_write_flash_data()
2934 for (liter = 0; liter < dwords; liter++, faddr++, dwptr++) { in qla28xx_write_flash_data()
2945 ql_log(ql_log_warn + ql_dbg_verbose, vha, 0x7095, in qla28xx_write_flash_data()
2950 ql_log(ql_log_warn, vha, 0x7097, in qla28xx_write_flash_data()
2963 ql_log(ql_log_warn + ql_dbg_verbose, vha, 0x7095, in qla28xx_write_flash_data()
2968 ql_log(ql_log_warn, vha, 0x7099, in qla28xx_write_flash_data()
2980 ql_log(ql_log_warn, vha, 0xffff, in qla28xx_write_flash_data()
3033 if (offset & 0xfff) in qla25xx_read_optrom_data()
3039 if (offset & 0xff) in qla25xx_read_optrom_data()
3044 ql_log(ql_log_warn, vha, 0x00cc, in qla25xx_read_optrom_data()
3054 while (left != 0) { in qla25xx_read_optrom_data()
3061 ql_log(ql_log_warn, vha, 0x00f5, in qla25xx_read_optrom_data()
3065 ql_log(ql_log_warn, vha, 0x00f6, in qla25xx_read_optrom_data()
3114 memset(ha->fcode_revision, 0, sizeof(ha->fcode_revision)); in qla2x00_get_fcode_version()
3118 ((qla2x00_read_flash_byte(ha, pcids + 0x0B) << 8) | in qla2x00_get_fcode_version()
3119 qla2x00_read_flash_byte(ha, pcids + 0x0A)); in qla2x00_get_fcode_version()
3120 iend = istart + 0x100; in qla2x00_get_fcode_version()
3123 do_next = 0; in qla2x00_get_fcode_version()
3140 do_next = 0; in qla2x00_get_fcode_version()
3154 do_next = 0; in qla2x00_get_fcode_version()
3158 if (rbyte == ' ' || rbyte == 0xd || rbyte == 0x10) in qla2x00_get_fcode_version()
3175 } while (0); in qla2x00_get_fcode_version()
3178 memset(ha->fcode_revision, 0, sizeof(ha->fcode_revision)); in qla2x00_get_fcode_version()
3194 memset(ha->bios_revision, 0, sizeof(ha->bios_revision)); in qla2x00_get_flash_version()
3195 memset(ha->efi_revision, 0, sizeof(ha->efi_revision)); in qla2x00_get_flash_version()
3196 memset(ha->fcode_revision, 0, sizeof(ha->fcode_revision)); in qla2x00_get_flash_version()
3197 memset(ha->fw_revision, 0, sizeof(ha->fw_revision)); in qla2x00_get_flash_version()
3202 pcihdr = 0; in qla2x00_get_flash_version()
3206 if (qla2x00_read_flash_byte(ha, pcihdr) != 0x55 || in qla2x00_get_flash_version()
3207 qla2x00_read_flash_byte(ha, pcihdr + 0x01) != 0xaa) { in qla2x00_get_flash_version()
3209 ql_log(ql_log_fatal, vha, 0x0050, in qla2x00_get_flash_version()
3217 ((qla2x00_read_flash_byte(ha, pcihdr + 0x19) << 8) | in qla2x00_get_flash_version()
3218 qla2x00_read_flash_byte(ha, pcihdr + 0x18)); in qla2x00_get_flash_version()
3222 qla2x00_read_flash_byte(ha, pcids + 0x1) != 'C' || in qla2x00_get_flash_version()
3223 qla2x00_read_flash_byte(ha, pcids + 0x2) != 'I' || in qla2x00_get_flash_version()
3224 qla2x00_read_flash_byte(ha, pcids + 0x3) != 'R') { in qla2x00_get_flash_version()
3226 ql_log(ql_log_fatal, vha, 0x0051, in qla2x00_get_flash_version()
3233 code_type = qla2x00_read_flash_byte(ha, pcids + 0x14); in qla2x00_get_flash_version()
3237 ha->bios_revision[0] = in qla2x00_get_flash_version()
3238 qla2x00_read_flash_byte(ha, pcids + 0x12); in qla2x00_get_flash_version()
3240 qla2x00_read_flash_byte(ha, pcids + 0x13); in qla2x00_get_flash_version()
3241 ql_dbg(ql_dbg_init, vha, 0x0052, in qla2x00_get_flash_version()
3243 ha->bios_revision[1], ha->bios_revision[0]); in qla2x00_get_flash_version()
3252 ha->efi_revision[0] = in qla2x00_get_flash_version()
3253 qla2x00_read_flash_byte(ha, pcids + 0x12); in qla2x00_get_flash_version()
3255 qla2x00_read_flash_byte(ha, pcids + 0x13); in qla2x00_get_flash_version()
3256 ql_dbg(ql_dbg_init, vha, 0x0053, in qla2x00_get_flash_version()
3258 ha->efi_revision[1], ha->efi_revision[0]); in qla2x00_get_flash_version()
3261 ql_log(ql_log_warn, vha, 0x0054, in qla2x00_get_flash_version()
3267 last_image = qla2x00_read_flash_byte(ha, pcids + 0x15) & BIT_7; in qla2x00_get_flash_version()
3270 pcihdr += ((qla2x00_read_flash_byte(ha, pcids + 0x11) << 8) | in qla2x00_get_flash_version()
3271 qla2x00_read_flash_byte(ha, pcids + 0x10)) * 512; in qla2x00_get_flash_version()
3276 memset(ha->fw_revision, 0, sizeof(ha->fw_revision)); in qla2x00_get_flash_version()
3278 memset(dbyte, 0, 8); in qla2x00_get_flash_version()
3283 ql_dbg(ql_dbg_init + ql_dbg_buffer, vha, 0x010a, in qla2x00_get_flash_version()
3286 ql_dump_buffer(ql_dbg_init + ql_dbg_buffer, vha, 0x010b, in qla2x00_get_flash_version()
3289 if ((dcode[0] == 0xffff && dcode[1] == 0xffff && in qla2x00_get_flash_version()
3290 dcode[2] == 0xffff && dcode[3] == 0xffff) || in qla2x00_get_flash_version()
3291 (dcode[0] == 0 && dcode[1] == 0 && dcode[2] == 0 && in qla2x00_get_flash_version()
3292 dcode[3] == 0)) { in qla2x00_get_flash_version()
3293 ql_log(ql_log_warn, vha, 0x0057, in qla2x00_get_flash_version()
3298 ha->fw_revision[0] = dbyte[0] << 16 | dbyte[1]; in qla2x00_get_flash_version()
3301 ql_dbg(ql_dbg_init, vha, 0x0058, in qla2x00_get_flash_version()
3303 "%d.%d.%d.\n", ha->fw_revision[0], in qla2x00_get_flash_version()
3326 memset(ha->bios_revision, 0, sizeof(ha->bios_revision)); in qla82xx_get_flash_version()
3327 memset(ha->efi_revision, 0, sizeof(ha->efi_revision)); in qla82xx_get_flash_version()
3328 memset(ha->fcode_revision, 0, sizeof(ha->fcode_revision)); in qla82xx_get_flash_version()
3329 memset(ha->fw_revision, 0, sizeof(ha->fw_revision)); in qla82xx_get_flash_version()
3336 ha->isp_ops->read_optrom(vha, dcode, pcihdr, 0x20 * 4); in qla82xx_get_flash_version()
3340 ql_log(ql_log_fatal, vha, 0x0154, in qla82xx_get_flash_version()
3347 pcids = pcihdr + ((bcode[0x19] << 8) | bcode[0x18]); in qla82xx_get_flash_version()
3349 ha->isp_ops->read_optrom(vha, dcode, pcids, 0x20 * 4); in qla82xx_get_flash_version()
3355 ql_log(ql_log_fatal, vha, 0x0155, in qla82xx_get_flash_version()
3362 code_type = bcode[0x14]; in qla82xx_get_flash_version()
3366 ha->bios_revision[0] = bcode[0x12]; in qla82xx_get_flash_version()
3367 ha->bios_revision[1] = bcode[0x13]; in qla82xx_get_flash_version()
3368 ql_dbg(ql_dbg_init, vha, 0x0156, in qla82xx_get_flash_version()
3370 ha->bios_revision[1], ha->bios_revision[0]); in qla82xx_get_flash_version()
3374 ha->fcode_revision[0] = bcode[0x12]; in qla82xx_get_flash_version()
3375 ha->fcode_revision[1] = bcode[0x13]; in qla82xx_get_flash_version()
3376 ql_dbg(ql_dbg_init, vha, 0x0157, in qla82xx_get_flash_version()
3378 ha->fcode_revision[1], ha->fcode_revision[0]); in qla82xx_get_flash_version()
3382 ha->efi_revision[0] = bcode[0x12]; in qla82xx_get_flash_version()
3383 ha->efi_revision[1] = bcode[0x13]; in qla82xx_get_flash_version()
3384 ql_dbg(ql_dbg_init, vha, 0x0158, in qla82xx_get_flash_version()
3386 ha->efi_revision[1], ha->efi_revision[0]); in qla82xx_get_flash_version()
3389 ql_log(ql_log_warn, vha, 0x0159, in qla82xx_get_flash_version()
3395 last_image = bcode[0x15] & BIT_7; in qla82xx_get_flash_version()
3398 pcihdr += ((bcode[0x11] << 8) | bcode[0x10]) * 512; in qla82xx_get_flash_version()
3402 memset(ha->fw_revision, 0, sizeof(ha->fw_revision)); in qla82xx_get_flash_version()
3404 ha->isp_ops->read_optrom(vha, dcode, ha->flt_region_fw << 2, 0x20); in qla82xx_get_flash_version()
3408 if (bcode[0x0] == 0x3 && bcode[0x1] == 0x0 && in qla82xx_get_flash_version()
3409 bcode[0x2] == 0x40 && bcode[0x3] == 0x40) { in qla82xx_get_flash_version()
3410 ha->fw_revision[0] = bcode[0x4]; in qla82xx_get_flash_version()
3411 ha->fw_revision[1] = bcode[0x5]; in qla82xx_get_flash_version()
3412 ha->fw_revision[2] = bcode[0x6]; in qla82xx_get_flash_version()
3413 ql_dbg(ql_dbg_init, vha, 0x0153, in qla82xx_get_flash_version()
3415 ha->fw_revision[0], ha->fw_revision[1], in qla82xx_get_flash_version()
3426 uint32_t pcihdr = 0, pcids = 0; in qla24xx_get_flash_version()
3432 uint32_t faddr = 0; in qla24xx_get_flash_version()
3441 memset(ha->bios_revision, 0, sizeof(ha->bios_revision)); in qla24xx_get_flash_version()
3442 memset(ha->efi_revision, 0, sizeof(ha->efi_revision)); in qla24xx_get_flash_version()
3443 memset(ha->fcode_revision, 0, sizeof(ha->fcode_revision)); in qla24xx_get_flash_version()
3444 memset(ha->fw_revision, 0, sizeof(ha->fw_revision)); in qla24xx_get_flash_version()
3456 ret = qla24xx_read_flash_data(vha, dcode, pcihdr >> 2, 0x20); in qla24xx_get_flash_version()
3458 ql_log(ql_log_info, vha, 0x017d, in qla24xx_get_flash_version()
3466 ql_log(ql_log_fatal, vha, 0x0059, in qla24xx_get_flash_version()
3472 pcids = pcihdr + ((bcode[0x19] << 8) | bcode[0x18]); in qla24xx_get_flash_version()
3474 ret = qla24xx_read_flash_data(vha, dcode, pcids >> 2, 0x20); in qla24xx_get_flash_version()
3476 ql_log(ql_log_info, vha, 0x018e, in qla24xx_get_flash_version()
3486 ql_log(ql_log_fatal, vha, 0x005a, in qla24xx_get_flash_version()
3488 ql_dump_buffer(ql_dbg_init, vha, 0x0059, dcode, 32); in qla24xx_get_flash_version()
3493 code_type = bcode[0x14]; in qla24xx_get_flash_version()
3497 ha->bios_revision[0] = bcode[0x12]; in qla24xx_get_flash_version()
3498 ha->bios_revision[1] = bcode[0x13]; in qla24xx_get_flash_version()
3499 ql_dbg(ql_dbg_init, vha, 0x005b, in qla24xx_get_flash_version()
3501 ha->bios_revision[1], ha->bios_revision[0]); in qla24xx_get_flash_version()
3505 ha->fcode_revision[0] = bcode[0x12]; in qla24xx_get_flash_version()
3506 ha->fcode_revision[1] = bcode[0x13]; in qla24xx_get_flash_version()
3507 ql_dbg(ql_dbg_init, vha, 0x005c, in qla24xx_get_flash_version()
3509 ha->fcode_revision[1], ha->fcode_revision[0]); in qla24xx_get_flash_version()
3513 ha->efi_revision[0] = bcode[0x12]; in qla24xx_get_flash_version()
3514 ha->efi_revision[1] = bcode[0x13]; in qla24xx_get_flash_version()
3515 ql_dbg(ql_dbg_init, vha, 0x005d, in qla24xx_get_flash_version()
3517 ha->efi_revision[1], ha->efi_revision[0]); in qla24xx_get_flash_version()
3520 ql_log(ql_log_warn, vha, 0x005e, in qla24xx_get_flash_version()
3526 last_image = bcode[0x15] & BIT_7; in qla24xx_get_flash_version()
3529 pcihdr += ((bcode[0x11] << 8) | bcode[0x10]) * 512; in qla24xx_get_flash_version()
3533 memset(ha->fw_revision, 0, sizeof(ha->fw_revision)); in qla24xx_get_flash_version()
3543 ql_log(ql_log_info, vha, 0x019e, in qla24xx_get_flash_version()
3548 ql_log(ql_log_warn, vha, 0x005f, in qla24xx_get_flash_version()
3551 ql_dump_buffer(ql_dbg_init, vha, 0x005f, dcode, 32); in qla24xx_get_flash_version()
3553 for (i = 0; i < 4; i++) in qla24xx_get_flash_version()
3556 ql_dbg(ql_dbg_init, vha, 0x0060, in qla24xx_get_flash_version()
3558 ha->fw_revision[0], ha->fw_revision[1], in qla24xx_get_flash_version()
3569 memset(ha->gold_fw_version, 0, sizeof(ha->gold_fw_version)); in qla24xx_get_flash_version()
3573 ql_log(ql_log_info, vha, 0x019f, in qla24xx_get_flash_version()
3578 ql_log(ql_log_warn, vha, 0x0056, in qla24xx_get_flash_version()
3580 ql_dump_buffer(ql_dbg_init, vha, 0x0056, dcode, 32); in qla24xx_get_flash_version()
3584 for (i = 0; i < 4; i++) in qla24xx_get_flash_version()
3594 if (pos >= end || *pos != 0x82) in qla2xxx_is_vpd_valid()
3595 return 0; in qla2xxx_is_vpd_valid()
3598 if (pos >= end || *pos != 0x90) in qla2xxx_is_vpd_valid()
3599 return 0; in qla2xxx_is_vpd_valid()
3602 if (pos >= end || *pos != 0x78) in qla2xxx_is_vpd_valid()
3603 return 0; in qla2xxx_is_vpd_valid()
3614 int len = 0; in qla2xxx_get_vpd_field()
3617 return 0; in qla2xxx_get_vpd_field()
3619 while (pos < end && *pos != 0x78) { in qla2xxx_get_vpd_field()
3620 len = (*pos == 0x82) ? pos[1] : pos[2]; in qla2xxx_get_vpd_field()
3625 if (*pos != 0x90 && *pos != 0x91) in qla2xxx_get_vpd_field()
3631 if (pos < end - len && *pos != 0x78) in qla2xxx_get_vpd_field()
3634 return 0; in qla2xxx_get_vpd_field()
3647 ql_log(ql_log_warn, vha, 0x00d5, in qla24xx_read_fcp_prio_cfg()
3653 memset(ha->fcp_prio_cfg, 0, FCP_PRIO_CFG_SIZE); in qla24xx_read_fcp_prio_cfg()
3661 if (!qla24xx_fcp_prio_cfg_valid(vha, ha->fcp_prio_cfg, 0)) in qla24xx_read_fcp_prio_cfg()
3669 ha->isp_ops->read_optrom(vha, &ha->fcp_prio_cfg->entry[0], in qla24xx_read_fcp_prio_cfg()