diff options
author | Uwe Koziolek <uwe.koziolek@gmx.net> | 2006-11-08 03:57:00 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-01 22:42:51 -0500 |
commit | 4adccf6f447dfa7af6f3af7e12f87829a6fac8dd (patch) | |
tree | 4bce767b051637153c734e7dfa15ce3995d25df0 | |
parent | 98fa4b60c673526fdd478d9719e41cd9e2b84986 (diff) |
[PATCH] sata_sis: slave support on SiS965
SiS965 and SiS180 chips must support slave mode,
SiS965L and SiS964 chips must not support slave mode.
SCR_STATUS for SATA ports in powerdown state fixed.
Now returning 0x0113 instead of 0x0117. Avoids problem
on detecting sata_sis controller.
Signed-off-by: Uwe Koziolek <uwe.koziolek@gmx.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r-- | drivers/ata/sata_sis.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/ata/sata_sis.c b/drivers/ata/sata_sis.c index 9d1235ba06b1..9c25a1e91730 100644 --- a/drivers/ata/sata_sis.c +++ b/drivers/ata/sata_sis.c | |||
@@ -173,7 +173,7 @@ static u32 sis_scr_cfg_read (struct ata_port *ap, unsigned int sc_reg) | |||
173 | if ((pdev->device == 0x182) || (pmr & SIS_PMR_COMBINED)) | 173 | if ((pdev->device == 0x182) || (pmr & SIS_PMR_COMBINED)) |
174 | pci_read_config_dword(pdev, cfg_addr+0x10, &val2); | 174 | pci_read_config_dword(pdev, cfg_addr+0x10, &val2); |
175 | 175 | ||
176 | return val|val2; | 176 | return (val|val2) & 0xfffffffb; /* avoid problems with powerdowned ports */ |
177 | } | 177 | } |
178 | 178 | ||
179 | static void sis_scr_cfg_write (struct ata_port *ap, unsigned int scr, u32 val) | 179 | static void sis_scr_cfg_write (struct ata_port *ap, unsigned int scr, u32 val) |
@@ -212,7 +212,7 @@ static u32 sis_scr_read (struct ata_port *ap, unsigned int sc_reg) | |||
212 | if ((pdev->device == 0x182) || (pmr & SIS_PMR_COMBINED)) | 212 | if ((pdev->device == 0x182) || (pmr & SIS_PMR_COMBINED)) |
213 | val2 = inl(ap->ioaddr.scr_addr + (sc_reg * 4) + 0x10); | 213 | val2 = inl(ap->ioaddr.scr_addr + (sc_reg * 4) + 0x10); |
214 | 214 | ||
215 | return val | val2; | 215 | return (val | val2) & 0xfffffffb; |
216 | } | 216 | } |
217 | 217 | ||
218 | static void sis_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val) | 218 | static void sis_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val) |
@@ -239,7 +239,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
239 | static int printed_version; | 239 | static int printed_version; |
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, val; |
243 | struct ata_port_info pi = sis_port_info, *ppi[2] = { &pi, &pi }; | 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; |
@@ -285,17 +285,24 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
285 | if (ent->device != 0x182) { | 285 | if (ent->device != 0x182) { |
286 | if ((pmr & SIS_PMR_COMBINED) == 0) { | 286 | if ((pmr & SIS_PMR_COMBINED) == 0) { |
287 | dev_printk(KERN_INFO, &pdev->dev, | 287 | dev_printk(KERN_INFO, &pdev->dev, |
288 | "Detected SiS 180/181 chipset in SATA mode\n"); | 288 | "Detected SiS 180/181/964 chipset in SATA mode\n"); |
289 | port2_start = 64; | 289 | port2_start = 64; |
290 | } | 290 | } |
291 | else { | 291 | else { |
292 | dev_printk(KERN_INFO, &pdev->dev, | 292 | dev_printk(KERN_INFO, &pdev->dev, |
293 | "Detected SiS 180/181 chipset in combined mode\n"); | 293 | "Detected SiS 180/181 chipset in combined mode\n"); |
294 | port2_start=0; | 294 | port2_start=0; |
295 | pi.flags |= ATA_FLAG_SLAVE_POSS; | ||
295 | } | 296 | } |
296 | } | 297 | } |
297 | else { | 298 | else { |
298 | dev_printk(KERN_INFO, &pdev->dev, "Detected SiS 182 chipset\n"); | 299 | pci_read_config_dword ( pdev, 0x6C, &val); |
300 | if (val & (1L << 31)) { | ||
301 | dev_printk(KERN_INFO, &pdev->dev, "Detected SiS 182/965 chipset\n"); | ||
302 | pi.flags |= ATA_FLAG_SLAVE_POSS; | ||
303 | } | ||
304 | else | ||
305 | dev_printk(KERN_INFO, &pdev->dev, "Detected SiS 182/965L chipset\n"); | ||
299 | port2_start = 0x20; | 306 | port2_start = 0x20; |
300 | } | 307 | } |
301 | 308 | ||