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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

1,163 次查看
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

标签 (2)
标记 (1)
0 项奖励
回复
2 回复数

1,036 次查看
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 项奖励
回复

1,036 次查看
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!
-----------------------------------------------------------------------------------------------------------------------