This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320C6678: Unable to read C6678 PCIe endpoint PCIe Config memory (0x2180_0000)

Part Number: TMS320C6678

Hello,

I am working on C6678-based PCIe endpoint using 64-bit PCIe addressing. I am unable to read PCIe config space (through BARs 2/3) starting at 0x2180_0000 in C6678 memory map.  I can, however, read the PCIe application registers through BARs 0/1.

My Inbound BARs are set up as:

initC6678PcieMemoryRegions: Region 0: BAR = 0x00000002, START = 0x380300000000, OFFSET = 0x00800000
initC6678PcieMemoryRegions: Region 1: BAR = 0x00000004, START = 0x380280000000, OFFSET = 0x80000000
initC6678PcieMemoryRegions: Region 2: BAR = 0x00000000, START = 0x000000000,    OFFSET = 0x00000000
initC6678PcieMemoryRegions: Region 3: BAR = 0x00000000, START = 0x000000000,    OFFSET = 0x00000000

where, the START addresses for IB_BARs 0 and 1 are set to the addresses of the PCIe BARs 0/1 and 2/3, respectively.

So, IB_BAR(1) is used to access DDR memory at 0x8000_0000 and above through BARs 4/5 while IB_BAR(0) is used to access all memory/registers having addresses less than 0x8000_0000.

I am able to read and write core-specific L2SRAM (i.e. 0x108x_xxxx | CORE << 24) but when reading PCIe config through the same IB_BAR the reads all return 0xffff_ffff.

For example, the contents of the ROM boot version string when retrieved through IB_BAR(0) look correct:

ROM Boot Version String:
0x0000: 0x76 0x31 0x2e 0x31 0x32 0x20 0x53 0x61 0x74 0x20 0x41 0x75 0x67 0x20 0x31 0x33 v1.12 Sat Aug 13
0x0010: 0x20 0x31 0x35 0x3a 0x32 0x31 0x3a 0x30 0x37 0x20 0x32 0x30 0x31 0x31 0x20 0x69 15:21:07 2011 i
0x0020: 0x32 0x63 0x20 0x6d 0x61 0x63 0x20 0x73 0x72 0x69 0x6f 0x20 0x70 0x63 0x69 0x65 2c mac srio pcie
0x0030: 0x20 0x76 0x75 0x73 0x72 0x20 0x73 0x70 0x69 0x00 0x00 0x00 0x00 0x00 0x00 0x00 vusr spi.......

Is it possible to read from PCIe root complex the C6678 PCIe Config information provided at 0x2180_00000?

