diff options
author | HighPoint Linux Team <linux@highpoint-tech.com> | 2009-09-11 05:21:27 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-10-02 10:45:22 -0400 |
commit | 3bfc13c239fd56ebc1ac98a914c6c6b8b0045478 (patch) | |
tree | 58568a4279e233de914a52fd53c3c5414f83a3d1 | |
parent | c0630f76d09131d606857a3da39739791d2c7b35 (diff) |
[SCSI] hptiop: Add RR44xx adapter support
Most code changes were made to support RR44xx adapters.
- add more PCI device ID.
- using PCI BAR[2] to access RR44xx IOP.
- using PCI BAR[0] to check and clear RR44xx IRQ.
Signed-off-by: HighPoint Linux Team <linux@highpoint-tech.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r-- | Documentation/scsi/hptiop.txt | 21 | ||||
-rw-r--r-- | drivers/scsi/hptiop.c | 37 | ||||
-rw-r--r-- | drivers/scsi/hptiop.h | 3 |
3 files changed, 48 insertions, 13 deletions
diff --git a/Documentation/scsi/hptiop.txt b/Documentation/scsi/hptiop.txt index a6eb4add1be6..9605179711f4 100644 --- a/Documentation/scsi/hptiop.txt +++ b/Documentation/scsi/hptiop.txt | |||
@@ -3,6 +3,25 @@ HIGHPOINT ROCKETRAID 3xxx/4xxx ADAPTER DRIVER (hptiop) | |||
3 | Controller Register Map | 3 | Controller Register Map |
4 | ------------------------- | 4 | ------------------------- |
5 | 5 | ||
6 | For RR44xx Intel IOP based adapters, the controller IOP is accessed via PCI BAR0 and BAR2: | ||
7 | |||
8 | BAR0 offset Register | ||
9 | 0x11C5C Link Interface IRQ Set | ||
10 | 0x11C60 Link Interface IRQ Clear | ||
11 | |||
12 | BAR2 offset Register | ||
13 | 0x10 Inbound Message Register 0 | ||
14 | 0x14 Inbound Message Register 1 | ||
15 | 0x18 Outbound Message Register 0 | ||
16 | 0x1C Outbound Message Register 1 | ||
17 | 0x20 Inbound Doorbell Register | ||
18 | 0x24 Inbound Interrupt Status Register | ||
19 | 0x28 Inbound Interrupt Mask Register | ||
20 | 0x30 Outbound Interrupt Status Register | ||
21 | 0x34 Outbound Interrupt Mask Register | ||
22 | 0x40 Inbound Queue Port | ||
23 | 0x44 Outbound Queue Port | ||
24 | |||
6 | For Intel IOP based adapters, the controller IOP is accessed via PCI BAR0: | 25 | For Intel IOP based adapters, the controller IOP is accessed via PCI BAR0: |
7 | 26 | ||
8 | BAR0 offset Register | 27 | BAR0 offset Register |
@@ -93,7 +112,7 @@ The driver exposes following sysfs attributes: | |||
93 | 112 | ||
94 | 113 | ||
95 | ----------------------------------------------------------------------------- | 114 | ----------------------------------------------------------------------------- |
96 | Copyright (C) 2006-2007 HighPoint Technologies, Inc. All Rights Reserved. | 115 | Copyright (C) 2006-2009 HighPoint Technologies, Inc. All Rights Reserved. |
97 | 116 | ||
98 | This file is distributed in the hope that it will be useful, | 117 | This file is distributed in the hope that it will be useful, |
99 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 118 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
diff --git a/drivers/scsi/hptiop.c b/drivers/scsi/hptiop.c index c596ab5f05c3..a0e7e711ff9d 100644 --- a/drivers/scsi/hptiop.c +++ b/drivers/scsi/hptiop.c | |||
@@ -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-2007 HighPoint Technologies, Inc. All Rights Reserved. | 3 | * Copyright (C) 2006-2009 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 |
@@ -41,7 +41,7 @@ MODULE_DESCRIPTION("HighPoint RocketRAID 3xxx/4xxx Controller Driver"); | |||
41 | 41 | ||
42 | static char driver_name[] = "hptiop"; | 42 | static char driver_name[] = "hptiop"; |
43 | static const char driver_name_long[] = "RocketRAID 3xxx/4xxx Controller driver"; | 43 | static const char driver_name_long[] = "RocketRAID 3xxx/4xxx Controller driver"; |
44 | static const char driver_ver[] = "v1.3 (071203)"; | 44 | static const char driver_ver[] = "v1.6 (090910)"; |
45 | 45 | ||
46 | static int iop_send_sync_msg(struct hptiop_hba *hba, u32 msg, u32 millisec); | 46 | static int iop_send_sync_msg(struct hptiop_hba *hba, u32 msg, u32 millisec); |
47 | static void hptiop_finish_scsi_req(struct hptiop_hba *hba, u32 tag, | 47 | static void hptiop_finish_scsi_req(struct hptiop_hba *hba, u32 tag, |
@@ -115,9 +115,13 @@ static void hptiop_drain_outbound_queue_itl(struct hptiop_hba *hba) | |||
115 | static int iop_intr_itl(struct hptiop_hba *hba) | 115 | static int iop_intr_itl(struct hptiop_hba *hba) |
116 | { | 116 | { |
117 | struct hpt_iopmu_itl __iomem *iop = hba->u.itl.iop; | 117 | struct hpt_iopmu_itl __iomem *iop = hba->u.itl.iop; |
118 | void __iomem *plx = hba->u.itl.plx; | ||
118 | u32 status; | 119 | u32 status; |
119 | int ret = 0; | 120 | int ret = 0; |
120 | 121 | ||
122 | if (plx && readl(plx + 0x11C5C) & 0xf) | ||
123 | writel(1, plx + 0x11C60); | ||
124 | |||
121 | status = readl(&iop->outbound_intstatus); | 125 | status = readl(&iop->outbound_intstatus); |
122 | 126 | ||
123 | if (status & IOPMU_OUTBOUND_INT_MSG0) { | 127 | if (status & IOPMU_OUTBOUND_INT_MSG0) { |
@@ -460,15 +464,25 @@ static void __iomem *hptiop_map_pci_bar(struct hptiop_hba *hba, int index) | |||
460 | 464 | ||
461 | static int hptiop_map_pci_bar_itl(struct hptiop_hba *hba) | 465 | static int hptiop_map_pci_bar_itl(struct hptiop_hba *hba) |
462 | { | 466 | { |
467 | struct pci_dev *pcidev = hba->pcidev; | ||
463 | hba->u.itl.iop = hptiop_map_pci_bar(hba, 0); | 468 | hba->u.itl.iop = hptiop_map_pci_bar(hba, 0); |
464 | if (hba->u.itl.iop) | 469 | if (hba->u.itl.iop == NULL) |
465 | return 0; | ||
466 | else | ||
467 | return -1; | 470 | return -1; |
471 | if ((pcidev->device & 0xff00) == 0x4400) { | ||
472 | hba->u.itl.plx = hba->u.itl.iop; | ||
473 | hba->u.itl.iop = hptiop_map_pci_bar(hba, 2); | ||
474 | if (hba->u.itl.iop == NULL) { | ||
475 | iounmap(hba->u.itl.plx); | ||
476 | return -1; | ||
477 | } | ||
478 | } | ||
479 | return 0; | ||
468 | } | 480 | } |
469 | 481 | ||
470 | static void hptiop_unmap_pci_bar_itl(struct hptiop_hba *hba) | 482 | static void hptiop_unmap_pci_bar_itl(struct hptiop_hba *hba) |
471 | { | 483 | { |
484 | if (hba->u.itl.plx) | ||
485 | iounmap(hba->u.itl.plx); | ||
472 | iounmap(hba->u.itl.iop); | 486 | iounmap(hba->u.itl.iop); |
473 | } | 487 | } |
474 | 488 | ||
@@ -1239,22 +1253,23 @@ static struct hptiop_adapter_ops hptiop_mv_ops = { | |||
1239 | static struct pci_device_id hptiop_id_table[] = { | 1253 | static struct pci_device_id hptiop_id_table[] = { |
1240 | { PCI_VDEVICE(TTI, 0x3220), (kernel_ulong_t)&hptiop_itl_ops }, | 1254 | { PCI_VDEVICE(TTI, 0x3220), (kernel_ulong_t)&hptiop_itl_ops }, |
1241 | { PCI_VDEVICE(TTI, 0x3320), (kernel_ulong_t)&hptiop_itl_ops }, | 1255 | { PCI_VDEVICE(TTI, 0x3320), (kernel_ulong_t)&hptiop_itl_ops }, |
1242 | { PCI_VDEVICE(TTI, 0x3520), (kernel_ulong_t)&hptiop_itl_ops }, | 1256 | { PCI_VDEVICE(TTI, 0x3410), (kernel_ulong_t)&hptiop_itl_ops }, |
1243 | { PCI_VDEVICE(TTI, 0x4320), (kernel_ulong_t)&hptiop_itl_ops }, | ||
1244 | { PCI_VDEVICE(TTI, 0x3510), (kernel_ulong_t)&hptiop_itl_ops }, | 1257 | { PCI_VDEVICE(TTI, 0x3510), (kernel_ulong_t)&hptiop_itl_ops }, |
1245 | { PCI_VDEVICE(TTI, 0x3511), (kernel_ulong_t)&hptiop_itl_ops }, | 1258 | { PCI_VDEVICE(TTI, 0x3511), (kernel_ulong_t)&hptiop_itl_ops }, |
1259 | { PCI_VDEVICE(TTI, 0x3520), (kernel_ulong_t)&hptiop_itl_ops }, | ||
1246 | { PCI_VDEVICE(TTI, 0x3521), (kernel_ulong_t)&hptiop_itl_ops }, | 1260 | { PCI_VDEVICE(TTI, 0x3521), (kernel_ulong_t)&hptiop_itl_ops }, |
1247 | { PCI_VDEVICE(TTI, 0x3522), (kernel_ulong_t)&hptiop_itl_ops }, | 1261 | { PCI_VDEVICE(TTI, 0x3522), (kernel_ulong_t)&hptiop_itl_ops }, |
1248 | { PCI_VDEVICE(TTI, 0x3410), (kernel_ulong_t)&hptiop_itl_ops }, | ||
1249 | { PCI_VDEVICE(TTI, 0x3540), (kernel_ulong_t)&hptiop_itl_ops }, | ||
1250 | { PCI_VDEVICE(TTI, 0x3530), (kernel_ulong_t)&hptiop_itl_ops }, | 1262 | { PCI_VDEVICE(TTI, 0x3530), (kernel_ulong_t)&hptiop_itl_ops }, |
1263 | { PCI_VDEVICE(TTI, 0x3540), (kernel_ulong_t)&hptiop_itl_ops }, | ||
1251 | { PCI_VDEVICE(TTI, 0x3560), (kernel_ulong_t)&hptiop_itl_ops }, | 1264 | { PCI_VDEVICE(TTI, 0x3560), (kernel_ulong_t)&hptiop_itl_ops }, |
1252 | { PCI_VDEVICE(TTI, 0x4322), (kernel_ulong_t)&hptiop_itl_ops }, | ||
1253 | { PCI_VDEVICE(TTI, 0x4321), (kernel_ulong_t)&hptiop_itl_ops }, | ||
1254 | { PCI_VDEVICE(TTI, 0x4210), (kernel_ulong_t)&hptiop_itl_ops }, | 1265 | { PCI_VDEVICE(TTI, 0x4210), (kernel_ulong_t)&hptiop_itl_ops }, |
1255 | { PCI_VDEVICE(TTI, 0x4211), (kernel_ulong_t)&hptiop_itl_ops }, | 1266 | { PCI_VDEVICE(TTI, 0x4211), (kernel_ulong_t)&hptiop_itl_ops }, |
1256 | { PCI_VDEVICE(TTI, 0x4310), (kernel_ulong_t)&hptiop_itl_ops }, | 1267 | { PCI_VDEVICE(TTI, 0x4310), (kernel_ulong_t)&hptiop_itl_ops }, |
1257 | { PCI_VDEVICE(TTI, 0x4311), (kernel_ulong_t)&hptiop_itl_ops }, | 1268 | { PCI_VDEVICE(TTI, 0x4311), (kernel_ulong_t)&hptiop_itl_ops }, |
1269 | { PCI_VDEVICE(TTI, 0x4320), (kernel_ulong_t)&hptiop_itl_ops }, | ||
1270 | { PCI_VDEVICE(TTI, 0x4321), (kernel_ulong_t)&hptiop_itl_ops }, | ||
1271 | { PCI_VDEVICE(TTI, 0x4322), (kernel_ulong_t)&hptiop_itl_ops }, | ||
1272 | { PCI_VDEVICE(TTI, 0x4400), (kernel_ulong_t)&hptiop_itl_ops }, | ||
1258 | { PCI_VDEVICE(TTI, 0x3120), (kernel_ulong_t)&hptiop_mv_ops }, | 1273 | { PCI_VDEVICE(TTI, 0x3120), (kernel_ulong_t)&hptiop_mv_ops }, |
1259 | { PCI_VDEVICE(TTI, 0x3122), (kernel_ulong_t)&hptiop_mv_ops }, | 1274 | { PCI_VDEVICE(TTI, 0x3122), (kernel_ulong_t)&hptiop_mv_ops }, |
1260 | { PCI_VDEVICE(TTI, 0x3020), (kernel_ulong_t)&hptiop_mv_ops }, | 1275 | { PCI_VDEVICE(TTI, 0x3020), (kernel_ulong_t)&hptiop_mv_ops }, |
diff --git a/drivers/scsi/hptiop.h b/drivers/scsi/hptiop.h index a0289f219752..0b871c0ae568 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-2007 HighPoint Technologies, Inc. All Rights Reserved. | 3 | * Copyright (C) 2006-2009 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 |
@@ -228,6 +228,7 @@ struct hptiop_hba { | |||
228 | union { | 228 | union { |
229 | struct { | 229 | struct { |
230 | struct hpt_iopmu_itl __iomem *iop; | 230 | struct hpt_iopmu_itl __iomem *iop; |
231 | void __iomem *plx; | ||
231 | } itl; | 232 | } itl; |
232 | struct { | 233 | struct { |
233 | struct hpt_iopmv_regs *regs; | 234 | struct hpt_iopmv_regs *regs; |