aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/csiostor/csio_hw.h
diff options
context:
space:
mode:
authorArvind Bhushan <arvindb@chelsio.com>2013-03-14 01:09:08 -0400
committerDavid S. Miller <davem@davemloft.net>2013-03-14 11:36:00 -0400
commit7cc163806b0dc31ea2067d48a2732b452a709f48 (patch)
tree8211ed0286b901937b89fc01b0c3284d36659d93 /drivers/scsi/csiostor/csio_hw.h
parentd69630e8a42220b04318995d8ed0637ea79a717e (diff)
csiostor: Cleanup chip specific operations.
This patch removes chip specific operations from the common hardware paths, as well as the Makefile change to accomodate the new files. Signed-off-by: Arvind Bhushan <arvindb@chelsio.com> Signed-off-by: Naresh Kumar Inna <naresh@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/scsi/csiostor/csio_hw.h')
-rw-r--r--drivers/scsi/csiostor/csio_hw.h47
1 files changed, 18 insertions, 29 deletions
diff --git a/drivers/scsi/csiostor/csio_hw.h b/drivers/scsi/csiostor/csio_hw.h
index 9edcca4c71af..489fc095cb03 100644
--- a/drivers/scsi/csiostor/csio_hw.h
+++ b/drivers/scsi/csiostor/csio_hw.h
@@ -48,6 +48,7 @@
48#include <scsi/scsi_device.h> 48#include <scsi/scsi_device.h>
49#include <scsi/scsi_transport_fc.h> 49#include <scsi/scsi_transport_fc.h>
50 50
51#include "csio_hw_chip.h"
51#include "csio_wr.h" 52#include "csio_wr.h"
52#include "csio_mb.h" 53#include "csio_mb.h"
53#include "csio_scsi.h" 54#include "csio_scsi.h"
@@ -60,13 +61,6 @@
60 */ 61 */
61#define FW_HOSTERROR 255 62#define FW_HOSTERROR 255
62 63
63#define CSIO_FW_FNAME "cxgb4/t4fw.bin"
64#define CSIO_CF_FNAME "cxgb4/t4-config.txt"
65
66#define FW_VERSION_MAJOR 1
67#define FW_VERSION_MINOR 2
68#define FW_VERSION_MICRO 8
69
70#define CSIO_HW_NAME "Chelsio FCoE Adapter" 64#define CSIO_HW_NAME "Chelsio FCoE Adapter"
71#define CSIO_MAX_PFN 8 65#define CSIO_MAX_PFN 8
72#define CSIO_MAX_PPORTS 4 66#define CSIO_MAX_PPORTS 4
@@ -123,8 +117,6 @@ extern int csio_msi;
123#define CSIO_VENDOR_ID 0x1425 117#define CSIO_VENDOR_ID 0x1425
124#define CSIO_ASIC_DEVID_PROTO_MASK 0xFF00 118#define CSIO_ASIC_DEVID_PROTO_MASK 0xFF00
125#define CSIO_ASIC_DEVID_TYPE_MASK 0x00FF 119#define CSIO_ASIC_DEVID_TYPE_MASK 0x00FF
126#define CSIO_FPGA 0xA000
127#define CSIO_T4_FCOE_ASIC 0x4600
128 120
129#define CSIO_GLBL_INTR_MASK (CIM | MPS | PL | PCIE | MC | EDC0 | \ 121#define CSIO_GLBL_INTR_MASK (CIM | MPS | PL | PCIE | MC | EDC0 | \
130 EDC1 | LE | TP | MA | PM_TX | PM_RX | \ 122 EDC1 | LE | TP | MA | PM_TX | PM_RX | \
@@ -207,17 +199,6 @@ enum {
207 SF_SIZE = SF_SEC_SIZE * 16, /* serial flash size */ 199 SF_SIZE = SF_SEC_SIZE * 16, /* serial flash size */
208}; 200};
209 201
210enum { MEM_EDC0, MEM_EDC1, MEM_MC };
211
212enum {
213 MEMWIN0_APERTURE = 2048,
214 MEMWIN0_BASE = 0x1b800,
215 MEMWIN1_APERTURE = 32768,
216 MEMWIN1_BASE = 0x28000,
217 MEMWIN2_APERTURE = 65536,
218 MEMWIN2_BASE = 0x30000,
219};
220
221/* serial flash and firmware constants */ 202/* serial flash and firmware constants */
222enum { 203enum {
223 SF_ATTEMPTS = 10, /* max retries for SF operations */ 204 SF_ATTEMPTS = 10, /* max retries for SF operations */
@@ -239,9 +220,6 @@ enum {
239 FLASH_CFG_MAX_SIZE = 0x10000 , /* max size of the flash config file*/ 220 FLASH_CFG_MAX_SIZE = 0x10000 , /* max size of the flash config file*/
240 FLASH_CFG_OFFSET = 0x1f0000, 221 FLASH_CFG_OFFSET = 0x1f0000,
241 FLASH_CFG_START_SEC = FLASH_CFG_OFFSET / SF_SEC_SIZE, 222 FLASH_CFG_START_SEC = FLASH_CFG_OFFSET / SF_SEC_SIZE,
242 FPGA_FLASH_CFG_OFFSET = 0xf0000 , /* if FPGA mode, then cfg file is
243 * at 1MB - 64KB */
244 FPGA_FLASH_CFG_START_SEC = FPGA_FLASH_CFG_OFFSET / SF_SEC_SIZE,
245}; 223};
246 224
247/* 225/*
@@ -259,6 +237,8 @@ enum {
259 FLASH_FW_START = FLASH_START(FLASH_FW_START_SEC), 237 FLASH_FW_START = FLASH_START(FLASH_FW_START_SEC),
260 FLASH_FW_MAX_SIZE = FLASH_MAX_SIZE(FLASH_FW_NSECS), 238 FLASH_FW_MAX_SIZE = FLASH_MAX_SIZE(FLASH_FW_NSECS),
261 239
240 /* Location of Firmware Configuration File in FLASH. */
241 FLASH_CFG_START = FLASH_START(FLASH_CFG_START_SEC),
262}; 242};
263 243
264#undef FLASH_START 244#undef FLASH_START
@@ -310,7 +290,7 @@ struct csio_adap_desc {
310struct pci_params { 290struct pci_params {
311 uint16_t vendor_id; 291 uint16_t vendor_id;
312 uint16_t device_id; 292 uint16_t device_id;
313 uint32_t vpd_cap_addr; 293 int vpd_cap_addr;
314 uint16_t speed; 294 uint16_t speed;
315 uint8_t width; 295 uint8_t width;
316}; 296};
@@ -513,6 +493,7 @@ struct csio_hw {
513 uint32_t fwrev; 493 uint32_t fwrev;
514 uint32_t tp_vers; 494 uint32_t tp_vers;
515 char chip_ver; 495 char chip_ver;
496 uint16_t chip_id; /* Tells T4/T5 chip */
516 uint32_t cfg_finiver; 497 uint32_t cfg_finiver;
517 uint32_t cfg_finicsum; 498 uint32_t cfg_finicsum;
518 uint32_t cfg_cfcsum; 499 uint32_t cfg_cfcsum;
@@ -556,6 +537,9 @@ struct csio_hw {
556 */ 537 */
557 538
558 struct csio_fcoe_res_info fres_info; /* Fcoe resource info */ 539 struct csio_fcoe_res_info fres_info; /* Fcoe resource info */
540 struct csio_hw_chip_ops *chip_ops; /* T4/T5 Chip specific
541 * Operations
542 */
559 543
560 /* MSIX vectors */ 544 /* MSIX vectors */
561 struct csio_msix_entries msix_entries[CSIO_MAX_MSIX_VECS]; 545 struct csio_msix_entries msix_entries[CSIO_MAX_MSIX_VECS];
@@ -636,9 +620,16 @@ csio_us_to_core_ticks(struct csio_hw *hw, uint32_t us)
636#define csio_dbg(__hw, __fmt, ...) 620#define csio_dbg(__hw, __fmt, ...)
637#endif 621#endif
638 622
623int csio_hw_wait_op_done_val(struct csio_hw *, int, uint32_t, int,
624 int, int, uint32_t *);
625void csio_hw_tp_wr_bits_indirect(struct csio_hw *, unsigned int,
626 unsigned int, unsigned int);
639int csio_mgmt_req_lookup(struct csio_mgmtm *, struct csio_ioreq *); 627int csio_mgmt_req_lookup(struct csio_mgmtm *, struct csio_ioreq *);
640void csio_hw_intr_disable(struct csio_hw *); 628void csio_hw_intr_disable(struct csio_hw *);
641int csio_hw_slow_intr_handler(struct csio_hw *hw); 629int csio_hw_slow_intr_handler(struct csio_hw *);
630int csio_handle_intr_status(struct csio_hw *, unsigned int,
631 const struct intr_info *);
632
642int csio_hw_start(struct csio_hw *); 633int csio_hw_start(struct csio_hw *);
643int csio_hw_stop(struct csio_hw *); 634int csio_hw_stop(struct csio_hw *);
644int csio_hw_reset(struct csio_hw *); 635int csio_hw_reset(struct csio_hw *);
@@ -647,19 +638,17 @@ int csio_is_hw_removing(struct csio_hw *);
647 638
648int csio_fwevtq_handler(struct csio_hw *); 639int csio_fwevtq_handler(struct csio_hw *);
649void csio_evtq_worker(struct work_struct *); 640void csio_evtq_worker(struct work_struct *);
650int csio_enqueue_evt(struct csio_hw *hw, enum csio_evt type, 641int csio_enqueue_evt(struct csio_hw *, enum csio_evt, void *, uint16_t);
651 void *evt_msg, uint16_t len);
652void csio_evtq_flush(struct csio_hw *hw); 642void csio_evtq_flush(struct csio_hw *hw);
653 643
654int csio_request_irqs(struct csio_hw *); 644int csio_request_irqs(struct csio_hw *);
655void csio_intr_enable(struct csio_hw *); 645void csio_intr_enable(struct csio_hw *);
656void csio_intr_disable(struct csio_hw *, bool); 646void csio_intr_disable(struct csio_hw *, bool);
647void csio_hw_fatal_err(struct csio_hw *);
657 648
658struct csio_lnode *csio_lnode_alloc(struct csio_hw *); 649struct csio_lnode *csio_lnode_alloc(struct csio_hw *);
659int csio_config_queues(struct csio_hw *); 650int csio_config_queues(struct csio_hw *);
660 651
661int csio_hw_mc_read(struct csio_hw *, uint32_t, __be32 *, uint64_t *);
662int csio_hw_edc_read(struct csio_hw *, int, uint32_t, __be32 *, uint64_t *);
663int csio_hw_init(struct csio_hw *); 652int csio_hw_init(struct csio_hw *);
664void csio_hw_exit(struct csio_hw *); 653void csio_hw_exit(struct csio_hw *);
665#endif /* ifndef __CSIO_HW_H__ */ 654#endif /* ifndef __CSIO_HW_H__ */