[Top] [All Lists]

Re: ATA devices attached to arbitary busses

To: Bryan Althouse <>
Subject: Re: ATA devices attached to arbitary busses
From: Alan Cox <>
Date: Thu, 05 May 2005 19:05:39 +0100
In-reply-to: <>
Original-recipient: rfc822;
References: <>
> 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.


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