diff options
author | Tejun Heo <htejun@gmail.com> | 2008-04-07 09:47:21 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-04-17 15:44:24 -0400 |
commit | 127102aea2ea9ec4e9ca233e2b1a75c8d3b058c4 (patch) | |
tree | 92fb528eac658adbc7307a009bd8a7558db2658a | |
parent | 350756f6dab6d37ef9ed3f18dec520e88969ddac (diff) |
libata: make SFF support optional
Now that SFF support is completely separated out from the core layer,
it can be made optional. Add CONFIG_ATA_SFF and let SFF drivers
depend on it. If CONFIG_ATA_SFF isn't set, all codes in libata-sff.c
and data structures for SFF support are disabled. This saves good
number of bytes for small systems.
Signed-off-by: Tejun Heo <htejun@gmail.com>
-rw-r--r-- | drivers/ata/Kconfig | 44 | ||||
-rw-r--r-- | drivers/ata/Makefile | 4 | ||||
-rw-r--r-- | drivers/ata/libata-core.c | 2 | ||||
-rw-r--r-- | drivers/ata/libata-scsi.c | 2 | ||||
-rw-r--r-- | drivers/ata/libata.h | 4 | ||||
-rw-r--r-- | include/linux/libata.h | 9 |
6 files changed, 46 insertions, 19 deletions
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig index ea665c249035..48c8fc55391e 100644 --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig | |||
@@ -49,6 +49,32 @@ config SATA_AHCI | |||
49 | 49 | ||
50 | If unsure, say N. | 50 | If unsure, say N. |
51 | 51 | ||
52 | config SATA_SIL24 | ||
53 | tristate "Silicon Image 3124/3132 SATA support" | ||
54 | depends on PCI | ||
55 | help | ||
56 | This option enables support for Silicon Image 3124/3132 Serial ATA. | ||
57 | |||
58 | If unsure, say N. | ||
59 | |||
60 | config SATA_FSL | ||
61 | tristate "Freescale 3.0Gbps SATA support" | ||
62 | depends on FSL_SOC | ||
63 | help | ||
64 | This option enables support for Freescale 3.0Gbps SATA controller. | ||
65 | It can be found on MPC837x and MPC8315. | ||
66 | |||
67 | If unsure, say N. | ||
68 | |||
69 | config ATA_SFF | ||
70 | bool "ATA SFF support" | ||
71 | default y | ||
72 | help | ||
73 | This option adds support for ATA controllers with SFF | ||
74 | compliant or similar programming interface. | ||
75 | |||
76 | if ATA_SFF | ||
77 | |||
52 | config SATA_SVW | 78 | config SATA_SVW |
53 | tristate "ServerWorks Frodo / Apple K2 SATA support" | 79 | tristate "ServerWorks Frodo / Apple K2 SATA support" |
54 | depends on PCI | 80 | depends on PCI |
@@ -125,14 +151,6 @@ config SATA_SIL | |||
125 | 151 | ||
126 | If unsure, say N. | 152 | If unsure, say N. |
127 | 153 | ||
128 | config SATA_SIL24 | ||
129 | tristate "Silicon Image 3124/3132 SATA support" | ||
130 | depends on PCI | ||
131 | help | ||
132 | This option enables support for Silicon Image 3124/3132 Serial ATA. | ||
133 | |||
134 | If unsure, say N. | ||
135 | |||
136 | config SATA_SIS | 154 | config SATA_SIS |
137 | tristate "SiS 964/965/966/180 SATA support" | 155 | tristate "SiS 964/965/966/180 SATA support" |
138 | depends on PCI | 156 | depends on PCI |
@@ -183,15 +201,6 @@ config PATA_ACPI | |||
183 | firmware in the BIOS. This driver can sometimes handle | 201 | firmware in the BIOS. This driver can sometimes handle |
184 | otherwise unsupported hardware. | 202 | otherwise unsupported hardware. |
185 | 203 | ||
186 | config SATA_FSL | ||
187 | tristate "Freescale 3.0Gbps SATA support" | ||
188 | depends on FSL_SOC | ||
189 | help | ||
190 | This option enables support for Freescale 3.0Gbps SATA controller. | ||
191 | It can be found on MPC837x and MPC8315. | ||
192 | |||
193 | If unsure, say N. | ||
194 | |||
195 | config PATA_ALI | 204 | config PATA_ALI |
196 | tristate "ALi PATA support (Experimental)" | 205 | tristate "ALi PATA support (Experimental)" |
197 | depends on PCI && EXPERIMENTAL | 206 | depends on PCI && EXPERIMENTAL |
@@ -679,4 +688,5 @@ config PATA_BF54X | |||
679 | 688 | ||
680 | If unsure, say N. | 689 | If unsure, say N. |
681 | 690 | ||
691 | endif # ATA_SFF | ||
682 | endif # ATA | 692 | endif # ATA |
diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile index 0511e6f0bb58..e6e41b2c731c 100644 --- a/drivers/ata/Makefile +++ b/drivers/ata/Makefile | |||
@@ -78,6 +78,6 @@ obj-$(CONFIG_ATA_GENERIC) += ata_generic.o | |||
78 | # Should be last libata driver | 78 | # Should be last libata driver |
79 | obj-$(CONFIG_PATA_LEGACY) += pata_legacy.o | 79 | obj-$(CONFIG_PATA_LEGACY) += pata_legacy.o |
80 | 80 | ||
81 | libata-objs := libata-core.o libata-scsi.o libata-sff.o libata-eh.o \ | 81 | libata-objs := libata-core.o libata-scsi.o libata-eh.o libata-pmp.o |
82 | libata-pmp.o | 82 | libata-$(CONFIG_ATA_SFF) += libata-sff.o |
83 | libata-$(CONFIG_ATA_ACPI) += libata-acpi.o | 83 | libata-$(CONFIG_ATA_ACPI) += libata-acpi.o |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 3a94c69c7fe7..ca60af0cb051 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -5195,7 +5195,9 @@ struct ata_port *ata_port_alloc(struct ata_host *host) | |||
5195 | ap->msg_enable = ATA_MSG_DRV | ATA_MSG_ERR | ATA_MSG_WARN; | 5195 | ap->msg_enable = ATA_MSG_DRV | ATA_MSG_ERR | ATA_MSG_WARN; |
5196 | #endif | 5196 | #endif |
5197 | 5197 | ||
5198 | #ifdef CONFIG_ATA_SFF | ||
5198 | INIT_DELAYED_WORK(&ap->port_task, ata_pio_task); | 5199 | INIT_DELAYED_WORK(&ap->port_task, ata_pio_task); |
5200 | #endif | ||
5199 | INIT_DELAYED_WORK(&ap->hotplug_task, ata_scsi_hotplug); | 5201 | INIT_DELAYED_WORK(&ap->hotplug_task, ata_scsi_hotplug); |
5200 | INIT_WORK(&ap->scsi_rescan_task, ata_scsi_dev_rescan); | 5202 | INIT_WORK(&ap->scsi_rescan_task, ata_scsi_dev_rescan); |
5201 | INIT_LIST_HEAD(&ap->eh_done_q); | 5203 | INIT_LIST_HEAD(&ap->eh_done_q); |
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index f8be92836a6e..a70881c408e5 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -2393,7 +2393,9 @@ static void atapi_request_sense(struct ata_queued_cmd *qc) | |||
2393 | /* FIXME: is this needed? */ | 2393 | /* FIXME: is this needed? */ |
2394 | memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); | 2394 | memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); |
2395 | 2395 | ||
2396 | #ifdef CONFIG_ATA_SFF | ||
2396 | ap->ops->sff_tf_read(ap, &qc->tf); | 2397 | ap->ops->sff_tf_read(ap, &qc->tf); |
2398 | #endif | ||
2397 | 2399 | ||
2398 | /* fill these in, for the case where they are -not- overwritten */ | 2400 | /* fill these in, for the case where they are -not- overwritten */ |
2399 | cmd->sense_buffer[0] = 0x70; | 2401 | cmd->sense_buffer[0] = 0x70; |
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h index 87f54a1db3b0..6b70a624828c 100644 --- a/drivers/ata/libata.h +++ b/drivers/ata/libata.h | |||
@@ -42,8 +42,10 @@ static inline int ata_is_builtin_hardreset(ata_reset_fn_t reset) | |||
42 | { | 42 | { |
43 | if (reset == sata_std_hardreset) | 43 | if (reset == sata_std_hardreset) |
44 | return 1; | 44 | return 1; |
45 | #ifdef CONFIG_ATA_SFF | ||
45 | if (reset == sata_sff_hardreset) | 46 | if (reset == sata_sff_hardreset) |
46 | return 1; | 47 | return 1; |
48 | #endif | ||
47 | return 0; | 49 | return 0; |
48 | } | 50 | } |
49 | 51 | ||
@@ -206,9 +208,11 @@ extern int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset, | |||
206 | extern void ata_eh_finish(struct ata_port *ap); | 208 | extern void ata_eh_finish(struct ata_port *ap); |
207 | 209 | ||
208 | /* libata-sff.c */ | 210 | /* libata-sff.c */ |
211 | #ifdef CONFIG_ATA_SFF | ||
209 | extern void ata_dev_select(struct ata_port *ap, unsigned int device, | 212 | extern void ata_dev_select(struct ata_port *ap, unsigned int device, |
210 | unsigned int wait, unsigned int can_sleep); | 213 | unsigned int wait, unsigned int can_sleep); |
211 | extern u8 ata_irq_on(struct ata_port *ap); | 214 | extern u8 ata_irq_on(struct ata_port *ap); |
212 | extern void ata_pio_task(struct work_struct *work); | 215 | extern void ata_pio_task(struct work_struct *work); |
216 | #endif /* CONFIG_ATA_SFF */ | ||
213 | 217 | ||
214 | #endif /* __LIBATA_H__ */ | 218 | #endif /* __LIBATA_H__ */ |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 037db1883bae..db77b90003fd 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -445,6 +445,7 @@ enum link_pm { | |||
445 | }; | 445 | }; |
446 | extern struct class_device_attribute class_device_attr_link_power_management_policy; | 446 | extern struct class_device_attribute class_device_attr_link_power_management_policy; |
447 | 447 | ||
448 | #ifdef CONFIG_ATA_SFF | ||
448 | struct ata_ioports { | 449 | struct ata_ioports { |
449 | void __iomem *cmd_addr; | 450 | void __iomem *cmd_addr; |
450 | void __iomem *data_addr; | 451 | void __iomem *data_addr; |
@@ -462,6 +463,7 @@ struct ata_ioports { | |||
462 | void __iomem *bmdma_addr; | 463 | void __iomem *bmdma_addr; |
463 | void __iomem *scr_addr; | 464 | void __iomem *scr_addr; |
464 | }; | 465 | }; |
466 | #endif /* CONFIG_ATA_SFF */ | ||
465 | 467 | ||
466 | struct ata_host { | 468 | struct ata_host { |
467 | spinlock_t lock; | 469 | spinlock_t lock; |
@@ -648,7 +650,9 @@ struct ata_port { | |||
648 | struct ata_prd *prd; /* our SG list */ | 650 | struct ata_prd *prd; /* our SG list */ |
649 | dma_addr_t prd_dma; /* and its DMA mapping */ | 651 | dma_addr_t prd_dma; /* and its DMA mapping */ |
650 | 652 | ||
653 | #ifdef CONFIG_ATA_SFF | ||
651 | struct ata_ioports ioaddr; /* ATA cmd/ctl/dma register blocks */ | 654 | struct ata_ioports ioaddr; /* ATA cmd/ctl/dma register blocks */ |
655 | #endif /* CONFIG_ATA_SFF */ | ||
652 | 656 | ||
653 | u8 ctl; /* cache of ATA control register */ | 657 | u8 ctl; /* cache of ATA control register */ |
654 | u8 last_ctl; /* Cache last written value */ | 658 | u8 last_ctl; /* Cache last written value */ |
@@ -760,6 +764,7 @@ struct ata_port_operations { | |||
760 | void (*port_stop)(struct ata_port *ap); | 764 | void (*port_stop)(struct ata_port *ap); |
761 | void (*host_stop)(struct ata_host *host); | 765 | void (*host_stop)(struct ata_host *host); |
762 | 766 | ||
767 | #ifdef CONFIG_ATA_SFF | ||
763 | /* | 768 | /* |
764 | * SFF / taskfile oriented ops | 769 | * SFF / taskfile oriented ops |
765 | */ | 770 | */ |
@@ -779,6 +784,7 @@ struct ata_port_operations { | |||
779 | void (*bmdma_start)(struct ata_queued_cmd *qc); | 784 | void (*bmdma_start)(struct ata_queued_cmd *qc); |
780 | void (*bmdma_stop)(struct ata_queued_cmd *qc); | 785 | void (*bmdma_stop)(struct ata_queued_cmd *qc); |
781 | u8 (*bmdma_status)(struct ata_port *ap); | 786 | u8 (*bmdma_status)(struct ata_port *ap); |
787 | #endif /* CONFIG_ATA_SFF */ | ||
782 | 788 | ||
783 | /* | 789 | /* |
784 | * Obsolete | 790 | * Obsolete |
@@ -1349,6 +1355,8 @@ static inline struct ata_port *ata_shost_to_port(struct Scsi_Host *host) | |||
1349 | /************************************************************************** | 1355 | /************************************************************************** |
1350 | * SFF - drivers/ata/libata-sff.c | 1356 | * SFF - drivers/ata/libata-sff.c |
1351 | */ | 1357 | */ |
1358 | #ifdef CONFIG_ATA_SFF | ||
1359 | |||
1352 | extern const struct ata_port_operations ata_sff_port_ops; | 1360 | extern const struct ata_port_operations ata_sff_port_ops; |
1353 | extern const struct ata_port_operations ata_bmdma_port_ops; | 1361 | extern const struct ata_port_operations ata_bmdma_port_ops; |
1354 | 1362 | ||
@@ -1489,5 +1497,6 @@ static inline u8 ata_wait_idle(struct ata_port *ap) | |||
1489 | 1497 | ||
1490 | return status; | 1498 | return status; |
1491 | } | 1499 | } |
1500 | #endif /* CONFIG_ATA_SFF */ | ||
1492 | 1501 | ||
1493 | #endif /* __LINUX_LIBATA_H__ */ | 1502 | #endif /* __LINUX_LIBATA_H__ */ |