SPRUI30H November 2015 – May 2024 DRA745 , DRA746 , DRA750 , DRA756
The 6 base address registers ((EP) BAR0 through (EP) BAR5) supported in EP mode (Type0), get discovered and configured by the RC during PCI enumeration, as per the PCIe standard. Via the PCIe ECAM (enhanced configuration access) mechanism the RC maps a remote EP function's BAR registers in 64-bit PCIe memory space and software run on RC access them as the PCIECTRL_EP_PCIEWIRE_BAR0 through PCIECTRL_EP_PCIEWIRE_BAR5 registers. Note that the configuration space of the RC (Type1 registers) also contains two BARs ((RC) BAR0 and (RC) BAR1), but they are not expected to be used.
Before enumeration, BARs can be initialized by the local software, using DIF access (CS or CS2), to modify the properties seen by the RC at enumeration. The following can be configured in each BAR: enabling, IO or memory type, size (mask width). Even BAR numbers (0,2,4) can also be paired with the BAR number above (1,3,5) to create a single, 64-bit address (memory).
If PCIe_SS_PL_CONF instance located register PCIECTRL_PL_DBI_RO_WR_EN[0] CX_DBI_RO_WR_EN bit is cleared, most BAR fields become read-only again, behaving like in over-the-wire PCI Cfg writes by the RC. Only the BAR base address (MSbits) is still writable. The size/mask, type, and enabling become read-only.
Enabled(1) | Space(2) BARn[0] | Type(2) BARn[2:1] | Prefetch(2) BARn[3] | Mem Size(1) (M-bit mask) | I/O Size (M-bit mask) | |
---|---|---|---|---|---|---|
(EP) BAR0 | Yes | Memory (0) | 32-bit (2'b00) | Yes (1) | 1 MiB (20-bit) | 256 Bytes (8-bit) |
(EP) BAR1 | Yes | Memory (0) | 32-bit (2'b00) | Yes (1) | 64 KiB (16-bit) | 256 Bytes (8-bit) |
(EP) BAR2 | Yes | Memory (0) | 32-bit (2'b00) | Yes (1) | 1 MiB (20-bit) | 256 Bytes (8-bit) |
(EP) BAR3 | Yes | Memory (0) | 32-bit (2'b00) | Yes (1) | 64 KiB (16-bit) | 256 Bytes (8-bit) |
(EP) BAR4 | Yes | Memory (0) | 32-bit (2'b00) | Yes (1) | 4 KiB (12-bit) | 256 Bytes (8-bit) |
(EP) BAR5 | Yes | Memory (0) | 32-bit (2'b00) | Yes (1) | 64 KiB (16-bit) | 256 Bytes (8-bit) |
The Table 24-508 and Table 24-509 describe how a memory and IO BAR can be accessed, respectively. A single address of the PCIe config space is accessed for a given BAR, with each line of the table showing a different mode: read vs. write; PCIe Cfg access vs. DIF (CS) access vs. DIF (CS2) access.
"M" is the width of the BAR mask in bits, with 2M the BAR size in bytes. Bits M and above are writable by the RC over the PCIe wire to set the BAR base address, as follows:
Method | BAR[31:M](1) | BAR[M-1:4] | BAR[3] | BAR[2:1] | BAR[0] |
---|---|---|---|---|---|
PCI read | Base address readout | Read returns zero | Read out "Prefetchable" | Read out "Type" | Read out 0 "space decoder"(2) |
PCI write | Base address write | No effect (masked = R/O) | No effect | No effect | No effect |
CS read | Base address readout | Read returns zero (masked) | Read out "Prefetchable" | Read out "Type" | Read out 0 "space decoder"(2) |
CS write | Base address write | No effect (masked = R/O) | Write "Prefetchable" | Write "Type" | Write "space decoder"(2) |
CS2 read | Base address readout | Read returns zero (masked) | Read out "Prefetchable" | Read out "Type" | Read out 0 "space decoder"(2) |
CS2 write | Write 0 to unmask (Sets M) | Write 1 to mask (Sets M) | Write 1 | Write 1 | Write "BAR enable" |
Method | BAR[31:8] | BAR[7:2] | BAR[1] | BAR[0] |
---|---|---|---|---|
PCI read | Base address readout | Read returns zero | Read out 0 (reserved bit) | Read out 1 "space decoder"(1) |
PCI write | Base address write | No effect (masked = R/O) | No effect | No effect |
CS read | Base address readout | Read returns zero (masked) | Read out 0 (reserved bit) | Read out 1 "space decoder"(1) |
CS write | Base address write | No effect (masked = R/O) | Write 0 No effect | Write "space decoder"(1) |
CS2 read | Base address readout | Read returns zero (masked) | Read out 0 (reserved) | Read out 1 "space decoder"(1) |
CS2 write | Write 0. No effect in fixed-sized I/O BAR | Write 1. No effect in fixed-sized I/O BAR | Write 0 No effect | Write "BAR enable" |