All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: David Daney <ddaney@caviumnetworks.com>
Cc: linux-ide@vger.kernel.org, linux-mips@linux-mips.org
Subject: Re: [PATCH 2/2] libata: New driver for OCTEON SOC Compact Flash interface (v2).
Date: Tue, 25 Nov 2008 11:59:14 -0500	[thread overview]
Message-ID: <492C2EE2.3090702@garzik.org> (raw)
In-Reply-To: <1227577181-30206-2-git-send-email-ddaney@caviumnetworks.com>

David Daney wrote:
> As part of our efforts to get the Cavium OCTEON processor support
> merged (see: http://marc.info/?l=linux-mips&m=122704699515601), we
> have this CF driver for your consideration.
> 
> Most OCTEON variants have *no* DMA or interrupt support on the CF
> interface so for these, only PIO is supported.  Although if DMA is
> available, we do take advantage of it.
> 
> The register definitions are part of the chip support patch set
> mentioned above, and are not included here.
> 
> In this second version, I think I have addressed all the issued raised
> by Alan Cox and Sergei Shtylyov.
> 
> Thanks,
> 
> Signed-off-by: David Daney <ddaney@caviumnetworks.com>
> ---
>  drivers/ata/Kconfig          |    9 +
>  drivers/ata/Makefile         |    1 +
>  drivers/ata/pata_octeon_cf.c |  904 ++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 914 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/ata/pata_octeon_cf.c
> 
> diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
> index 78fbec8..b59904b 100644
> --- a/drivers/ata/Kconfig
> +++ b/drivers/ata/Kconfig
> @@ -697,6 +697,15 @@ config PATA_IXP4XX_CF
>  
>  	  If unsure, say N.
>  
> +config PATA_OCTEON_CF
> +	tristate "OCTEON Boot Bus Compact Flash support"
> +	depends on CPU_CAVIUM_OCTEON
> +	help
> +	  This option enables a polled compact flash driver for use with
> +	  compact flash cards attached to the OCTEON boot bus.
> +
> +	  If unsure, say N.
> +
>  config PATA_SCC
>  	tristate "Toshiba's Cell Reference Set IDE support"
>  	depends on PCI && PPC_CELLEB
> diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile
> index 674965f..7f1ecf9 100644
> --- a/drivers/ata/Makefile
> +++ b/drivers/ata/Makefile
> @@ -69,6 +69,7 @@ obj-$(CONFIG_PATA_IXP4XX_CF)	+= pata_ixp4xx_cf.o
>  obj-$(CONFIG_PATA_SCC)		+= pata_scc.o
>  obj-$(CONFIG_PATA_SCH)		+= pata_sch.o
>  obj-$(CONFIG_PATA_BF54X)	+= pata_bf54x.o
> +obj-$(CONFIG_PATA_OCTEON_CF)	+= pata_octeon_cf.o
>  obj-$(CONFIG_PATA_PLATFORM)	+= pata_platform.o
>  obj-$(CONFIG_PATA_OF_PLATFORM)	+= pata_of_platform.o
>  obj-$(CONFIG_PATA_ICSIDE)	+= pata_icside.o
> diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
> new file mode 100644
> index 0000000..a31d999
> --- /dev/null
> +++ b/drivers/ata/pata_octeon_cf.c
> @@ -0,0 +1,904 @@
> +/*
> + * Driver for the Octeon bootbus compact flash.
> + *
> + * This file is subject to the terms and conditions of the GNU General Public
> + * License.  See the file "COPYING" in the main directory of this archive
> + * for more details.
> + *
> + * Copyright (C) 2005-2008 Cavium Networks
> + * Copyright (C) 2008 Wind River Systems
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/libata.h>
> +#include <linux/irq.h>
> +#include <linux/platform_device.h>
> +#include <scsi/scsi_host.h>
> +
> +#include <asm/octeon/octeon.h>
> +
> +#define DRV_NAME	"pata_octeon_cf"
> +#define DRV_VERSION	"2.1"
> +
> +
> +struct octeon_cf_port {
> +	struct tasklet_struct delayed_irq_tasklet;
> +	int dma_finished;
> +};
> +
> +/* Timing multiple used for configuring the boot bus DMA engine */
> +#define CF_DMA_TIMING_MULT	4
> +
> +static struct scsi_host_template octeon_cf_sht = {
> +	ATA_PIO_SHT(DRV_NAME),
> +};
> +
> +static int mwdmamodes = 0x1f;	/* Support Multiword DMA 0-4 */
> +module_param(mwdmamodes, int, 0444);
> +MODULE_PARM_DESC(mwdmamodes,
> +		 "Bitmask controlling which MWDMA modes are supported.  "
> +		 "Default is 0x1f for MWDMA 0-4.");

Two comments:

* perhaps I missed this, but why is this module param necessary?  In 
general we avoid things like this.

* I would avoid pretending to be an SFF DMA engine, and just code it in 
the style of a custom DMA engine with SFF registers/mode, such as 
sata_mv or sata_promise.

	Jeff



  reply	other threads:[~2008-11-25 16:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-25  1:36 [PATCH 0/2] libata: Cavium OCTEON SOC Compact Flash driver (v2) David Daney
2008-11-25  1:39 ` [PATCH 1/2] libata: Add three more columns to the ata_timing table David Daney
2008-11-25 11:02   ` Sergei Shtylyov
2008-11-25 16:46     ` David Daney
2008-11-25 17:02       ` Sergei Shtylyov
2008-11-25 18:51       ` Sergei Shtylyov
2008-11-25 19:09         ` David Daney
2008-11-25 17:00   ` Jeff Garzik
2008-11-25 17:04     ` David Daney
2008-11-25 17:12     ` Alan Cox
2008-11-25 18:41       ` Sergei Shtylyov
2008-11-25 18:47         ` Alan Cox
2008-11-25  1:39 ` [PATCH 2/2] libata: New driver for OCTEON SOC Compact Flash interface (v2) David Daney
2008-11-25 16:59   ` Jeff Garzik [this message]
2008-11-25 17:25     ` David Daney
2008-11-25 17:34       ` Alan Cox
2008-11-25 17:37         ` David Daney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=492C2EE2.3090702@garzik.org \
    --to=jeff@garzik.org \
    --cc=ddaney@caviumnetworks.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.