Re: howto provide io memory to PCI card

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 27, 2010 at 04:48:40PM -0400, Charles Brown wrote:
> All,
>
>    I'm trying to write a device driver under ubuntu for a PCI card, and  
> exchange information with the card.
>
>    The hardware engineer has configured the card to support BAR0 for  
> data to the card, and linux allocates memory at kernel boot and I am  
> able to write data from the driver to the card.
>
>    For data coming from the card to the driver, the hardware engineer  
> expects the driver to allocate IO memory when the driver loads, and to  
> provide the physical address of that memory to the card - which the card  
> will use with its address translation register, to write data directly  
> into the provided I/O memory.

I think you are confused here. "I/O Memory" is on the card. Your engineer
is telling you he wants the card to transfer data to *host* memory.
The card needs a "PCI Bus Address" (aka "physical address") to access
that memory and Documentation/DMA-API.txt will explain that to you.

>   Using information from LDD3 I've been able to allocate IO memory, but  
> I can't find any PCI/kernel functions that allow me to tell the kernel  
> about this memory for the PCI card, and there's no way to tell the card  
> about this memory, except through writing the physical address back into  
> the IO memory associated to BAR0.
>
>   How do I make this allocated memory available to the card?

See how other drivers use interfaces described in Documentation/DMA-API.txt.
e.g. drivers/net/bnx2 or drivers/scsi/mpt2sas

It would be helpful if you could post the code some place.  Assuming you
can't and this driver will be released under GPL, just copy code from a
similar driver.

hth,
grant
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux