PCI memspace access
Posted: Thu Jan 10, 2008 7:49 pm
Hello Gurus,
In my setup, Linux runs on the BSP of my dual core cpu and a tiny simple OS runs on the AP core with its own reserved memory, IDT and GDT. No paging. AP code can see all the memory.
There is an inexpensive PCI-X card on the system which is memory mapped (This card asks for 1MB mem space, but does not have any on-board memory).
I'm discarding the original driver and writing a new one. This driver would write some data in the base addr mentioned in BAR0 of this card and send a fixed-vector IPI to the AP core. The Intr handler in AP for this vector should be able to read the data written in the above base addr.
Will the following scheme work for the above requirement?
1. In the tiny kernel running on AP core, statically allocate the memspace requirement sizing BAR0. (e.g long driverMem[4 MB])
2. Point this allocated memory to the device's base address (e.g. *baseAddr = driverMem)
If this won't work, is there a correct or better way to do it?
Thanks for your time.
In my setup, Linux runs on the BSP of my dual core cpu and a tiny simple OS runs on the AP core with its own reserved memory, IDT and GDT. No paging. AP code can see all the memory.
There is an inexpensive PCI-X card on the system which is memory mapped (This card asks for 1MB mem space, but does not have any on-board memory).
I'm discarding the original driver and writing a new one. This driver would write some data in the base addr mentioned in BAR0 of this card and send a fixed-vector IPI to the AP core. The Intr handler in AP for this vector should be able to read the data written in the above base addr.
Will the following scheme work for the above requirement?
1. In the tiny kernel running on AP core, statically allocate the memspace requirement sizing BAR0. (e.g long driverMem[4 MB])
2. Point this allocated memory to the device's base address (e.g. *baseAddr = driverMem)
If this won't work, is there a correct or better way to do it?
Thanks for your time.