PCIE RC侧的设备树和配置主要需要配置以下几个部分:
- PCIe控制器节点
在设备树中添加PCIe控制器节点,并设置相应属性,如vendor-id、device-id、bus-range等。具体示例如下:
pcie0: pcie@ff800000 {
compatible = "xlnx,versal-pcie-5.2", "xlnx,versal-pcie";
reg = <0x0 0xff800000 0x0 0x1000>;
interrupts = <0 60 4>;
interrupt-names = "msi";
#address-cells = <3>;
#size-cells = <2>;
ranges = <0x02000000 0 0x40000000 0x40000000 0 0x40000000>;
};
- PCIe端口节点
在PCIe控制器节点下添加PCIe端口节点,并设置相应属性,如vendor-id、device-id、bar-range等。具体示例如下:
pcie0_ep: endpoint@0 {
compatible = "xlnx,versal-pcie-5.2-ep", "xlnx,versal-pcie-ep";
reg = <0x0 0x0 0x0 0x1000>;
device_type = "pci";
/* BAR0 */
ranges = <0x02000000 0x0 0x30000000 0x0 0x30000000 0x1000000>;
reg-names = "bar";
reg = <0x0 0x0 0x30000000>;
/* MSI */
msi-controller;
msi-parent = <&pcie0>;
interrupts = <0 61 4>;
interrupt-names = "msi";
};
- 设备驱动节点
在PCIe端口节点下添加设备驱动节点,并设置相应属性,如compatible、interrupts等。具体示例如下:
my_device: my_device@0 {
compatible = "my_device";
reg = <0x0 0x0 0x0 0x0 0x0>;
interrupts = <0 62 4>;
};
以上是一个简单的PCIE RC侧设备树和配置示例,具体配置要根据硬件设计而定。
PCIE RC侧的设备树和配置主要需要配置以下几个部分:
- PCIe控制器节点
在设备树中添加PCIe控制器节点,并设置相应属性,如vendor-id、device-id、bus-range等。具体示例如下:
pcie0: pcie@ff800000 {
compatible = "xlnx,versal-pcie-5.2", "xlnx,versal-pcie";
reg = <0x0 0xff800000 0x0 0x1000>;
interrupts = <0 60 4>;
interrupt-names = "msi";
#address-cells = <3>;
#size-cells = <2>;
ranges = <0x02000000 0 0x40000000 0x40000000 0 0x40000000>;
};
- PCIe端口节点
在PCIe控制器节点下添加PCIe端口节点,并设置相应属性,如vendor-id、device-id、bar-range等。具体示例如下:
pcie0_ep: endpoint@0 {
compatible = "xlnx,versal-pcie-5.2-ep", "xlnx,versal-pcie-ep";
reg = <0x0 0x0 0x0 0x1000>;
device_type = "pci";
/* BAR0 */
ranges = <0x02000000 0x0 0x30000000 0x0 0x30000000 0x1000000>;
reg-names = "bar";
reg = <0x0 0x0 0x30000000>;
/* MSI */
msi-controller;
msi-parent = <&pcie0>;
interrupts = <0 61 4>;
interrupt-names = "msi";
};
- 设备驱动节点
在PCIe端口节点下添加设备驱动节点,并设置相应属性,如compatible、interrupts等。具体示例如下:
my_device: my_device@0 {
compatible = "my_device";
reg = <0x0 0x0 0x0 0x0 0x0>;
interrupts = <0 62 4>;
};
以上是一个简单的PCIE RC侧设备树和配置示例,具体配置要根据硬件设计而定。