Skip to contentSkip to conversation

CS5535 driver

PATCH In review Bartlomiej Zolnierkiewicz 2 participants 2 messages Aug 29, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 CS5535 driver

Hi,

Alan Cox has sent me this driver recently. It needs a little bit of work to become
acceptable into mainline kernel and as I don't have neither the hardware nor the time to work on it now, I'm posting it to you and linux-ide ML with a remaining TODO list (original patch attached to the mail). :-)

I hope that somebody will work on it so that it can be merged soon.

* cs5535_tuneproc() needs to be fixed to not abuse ->tuneproc interface (which is exported to user-space), all DMA tuning should be done through ->speedproc interface only
* cs5535_set_drive() needs to use ide_rate_filter() to limit values passed from the user-space
* cs5535_set_drive() needs to set drive's speed unconditionally otherwise drive may not be setup correctly after resume
* cs5535_set_drive() shouldn't change drive->current_speed
* cable detection needs to be in separate function (for hotplug - later)
* driver lacks device side cable detection [ see eighty_ninty_three() ]
* driver needs to check for blacklisted DMA devices [ see ide_use_dma() ]
* init_hwif_cs5535() should be marked __devinit not __init
* cs5535_ide_init() lacks __init tag
* .name in driver struct should be "CS5535_IDE" (w/o space)
* what taking ide_lock in init_chipset_cs5535() is supposed to protect?
* it would be simpler to always set ->autotune and tune PIO instead of checking for BIOS settings

minor things:

* use 'drive->hwif' instead of 'HWIF' macro
* use 'u8' instead of 'byte' type
* remove unneeded includes
* proper coding style:

        if (foo) {
        } else {
        }

       if (foo)
               bar;

Thanks,
Bartlomiej

drivers/ide/Kconfig +8 -0
diff -aur --unidirectional-new-file linux-2.6.11.4-21.7/drivers/ide/Kconfig linux-cs5535/drivers/ide/Kconfig
@@ -540,6 +540,14 @@
 
 	  It is safe to say Y to this question.
 
+config BLK_DEV_CS5535
+	tristate "AMD CS5535 MediaGX chipset support"
+	help
+	  Include support for UDMA on the Cyrix MediaGX 5535 chipset. This
+	  will automatically be detected and configured if found.
+
+	  It is safe to say Y to this question.
+
 config BLK_DEV_HPT34X
 	tristate "HPT34X chipset support"
 	help
drivers/ide/pci/Makefile +1 -0
diff -aur --unidirectional-new-file linux-2.6.11.4-21.7/drivers/ide/pci/Makefile linux-cs5535/drivers/ide/pci/Makefile
@@ -6,6 +6,7 @@
 obj-$(CONFIG_BLK_DEV_CMD64X)		+= cmd64x.o
 obj-$(CONFIG_BLK_DEV_CS5520)		+= cs5520.o
 obj-$(CONFIG_BLK_DEV_CS5530)		+= cs5530.o
+obj-$(CONFIG_BLK_DEV_CS5535)		+= cs5535.o
 obj-$(CONFIG_BLK_DEV_SC1200)		+= sc1200.o
 obj-$(CONFIG_BLK_DEV_CY82C693)		+= cy82c693.o
 obj-$(CONFIG_BLK_DEV_HPT34X)		+= hpt34x.o
drivers/ide/pci/cs5535.c +381 -0

381 lines not on this page · raw message

include/linux/pci_ids.h +1 -0
diff -aur --unidirectional-new-file linux-2.6.11.4-21.7/include/linux/pci_ids.h linux-cs5535/include/linux/pci_ids.h
@@ -387,6 +387,7 @@
 #define PCI_DEVICE_ID_NS_SCx200_XBUS	0x0505
 #define PCI_DEVICE_ID_NS_SC1100_BRIDGE	0x0510
 #define PCI_DEVICE_ID_NS_87410		0xd001
+#define PCI_DEVICE_ID_NS_CS5535_IDE	0x002d
 
 #define PCI_VENDOR_ID_TSENG		0x100c
 #define PCI_DEVICE_ID_TSENG_W32P_2	0x3202
#1 lore raw
Quoted 10 lines · Bartlomiej Zolnierkiewicz

Hi,

Alan Cox has sent me this driver recently. It needs a little bit of work to become
acceptable into mainline kernel and as I don't have neither the hardware nor the time to work on it now, I'm posting it to you and linux-ide ML with a remaining TODO list (original patch attached to the mail). :-)

I hope that somebody will work on it so that it can be merged soon.

Quoted 10 lines

* cs5535_tuneproc() needs to be fixed to not abuse ->tuneproc interface (which is exported to user-space), all DMA tuning should be done through ->speedproc interface only
* cs5535_set_drive() needs to use ide_rate_filter() to limit values passed from the user-space
* cs5535_set_drive() needs to set drive's speed unconditionally otherwise drive may not be setup correctly after resume
* cs5535_set_drive() shouldn't change drive->current_speed
* cable detection needs to be in separate function (for hotplug - later)
* driver lacks device side cable detection [ see eighty_ninty_three() ]

That, as far as I know, only works on mainboards with a capacitor installed. If there is host cable detection, it doesn't work reliably.

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR