linux-mips
[Top] [All Lists]

Re: ATA devices attached to arbitary busses

To: Bryan Althouse <bryan.althouse@3phoenix.com>
Subject: Re: ATA devices attached to arbitary busses
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
Date: Thu, 05 May 2005 19:05:39 +0100
Cc: owner-linux-mips@oss.sgi.com, linux-mips@linux-mips.org
In-reply-to: <20050505175716Z8225009-1340+6570@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20050505175716Z8225009-1340+6570@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
> FPGA.  Right now, I'm a bit clueless as to how to get the linux kernel to
> support this.  Could someone please point me in the right direction?  What
> kernel source files should I be looking at?  Is there any documentation?
> Many thanks!

It really depends on the complexity of your controller. If you are just
doing PIO with generic IDE interfacing then its simply a matter of
telling Linux that there is an interface at these addresses with these
port operations and it'll just do the rest for you, except hotplug.

Basically for the standard port layouts.

        hw_regs_t hw;
        ide_hwif_t *hwif;

        memset(&hw, 0, sizeof(hw));
        ide_std_init_ports(&hw, base_port_num, ctrl_port);
        hw.irq = IRQ_LINE;
        hw.dma = NO_DMA;

        index = ide_register_hw(&hw, &hwif);

If the port layout is non standard and you use mmio etc then you need to
set hw up by hand. drivers/ide/legacy/macide.c is a good example of
interfacing a non standard controller.

Alan


<Prev in Thread] Current Thread [Next in Thread>