This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: accessing PCI device


On Wed, 2006-08-30 at 09:41 +0200, Jacek Poplawski wrote:
> Hello Mark,
> > This is the base address of the CPU's window into PCI IO space. So if a
> > PCI device BAR is set to X in IO space, the CPU accesses it with BASE+X.
> >   
> That's what I was thinking.
> (and sorry I mean also HAL_PCI_PHYSICAL_MEMORY_BASE)
> But I wonder why this value was different in Intel's port of RedBoot and 
> in the Linux kernel.
> And why Linux kernel uses ioremap before accessing memory?
> Maybe I should use something like that also in ecos?

eCos != Linux, so naturally the PCI support for the two OSes is
different.

For one thing, the virtual memory maps are different and that would
explain the different base addresses. I don't know about ixp2xxx, but
even the physical base addresses are configurable on some controllers.

ioremap() takes a physical address and returns a "cookie" that can
be used with read{b,w,l} and friends. Presumably, the phys address
is gotten by calling pci_resource_start() or some such.

In an eCos driver, you'd typically use cyg_pci_get_device_info() to
gather information about the device. Part of the returned info is
the virtual addresses of the device mem/io regions. So there's no
need for an ioremap() equivelent.

--Mark



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]