AnsweredAssumed Answered

Can not allocate PCIe region when size is 8M on Sabre platform

Question asked by Chris Hossack on Nov 4, 2015
Latest reply on Jan 13, 2016 by Chris Hossack

Hi

I’ve recompiled the imx6 kernel to support PCIe (see Re: Changing the Kernel configuration for i.MX6 SABRE ) and connected my PCI TMS320C6424 via a PCIe-toPCI adaptor to the sabre mini-PCIe slot. I can see my device correctly attached to the PCIe bus

 

$ lspci

00:00.0 PCI bridge: Device 16c3:abcd (rev 01)

01:00.0 PCI bridge: Pericom Semiconductor PI7C9X111SL PCIe-to-PCI Reversible Bridge (rev 02)

02:04.0 Signal processing controller: Texas Instruments TMS320C6424

 

But the kernel has failed to assigned any PCIe regions greater than 4M.

 

$ lspci -vvv -s 02:04.0

02:04.0 Signal processing controller: Texas Instruments TMS320C6424

        Subsystem: Device 04b8:0136

        Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr+ Stepping- SERR+ FastB2B- DisINTx-

        Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-

        Interrupt: pin A routed to IRQ 155

        Region 0: Memory at <unassigned> (32-bit, prefetchable) [disabled]

        Region 1: Memory at 01400000 (32-bit, non-prefetchable) [disabled] [size=64K]

        Region 2: Memory at 01000000 (32-bit, non-prefetchable) [disabled] [size=4M]

        Region 3: Memory at <unassigned> (32-bit, prefetchable) [disabled]

        Region 4: Memory at <unassigned> (32-bit, prefetchable) [disabled]

        Region 5: Memory at <unassigned> (32-bit, prefetchable) [disabled]

 

When I plug in my TMS320C6424 board in to 386 Ubuntu PC it does allocate the 8M regions.

 

$ lspci -vvv -s 01:04.0

01:04.0 Signal processing controller: Texas Instruments TMS320C6424

        Subsystem: Device 04b8:0136

        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-

        Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-

        Latency: 64, Cache Line Size: 32 bytes

        Interrupt: pin A routed to IRQ 16

        Region 0: Memory at fd800000 (32-bit, prefetchable) [size=8M]

        Region 1: Memory at febf0000 (32-bit, non-prefetchable) [size=64K]

        Region 2: Memory at fe400000 (32-bit, non-prefetchable) [size=4M]

        Region 3: Memory at fd000000 (32-bit, prefetchable) [size=8M]

        Region 4: Memory at fc800000 (32-bit, prefetchable) [size=8M]

        Region 5: Memory at fc000000 (32-bit, prefetchable) [size=8M]

 

I looked around for other solutions and found this possible patch PCIe BAR length limit  written by for imx_3.0.35.4.0 but when I added this to my linux-imx_3.10.53.bbappend I get the following error

 

ERROR: Command Error: exit status: 1  Output:

Applying patch 0001-imx-pcie-fix-the-8MB-size-MEM-space-allocation-failu.patch

can't find file to patch at input line 33

Perhaps you used the wrong -p or --strip option?

The text leading up to this was:

--------------------------

|From da2b24e9270da50cc1547e436dfdb648b9ce6b3a Mon Sep 17 00:00:00 2001

|From: Richard Zhu <r65037@freescale.com>

|Date: Fri, 14 Jun 2013 15:50:55 +0800

|Subject: [PATCH] imx: pcie: fix the 8MB size MEM space allocation failure

|

|"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 the address if outof 0x0110_0000 ~ 0x01EF_FFFF limitaion.

|

|solution:

|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:

|        * 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.

|

|Signed-off-by: Richard Zhu <r65037@freescale.com>

|---

| arch/arm/mach-mx6/pcie.c |    8 ++++----

| 1 files changed, 4 insertions(+), 4 deletions(-)

|

|diff --git a/arch/arm/mach-mx6/pcie.c b/arch/arm/mach-mx6/pcie.c

|index c4e8f7d..6f38b0a 100644

|--- a/arch/arm/mach-mx6/pcie.c

|+++ b/arch/arm/mach-mx6/pcie.c

--------------------------

No file to patch.  Skipping patch.

3 out of 3 hunks ignored

Patch 0001-imx-pcie-fix-the-8MB-size-MEM-space-allocation-failu.patch does not apply (enforce with -f)

ERROR: Function failed: patch_do_patch

ERROR: Logfile of failure stored in: /mnt/data/imx6/fsl-release-bsp-3-10-53/build-x11/tmp/work/imx6qsabresd-poky-linux-gnueabi/linux-imx/3.10.53-r0/temp/log.do_patch.4295

ERROR: Task 1 (/mnt/data/imx6/fsl-release-bsp-3-10-53/sources/meta-fsl-bsp-release/imx/meta-fsl-arm/recipes-kernel/linux/linux-imx_3.10.53.bb, do_patch) failed with exit code '1'

 

It looks like the file arch/arm/mach-mx6/pcie.c no longer exists at that location and grep-ing for a similar one produces no winners.

 

$ find ./tmp/work/imx6qsabresd-poky-linux-gnueabi/linux-imx/3.10.53-r0/git -name pcie.c

./drivers/net/wireless/mwifiex/pcie.c

./arch/arm/mach-cns3xxx/pcie.c

./arch/arm/mach-tegra/pcie.c

./arch/arm/plat-orion/pcie.c

./arch/arm/mach-dove/pcie.c

./arch/arm/mach-mv78xx0/pcie.c

./arch/arm/mach-kirkwood/pcie.c

 

 

I need these 8M PCIe regions to access the TMS320C6424 on-board memory, and these are fixed at power up so I can’t change them.

 

Can anybody help?

 

Cheers

 

Chris

Outcomes