Skip to contentSkip to conversation

pata_acpi driver

PATCH In review Alan 2 participants 3 messages Feb 6, 2007 libata

lore
Share & tools
lore

Alan

author
#0 lore raw

PATCH 1/1 pata_acpi driver

An ACPI[1] firmware driver for motherboard PATA ports.

Drives conventional IDE interface ports that have ACPI methods for firmware control. Generally this means the motherboard ide0/ide1 PATA ports, regardless of controller. It may not cover some controllers in non-legacy mode however.

This is linked near the end so that with built in drivers it will grab only ports that lack native drivers. The libata-acpi code is designed to be reusable as we will want to borrow a couple of bits for VIA and Nvidia cable detect.

Give it a test, see what it does. I don't entirely trust this code as it worked first time on my machine and that makes me suspicious..

Alan
[1] Another Crap Proposal Intel ;)

drivers/ata/Kconfig +9 -0
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.20-rc6-mm3/drivers/ata/Kconfig linux-2.6.20-rc6-mm3/drivers/ata/Kconfig
@@ -174,6 +174,15 @@
 	  You can disable this at kernel boot time by using the
 	  option libata.noacpi=1
 
+config PATA_ACPI
+	tristate "ACPI firmware driver for PATA"
+	depends on ACPI && PCI && SATA_ACPI
+	help
+	  This option enables an ACPI method driver which drives
+	  motherboard PATA controller interfaces through the ACPI
+	  firmware in the BIOS. This driver can sometimes handle
+	  otherwise unsupported hardware.
+
 config PATA_ALI
 	tristate "ALi PATA support (Experimental)"
 	depends on PCI && EXPERIMENTAL
drivers/ata/libata-acpi.c +89 -1

99 lines not on this page · raw message

drivers/ata/libata-acpi.h +47 -0

47 lines not on this page · raw message

drivers/ata/Makefile +2 -0
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.20-rc6-mm3/drivers/ata/Makefile linux-2.6.20-rc6-mm3/drivers/ata/Makefile
@@ -60,6 +60,8 @@
 obj-$(CONFIG_PATA_TRIFLEX)	+= pata_triflex.o
 obj-$(CONFIG_PATA_IXP4XX_CF)	+= pata_ixp4xx_cf.o
 obj-$(CONFIG_PATA_PLATFORM)	+= pata_platform.o
+# Should be last but two libata driver
+obj-$(CONFIG_PATA_ACPI)		+= pata_acpi.o
 # Should be last but one libata driver
 obj-$(CONFIG_ATA_GENERIC)	+= ata_generic.o
 # Should be last libata driver
drivers/ata/pata_acpi.c +398 -0

398 lines not on this page · raw message

#1 lore raw
Quoted 9 lines · Alan

An ACPI[1] firmware driver for motherboard PATA ports.

+int ata_acpi_stm(const struct ata_port *ap, void *handle, struct acpi_gtm *stm)

drivers/ata/libata-acpi.c +5 -0
+{
+	acpi_status status;
+	struct acpi_object_list         input;
+	union acpi_object               in_params[3];
+

drivers/ata/libata-acpi.c line 737

Quoted 10 lines
drivers/ata/libata-acpi.c +10 -0
+	in_params[0].type = ACPI_TYPE_BUFFER;
+	in_params[0].buffer.length = sizeof(struct acpi_gtm);
+	in_params[0].buffer.pointer = (u8 *)stm;
+	/* Buffers for id may need byteswapping ? */
+	in_params[1].type = ACPI_TYPE_BUFFER;
+	in_params[1].buffer.length = 512;
+	in_params[1].buffer.pointer = (u8 *)ap->device[0].id;
+	in_params[2].type = ACPI_TYPE_BUFFER;
+	in_params[2].buffer.length = 512;
+	in_params[1].buffer.pointer = (u8 *)ap->device[1].id;

Must be a typo. [2]

author
#2 lore raw
Quoted 5 lines

drivers/ata/libata-acpi.c line 737

Quoted 3 lines
drivers/ata/libata-acpi.c +3 -0
+	in_params[2].type = ACPI_TYPE_BUFFER;
+	in_params[2].buffer.length = 512;
+	in_params[1].buffer.pointer = (u8 *)ap->device[1].id;

Must be a typo. [2]

Indeed it is - thanks.

Alan