New driver for Artop [Acard] controllers.
PATCH 1/1 New driver for Artop [Acard] controllers.
Hi!
After getting a couple reports that the Artop driver doesn't work, I decided to take a look at it ... well and I decided that this is impossible to debug, so I rewrote it from scratch instead. I have no documentation nor the actual hardware, so it may be wrong somewhere, but I think definitely less wrong than the original one.
I must say I also thought about preserving the original one for it's humoristic value, consider what the following statements do:
1) #define SPLIT_BYTE(B,H,L) ((H)=(B>>4), (L)=(B-((B>>4)<<4)))
... computation of L is just wonderful - first shift B down, then up again, this clears the lower four bits, and then subtract that from B. What a nice way to write ((B) & 0xf) ...
2) ((art&0x06)==0x06)?"5":((art&0x05)==0x05)?"4":((art&0x04)==0x04)?"3":((art&0x03)==0x03)?"2":((art&0x02)==0x02)?"1":((art&0x01)==0x01)?"0":"?"
... this is a real pearl - what a cool way to compute (art - 1).
2a)
switch(speed) {
case 7: return "6";
case 6: return "5";
case 5: return "4";
case 4: return "3";
case 3: return "2";
case 2: return "1";
case 1: return "0";
case 0: return "?";
}... another one, for the same purpose with a different chip version.
3) ((0x00 << (2*drive->dn))
... no comment
Signature · 2 lines
Vojtech Pavlik SuSE Labs
[email protected], 2002-05-24 15:34:29+02:00, [email protected]
This is a new driver for the Artop (Acard) controllers. It's completely untested, as I have never seen the hardware. However, I suspect it is much less broken than the previous one ...
Config.help | 25 -- Config.in | 5 aec62xx.c | 693 ++++++++++++++++++------------------------------------------ 3 files changed, 223 insertions(+), 500 deletions(-)
drivers/ide/Config.help +5 -20
@@ -295,28 +295,13 @@ It is normally safe to answer Y; however, the default is N. CONFIG_BLK_DEV_AEC62XX - This driver adds up to 4 more EIDE devices sharing a single - interrupt. This add-on card is a bootable PCI UDMA controller. In - order to get this card to initialize correctly in some cases, you - should say Y here, and preferably also to "Use DMA by default when - available". - - The ATP850U/UF is an UltraDMA 33 chipset base. - The ATP860 is an UltraDMA 66 chipset base. - The ATP860M(acintosh) version is an UltraDMA 66 chipset base. - The ATP865 is an ATA100/133 chipset. - - Please read the comments at the top of <file:drivers/ide/aec62xx.c>. - If you say Y here, then say Y to "Use DMA by default when available" - as well. - -CONFIG_AEC62XX_TUNING - Please read the comments at the top of <file:drivers/ide/aec62xx.c>. - If unsure, say N. + This driver adds explicit support for Acard AEC62xx (Artop ATP8xx) + IDE controllers. This allows the kernel to change PIO, DMA and UDMA + speeds and to configure the chip to optimum performance. CONFIG_AEC6280_BURST - Use burst mode for DMA transfers. Higher speed, but causes more load - on the bus. + Use burst mode for DMA transfers. This helps to achieve higher + transfer rates, but causes more load on the PCI bus. If unsure, say N.
drivers/ide/Config.in +2 -3
@@ -40,9 +40,8 @@ int ' Default queue depth' CONFIG_BLK_DEV_IDE_TCQ_DEPTH 32 fi dep_bool ' Good-Bad DMA Model-Firmware (EXPERIMENTAL)' CONFIG_IDEDMA_NEW_DRIVE_LISTINGS $CONFIG_EXPERIMENTAL - dep_bool ' AEC62XX chip set support' CONFIG_BLK_DEV_AEC62XX $CONFIG_BLK_DEV_IDEDMA_PCI - dep_mbool ' AEC62XX Tuning support' CONFIG_AEC62XX_TUNING $CONFIG_BLK_DEV_AEC62XX - dep_mbool ' AEC6280 Burst mode' CONFIG_AEC6280_BURST $CONFIG_BLK_DEV_AEC62XX + dep_bool ' Acard (Artop) chipset support' CONFIG_BLK_DEV_AEC62XX $CONFIG_BLK_DEV_IDEDMA_PCI + dep_mbool ' ATP865 burst mode' CONFIG_AEC6280_BURST $CONFIG_BLK_DEV_AEC62XX dep_bool ' ALI M15x3 chipset support' CONFIG_BLK_DEV_ALI15X3 $CONFIG_BLK_DEV_IDEDMA_PCI dep_mbool ' ALI M15x3 WDC support (DANGEROUS)' CONFIG_WDC_ALI15X3 $CONFIG_BLK_DEV_ALI15X3 $CONFIG_EXPERIMENTAL dep_bool ' AMD and nVidia chipset support' CONFIG_BLK_DEV_AMD74XX $CONFIG_BLK_DEV_IDEDMA_PCI
drivers/ide/aec62xx.c +216 -477
814 lines not on this page · raw message