summaryrefslogtreecommitdiff
path: root/packages/linux/nas100d-kernel
diff options
context:
space:
mode:
authorRod Whitby <rod@whitby.id.au>2005-11-11 15:31:02 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2005-11-11 15:31:02 +0000
commit53933a30544a77e3dd40a62ef810a6d37c275f68 (patch)
treee7d105fe0d30bfc54b65f063f3d18e48ee1a0eae /packages/linux/nas100d-kernel
parent9641598e03d1e440ddd4de61fe32c584fbcece59 (diff)
nas100d-kernel: Added 60-nas100d-ide.patch from azummo
Diffstat (limited to 'packages/linux/nas100d-kernel')
-rw-r--r--packages/linux/nas100d-kernel/2.6.14/60-nas100d-ide.patch117
1 files changed, 117 insertions, 0 deletions
diff --git a/packages/linux/nas100d-kernel/2.6.14/60-nas100d-ide.patch b/packages/linux/nas100d-kernel/2.6.14/60-nas100d-ide.patch
new file mode 100644
index 0000000000..7928266b32
--- /dev/null
+++ b/packages/linux/nas100d-kernel/2.6.14/60-nas100d-ide.patch
@@ -0,0 +1,117 @@
+ drivers/ide/pci/aec62xx.c | 36 +++++++++++++++++++++++++++++++++---
+ drivers/ide/setup-pci.c | 9 ++++++++-
+ 2 files changed, 41 insertions(+), 4 deletions(-)
+
+--- linux-2.6.14.orig/drivers/ide/pci/aec62xx.c 2005-11-12 15:31:31.000000000 +0100
++++ linux-2.6.14/drivers/ide/pci/aec62xx.c 2005-11-12 15:32:57.000000000 +0100
+@@ -143,7 +143,13 @@ static int aec6210_tune_chipset (ide_dri
+ u8 ultra = 0, ultra_conf = 0;
+ u8 tmp0 = 0, tmp1 = 0, tmp2 = 0;
+ unsigned long flags;
+-
++#ifdef CONFIG_MACH_NAS100D
++ byte reg4ah;
++ pci_write_config_byte(hwif->pci_dev, PCI_LATENCY_TIMER, 0x90);
++ /* Enable burst mode & force 2 ports enable */
++ pci_read_config_byte(hwif->pci_dev, 0x4a, &reg4ah);
++ pci_write_config_byte(hwif->pci_dev, 0x4a, reg4ah | 0x80);
++#endif
+ local_irq_save(flags);
+ /* 0x40|(2*drive->dn): Active, 0x41|(2*drive->dn): Recovery */
+ pci_read_config_word(dev, 0x40|(2*drive->dn), &d_conf);
+@@ -263,7 +269,7 @@ static int aec62xx_irq_timeout (ide_driv
+ case PCI_DEVICE_ID_ARTOP_ATP865:
+ case PCI_DEVICE_ID_ARTOP_ATP865R:
+ printk(" AEC62XX time out ");
+-#if 0
++#ifdef CONFIG_MACH_NAS100D
+ {
+ int i = 0;
+ u8 reg49h = 0;
+@@ -277,7 +283,7 @@ static int aec62xx_irq_timeout (ide_driv
+ default:
+ break;
+ }
+-#if 0
++#ifdef CONFIG_MACH_NAS100D
+ {
+ ide_hwif_t *hwif = HWIF(drive);
+ struct pci_dev *dev = hwif->pci_dev;
+@@ -299,6 +305,13 @@ static unsigned int __devinit init_chips
+ {
+ int bus_speed = system_bus_clock();
+
++#ifdef CONFIG_MACH_NAS100D
++ /* enable both ports */
++ byte tmp;
++ pci_read_config_byte(dev, 0x4a, &tmp);
++ pci_write_config_byte(dev, 0x4a, tmp | 0x06);
++#endif
++
+ if (dev->resource[PCI_ROM_RESOURCE].start) {
+ pci_write_config_dword(dev, PCI_ROM_ADDRESS, dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
+ printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n", name, dev->resource[PCI_ROM_RESOURCE].start);
+@@ -312,11 +325,22 @@ static unsigned int __devinit init_chips
+ return dev->irq;
+ }
+
++#ifdef CONFIG_MACH_NAS100D
++void nas100d_outw(u16 addr, unsigned long port)
++{
++ outsw(port, &addr, 1);
++}
++#endif
++
+ static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif)
+ {
+ hwif->autodma = 0;
+ hwif->tuneproc = &aec62xx_tune_drive;
+ hwif->speedproc = &aec62xx_tune_chipset;
++#ifdef CONFIG_MACH_NAS100D
++ printk(KERN_INFO "aec62xx: nas100d workaround\n");
++ hwif->OUTW = nas100d_outw;
++#endif
+
+ if (hwif->pci_dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) {
+ hwif->serialized = hwif->channel;
+@@ -408,6 +432,9 @@ static ide_pci_device_t aec62xx_chipsets
+ .init_dma = init_dma_aec62xx,
+ .channels = 2,
+ .autodma = NOAUTODMA,
++#ifdef CONFIG_MACH_NAS100D
++ .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
++#endif
+ .bootable = OFF_BOARD,
+ },{ /* 2 */
+ .name = "AEC6260R",
+@@ -427,6 +454,9 @@ static ide_pci_device_t aec62xx_chipsets
+ .init_dma = init_dma_aec62xx,
+ .channels = 2,
+ .autodma = AUTODMA,
++#ifdef CONFIG_MACH_NAS100D
++ .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
++#endif
+ .bootable = OFF_BOARD,
+ },{ /* 4 */
+ .name = "AEC6X80R",
+--- linux-2.6.14.orig/drivers/ide/setup-pci.c 2005-11-12 14:33:27.000000000 +0100
++++ linux-2.6.14/drivers/ide/setup-pci.c 2005-11-12 15:32:57.000000000 +0100
+@@ -602,10 +602,17 @@ void ide_pci_setup_ports(struct pci_dev
+ if ((d->flags & IDEPCI_FLAG_FORCE_PDC) &&
+ (secondpdc++==1) && (port==1))
+ goto controller_ok;
+-
++
++#ifdef CONFIG_MACH_NAS100D
++// XXX ????
++ pci_read_config_byte(dev, e->reg, &tmp);
++ pci_write_config_byte(dev, e->reg, tmp & ~0x01);
++#endif
+ if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) ||
+ (tmp & e->mask) != e->val))
+ continue; /* port not enabled */
++
++
+ controller_ok:
+
+ if (d->channels <= port)