1 Index: linux-2.4.35.4/drivers/ide/pci/aec62xx.c
2 ===================================================================
3 --- linux-2.4.35.4.orig/drivers/ide/pci/aec62xx.c 2007-12-15 05:19:35.958470194 +0100
4 +++ linux-2.4.35.4/drivers/ide/pci/aec62xx.c 2007-12-15 05:20:16.928804961 +0100
7 * Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org>
9 + * With Broadcom 4780 patches
13 #include <linux/module.h>
15 ide_hwif_t *hwif = HWIF(drive);
16 struct hd_driveid *id = drive->id;
18 +#ifndef CONFIG_BCM947XX
19 if ((id->capability & 1) && drive->autodma) {
23 /* Consult the list of known "bad" drives */
24 if (hwif->ide_dma_bad_drive(drive))
28 int bus_speed = system_bus_clock();
30 +#ifndef CONFIG_BCM947XX
31 if (dev->resource[PCI_ROM_RESOURCE].start) {
32 pci_write_config_dword(dev, PCI_ROM_ADDRESS, dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
33 printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n", name, dev->resource[PCI_ROM_RESOURCE].start);
36 + if (dev->resource[PCI_ROM_RESOURCE].start) {
37 + pci_write_config_dword(dev, PCI_ROM_ADDRESS,
38 + dev->resource[PCI_ROM_RESOURCE].
39 + start | PCI_ROM_ADDRESS_ENABLE);
41 + pci_write_config_dword(dev, PCI_ROM_ADDRESS,
42 + dev->resource[PCI_ROM_RESOURCE].
46 + /* Set IDE controller parameters manually - FIXME: replace magic values */
50 + pci_write_config_word(dev, PCI_COMMAND, 0x0007);
51 + //pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x5A);
52 + pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x13);
54 + pci_write_config_byte(dev, 0x40, 0x31);
55 + pci_write_config_byte(dev, 0x41, 0x31);
56 + pci_write_config_byte(dev, 0x42, 0x31);
57 + pci_write_config_byte(dev, 0x43, 0x31);
58 + // Set IDE Command Speed
59 + pci_write_config_byte(dev, 0x48, 0x31);
61 + // Disable WriteSubSysID & PIOROM
62 + pci_read_config_byte(dev, 0x49, &setting);
64 + pci_write_config_byte(dev, 0x49, setting);
66 + // Enable PCI burst & INTA & PCI memory read multiple, FIFO threshold=80
67 + pci_read_config_byte(dev, 0x4A, &setting);
68 + //setting = (setting & 0xFE) | 0xA8;
69 + setting = (setting & 0xFE) | 0xD8;
70 + setting = (setting & 0xF7);
71 + pci_write_config_byte(dev, 0x4A, setting);
73 + //pci_write_config_byte(dev, 0x4B, 0x20);
74 + pci_write_config_byte(dev, 0x4B, 0x2C);
75 + //pci_write_config_byte(dev, 0x4B, 0x0C);
77 + // Set PreRead count: 512 byte
78 + pci_write_config_byte(dev, 0x4C, 0);
79 + pci_write_config_word(dev, 0x4D, 0x0002);
80 + pci_write_config_byte(dev, 0x54, 0);
81 + pci_write_config_word(dev, 0x55, 0x0002);
85 #if defined(DISPLAY_AEC62XX_TIMINGS) && defined(CONFIG_PROC_FS)
86 aec_devs[n_aec_devs++] = dev;
89 static void __init init_setup_aec6x80 (struct pci_dev *dev, ide_pci_device_t *d)
91 +#ifndef CONFIG_BCM947XX /* Causes OOPS on BCM4780 */
92 unsigned long bar4reg = pci_resource_start(dev, 4);
94 if (inb(bar4reg+2) & 0x10) {
96 strcpy(d->name, "AEC6280R");
100 ide_setup_pci_device(dev, d);