public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Configuring PCI devices
@ 2004-05-26  9:17 David Brennan
  2004-05-26 12:28 ` Gary Thomas
  0 siblings, 1 reply; 2+ messages in thread
From: David Brennan @ 2004-05-26  9:17 UTC (permalink / raw)
  To: eCos Discuss

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.

Thanks
David Brennan

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] Configuring PCI devices
  2004-05-26  9:17 [ECOS] Configuring PCI devices David Brennan
@ 2004-05-26 12:28 ` Gary Thomas
  0 siblings, 0 replies; 2+ messages in thread
From: Gary Thomas @ 2004-05-26 12:28 UTC (permalink / raw)
  To: David Brennan; +Cc: eCos Discuss

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-05-26 11:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-26  9:17 [ECOS] Configuring PCI devices David Brennan
2004-05-26 12:28 ` Gary Thomas

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 read-only IMAP folder(s) and NNTP newsgroup(s).