Can we remove the PCIe IO resource for i.MX6 if not using it?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can we remove the PCIe IO resource for i.MX6 if not using it?

542 Views
GregT
Contributor III

I don't think we need the io resource for the PCIe on the i.MX6.  We will not be supporting legacy PCI and we have a dedicated embedded system that only communicates with FPGAs through BARs and MSI interrrupts.  Can we remove the io resource allocation in the pcie.c driver and add 1MB to the memory resource as shown below?

So remove this:

/*
* IORESOURCE_IO
*/
snprintf(pp->io_space_name, sizeof(pp->io_space_name),
"PCIe %d I/O", pp->index);
pp->io_space_name[sizeof(pp->io_space_name) - 1] = 0;
pp->res[0].name = pp->io_space_name;
if (pp->index == 0) {
pp->res[0].start = PCIE_ARB_BASE_ADDR + SZ_16M - SZ_2M;
pp->res[0].end = pp->res[0].start + SZ_1M - 1;
}
pp->res[0].flags = IORESOURCE_IO;
if (request_resource(&ioport_resource, &pp->res[0]))
panic("Request PCIe IO resource failed\n");
sys->resource[0] = &pp->res[0];

and change the memory resource to:

/*
* IORESOURCE_MEM
*/
snprintf(pp->mem_space_name, sizeof(pp->mem_space_name),
"PCIe %d MEM", pp->index);
pp->mem_space_name[sizeof(pp->mem_space_name) - 1] = 0;
pp->res[0].name = pp->mem_space_name;
if (pp->index == 0) {
pp->res[0].start = PCIE_ARB_BASE_ADDR;
pp->res[0].end = pp->res[0].start + SZ_16M - SZ_1M - 1;
}
pp->res[0].flags = IORESOURCE_MEM;
if (request_resource(&iomem_resource, &pp->res[0]))
panic("Request PCIe Memory resource failed\n");
sys->resource[0] = &pp->res[0];

Thanks in advance,

Greg

Labels (2)
Tags (1)
0 Kudos
2 Replies

415 Views
GregT
Contributor III

I've made the above changes and our system is still running correctly.  Looks like an easy way to get an extra MB for PCIe BAR space if you don't need to support legacy PCI devices that use I/O resources.

0 Kudos

415 Views
b36401
NXP Employee
NXP Employee

Yes. It can be tuned with BAR configuration.
However officially it is not recommended.

Have a great day,
Victor

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------