aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrishna Gudipati <kgudipat@brocade.com>2011-06-13 18:52:40 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-06-29 16:50:50 -0400
commit8b070b4a022f86dd5098308e36426ce29b6b8960 (patch)
tree6e6e2077aa3de449d4e3917392eb0179a635f1ad
parent775c7742adfd7726f05914198bf33eaa3b9f64bb (diff)
[SCSI] bfa: Brocade-1860 Fabric Adapter 16Gbs support and flash controller fixes.
- Added support for 16Gbps. - Added logic to flush pending mailbox command queue when IOC is disabled. - Fix to Halt the flash controller during fw initialization - since when asic blck is programmed flash controller's continuous access blocks f/w access to flash. - Added new asic based card types and modified IOC get card model routine. - Added PLL init fix to do LPU reset every time we do a memory initialization, since not doing so will cause LPU to be uninitialized during driver load. - Added fix to Halt flash controller before PLL initialization. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--drivers/scsi/bfa/bfa_defs.h18
-rw-r--r--drivers/scsi/bfa/bfa_fcbuild.h6
-rw-r--r--drivers/scsi/bfa/bfa_ioc.c68
-rw-r--r--drivers/scsi/bfa/bfa_ioc.h7
-rw-r--r--drivers/scsi/bfa/bfa_ioc_ct.c42
-rw-r--r--drivers/scsi/bfa/bfad.c3
-rw-r--r--drivers/scsi/bfa/bfad_attr.c3
-rw-r--r--drivers/scsi/bfa/bfad_im.c5
-rw-r--r--drivers/scsi/bfa/bfi.h2
-rw-r--r--drivers/scsi/bfa/bfi_reg.h7
10 files changed, 130 insertions, 31 deletions
diff --git a/drivers/scsi/bfa/bfa_defs.h b/drivers/scsi/bfa/bfa_defs.h
index be1ba54fa19..7dbf3624d16 100644
--- a/drivers/scsi/bfa/bfa_defs.h
+++ b/drivers/scsi/bfa/bfa_defs.h
@@ -40,7 +40,12 @@ enum {
40 BFA_MFG_TYPE_ASTRA = 807, /* Astra mezz card */ 40 BFA_MFG_TYPE_ASTRA = 807, /* Astra mezz card */
41 BFA_MFG_TYPE_LIGHTNING_P0 = 902, /* Lightning mezz card - old */ 41 BFA_MFG_TYPE_LIGHTNING_P0 = 902, /* Lightning mezz card - old */
42 BFA_MFG_TYPE_LIGHTNING = 1741, /* Lightning mezz card */ 42 BFA_MFG_TYPE_LIGHTNING = 1741, /* Lightning mezz card */
43 BFA_MFG_TYPE_INVALID = 0, /* Invalid card type */ 43 BFA_MFG_TYPE_PROWLER_F = 1560, /* Prowler FC only cards */
44 BFA_MFG_TYPE_PROWLER_N = 1410, /* Prowler NIC only cards */
45 BFA_MFG_TYPE_PROWLER_C = 1710, /* Prowler CNA only cards */
46 BFA_MFG_TYPE_PROWLER_D = 1860, /* Prowler Dual cards */
47 BFA_MFG_TYPE_CHINOOK = 1867, /* Chinook cards */
48 BFA_MFG_TYPE_INVALID = 0, /* Invalid card type */
44}; 49};
45 50
46#pragma pack(1) 51#pragma pack(1)
@@ -53,7 +58,8 @@ enum {
53 (type) == BFA_MFG_TYPE_WANCHESE || \ 58 (type) == BFA_MFG_TYPE_WANCHESE || \
54 (type) == BFA_MFG_TYPE_ASTRA || \ 59 (type) == BFA_MFG_TYPE_ASTRA || \
55 (type) == BFA_MFG_TYPE_LIGHTNING_P0 || \ 60 (type) == BFA_MFG_TYPE_LIGHTNING_P0 || \
56 (type) == BFA_MFG_TYPE_LIGHTNING)) 61 (type) == BFA_MFG_TYPE_LIGHTNING || \
62 (type) == BFA_MFG_TYPE_CHINOOK))
57 63
58/* 64/*
59 * Check if the card having old wwn/mac handling 65 * Check if the card having old wwn/mac handling
@@ -337,6 +343,11 @@ struct bfa_ioc_attr_s {
337#define BFA_MFG_SUPPLIER_PARTNUM_SIZE 20 343#define BFA_MFG_SUPPLIER_PARTNUM_SIZE 20
338#define BFA_MFG_SUPPLIER_SERIALNUM_SIZE 20 344#define BFA_MFG_SUPPLIER_SERIALNUM_SIZE 20
339#define BFA_MFG_SUPPLIER_REVISION_SIZE 4 345#define BFA_MFG_SUPPLIER_REVISION_SIZE 4
346/*
347 * Initial capability definition
348 */
349#define BFA_MFG_IC_FC 0x01
350#define BFA_MFG_IC_ETH 0x02
340 351
341#pragma pack(1) 352#pragma pack(1)
342 353
@@ -425,7 +436,8 @@ enum bfa_port_speed {
425 BFA_PORT_SPEED_16GBPS = 16, 436 BFA_PORT_SPEED_16GBPS = 16,
426 BFA_PORT_SPEED_AUTO = 437 BFA_PORT_SPEED_AUTO =
427 (BFA_PORT_SPEED_1GBPS | BFA_PORT_SPEED_2GBPS | 438 (BFA_PORT_SPEED_1GBPS | BFA_PORT_SPEED_2GBPS |
428 BFA_PORT_SPEED_4GBPS | BFA_PORT_SPEED_8GBPS), 439 BFA_PORT_SPEED_4GBPS | BFA_PORT_SPEED_8GBPS |
440 BFA_PORT_SPEED_16GBPS),
429}; 441};
430#define bfa_port_speed_t enum bfa_port_speed 442#define bfa_port_speed_t enum bfa_port_speed
431 443
diff --git a/drivers/scsi/bfa/bfa_fcbuild.h b/drivers/scsi/bfa/bfa_fcbuild.h
index ece51ec7620..24c4cfb3009 100644
--- a/drivers/scsi/bfa/bfa_fcbuild.h
+++ b/drivers/scsi/bfa/bfa_fcbuild.h
@@ -66,6 +66,9 @@ fc_rpsc_operspeed_to_bfa_speed(enum fc_rpsc_op_speed speed)
66 case RPSC_OP_SPEED_8G: 66 case RPSC_OP_SPEED_8G:
67 return BFA_PORT_SPEED_8GBPS; 67 return BFA_PORT_SPEED_8GBPS;
68 68
69 case RPSC_OP_SPEED_16G:
70 return BFA_PORT_SPEED_16GBPS;
71
69 case RPSC_OP_SPEED_10G: 72 case RPSC_OP_SPEED_10G:
70 return BFA_PORT_SPEED_10GBPS; 73 return BFA_PORT_SPEED_10GBPS;
71 74
@@ -94,6 +97,9 @@ fc_bfa_speed_to_rpsc_operspeed(enum bfa_port_speed op_speed)
94 case BFA_PORT_SPEED_8GBPS: 97 case BFA_PORT_SPEED_8GBPS:
95 return RPSC_OP_SPEED_8G; 98 return RPSC_OP_SPEED_8G;
96 99
100 case BFA_PORT_SPEED_16GBPS:
101 return RPSC_OP_SPEED_16G;
102
97 case BFA_PORT_SPEED_10GBPS: 103 case BFA_PORT_SPEED_10GBPS:
98 return RPSC_OP_SPEED_10G; 104 return RPSC_OP_SPEED_10G;
99 105
diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c
index 9c6e493cb9c..b9413c2e67f 100644
--- a/drivers/scsi/bfa/bfa_ioc.c
+++ b/drivers/scsi/bfa/bfa_ioc.c
@@ -85,7 +85,7 @@ static void bfa_ioc_send_disable(struct bfa_ioc_s *ioc);
85static void bfa_ioc_send_getattr(struct bfa_ioc_s *ioc); 85static void bfa_ioc_send_getattr(struct bfa_ioc_s *ioc);
86static void bfa_ioc_hb_monitor(struct bfa_ioc_s *ioc); 86static void bfa_ioc_hb_monitor(struct bfa_ioc_s *ioc);
87static void bfa_ioc_mbox_poll(struct bfa_ioc_s *ioc); 87static void bfa_ioc_mbox_poll(struct bfa_ioc_s *ioc);
88static void bfa_ioc_mbox_hbfail(struct bfa_ioc_s *ioc); 88static void bfa_ioc_mbox_flush(struct bfa_ioc_s *ioc);
89static void bfa_ioc_recover(struct bfa_ioc_s *ioc); 89static void bfa_ioc_recover(struct bfa_ioc_s *ioc);
90static void bfa_ioc_check_attr_wwns(struct bfa_ioc_s *ioc); 90static void bfa_ioc_check_attr_wwns(struct bfa_ioc_s *ioc);
91static void bfa_ioc_event_notify(struct bfa_ioc_s *ioc , 91static void bfa_ioc_event_notify(struct bfa_ioc_s *ioc ,
@@ -971,6 +971,7 @@ bfa_iocpf_sm_disabling_sync(struct bfa_iocpf_s *iocpf, enum iocpf_event event)
971static void 971static void
972bfa_iocpf_sm_disabled_entry(struct bfa_iocpf_s *iocpf) 972bfa_iocpf_sm_disabled_entry(struct bfa_iocpf_s *iocpf)
973{ 973{
974 bfa_ioc_mbox_flush(iocpf->ioc);
974 bfa_fsm_send_event(iocpf->ioc, IOC_E_DISABLED); 975 bfa_fsm_send_event(iocpf->ioc, IOC_E_DISABLED);
975} 976}
976 977
@@ -1081,7 +1082,7 @@ bfa_iocpf_sm_fail_sync_entry(struct bfa_iocpf_s *iocpf)
1081 /* 1082 /*
1082 * Flush any queued up mailbox requests. 1083 * Flush any queued up mailbox requests.
1083 */ 1084 */
1084 bfa_ioc_mbox_hbfail(iocpf->ioc); 1085 bfa_ioc_mbox_flush(iocpf->ioc);
1085 1086
1086 bfa_ioc_hw_sem_get(iocpf->ioc); 1087 bfa_ioc_hw_sem_get(iocpf->ioc);
1087} 1088}
@@ -1399,6 +1400,7 @@ bfa_ioc_hwinit(struct bfa_ioc_s *ioc, bfa_boolean_t force)
1399 1400
1400 if (!fwvalid) { 1401 if (!fwvalid) {
1401 bfa_ioc_boot(ioc, boot_type, boot_env); 1402 bfa_ioc_boot(ioc, boot_type, boot_env);
1403 bfa_ioc_poll_fwinit(ioc);
1402 return; 1404 return;
1403 } 1405 }
1404 1406
@@ -1434,6 +1436,7 @@ bfa_ioc_hwinit(struct bfa_ioc_s *ioc, bfa_boolean_t force)
1434 * Initialize the h/w for any other states. 1436 * Initialize the h/w for any other states.
1435 */ 1437 */
1436 bfa_ioc_boot(ioc, boot_type, boot_env); 1438 bfa_ioc_boot(ioc, boot_type, boot_env);
1439 bfa_ioc_poll_fwinit(ioc);
1437} 1440}
1438 1441
1439static void 1442static void
@@ -1668,7 +1671,7 @@ bfa_ioc_mbox_poll(struct bfa_ioc_s *ioc)
1668 * Cleanup any pending requests. 1671 * Cleanup any pending requests.
1669 */ 1672 */
1670static void 1673static void
1671bfa_ioc_mbox_hbfail(struct bfa_ioc_s *ioc) 1674bfa_ioc_mbox_flush(struct bfa_ioc_s *ioc)
1672{ 1675{
1673 struct bfa_ioc_mbox_mod_s *mod = &ioc->mbox_mod; 1676 struct bfa_ioc_mbox_mod_s *mod = &ioc->mbox_mod;
1674 struct bfa_mbox_cmd_s *cmd; 1677 struct bfa_mbox_cmd_s *cmd;
@@ -2178,22 +2181,28 @@ bfa_ioc_mbox_isr(struct bfa_ioc_s *ioc)
2178 struct bfi_mbmsg_s m; 2181 struct bfi_mbmsg_s m;
2179 int mc; 2182 int mc;
2180 2183
2181 if (!bfa_ioc_msgget(ioc, &m)) 2184 if (bfa_ioc_msgget(ioc, &m)) {
2182 return; 2185 /*
2186 * Treat IOC message class as special.
2187 */
2188 mc = m.mh.msg_class;
2189 if (mc == BFI_MC_IOC) {
2190 bfa_ioc_isr(ioc, &m);
2191 return;
2192 }
2183 2193
2184 /* 2194 if ((mc > BFI_MC_MAX) || (mod->mbhdlr[mc].cbfn == NULL))
2185 * Treat IOC message class as special. 2195 return;
2186 */ 2196
2187 mc = m.mh.msg_class; 2197 mod->mbhdlr[mc].cbfn(mod->mbhdlr[mc].cbarg, &m);
2188 if (mc == BFI_MC_IOC) {
2189 bfa_ioc_isr(ioc, &m);
2190 return;
2191 } 2198 }
2192 2199
2193 if ((mc > BFI_MC_MAX) || (mod->mbhdlr[mc].cbfn == NULL)) 2200 bfa_ioc_lpu_read_stat(ioc);
2194 return;
2195 2201
2196 mod->mbhdlr[mc].cbfn(mod->mbhdlr[mc].cbarg, &m); 2202 /*
2203 * Try to send pending mailbox commands
2204 */
2205 bfa_ioc_mbox_poll(ioc);
2197} 2206}
2198 2207
2199void 2208void
@@ -2392,8 +2401,33 @@ bfa_ioc_get_adapter_model(struct bfa_ioc_s *ioc, char *model)
2392 /* 2401 /*
2393 * model name 2402 * model name
2394 */ 2403 */
2395 snprintf(model, BFA_ADAPTER_MODEL_NAME_LEN, "%s-%u", 2404 if (ioc->asic_gen == BFI_ASIC_GEN_CT2) {
2396 BFA_MFG_NAME, ioc_attr->card_type); 2405 int np = bfa_ioc_get_nports(ioc);
2406 char c;
2407 switch (ioc_attr->card_type) {
2408 case BFA_MFG_TYPE_PROWLER_F:
2409 case BFA_MFG_TYPE_PROWLER_N:
2410 case BFA_MFG_TYPE_PROWLER_C:
2411 snprintf(model, BFA_ADAPTER_MODEL_NAME_LEN,
2412 "%s-%u-%u",
2413 BFA_MFG_NAME, ioc_attr->card_type, np);
2414 break;
2415 case BFA_MFG_TYPE_PROWLER_D:
2416 if (ioc_attr->ic == BFA_MFG_IC_FC)
2417 c = 'F';
2418 else
2419 c = 'P';
2420
2421 snprintf(model, BFA_ADAPTER_MODEL_NAME_LEN,
2422 "%s-%u-%u%c",
2423 BFA_MFG_NAME, ioc_attr->card_type, np, c);
2424 break;
2425 default:
2426 break;
2427 }
2428 } else
2429 snprintf(model, BFA_ADAPTER_MODEL_NAME_LEN, "%s-%u",
2430 BFA_MFG_NAME, ioc_attr->card_type);
2397} 2431}
2398 2432
2399enum bfa_ioc_state 2433enum bfa_ioc_state
diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h
index 8c9bbdf2648..527e613530e 100644
--- a/drivers/scsi/bfa/bfa_ioc.h
+++ b/drivers/scsi/bfa/bfa_ioc.h
@@ -136,6 +136,7 @@ struct bfa_ioc_regs_s {
136 void __iomem *hfn_mbox; 136 void __iomem *hfn_mbox;
137 void __iomem *lpu_mbox_cmd; 137 void __iomem *lpu_mbox_cmd;
138 void __iomem *lpu_mbox; 138 void __iomem *lpu_mbox;
139 void __iomem *lpu_read_stat;
139 void __iomem *pss_ctl_reg; 140 void __iomem *pss_ctl_reg;
140 void __iomem *pss_err_status_reg; 141 void __iomem *pss_err_status_reg;
141 void __iomem *app_pll_fast_ctl_reg; 142 void __iomem *app_pll_fast_ctl_reg;
@@ -277,6 +278,7 @@ struct bfa_ioc_hwif_s {
277 void (*ioc_sync_leave) (struct bfa_ioc_s *ioc); 278 void (*ioc_sync_leave) (struct bfa_ioc_s *ioc);
278 void (*ioc_sync_ack) (struct bfa_ioc_s *ioc); 279 void (*ioc_sync_ack) (struct bfa_ioc_s *ioc);
279 bfa_boolean_t (*ioc_sync_complete) (struct bfa_ioc_s *ioc); 280 bfa_boolean_t (*ioc_sync_complete) (struct bfa_ioc_s *ioc);
281 bfa_boolean_t (*ioc_lpu_read_stat) (struct bfa_ioc_s *ioc);
280}; 282};
281 283
282#define bfa_ioc_pcifn(__ioc) ((__ioc)->pcidev.pci_func) 284#define bfa_ioc_pcifn(__ioc) ((__ioc)->pcidev.pci_func)
@@ -338,7 +340,10 @@ bfa_status_t bfa_ioc_ct2_pll_init(void __iomem *rb, enum bfi_asic_mode mode);
338} while (0) 340} while (0)
339#define bfa_ioc_ownership_reset(__ioc) \ 341#define bfa_ioc_ownership_reset(__ioc) \
340 ((__ioc)->ioc_hwif->ioc_ownership_reset(__ioc)) 342 ((__ioc)->ioc_hwif->ioc_ownership_reset(__ioc))
341 343#define bfa_ioc_lpu_read_stat(__ioc) do { \
344 if ((__ioc)->ioc_hwif->ioc_lpu_read_stat) \
345 ((__ioc)->ioc_hwif->ioc_lpu_read_stat(__ioc)); \
346} while (0)
342 347
343void bfa_ioc_set_cb_hwif(struct bfa_ioc_s *ioc); 348void bfa_ioc_set_cb_hwif(struct bfa_ioc_s *ioc);
344void bfa_ioc_set_ct_hwif(struct bfa_ioc_s *ioc); 349void bfa_ioc_set_ct_hwif(struct bfa_ioc_s *ioc);
diff --git a/drivers/scsi/bfa/bfa_ioc_ct.c b/drivers/scsi/bfa/bfa_ioc_ct.c
index 6710a801660..5b5579401d4 100644
--- a/drivers/scsi/bfa/bfa_ioc_ct.c
+++ b/drivers/scsi/bfa/bfa_ioc_ct.c
@@ -192,11 +192,14 @@ static struct { u32 hfn, lpu; } ct_p1reg[] = {
192 { HOSTFN3_LPU1_CMD_STAT, LPU1_HOSTFN3_CMD_STAT } 192 { HOSTFN3_LPU1_CMD_STAT, LPU1_HOSTFN3_CMD_STAT }
193}; 193};
194 194
195static struct { uint32_t hfn_mbox, lpu_mbox, hfn_pgn, hfn, lpu; } ct2_reg[] = { 195static struct { uint32_t hfn_mbox, lpu_mbox, hfn_pgn, hfn, lpu, lpu_read; }
196 ct2_reg[] = {
196 { CT2_HOSTFN_LPU0_MBOX0, CT2_LPU0_HOSTFN_MBOX0, CT2_HOSTFN_PAGE_NUM, 197 { CT2_HOSTFN_LPU0_MBOX0, CT2_LPU0_HOSTFN_MBOX0, CT2_HOSTFN_PAGE_NUM,
197 CT2_HOSTFN_LPU0_CMD_STAT, CT2_LPU0_HOSTFN_CMD_STAT }, 198 CT2_HOSTFN_LPU0_CMD_STAT, CT2_LPU0_HOSTFN_CMD_STAT,
199 CT2_HOSTFN_LPU0_READ_STAT},
198 { CT2_HOSTFN_LPU1_MBOX0, CT2_LPU1_HOSTFN_MBOX0, CT2_HOSTFN_PAGE_NUM, 200 { CT2_HOSTFN_LPU1_MBOX0, CT2_LPU1_HOSTFN_MBOX0, CT2_HOSTFN_PAGE_NUM,
199 CT2_HOSTFN_LPU1_CMD_STAT, CT2_LPU1_HOSTFN_CMD_STAT }, 201 CT2_HOSTFN_LPU1_CMD_STAT, CT2_LPU1_HOSTFN_CMD_STAT,
202 CT2_HOSTFN_LPU1_READ_STAT},
200}; 203};
201 204
202static void 205static void
@@ -271,6 +274,7 @@ bfa_ioc_ct2_reg_init(struct bfa_ioc_s *ioc)
271 ioc->ioc_regs.host_page_num_fn = rb + ct2_reg[port].hfn_pgn; 274 ioc->ioc_regs.host_page_num_fn = rb + ct2_reg[port].hfn_pgn;
272 ioc->ioc_regs.hfn_mbox_cmd = rb + ct2_reg[port].hfn; 275 ioc->ioc_regs.hfn_mbox_cmd = rb + ct2_reg[port].hfn;
273 ioc->ioc_regs.lpu_mbox_cmd = rb + ct2_reg[port].lpu; 276 ioc->ioc_regs.lpu_mbox_cmd = rb + ct2_reg[port].lpu;
277 ioc->ioc_regs.lpu_read_stat = rb + ct2_reg[port].lpu_read;
274 278
275 if (port == 0) { 279 if (port == 0) {
276 ioc->ioc_regs.heartbeat = rb + CT2_BFA_IOC0_HBEAT_REG; 280 ioc->ioc_regs.heartbeat = rb + CT2_BFA_IOC0_HBEAT_REG;
@@ -379,6 +383,20 @@ bfa_ioc_ct_isr_mode_set(struct bfa_ioc_s *ioc, bfa_boolean_t msix)
379 writel(r32, rb + FNC_PERS_REG); 383 writel(r32, rb + FNC_PERS_REG);
380} 384}
381 385
386bfa_boolean_t
387bfa_ioc_ct2_lpu_read_stat(struct bfa_ioc_s *ioc)
388{
389 u32 r32;
390
391 r32 = readl(ioc->ioc_regs.lpu_read_stat);
392 if (r32) {
393 writel(1, ioc->ioc_regs.lpu_read_stat);
394 return BFA_TRUE;
395 }
396
397 return BFA_FALSE;
398}
399
382/* 400/*
383 * Cleanup hw semaphore and usecnt registers 401 * Cleanup hw semaphore and usecnt registers
384 */ 402 */
@@ -540,6 +558,7 @@ bfa_ioc_set_ct2_hwif(struct bfa_ioc_s *ioc)
540 hwif_ct2.ioc_pll_init = bfa_ioc_ct2_pll_init; 558 hwif_ct2.ioc_pll_init = bfa_ioc_ct2_pll_init;
541 hwif_ct2.ioc_reg_init = bfa_ioc_ct2_reg_init; 559 hwif_ct2.ioc_reg_init = bfa_ioc_ct2_reg_init;
542 hwif_ct2.ioc_map_port = bfa_ioc_ct2_map_port; 560 hwif_ct2.ioc_map_port = bfa_ioc_ct2_map_port;
561 hwif_ct2.ioc_lpu_read_stat = bfa_ioc_ct2_lpu_read_stat;
543 hwif_ct2.ioc_isr_mode_set = NULL; 562 hwif_ct2.ioc_isr_mode_set = NULL;
544 ioc->ioc_hwif = &hwif_ct2; 563 ioc->ioc_hwif = &hwif_ct2;
545} 564}
@@ -791,15 +810,26 @@ bfa_ioc_ct2_mem_init(void __iomem *rb, enum bfi_asic_mode mode)
791bfa_status_t 810bfa_status_t
792bfa_ioc_ct2_pll_init(void __iomem *rb, enum bfi_asic_mode mode) 811bfa_ioc_ct2_pll_init(void __iomem *rb, enum bfi_asic_mode mode)
793{ 812{
813 u32 r32;
814
815 /*
816 * Initialize PLL if not already done by NFC
817 */
818 r32 = readl((rb + CT2_WGN_STATUS));
819
820 writel(__HALT_NFC_CONTROLLER, (rb + CT2_NFC_CSR_SET_REG));
821
794 bfa_ioc_ct2_sclk_init(rb, mode); 822 bfa_ioc_ct2_sclk_init(rb, mode);
795 bfa_ioc_ct2_lclk_init(rb, mode); 823 bfa_ioc_ct2_lclk_init(rb, mode);
796 bfa_ioc_ct2_mem_init(rb, mode); 824 bfa_ioc_ct2_mem_init(rb, mode);
797 825
798 /* 826 /*
799 * Disable flash presence to NFC by clearing GPIO 0 827 * Announce flash device presence, if flash was corrupted.
800 */ 828 */
801 writel(0, (rb + PSS_GPIO_OUT_REG)); 829 if (r32 == (__WGN_READY | __GLBL_PF_VF_CFG_RDY)) {
802 writel(1, (rb + PSS_GPIO_OE_REG)); 830 writel(0, (rb + PSS_GPIO_OUT_REG));
831 writel(1, (rb + PSS_GPIO_OE_REG));
832 }
803 833
804 writel(BFI_IOC_UNINIT, (rb + CT2_BFA_IOC0_STATE_REG)); 834 writel(BFI_IOC_UNINIT, (rb + CT2_BFA_IOC0_STATE_REG));
805 writel(BFI_IOC_UNINIT, (rb + CT2_BFA_IOC1_STATE_REG)); 835 writel(BFI_IOC_UNINIT, (rb + CT2_BFA_IOC1_STATE_REG));
diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index 8ddae0d85fa..57cc50eacb0 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -1348,8 +1348,7 @@ bfad_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid)
1348 int error = -ENODEV, retval; 1348 int error = -ENODEV, retval;
1349 1349
1350 /* For single port cards - only claim function 0 */ 1350 /* For single port cards - only claim function 0 */
1351 if ((pdev->device == BFA_PCI_DEVICE_ID_FC_8G1P || 1351 if ((pdev->device == BFA_PCI_DEVICE_ID_FC_8G1P) &&
1352 pdev->device == BFA_PCI_DEVICE_ID_CT2) &&
1353 (PCI_FUNC(pdev->devfn) != 0)) 1352 (PCI_FUNC(pdev->devfn) != 0))
1354 return -ENODEV; 1353 return -ENODEV;
1355 1354
diff --git a/drivers/scsi/bfa/bfad_attr.c b/drivers/scsi/bfa/bfad_attr.c
index a94ea423543..3127df2951e 100644
--- a/drivers/scsi/bfa/bfad_attr.c
+++ b/drivers/scsi/bfa/bfad_attr.c
@@ -218,6 +218,9 @@ bfad_im_get_host_speed(struct Scsi_Host *shost)
218 case BFA_PORT_SPEED_10GBPS: 218 case BFA_PORT_SPEED_10GBPS:
219 fc_host_speed(shost) = FC_PORTSPEED_10GBIT; 219 fc_host_speed(shost) = FC_PORTSPEED_10GBIT;
220 break; 220 break;
221 case BFA_PORT_SPEED_16GBPS:
222 fc_host_speed(shost) = FC_PORTSPEED_16GBIT;
223 break;
221 case BFA_PORT_SPEED_8GBPS: 224 case BFA_PORT_SPEED_8GBPS:
222 fc_host_speed(shost) = FC_PORTSPEED_8GBIT; 225 fc_host_speed(shost) = FC_PORTSPEED_8GBIT;
223 break; 226 break;
diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c
index d6d89fbfa65..451ff556625 100644
--- a/drivers/scsi/bfa/bfad_im.c
+++ b/drivers/scsi/bfa/bfad_im.c
@@ -925,7 +925,10 @@ bfad_im_supported_speeds(struct bfa_s *bfa)
925 return 0; 925 return 0;
926 926
927 bfa_ioc_get_attr(&bfa->ioc, ioc_attr); 927 bfa_ioc_get_attr(&bfa->ioc, ioc_attr);
928 if (ioc_attr->adapter_attr.max_speed == BFA_PORT_SPEED_8GBPS) { 928 if (ioc_attr->adapter_attr.max_speed == BFA_PORT_SPEED_16GBPS)
929 supported_speed |= FC_PORTSPEED_16GBIT | FC_PORTSPEED_8GBIT |
930 FC_PORTSPEED_4GBIT | FC_PORTSPEED_2GBIT;
931 else if (ioc_attr->adapter_attr.max_speed == BFA_PORT_SPEED_8GBPS) {
929 if (ioc_attr->adapter_attr.is_mezz) { 932 if (ioc_attr->adapter_attr.is_mezz) {
930 supported_speed |= FC_PORTSPEED_8GBIT | 933 supported_speed |= FC_PORTSPEED_8GBIT |
931 FC_PORTSPEED_4GBIT | 934 FC_PORTSPEED_4GBIT |
diff --git a/drivers/scsi/bfa/bfi.h b/drivers/scsi/bfa/bfi.h
index e6383f23e06..35af1d11ab2 100644
--- a/drivers/scsi/bfa/bfi.h
+++ b/drivers/scsi/bfa/bfi.h
@@ -251,7 +251,7 @@ struct bfi_ioc_attr_s {
251 u32 adapter_prop; /* adapter properties */ 251 u32 adapter_prop; /* adapter properties */
252 u16 maxfrsize; /* max receive frame size */ 252 u16 maxfrsize; /* max receive frame size */
253 char asic_rev; 253 char asic_rev;
254 u8 rsvd_d; 254 u8 ic; /* initial capability */
255 char fw_version[BFA_VERSION_LEN]; 255 char fw_version[BFA_VERSION_LEN];
256 char optrom_version[BFA_VERSION_LEN]; 256 char optrom_version[BFA_VERSION_LEN];
257 struct bfa_mfg_vpd_s vpd; 257 struct bfa_mfg_vpd_s vpd;
diff --git a/drivers/scsi/bfa/bfi_reg.h b/drivers/scsi/bfa/bfi_reg.h
index de4db72b39e..d20d2b30ed3 100644
--- a/drivers/scsi/bfa/bfi_reg.h
+++ b/drivers/scsi/bfa/bfi_reg.h
@@ -275,6 +275,8 @@ enum {
275#define CT2_HOSTFN_LPU1_CMD_STAT (CT2_PCI_CPQ_BASE + 0x84) 275#define CT2_HOSTFN_LPU1_CMD_STAT (CT2_PCI_CPQ_BASE + 0x84)
276#define CT2_LPU0_HOSTFN_CMD_STAT (CT2_PCI_CPQ_BASE + 0x88) 276#define CT2_LPU0_HOSTFN_CMD_STAT (CT2_PCI_CPQ_BASE + 0x88)
277#define CT2_LPU1_HOSTFN_CMD_STAT (CT2_PCI_CPQ_BASE + 0x8c) 277#define CT2_LPU1_HOSTFN_CMD_STAT (CT2_PCI_CPQ_BASE + 0x8c)
278#define CT2_HOSTFN_LPU0_READ_STAT (CT2_PCI_CPQ_BASE + 0x90)
279#define CT2_HOSTFN_LPU1_READ_STAT (CT2_PCI_CPQ_BASE + 0x94)
278#define CT2_HOST_SEM0_REG 0x000148f0 280#define CT2_HOST_SEM0_REG 0x000148f0
279#define CT2_HOST_SEM1_REG 0x000148f4 281#define CT2_HOST_SEM1_REG 0x000148f4
280#define CT2_HOST_SEM2_REG 0x000148f8 282#define CT2_HOST_SEM2_REG 0x000148f8
@@ -330,6 +332,11 @@ enum {
330#define CT2_PMM_1T_CONTROL_REG_P0 0x0002381c 332#define CT2_PMM_1T_CONTROL_REG_P0 0x0002381c
331#define __PMM_1T_PNDB_P 0x00000002 333#define __PMM_1T_PNDB_P 0x00000002
332#define CT2_PMM_1T_CONTROL_REG_P1 0x00023c1c 334#define CT2_PMM_1T_CONTROL_REG_P1 0x00023c1c
335#define CT2_WGN_STATUS 0x00014990
336#define __WGN_READY 0x00000400
337#define __GLBL_PF_VF_CFG_RDY 0x00000200
338#define CT2_NFC_CSR_SET_REG 0x00027424
339#define __HALT_NFC_CONTROLLER 0x00000002
333 340
334/* 341/*
335 * Name semaphore registers based on usage 342 * Name semaphore registers based on usage