aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfa_ioc.c
diff options
context:
space:
mode:
authorJing Huang <huangj@brocade.com>2010-07-08 22:45:20 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-27 13:04:03 -0400
commit293f82d59ed8b6d61d242e40ee7a6a146fae5eaa (patch)
treef1f5f0c935e20765188847ff7f6cf4863adf69e3 /drivers/scsi/bfa/bfa_ioc.c
parent3cb5469a2ab4b87a7c63dd218fdc1625bc73eccc (diff)
[SCSI] bfa: enable new hardware
This patch enables support of new mezzanine cards for HP and IBM blade server. - Add new pciids for HP and IBM mezzanine card. - Add a new firmware image for HP mezzanine card, which is running in FC only mode. Rename firmware image to reflect the difference. Change the firmware download code accordingly for the above changes. Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bfa/bfa_ioc.c')
-rw-r--r--drivers/scsi/bfa/bfa_ioc.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c
index e038bc9769f6..ef3b3fefbe74 100644
--- a/drivers/scsi/bfa/bfa_ioc.c
+++ b/drivers/scsi/bfa/bfa_ioc.c
@@ -59,14 +59,12 @@ BFA_TRC_FILE(CNA, IOC);
59 ((__ioc)->ioc_hwif->ioc_firmware_lock(__ioc)) 59 ((__ioc)->ioc_hwif->ioc_firmware_lock(__ioc))
60#define bfa_ioc_firmware_unlock(__ioc) \ 60#define bfa_ioc_firmware_unlock(__ioc) \
61 ((__ioc)->ioc_hwif->ioc_firmware_unlock(__ioc)) 61 ((__ioc)->ioc_hwif->ioc_firmware_unlock(__ioc))
62#define bfa_ioc_fwimg_get_chunk(__ioc, __off) \
63 ((__ioc)->ioc_hwif->ioc_fwimg_get_chunk(__ioc, __off))
64#define bfa_ioc_fwimg_get_size(__ioc) \
65 ((__ioc)->ioc_hwif->ioc_fwimg_get_size(__ioc))
66#define bfa_ioc_reg_init(__ioc) ((__ioc)->ioc_hwif->ioc_reg_init(__ioc)) 62#define bfa_ioc_reg_init(__ioc) ((__ioc)->ioc_hwif->ioc_reg_init(__ioc))
67#define bfa_ioc_map_port(__ioc) ((__ioc)->ioc_hwif->ioc_map_port(__ioc)) 63#define bfa_ioc_map_port(__ioc) ((__ioc)->ioc_hwif->ioc_map_port(__ioc))
68#define bfa_ioc_notify_hbfail(__ioc) \ 64#define bfa_ioc_notify_hbfail(__ioc) \
69 ((__ioc)->ioc_hwif->ioc_notify_hbfail(__ioc)) 65 ((__ioc)->ioc_hwif->ioc_notify_hbfail(__ioc))
66#define bfa_ioc_is_optrom(__ioc) \
67 (bfi_image_get_size(BFA_IOC_FWIMG_TYPE(__ioc)) < BFA_IOC_FWIMG_MINSZ)
70 68
71bfa_boolean_t bfa_auto_recover = BFA_TRUE; 69bfa_boolean_t bfa_auto_recover = BFA_TRUE;
72 70
@@ -879,8 +877,8 @@ bfa_ioc_fwver_cmp(struct bfa_ioc_s *ioc, struct bfi_ioc_image_hdr_s *fwhdr)
879 struct bfi_ioc_image_hdr_s *drv_fwhdr; 877 struct bfi_ioc_image_hdr_s *drv_fwhdr;
880 int i; 878 int i;
881 879
882 drv_fwhdr = 880 drv_fwhdr = (struct bfi_ioc_image_hdr_s *)
883 (struct bfi_ioc_image_hdr_s *)bfa_ioc_fwimg_get_chunk(ioc, 0); 881 bfi_image_get_chunk(BFA_IOC_FWIMG_TYPE(ioc), 0);
884 882
885 for (i = 0; i < BFI_IOC_MD5SUM_SZ; i++) { 883 for (i = 0; i < BFI_IOC_MD5SUM_SZ; i++) {
886 if (fwhdr->md5sum[i] != drv_fwhdr->md5sum[i]) { 884 if (fwhdr->md5sum[i] != drv_fwhdr->md5sum[i]) {
@@ -907,12 +905,13 @@ bfa_ioc_fwver_valid(struct bfa_ioc_s *ioc)
907 /** 905 /**
908 * If bios/efi boot (flash based) -- return true 906 * If bios/efi boot (flash based) -- return true
909 */ 907 */
910 if (bfa_ioc_fwimg_get_size(ioc) < BFA_IOC_FWIMG_MINSZ) 908 if (bfa_ioc_is_optrom(ioc))
911 return BFA_TRUE; 909 return BFA_TRUE;
912 910
913 bfa_ioc_fwver_get(ioc, &fwhdr); 911 bfa_ioc_fwver_get(ioc, &fwhdr);
914 drv_fwhdr = 912 drv_fwhdr = (struct bfi_ioc_image_hdr_s *)
915 (struct bfi_ioc_image_hdr_s *)bfa_ioc_fwimg_get_chunk(ioc, 0); 913 bfi_image_get_chunk(BFA_IOC_FWIMG_TYPE(ioc), 0);
914
916 915
917 if (fwhdr.signature != drv_fwhdr->signature) { 916 if (fwhdr.signature != drv_fwhdr->signature) {
918 bfa_trc(ioc, fwhdr.signature); 917 bfa_trc(ioc, fwhdr.signature);
@@ -1125,21 +1124,22 @@ bfa_ioc_download_fw(struct bfa_ioc_s *ioc, u32 boot_type,
1125 /** 1124 /**
1126 * Flash based firmware boot 1125 * Flash based firmware boot
1127 */ 1126 */
1128 bfa_trc(ioc, bfa_ioc_fwimg_get_size(ioc)); 1127 bfa_trc(ioc, bfi_image_get_size(BFA_IOC_FWIMG_TYPE(ioc)));
1129 if (bfa_ioc_fwimg_get_size(ioc) < BFA_IOC_FWIMG_MINSZ) 1128 if (bfa_ioc_is_optrom(ioc))
1130 boot_type = BFI_BOOT_TYPE_FLASH; 1129 boot_type = BFI_BOOT_TYPE_FLASH;
1131 fwimg = bfa_ioc_fwimg_get_chunk(ioc, chunkno); 1130 fwimg = bfi_image_get_chunk(BFA_IOC_FWIMG_TYPE(ioc), chunkno);
1131
1132 1132
1133 pgnum = bfa_ioc_smem_pgnum(ioc, loff); 1133 pgnum = bfa_ioc_smem_pgnum(ioc, loff);
1134 pgoff = bfa_ioc_smem_pgoff(ioc, loff); 1134 pgoff = bfa_ioc_smem_pgoff(ioc, loff);
1135 1135
1136 bfa_reg_write(ioc->ioc_regs.host_page_num_fn, pgnum); 1136 bfa_reg_write(ioc->ioc_regs.host_page_num_fn, pgnum);
1137 1137
1138 for (i = 0; i < bfa_ioc_fwimg_get_size(ioc); i++) { 1138 for (i = 0; i < bfi_image_get_size(BFA_IOC_FWIMG_TYPE(ioc)); i++) {
1139 1139
1140 if (BFA_IOC_FLASH_CHUNK_NO(i) != chunkno) { 1140 if (BFA_IOC_FLASH_CHUNK_NO(i) != chunkno) {
1141 chunkno = BFA_IOC_FLASH_CHUNK_NO(i); 1141 chunkno = BFA_IOC_FLASH_CHUNK_NO(i);
1142 fwimg = bfa_ioc_fwimg_get_chunk(ioc, 1142 fwimg = bfi_image_get_chunk(BFA_IOC_FWIMG_TYPE(ioc),
1143 BFA_IOC_FLASH_CHUNK_ADDR(chunkno)); 1143 BFA_IOC_FLASH_CHUNK_ADDR(chunkno));
1144 } 1144 }
1145 1145
@@ -1188,6 +1188,7 @@ bfa_ioc_getattr_reply(struct bfa_ioc_s *ioc)
1188 struct bfi_ioc_attr_s *attr = ioc->attr; 1188 struct bfi_ioc_attr_s *attr = ioc->attr;
1189 1189
1190 attr->adapter_prop = bfa_os_ntohl(attr->adapter_prop); 1190 attr->adapter_prop = bfa_os_ntohl(attr->adapter_prop);
1191 attr->card_type = bfa_os_ntohl(attr->card_type);
1191 attr->maxfrsize = bfa_os_ntohs(attr->maxfrsize); 1192 attr->maxfrsize = bfa_os_ntohs(attr->maxfrsize);
1192 1193
1193 bfa_fsm_send_event(ioc, IOC_E_FWRSP_GETATTR); 1194 bfa_fsm_send_event(ioc, IOC_E_FWRSP_GETATTR);
@@ -1416,7 +1417,7 @@ bfa_ioc_pci_init(struct bfa_ioc_s *ioc, struct bfa_pcidev_s *pcidev,
1416{ 1417{
1417 ioc->ioc_mc = mc; 1418 ioc->ioc_mc = mc;
1418 ioc->pcidev = *pcidev; 1419 ioc->pcidev = *pcidev;
1419 ioc->ctdev = (ioc->pcidev.device_id == BFA_PCI_DEVICE_ID_CT); 1420 ioc->ctdev = bfa_asic_id_ct(ioc->pcidev.device_id);
1420 ioc->cna = ioc->ctdev && !ioc->fcmode; 1421 ioc->cna = ioc->ctdev && !ioc->fcmode;
1421 1422
1422 /** 1423 /**
@@ -1916,7 +1917,7 @@ bfa_ioc_set_fcmode(struct bfa_ioc_s *ioc)
1916bfa_boolean_t 1917bfa_boolean_t
1917bfa_ioc_get_fcmode(struct bfa_ioc_s *ioc) 1918bfa_ioc_get_fcmode(struct bfa_ioc_s *ioc)
1918{ 1919{
1919 return ioc->fcmode || (ioc->pcidev.device_id != BFA_PCI_DEVICE_ID_CT); 1920 return ioc->fcmode || !bfa_asic_id_ct(ioc->pcidev.device_id);
1920} 1921}
1921 1922
1922/** 1923/**