All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] pci: layerscape: Fixup iommu-map for LS208xA
@ 2017-08-31  7:56 Bharat Bhushan
  2017-09-25 17:31 ` York Sun
  0 siblings, 1 reply; 2+ messages in thread
From: Bharat Bhushan @ 2017-08-31  7:56 UTC (permalink / raw)
  To: u-boot

"pci: layerscape: Fixup device tree node for ls2088a" added
support for LS208xA devices but fixing iommu-map property
is missing. This patch adds support for fixing iommu-map.

Signed-off-by: Bharat Bhushan <Bharat.Bhushan@nxp.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
 drivers/pci/pcie_layerscape_fixup.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/pci/pcie_layerscape_fixup.c b/drivers/pci/pcie_layerscape_fixup.c
index 9e6c2f5..3dae201 100644
--- a/drivers/pci/pcie_layerscape_fixup.c
+++ b/drivers/pci/pcie_layerscape_fixup.c
@@ -130,19 +130,28 @@ static void fdt_pcie_set_iommu_map_entry(void *blob, struct ls_pcie *pcie,
 	u32 iommu_map[4];
 	int nodeoffset;
 	int lenp;
+	uint svr;
+	char *compat = NULL;
 
 	/* find pci controller node */
 	nodeoffset = fdt_node_offset_by_compat_reg(blob, "fsl,ls-pcie",
 						   pcie->dbi_res.start);
 	if (nodeoffset < 0) {
 #ifdef CONFIG_FSL_PCIE_COMPAT /* Compatible with older version of dts node */
-		nodeoffset = fdt_node_offset_by_compat_reg(blob,
-				CONFIG_FSL_PCIE_COMPAT, pcie->dbi_res.start);
+		svr = (get_svr() >> SVR_VAR_PER_SHIFT) & 0xFFFFFE;
+		if (svr == SVR_LS2088A || svr == SVR_LS2084A ||
+		    svr == SVR_LS2048A || svr == SVR_LS2044A ||
+		    svr == SVR_LS2081A || svr == SVR_LS2041A)
+			compat = "fsl,ls2088a-pcie";
+		else
+			compat = CONFIG_FSL_PCIE_COMPAT;
+
+		if (compat)
+			nodeoffset = fdt_node_offset_by_compat_reg(blob,
+						compat, pcie->dbi_res.start);
+#endif
 		if (nodeoffset < 0)
 			return;
-#else
-		return;
-#endif
 	}
 
 	/* get phandle to iommu controller */
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH] pci: layerscape: Fixup iommu-map for LS208xA
  2017-08-31  7:56 [U-Boot] [PATCH] pci: layerscape: Fixup iommu-map for LS208xA Bharat Bhushan
@ 2017-09-25 17:31 ` York Sun
  0 siblings, 0 replies; 2+ messages in thread
From: York Sun @ 2017-09-25 17:31 UTC (permalink / raw)
  To: u-boot

On 08/31/2017 12:59 AM, Bharat Bhushan wrote:
> "pci: layerscape: Fixup device tree node for ls2088a" added
> support for LS208xA devices but fixing iommu-map property
> is missing. This patch adds support for fixing iommu-map.
> 
> Signed-off-by: Bharat Bhushan <Bharat.Bhushan@nxp.com>
> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
> ---

Revised commit message.
Applied to fsl-qoriq mater. Thanks.

York

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-25 17:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-31  7:56 [U-Boot] [PATCH] pci: layerscape: Fixup iommu-map for LS208xA Bharat Bhushan
2017-09-25 17:31 ` York Sun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.