All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] achi, ata_generic: Add ASMedia ASM1061 support
@ 2011-09-08  3:43 Keng-Yu Lin
  2011-09-08  9:40 ` Alan Cox
  2011-09-08 10:36 ` Sergei Shtylyov
  0 siblings, 2 replies; 3+ messages in thread
From: Keng-Yu Lin @ 2011-09-08  3:43 UTC (permalink / raw)
  To: Jeff Garzik, Jesse Barnes, linux-ide, linux-kernel, linux-pci

ASM1061 PCI-E to SATA bridge controller has two variants.
One works under AHCI and the other works with ata_generic.

Add the PCI vendor ID and product IDs accordingly.

Signed-off-by: Keng-Yu Lin <kengyu@canonical.com>
---
 drivers/ata/ahci.c        |    3 +++
 drivers/ata/ata_generic.c |    1 +
 include/linux/pci_ids.h   |    4 ++++
 3 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 71afe03..4899aad 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -397,6 +397,9 @@ static const struct pci_device_id ahci_pci_tbl[] = {
 	/* Promise */
 	{ PCI_VDEVICE(PROMISE, 0x3f20), board_ahci },	/* PDC42819 */
 
+	/* Asmedia */
+	{ PCI_VDEVICE(ASMEDIA, 0x0612), board_ahci },	/* ASM1061 */
+
 	/* Generic, PCI class code for AHCI */
 	{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
 	  PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff, board_ahci },
diff --git a/drivers/ata/ata_generic.c b/drivers/ata/ata_generic.c
index 721d38b..8187503 100644
--- a/drivers/ata/ata_generic.c
+++ b/drivers/ata/ata_generic.c
@@ -220,6 +220,7 @@ static struct pci_device_id ata_generic[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_HINT,   PCI_DEVICE_ID_HINT_VXPROII_IDE), },
 	{ PCI_DEVICE(PCI_VENDOR_ID_VIA,    PCI_DEVICE_ID_VIA_82C561), },
 	{ PCI_DEVICE(PCI_VENDOR_ID_OPTI,   PCI_DEVICE_ID_OPTI_82C558), },
+	{ PCI_DEVICE(PCI_VENDOR_ID_ASMEDIA,PCI_DEVICE_ID_ASM1061_IDE), },
 	{ PCI_DEVICE(PCI_VENDOR_ID_CENATEK,PCI_DEVICE_ID_CENATEK_IDE),
 	  .driver_data = ATA_GEN_FORCE_DMA },
 	/*
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index f8910e1..87182b8 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2844,3 +2844,7 @@
 
 #define PCI_VENDOR_ID_XEN		0x5853
 #define PCI_DEVICE_ID_XEN_PLATFORM	0x0001
+
+#define PCI_VENDOR_ID_ASMEDIA		0x1b21
+#define PCI_DEVICE_ID_ASM1061_IDE	0x0611
+#define PCI_DEVICE_ID_ASM1061_AHCI	0x0612
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] achi, ata_generic: Add ASMedia ASM1061 support
  2011-09-08  3:43 [PATCH] achi, ata_generic: Add ASMedia ASM1061 support Keng-Yu Lin
@ 2011-09-08  9:40 ` Alan Cox
  2011-09-08 10:36 ` Sergei Shtylyov
  1 sibling, 0 replies; 3+ messages in thread
From: Alan Cox @ 2011-09-08  9:40 UTC (permalink / raw)
  To: Keng-Yu Lin; +Cc: Jeff Garzik, Jesse Barnes, linux-ide, linux-kernel, linux-pci

On Thu,  8 Sep 2011 11:43:46 +0800
Keng-Yu Lin <kengyu@canonical.com> wrote:

> ASM1061 PCI-E to SATA bridge controller has two variants.
> One works under AHCI and the other works with ata_generic.

ata_generic should be an absolute last resort - it doesn't support error
recovery by speed dropping, mode setting, hotplug, timing tuning etc. 

Is there any documentation on the device or does it appear to follow the
usual mode setting behaviours ? The web page merely says

"Bus Master Programming Interface to IDE ATA Controller Rev. 1.0"

which covers only the basic transfers and not timing (ie ata_generic) as
you say but there are a few ways to find out more about how it works

- dump the PCI space in IDE mode and see if it looks like d1510r1 - some
  controllers are pretty unimaginative and so follow follow Appendix B
  of this document.

- see if it will run with the pata_acpi driver (ie it has _GTM and
  similar methods in the BIOS). If it does then this is preferable as it
  can do limited mode handling and you can also see what the ACPI code
  itself actually does for _GTM/_STM.

- See if Asmedia will provide documentation. I don't see anything useful
  on the English web site but perhaps someone has as Asmedia contact ?

The AHCI one looks good - AHCI standardises all this
stuff so the AHCI one can just be a device id.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] achi, ata_generic: Add ASMedia ASM1061 support
  2011-09-08  3:43 [PATCH] achi, ata_generic: Add ASMedia ASM1061 support Keng-Yu Lin
  2011-09-08  9:40 ` Alan Cox
@ 2011-09-08 10:36 ` Sergei Shtylyov
  1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2011-09-08 10:36 UTC (permalink / raw)
  To: Keng-Yu Lin; +Cc: Jeff Garzik, Jesse Barnes, linux-ide, linux-kernel, linux-pci

Hello.

On 08-09-2011 7:43, Keng-Yu Lin wrote:

> ASM1061 PCI-E to SATA bridge controller has two variants.
> One works under AHCI and the other works with ata_generic.

> Add the PCI vendor ID and product IDs accordingly.

> Signed-off-by: Keng-Yu Lin<kengyu@canonical.com>
[...]
> diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
> index f8910e1..87182b8 100644
> --- a/include/linux/pci_ids.h
> +++ b/include/linux/pci_ids.h
> @@ -2844,3 +2844,7 @@
>
>   #define PCI_VENDOR_ID_XEN		0x5853
>   #define PCI_DEVICE_ID_XEN_PLATFORM	0x0001
> +
> +#define PCI_VENDOR_ID_ASMEDIA		0x1b21
> +#define PCI_DEVICE_ID_ASM1061_IDE	0x0611
> +#define PCI_DEVICE_ID_ASM1061_AHCI	0x0612

    Adding new device IDs to that file is frowned upon. Define the device ID 
locally in the driver file, if you must. You don't even use the second one.

WBR, Sergei

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-09-08 10:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-08  3:43 [PATCH] achi, ata_generic: Add ASMedia ASM1061 support Keng-Yu Lin
2011-09-08  9:40 ` Alan Cox
2011-09-08 10:36 ` Sergei Shtylyov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.