diff options
Diffstat (limited to 'packages/linux/nas100d-kernel/2.6.14/60-nas100d-ide.patch')
-rw-r--r-- | packages/linux/nas100d-kernel/2.6.14/60-nas100d-ide.patch | 108 |
1 files changed, 67 insertions, 41 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 index 7928266b32..9f5d164356 100644 --- a/packages/linux/nas100d-kernel/2.6.14/60-nas100d-ide.patch +++ b/packages/linux/nas100d-kernel/2.6.14/60-nas100d-ide.patch @@ -1,25 +1,26 @@ - drivers/ide/pci/aec62xx.c | 36 +++++++++++++++++++++++++++++++++--- - drivers/ide/setup-pci.c | 9 ++++++++- - 2 files changed, 41 insertions(+), 4 deletions(-) + drivers/ide/pci/aec62xx.c | 51 +++++++++++++++++++++++++++++++++++++++++++--- + drivers/ide/setup-pci.c | 12 +++++++++- + 2 files changed, 59 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; +--- linux-nas100d.orig/drivers/ide/pci/aec62xx.c 2005-11-12 15:38:03.000000000 +0100 ++++ linux-nas100d/drivers/ide/pci/aec62xx.c 2005-11-13 01:45:26.000000000 +0100 +@@ -145,6 +145,15 @@ static int aec6210_tune_chipset (ide_dri unsigned long flags; -- + + local_irq_save(flags); ++ +#ifdef CONFIG_MACH_NAS100D -+ byte reg4ah; ++ printk(KERN_INFO "aec62xx: nas100d tuning\n"); + 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, ®4ah); -+ pci_write_config_byte(hwif->pci_dev, 0x4a, reg4ah | 0x80); ++ pci_read_config_byte(hwif->pci_dev, 0x4a, &tmp0); ++ pci_write_config_byte(hwif->pci_dev, 0x4a, tmp0 | 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 + tmp0 = pci_bus_clock_list(speed, BUSCLOCK(dev)); +@@ -263,7 +272,7 @@ static int aec62xx_irq_timeout (ide_driv case PCI_DEVICE_ID_ARTOP_ATP865: case PCI_DEVICE_ID_ARTOP_ATP865R: printk(" AEC62XX time out "); @@ -28,7 +29,7 @@ { int i = 0; u8 reg49h = 0; -@@ -277,7 +283,7 @@ static int aec62xx_irq_timeout (ide_driv +@@ -277,7 +286,7 @@ static int aec62xx_irq_timeout (ide_driv default: break; } @@ -37,13 +38,14 @@ { ide_hwif_t *hwif = HWIF(drive); struct pci_dev *dev = hwif->pci_dev; -@@ -299,6 +305,13 @@ static unsigned int __devinit init_chips +@@ -299,6 +308,14 @@ static unsigned int __devinit init_chips { int bus_speed = system_bus_clock(); +#ifdef CONFIG_MACH_NAS100D + /* enable both ports */ + byte tmp; ++ printk(KERN_INFO "%s: nas100d ports enable\n", name); + pci_read_config_byte(dev, 0x4a, &tmp); + pci_write_config_byte(dev, 0x4a, tmp | 0x06); +#endif @@ -51,14 +53,24 @@ 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 +@@ -312,12 +329,35 @@ static unsigned int __devinit init_chips return dev->irq; } +#ifdef CONFIG_MACH_NAS100D -+void nas100d_outw(u16 addr, unsigned long port) ++static void nas100d_insw (unsigned long port, u16 *addr, u32 count) ++{ ++ while (count--) ++ *addr++ = __cpu_to_le16(inw(port)); ++} ++ ++static void nas100d_outw (u16 val, unsigned long port) +{ -+ outsw(port, &addr, 1); ++ u32 n, byte_enables, data; ++ n = port % 4; ++ byte_enables = (0xf & ~(BIT(n) | BIT(n+1))) << IXP4XX_PCI_NP_CBE_BESL; ++ data = val << (8*n); ++ ixp4xx_pci_write(port, byte_enables | NP_CMD_IOWRITE, __le16_to_cpu(data)); +} +#endif + @@ -67,24 +79,26 @@ hwif->autodma = 0; hwif->tuneproc = &aec62xx_tune_drive; hwif->speedproc = &aec62xx_tune_chipset; + +#ifdef CONFIG_MACH_NAS100D -+ printk(KERN_INFO "aec62xx: nas100d workaround\n"); ++ printk(KERN_INFO "aec62xx: enabling nas100d iops\n"); + hwif->OUTW = nas100d_outw; ++ hwif->INSW = nas100d_insw; +#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 + hwif->no_dsc = 1; +@@ -360,7 +400,7 @@ static void __devinit init_dma_aec62xx(i + } else { + u8 ata66 = 0; + pci_read_config_byte(hwif->pci_dev, 0x49, &ata66); +- if (!(hwif->udma_four)) ++ if (!(hwif->udma_four)) + hwif->udma_four = (ata66&(hwif->channel?0x02:0x01))?0:1; + } + +@@ -427,6 +467,9 @@ static ide_pci_device_t aec62xx_chipsets .init_dma = init_dma_aec62xx, .channels = 2, .autodma = AUTODMA, @@ -94,23 +108,35 @@ .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 +@@ -454,6 +497,8 @@ static int __devinit aec62xx_init_one(st + { + ide_pci_device_t *d = &aec62xx_chipsets[id->driver_data]; + ++ printk(KERN_INFO "aec62xx: using config %lx\n", id->driver_data); ++ + return d->init_setup(dev, d); + } + +--- linux-nas100d.orig/drivers/ide/setup-pci.c 2005-11-12 15:38:03.000000000 +0100 ++++ linux-nas100d/drivers/ide/setup-pci.c 2005-11-13 01:36:30.000000000 +0100 +@@ -602,10 +602,20 @@ 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)) ++#ifdef CONFIG_MACH_NAS100D ++ { ++ pci_write_config_byte(dev, e->reg, tmp & ~0x01); ++#endif continue; /* port not enabled */ -+ ++#ifdef CONFIG_MACH_NAS100D ++ } ++ else ++ pci_write_config_byte(dev, e->reg, tmp & ~0x01); ++#endif + controller_ok: |