Embedded Linux PCI memory map

Hi, I have a question about PCI memory map. We use a processor that can only access 128M of PCI memory. So lets say it has assigned the PCI memory address from 0xd0000000 - 0xd7ffffff .. Now I have PCI device which has 4 base address.

Base Adress 0 - 64M Base Address 1 -4 M Base Address 2 - 4 M Base Adress 3 - 4 M

Now what I see when Linux Boots up. It sets the first PCI memory at 64 Meg boundary. That means, linux Writes 0xd4000000 on the first BaseAddress_0 of the PCI card . Then it would set the Base Address_1 to 0xd8000000.

Now as you can see, Linux just wasted the memory from 0xd0000000 -

0xd4000000 .. Is there any reason why Linux has to set the BaseAddress_0 starting at 64 Meg boundary. Why cannt I set BaseAddress_0 to 0xd0000000 (which is a page boudary) Thanks
Reply to
Loading thread data ...

First of all, I very much doubt that it is Linux that is the culprit. At least on a standard PC platform, it is the BIOS that is responsible for assigning addresses to PCI peripherals. I've never heard of an OS re-mapping them?!? (but am happy to be proven wrong)

In theory, the only restriction is that memory spaces must be naturally-aligned. In this case, $d0000000 is perfectly valid for a 64MB window.

In the normal course of events, you don't get much choice where these windows are allocated. You get what you're given.

However, it may be possible to re-locate a device's memory windows yourself by re-programming the BAR registers via PCI configuration cycles once the system is up and running. I'm not sure (a) exactly how this is done and (b) whether or not that'll confuse the hell out of Linux. Maybe you need to fake a 'hotswap'?

Regards, Mark

Reply to
Mark McDougall

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.