Hi,
Configuring PCIe root port on Stratix 10 to allow the HPS to map an I/O BAR can be a complex process.
To be honest , I never try such deep before, but I can lay down some of the tips/suggestion for you to move on further.
- Modify the device tree: The device tree is used by the kernel to determine the system's hardware configuration. You can modify the device tree to map an IO space for the PCIe bridge. You can use the "ranges" property in the device tree to specify the base address and size of the I/O space. The "reg" property can be used to specify the base address and size of the memory space. Here's an example of what the device tree entry might look like:
pcie0: pcie@ffe201000 {
compatible = "pci-host-ecam-generic";
reg = <0x0 0xffe201000 0x0 0x1000>;
#address-cells = <3>;
#size-cells = <2>;
ranges = <0x81000000 0x0 0x00000000 0x00010000 0x00000000 0x00010000>,
<0x82000000 0x0 0x00000000 0x00010000 0x00000000 0x00010000>;
interrupts = <0 184 4>;
num-lanes = <8>;
max-functions = <8>;
dma-coherent;
status = "okay";
};
- Enable the I/O space in the PCIe root port configuration: In the Qsys Designer, you can enable the I/O space in the PCIe root port configuration. Under the "Root Port" tab, set the "I/O Space Enable" option to "Enabled".
- Verify that the PCIe bridge supports I/O space: Not all PCIe bridges support I/O space. You can verify that the PCIe bridge in your system supports I/O space by checking the device datasheet or manual. If the PCIe bridge does not support I/O space, you may need to use a different bridge that does support it.
- Check the PCIe endpoint configuration: The PCIe endpoint device (e.g. video card) must be configured to use the I/O space instead of memory space. This is usually done using the device's configuration registers. The configuration registers can be accessed using the "setpci" command in Linux.
Hope this is able to help.
Regards,
Wincent_Intel