[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AIX drivers
Sorry I didn't get back to you Hans.
Ok well here is a piece of code that attaches successfully.
struct io_map io_m;
struct io_map *io_m_ptr = &io_m;
char value;
int bid = BID_VAL(IO_PCI, PCI_BUSMEM, 0);
unsigned long ioaddr;
(io_m_ptr)->key = IO_MEM_MAP; /* ONLY THIS */
(io_m_ptr)->flags = 0; /* read/write */
(io_m_ptr)->size = 0xff; /* Whatever */
(io_m_ptr)->bid = BID_VAL(IO_PCI, PCI_BUSMEM, BID_NUM(bid));
(io_m_ptr)->busaddr = (long long)(ulong)bus_mem_address;
ioaddr = iomem_att(io_m_ptr);
/* read in character value at offset 0x2 */
value = *(volatile unsigned char *)(ioaddr | 0x2))
eieio();
iomem_det(ioaddr);
I have also sent an attachment of one module that helped me from a graphics PCI device driver.
I have a question for you.
We have up to now done many performance tests with my little driver. We have found that attaching and detaching each time we want to access our board is TOO costsly on resources. It is imperative that we get realtime performance with the system. IS there some way to map all the baseaddresses at ONCE. We just want to avoid mapping them individually each time. For example:
If I write 0x20000000 into base_address0 of the PCI card and then I do an attach starting at this address but for a larger memory space that could include all the other base_addressX registers would I be able to now access using offsets any internal registers on my card. Or is it only possible to map ONE region at any given time.
Craig
PCI.zip