aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVikas Chaudhary <vikas.chaudhary@qlogic.com>2012-08-22 07:55:03 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-09-24 04:11:07 -0400
commitc38fa3abea1df01c5692e8b5aa16dd0c66497419 (patch)
treece8510b0592213c7870dd80c0d653c0f006041ca
parentde8c72daa027dd71b4c7ac7db4324e9471c52429 (diff)
[SCSI] qla4xxx: Clean-up and optimize macros
Remove following unused define:- QLA82XX_MINIDUMP_OCM0_SIZE QLA82XX_MINIDUMP_L1C_SIZE QLA82XX_MINIDUMP_L2C_SIZE QLA82XX_MINIDUMP_COMMON_STR_SIZE QLA82XX_MINIDUMP_FCOE_STR_SIZE QLA82XX_MINIDUMP_MEM_SIZE QLA82XX_MAX_ENTRY_HDR Added following new define to optimize code:- MIU_TA_CTL_WRITE_ENABLE MIU_TA_CTL_WRITE_START MIU_TA_CTL_START_ENABLE Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--drivers/scsi/qla4xxx/ql4_nx.c12
-rw-r--r--drivers/scsi/qla4xxx/ql4_nx.h29
2 files changed, 14 insertions, 27 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
index e4801845b769..84b039f9e9b5 100644
--- a/drivers/scsi/qla4xxx/ql4_nx.c
+++ b/drivers/scsi/qla4xxx/ql4_nx.c
@@ -562,10 +562,6 @@ qla4_82xx_pci_get_crb_addr_2M(struct scsi_qla_host *ha, ulong *off)
562 return 1; 562 return 1;
563} 563}
564 564
565/* PCI Windowing for DDR regions. */
566#define QLA8XXX_ADDR_IN_RANGE(addr, low, high) \
567 (((addr) <= (high)) && ((addr) >= (low)))
568
569/* 565/*
570* check memory access boundary. 566* check memory access boundary.
571* used by test agent. support ddr access only for now 567* used by test agent. support ddr access only for now
@@ -1276,7 +1272,7 @@ qla4_82xx_pci_mem_read_2M(struct scsi_qla_host *ha,
1276 qla4_82xx_wr_32(ha, mem_crb + MIU_TEST_AGT_ADDR_HI, temp); 1272 qla4_82xx_wr_32(ha, mem_crb + MIU_TEST_AGT_ADDR_HI, temp);
1277 temp = MIU_TA_CTL_ENABLE; 1273 temp = MIU_TA_CTL_ENABLE;
1278 qla4_82xx_wr_32(ha, mem_crb + MIU_TEST_AGT_CTRL, temp); 1274 qla4_82xx_wr_32(ha, mem_crb + MIU_TEST_AGT_CTRL, temp);
1279 temp = MIU_TA_CTL_START | MIU_TA_CTL_ENABLE; 1275 temp = MIU_TA_CTL_START_ENABLE;
1280 qla4_82xx_wr_32(ha, mem_crb + MIU_TEST_AGT_CTRL, temp); 1276 qla4_82xx_wr_32(ha, mem_crb + MIU_TEST_AGT_CTRL, temp);
1281 1277
1282 for (j = 0; j < MAX_CTL_CHECK; j++) { 1278 for (j = 0; j < MAX_CTL_CHECK; j++) {
@@ -1410,9 +1406,9 @@ qla4_82xx_pci_mem_write_2M(struct scsi_qla_host *ha,
1410 qla4_82xx_wr_32(ha, mem_crb + MIU_TEST_AGT_WRDATA_UPPER_HI, 1406 qla4_82xx_wr_32(ha, mem_crb + MIU_TEST_AGT_WRDATA_UPPER_HI,
1411 temp); 1407 temp);
1412 1408
1413 temp = MIU_TA_CTL_ENABLE | MIU_TA_CTL_WRITE; 1409 temp = MIU_TA_CTL_WRITE_ENABLE;
1414 qla4_82xx_wr_32(ha, mem_crb+MIU_TEST_AGT_CTRL, temp); 1410 qla4_82xx_wr_32(ha, mem_crb+MIU_TEST_AGT_CTRL, temp);
1415 temp = MIU_TA_CTL_START | MIU_TA_CTL_ENABLE | MIU_TA_CTL_WRITE; 1411 temp = MIU_TA_CTL_WRITE_START;
1416 qla4_82xx_wr_32(ha, mem_crb+MIU_TEST_AGT_CTRL, temp); 1412 qla4_82xx_wr_32(ha, mem_crb+MIU_TEST_AGT_CTRL, temp);
1417 1413
1418 for (j = 0; j < MAX_CTL_CHECK; j++) { 1414 for (j = 0; j < MAX_CTL_CHECK; j++) {
@@ -2041,7 +2037,7 @@ static int qla4_8xxx_minidump_process_rdmem(struct scsi_qla_host *ha,
2041 qla4_8xxx_md_rw_32(ha, MD_MIU_TEST_AGT_ADDR_HI, r_value, 1); 2037 qla4_8xxx_md_rw_32(ha, MD_MIU_TEST_AGT_ADDR_HI, r_value, 1);
2042 r_value = MIU_TA_CTL_ENABLE; 2038 r_value = MIU_TA_CTL_ENABLE;
2043 qla4_8xxx_md_rw_32(ha, MD_MIU_TEST_AGT_CTRL, r_value, 1); 2039 qla4_8xxx_md_rw_32(ha, MD_MIU_TEST_AGT_CTRL, r_value, 1);
2044 r_value = MIU_TA_CTL_START | MIU_TA_CTL_ENABLE; 2040 r_value = MIU_TA_CTL_START_ENABLE;
2045 qla4_8xxx_md_rw_32(ha, MD_MIU_TEST_AGT_CTRL, r_value, 1); 2041 qla4_8xxx_md_rw_32(ha, MD_MIU_TEST_AGT_CTRL, r_value, 1);
2046 2042
2047 for (j = 0; j < MAX_CTL_CHECK; j++) { 2043 for (j = 0; j < MAX_CTL_CHECK; j++) {
diff --git a/drivers/scsi/qla4xxx/ql4_nx.h b/drivers/scsi/qla4xxx/ql4_nx.h
index 1936c8168332..16c5ae6d271a 100644
--- a/drivers/scsi/qla4xxx/ql4_nx.h
+++ b/drivers/scsi/qla4xxx/ql4_nx.h
@@ -517,6 +517,10 @@ enum {
517#define QLA82XX_PCI_QDR_NET (unsigned long)0x04000000 517#define QLA82XX_PCI_QDR_NET (unsigned long)0x04000000
518#define QLA82XX_PCI_QDR_NET_MAX (unsigned long)0x043fffff 518#define QLA82XX_PCI_QDR_NET_MAX (unsigned long)0x043fffff
519 519
520/* PCI Windowing for DDR regions. */
521#define QLA8XXX_ADDR_IN_RANGE(addr, low, high) \
522 (((addr) <= (high)) && ((addr) >= (low)))
523
520/* 524/*
521 * Register offsets for MN 525 * Register offsets for MN
522 */ 526 */
@@ -540,6 +544,11 @@ enum {
540#define MIU_TA_CTL_WRITE 4 544#define MIU_TA_CTL_WRITE 4
541#define MIU_TA_CTL_BUSY 8 545#define MIU_TA_CTL_BUSY 8
542 546
547#define MIU_TA_CTL_WRITE_ENABLE (MIU_TA_CTL_WRITE | MIU_TA_CTL_ENABLE)
548#define MIU_TA_CTL_WRITE_START (MIU_TA_CTL_WRITE | MIU_TA_CTL_ENABLE |\
549 MIU_TA_CTL_START)
550#define MIU_TA_CTL_START_ENABLE (MIU_TA_CTL_START | MIU_TA_CTL_ENABLE)
551
543/*CAM RAM */ 552/*CAM RAM */
544# define QLA82XX_CAM_RAM_BASE (QLA82XX_CRB_CAM + 0x02000) 553# define QLA82XX_CAM_RAM_BASE (QLA82XX_CRB_CAM + 0x02000)
545# define QLA82XX_CAM_RAM(reg) (QLA82XX_CAM_RAM_BASE + (reg)) 554# define QLA82XX_CAM_RAM(reg) (QLA82XX_CAM_RAM_BASE + (reg))
@@ -565,11 +574,10 @@ enum {
565/* Driver Coexistence Defines */ 574/* Driver Coexistence Defines */
566#define QLA82XX_CRB_DRV_ACTIVE (QLA82XX_CAM_RAM(0x138)) 575#define QLA82XX_CRB_DRV_ACTIVE (QLA82XX_CAM_RAM(0x138))
567#define QLA82XX_CRB_DEV_STATE (QLA82XX_CAM_RAM(0x140)) 576#define QLA82XX_CRB_DEV_STATE (QLA82XX_CAM_RAM(0x140))
568#define QLA82XX_CRB_DEV_PART_INFO (QLA82XX_CAM_RAM(0x14c))
569#define QLA82XX_CRB_DRV_IDC_VERSION (QLA82XX_CAM_RAM(0x174))
570#define QLA82XX_CRB_DRV_STATE (QLA82XX_CAM_RAM(0x144)) 577#define QLA82XX_CRB_DRV_STATE (QLA82XX_CAM_RAM(0x144))
571#define QLA82XX_CRB_DRV_SCRATCH (QLA82XX_CAM_RAM(0x148)) 578#define QLA82XX_CRB_DRV_SCRATCH (QLA82XX_CAM_RAM(0x148))
572#define QLA82XX_CRB_DEV_PART_INFO (QLA82XX_CAM_RAM(0x14c)) 579#define QLA82XX_CRB_DEV_PART_INFO (QLA82XX_CAM_RAM(0x14c))
580#define QLA82XX_CRB_DRV_IDC_VERSION (QLA82XX_CAM_RAM(0x174))
573 581
574/* Every driver should use these Device State */ 582/* Every driver should use these Device State */
575#define QLA8XXX_DEV_COLD 1 583#define QLA8XXX_DEV_COLD 1
@@ -956,23 +964,6 @@ struct qla8xxx_minidump_entry_queue {
956 } rd_strd; 964 } rd_strd;
957}; 965};
958 966
959#define QLA82XX_MINIDUMP_OCM0_SIZE (256 * 1024)
960#define QLA82XX_MINIDUMP_L1C_SIZE (256 * 1024)
961#define QLA82XX_MINIDUMP_L2C_SIZE 1572864
962#define QLA82XX_MINIDUMP_COMMON_STR_SIZE 0
963#define QLA82XX_MINIDUMP_FCOE_STR_SIZE 0
964#define QLA82XX_MINIDUMP_MEM_SIZE 0
965#define QLA82XX_MAX_ENTRY_HDR 4
966
967struct qla82xx_minidump {
968 uint32_t md_ocm0_data[QLA82XX_MINIDUMP_OCM0_SIZE];
969 uint32_t md_l1c_data[QLA82XX_MINIDUMP_L1C_SIZE];
970 uint32_t md_l2c_data[QLA82XX_MINIDUMP_L2C_SIZE];
971 uint32_t md_cs_data[QLA82XX_MINIDUMP_COMMON_STR_SIZE];
972 uint32_t md_fcoes_data[QLA82XX_MINIDUMP_FCOE_STR_SIZE];
973 uint32_t md_mem_data[QLA82XX_MINIDUMP_MEM_SIZE];
974};
975
976#define MBC_DIAGNOSTIC_MINIDUMP_TEMPLATE 0x129 967#define MBC_DIAGNOSTIC_MINIDUMP_TEMPLATE 0x129
977#define RQST_TMPLT_SIZE 0x0 968#define RQST_TMPLT_SIZE 0x0
978#define RQST_TMPLT 0x1 969#define RQST_TMPLT 0x1