This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Configuring PCI devices
- From: Gary Thomas <gary at mlbassoc dot com>
- To: David Brennan <eCos at brennanhome dot com>
- Cc: eCos Discuss <ecos-discuss at sources dot redhat dot com>
- Date: Wed, 26 May 2004 05:47:12 -0600
- Subject: Re: [ECOS] Configuring PCI devices
- Organization: MLB Associates
- References: <40B4350A.6000308@brennanhome.com>
On Wed, 2004-05-26 at 00:11, David Brennan wrote:
> I am trying to write a "device driver" for the Tundra Universe II chip.
> I am using a "public" linux driver for guidance. I was trying to use
> cyg_pci_read_uint32 to read the custom configuration registers for this
> chip, but found that was not working. On further investigation, I
> realized that offset is only a cyg_uint8. Since I am trying to access
> registers with an offset greater than 256, what is the preferred method
> of accessing these?
>
> The Linux code dereferences from the bar[0] address directly, then adds
> the offset, and reads the value with a readl macro call. Is that
> "acceptable" under eCos. I am writing this for a i386 pc platform. But
> if its possible to make it "cross platformable" I'm willing to work
> within the eCos HAL restrictions.
You seem to have some confusion here. cyg_pci_read_uint32() and
brethren are for accessing PCI configuration registers. If you want to
access PCI memory or I/O space, use the BAR[x] pointers.
--
Gary Thomas <gary@mlbassoc.com>
MLB Associates
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss