Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PCI-card memory not mapped



On Friday, February 21, 2003, at 04:30 AM, Bela Farago wrote:
BEFORE I my driver appears on scene IORegistry ALREADY indicates no memory for this card. If I am not misstaken all these problems appears BECAUSE Open Firmware did not correctly identified the card's needs?

No, it is not a problem. Before a driver requests for the card to be mapped into memory, it is not mapped.

gives any reason why there is no mapping done. There is really a need for an insider who knows at what stage the config (the card?) might fail ( might be not proper PCI conformance?)

The configuration has not failed. Your driver is responsible for creating the mappings.

I more or less worked around by creating two IOMemoryDescriptors with physical address as read from bar0 and bar1 and sizes of 0x800 and 0x4000 as read out from IORegistry, and call IOMemoryDescriptor's map method which returns an IOMemoryMap. As far as I am today it seems I can talk to the card but I do not know whether am I living dangerously or not... Will my code break when interrupts come into play or DMA?

I would look at an example PCI driver. The "AppleIntel8255x" driver (which you can check out from the Darwin CVS repository) is a good example, since it also shows how to set up DMA and interrupts. Basically, in your start routine you will want to make one or more calls of the form:

IOMemoryMap *map0;
map0 = nub->mapDeviceMemoryWithRegister(kIOPCIConfigBaseAddress0);

The memory described by BAR0 will be mapped in, and a handle to this mapping will be placed in map0. You can then call methods on map0 to get information (such as the virtual or physical address to which the device memory has been mapped, etc.).


Hope this helps,

Amanda Walker
_______________________________________________
darwin-drivers mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-drivers
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: PCI-card memory not mapped (From: Bela Farago <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.