diff options
author | Wu Zhangjin <wuzhangjin@gmail.com> | 2010-12-24 08:39:08 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2010-12-24 13:33:23 -0500 |
commit | 9272dcc232b84ccb027d6861077934055d42764d (patch) | |
tree | 5409dd6200065ae89675a6b56faff18066930b2c | |
parent | 687a993339c4f3a63654746230da3aab8bbdbffd (diff) |
pata_cs5536: Add support for non-X86_32 platforms
pata_cs5536 does work on the other platforms(e.g. Loongson, a MIPS
variant), so, remove the dependency of X86_32 and fix the building
errors under the other platforms via only reserving the X86_32 specific
parts for X86_32.
pata_amd also supports cs5536 IDE controller, but this one saves about
33k for the compressed kernel image(vmlinuz for MIPS).
Signed-off-by: Zhang Le <r0bertz@gentoo.org>
Signed-off-by: Chen Jie <chenj@lemote.com>
Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r-- | drivers/ata/Kconfig | 2 | ||||
-rw-r--r-- | drivers/ata/pata_cs5536.c | 18 |
2 files changed, 13 insertions, 7 deletions
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig index 11ec911016c6..cfd04f4e418c 100644 --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig | |||
@@ -366,7 +366,7 @@ config PATA_CS5535 | |||
366 | 366 | ||
367 | config PATA_CS5536 | 367 | config PATA_CS5536 |
368 | tristate "CS5536 PATA support" | 368 | tristate "CS5536 PATA support" |
369 | depends on PCI && X86 && !X86_64 | 369 | depends on PCI |
370 | help | 370 | help |
371 | This option enables support for the AMD CS5536 | 371 | This option enables support for the AMD CS5536 |
372 | companion chip used with the Geode LX processor family. | 372 | companion chip used with the Geode LX processor family. |
diff --git a/drivers/ata/pata_cs5536.c b/drivers/ata/pata_cs5536.c index 21ee23f89e88..a6e6c963b6ae 100644 --- a/drivers/ata/pata_cs5536.c +++ b/drivers/ata/pata_cs5536.c | |||
@@ -37,10 +37,20 @@ | |||
37 | #include <linux/delay.h> | 37 | #include <linux/delay.h> |
38 | #include <linux/libata.h> | 38 | #include <linux/libata.h> |
39 | #include <scsi/scsi_host.h> | 39 | #include <scsi/scsi_host.h> |
40 | |||
41 | #ifdef CONFIG_X86_32 | ||
40 | #include <asm/msr.h> | 42 | #include <asm/msr.h> |
43 | static int use_msr; | ||
44 | module_param_named(msr, use_msr, int, 0644); | ||
45 | MODULE_PARM_DESC(msr, "Force using MSR to configure IDE function (Default: 0)"); | ||
46 | #else | ||
47 | #define rdmsr(x, y, z) do { } while (0) | ||
48 | #define wrmsr(x, y, z) do { } while (0) | ||
49 | #define use_msr 0 | ||
50 | #endif | ||
41 | 51 | ||
42 | #define DRV_NAME "pata_cs5536" | 52 | #define DRV_NAME "pata_cs5536" |
43 | #define DRV_VERSION "0.0.7" | 53 | #define DRV_VERSION "0.0.8" |
44 | 54 | ||
45 | enum { | 55 | enum { |
46 | CFG = 0, | 56 | CFG = 0, |
@@ -75,8 +85,6 @@ enum { | |||
75 | IDE_ETC_NODMA = 0x03, | 85 | IDE_ETC_NODMA = 0x03, |
76 | }; | 86 | }; |
77 | 87 | ||
78 | static int use_msr; | ||
79 | |||
80 | static const u32 msr_reg[4] = { | 88 | static const u32 msr_reg[4] = { |
81 | MSR_IDE_CFG, MSR_IDE_DTC, MSR_IDE_CAST, MSR_IDE_ETC, | 89 | MSR_IDE_CFG, MSR_IDE_DTC, MSR_IDE_CAST, MSR_IDE_ETC, |
82 | }; | 90 | }; |
@@ -88,7 +96,7 @@ static const u8 pci_reg[4] = { | |||
88 | static inline int cs5536_read(struct pci_dev *pdev, int reg, u32 *val) | 96 | static inline int cs5536_read(struct pci_dev *pdev, int reg, u32 *val) |
89 | { | 97 | { |
90 | if (unlikely(use_msr)) { | 98 | if (unlikely(use_msr)) { |
91 | u32 dummy; | 99 | u32 dummy __maybe_unused; |
92 | 100 | ||
93 | rdmsr(msr_reg[reg], *val, dummy); | 101 | rdmsr(msr_reg[reg], *val, dummy); |
94 | return 0; | 102 | return 0; |
@@ -294,8 +302,6 @@ MODULE_DESCRIPTION("low-level driver for the CS5536 IDE controller"); | |||
294 | MODULE_LICENSE("GPL"); | 302 | MODULE_LICENSE("GPL"); |
295 | MODULE_DEVICE_TABLE(pci, cs5536); | 303 | MODULE_DEVICE_TABLE(pci, cs5536); |
296 | MODULE_VERSION(DRV_VERSION); | 304 | MODULE_VERSION(DRV_VERSION); |
297 | module_param_named(msr, use_msr, int, 0644); | ||
298 | MODULE_PARM_DESC(msr, "Force using MSR to configure IDE function (Default: 0)"); | ||
299 | 305 | ||
300 | module_init(cs5536_init); | 306 | module_init(cs5536_init); |
301 | module_exit(cs5536_exit); | 307 | module_exit(cs5536_exit); |