Part Number: AM6548
Dear TI support team,
we are using the PCIe subsystem of the AM6548 to establish a PCIe connection to an x86 CPU. In this setup, the AM6548 runs in Endpoint mode, our code is running on the R5f using TI-RTOS / Processor SDK 06.01.
Since the PCIe driver that comes with the processor SDK (pdk_am65xx_1_0_6\packages\ti\drv\pcie\src\v2) appears to be an example specifically tailored to the connection of two AM* devices connected together we've written our own code for setting up the PCIe endpoint.
The endpoint is detected by the RC and accesses to configuration space work. The lspci command executed on the x86 shows the default BAR layout:
# lspci -vvv -n -s 01:00.0
...
Region 0: Memory at <unassigned> (64-bit, non-prefetchable) [size=1M]
Region 2: Memory at <unassigned> (64-bit, non-prefetchable) [size=8M]
Region 4: I/O ports at <unassigned> [disabled] [size=256]
Region 5: Memory at <unassigned> (32-bit, non-prefetchable) [size=2G]
...
This layout matches with the layout from section 12.2.2.4.15 of the TRM (SPRUID7E) - even though this section is only valid for SR2.0. A corresponding section for SR1.0 does not exist.
- Why is section 12.2.4.15 of the TRM only valid for SR2.0? How about SR1.0?
We want to change this layout. Changing the BAR type and memory type (to MEM 32-bit) works and is correctly detected by the RC.
However changing the BAR's size does not work as expected. According to the manual, the mask register is a shadow register at the address of the BAR register.
We performed the following steps to change it (as mentioned by the manual):
- Set the field DBI_CS2 in PCIE_EP_CMD_STATUS (Bit 5 at 05500004h)
- Write the new BAR mask (e.g. write 0000ffffh to register 05501024h)
- Clear the field DBI_CS2 in PCIE_EP_CMD_STATUS
After that, the size of the BAR did not change.
When the value ffffffffh will be written to 5501024h and immediately read back, the returned value is still 80000000h. This corresponds to a BAR size of 2G (like in the default configuration).
The KeyStoneArchitecture PCI User Guide (which does not apply to the AM6548) suggests that Bit 0 of the BAR mask register enables or disables the BAR.
Indeed after setting DBI_CS2, writing the value fffffffeh and clearing DBI_CS2, the BAR will be disabled. This implies that writes to the mask register produce a result. However changing the BAR's size does not work.
There is code in the PCIe sample that comes with the processor SDK, but since that code never uses the content of the BAR registers that example wouldn't detect if programming of the BAR size went wrong.
- How can the BAR size be changed?
- Is there a BAR_ENABLE bit for the AM6548 too (The manual does not mention it, or rather it doesn't document the BAR mask registers at all)?
- Which mask values correspond to which BAR sizes (our guess is: 00000fffh is 4k, 00001fffh is 8k, and so on)?
Best Regards,
Dominic