aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-11-01 00:17:23 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-11-01 00:17:23 -0500
commit30574b61611ccd29677989097f8c8a5d9a73d873 (patch)
tree8385fb5018037402db9adb727b9755bc5b43ac92
parent0ca43235b34c92278fa903297acef37198ec3e26 (diff)
parentc6446a4cdadaf411bafe1565e9fa7666f3c2fe95 (diff)
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev: [PATCH] ata_piix: allow 01b MAP for both ICH6M and ICH7M [PATCH] libata: unexport ata_dev_revalidate() [PATCH] Add 0x7110 piix to ata_piix.c [PATCH] sata_sis: fix flags handling for the secondary port
-rw-r--r--drivers/ata/ata_piix.c38
-rw-r--r--drivers/ata/libata-core.c1
-rw-r--r--drivers/ata/libata.h1
-rw-r--r--drivers/ata/sata_sis.c21
-rw-r--r--include/linux/libata.h1
5 files changed, 17 insertions, 45 deletions
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 5250187ffce2..8385387c49cd 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -126,8 +126,7 @@ enum {
126 ich6_sata = 7, 126 ich6_sata = 7,
127 ich6_sata_ahci = 8, 127 ich6_sata_ahci = 8,
128 ich6m_sata_ahci = 9, 128 ich6m_sata_ahci = 9,
129 ich7m_sata_ahci = 10, 129 ich8_sata_ahci = 10,
130 ich8_sata_ahci = 11,
131 130
132 /* constants for mapping table */ 131 /* constants for mapping table */
133 P0 = 0, /* port 0 */ 132 P0 = 0, /* port 0 */
@@ -169,6 +168,7 @@ static const struct pci_device_id piix_pci_tbl[] = {
169#ifdef ATA_ENABLE_PATA 168#ifdef ATA_ENABLE_PATA
170 /* Intel PIIX4 for the 430TX/440BX/MX chipset: UDMA 33 */ 169 /* Intel PIIX4 for the 430TX/440BX/MX chipset: UDMA 33 */
171 /* Also PIIX4E (fn3 rev 2) and PIIX4M (fn3 rev 3) */ 170 /* Also PIIX4E (fn3 rev 2) and PIIX4M (fn3 rev 3) */
171 { 0x8086, 0x7110, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix_pata_33 },
172 { 0x8086, 0x7111, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix_pata_33 }, 172 { 0x8086, 0x7111, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix_pata_33 },
173 { 0x8086, 0x24db, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 }, 173 { 0x8086, 0x24db, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 },
174 { 0x8086, 0x25a2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 }, 174 { 0x8086, 0x25a2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 },
@@ -227,7 +227,7 @@ static const struct pci_device_id piix_pci_tbl[] = {
227 /* 82801GB/GR/GH (ICH7, identical to ICH6) */ 227 /* 82801GB/GR/GH (ICH7, identical to ICH6) */
228 { 0x8086, 0x27c0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci }, 228 { 0x8086, 0x27c0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci },
229 /* 2801GBM/GHM (ICH7M, identical to ICH6M) */ 229 /* 2801GBM/GHM (ICH7M, identical to ICH6M) */
230 { 0x8086, 0x27c4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich7m_sata_ahci }, 230 { 0x8086, 0x27c4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6m_sata_ahci },
231 /* Enterprise Southbridge 2 (where's the datasheet?) */ 231 /* Enterprise Southbridge 2 (where's the datasheet?) */
232 { 0x8086, 0x2680, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci }, 232 { 0x8086, 0x2680, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci },
233 /* SATA Controller 1 IDE (ICH8, no datasheet yet) */ 233 /* SATA Controller 1 IDE (ICH8, no datasheet yet) */
@@ -399,23 +399,10 @@ static const struct piix_map_db ich6m_map_db = {
399 .mask = 0x3, 399 .mask = 0x3,
400 .port_enable = 0x5, 400 .port_enable = 0x5,
401 .present_shift = 4, 401 .present_shift = 4,
402 .map = {
403 /* PM PS SM SS MAP */
404 { P0, P2, RV, RV }, /* 00b */
405 { RV, RV, RV, RV },
406 { P0, P2, IDE, IDE }, /* 10b */
407 { RV, RV, RV, RV },
408 },
409};
410
411static const struct piix_map_db ich7m_map_db = {
412 .mask = 0x3,
413 .port_enable = 0x5,
414 .present_shift = 4,
415 402
416 /* Map 01b isn't specified in the doc but some notebooks use 403 /* Map 01b isn't specified in the doc but some notebooks use
417 * it anyway. ATM, the only case spotted carries subsystem ID 404 * it anyway. MAP 01b have been spotted on both ICH6M and
418 * 1025:0107. This is the only difference from ich6m. 405 * ICH7M.
419 */ 406 */
420 .map = { 407 .map = {
421 /* PM PS SM SS MAP */ 408 /* PM PS SM SS MAP */
@@ -445,7 +432,6 @@ static const struct piix_map_db *piix_map_db_table[] = {
445 [ich6_sata] = &ich6_map_db, 432 [ich6_sata] = &ich6_map_db,
446 [ich6_sata_ahci] = &ich6_map_db, 433 [ich6_sata_ahci] = &ich6_map_db,
447 [ich6m_sata_ahci] = &ich6m_map_db, 434 [ich6m_sata_ahci] = &ich6m_map_db,
448 [ich7m_sata_ahci] = &ich7m_map_db,
449 [ich8_sata_ahci] = &ich8_map_db, 435 [ich8_sata_ahci] = &ich8_map_db,
450}; 436};
451 437
@@ -556,19 +542,7 @@ static struct ata_port_info piix_port_info[] = {
556 .port_ops = &piix_sata_ops, 542 .port_ops = &piix_sata_ops,
557 }, 543 },
558 544
559 /* ich7m_sata_ahci: 10 */ 545 /* ich8_sata_ahci: 10 */
560 {
561 .sht = &piix_sht,
562 .flags = ATA_FLAG_SATA |
563 PIIX_FLAG_CHECKINTR | PIIX_FLAG_SCR |
564 PIIX_FLAG_AHCI,
565 .pio_mask = 0x1f, /* pio0-4 */
566 .mwdma_mask = 0x07, /* mwdma0-2 */
567 .udma_mask = 0x7f, /* udma0-6 */
568 .port_ops = &piix_sata_ops,
569 },
570
571 /* ich8_sata_ahci: 11 */
572 { 546 {
573 .sht = &piix_sht, 547 .sht = &piix_sht,
574 .flags = ATA_FLAG_SATA | 548 .flags = ATA_FLAG_SATA |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 83728a9457ad..a8fd0c3e59b3 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -6122,7 +6122,6 @@ EXPORT_SYMBOL_GPL(ata_std_prereset);
6122EXPORT_SYMBOL_GPL(ata_std_softreset); 6122EXPORT_SYMBOL_GPL(ata_std_softreset);
6123EXPORT_SYMBOL_GPL(sata_std_hardreset); 6123EXPORT_SYMBOL_GPL(sata_std_hardreset);
6124EXPORT_SYMBOL_GPL(ata_std_postreset); 6124EXPORT_SYMBOL_GPL(ata_std_postreset);
6125EXPORT_SYMBOL_GPL(ata_dev_revalidate);
6126EXPORT_SYMBOL_GPL(ata_dev_classify); 6125EXPORT_SYMBOL_GPL(ata_dev_classify);
6127EXPORT_SYMBOL_GPL(ata_dev_pair); 6126EXPORT_SYMBOL_GPL(ata_dev_pair);
6128EXPORT_SYMBOL_GPL(ata_port_disable); 6127EXPORT_SYMBOL_GPL(ata_port_disable);
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
index a5ecb71390a9..0ed263be652a 100644
--- a/drivers/ata/libata.h
+++ b/drivers/ata/libata.h
@@ -53,6 +53,7 @@ extern unsigned ata_exec_internal(struct ata_device *dev,
53extern unsigned int ata_do_simple_cmd(struct ata_device *dev, u8 cmd); 53extern unsigned int ata_do_simple_cmd(struct ata_device *dev, u8 cmd);
54extern int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class, 54extern int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
55 int post_reset, u16 *id); 55 int post_reset, u16 *id);
56extern int ata_dev_revalidate(struct ata_device *dev, int post_reset);
56extern int ata_dev_configure(struct ata_device *dev, int print_info); 57extern int ata_dev_configure(struct ata_device *dev, int print_info);
57extern int sata_down_spd_limit(struct ata_port *ap); 58extern int sata_down_spd_limit(struct ata_port *ap);
58extern int sata_set_spd_needed(struct ata_port *ap); 59extern int sata_set_spd_needed(struct ata_port *ap);
diff --git a/drivers/ata/sata_sis.c b/drivers/ata/sata_sis.c
index 0738f52463a9..9d1235ba06b1 100644
--- a/drivers/ata/sata_sis.c
+++ b/drivers/ata/sata_sis.c
@@ -240,7 +240,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
240 struct ata_probe_ent *probe_ent = NULL; 240 struct ata_probe_ent *probe_ent = NULL;
241 int rc; 241 int rc;
242 u32 genctl; 242 u32 genctl;
243 struct ata_port_info *ppi[2]; 243 struct ata_port_info pi = sis_port_info, *ppi[2] = { &pi, &pi };
244 int pci_dev_busy = 0; 244 int pci_dev_busy = 0;
245 u8 pmr; 245 u8 pmr;
246 u8 port2_start; 246 u8 port2_start;
@@ -265,27 +265,20 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
265 if (rc) 265 if (rc)
266 goto err_out_regions; 266 goto err_out_regions;
267 267
268 ppi[0] = ppi[1] = &sis_port_info;
269 probe_ent = ata_pci_init_native_mode(pdev, ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
270 if (!probe_ent) {
271 rc = -ENOMEM;
272 goto err_out_regions;
273 }
274
275 /* check and see if the SCRs are in IO space or PCI cfg space */ 268 /* check and see if the SCRs are in IO space or PCI cfg space */
276 pci_read_config_dword(pdev, SIS_GENCTL, &genctl); 269 pci_read_config_dword(pdev, SIS_GENCTL, &genctl);
277 if ((genctl & GENCTL_IOMAPPED_SCR) == 0) 270 if ((genctl & GENCTL_IOMAPPED_SCR) == 0)
278 probe_ent->port_flags |= SIS_FLAG_CFGSCR; 271 pi.flags |= SIS_FLAG_CFGSCR;
279 272
280 /* if hardware thinks SCRs are in IO space, but there are 273 /* if hardware thinks SCRs are in IO space, but there are
281 * no IO resources assigned, change to PCI cfg space. 274 * no IO resources assigned, change to PCI cfg space.
282 */ 275 */
283 if ((!(probe_ent->port_flags & SIS_FLAG_CFGSCR)) && 276 if ((!(pi.flags & SIS_FLAG_CFGSCR)) &&
284 ((pci_resource_start(pdev, SIS_SCR_PCI_BAR) == 0) || 277 ((pci_resource_start(pdev, SIS_SCR_PCI_BAR) == 0) ||
285 (pci_resource_len(pdev, SIS_SCR_PCI_BAR) < 128))) { 278 (pci_resource_len(pdev, SIS_SCR_PCI_BAR) < 128))) {
286 genctl &= ~GENCTL_IOMAPPED_SCR; 279 genctl &= ~GENCTL_IOMAPPED_SCR;
287 pci_write_config_dword(pdev, SIS_GENCTL, genctl); 280 pci_write_config_dword(pdev, SIS_GENCTL, genctl);
288 probe_ent->port_flags |= SIS_FLAG_CFGSCR; 281 pi.flags |= SIS_FLAG_CFGSCR;
289 } 282 }
290 283
291 pci_read_config_byte(pdev, SIS_PMR, &pmr); 284 pci_read_config_byte(pdev, SIS_PMR, &pmr);
@@ -306,6 +299,12 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
306 port2_start = 0x20; 299 port2_start = 0x20;
307 } 300 }
308 301
302 probe_ent = ata_pci_init_native_mode(pdev, ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
303 if (!probe_ent) {
304 rc = -ENOMEM;
305 goto err_out_regions;
306 }
307
309 if (!(probe_ent->port_flags & SIS_FLAG_CFGSCR)) { 308 if (!(probe_ent->port_flags & SIS_FLAG_CFGSCR)) {
310 probe_ent->port[0].scr_addr = 309 probe_ent->port[0].scr_addr =
311 pci_resource_start(pdev, SIS_SCR_PCI_BAR); 310 pci_resource_start(pdev, SIS_SCR_PCI_BAR);
diff --git a/include/linux/libata.h b/include/linux/libata.h
index b03d5a340dc8..abd2debebca2 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -702,7 +702,6 @@ extern int ata_std_prereset(struct ata_port *ap);
702extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes); 702extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes);
703extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class); 703extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class);
704extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes); 704extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes);
705extern int ata_dev_revalidate(struct ata_device *dev, int post_reset);
706extern void ata_port_disable(struct ata_port *); 705extern void ata_port_disable(struct ata_port *);
707extern void ata_std_ports(struct ata_ioports *ioaddr); 706extern void ata_std_ports(struct ata_ioports *ioaddr);
708#ifdef CONFIG_PCI 707#ifdef CONFIG_PCI