Hi.
I have a custom FPGA connected to i.mx6q on pcie bus.
I need to open 2 BARs with lengths of 64MB and 256KB but after some tests I found that it seems to be a limit of 4MB for memory regions under which everything's ok and over which I get these messages on kernel startup:
[ 1.307700] pci 0000:01:00.0: BAR 0: can't assign mem pref (size 0x4000000)
[ 1.314698] pci 0000:01:00.0: BAR 1: can't assign mem pref (size 0x40000)
I've found a similar problem on a previous application with Marvell Armada Xp and I solved it by changing a couple of parameters inside kernel board drivers, but I can't find similar defines inside linux sources for i.mx6.
Can someone help me in finding a solution please?
Thank you very much.
Solved! Go to Solution.
richard.zhu Jun 14, 2013 2:45 AM (in response to imxcommunityscout)
Based on the imx_3.0.35.4.0 FSL Linux BSP release, the layout of the 16MB address space of PCIe RC is listed below:
* i.MX6 defines 16MB in the AXI address map for PCIe.
*
* That address space excepted the pcie registers is
* split and defined into different regions by iATU,
* with sizes and offsets as follows:
*
* RC:
* 0x0100_0000 --- 0x010F_FFFF 1MB IORESOURCE_IO
* 0x0110_0000 --- 0x01EF_FFFF 14MB IORESOURCE_MEM
* 0x01F0_0000 --- 0x01FF_FFFF 1MB Cfg + MSI + Registers
*
0x0110_0000 ~ 0x01EF_FFFF 14MB would be used for MEM allocation.
But the "IORESOURCE_SIZEALIGN" would be used during the Linux PCI/PCIe subsystem probe/scan the bus and allocate the resources.
If the 8MB MEM is required, the start address 0x0180_0000 would be used by Linux PCI/PCIe subsystem, trying to
allocate the 8MB MEM space (0x0180_0000 ~ 0x01FF_FFFF), this operation would be failed.
Because that the limitation of the MEM space of iMX6 PCIe RC is
* 0x0110_0000 --- 0x01EF_FFFF 14MB IORESOURCE_MEM
So, One method to allocate the 8MB(the biggest size of IO/MEM space) MEM space on iMX6 PCIe RC.
Adjust the layout of the 16MB address space of iMX6 PCIe RC, like this:
* RC:
* 0x0100_0000 --- 0x01DF_FFFF 14MB IORESOURCE_MEM
* 0x01E0_0000 --- 0x01EF_FFFF 1MB IORESOURCE_IO
* 0x01F0_0000 --- 0x01FF_FFFF 1MB Cfg + MSI + Registers
The 8MB space would be allocated from 0x0100_0000 ~ 0x017F_FFFF.
Based two imx6 platforms, one is used as RC, the other is used as RC.
Here is the test log at RC side:
iMX6 PCIe PCIe RC mode imx_pcie_pltfm_probe entering.
PCIE: imx_pcie_pltfm_probe start link up.
IMX PCIe port: link up.
PCI: bus0: Fast back to back transfers disabled
PCI: bus1: Fast back to back transfers disabled
pci 0000:00:00.0: BAR 8: assigned [mem 0x01000000-0x017fffff]
pci 0000:00:00.0: BAR 0: assigned [mem 0x01800000-0x018fffff 64bit pref]
pci 0000:00:00.0: BAR 0: set to [mem 0x01800000-0x018fffff 64bit pref] (PCI address [0x1800000-0x18fffff])
pci 0000:00:00.0: BAR 9: assigned [mem 0x01900000-0x019fffff pref]
pci 0000:00:00.0: BAR 6: assigned [mem 0x01a00000-0x01a0ffff pref]
pci 0000:00:00.0: BAR 7: assigned [io 0x1e00000-0x1e00fff]
pci 0000:01:00.0: BAR 0: assigned [mem 0x01000000-0x017fffff]
pci 0000:01:00.0: BAR 0: set to [mem 0x01000000-0x017fffff] (PCI address [0x1000000-0x17fffff])
pci 0000:01:00.0: BAR 6: assigned [mem 0x01900000-0x0190ffff pref]
pci 0000:01:00.0: BAR 2: assigned [io 0x1e00000-0x1e00fff]
pci 0000:01:00.0: BAR 2: set to [io 0x1e00000-0x1e00fff] (PCI address [0x1e00000-0x1e00fff])
pci 0000:01:00.0: BAR 3: assigned [mem 0x01910000-0x019100ff pref]
pci 0000:01:00.0: BAR 3: set to [mem 0x01910000-0x019100ff pref] (PCI address [0x1910000-0x19100ff])
pci 0000:00:00.0: PCI bridge to [bus 01-01]
pci 0000:00:00.0: bridge window [io 0x1e00000-0x1e00fff]
pci 0000:00:00.0: bridge window [mem 0x01000000-0x017fffff]
pci 0000:00:00.0: bridge window [mem 0x01900000-0x019fffff pref]
Based on the imx_3.0.35.4.0 release, attach the patch
Hi,
Would it be possible to have access to this patch ? (I get access denied when I try to get it)
I have a similar problem trying to connect Imx6 to a DSP.
Thank you
Can you try again?
Hi,
I did but I get: https://community.freescale.com/login.jspa?authzFailed=true
Maybe my profile does not allow me to download stuff "???
Maybe you can try with other browser to see if this works.
I am sorry but I tried Safari, Chrome and Firefox and it does not work. Can you email me the patch since it is only 1.3K ? I really need it and I don't want to screw up the PCIe driver if I try to do it myself.
Hi Claude,
I tried by community but it doesnt work.
you can send me a private message with your email
Did you get it?
Hi Karina, I got a similar problem. Can you send me the patch as well?
I got it.
Fantastic :smileyhappy:
Dear Karina and Claude.
May I get the patch? I have similar problem.
The link is not allowed for me.
Please send it by email?
BR.
I have the same imx6 BAR problem. Could you send me the patch as well (to winfried<dot>dobbe<at>dynniq<dot>com) because my community account doesn't give me permission to download the patch.
Thanks in advance,
Winfried