Linux Resources

From PEL Wiki

Jump to: navigation, search

The Linux kernel keeps track of address ranges and their assignments using structures called resources.

I set up a RAM resource for my card at the same time the kernel reads the BIOS-supplied memory map. The problem with this is that we need to keep the PCI system from undoing that later in the boot process. It doesn't like PCI peripherals to be mapped into the same address space as RAM.

I tried just pretending that there was not an error, but that kludge didn't work out.

Right now I'm printing out the resource map, to see what I can do. I printed the tree structure, and I'm looking to see if I can assign the memory region to be the parent of the PCI regions.

One silly thing I found was that the PCI system in Linux disables the upper bits of the address, and never takes care of them again. I had to comment that out!

I added a tree traversal to make sure that the resources are getting set up correctly. Now I'm going to check the command bits at various times in the kernel and try to figure out when it changes. I searched for every instance where that register is written explicitly, and couldn't come up with the time it's disabled.

When the PCIe bus can't allocate the right resource, because I've already assigned that range to be E820_RAM, I use insert_resource to force it. Now there is a System RAM resource which has a PCIe bus resource and a card resource as children. That's the correct topology as far as I'm concerned, so I mark this "problem solved."