aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hptiop.h
diff options
context:
space:
mode:
authorHighPoint Linux Team <linux@highpoint-tech.com>2012-10-24 20:41:52 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-11-26 23:59:43 -0500
commit286aa031664ba5223bcb3dfd49a9e2d89d6b3aec (patch)
tree3d1adf4d0440dffb1dda053a10b9c45b0fd8c5bb /drivers/scsi/hptiop.h
parentb83908ce845311061eaabf2d8dc9b182907dbc5f (diff)
[SCSI] hptiop: Support HighPoint RR4520/RR4522 HBA
Support IOP RR4520/RR4522 which are based on Marvell frey. Signed-off-by: HighPoint Linux Team <linux@highpoint-tech.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/hptiop.h')
-rw-r--r--drivers/scsi/hptiop.h72
1 files changed, 71 insertions, 1 deletions
diff --git a/drivers/scsi/hptiop.h b/drivers/scsi/hptiop.h
index baa648d87fde..020619d60b08 100644
--- a/drivers/scsi/hptiop.h
+++ b/drivers/scsi/hptiop.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * HighPoint RR3xxx/4xxx controller driver for Linux 2 * HighPoint RR3xxx/4xxx controller driver for Linux
3 * Copyright (C) 2006-2009 HighPoint Technologies, Inc. All Rights Reserved. 3 * Copyright (C) 2006-2012 HighPoint Technologies, Inc. All Rights Reserved.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify 5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
@@ -75,6 +75,45 @@ struct hpt_iopmv_regs {
75 __le32 outbound_intmask; 75 __le32 outbound_intmask;
76}; 76};
77 77
78#pragma pack(1)
79struct hpt_iopmu_mvfrey {
80 __le32 reserved0[(0x4000 - 0) / 4];
81 __le32 inbound_base;
82 __le32 inbound_base_high;
83 __le32 reserved1[(0x4018 - 0x4008) / 4];
84 __le32 inbound_write_ptr;
85 __le32 reserved2[(0x402c - 0x401c) / 4];
86 __le32 inbound_conf_ctl;
87 __le32 reserved3[(0x4050 - 0x4030) / 4];
88 __le32 outbound_base;
89 __le32 outbound_base_high;
90 __le32 outbound_shadow_base;
91 __le32 outbound_shadow_base_high;
92 __le32 reserved4[(0x4088 - 0x4060) / 4];
93 __le32 isr_cause;
94 __le32 isr_enable;
95 __le32 reserved5[(0x1020c - 0x4090) / 4];
96 __le32 pcie_f0_int_enable;
97 __le32 reserved6[(0x10400 - 0x10210) / 4];
98 __le32 f0_to_cpu_msg_a;
99 __le32 reserved7[(0x10420 - 0x10404) / 4];
100 __le32 cpu_to_f0_msg_a;
101 __le32 reserved8[(0x10480 - 0x10424) / 4];
102 __le32 f0_doorbell;
103 __le32 f0_doorbell_enable;
104};
105
106struct mvfrey_inlist_entry {
107 dma_addr_t addr;
108 __le32 intrfc_len;
109 __le32 reserved;
110};
111
112struct mvfrey_outlist_entry {
113 __le32 val;
114};
115#pragma pack()
116
78#define MVIOP_MU_QUEUE_ADDR_HOST_MASK (~(0x1full)) 117#define MVIOP_MU_QUEUE_ADDR_HOST_MASK (~(0x1full))
79#define MVIOP_MU_QUEUE_ADDR_HOST_BIT 4 118#define MVIOP_MU_QUEUE_ADDR_HOST_BIT 4
80 119
@@ -87,6 +126,9 @@ struct hpt_iopmv_regs {
87#define MVIOP_MU_OUTBOUND_INT_MSG 1 126#define MVIOP_MU_OUTBOUND_INT_MSG 1
88#define MVIOP_MU_OUTBOUND_INT_POSTQUEUE 2 127#define MVIOP_MU_OUTBOUND_INT_POSTQUEUE 2
89 128
129#define CL_POINTER_TOGGLE 0x00004000
130#define CPU_TO_F0_DRBL_MSG_BIT 0x02000000
131
90enum hpt_iopmu_message { 132enum hpt_iopmu_message {
91 /* host-to-iop messages */ 133 /* host-to-iop messages */
92 IOPMU_INBOUND_MSG0_NOP = 0, 134 IOPMU_INBOUND_MSG0_NOP = 0,
@@ -95,6 +137,7 @@ enum hpt_iopmu_message {
95 IOPMU_INBOUND_MSG0_SHUTDOWN, 137 IOPMU_INBOUND_MSG0_SHUTDOWN,
96 IOPMU_INBOUND_MSG0_STOP_BACKGROUND_TASK, 138 IOPMU_INBOUND_MSG0_STOP_BACKGROUND_TASK,
97 IOPMU_INBOUND_MSG0_START_BACKGROUND_TASK, 139 IOPMU_INBOUND_MSG0_START_BACKGROUND_TASK,
140 IOPMU_INBOUND_MSG0_RESET_COMM,
98 IOPMU_INBOUND_MSG0_MAX = 0xff, 141 IOPMU_INBOUND_MSG0_MAX = 0xff,
99 /* iop-to-host messages */ 142 /* iop-to-host messages */
100 IOPMU_OUTBOUND_MSG0_REGISTER_DEVICE_0 = 0x100, 143 IOPMU_OUTBOUND_MSG0_REGISTER_DEVICE_0 = 0x100,
@@ -118,6 +161,7 @@ struct hpt_iop_request_header {
118#define IOP_REQUEST_FLAG_BIST_REQUEST 2 161#define IOP_REQUEST_FLAG_BIST_REQUEST 2
119#define IOP_REQUEST_FLAG_REMAPPED 4 162#define IOP_REQUEST_FLAG_REMAPPED 4
120#define IOP_REQUEST_FLAG_OUTPUT_CONTEXT 8 163#define IOP_REQUEST_FLAG_OUTPUT_CONTEXT 8
164#define IOP_REQUEST_FLAG_ADDR_BITS 0x40 /* flags[31:16] is phy_addr[47:32] */
121 165
122enum hpt_iop_request_type { 166enum hpt_iop_request_type {
123 IOP_REQUEST_TYPE_GET_CONFIG = 0, 167 IOP_REQUEST_TYPE_GET_CONFIG = 0,
@@ -223,6 +267,13 @@ struct hpt_scsi_pointer {
223 267
224#define HPT_SCP(scp) ((struct hpt_scsi_pointer *)&(scp)->SCp) 268#define HPT_SCP(scp) ((struct hpt_scsi_pointer *)&(scp)->SCp)
225 269
270enum hptiop_family {
271 UNKNOWN_BASED_IOP,
272 INTEL_BASED_IOP,
273 MV_BASED_IOP,
274 MVFREY_BASED_IOP
275} ;
276
226struct hptiop_hba { 277struct hptiop_hba {
227 struct hptiop_adapter_ops *ops; 278 struct hptiop_adapter_ops *ops;
228 union { 279 union {
@@ -236,6 +287,22 @@ struct hptiop_hba {
236 void *internal_req; 287 void *internal_req;
237 dma_addr_t internal_req_phy; 288 dma_addr_t internal_req_phy;
238 } mv; 289 } mv;
290 struct {
291 struct hpt_iop_request_get_config __iomem *config;
292 struct hpt_iopmu_mvfrey __iomem *mu;
293
294 int internal_mem_size;
295 struct hptiop_request internal_req;
296 int list_count;
297 struct mvfrey_inlist_entry *inlist;
298 dma_addr_t inlist_phy;
299 __le32 inlist_wptr;
300 struct mvfrey_outlist_entry *outlist;
301 dma_addr_t outlist_phy;
302 __le32 *outlist_cptr; /* copy pointer shadow */
303 dma_addr_t outlist_cptr_phy;
304 __le32 outlist_rptr;
305 } mvfrey;
239 } u; 306 } u;
240 307
241 struct Scsi_Host *host; 308 struct Scsi_Host *host;
@@ -283,6 +350,7 @@ struct hpt_ioctl_k {
283}; 350};
284 351
285struct hptiop_adapter_ops { 352struct hptiop_adapter_ops {
353 enum hptiop_family family;
286 int (*iop_wait_ready)(struct hptiop_hba *hba, u32 millisec); 354 int (*iop_wait_ready)(struct hptiop_hba *hba, u32 millisec);
287 int (*internal_memalloc)(struct hptiop_hba *hba); 355 int (*internal_memalloc)(struct hptiop_hba *hba);
288 int (*internal_memfree)(struct hptiop_hba *hba); 356 int (*internal_memfree)(struct hptiop_hba *hba);
@@ -298,6 +366,8 @@ struct hptiop_adapter_ops {
298 void (*post_msg)(struct hptiop_hba *hba, u32 msg); 366 void (*post_msg)(struct hptiop_hba *hba, u32 msg);
299 void (*post_req)(struct hptiop_hba *hba, struct hptiop_request *_req); 367 void (*post_req)(struct hptiop_hba *hba, struct hptiop_request *_req);
300 int hw_dma_bit_mask; 368 int hw_dma_bit_mask;
369 int (*reset_comm)(struct hptiop_hba *hba);
370 __le64 host_phy_flag;
301}; 371};
302 372
303#define HPT_IOCTL_RESULT_OK 0 373#define HPT_IOCTL_RESULT_OK 0