Thank you!
Brad
 



  • Hi,

    I've notified the RTOS team. Their feedback will be posted directly here.

    Best Regards,
    Yordan
  • Hi Yordan,

    Thanks for the reply - looking forward to their response!
    Brad

  • Here's another data point ...

    I modified the IB_OFFSET(0) to be 0x2180_0000 instead of 0x0080_0000 while still being associated with BAR2/3. After doing this I was still unable to read the PCIe Config registers at offsets of 0x0, 0x4, 0x310, 0x1000 and 0x1050. All read returned with 0xFFFF_FFFF
  • Hi,

    I have some confusion on the problem. C6678 is the PCIE EP, what is the PCIE RC? You set up the inbound translation of the C6678 and there are 4 regions with total 6 BARs. And BAR 0 is dedicated for address space 0, including application and configuration registers. In 64-bit address mode, BAR0 and BAR1 is used together. " I can, however, read the PCIe application registers through BARs 0/1.". What is the BAR mask size setting in the C6678 side? In 32-bit address mode, can you read configuration register?

    Regards, Eric
  • Hi Eric,

    Yes, C6678 is PCIe EP. The PCIe RC is Intel-based running Windows Server 2012. We configure C6678 to boot into PCIe boot mode with 64-bit addressing. The BARs 2/3 and 4/5 are each allocated 2GB apertures.

    I haven't tried booting into 32-bit PCIe addressing mode since it would require modifications to FPGA (which sets the boot mode) as well as adapting driver for 32-bit addressing (don't have a linux box to run our hardware in).

    Here are the registers you requested (we have 2 C6678s on our custom board):

    C6678-0:
    ---------------------------------
    Value Mask
    BAR0: 0xD0D00004 0xFFFFF000
    BAR1: 0x00000000 0x00000000
    BAR2: 0x0000000C 0x80000000
    BAR3: 0x00003803 0x00000000
    BAR4: 0x8000000C 0x80000000
    BAR5: 0x00003802 0x00000000

    C6678-1:
    ---------------------------------
    Value Mask
    BAR0: 0xD0C00004 0xFFFFF000
    BAR1: 0x00000000 0x00000000
    BAR2: 0x0000000C 0x80000000
    BAR3: 0x00003802 0x00000000
    BAR4: 0x8000000C 0x80000000
    BAR5: 0x00003801 0x00000000

    I obtained the Mask values by writing 0xFFFF_FFF0 to each of the BARs from within BlackHawk JTAG emulator. The lower 32-bits were first written before writing the upper 32-bits for each BAR which I guess explains why the upper 32-bits are 0s instead of Fs
  • I tried reading various PCIe config-space registers through BARs 2/3 using both 8-bit and 16-bit reads (instead of 32-bit reads) and those returned 0xFF and 0xFFFF, respectively.
  • In Code Composer Debug View I displayed the memory as 64-bit values (TI format). Then I wrote to the BAR registers (starting at 0x2180_1010) using 64-bit value of 0xFFFF_FFFF_FFFF_FFF0. The values did not change from above:

    C6678-0:
    ---------------------------------
    Value Mask
    BAR0: 0xD0D00004 0xFFFFF000
    BAR1: 0x00000000 0x00000000
    BAR2: 0x0000000C 0x80000000
    BAR3: 0x00003803 0x00000000
    BAR4: 0x8000000C 0x80000000
    BAR5: 0x00003802 0x00000000

    C6678-1:
    ---------------------------------
    Value Mask
    BAR0: 0xD0C00004 0xFFFFF000
    BAR1: 0x00000000 0x00000000
    BAR2: 0x0000000C 0x80000000
    BAR3: 0x00003802 0x00000000
    BAR4: 0x8000000C 0x80000000
    BAR5: 0x00003801 0x00000000

    I expected the upper 32-bits of each BAR MASK to be 0xFFFF_FFFF but instead they all came back as 0x0000_0000 ...
  • Here's the contents of our DEVSTAT register:

    DEVSTAT: 0x0001_23C9

    LENDIAN:         0b1             LITTLE ENDIAN

    BOOTMODE[12:0]:  0x11E4          

    BOOT DEVICE: 0x4             PCIe BOOT MODE

    PCIe CFG:    0x3c            2048 MB, 64-BIT, BARs for BAR2/3 and BAR4/5

    PCIESSMODE[1:0]: 0b00            END POINT

    PCIESSEN:        0b1             PCIe module enabled

    PACLKSEL:        0b0             Select PASSCLK

  • I also checked the CMD_STATUS and STATUS_COMMAND registers on both C6678s:


    CMD_STATUS: 0x0000_0005

    LTSSM_EN:          0b1 - Enable LTSSM
    OB_XLT_EN:         0b1 - Enable outbound address translation
    IB_XLT_EN:         0b1 - Enable inbound address translation
    POSTED_WR_ENABLE:  0b0 - Disable internal bus master to use posted write commands (N/A for KeyStone)
    APP_RETRY_EN:      0b0 - Disable all incoming PCIe transactions to be returned with a retry response
    DBI_CS2:           0b0 - Disable writing to BAR MASK registers


    STATUS_COMMAND: 0x0810_0146

    IO_SP:              0b0 - N/A for KeyStone devices
    MEM_SP:             0b1 - Enable memory accesses
    BUS_MS:             0b1 - Enable bus mastership
    PAR_ERR_RESP:       0b1 - PCIESS responds normally to parity errors
    SERR_EN:            0b1 - Enable generation of error messages to RC
    INTX_DIS:           0b0 - INTX generation enabled 
    INT_STAT:           0b0 - No interrupts received
    CAP_LIST:           0b1 - always 0b1 for PCIe
    DAT_PAR_ERROR:      0b0 - No R/W parity errors from requester
    SIG_TGT_ABORT:      0b1 - A function acting as completer terminates a request by issuing
                              completer abort completion status to requester

    RX_TGT_ABORT:       0b0 - Requester has not received a completion with abort status
    RX_MST_ABORT:       0b0 - Requester has not received a completion with unsupported request
                              status
    SIG_SYS_ERROR:      0b0 - Function has not received ERR_FATAL or ERR_NONFATAL
    PARITY_ERROR:       0b0 - No poisoned TLP received by function

    The only troubling field is the SIG_TGT_ABORT

  • Hi Eric,

    I am awaiting your feedback/input.

    Thanks,
    Brad

  • Are there any TI employees that can help me resolve this issue?
    Thanks!
  • Hi,

    CMD_STATUS: 0x0000_0005

    LTSSM_EN:          0b1 - Enable LTSSM

    OB_XLT_EN:         0b1 - Enable outbound address translation

    IB_XLT_EN:         0b1 - Enable inbound address translation

    Can you double check if this is a typo? The OB needs to be enabled.

    Regards, Eric

  • Hi Eric,

    The OB_XLT_EN is not enabled. Here is dump of config-space using BlackHawk emulator:

    0x2180_0000 4E301101 00000005 00000000 00000000 00000000 00010000 00000000 00000000
    0x2180_0020 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_0040 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_0060 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_0080 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_00A0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_00C0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_00E0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_0100 00000000 00000000 00000001 00000001 00000000 00000000 00000000 00000000
    0x2180_0120 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_0140 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_0160 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_0180 00000000 00000000 00000001 00000001 00000000 00000000 00000001 00000001
    0x2180_01A0 00000000 00000000 00000001 00000001 00000000 00000000 00000001 00000001
    0x2180_01C0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_01E0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_0200 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_0220 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_0240 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_0260 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_0280 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_02A0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_02C0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_02E0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_0300 00000002 00000000 00003803 00800000 00000004 80000000 00003802 21800000
    0x2180_0320 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_0340 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_0360 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_0380 00002110 00000000 00001111 00000000 00062320 00022320 00000000 00000000
    0x2180_03A0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_03C0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    0x2180_03E0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

    Thanks!
    Brad
  • Hi Eric,

    I have adapted my driver to enable outbound translation in the C6678 endpoint:

    C6678 CMD_STATUS (initial): 0x00000005
    C6678 OB_SIZE (initial):    0x00000000

    C6678 CMD_STATUS (final):   0x00000007
    C6678 OB_SIZE (final):      0x00000000

    Even with outbound translation enabled, I still am unable to access PCIe config space through BARs 2/3 - reads return 0xffff_ffff.

    Thanks,
    Brad

  • Hi,

    I looked at your application register dump and inbound translation setting, also the BAR mask and BAR settings. I thought BAR0/1 should be used to access the configuration. Why BAR0/1 is 0xD0C0_0004? What if 0x0000_0004?

    Regards, Eric
  • Hi Eric,

    From the PCIe User Guide (sprugs6d.pdf), the lower 4 bits in BAR0, BAR2 and BAR4 are:


    Bit    0: MEM_SPACE (0 = Memory BAR, 1 = I/O BAR)
    Bit 2-1: TYPE (0b00 = 32-bit BAR, 0b10 = 64-bit BAR) 
    Bit    3: PREFETCH

    So, 


    BAR0/1 = 0x0000_0000_D0C0_0004 -> 64-bit memory BAR
    BAR2/3 = 0x0000_3802_0000_000C -> 64-bit PREFETCHABLE memory BAR
    BAR4/5 = 0x0000_3801_8000_000C -> 64-bit PREFETCHABLE memory BAR

    So, BARs 2/3 and 4/5 both have PREFETCHABLE bit enabled. Could that be the problem?

    Thanks,
    Brad

  • Hi,

    My suggestion is to use BAR0/1. Why you used 0xD0C0_0004 instead of 0x0000_0004? In our PCIE driver example, the BAR is configured as no-prefetch. You can try BAR2/3 or BAR 4/5 with that as well, with inbound translation offset to 0x2180_0000.

    Regards, Eric

  • Hi Eric,

    My suggestion is to use BAR0/1.

    Since BAR0/1 only provides a 4KB window, I need to use either BAR2/3 or BAR4/5 to access those config-space registers that sit above 0x1000 (e.g. STATUS_COMMAND is at offset of 0x1004 in PCIe config space and BAR0/1 doesn't provide access to that offset)

    Why you used 0xD0C0_0004 instead of 0x0000_0004

    The BAR of 0xD0C0_0004 is the value assigned by the operating system (Windows in my case) to the C6678 PCIe endpoint. I can't change this value. Also, I the PREFETCHABLE, TYPE, and MEM_SPACE bits are set by the OS during PCIe enumeration.

    Please note that I am directly booting into PCIe boot mode.  I am not first booting into I2C and loading Boot Parameter or Boot Config tables - so I am not modifying any portion of the PCIe boot mode settings except for what is provided through the BOOTMODE pins.

    You can try BAR2/3 or BAR 4/5 with that as well, with inbound translation offset to 0x2180_0000

    I have tried both BAR2/3 and BAR4/5 with offsets of 0x2180_0000 and that did not make any difference.  I also tried offset of 0 (instead of 0x80_0000) and that didn't help either.

    One interesting new piece of information is that (now that I am able to initialize DDR3 on my platform), I can now access (Read and Write) DDR3 memory with BAR4/5 offset set to 0x8000_0000. So I am not sure it has to do with the inbound offset.

    Regards,
    Brad

  • Hi Eric,

    I tested reading the following areas through BAR2/3:

    DDR3 EMIF Configuratiom:
    0x2100_0000:  Reads returned 0xCCCC_CCCC
    0x2100_0004:  Reads returned 0xCCCC_CCCC

    HyperLink Configuration:
    0x2140_0000:  Reads returned 0xCCCC_CCCC
    0x2140_0004:  Reads returned 0xCCCC_CCCC

    PCIe Configuration:
    0x2180_0000: Reads returned 0xFFFF_FFFF
    0x2180_0004: Reads returned 0xFFFF_FFFF

    Queue Manager Configuration:
    0x3400_0000: Reads returned 0xCCCC_CCCC
    0x3400_0004: Reads returned 0xCCCC_CCCC

    HyperLink Data:
    0x4000_0000: Reads returned 0xCCCC_CCCC
    0x4000_0004: Reads returned 0xCCCC_CCCC

    PCIe Data:
    0x6000_0000: Reads returned 0xCCCC_CCCC
    0x6000_0000: Reads returned 0xCCCC_CCCC

    Should I be able to access any of these areas over the PCIe link?  

  • Hi,

    If you can use BAR4/5 to access DDR, then there should be no issue to use BAR2/3 to access DDR as well by changing the inbound offset (please move BAR4/5 to pointing someplace else).

    You used BAR2/3 to access a lots of peripheral registers, I thought your trial is arbitrary and the returned data is garbage, the access doesn't work. But be aware that even your PCIE setting is correct, you are not necessarily able to access those. EMIF is 36-bit, need 36 to 32 bit mapping; Hyperlink register needs power up, Hyperlink data needs link established, etc....

    Please make sure that either use BAR2/3 or BAR 4/5 you can access MSMC, or DDR or global L2. Then for the BAR0/1, where did you setup the BAR mask to 4KB, can you assign a 16KB mask?

    Regards, Eric
  • Hi Eric,

    If you can use BAR4/5 to access DDR, then there should be no issue to use BAR2/3 to access DDR as well by changing the inbound offset (please move BAR4/5 to pointing someplace else). 

    Yes, I can use both BAR2/3 and BAR4/5 to access DDR!

    You used BAR2/3 to access a lots of peripheral registers, I thought your trial is arbitrary and the returned data is garbage, the access doesn't work. But be aware that even your PCIE setting is correct, you are not necessarily able to access those. EMIF is 36-bit, need 36 to 32 bit mapping; Hyperlink register needs power up, Hyperlink data needs link established, etc....

    OK. Understood that some of the peripheral register sets can only be accessed once enabled.  

    Please make sure that either use BAR2/3 or BAR 4/5 you can access MSMC, or DDR or global L2. Then for the BAR0/1, where did you setup the BAR mask to 4KB, can you assign a 16KB mask?

    Yes, currently BAR2/3 can access MSMC and L2SRAM while BAR4/5 can access DDR3.  

    But, how can I modify the window size of the BAR0/1 beyond 4kB? I believe that is done by the ROM Boot Loader. Currently I am booting directly into PCIe Boot Mode.  My understanding is that to modify the PCIe BAR window sizes further than what is available from the RBL, I would need to boot into, for example, I2C boot mode and provide Boot Parameter and Boot Config Tables that would set the BAR0/1 MASK for 32KB window size.

    Even the "PCIe Boot Mode Parameter Table" (in sprs691e.pdf) does not provide for setting Window 0 size - only Windows 1 (BAR2/3) and 2 (BAR4/5) are configurable in this table.  

    So, how should I configure BAR0/1 for 32KB window size?

    Thanks,
    Brad

  • Hi,

    Sorry I forgot you used the PCIE boot mode from ROM. When using BAR2/3 or BAR4/5 and pointing to 0x2180_0000, is that correct you can read back the first 4KB of PCIE registers (that is application register), but not the next 4KB (from 0x2180_1000 for configuration register)?

    Regards, Eric
  • Hi Eric,

    No, I can only read from 0x2180_0000 - 0x2180_FFFC when accessing through BAR 0/1. Using either BAR2/3 or BAR4/5 to access that same area returns 0xFFFF_FFFF for reads.

    I am unable to read over the PCIe link any PCIe config registers in locations 0x2180_1000 - 0x2180_7FFC when using any BAR (BAR0/1, BAR2/3 or BAR4/5). So, for example, I am unable to read using any 64-bit BAR the Configuration Registers Common to Type 0 and Type 1 Headers, Configuration Type 0 Registers, Configuration Type 1 Registers, Power Management Capability Registers, MSI Registers, PCI Capabilities Registers, etc

    Thanks,
    Brad
  • Eric,

    I am resolving this issue.

    We are able to access PCIe config space registers using config cycles and i guess it would violate the PCIe specs to be able to access/modify these registers without using config cycles (e.g. TLPs through BAR2/3 or BAR4/5). I have confirmed that I can access MSMC, L2SRAM and DDR3 through the BARs

    Thanks,
    Brad