Multiple PCI memory system resources problem

Hello everyone,

I ran into a “system resource” problem while trying to modify the bsp-freescale-mpc8349mds_pci-mpc83xx PCI driver to make it drive both PCI controllers present on the PPC8349 CPU.

Each PCI controller needs to allocate its own range of PCI memory (RSRCDBMGR_PCI_MEMORY) so that their individual bus can be map into the CPU memory space. I need to create two distinct PCI memory resources so that memory accesses targeted at a specific PCI device can goes trough the right PCI controller.

I manage to create both of my PCI memory resource.

My problem it that I don’t know how to instruct rsrcdbmgr_attach to get the memory resource from the first or the second PCI memory resource previously allocated. This is necessary to make sure that the device driver will access the device trough the proper PCI controller.

I saw that I can add additional flags like RSRCDBMGR_FLAG_NOREMOVE while I am creating the PCI memory resource and I tough that I might be able to use a RSRCDBMGR_RESERVED_5 or to extend those flags to allow me to distinguish between the two PCI memory resources.

Is that the right way to go?

Is there another way to do it?

Thank you