diff options
author | Sumant Patro <sumantp@lsil.com> | 2006-02-03 18:34:35 -0500 |
---|---|---|
committer | <jejb@mulgrave.il.steeleye.com> | 2006-02-04 17:38:41 -0500 |
commit | f9876f0b67c3f0b04ee2167602df54e7ae139ad7 (patch) | |
tree | 7d82ef9fa3e19f837c4aa69a0f168fbf5f6e8114 /drivers/scsi/megaraid/megaraid_sas.c | |
parent | 122da30223c06cee181044af6d32e88b256d10df (diff) |
[SCSI] megaraid_sas: support for 1078 type controller added
This patch adds support for 1078 type controller (device id : 0x60).
Signed-off-by: Sumant Patro <Sumant.Patro@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/megaraid/megaraid_sas.c')
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas.c | 98 |
1 files changed, 97 insertions, 1 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c index 0b738243782e..7de267e14458 100644 --- a/drivers/scsi/megaraid/megaraid_sas.c +++ b/drivers/scsi/megaraid/megaraid_sas.c | |||
@@ -60,6 +60,12 @@ static struct pci_device_id megasas_pci_table[] = { | |||
60 | PCI_ANY_ID, | 60 | PCI_ANY_ID, |
61 | }, | 61 | }, |
62 | { | 62 | { |
63 | PCI_VENDOR_ID_LSI_LOGIC, | ||
64 | PCI_DEVICE_ID_LSI_SAS1078R, // ppc IOP | ||
65 | PCI_ANY_ID, | ||
66 | PCI_ANY_ID, | ||
67 | }, | ||
68 | { | ||
63 | PCI_VENDOR_ID_DELL, | 69 | PCI_VENDOR_ID_DELL, |
64 | PCI_DEVICE_ID_DELL_PERC5, // xscale IOP | 70 | PCI_DEVICE_ID_DELL_PERC5, // xscale IOP |
65 | PCI_ANY_ID, | 71 | PCI_ANY_ID, |
@@ -199,6 +205,86 @@ static struct megasas_instance_template megasas_instance_template_xscale = { | |||
199 | */ | 205 | */ |
200 | 206 | ||
201 | /** | 207 | /** |
208 | * The following functions are defined for ppc (deviceid : 0x60) | ||
209 | * controllers | ||
210 | */ | ||
211 | |||
212 | /** | ||
213 | * megasas_enable_intr_ppc - Enables interrupts | ||
214 | * @regs: MFI register set | ||
215 | */ | ||
216 | static inline void | ||
217 | megasas_enable_intr_ppc(struct megasas_register_set __iomem * regs) | ||
218 | { | ||
219 | writel(0xFFFFFFFF, &(regs)->outbound_doorbell_clear); | ||
220 | |||
221 | writel(~0x80000004, &(regs)->outbound_intr_mask); | ||
222 | |||
223 | /* Dummy readl to force pci flush */ | ||
224 | readl(®s->outbound_intr_mask); | ||
225 | } | ||
226 | |||
227 | /** | ||
228 | * megasas_read_fw_status_reg_ppc - returns the current FW status value | ||
229 | * @regs: MFI register set | ||
230 | */ | ||
231 | static u32 | ||
232 | megasas_read_fw_status_reg_ppc(struct megasas_register_set __iomem * regs) | ||
233 | { | ||
234 | return readl(&(regs)->outbound_scratch_pad); | ||
235 | } | ||
236 | |||
237 | /** | ||
238 | * megasas_clear_interrupt_ppc - Check & clear interrupt | ||
239 | * @regs: MFI register set | ||
240 | */ | ||
241 | static int | ||
242 | megasas_clear_intr_ppc(struct megasas_register_set __iomem * regs) | ||
243 | { | ||
244 | u32 status; | ||
245 | /* | ||
246 | * Check if it is our interrupt | ||
247 | */ | ||
248 | status = readl(®s->outbound_intr_status); | ||
249 | |||
250 | if (!(status & MFI_REPLY_1078_MESSAGE_INTERRUPT)) { | ||
251 | return 1; | ||
252 | } | ||
253 | |||
254 | /* | ||
255 | * Clear the interrupt by writing back the same value | ||
256 | */ | ||
257 | writel(status, ®s->outbound_doorbell_clear); | ||
258 | |||
259 | return 0; | ||
260 | } | ||
261 | /** | ||
262 | * megasas_fire_cmd_ppc - Sends command to the FW | ||
263 | * @frame_phys_addr : Physical address of cmd | ||
264 | * @frame_count : Number of frames for the command | ||
265 | * @regs : MFI register set | ||
266 | */ | ||
267 | static inline void | ||
268 | megasas_fire_cmd_ppc(dma_addr_t frame_phys_addr, u32 frame_count, struct megasas_register_set __iomem *regs) | ||
269 | { | ||
270 | writel((frame_phys_addr | (frame_count<<1))|1, | ||
271 | &(regs)->inbound_queue_port); | ||
272 | } | ||
273 | |||
274 | static struct megasas_instance_template megasas_instance_template_ppc = { | ||
275 | |||
276 | .fire_cmd = megasas_fire_cmd_ppc, | ||
277 | .enable_intr = megasas_enable_intr_ppc, | ||
278 | .clear_intr = megasas_clear_intr_ppc, | ||
279 | .read_fw_status_reg = megasas_read_fw_status_reg_ppc, | ||
280 | }; | ||
281 | |||
282 | /** | ||
283 | * This is the end of set of functions & definitions | ||
284 | * specific to ppc (deviceid : 0x60) controllers | ||
285 | */ | ||
286 | |||
287 | /** | ||
202 | * megasas_disable_intr - Disables interrupts | 288 | * megasas_disable_intr - Disables interrupts |
203 | * @regs: MFI register set | 289 | * @regs: MFI register set |
204 | */ | 290 | */ |
@@ -1607,7 +1693,17 @@ static int megasas_init_mfi(struct megasas_instance *instance) | |||
1607 | 1693 | ||
1608 | reg_set = instance->reg_set; | 1694 | reg_set = instance->reg_set; |
1609 | 1695 | ||
1610 | instance->instancet = &megasas_instance_template_xscale; | 1696 | switch(instance->pdev->device) |
1697 | { | ||
1698 | case PCI_DEVICE_ID_LSI_SAS1078R: | ||
1699 | instance->instancet = &megasas_instance_template_ppc; | ||
1700 | break; | ||
1701 | case PCI_DEVICE_ID_LSI_SAS1064R: | ||
1702 | case PCI_DEVICE_ID_DELL_PERC5: | ||
1703 | default: | ||
1704 | instance->instancet = &megasas_instance_template_xscale; | ||
1705 | break; | ||
1706 | } | ||
1611 | 1707 | ||
1612 | /* | 1708 | /* |
1613 | * We expect the FW state to be READY | 1709 | * We expect the FW state to be READY |