diff options
author | Richard Zhu <Richard.Zhu@freescale.com> | 2015-05-15 12:49:44 +0800 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2015-09-17 09:23:24 -0500 |
commit | 6a1fd2416b22874c251ad90f5834d2e1f80f0f67 (patch) | |
tree | 40b6aad62918d2f72cc9baa5b8c1da5d193d3824 /drivers/pci | |
parent | d61759823bdaa500692ddf5c41d06f96a699cd59 (diff) |
MLK-10967-2 pci: imx: enable pcie ep rc msi test
Regarding to the limitation of the iMX ADAP(pcie connector),
only imx7d 12x12 arm2 board is used to verify the pcie
ep/rc validation system on imx7d platforms
Enalbe the msi pcie ep rc on it.
Test howto:
- Enable CONFIG_PCI_MSI=y, when rebuild the rc/ep images
- EP side(console command and kernel message):
root@imx6sxsabresd:~# ./memtool -32 <msi_addr>=0
Writing 32-bit value 0x0 to address <msi_addr>
- RC side(console command and kernel message):
root@imx6sxsabresd:~# cat /proc/interrupts | grep MSI
384: 1 PCI-MSI
Note:
imx6q msi_addr 0x01ff_8000
imx6sx msi_addr 0x08ff_8000
imx7d msi_addr 0x4ffc_0000
Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/host/pci-imx6-ep-driver.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/pci/host/pci-imx6-ep-driver.c b/drivers/pci/host/pci-imx6-ep-driver.c index 299a7655eade..192ced7cbffc 100644 --- a/drivers/pci/host/pci-imx6-ep-driver.c +++ b/drivers/pci/host/pci-imx6-ep-driver.c @@ -1,7 +1,7 @@ /* * PCIe endpoint skeleton driver for IMX6 SOCs * - * Copyright (C) 2014 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright (C) 2014-2015 Freescale Semiconductor, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,6 +28,7 @@ #include <linux/delay.h> #include <linux/sched.h> #include <linux/interrupt.h> +#include <linux/of.h> #define DRV_DESCRIPTION "i.MX PCIE endpoint device driver" #define DRV_VERSION "version 0.1" @@ -50,6 +51,7 @@ static int imx_pcie_ep_probe(struct pci_dev *pdev, { int ret = 0; unsigned int msi_addr = 0; + struct device_node *np; struct device *dev = &pdev->dev; struct imx_pcie_ep_priv *priv; @@ -85,16 +87,18 @@ static int imx_pcie_ep_probe(struct pci_dev *pdev, return ret; } + np = of_find_compatible_node(NULL, NULL, "snps,dw-pcie"); + /* - * Force to use 0x01FF8000 on iMX6q SD board and 0x08FF8000 - * on iMX6sx SDB board as the MSI address, to do the MSI demo + * Force to use the hardcode MSI address to do the MSI demo */ - if (*(unsigned int *)priv->hw_base > 0x4FFFFFFF) - /* iMX6sx SDB board, DDR layout [0x8000_0000 ~ 0xBFFF_FFFF] */ + if (of_device_is_compatible(np, "fsl,imx7d-pcie")) + msi_addr = 0x4FFC0000; + else if (of_device_is_compatible(np, "fsl,imx6sx-pcie")) msi_addr = 0x08FF8000; else - /* iMX6q SD board, DDR layout [0x1000_0000 ~ 0x4FFF_FFFF] */ msi_addr = 0x01FF8000; + pr_info("pci_msi_addr = 0x%08x\n", msi_addr); pci_bus_write_config_dword(pdev->bus, 0, 0x54, msi_addr); pci_bus_write_config_dword(pdev->bus->parent, 0, 0x820, msi_addr); |