linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Ben Warren <bwarren@qstreams.com>
To: Michael Brian Willis <willis@arlut.utexas.edu>
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: MPC85xx and linux IDE driver
Date: Wed, 17 Oct 2007 14:44:11 -0400	[thread overview]
Message-ID: <471657FB.3040806@qstreams.com> (raw)
In-Reply-To: <1192643237.4929.41.camel@louie>

Michael Brian Willis wrote:
> On Fri, 2007-10-12 at 15:48 -0400, Ben Warren wrote:
>   
>   
>> Here's what I use:
>>
>> http://marc.info/?l=linux-kernel&m=113877891224982&w=2
>>     
>
> Thanks for the response Ben. 
>
> I have put the driver you mentioned in my linux source and added the
> necessary information in the Kconfig file and the Makefile. So, I am now
> able to build the driver when I make my kernel image. However, I can't
> figure out what else needs to be done in order to actually use the
> driver for my compact flash device. Do I need to specify anything at the
> kernel command line, or do I need to modify any other config files?
> (Below is the ide portion of my linux .config file)
>
>   
This device driver is a platform driver, so you need to register a 
platform device somewhere in your board-specific init code that contains 
the hardware details (memory mapping and IRQ #).  You can either pass 
this in via device tree or hard code it.  I chose the latter in order to 
get up and runninq quickly.  Here's the init function I use.  CS0 is @ 
0xe4000000, CS1 is @ 0xe4100000 and I'm using IRQ20, which is one of the 
external IRQs on my CPU:

/* Compact Flash Initialization */

static int __init prism_setup_cf(void)
{
    struct resource r[3];
    struct platform_device *cf_dev;
    unsigned int virq;

    memset(&r, 0, sizeof(r));
    r[0].start = 0xe4000000;
    r[0].end = 0xe400000f;
    r[0].flags = IORESOURCE_MEM;

    r[1].start = 0xe4100000;
    r[1].end = 0xe410000f;
    r[1].flags = IORESOURCE_MEM;

   
    virq = irq_find_mapping(NULL, 20);
    set_irq_type(virq, IRQ_TYPE_EDGE_FALLING);
    r[2].start = virq;
    r[2].end = 0;
    r[2].flags = IORESOURCE_IRQ;

    cf_dev = platform_device_register_simple("mmio-cfide", 0, r, 3);

    return (cf_dev ? 0 : PTR_ERR(cf_dev));
}

> Thank you for your help so far, anymore help/direction is greatly
> appreciated. 
>
>   
Glad to help.

regards,
Ben

  reply	other threads:[~2007-10-17 18:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-12 18:29 MPC85xx and linux IDE driver Michael Brian Willis
2007-10-12 19:48 ` Ben Warren
2007-10-17 17:47   ` Michael Brian Willis
2007-10-17 18:44     ` Ben Warren [this message]
2007-10-25 21:49       ` Michael Brian Willis
2007-10-25 22:04         ` Ben Warren

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=471657FB.3040806@qstreams.com \
    --to=bwarren@qstreams.com \
    --cc=linuxppc-embedded@ozlabs.org \
    --cc=willis@arlut.utexas.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).