Blame view
drivers/ata/ata_piix.c
46.5 KB
1da177e4c Linux-2.6.12-rc2 |
1 |
/* |
af36d7f0d [libata] license ... |
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
* ata_piix.c - Intel PATA/SATA controllers * * Maintained by: Jeff Garzik <jgarzik@pobox.com> * Please ALWAYS copy linux-ide@vger.kernel.org * on emails. * * * Copyright 2003-2005 Red Hat Inc * Copyright 2003-2005 Jeff Garzik * * * Copyright header from piix.c: * * Copyright (C) 1998-1999 Andrzej Krzysztofowicz, Author and Maintainer * Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org> |
ab7716300 ata: Switch all m... |
17 |
* Copyright (C) 2003 Red Hat Inc |
af36d7f0d [libata] license ... |
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
* * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * * * libata documentation is available via 'make {ps|pdf}docs', * as Documentation/DocBook/libata.* * * Hardware documentation available at http://developer.intel.com/ * |
d96212ed8 [PATCH] libata: a... |
40 |
* Documentation |
25985edce Fix common misspe... |
41 42 |
* Publicly available from Intel web site. Errata documentation * is also publicly available. As an aide to anyone hacking on this |
2c5ff671c [PATCH] trivial p... |
43 |
* driver the list of errata that are relevant is below, going back to |
d96212ed8 [PATCH] libata: a... |
44 45 |
* PIIX4. Older device documentation is now a bit tricky to find. * |
883931612 Fix typos in comm... |
46 |
* The chipsets all follow very much the same design. The original Triton |
25985edce Fix common misspe... |
47 |
* series chipsets do _not_ support independent device timings, but this |
d96212ed8 [PATCH] libata: a... |
48 49 |
* is fixed in Triton II. With the odd mobile exception the chips then * change little except in gaining more modes until SATA arrives. This |
25985edce Fix common misspe... |
50 |
* driver supports only the chips with independent timing (that is those |
d96212ed8 [PATCH] libata: a... |
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
* with SITRE and the 0x44 timing register). See pata_oldpiix and pata_mpiix * for the early chip drivers. * * Errata of note: * * Unfixable * PIIX4 errata #9 - Only on ultra obscure hw * ICH3 errata #13 - Not observed to affect real hw * by Intel * * Things we must deal with * PIIX4 errata #10 - BM IDE hang with non UDMA * (must stop/start dma to recover) * 440MX errata #15 - As PIIX4 errata #10 * PIIX4 errata #15 - Must not read control registers * during a PIO transfer * 440MX errata #13 - As PIIX4 errata #15 * ICH2 errata #21 - DMA mode 0 doesn't work right * ICH0/1 errata #55 - As ICH2 errata #21 * ICH2 spec c #9 - Extra operations needed to handle * drive hotswap [NOT YET SUPPORTED] * ICH2 spec c #20 - IDE PRD must not cross a 64K boundary * and must be dword aligned * ICH2 spec c #24 - UDMA mode 4,5 t85/86 should be 6ns not 3.3 |
c611bed78 ata_piix: ICH7 do... |
75 |
* ICH7 errata #16 - MWDMA1 timings are incorrect |
d96212ed8 [PATCH] libata: a... |
76 77 78 79 80 81 82 83 |
* * Should have been BIOS fixed: * 450NX: errata #19 - DMA hangs on old 450NX * 450NX: errata #20 - DMA hangs on old 450NX * 450NX: errata #25 - Corruption with DMA on old 450NX * ICH3 errata #15 - IDE deadlock under high load * (BIOS must set dev 31 fn 0 bit 23) * ICH3 errata #18 - Don't use native mode |
1da177e4c Linux-2.6.12-rc2 |
84 85 86 87 88 89 90 91 |
*/ #include <linux/kernel.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/init.h> #include <linux/blkdev.h> #include <linux/delay.h> |
6248e6472 [libata ata_piix]... |
92 |
#include <linux/device.h> |
5a0e3ad6a include cleanup: ... |
93 |
#include <linux/gfp.h> |
1da177e4c Linux-2.6.12-rc2 |
94 95 |
#include <scsi/scsi_host.h> #include <linux/libata.h> |
b8b275efc ata_piix: fix sus... |
96 |
#include <linux/dmi.h> |
1da177e4c Linux-2.6.12-rc2 |
97 98 |
#define DRV_NAME "ata_piix" |
c611bed78 ata_piix: ICH7 do... |
99 |
#define DRV_VERSION "2.13" |
1da177e4c Linux-2.6.12-rc2 |
100 101 102 103 104 |
enum { PIIX_IOCFG = 0x54, /* IDE I/O configuration register */ ICH5_PMR = 0x90, /* port mapping register */ ICH5_PCS = 0x92, /* port control and status */ |
c72907245 ata_piix: impleme... |
105 106 107 108 |
PIIX_SIDPR_BAR = 5, PIIX_SIDPR_LEN = 16, PIIX_SIDPR_IDX = 0, PIIX_SIDPR_DATA = 4, |
1da177e4c Linux-2.6.12-rc2 |
109 |
|
ff0fc1467 [PATCH] ata_piix:... |
110 |
PIIX_FLAG_CHECKINTR = (1 << 28), /* make sure PCI INTx enabled */ |
c72907245 ata_piix: impleme... |
111 |
PIIX_FLAG_SIDPR = (1 << 29), /* SATA idx/data pair regs */ |
1da177e4c Linux-2.6.12-rc2 |
112 |
|
800b39966 [PATCH] libata: a... |
113 114 |
PIIX_PATA_FLAGS = ATA_FLAG_SLAVE_POSS, PIIX_SATA_FLAGS = ATA_FLAG_SATA | PIIX_FLAG_CHECKINTR, |
b3362f88a [PATCH] ata_piix:... |
115 |
|
5e5a4f5d5 ata_piix: make DV... |
116 |
PIIX_FLAG_PIO16 = (1 << 30), /*support 16bit PIO only*/ |
1da177e4c Linux-2.6.12-rc2 |
117 118 |
PIIX_80C_PRI = (1 << 5) | (1 << 4), PIIX_80C_SEC = (1 << 7) | (1 << 6), |
d33f58b88 [PATCH] ata_piix:... |
119 120 121 122 123 124 |
/* constants for mapping table */ P0 = 0, /* port 0 */ P1 = 1, /* port 1 */ P2 = 2, /* port 2 */ P3 = 3, /* port 3 */ IDE = -1, /* IDE */ |
25985edce Fix common misspe... |
125 |
NA = -2, /* not available */ |
d33f58b88 [PATCH] ata_piix:... |
126 |
RV = -3, /* reserved */ |
7b6dbd687 libata: Check PCI... |
127 |
PIIX_AHCI_DEVICE = 6, |
b8b275efc ata_piix: fix sus... |
128 129 130 |
/* host->flags bits */ PIIX_HOST_BROKEN_SUSPEND = (1 << 24), |
1da177e4c Linux-2.6.12-rc2 |
131 |
}; |
9cde9ed15 ata_piix: separat... |
132 133 134 135 136 137 138 |
enum piix_controller_ids { /* controller IDs */ piix_pata_mwdma, /* PIIX3 MWDMA only */ piix_pata_33, /* PIIX4 at 33Mhz */ ich_pata_33, /* ICH up to UDMA 33 only */ ich_pata_66, /* ICH up to 66 Mhz */ ich_pata_100, /* ICH up to UDMA 100 */ |
c611bed78 ata_piix: ICH7 do... |
139 |
ich_pata_100_nomwdma1, /* ICH up to UDMA 100 but with no MWDMA1*/ |
9cde9ed15 ata_piix: separat... |
140 141 |
ich5_sata, ich6_sata, |
9c0bf6750 ata_piix: kill ic... |
142 143 |
ich6m_sata, ich8_sata, |
9cde9ed15 ata_piix: separat... |
144 |
ich8_2port_sata, |
9c0bf6750 ata_piix: kill ic... |
145 146 |
ich8m_apple_sata, /* locks up on second port enable */ tolapai_sata, |
9cde9ed15 ata_piix: separat... |
147 |
piix_pata_vmw, /* PIIX4 for VMware, spurious DMA_ERR */ |
5e5a4f5d5 ata_piix: make DV... |
148 |
ich8_sata_snb, |
9cde9ed15 ata_piix: separat... |
149 |
}; |
d33f58b88 [PATCH] ata_piix:... |
150 151 |
struct piix_map_db { const u32 mask; |
73291a1cb [libata] ata_piix... |
152 |
const u16 port_enable; |
d33f58b88 [PATCH] ata_piix:... |
153 154 |
const int map[][4]; }; |
d96715c1a [PATCH] ata_piix:... |
155 156 |
struct piix_host_priv { const int *map; |
2852bcf7c ata_piix: save, u... |
157 |
u32 saved_iocfg; |
c72907245 ata_piix: impleme... |
158 |
void __iomem *sidpr; |
d96715c1a [PATCH] ata_piix:... |
159 |
}; |
2dcb407e6 [libata] checkpat... |
160 161 |
static int piix_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); |
2852bcf7c ata_piix: save, u... |
162 |
static void piix_remove_one(struct pci_dev *pdev); |
a1efdaba2 libata: make rese... |
163 |
static int piix_pata_prereset(struct ata_link *link, unsigned long deadline); |
2dcb407e6 [libata] checkpat... |
164 165 166 |
static void piix_set_piomode(struct ata_port *ap, struct ata_device *adev); static void piix_set_dmamode(struct ata_port *ap, struct ata_device *adev); static void ich_set_dmamode(struct ata_port *ap, struct ata_device *adev); |
eb4a2c7f0 pata: cable methods |
167 |
static int ich_pata_cable_detect(struct ata_port *ap); |
25f98131a ata_piix: ignore ... |
168 |
static u8 piix_vmw_bmdma_status(struct ata_port *ap); |
82ef04fb4 libata: make SCR ... |
169 170 171 172 |
static int piix_sidpr_scr_read(struct ata_link *link, unsigned int reg, u32 *val); static int piix_sidpr_scr_write(struct ata_link *link, unsigned int reg, u32 val); |
a97c40068 ata_piix: impleme... |
173 174 |
static int piix_sidpr_set_lpm(struct ata_link *link, enum ata_lpm_policy policy, unsigned hints); |
27943620c libata: implement... |
175 |
static bool piix_irq_check(struct ata_port *ap); |
5e5a4f5d5 ata_piix: make DV... |
176 |
static int piix_port_start(struct ata_port *ap); |
b8b275efc ata_piix: fix sus... |
177 178 179 180 |
#ifdef CONFIG_PM static int piix_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg); static int piix_pci_device_resume(struct pci_dev *pdev); #endif |
1da177e4c Linux-2.6.12-rc2 |
181 182 |
static unsigned int in_module_init = 1; |
3b7d697df [libata] constify... |
183 |
static const struct pci_device_id piix_pci_tbl[] = { |
d2cdfc0db libata: PIIX3 sup... |
184 185 |
/* Intel PIIX3 for the 430HX etc */ { 0x8086, 0x7010, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix_pata_mwdma }, |
25f98131a ata_piix: ignore ... |
186 187 |
/* VMware ICH4 */ { 0x8086, 0x7111, 0x15ad, 0x1976, 0, 0, piix_pata_vmw }, |
669a5db41 [libata] Add a bu... |
188 189 190 |
/* Intel PIIX4 for the 430TX/440BX/MX chipset: UDMA 33 */ /* Also PIIX4E (fn3 rev 2) and PIIX4M (fn3 rev 3) */ { 0x8086, 0x7111, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix_pata_33 }, |
669a5db41 [libata] Add a bu... |
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
/* Intel PIIX4 */ { 0x8086, 0x7199, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix_pata_33 }, /* Intel PIIX4 */ { 0x8086, 0x7601, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix_pata_33 }, /* Intel PIIX */ { 0x8086, 0x84CA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix_pata_33 }, /* Intel ICH (i810, i815, i840) UDMA 66*/ { 0x8086, 0x2411, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_66 }, /* Intel ICH0 : UDMA 33*/ { 0x8086, 0x2421, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_33 }, /* Intel ICH2M */ { 0x8086, 0x244A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 }, /* Intel ICH2 (i810E2, i845, 850, 860) UDMA 100 */ { 0x8086, 0x244B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 }, /* Intel ICH3M */ { 0x8086, 0x248A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 }, /* Intel ICH3 (E7500/1) UDMA 100 */ { 0x8086, 0x248B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 }, |
4bb969db4 ata_piix: Add dev... |
209 210 |
/* Intel ICH4-L */ { 0x8086, 0x24C1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 }, |
669a5db41 [libata] Add a bu... |
211 212 213 214 |
/* Intel ICH4 (i845GV, i845E, i852, i855) UDMA 100 */ { 0x8086, 0x24CA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 }, { 0x8086, 0x24CB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 }, /* Intel ICH5 */ |
2eb829e93 ata_piix: disallo... |
215 |
{ 0x8086, 0x24DB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 }, |
669a5db41 [libata] Add a bu... |
216 217 |
/* C-ICH (i810E2) */ { 0x8086, 0x245B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 }, |
85cd7251b [libata #pata-dri... |
218 |
/* ESB (855GME/875P + 6300ESB) UDMA 100 */ |
669a5db41 [libata] Add a bu... |
219 220 221 222 |
{ 0x8086, 0x25A2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 }, /* ICH6 (and 6) (i915) UDMA 100 */ { 0x8086, 0x266F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 }, /* ICH7/7-R (i945, i975) UDMA 100*/ |
c611bed78 ata_piix: ICH7 do... |
223 224 |
{ 0x8086, 0x27DF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100_nomwdma1 }, { 0x8086, 0x269E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100_nomwdma1 }, |
c1e6f28cc Add a PCI ID for ... |
225 226 |
/* ICH8 Mobile PATA Controller */ { 0x8086, 0x2850, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 }, |
1da177e4c Linux-2.6.12-rc2 |
227 |
|
7654db1a9 ata_piix: Remove ... |
228 |
/* SATA ports */ |
4fca377f7 [libata] trivial:... |
229 |
|
1d076e5b8 [PATCH] ata_piix:... |
230 |
/* 82801EB (ICH5) */ |
1da177e4c Linux-2.6.12-rc2 |
231 |
{ 0x8086, 0x24d1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich5_sata }, |
1d076e5b8 [PATCH] ata_piix:... |
232 |
/* 82801EB (ICH5) */ |
1da177e4c Linux-2.6.12-rc2 |
233 |
{ 0x8086, 0x24df, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich5_sata }, |
1d076e5b8 [PATCH] ata_piix:... |
234 |
/* 6300ESB (ICH5 variant with broken PCS present bits) */ |
5e56a37c3 [PATCH] ata_piix:... |
235 |
{ 0x8086, 0x25a3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich5_sata }, |
1d076e5b8 [PATCH] ata_piix:... |
236 |
/* 6300ESB pretending RAID */ |
5e56a37c3 [PATCH] ata_piix:... |
237 |
{ 0x8086, 0x25b0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich5_sata }, |
1d076e5b8 [PATCH] ata_piix:... |
238 |
/* 82801FB/FW (ICH6/ICH6W) */ |
1da177e4c Linux-2.6.12-rc2 |
239 |
{ 0x8086, 0x2651, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata }, |
1d076e5b8 [PATCH] ata_piix:... |
240 |
/* 82801FR/FRW (ICH6R/ICH6RW) */ |
9c0bf6750 ata_piix: kill ic... |
241 |
{ 0x8086, 0x2652, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata }, |
5016d7d21 ata_piix: don't a... |
242 243 244 |
/* 82801FBM ICH6M (ICH6R with only port 0 and 2 implemented). * Attach iff the controller is in IDE mode. */ { 0x8086, 0x2653, PCI_ANY_ID, PCI_ANY_ID, |
9c0bf6750 ata_piix: kill ic... |
245 |
PCI_CLASS_STORAGE_IDE << 8, 0xffff00, ich6m_sata }, |
1d076e5b8 [PATCH] ata_piix:... |
246 |
/* 82801GB/GR/GH (ICH7, identical to ICH6) */ |
9c0bf6750 ata_piix: kill ic... |
247 |
{ 0x8086, 0x27c0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata }, |
1d076e5b8 [PATCH] ata_piix:... |
248 |
/* 2801GBM/GHM (ICH7M, identical to ICH6M) */ |
9c0bf6750 ata_piix: kill ic... |
249 |
{ 0x8086, 0x27c4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6m_sata }, |
f98b6573f [PATCH] ata_piix:... |
250 |
/* Enterprise Southbridge 2 (631xESB/632xESB) */ |
9c0bf6750 ata_piix: kill ic... |
251 |
{ 0x8086, 0x2680, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata }, |
f98b6573f [PATCH] ata_piix:... |
252 |
/* SATA Controller 1 IDE (ICH8) */ |
9c0bf6750 ata_piix: kill ic... |
253 |
{ 0x8086, 0x2820, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata }, |
f98b6573f [PATCH] ata_piix:... |
254 |
/* SATA Controller 2 IDE (ICH8) */ |
00242ec87 ata_piix: reorgan... |
255 |
{ 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, |
8d8ef2fb9 ata_piix: only en... |
256 |
/* Mobile SATA Controller IDE (ICH8M), Apple */ |
9c0bf6750 ata_piix: kill ic... |
257 |
{ 0x8086, 0x2828, 0x106b, 0x00a0, 0, 0, ich8m_apple_sata }, |
23cf296e3 ata_piix: fix mac... |
258 |
{ 0x8086, 0x2828, 0x106b, 0x00a1, 0, 0, ich8m_apple_sata }, |
487eff68e ata_piix: subsys ... |
259 |
{ 0x8086, 0x2828, 0x106b, 0x00a3, 0, 0, ich8m_apple_sata }, |
23cf296e3 ata_piix: fix mac... |
260 261 |
/* Mobile SATA Controller IDE (ICH8M) */ { 0x8086, 0x2828, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata }, |
f98b6573f [PATCH] ata_piix:... |
262 |
/* SATA Controller IDE (ICH9) */ |
9c0bf6750 ata_piix: kill ic... |
263 |
{ 0x8086, 0x2920, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata }, |
f98b6573f [PATCH] ata_piix:... |
264 |
/* SATA Controller IDE (ICH9) */ |
00242ec87 ata_piix: reorgan... |
265 |
{ 0x8086, 0x2921, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, |
f98b6573f [PATCH] ata_piix:... |
266 |
/* SATA Controller IDE (ICH9) */ |
00242ec87 ata_piix: reorgan... |
267 |
{ 0x8086, 0x2926, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, |
f98b6573f [PATCH] ata_piix:... |
268 |
/* SATA Controller IDE (ICH9M) */ |
00242ec87 ata_piix: reorgan... |
269 |
{ 0x8086, 0x2928, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, |
f98b6573f [PATCH] ata_piix:... |
270 |
/* SATA Controller IDE (ICH9M) */ |
00242ec87 ata_piix: reorgan... |
271 |
{ 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, |
f98b6573f [PATCH] ata_piix:... |
272 |
/* SATA Controller IDE (ICH9M) */ |
9c0bf6750 ata_piix: kill ic... |
273 |
{ 0x8086, 0x292e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata }, |
c5cf0ffa7 ata_piix: IDE mod... |
274 |
/* SATA Controller IDE (Tolapai) */ |
9c0bf6750 ata_piix: kill ic... |
275 |
{ 0x8086, 0x5028, PCI_ANY_ID, PCI_ANY_ID, 0, 0, tolapai_sata }, |
bf7f22b9c ata_piix: IDE mod... |
276 |
/* SATA Controller IDE (ICH10) */ |
9c0bf6750 ata_piix: kill ic... |
277 |
{ 0x8086, 0x3a00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata }, |
bf7f22b9c ata_piix: IDE mod... |
278 279 280 |
/* SATA Controller IDE (ICH10) */ { 0x8086, 0x3a06, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, /* SATA Controller IDE (ICH10) */ |
9c0bf6750 ata_piix: kill ic... |
281 |
{ 0x8086, 0x3a20, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata }, |
bf7f22b9c ata_piix: IDE mod... |
282 283 |
/* SATA Controller IDE (ICH10) */ { 0x8086, 0x3a26, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, |
c6c6a1afe ata_piix: IDE Mod... |
284 285 286 |
/* SATA Controller IDE (PCH) */ { 0x8086, 0x3b20, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata }, /* SATA Controller IDE (PCH) */ |
0395e61ba ata_piix: IDE Mod... |
287 288 |
{ 0x8086, 0x3b21, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, /* SATA Controller IDE (PCH) */ |
c6c6a1afe ata_piix: IDE Mod... |
289 290 |
{ 0x8086, 0x3b26, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, /* SATA Controller IDE (PCH) */ |
0395e61ba ata_piix: IDE Mod... |
291 292 |
{ 0x8086, 0x3b28, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata }, /* SATA Controller IDE (PCH) */ |
c6c6a1afe ata_piix: IDE Mod... |
293 294 295 |
{ 0x8086, 0x3b2d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, /* SATA Controller IDE (PCH) */ { 0x8086, 0x3b2e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata }, |
88e8201e6 ata_piix: IDE Mod... |
296 |
/* SATA Controller IDE (CPT) */ |
5e5a4f5d5 ata_piix: make DV... |
297 |
{ 0x8086, 0x1c00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb }, |
88e8201e6 ata_piix: IDE Mod... |
298 |
/* SATA Controller IDE (CPT) */ |
5e5a4f5d5 ata_piix: make DV... |
299 |
{ 0x8086, 0x1c01, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb }, |
88e8201e6 ata_piix: IDE Mod... |
300 301 302 303 |
/* SATA Controller IDE (CPT) */ { 0x8086, 0x1c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, /* SATA Controller IDE (CPT) */ { 0x8086, 0x1c09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, |
238e149c7 ata_piix: IDE Mod... |
304 |
/* SATA Controller IDE (PBG) */ |
5e5a4f5d5 ata_piix: make DV... |
305 |
{ 0x8086, 0x1d00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb }, |
238e149c7 ata_piix: IDE Mod... |
306 307 |
/* SATA Controller IDE (PBG) */ { 0x8086, 0x1d08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, |
4a836c701 ata_piix: IDE-mod... |
308 |
/* SATA Controller IDE (Panther Point) */ |
5e5a4f5d5 ata_piix: make DV... |
309 |
{ 0x8086, 0x1e00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb }, |
4a836c701 ata_piix: IDE-mod... |
310 |
/* SATA Controller IDE (Panther Point) */ |
5e5a4f5d5 ata_piix: make DV... |
311 |
{ 0x8086, 0x1e01, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb }, |
4a836c701 ata_piix: IDE-mod... |
312 313 314 315 |
/* SATA Controller IDE (Panther Point) */ { 0x8086, 0x1e08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, /* SATA Controller IDE (Panther Point) */ { 0x8086, 0x1e09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, |
1da177e4c Linux-2.6.12-rc2 |
316 317 318 319 320 321 322 |
{ } /* terminate list */ }; static struct pci_driver piix_pci_driver = { .name = DRV_NAME, .id_table = piix_pci_tbl, .probe = piix_init_one, |
2852bcf7c ata_piix: save, u... |
323 |
.remove = piix_remove_one, |
438ac6d5e libata: add missi... |
324 |
#ifdef CONFIG_PM |
b8b275efc ata_piix: fix sus... |
325 326 |
.suspend = piix_pci_device_suspend, .resume = piix_pci_device_resume, |
438ac6d5e libata: add missi... |
327 |
#endif |
1da177e4c Linux-2.6.12-rc2 |
328 |
}; |
193515d51 [libata] eliminat... |
329 |
static struct scsi_host_template piix_sht = { |
68d1d07b5 libata: implement... |
330 |
ATA_BMDMA_SHT(DRV_NAME), |
1da177e4c Linux-2.6.12-rc2 |
331 |
}; |
27943620c libata: implement... |
332 |
static struct ata_port_operations piix_sata_ops = { |
871af1210 libata: Add 32bit... |
333 |
.inherits = &ata_bmdma32_port_ops, |
27943620c libata: implement... |
334 |
.sff_irq_check = piix_irq_check, |
5e5a4f5d5 ata_piix: make DV... |
335 |
.port_start = piix_port_start, |
27943620c libata: implement... |
336 337 338 339 |
}; static struct ata_port_operations piix_pata_ops = { .inherits = &piix_sata_ops, |
029cfd6b7 libata: implement... |
340 |
.cable_detect = ata_cable_40wire, |
1da177e4c Linux-2.6.12-rc2 |
341 342 |
.set_piomode = piix_set_piomode, .set_dmamode = piix_set_dmamode, |
a1efdaba2 libata: make rese... |
343 |
.prereset = piix_pata_prereset, |
1da177e4c Linux-2.6.12-rc2 |
344 |
}; |
029cfd6b7 libata: implement... |
345 346 347 |
static struct ata_port_operations piix_vmw_ops = { .inherits = &piix_pata_ops, .bmdma_status = piix_vmw_bmdma_status, |
669a5db41 [libata] Add a bu... |
348 |
}; |
029cfd6b7 libata: implement... |
349 350 351 352 |
static struct ata_port_operations ich_pata_ops = { .inherits = &piix_pata_ops, .cable_detect = ich_pata_cable_detect, .set_dmamode = ich_set_dmamode, |
1da177e4c Linux-2.6.12-rc2 |
353 |
}; |
a97c40068 ata_piix: impleme... |
354 355 356 357 358 359 360 361 362 |
static struct device_attribute *piix_sidpr_shost_attrs[] = { &dev_attr_link_power_management_policy, NULL }; static struct scsi_host_template piix_sidpr_sht = { ATA_BMDMA_SHT(DRV_NAME), .shost_attrs = piix_sidpr_shost_attrs, }; |
029cfd6b7 libata: implement... |
363 364 |
static struct ata_port_operations piix_sidpr_sata_ops = { .inherits = &piix_sata_ops, |
57c9efdfb libata: implement... |
365 |
.hardreset = sata_std_hardreset, |
c72907245 ata_piix: impleme... |
366 367 |
.scr_read = piix_sidpr_scr_read, .scr_write = piix_sidpr_scr_write, |
a97c40068 ata_piix: impleme... |
368 |
.set_lpm = piix_sidpr_set_lpm, |
c72907245 ata_piix: impleme... |
369 |
}; |
d96715c1a [PATCH] ata_piix:... |
370 |
static const struct piix_map_db ich5_map_db = { |
d33f58b88 [PATCH] ata_piix:... |
371 |
.mask = 0x7, |
ea35d29e2 [libata] ata_piix... |
372 |
.port_enable = 0x3, |
d33f58b88 [PATCH] ata_piix:... |
373 374 375 376 377 378 379 380 381 382 383 384 |
.map = { /* PM PS SM SS MAP */ { P0, NA, P1, NA }, /* 000b */ { P1, NA, P0, NA }, /* 001b */ { RV, RV, RV, RV }, { RV, RV, RV, RV }, { P0, P1, IDE, IDE }, /* 100b */ { P1, P0, IDE, IDE }, /* 101b */ { IDE, IDE, P0, P1 }, /* 110b */ { IDE, IDE, P1, P0 }, /* 111b */ }, }; |
d96715c1a [PATCH] ata_piix:... |
385 |
static const struct piix_map_db ich6_map_db = { |
d33f58b88 [PATCH] ata_piix:... |
386 |
.mask = 0x3, |
ea35d29e2 [libata] ata_piix... |
387 |
.port_enable = 0xf, |
d33f58b88 [PATCH] ata_piix:... |
388 389 |
.map = { /* PM PS SM SS MAP */ |
79ea24e72 [PATCH] ata_piix:... |
390 |
{ P0, P2, P1, P3 }, /* 00b */ |
d33f58b88 [PATCH] ata_piix:... |
391 392 393 394 395 |
{ IDE, IDE, P1, P3 }, /* 01b */ { P0, P2, IDE, IDE }, /* 10b */ { RV, RV, RV, RV }, }, }; |
d96715c1a [PATCH] ata_piix:... |
396 |
static const struct piix_map_db ich6m_map_db = { |
d33f58b88 [PATCH] ata_piix:... |
397 |
.mask = 0x3, |
ea35d29e2 [libata] ata_piix... |
398 |
.port_enable = 0x5, |
670837417 [PATCH] ata_piix:... |
399 400 |
/* Map 01b isn't specified in the doc but some notebooks use |
c6446a4cd [PATCH] ata_piix:... |
401 402 |
* it anyway. MAP 01b have been spotted on both ICH6M and * ICH7M. |
670837417 [PATCH] ata_piix:... |
403 404 405 |
*/ .map = { /* PM PS SM SS MAP */ |
e04b3b9d0 ata_piix: kill in... |
406 |
{ P0, P2, NA, NA }, /* 00b */ |
670837417 [PATCH] ata_piix:... |
407 408 409 410 411 |
{ IDE, IDE, P1, P3 }, /* 01b */ { P0, P2, IDE, IDE }, /* 10b */ { RV, RV, RV, RV }, }, }; |
08f12edc3 [libata] ata_piix... |
412 413 |
static const struct piix_map_db ich8_map_db = { .mask = 0x3, |
a0ce9aca9 ata_piix: port en... |
414 |
.port_enable = 0xf, |
08f12edc3 [libata] ata_piix... |
415 416 |
.map = { /* PM PS SM SS MAP */ |
158f30c89 [PATCH] libata: u... |
417 |
{ P0, P2, P1, P3 }, /* 00b (hardwired when in AHCI) */ |
08f12edc3 [libata] ata_piix... |
418 |
{ RV, RV, RV, RV }, |
ac2b04371 ata_piix: update ... |
419 |
{ P0, P2, IDE, IDE }, /* 10b (IDE mode) */ |
08f12edc3 [libata] ata_piix... |
420 421 422 |
{ RV, RV, RV, RV }, }, }; |
00242ec87 ata_piix: reorgan... |
423 |
static const struct piix_map_db ich8_2port_map_db = { |
e2d352af6 ata_piix: replace... |
424 425 426 427 428 429 430 431 432 |
.mask = 0x3, .port_enable = 0x3, .map = { /* PM PS SM SS MAP */ { P0, NA, P1, NA }, /* 00b */ { RV, RV, RV, RV }, /* 01b */ { RV, RV, RV, RV }, /* 10b */ { RV, RV, RV, RV }, }, |
c5cf0ffa7 ata_piix: IDE mod... |
433 |
}; |
8d8ef2fb9 ata_piix: only en... |
434 435 436 437 438 439 440 441 442 443 444 |
static const struct piix_map_db ich8m_apple_map_db = { .mask = 0x3, .port_enable = 0x1, .map = { /* PM PS SM SS MAP */ { P0, NA, NA, NA }, /* 00b */ { RV, RV, RV, RV }, { P0, P2, IDE, IDE }, /* 10b */ { RV, RV, RV, RV }, }, }; |
00242ec87 ata_piix: reorgan... |
445 |
static const struct piix_map_db tolapai_map_db = { |
8f73a6880 ata_piix: SATA 2p... |
446 447 448 449 450 451 452 453 454 455 |
.mask = 0x3, .port_enable = 0x3, .map = { /* PM PS SM SS MAP */ { P0, NA, P1, NA }, /* 00b */ { RV, RV, RV, RV }, /* 01b */ { RV, RV, RV, RV }, /* 10b */ { RV, RV, RV, RV }, }, }; |
d96715c1a [PATCH] ata_piix:... |
456 457 |
static const struct piix_map_db *piix_map_db_table[] = { [ich5_sata] = &ich5_map_db, |
d96715c1a [PATCH] ata_piix:... |
458 |
[ich6_sata] = &ich6_map_db, |
9c0bf6750 ata_piix: kill ic... |
459 460 |
[ich6m_sata] = &ich6m_map_db, [ich8_sata] = &ich8_map_db, |
00242ec87 ata_piix: reorgan... |
461 |
[ich8_2port_sata] = &ich8_2port_map_db, |
9c0bf6750 ata_piix: kill ic... |
462 463 |
[ich8m_apple_sata] = &ich8m_apple_map_db, [tolapai_sata] = &tolapai_map_db, |
5e5a4f5d5 ata_piix: make DV... |
464 |
[ich8_sata_snb] = &ich8_map_db, |
d96715c1a [PATCH] ata_piix:... |
465 |
}; |
1da177e4c Linux-2.6.12-rc2 |
466 |
static struct ata_port_info piix_port_info[] = { |
00242ec87 ata_piix: reorgan... |
467 468 |
[piix_pata_mwdma] = /* PIIX3 MWDMA only */ { |
00242ec87 ata_piix: reorgan... |
469 |
.flags = PIIX_PATA_FLAGS, |
14bdef982 [libata] convert ... |
470 471 |
.pio_mask = ATA_PIO4, .mwdma_mask = ATA_MWDMA12_ONLY, /* mwdma1-2 ?? CHECK 0 should be ok but slow */ |
00242ec87 ata_piix: reorgan... |
472 473 |
.port_ops = &piix_pata_ops, }, |
ec300d99e [libata] ata_piix... |
474 |
[piix_pata_33] = /* PIIX4 at 33MHz */ |
1d076e5b8 [PATCH] ata_piix:... |
475 |
{ |
b3362f88a [PATCH] ata_piix:... |
476 |
.flags = PIIX_PATA_FLAGS, |
14bdef982 [libata] convert ... |
477 478 479 |
.pio_mask = ATA_PIO4, .mwdma_mask = ATA_MWDMA12_ONLY, /* mwdma1-2 ?? CHECK 0 should be ok but slow */ .udma_mask = ATA_UDMA2, |
1d076e5b8 [PATCH] ata_piix:... |
480 481 |
.port_ops = &piix_pata_ops, }, |
ec300d99e [libata] ata_piix... |
482 |
[ich_pata_33] = /* ICH0 - ICH at 33Mhz*/ |
669a5db41 [libata] Add a bu... |
483 |
{ |
b3362f88a [PATCH] ata_piix:... |
484 |
.flags = PIIX_PATA_FLAGS, |
14bdef982 [libata] convert ... |
485 486 487 |
.pio_mask = ATA_PIO4, .mwdma_mask = ATA_MWDMA12_ONLY, /* Check: maybe MWDMA0 is ok */ .udma_mask = ATA_UDMA2, |
669a5db41 [libata] Add a bu... |
488 489 |
.port_ops = &ich_pata_ops, }, |
ec300d99e [libata] ata_piix... |
490 491 |
[ich_pata_66] = /* ICH controllers up to 66MHz */ |
1da177e4c Linux-2.6.12-rc2 |
492 |
{ |
b3362f88a [PATCH] ata_piix:... |
493 |
.flags = PIIX_PATA_FLAGS, |
14bdef982 [libata] convert ... |
494 495 |
.pio_mask = ATA_PIO4, .mwdma_mask = ATA_MWDMA12_ONLY, /* MWDMA0 is broken on chip */ |
669a5db41 [libata] Add a bu... |
496 497 498 |
.udma_mask = ATA_UDMA4, .port_ops = &ich_pata_ops, }, |
85cd7251b [libata #pata-dri... |
499 |
|
ec300d99e [libata] ata_piix... |
500 |
[ich_pata_100] = |
669a5db41 [libata] Add a bu... |
501 |
{ |
b3362f88a [PATCH] ata_piix:... |
502 |
.flags = PIIX_PATA_FLAGS | PIIX_FLAG_CHECKINTR, |
14bdef982 [libata] convert ... |
503 504 505 |
.pio_mask = ATA_PIO4, .mwdma_mask = ATA_MWDMA12_ONLY, .udma_mask = ATA_UDMA5, |
669a5db41 [libata] Add a bu... |
506 |
.port_ops = &ich_pata_ops, |
1da177e4c Linux-2.6.12-rc2 |
507 |
}, |
c611bed78 ata_piix: ICH7 do... |
508 509 510 511 512 513 514 515 |
[ich_pata_100_nomwdma1] = { .flags = PIIX_PATA_FLAGS | PIIX_FLAG_CHECKINTR, .pio_mask = ATA_PIO4, .mwdma_mask = ATA_MWDMA2_ONLY, .udma_mask = ATA_UDMA5, .port_ops = &ich_pata_ops, }, |
ec300d99e [libata] ata_piix... |
516 |
[ich5_sata] = |
1da177e4c Linux-2.6.12-rc2 |
517 |
{ |
228c1590b [PATCH] ata_piix:... |
518 |
.flags = PIIX_SATA_FLAGS, |
14bdef982 [libata] convert ... |
519 520 |
.pio_mask = ATA_PIO4, .mwdma_mask = ATA_MWDMA2, |
bf6263a85 [libata] Use ATA_... |
521 |
.udma_mask = ATA_UDMA6, |
1da177e4c Linux-2.6.12-rc2 |
522 523 |
.port_ops = &piix_sata_ops, }, |
ec300d99e [libata] ata_piix... |
524 |
[ich6_sata] = |
1da177e4c Linux-2.6.12-rc2 |
525 |
{ |
723159c58 ata_piix: kill un... |
526 |
.flags = PIIX_SATA_FLAGS, |
14bdef982 [libata] convert ... |
527 528 |
.pio_mask = ATA_PIO4, .mwdma_mask = ATA_MWDMA2, |
bf6263a85 [libata] Use ATA_... |
529 |
.udma_mask = ATA_UDMA6, |
1da177e4c Linux-2.6.12-rc2 |
530 531 |
.port_ops = &piix_sata_ops, }, |
9c0bf6750 ata_piix: kill ic... |
532 |
[ich6m_sata] = |
c368ca4ef [PATCH] ata_piix:... |
533 |
{ |
5016d7d21 ata_piix: don't a... |
534 |
.flags = PIIX_SATA_FLAGS, |
14bdef982 [libata] convert ... |
535 536 |
.pio_mask = ATA_PIO4, .mwdma_mask = ATA_MWDMA2, |
bf6263a85 [libata] Use ATA_... |
537 |
.udma_mask = ATA_UDMA6, |
c368ca4ef [PATCH] ata_piix:... |
538 539 |
.port_ops = &piix_sata_ops, }, |
1d076e5b8 [PATCH] ata_piix:... |
540 |
|
9c0bf6750 ata_piix: kill ic... |
541 |
[ich8_sata] = |
08f12edc3 [libata] ata_piix... |
542 |
{ |
5016d7d21 ata_piix: don't a... |
543 |
.flags = PIIX_SATA_FLAGS | PIIX_FLAG_SIDPR, |
14bdef982 [libata] convert ... |
544 545 |
.pio_mask = ATA_PIO4, .mwdma_mask = ATA_MWDMA2, |
bf6263a85 [libata] Use ATA_... |
546 |
.udma_mask = ATA_UDMA6, |
08f12edc3 [libata] ata_piix... |
547 548 |
.port_ops = &piix_sata_ops, }, |
669a5db41 [libata] Add a bu... |
549 |
|
00242ec87 ata_piix: reorgan... |
550 |
[ich8_2port_sata] = |
c5cf0ffa7 ata_piix: IDE mod... |
551 |
{ |
5016d7d21 ata_piix: don't a... |
552 |
.flags = PIIX_SATA_FLAGS | PIIX_FLAG_SIDPR, |
14bdef982 [libata] convert ... |
553 554 |
.pio_mask = ATA_PIO4, .mwdma_mask = ATA_MWDMA2, |
c5cf0ffa7 ata_piix: IDE mod... |
555 556 557 |
.udma_mask = ATA_UDMA6, .port_ops = &piix_sata_ops, }, |
8f73a6880 ata_piix: SATA 2p... |
558 |
|
9c0bf6750 ata_piix: kill ic... |
559 |
[tolapai_sata] = |
8f73a6880 ata_piix: SATA 2p... |
560 |
{ |
5016d7d21 ata_piix: don't a... |
561 |
.flags = PIIX_SATA_FLAGS, |
14bdef982 [libata] convert ... |
562 563 |
.pio_mask = ATA_PIO4, .mwdma_mask = ATA_MWDMA2, |
8f73a6880 ata_piix: SATA 2p... |
564 565 566 |
.udma_mask = ATA_UDMA6, .port_ops = &piix_sata_ops, }, |
8d8ef2fb9 ata_piix: only en... |
567 |
|
9c0bf6750 ata_piix: kill ic... |
568 |
[ich8m_apple_sata] = |
8d8ef2fb9 ata_piix: only en... |
569 |
{ |
23cf296e3 ata_piix: fix mac... |
570 |
.flags = PIIX_SATA_FLAGS, |
14bdef982 [libata] convert ... |
571 572 |
.pio_mask = ATA_PIO4, .mwdma_mask = ATA_MWDMA2, |
8d8ef2fb9 ata_piix: only en... |
573 574 575 |
.udma_mask = ATA_UDMA6, .port_ops = &piix_sata_ops, }, |
25f98131a ata_piix: ignore ... |
576 577 |
[piix_pata_vmw] = { |
25f98131a ata_piix: ignore ... |
578 |
.flags = PIIX_PATA_FLAGS, |
14bdef982 [libata] convert ... |
579 580 581 |
.pio_mask = ATA_PIO4, .mwdma_mask = ATA_MWDMA12_ONLY, /* mwdma1-2 ?? CHECK 0 should be ok but slow */ .udma_mask = ATA_UDMA2, |
25f98131a ata_piix: ignore ... |
582 583 |
.port_ops = &piix_vmw_ops, }, |
5e5a4f5d5 ata_piix: make DV... |
584 585 586 587 588 589 590 591 592 593 594 595 |
/* * some Sandybridge chipsets have broken 32 mode up to now, * see https://bugzilla.kernel.org/show_bug.cgi?id=40592 */ [ich8_sata_snb] = { .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SIDPR | PIIX_FLAG_PIO16, .pio_mask = ATA_PIO4, .mwdma_mask = ATA_MWDMA2, .udma_mask = ATA_UDMA6, .port_ops = &piix_sata_ops, }, |
1da177e4c Linux-2.6.12-rc2 |
596 597 598 599 600 601 602 603 604 605 606 607 |
}; static struct pci_bits piix_enable_bits[] = { { 0x41U, 1U, 0x80UL, 0x80UL }, /* port 0 */ { 0x43U, 1U, 0x80UL, 0x80UL }, /* port 1 */ }; MODULE_AUTHOR("Andre Hedrick, Alan Cox, Andrzej Krzysztofowicz, Jeff Garzik"); MODULE_DESCRIPTION("SCSI low-level driver for Intel PIIX/ICH ATA controllers"); MODULE_LICENSE("GPL"); MODULE_DEVICE_TABLE(pci, piix_pci_tbl); MODULE_VERSION(DRV_VERSION); |
fc085150b [PATCH] libata: a... |
608 609 610 611 612 613 614 615 616 617 618 619 620 |
struct ich_laptop { u16 device; u16 subvendor; u16 subdevice; }; /* * List of laptops that use short cables rather than 80 wire */ static const struct ich_laptop ich_laptop[] = { /* devid, subvendor, subdev */ { 0x27DF, 0x0005, 0x0280 }, /* ICH7 on Acer 5602WLMi */ |
2655e2cee ata_piix: Add add... |
621 |
{ 0x27DF, 0x1025, 0x0102 }, /* ICH7 on Acer 5602aWLMi */ |
babfb682c ata_piix: add ICH... |
622 |
{ 0x27DF, 0x1025, 0x0110 }, /* ICH7 on Acer 3682WLMi */ |
6034734d3 ata_piix: Add new... |
623 |
{ 0x27DF, 0x1028, 0x02b0 }, /* ICH7 on unknown Dell */ |
123401068 Add notation that... |
624 |
{ 0x27DF, 0x1043, 0x1267 }, /* ICH7 on Asus W5F */ |
54174db30 [libata] ata_piix... |
625 |
{ 0x27DF, 0x103C, 0x30A1 }, /* ICH7 on HP Compaq nc2400 */ |
af901ca18 tree-wide: fix as... |
626 |
{ 0x27DF, 0x103C, 0x361a }, /* ICH7 on unknown HP */ |
d09addf65 ata_piix: add Her... |
627 |
{ 0x27DF, 0x1071, 0xD221 }, /* ICH7 on Hercules EC-900 */ |
6034734d3 ata_piix: Add new... |
628 |
{ 0x27DF, 0x152D, 0x0778 }, /* ICH7 on unknown Intel */ |
b33620f9f ata_piix: add sho... |
629 |
{ 0x24CA, 0x1025, 0x0061 }, /* ICH4 on ACER Aspire 2023WLMi */ |
e1fefea9c [libata] ata_piix... |
630 631 |
{ 0x24CA, 0x1025, 0x003d }, /* ICH4 on ACER TM290 */ { 0x266F, 0x1025, 0x0066 }, /* ICH6 on ACER Aspire 1694WLMi */ |
01ce2601e ata_piix: add Asu... |
632 |
{ 0x2653, 0x1043, 0x82D8 }, /* ICH6M on Asus Eee 701 */ |
124a6eece ata_piix: The Son... |
633 |
{ 0x27df, 0x104d, 0x900e }, /* ICH7 on Sony TZ-90 */ |
fc085150b [PATCH] libata: a... |
634 635 636 |
/* end marker */ { 0, } }; |
5e5a4f5d5 ata_piix: make DV... |
637 638 639 640 641 642 643 |
static int piix_port_start(struct ata_port *ap) { if (!(ap->flags & PIIX_FLAG_PIO16)) ap->pflags |= ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32CHANGE; return ata_bmdma_port_start(ap); } |
1da177e4c Linux-2.6.12-rc2 |
644 |
/** |
eb4a2c7f0 pata: cable methods |
645 |
* ich_pata_cable_detect - Probe host controller cable detect info |
1da177e4c Linux-2.6.12-rc2 |
646 647 648 649 650 651 652 653 |
* @ap: Port for which cable detect info is desired * * Read 80c cable indicator from ATA PCI device's PCI config * register. This register is normally set by firmware (BIOS). * * LOCKING: * None (inherited from caller). */ |
669a5db41 [libata] Add a bu... |
654 |
|
eb4a2c7f0 pata: cable methods |
655 |
static int ich_pata_cable_detect(struct ata_port *ap) |
1da177e4c Linux-2.6.12-rc2 |
656 |
{ |
cca3974e4 libata: Grand ren... |
657 |
struct pci_dev *pdev = to_pci_dev(ap->host->dev); |
2852bcf7c ata_piix: save, u... |
658 |
struct piix_host_priv *hpriv = ap->host->private_data; |
fc085150b [PATCH] libata: a... |
659 |
const struct ich_laptop *lap = &ich_laptop[0]; |
2852bcf7c ata_piix: save, u... |
660 |
u8 mask; |
1da177e4c Linux-2.6.12-rc2 |
661 |
|
fc085150b [PATCH] libata: a... |
662 663 664 665 |
/* Check for specials - Acer Aspire 5602WLMi */ while (lap->device) { if (lap->device == pdev->device && lap->subvendor == pdev->subsystem_vendor && |
2dcb407e6 [libata] checkpat... |
666 |
lap->subdevice == pdev->subsystem_device) |
eb4a2c7f0 pata: cable methods |
667 |
return ATA_CBL_PATA40_SHORT; |
2dcb407e6 [libata] checkpat... |
668 |
|
fc085150b [PATCH] libata: a... |
669 670 |
lap++; } |
1da177e4c Linux-2.6.12-rc2 |
671 |
/* check BIOS cable detect results */ |
2a88d1ac8 [PATCH] libata: r... |
672 |
mask = ap->port_no == 0 ? PIIX_80C_PRI : PIIX_80C_SEC; |
2852bcf7c ata_piix: save, u... |
673 |
if ((hpriv->saved_iocfg & mask) == 0) |
eb4a2c7f0 pata: cable methods |
674 675 |
return ATA_CBL_PATA40; return ATA_CBL_PATA80; |
1da177e4c Linux-2.6.12-rc2 |
676 677 678 |
} /** |
ccc4672af [PATCH] ata_piix:... |
679 |
* piix_pata_prereset - prereset for PATA host controller |
cc0680a58 libata-link: link... |
680 |
* @link: Target link |
d4b2bab4f libata: add deadl... |
681 |
* @deadline: deadline jiffies for the operation |
1da177e4c Linux-2.6.12-rc2 |
682 |
* |
573db6b8f [PATCH] ata_piix:... |
683 684 685 |
* LOCKING: * None (inherited from caller). */ |
cc0680a58 libata-link: link... |
686 |
static int piix_pata_prereset(struct ata_link *link, unsigned long deadline) |
1da177e4c Linux-2.6.12-rc2 |
687 |
{ |
cc0680a58 libata-link: link... |
688 |
struct ata_port *ap = link->ap; |
cca3974e4 libata: Grand ren... |
689 |
struct pci_dev *pdev = to_pci_dev(ap->host->dev); |
1da177e4c Linux-2.6.12-rc2 |
690 |
|
c961922b7 [PATCH] libata-eh... |
691 692 |
if (!pci_test_config_bits(pdev, &piix_enable_bits[ap->port_no])) return -ENOENT; |
9363c3825 libata: rename SF... |
693 |
return ata_sff_prereset(link, deadline); |
ccc4672af [PATCH] ata_piix:... |
694 |
} |
60c3be387 ata_piix: paralle... |
695 |
static DEFINE_SPINLOCK(piix_lock); |
6a94a746f ata_piix: unify c... |
696 697 |
static void piix_set_timings(struct ata_port *ap, struct ata_device *adev, u8 pio) |
1da177e4c Linux-2.6.12-rc2 |
698 |
{ |
cca3974e4 libata: Grand ren... |
699 |
struct pci_dev *dev = to_pci_dev(ap->host->dev); |
60c3be387 ata_piix: paralle... |
700 |
unsigned long flags; |
1da177e4c Linux-2.6.12-rc2 |
701 |
unsigned int is_slave = (adev->devno != 0); |
2a88d1ac8 [PATCH] libata: r... |
702 |
unsigned int master_port= ap->port_no ? 0x42 : 0x40; |
1da177e4c Linux-2.6.12-rc2 |
703 704 705 |
unsigned int slave_port = 0x44; u16 master_data; u8 slave_data; |
669a5db41 [libata] Add a bu... |
706 707 |
u8 udma_enable; int control = 0; |
85cd7251b [libata #pata-dri... |
708 |
|
669a5db41 [libata] Add a bu... |
709 710 711 712 |
/* * See Intel Document 298600-004 for the timing programing rules * for ICH controllers. */ |
1da177e4c Linux-2.6.12-rc2 |
713 714 715 716 717 718 719 |
static const /* ISP RTC */ u8 timings[][2] = { { 0, 0 }, { 0, 0 }, { 1, 0 }, { 2, 1 }, { 2, 3 }, }; |
669a5db41 [libata] Add a bu... |
720 721 722 723 |
if (pio >= 2) control |= 1; /* TIME1 enable */ if (ata_pio_need_iordy(adev)) control |= 2; /* IE enable */ |
85cd7251b [libata #pata-dri... |
724 |
/* Intel specifies that the PPE functionality is for disk only */ |
669a5db41 [libata] Add a bu... |
725 726 |
if (adev->class == ATA_DEV_ATA) control |= 4; /* PPE enable */ |
6a94a746f ata_piix: unify c... |
727 728 729 730 731 732 733 |
/* * If the drive MWDMA is faster than it can do PIO then * we must force PIO into PIO0 */ if (adev->pio_mode < XFER_PIO_0 + pio) /* Enable DMA timing only */ control |= 8; /* PIO cycles in PIO0 */ |
669a5db41 [libata] Add a bu... |
734 |
|
60c3be387 ata_piix: paralle... |
735 |
spin_lock_irqsave(&piix_lock, flags); |
a5bf5f5a3 ata_piix: fix pio... |
736 737 738 739 |
/* PIO configuration clears DTE unconditionally. It will be * programmed in set_dmamode which is guaranteed to be called * after set_piomode if any DMA mode is available. */ |
1da177e4c Linux-2.6.12-rc2 |
740 741 |
pci_read_config_word(dev, master_port, &master_data); if (is_slave) { |
a5bf5f5a3 ata_piix: fix pio... |
742 743 |
/* clear TIME1|IE1|PPE1|DTE1 */ master_data &= 0xff0f; |
669a5db41 [libata] Add a bu... |
744 745 |
/* enable PPE1, IE1 and TIME1 as needed */ master_data |= (control << 4); |
1da177e4c Linux-2.6.12-rc2 |
746 |
pci_read_config_byte(dev, slave_port, &slave_data); |
2a88d1ac8 [PATCH] libata: r... |
747 |
slave_data &= (ap->port_no ? 0x0f : 0xf0); |
669a5db41 [libata] Add a bu... |
748 |
/* Load the timing nibble for this slave */ |
a5bf5f5a3 ata_piix: fix pio... |
749 750 |
slave_data |= ((timings[pio][0] << 2) | timings[pio][1]) << (ap->port_no ? 4 : 0); |
1da177e4c Linux-2.6.12-rc2 |
751 |
} else { |
a5bf5f5a3 ata_piix: fix pio... |
752 753 |
/* clear ISP|RCT|TIME0|IE0|PPE0|DTE0 */ master_data &= 0xccf0; |
669a5db41 [libata] Add a bu... |
754 755 |
/* Enable PPE, IE and TIME as appropriate */ master_data |= control; |
a5bf5f5a3 ata_piix: fix pio... |
756 |
/* load ISP and RCT */ |
1da177e4c Linux-2.6.12-rc2 |
757 758 759 760 |
master_data |= (timings[pio][0] << 12) | (timings[pio][1] << 8); } |
ce986690d ata_piix: SITRE h... |
761 762 763 |
/* Enable SITRE (separate slave timing register) */ master_data |= 0x4000; |
1da177e4c Linux-2.6.12-rc2 |
764 765 766 |
pci_write_config_word(dev, master_port, master_data); if (is_slave) pci_write_config_byte(dev, slave_port, slave_data); |
669a5db41 [libata] Add a bu... |
767 768 769 |
/* Ensure the UDMA bit is off - it will be turned back on if UDMA is selected */ |
85cd7251b [libata #pata-dri... |
770 |
|
669a5db41 [libata] Add a bu... |
771 772 773 774 775 |
if (ap->udma_mask) { pci_read_config_byte(dev, 0x48, &udma_enable); udma_enable &= ~(1 << (2 * ap->port_no + adev->devno)); pci_write_config_byte(dev, 0x48, udma_enable); } |
60c3be387 ata_piix: paralle... |
776 777 |
spin_unlock_irqrestore(&piix_lock, flags); |
1da177e4c Linux-2.6.12-rc2 |
778 779 780 |
} /** |
6a94a746f ata_piix: unify c... |
781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 |
* piix_set_piomode - Initialize host controller PATA PIO timings * @ap: Port whose timings we are configuring * @adev: Drive in question * * Set PIO mode for device, in host controller PCI config space. * * LOCKING: * None (inherited from caller). */ static void piix_set_piomode(struct ata_port *ap, struct ata_device *adev) { piix_set_timings(ap, adev, adev->pio_mode - XFER_PIO_0); } /** |
669a5db41 [libata] Add a bu... |
797 |
* do_pata_set_dmamode - Initialize host controller PATA PIO timings |
1da177e4c Linux-2.6.12-rc2 |
798 |
* @ap: Port whose timings we are configuring |
669a5db41 [libata] Add a bu... |
799 |
* @adev: Drive in question |
c32a8fd7c [PATCH] ata-piix:... |
800 |
* @isich: set if the chip is an ICH device |
1da177e4c Linux-2.6.12-rc2 |
801 802 803 804 805 806 |
* * Set UDMA mode for device, in host controller PCI config space. * * LOCKING: * None (inherited from caller). */ |
2dcb407e6 [libata] checkpat... |
807 |
static void do_pata_set_dmamode(struct ata_port *ap, struct ata_device *adev, int isich) |
1da177e4c Linux-2.6.12-rc2 |
808 |
{ |
cca3974e4 libata: Grand ren... |
809 |
struct pci_dev *dev = to_pci_dev(ap->host->dev); |
60c3be387 ata_piix: paralle... |
810 |
unsigned long flags; |
669a5db41 [libata] Add a bu... |
811 812 |
u8 speed = adev->dma_mode; int devid = adev->devno + 2 * ap->port_no; |
dedf61db4 libata piix3 supp... |
813 |
u8 udma_enable = 0; |
85cd7251b [libata #pata-dri... |
814 |
|
1da177e4c Linux-2.6.12-rc2 |
815 |
if (speed >= XFER_UDMA_0) { |
6a94a746f ata_piix: unify c... |
816 |
unsigned int udma = speed - XFER_UDMA_0; |
669a5db41 [libata] Add a bu... |
817 818 819 |
u16 udma_timing; u16 ideconf; int u_clock, u_speed; |
85cd7251b [libata #pata-dri... |
820 |
|
6a94a746f ata_piix: unify c... |
821 822 823 |
spin_lock_irqsave(&piix_lock, flags); pci_read_config_byte(dev, 0x48, &udma_enable); |
669a5db41 [libata] Add a bu... |
824 |
/* |
2dcb407e6 [libata] checkpat... |
825 |
* UDMA is handled by a combination of clock switching and |
85cd7251b [libata #pata-dri... |
826 827 |
* selection of dividers * |
669a5db41 [libata] Add a bu... |
828 |
* Handy rule: Odd modes are UDMATIMx 01, even are 02 |
85cd7251b [libata #pata-dri... |
829 |
* except UDMA0 which is 00 |
669a5db41 [libata] Add a bu... |
830 831 832 833 834 835 836 837 |
*/ u_speed = min(2 - (udma & 1), udma); if (udma == 5) u_clock = 0x1000; /* 100Mhz */ else if (udma > 2) u_clock = 1; /* 66Mhz */ else u_clock = 0; /* 33Mhz */ |
85cd7251b [libata #pata-dri... |
838 |
|
669a5db41 [libata] Add a bu... |
839 |
udma_enable |= (1 << devid); |
85cd7251b [libata #pata-dri... |
840 |
|
669a5db41 [libata] Add a bu... |
841 842 843 844 845 |
/* Load the CT/RP selection */ pci_read_config_word(dev, 0x4A, &udma_timing); udma_timing &= ~(3 << (4 * devid)); udma_timing |= u_speed << (4 * devid); pci_write_config_word(dev, 0x4A, udma_timing); |
85cd7251b [libata #pata-dri... |
846 |
if (isich) { |
669a5db41 [libata] Add a bu... |
847 848 849 850 851 852 853 |
/* Select a 33/66/100Mhz clock */ pci_read_config_word(dev, 0x54, &ideconf); ideconf &= ~(0x1001 << devid); ideconf |= u_clock << devid; /* For ICH or later we should set bit 10 for better performance (WR_PingPong_En) */ pci_write_config_word(dev, 0x54, ideconf); |
1da177e4c Linux-2.6.12-rc2 |
854 |
} |
6a94a746f ata_piix: unify c... |
855 856 857 858 |
pci_write_config_byte(dev, 0x48, udma_enable); spin_unlock_irqrestore(&piix_lock, flags); |
1da177e4c Linux-2.6.12-rc2 |
859 |
} else { |
6a94a746f ata_piix: unify c... |
860 861 |
/* MWDMA is driven by the PIO timings. */ unsigned int mwdma = speed - XFER_MW_DMA_0; |
669a5db41 [libata] Add a bu... |
862 863 864 865 |
const unsigned int needed_pio[3] = { XFER_PIO_0, XFER_PIO_3, XFER_PIO_4 }; int pio = needed_pio[mwdma] - XFER_PIO_0; |
85cd7251b [libata #pata-dri... |
866 |
|
6a94a746f ata_piix: unify c... |
867 868 |
/* XFER_PIO_0 is never used currently */ piix_set_timings(ap, adev, pio); |
1da177e4c Linux-2.6.12-rc2 |
869 |
} |
669a5db41 [libata] Add a bu... |
870 871 872 873 874 875 876 877 878 879 880 881 |
} /** * piix_set_dmamode - Initialize host controller PATA DMA timings * @ap: Port whose timings we are configuring * @adev: um * * Set MW/UDMA mode for device, in host controller PCI config space. * * LOCKING: * None (inherited from caller). */ |
2dcb407e6 [libata] checkpat... |
882 |
static void piix_set_dmamode(struct ata_port *ap, struct ata_device *adev) |
669a5db41 [libata] Add a bu... |
883 884 885 886 887 888 889 890 891 892 893 894 895 896 |
{ do_pata_set_dmamode(ap, adev, 0); } /** * ich_set_dmamode - Initialize host controller PATA DMA timings * @ap: Port whose timings we are configuring * @adev: um * * Set MW/UDMA mode for device, in host controller PCI config space. * * LOCKING: * None (inherited from caller). */ |
2dcb407e6 [libata] checkpat... |
897 |
static void ich_set_dmamode(struct ata_port *ap, struct ata_device *adev) |
669a5db41 [libata] Add a bu... |
898 899 |
{ do_pata_set_dmamode(ap, adev, 1); |
1da177e4c Linux-2.6.12-rc2 |
900 |
} |
c72907245 ata_piix: impleme... |
901 902 903 904 |
/* * Serial ATA Index/Data Pair Superset Registers access * * Beginning from ICH8, there's a sane way to access SCRs using index |
be77e43ab ata_piix: drop me... |
905 906 907 |
* and data register pair located at BAR5 which means that we have * separate SCRs for master and slave. This is handled using libata * slave_link facility. |
c72907245 ata_piix: impleme... |
908 909 910 911 912 913 |
*/ static const int piix_sidx_map[] = { [SCR_STATUS] = 0, [SCR_ERROR] = 2, [SCR_CONTROL] = 1, }; |
be77e43ab ata_piix: drop me... |
914 |
static void piix_sidpr_sel(struct ata_link *link, unsigned int reg) |
c72907245 ata_piix: impleme... |
915 |
{ |
be77e43ab ata_piix: drop me... |
916 |
struct ata_port *ap = link->ap; |
c72907245 ata_piix: impleme... |
917 |
struct piix_host_priv *hpriv = ap->host->private_data; |
be77e43ab ata_piix: drop me... |
918 |
iowrite32(((ap->port_no * 2 + link->pmp) << 8) | piix_sidx_map[reg], |
c72907245 ata_piix: impleme... |
919 920 |
hpriv->sidpr + PIIX_SIDPR_IDX); } |
82ef04fb4 libata: make SCR ... |
921 922 |
static int piix_sidpr_scr_read(struct ata_link *link, unsigned int reg, u32 *val) |
c72907245 ata_piix: impleme... |
923 |
{ |
be77e43ab ata_piix: drop me... |
924 |
struct piix_host_priv *hpriv = link->ap->host->private_data; |
c72907245 ata_piix: impleme... |
925 926 927 |
if (reg >= ARRAY_SIZE(piix_sidx_map)) return -EINVAL; |
be77e43ab ata_piix: drop me... |
928 929 |
piix_sidpr_sel(link, reg); *val = ioread32(hpriv->sidpr + PIIX_SIDPR_DATA); |
c72907245 ata_piix: impleme... |
930 931 |
return 0; } |
82ef04fb4 libata: make SCR ... |
932 933 |
static int piix_sidpr_scr_write(struct ata_link *link, unsigned int reg, u32 val) |
c72907245 ata_piix: impleme... |
934 |
{ |
be77e43ab ata_piix: drop me... |
935 |
struct piix_host_priv *hpriv = link->ap->host->private_data; |
82ef04fb4 libata: make SCR ... |
936 |
|
c72907245 ata_piix: impleme... |
937 938 |
if (reg >= ARRAY_SIZE(piix_sidx_map)) return -EINVAL; |
be77e43ab ata_piix: drop me... |
939 940 |
piix_sidpr_sel(link, reg); iowrite32(val, hpriv->sidpr + PIIX_SIDPR_DATA); |
c72907245 ata_piix: impleme... |
941 942 |
return 0; } |
a97c40068 ata_piix: impleme... |
943 944 945 946 947 |
static int piix_sidpr_set_lpm(struct ata_link *link, enum ata_lpm_policy policy, unsigned hints) { return sata_link_scr_lpm(link, policy, false); } |
27943620c libata: implement... |
948 949 950 951 952 953 954 |
static bool piix_irq_check(struct ata_port *ap) { if (unlikely(!ap->ioaddr.bmdma_addr)) return false; return ap->ops->bmdma_status(ap) & ATA_DMA_INTR; } |
b8b275efc ata_piix: fix sus... |
955 |
#ifdef CONFIG_PM |
8c3832ebe ata_piix: impleme... |
956 957 |
static int piix_broken_suspend(void) { |
1855256c4 drivers/firmware:... |
958 |
static const struct dmi_system_id sysids[] = { |
8c3832ebe ata_piix: impleme... |
959 |
{ |
4c74d4ec3 ata_piix: add ano... |
960 961 962 963 964 965 966 |
.ident = "TECRA M3", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M3"), }, }, { |
04d86d6fc ata_piix: add mor... |
967 968 969 970 971 972 973 |
.ident = "TECRA M3", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), DMI_MATCH(DMI_PRODUCT_NAME, "Tecra M3"), }, }, { |
d1aa690a7 ata_piix: add Tos... |
974 975 976 977 978 979 980 |
.ident = "TECRA M4", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), DMI_MATCH(DMI_PRODUCT_NAME, "Tecra M4"), }, }, { |
040dee53a ata_piix: add TEC... |
981 982 983 984 985 986 987 |
.ident = "TECRA M4", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M4"), }, }, { |
8c3832ebe ata_piix: impleme... |
988 989 990 991 992 |
.ident = "TECRA M5", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M5"), }, |
b8b275efc ata_piix: fix sus... |
993 |
}, |
8c3832ebe ata_piix: impleme... |
994 |
{ |
ffe188dd8 ata_piix: Add Tos... |
995 996 997 998 999 1000 1001 |
.ident = "TECRA M6", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M6"), }, }, { |
5c08ea019 ata_piix: add TEC... |
1002 1003 1004 1005 1006 1007 1008 |
.ident = "TECRA M7", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M7"), }, }, { |
04d86d6fc ata_piix: add mor... |
1009 1010 1011 1012 1013 1014 1015 |
.ident = "TECRA A8", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), DMI_MATCH(DMI_PRODUCT_NAME, "TECRA A8"), }, }, { |
ffe188dd8 ata_piix: Add Tos... |
1016 1017 1018 1019 1020 1021 1022 |
.ident = "Satellite R20", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), DMI_MATCH(DMI_PRODUCT_NAME, "Satellite R20"), }, }, { |
04d86d6fc ata_piix: add mor... |
1023 1024 1025 1026 1027 1028 1029 |
.ident = "Satellite R25", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), DMI_MATCH(DMI_PRODUCT_NAME, "Satellite R25"), }, }, { |
3cc0b9d3b ata_piix: add Sat... |
1030 1031 1032 1033 1034 1035 1036 |
.ident = "Satellite U200", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U200"), }, }, { |
04d86d6fc ata_piix: add mor... |
1037 1038 1039 1040 1041 1042 1043 |
.ident = "Satellite U200", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE U200"), }, }, { |
62320e23c ata_piix: add SAT... |
1044 1045 1046 1047 1048 1049 1050 |
.ident = "Satellite Pro U200", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE PRO U200"), }, }, { |
8c3832ebe ata_piix: impleme... |
1051 1052 1053 1054 1055 |
.ident = "Satellite U205", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U205"), }, |
b8b275efc ata_piix: fix sus... |
1056 |
}, |
8c3832ebe ata_piix: impleme... |
1057 |
{ |
de753e5e8 ata_piix: add SAT... |
1058 1059 1060 1061 1062 1063 1064 |
.ident = "SATELLITE U205", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE U205"), }, }, { |
8c3832ebe ata_piix: impleme... |
1065 1066 1067 1068 1069 |
.ident = "Portege M500", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE M500"), }, |
b8b275efc ata_piix: fix sus... |
1070 |
}, |
c3f93b8fc ata_piix: VGN-BX2... |
1071 1072 1073 1074 1075 1076 1077 |
{ .ident = "VGN-BX297XP", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), DMI_MATCH(DMI_PRODUCT_NAME, "VGN-BX297XP"), }, }, |
7d0515484 [libata] ata_piix... |
1078 1079 |
{ } /* terminate list */ |
8c3832ebe ata_piix: impleme... |
1080 |
}; |
7abe79c35 ata_piix: add Tec... |
1081 1082 1083 1084 |
static const char *oemstrs[] = { "Tecra M3,", }; int i; |
8c3832ebe ata_piix: impleme... |
1085 1086 1087 |
if (dmi_check_system(sysids)) return 1; |
7abe79c35 ata_piix: add Tec... |
1088 1089 1090 |
for (i = 0; i < ARRAY_SIZE(oemstrs); i++) if (dmi_find_device(DMI_DEV_TYPE_OEM_STRING, oemstrs[i], NULL)) return 1; |
1eedb4a90 ata_piix: add bor... |
1091 1092 1093 1094 1095 1096 |
/* TECRA M4 sometimes forgets its identify and reports bogus * DMI information. As the bogus information is a bit * generic, match as many entries as possible. This manual * matching is necessary because dmi_system_id.matches is * limited to four entries. */ |
3c387730e [libata] ata_piix... |
1097 1098 1099 1100 1101 1102 1103 |
if (dmi_match(DMI_SYS_VENDOR, "TOSHIBA") && dmi_match(DMI_PRODUCT_NAME, "000000") && dmi_match(DMI_PRODUCT_VERSION, "000000") && dmi_match(DMI_PRODUCT_SERIAL, "000000") && dmi_match(DMI_BOARD_VENDOR, "TOSHIBA") && dmi_match(DMI_BOARD_NAME, "Portable PC") && dmi_match(DMI_BOARD_VERSION, "Version A0")) |
1eedb4a90 ata_piix: add bor... |
1104 |
return 1; |
8c3832ebe ata_piix: impleme... |
1105 1106 |
return 0; } |
b8b275efc ata_piix: fix sus... |
1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 |
static int piix_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg) { struct ata_host *host = dev_get_drvdata(&pdev->dev); unsigned long flags; int rc = 0; rc = ata_host_suspend(host, mesg); if (rc) return rc; /* Some braindamaged ACPI suspend implementations expect the * controller to be awake on entry; otherwise, it burns cpu * cycles and power trying to do something to the sleeping * beauty. */ |
3a2d5b700 PM: Introduce PM_... |
1123 |
if (piix_broken_suspend() && (mesg.event & PM_EVENT_SLEEP)) { |
b8b275efc ata_piix: fix sus... |
1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 |
pci_save_state(pdev); /* mark its power state as "unknown", since we don't * know if e.g. the BIOS will change its device state * when we suspend. */ if (pdev->current_state == PCI_D0) pdev->current_state = PCI_UNKNOWN; /* tell resume that it's waking up from broken suspend */ spin_lock_irqsave(&host->lock, flags); host->flags |= PIIX_HOST_BROKEN_SUSPEND; spin_unlock_irqrestore(&host->lock, flags); } else ata_pci_device_do_suspend(pdev, mesg); return 0; } static int piix_pci_device_resume(struct pci_dev *pdev) { struct ata_host *host = dev_get_drvdata(&pdev->dev); unsigned long flags; int rc; if (host->flags & PIIX_HOST_BROKEN_SUSPEND) { spin_lock_irqsave(&host->lock, flags); host->flags &= ~PIIX_HOST_BROKEN_SUSPEND; spin_unlock_irqrestore(&host->lock, flags); pci_set_power_state(pdev, PCI_D0); pci_restore_state(pdev); /* PCI device wasn't disabled during suspend. Use |
0b62e13b5 pci: rename __pci... |
1158 1159 |
* pci_reenable_device() to avoid affecting the enable * count. |
b8b275efc ata_piix: fix sus... |
1160 |
*/ |
0b62e13b5 pci: rename __pci... |
1161 |
rc = pci_reenable_device(pdev); |
b8b275efc ata_piix: fix sus... |
1162 |
if (rc) |
a44fec1fc ata: Convert dev_... |
1163 1164 1165 1166 |
dev_err(&pdev->dev, "failed to enable device after resume (%d) ", rc); |
b8b275efc ata_piix: fix sus... |
1167 1168 1169 1170 1171 1172 1173 1174 1175 |
} else rc = ata_pci_device_do_resume(pdev); if (rc == 0) ata_host_resume(host); return rc; } #endif |
25f98131a ata_piix: ignore ... |
1176 1177 1178 1179 |
static u8 piix_vmw_bmdma_status(struct ata_port *ap) { return ata_bmdma_status(ap) & ~ATA_DMA_ERR; } |
1da177e4c Linux-2.6.12-rc2 |
1180 1181 1182 1183 1184 |
#define AHCI_PCI_BAR 5 #define AHCI_GLOBAL_CTL 0x04 #define AHCI_ENABLE (1 << 31) static int piix_disable_ahci(struct pci_dev *pdev) { |
ea6ba10bb [libata] __iomem ... |
1185 |
void __iomem *mmio; |
1da177e4c Linux-2.6.12-rc2 |
1186 1187 1188 1189 1190 1191 |
u32 tmp; int rc = 0; /* BUG: pci_enable_device has not yet been called. This * works because this device is usually set up by BIOS. */ |
374b18735 [libata] update s... |
1192 1193 |
if (!pci_resource_start(pdev, AHCI_PCI_BAR) || !pci_resource_len(pdev, AHCI_PCI_BAR)) |
1da177e4c Linux-2.6.12-rc2 |
1194 |
return 0; |
7b6dbd687 libata: Check PCI... |
1195 |
|
374b18735 [libata] update s... |
1196 |
mmio = pci_iomap(pdev, AHCI_PCI_BAR, 64); |
1da177e4c Linux-2.6.12-rc2 |
1197 1198 |
if (!mmio) return -ENOMEM; |
7b6dbd687 libata: Check PCI... |
1199 |
|
c47a631f8 ata_piix: Invalid... |
1200 |
tmp = ioread32(mmio + AHCI_GLOBAL_CTL); |
1da177e4c Linux-2.6.12-rc2 |
1201 1202 |
if (tmp & AHCI_ENABLE) { tmp &= ~AHCI_ENABLE; |
c47a631f8 ata_piix: Invalid... |
1203 |
iowrite32(tmp, mmio + AHCI_GLOBAL_CTL); |
1da177e4c Linux-2.6.12-rc2 |
1204 |
|
c47a631f8 ata_piix: Invalid... |
1205 |
tmp = ioread32(mmio + AHCI_GLOBAL_CTL); |
1da177e4c Linux-2.6.12-rc2 |
1206 1207 1208 |
if (tmp & AHCI_ENABLE) rc = -EIO; } |
7b6dbd687 libata: Check PCI... |
1209 |
|
374b18735 [libata] update s... |
1210 |
pci_iounmap(pdev, mmio); |
1da177e4c Linux-2.6.12-rc2 |
1211 1212 1213 1214 |
return rc; } /** |
c621b1406 [PATCH] libata: a... |
1215 |
* piix_check_450nx_errata - Check for problem 450NX setup |
c893a3ae4 Various libata do... |
1216 |
* @ata_dev: the PCI device to check |
2e9edbf81 [libata] export a... |
1217 |
* |
c621b1406 [PATCH] libata: a... |
1218 1219 1220 1221 1222 1223 1224 1225 |
* Check for the present of 450NX errata #19 and errata #25. If * they are found return an error code so we can turn off DMA */ static int __devinit piix_check_450nx_errata(struct pci_dev *ata_dev) { struct pci_dev *pdev = NULL; u16 cfg; |
c621b1406 [PATCH] libata: a... |
1226 |
int no_piix_dma = 0; |
2e9edbf81 [libata] export a... |
1227 |
|
2dcb407e6 [libata] checkpat... |
1228 |
while ((pdev = pci_get_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, pdev)) != NULL) { |
c621b1406 [PATCH] libata: a... |
1229 1230 |
/* Look for 450NX PXB. Check for problem configurations A PCI quirk checks bit 6 already */ |
c621b1406 [PATCH] libata: a... |
1231 1232 |
pci_read_config_word(pdev, 0x41, &cfg); /* Only on the original revision: IDE DMA can hang */ |
44c10138f PCI: Change all d... |
1233 |
if (pdev->revision == 0x00) |
c621b1406 [PATCH] libata: a... |
1234 1235 |
no_piix_dma = 1; /* On all revisions below 5 PXB bus lock must be disabled for IDE */ |
44c10138f PCI: Change all d... |
1236 |
else if (cfg & (1<<14) && pdev->revision < 5) |
c621b1406 [PATCH] libata: a... |
1237 1238 |
no_piix_dma = 2; } |
31a34fe75 [PATCH] ata_piix ... |
1239 |
if (no_piix_dma) |
a44fec1fc ata: Convert dev_... |
1240 1241 1242 1243 1244 |
dev_warn(&ata_dev->dev, "450NX errata present, disabling IDE DMA%s ", no_piix_dma == 2 ? " - a BIOS update may resolve this" : ""); |
c621b1406 [PATCH] libata: a... |
1245 |
return no_piix_dma; |
2e9edbf81 [libata] export a... |
1246 |
} |
c621b1406 [PATCH] libata: a... |
1247 |
|
8b09f0da0 ata_piix: convert... |
1248 |
static void __devinit piix_init_pcs(struct ata_host *host, |
ea35d29e2 [libata] ata_piix... |
1249 1250 |
const struct piix_map_db *map_db) { |
8b09f0da0 ata_piix: convert... |
1251 |
struct pci_dev *pdev = to_pci_dev(host->dev); |
ea35d29e2 [libata] ata_piix... |
1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 |
u16 pcs, new_pcs; pci_read_config_word(pdev, ICH5_PCS, &pcs); new_pcs = pcs | map_db->port_enable; if (new_pcs != pcs) { DPRINTK("updating PCS from 0x%x to 0x%x ", pcs, new_pcs); pci_write_config_word(pdev, ICH5_PCS, new_pcs); msleep(150); } } |
8b09f0da0 ata_piix: convert... |
1265 1266 1267 |
static const int *__devinit piix_init_sata_map(struct pci_dev *pdev, struct ata_port_info *pinfo, const struct piix_map_db *map_db) |
d33f58b88 [PATCH] ata_piix:... |
1268 |
{ |
b4482a4b2 more trivial sign... |
1269 |
const int *map; |
d33f58b88 [PATCH] ata_piix:... |
1270 1271 1272 1273 1274 1275 |
int i, invalid_map = 0; u8 map_value; pci_read_config_byte(pdev, ICH5_PMR, &map_value); map = map_db->map[map_value & map_db->mask]; |
a44fec1fc ata: Convert dev_... |
1276 |
dev_info(&pdev->dev, "MAP ["); |
d33f58b88 [PATCH] ata_piix:... |
1277 1278 1279 1280 |
for (i = 0; i < 4; i++) { switch (map[i]) { case RV: invalid_map = 1; |
a44fec1fc ata: Convert dev_... |
1281 |
pr_cont(" XX"); |
d33f58b88 [PATCH] ata_piix:... |
1282 1283 1284 |
break; case NA: |
a44fec1fc ata: Convert dev_... |
1285 |
pr_cont(" --"); |
d33f58b88 [PATCH] ata_piix:... |
1286 1287 1288 1289 |
break; case IDE: WARN_ON((i & 1) || map[i + 1] != IDE); |
669a5db41 [libata] Add a bu... |
1290 |
pinfo[i / 2] = piix_port_info[ich_pata_100]; |
d33f58b88 [PATCH] ata_piix:... |
1291 |
i++; |
a44fec1fc ata: Convert dev_... |
1292 |
pr_cont(" IDE IDE"); |
d33f58b88 [PATCH] ata_piix:... |
1293 1294 1295 |
break; default: |
a44fec1fc ata: Convert dev_... |
1296 |
pr_cont(" P%d", map[i]); |
d33f58b88 [PATCH] ata_piix:... |
1297 |
if (i & 1) |
cca3974e4 libata: Grand ren... |
1298 |
pinfo[i / 2].flags |= ATA_FLAG_SLAVE_POSS; |
d33f58b88 [PATCH] ata_piix:... |
1299 1300 1301 |
break; } } |
a44fec1fc ata: Convert dev_... |
1302 1303 |
pr_cont(" ] "); |
d33f58b88 [PATCH] ata_piix:... |
1304 1305 |
if (invalid_map) |
a44fec1fc ata: Convert dev_... |
1306 1307 |
dev_err(&pdev->dev, "invalid MAP value %u ", map_value); |
d33f58b88 [PATCH] ata_piix:... |
1308 |
|
8b09f0da0 ata_piix: convert... |
1309 |
return map; |
d33f58b88 [PATCH] ata_piix:... |
1310 |
} |
e9c1670c2 ata_piix: add wor... |
1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 |
static bool piix_no_sidpr(struct ata_host *host) { struct pci_dev *pdev = to_pci_dev(host->dev); /* * Samsung DB-P70 only has three ATA ports exposed and * curiously the unconnected first port reports link online * while not responding to SRST protocol causing excessive * detection delay. * * Unfortunately, the system doesn't carry enough DMI * information to identify the machine but does have subsystem * vendor and device set. As it's unclear whether the * subsystem vendor/device is used only for this specific * board, the port can't be disabled solely with the * information; however, turning off SIDPR access works around * the problem. Turn it off. * * This problem is reported in bnc#441240. * * https://bugzilla.novell.com/show_bug.cgi?id=441420 */ if (pdev->vendor == PCI_VENDOR_ID_INTEL && pdev->device == 0x2920 && pdev->subsystem_vendor == PCI_VENDOR_ID_SAMSUNG && pdev->subsystem_device == 0xb049) { |
a44fec1fc ata: Convert dev_... |
1336 1337 1338 |
dev_warn(host->dev, "Samsung DB-P70 detected, disabling SIDPR "); |
e9c1670c2 ata_piix: add wor... |
1339 1340 1341 1342 1343 |
return true; } return false; } |
be77e43ab ata_piix: drop me... |
1344 |
static int __devinit piix_init_sidpr(struct ata_host *host) |
c72907245 ata_piix: impleme... |
1345 1346 1347 |
{ struct pci_dev *pdev = to_pci_dev(host->dev); struct piix_host_priv *hpriv = host->private_data; |
be77e43ab ata_piix: drop me... |
1348 |
struct ata_link *link0 = &host->ports[0]->link; |
cb6716c87 ata_piix: verify ... |
1349 |
u32 scontrol; |
be77e43ab ata_piix: drop me... |
1350 |
int i, rc; |
c72907245 ata_piix: impleme... |
1351 1352 1353 1354 |
/* check for availability */ for (i = 0; i < 4; i++) if (hpriv->map[i] == IDE) |
be77e43ab ata_piix: drop me... |
1355 |
return 0; |
c72907245 ata_piix: impleme... |
1356 |
|
e9c1670c2 ata_piix: add wor... |
1357 1358 1359 |
/* is it blacklisted? */ if (piix_no_sidpr(host)) return 0; |
c72907245 ata_piix: impleme... |
1360 |
if (!(host->ports[0]->flags & PIIX_FLAG_SIDPR)) |
be77e43ab ata_piix: drop me... |
1361 |
return 0; |
c72907245 ata_piix: impleme... |
1362 1363 1364 |
if (pci_resource_start(pdev, PIIX_SIDPR_BAR) == 0 || pci_resource_len(pdev, PIIX_SIDPR_BAR) != PIIX_SIDPR_LEN) |
be77e43ab ata_piix: drop me... |
1365 |
return 0; |
c72907245 ata_piix: impleme... |
1366 1367 |
if (pcim_iomap_regions(pdev, 1 << PIIX_SIDPR_BAR, DRV_NAME)) |
be77e43ab ata_piix: drop me... |
1368 |
return 0; |
c72907245 ata_piix: impleme... |
1369 1370 |
hpriv->sidpr = pcim_iomap_table(pdev)[PIIX_SIDPR_BAR]; |
cb6716c87 ata_piix: verify ... |
1371 1372 1373 1374 1375 |
/* SCR access via SIDPR doesn't work on some configurations. * Give it a test drive by inhibiting power save modes which * we'll do anyway. */ |
be77e43ab ata_piix: drop me... |
1376 |
piix_sidpr_scr_read(link0, SCR_CONTROL, &scontrol); |
cb6716c87 ata_piix: verify ... |
1377 1378 1379 1380 1381 1382 1383 |
/* if IPM is already 3, SCR access is probably working. Don't * un-inhibit power save modes as BIOS might have inhibited * them for a reason. */ if ((scontrol & 0xf00) != 0x300) { scontrol |= 0x300; |
be77e43ab ata_piix: drop me... |
1384 1385 |
piix_sidpr_scr_write(link0, SCR_CONTROL, scontrol); piix_sidpr_scr_read(link0, SCR_CONTROL, &scontrol); |
cb6716c87 ata_piix: verify ... |
1386 1387 |
if ((scontrol & 0xf00) != 0x300) { |
a44fec1fc ata: Convert dev_... |
1388 1389 1390 |
dev_info(host->dev, "SCR access via SIDPR is available but doesn't work "); |
be77e43ab ata_piix: drop me... |
1391 |
return 0; |
cb6716c87 ata_piix: verify ... |
1392 1393 |
} } |
be77e43ab ata_piix: drop me... |
1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 |
/* okay, SCRs available, set ops and ask libata for slave_link */ for (i = 0; i < 2; i++) { struct ata_port *ap = host->ports[i]; ap->ops = &piix_sidpr_sata_ops; if (ap->flags & ATA_FLAG_SLAVE_POSS) { rc = ata_slave_link_init(ap); if (rc) return rc; } } return 0; |
c72907245 ata_piix: impleme... |
1408 |
} |
2852bcf7c ata_piix: save, u... |
1409 |
static void piix_iocfg_bit18_quirk(struct ata_host *host) |
43a98f05d ata_piix: impleme... |
1410 |
{ |
1855256c4 drivers/firmware:... |
1411 |
static const struct dmi_system_id sysids[] = { |
43a98f05d ata_piix: impleme... |
1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 |
{ /* Clevo M570U sets IOCFG bit 18 if the cdrom * isn't used to boot the system which * disables the channel. */ .ident = "M570U", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Clevo Co."), DMI_MATCH(DMI_PRODUCT_NAME, "M570U"), }, }, |
7d0515484 [libata] ata_piix... |
1423 1424 |
{ } /* terminate list */ |
43a98f05d ata_piix: impleme... |
1425 |
}; |
2852bcf7c ata_piix: save, u... |
1426 1427 |
struct pci_dev *pdev = to_pci_dev(host->dev); struct piix_host_priv *hpriv = host->private_data; |
43a98f05d ata_piix: impleme... |
1428 1429 1430 1431 1432 1433 1434 1435 |
if (!dmi_check_system(sysids)) return; /* The datasheet says that bit 18 is NOOP but certain systems * seem to use it to disable a channel. Clear the bit on the * affected systems. */ |
2852bcf7c ata_piix: save, u... |
1436 |
if (hpriv->saved_iocfg & (1 << 18)) { |
a44fec1fc ata: Convert dev_... |
1437 1438 |
dev_info(&pdev->dev, "applying IOCFG bit18 quirk "); |
2852bcf7c ata_piix: save, u... |
1439 1440 |
pci_write_config_dword(pdev, PIIX_IOCFG, hpriv->saved_iocfg & ~(1 << 18)); |
43a98f05d ata_piix: impleme... |
1441 1442 |
} } |
5f451fe1a SATA PIIX: Blackl... |
1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 |
static bool piix_broken_system_poweroff(struct pci_dev *pdev) { static const struct dmi_system_id broken_systems[] = { { .ident = "HP Compaq 2510p", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq 2510p"), }, /* PCI slot number of the controller */ .driver_data = (void *)0x1FUL, }, |
65e316431 ata_piix: Add HP ... |
1455 1456 1457 1458 1459 1460 1461 1462 1463 |
{ .ident = "HP Compaq nc6000", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq nc6000"), }, /* PCI slot number of the controller */ .driver_data = (void *)0x1FUL, }, |
5f451fe1a SATA PIIX: Blackl... |
1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 |
{ } /* terminate list */ }; const struct dmi_system_id *dmi = dmi_first_match(broken_systems); if (dmi) { unsigned long slot = (unsigned long)dmi->driver_data; /* apply the quirk only to on-board controllers */ return slot == PCI_SLOT(pdev->devfn); } return false; } |
c621b1406 [PATCH] libata: a... |
1477 |
/** |
1da177e4c Linux-2.6.12-rc2 |
1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 |
* piix_init_one - Register PIIX ATA PCI device with kernel services * @pdev: PCI device to register * @ent: Entry in piix_pci_tbl matching with @pdev * * Called from kernel PCI layer. We probe for combined mode (sigh), * and then hand over control to libata, for it to do the rest. * * LOCKING: * Inherited from PCI layer (may sleep). * * RETURNS: * Zero on success, or -ERRNO value. */ |
bc5468f52 ata_piix.c:piix_i... |
1491 1492 |
static int __devinit piix_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) |
1da177e4c Linux-2.6.12-rc2 |
1493 |
{ |
24dc5f33e libata: update li... |
1494 |
struct device *dev = &pdev->dev; |
d33f58b88 [PATCH] ata_piix:... |
1495 |
struct ata_port_info port_info[2]; |
1626aeb88 libata: clean up ... |
1496 |
const struct ata_port_info *ppi[] = { &port_info[0], &port_info[1] }; |
a97c40068 ata_piix: impleme... |
1497 |
struct scsi_host_template *sht = &piix_sht; |
cca3974e4 libata: Grand ren... |
1498 |
unsigned long port_flags; |
8b09f0da0 ata_piix: convert... |
1499 1500 1501 |
struct ata_host *host; struct piix_host_priv *hpriv; int rc; |
1da177e4c Linux-2.6.12-rc2 |
1502 |
|
06296a1e6 ata: Add and use ... |
1503 |
ata_print_version_once(&pdev->dev, DRV_VERSION); |
1da177e4c Linux-2.6.12-rc2 |
1504 |
|
347979a03 ata_piix: Turn on... |
1505 1506 |
/* no hotplugging support for later devices (FIXME) */ if (!in_module_init && ent->driver_data >= ich5_sata) |
1da177e4c Linux-2.6.12-rc2 |
1507 |
return -ENODEV; |
5f451fe1a SATA PIIX: Blackl... |
1508 1509 1510 1511 1512 1513 1514 1515 |
if (piix_broken_system_poweroff(pdev)) { piix_port_info[ent->driver_data].flags |= ATA_FLAG_NO_POWEROFF_SPINDOWN | ATA_FLAG_NO_HIBERNATE_SPINDOWN; dev_info(&pdev->dev, "quirky BIOS, skipping spindown " "on poweroff and hibernation "); } |
8b09f0da0 ata_piix: convert... |
1516 1517 1518 1519 1520 1521 1522 1523 1524 |
port_info[0] = piix_port_info[ent->driver_data]; port_info[1] = piix_port_info[ent->driver_data]; port_flags = port_info[0].flags; /* enable device and prepare host */ rc = pcim_enable_device(pdev); if (rc) return rc; |
2852bcf7c ata_piix: save, u... |
1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 |
hpriv = devm_kzalloc(dev, sizeof(*hpriv), GFP_KERNEL); if (!hpriv) return -ENOMEM; /* Save IOCFG, this will be used for cable detection, quirk * detection and restoration on detach. This is necessary * because some ACPI implementations mess up cable related * bits on _STM. Reported on kernel bz#11879. */ pci_read_config_dword(pdev, PIIX_IOCFG, &hpriv->saved_iocfg); |
5016d7d21 ata_piix: don't a... |
1535 1536 1537 1538 1539 |
/* ICH6R may be driven by either ata_piix or ahci driver * regardless of BIOS configuration. Make sure AHCI mode is * off. */ if (pdev->vendor == PCI_VENDOR_ID_INTEL && pdev->device == 0x2652) { |
da3ceb228 ata: duplicate va... |
1540 |
rc = piix_disable_ahci(pdev); |
5016d7d21 ata_piix: don't a... |
1541 1542 1543 |
if (rc) return rc; } |
8b09f0da0 ata_piix: convert... |
1544 |
/* SATA map init can change port_info, do it before prepping host */ |
8b09f0da0 ata_piix: convert... |
1545 1546 1547 |
if (port_flags & ATA_FLAG_SATA) hpriv->map = piix_init_sata_map(pdev, port_info, piix_map_db_table[ent->driver_data]); |
1da177e4c Linux-2.6.12-rc2 |
1548 |
|
1c5afdf7a libata-sff: separ... |
1549 |
rc = ata_pci_bmdma_prepare_host(pdev, ppi, &host); |
8b09f0da0 ata_piix: convert... |
1550 1551 1552 |
if (rc) return rc; host->private_data = hpriv; |
ff0fc1467 [PATCH] ata_piix:... |
1553 |
|
8b09f0da0 ata_piix: convert... |
1554 |
/* initialize controller */ |
c72907245 ata_piix: impleme... |
1555 |
if (port_flags & ATA_FLAG_SATA) { |
8b09f0da0 ata_piix: convert... |
1556 |
piix_init_pcs(host, piix_map_db_table[ent->driver_data]); |
be77e43ab ata_piix: drop me... |
1557 1558 1559 |
rc = piix_init_sidpr(host); if (rc) return rc; |
a97c40068 ata_piix: impleme... |
1560 1561 |
if (host->ports[0]->ops == &piix_sidpr_sata_ops) sht = &piix_sidpr_sht; |
c72907245 ata_piix: impleme... |
1562 |
} |
1da177e4c Linux-2.6.12-rc2 |
1563 |
|
43a98f05d ata_piix: impleme... |
1564 |
/* apply IOCFG bit18 quirk */ |
2852bcf7c ata_piix: save, u... |
1565 |
piix_iocfg_bit18_quirk(host); |
43a98f05d ata_piix: impleme... |
1566 |
|
1da177e4c Linux-2.6.12-rc2 |
1567 1568 1569 1570 1571 1572 |
/* On ICH5, some BIOSen disable the interrupt using the * PCI_COMMAND_INTX_DISABLE bit added in PCI 2.3. * On ICH6, this bit has the same effect, but only when * MSI is disabled (and it is disabled, as we don't use * message-signalled interrupts currently). */ |
cca3974e4 libata: Grand ren... |
1573 |
if (port_flags & PIIX_FLAG_CHECKINTR) |
a04ce0ffc [PATCH] PCI/libat... |
1574 |
pci_intx(pdev, 1); |
1da177e4c Linux-2.6.12-rc2 |
1575 |
|
c621b1406 [PATCH] libata: a... |
1576 1577 1578 1579 |
if (piix_check_450nx_errata(pdev)) { /* This writes into the master table but it does not really matter for this errata as we will apply it to all the PIIX devices on the board */ |
8b09f0da0 ata_piix: convert... |
1580 1581 1582 1583 |
host->ports[0]->mwdma_mask = 0; host->ports[0]->udma_mask = 0; host->ports[1]->mwdma_mask = 0; host->ports[1]->udma_mask = 0; |
c621b1406 [PATCH] libata: a... |
1584 |
} |
517d3cc15 [libata] ata_piix... |
1585 |
host->flags |= ATA_HOST_PARALLEL_SCAN; |
8b09f0da0 ata_piix: convert... |
1586 1587 |
pci_set_master(pdev); |
a97c40068 ata_piix: impleme... |
1588 |
return ata_pci_sff_activate_host(host, ata_bmdma_interrupt, sht); |
1da177e4c Linux-2.6.12-rc2 |
1589 |
} |
2852bcf7c ata_piix: save, u... |
1590 1591 1592 1593 1594 1595 1596 1597 1598 |
static void piix_remove_one(struct pci_dev *pdev) { struct ata_host *host = dev_get_drvdata(&pdev->dev); struct piix_host_priv *hpriv = host->private_data; pci_write_config_dword(pdev, PIIX_IOCFG, hpriv->saved_iocfg); ata_pci_remove_one(pdev); } |
1da177e4c Linux-2.6.12-rc2 |
1599 1600 1601 |
static int __init piix_init(void) { int rc; |
b7887196e [PATCH] libata: r... |
1602 1603 1604 |
DPRINTK("pci_register_driver "); rc = pci_register_driver(&piix_pci_driver); |
1da177e4c Linux-2.6.12-rc2 |
1605 1606 1607 1608 1609 1610 1611 1612 1613 |
if (rc) return rc; in_module_init = 0; DPRINTK("done "); return 0; } |
1da177e4c Linux-2.6.12-rc2 |
1614 1615 1616 1617 1618 1619 1620 |
static void __exit piix_exit(void) { pci_unregister_driver(&piix_pci_driver); } module_init(piix_init); module_exit(piix_exit); |