MLK-16818-2 PCI: imx: enable the pcie ep rc for imx8
authorRichard Zhu <hongxing.zhu@nxp.com>
Fri, 17 Nov 2017 06:46:32 +0000 (14:46 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:47:04 +0000 (15:47 -0500)
commit59c53960c177d801cc709b2a78297a467ea4e999
treec63013a97d7320caab98bd5b2bcbf53a950beb25
parent4335198475aeb1367fb7282274f769070b014756
MLK-16818-2 PCI: imx: enable the pcie ep rc for imx8

Enable the PCIE EP RC for iMX8

RC access memory of EP:
- EP:
  write the <ddr_region_address> to the bar0 of ep.
- RC:
  access the <mem_base_address>, and this address
  would be mapped to the <ddr_region_address> of ep.
Note:
        ddr_region_address    mem_base_addr  bar0_addr
imx8mq  0xb820_0000           0x2000_0000    0x33c0_0010
imx8qxp 0xb820_0000           0x6000_0000    0x5f00_0010
imx8qm  0xb820_0000           0x7000_0000    0x5f01_0010

MSI verification:
- EP:
  write 0 to the <msi_addr>, for example ./memtool -32 <msi_addr>=0
- RC:
  check the msi is triggered or not.
  cat /proc/interrupts | grep msi
Note:
The msi_addr can be get by the following command after RC platform
is boot up.
For example
root@imx8_all:~# dmesg | grep msi_addr
[    2.670247] pci_msi_addr = 0x7ff80000, cpu_base 0x80000000

        msi_addr
imx8mq  0x27f8_0000
imx8qxp 0x6ff8_0000
imx8qm  0x7ff8_0000

iMX8QM:
BuildInfo:
- SCFW daabd5d3, IMX-MKIMAGE 0ad6069a, ATF 93dd1cc
- U-Boot 2017.03-imx_v2017.03+gc662e0a
iMX8QXP:
BuildInfo:
- SCFW daabd5d3, IMX-MKIMAGE 0ad6069a, ATF 93dd1cc
- U-Boot 2017.03-imx_v2017.03+gc662e0a

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
drivers/pci/host/pci-imx6-ep-driver.c
drivers/pci/host/pci-imx6.c
drivers/pci/host/pcie-designware.c
drivers/pci/host/pcie-designware.h