Skip to content

Commit a744e01

Browse files
Ivan Kokshayskytorvalds
authored andcommitted
alpha: resurrect Cypress IDE quirk
Which was removed in the hope that generic legacy IDE quirk in drivers/pci/probe.c is sufficient for Cypress IDE. It isn't, as this controller has non-standard BAR layout: secondary channel registers are in the BAR0-1 of the second PCI function - not in the BAR2-3 of the same function, as the generic quirk routine assumes. Signed-off-by: Ivan Kokshaysky <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent d559d4a commit a744e01

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

arch/alpha/kernel/pci.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,23 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82378, quirk_i
7171
static void __init
7272
quirk_cypress(struct pci_dev *dev)
7373
{
74+
/* The Notorious Cy82C693 chip. */
75+
76+
/* The generic legacy mode IDE fixup in drivers/pci/probe.c
77+
doesn't work correctly with the Cypress IDE controller as
78+
it has non-standard register layout. Fix that. */
79+
if (dev->class >> 8 == PCI_CLASS_STORAGE_IDE) {
80+
dev->resource[2].start = dev->resource[3].start = 0;
81+
dev->resource[2].end = dev->resource[3].end = 0;
82+
dev->resource[2].flags = dev->resource[3].flags = 0;
83+
if (PCI_FUNC(dev->devfn) == 2) {
84+
dev->resource[0].start = 0x170;
85+
dev->resource[0].end = 0x177;
86+
dev->resource[1].start = 0x376;
87+
dev->resource[1].end = 0x376;
88+
}
89+
}
90+
7491
/* The Cypress bridge responds on the PCI bus in the address range
7592
0xffff0000-0xffffffff (conventional x86 BIOS ROM). There is no
7693
way to turn this off. The bridge also supports several extended

0 commit comments

Comments
 (0)