All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/5] soc/fsl/qbman: Rework private memory allocations
@ 2017-03-29 21:13 ` Roy Pledge
  0 siblings, 0 replies; 44+ messages in thread
From: Roy Pledge @ 2017-03-29 21:13 UTC (permalink / raw)
  To: robin.murphy-5wv7dgnIgG8, oss-fOR+EgIDQEHk1uMJSBkQmQ,
	linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: madalin.bucur-3arQi8VN3Tc, Roy Pledge

The QBMan device requires three separate memory areas that are only
accessed by the device. These areas are reserved using the OF reserved
memory mechanism and associated to the device in the device trees
memory-region attribute. However in order to be allocatable using
the dma_alloc() APIs the reservations compatiable string must
include "shared-dma-pool" and specify "no-map".

This set of changes updates the QBMan driver, PPC device trees and
bindings to use the above mechasism. This work was encouraged as part
of preparing this driver to work on ARM processors.

Roy Pledge (5):
  soc/fsl/qbman: Use shared-dma-pool for BMan private memory allocations
  soc/fsl/qbman: Use shared-dma-pool for QMan private memory allocations
  dts: arch/powerpc: Update Freescale DTS for QBMan memory allocations
  dt-bindings: soc/fsl: Update reserved memory binding for QBMan
  powerpc: Add HAVE_GENERIC_DMA_COHERENT options to Kconfig

 Documentation/devicetree/bindings/soc/fsl/bman.txt |  10 +-
 Documentation/devicetree/bindings/soc/fsl/qman.txt |  16 +--
 arch/powerpc/Kconfig                               |   1 +
 arch/powerpc/boot/dts/fsl/b4qds.dtsi               |   6 ++
 arch/powerpc/boot/dts/fsl/b4si-post.dtsi           |  15 ---
 arch/powerpc/boot/dts/fsl/cyrus_p5020.dts          |   6 ++
 arch/powerpc/boot/dts/fsl/kmcent2.dts              |   6 ++
 arch/powerpc/boot/dts/fsl/kmcoge4.dts              |   6 ++
 arch/powerpc/boot/dts/fsl/oca4080.dts              |   6 ++
 arch/powerpc/boot/dts/fsl/p1023rdb.dts             |   6 ++
 arch/powerpc/boot/dts/fsl/p1023si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/p2041rdb.dts             |   6 ++
 arch/powerpc/boot/dts/fsl/p2041si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/p3041ds.dts              |   6 ++
 arch/powerpc/boot/dts/fsl/p3041si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/p4080ds.dts              |   6 ++
 arch/powerpc/boot/dts/fsl/p4080si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/p5020ds.dts              |   6 ++
 arch/powerpc/boot/dts/fsl/p5020si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/p5040ds.dts              |   6 ++
 arch/powerpc/boot/dts/fsl/p5040si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/t1023rdb.dts             |   6 ++
 arch/powerpc/boot/dts/fsl/t1023si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/t1024qds.dts             |   6 ++
 arch/powerpc/boot/dts/fsl/t1024rdb.dts             |   6 ++
 arch/powerpc/boot/dts/fsl/t1040si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/t104xd4rdb.dtsi          |   6 ++
 arch/powerpc/boot/dts/fsl/t104xqds.dtsi            |   6 ++
 arch/powerpc/boot/dts/fsl/t104xrdb.dtsi            |   6 ++
 arch/powerpc/boot/dts/fsl/t2081si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/t208xqds.dtsi            |   6 ++
 arch/powerpc/boot/dts/fsl/t208xrdb.dtsi            |   6 ++
 arch/powerpc/boot/dts/fsl/t4240qds.dts             |   6 ++
 arch/powerpc/boot/dts/fsl/t4240rdb.dts             |   6 ++
 arch/powerpc/boot/dts/fsl/t4240si-post.dtsi        |  15 ---
 drivers/soc/fsl/qbman/bman_ccsr.c                  |  27 ++++-
 drivers/soc/fsl/qbman/bman_priv.h                  |   3 +
 drivers/soc/fsl/qbman/qman_ccsr.c                  | 119 ++++++++++++---------
 drivers/soc/fsl/qbman/qman_priv.h                  |   4 +-
 drivers/soc/fsl/qbman/qman_test.h                  |   2 -
 40 files changed, 238 insertions(+), 235 deletions(-)

--
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [RFC PATCH 0/5] soc/fsl/qbman: Rework private memory allocations
@ 2017-03-29 21:13 ` Roy Pledge
  0 siblings, 0 replies; 44+ messages in thread
From: Roy Pledge @ 2017-03-29 21:13 UTC (permalink / raw)
  To: robin.murphy, oss, linuxppc-dev, linux-arm-kernel, devicetree
  Cc: madalin.bucur, Roy Pledge

The QBMan device requires three separate memory areas that are only
accessed by the device. These areas are reserved using the OF reserved
memory mechanism and associated to the device in the device trees
memory-region attribute. However in order to be allocatable using
the dma_alloc() APIs the reservations compatiable string must
include "shared-dma-pool" and specify "no-map".

This set of changes updates the QBMan driver, PPC device trees and
bindings to use the above mechasism. This work was encouraged as part
of preparing this driver to work on ARM processors.

Roy Pledge (5):
  soc/fsl/qbman: Use shared-dma-pool for BMan private memory allocations
  soc/fsl/qbman: Use shared-dma-pool for QMan private memory allocations
  dts: arch/powerpc: Update Freescale DTS for QBMan memory allocations
  dt-bindings: soc/fsl: Update reserved memory binding for QBMan
  powerpc: Add HAVE_GENERIC_DMA_COHERENT options to Kconfig

 Documentation/devicetree/bindings/soc/fsl/bman.txt |  10 +-
 Documentation/devicetree/bindings/soc/fsl/qman.txt |  16 +--
 arch/powerpc/Kconfig                               |   1 +
 arch/powerpc/boot/dts/fsl/b4qds.dtsi               |   6 ++
 arch/powerpc/boot/dts/fsl/b4si-post.dtsi           |  15 ---
 arch/powerpc/boot/dts/fsl/cyrus_p5020.dts          |   6 ++
 arch/powerpc/boot/dts/fsl/kmcent2.dts              |   6 ++
 arch/powerpc/boot/dts/fsl/kmcoge4.dts              |   6 ++
 arch/powerpc/boot/dts/fsl/oca4080.dts              |   6 ++
 arch/powerpc/boot/dts/fsl/p1023rdb.dts             |   6 ++
 arch/powerpc/boot/dts/fsl/p1023si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/p2041rdb.dts             |   6 ++
 arch/powerpc/boot/dts/fsl/p2041si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/p3041ds.dts              |   6 ++
 arch/powerpc/boot/dts/fsl/p3041si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/p4080ds.dts              |   6 ++
 arch/powerpc/boot/dts/fsl/p4080si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/p5020ds.dts              |   6 ++
 arch/powerpc/boot/dts/fsl/p5020si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/p5040ds.dts              |   6 ++
 arch/powerpc/boot/dts/fsl/p5040si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/t1023rdb.dts             |   6 ++
 arch/powerpc/boot/dts/fsl/t1023si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/t1024qds.dts             |   6 ++
 arch/powerpc/boot/dts/fsl/t1024rdb.dts             |   6 ++
 arch/powerpc/boot/dts/fsl/t1040si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/t104xd4rdb.dtsi          |   6 ++
 arch/powerpc/boot/dts/fsl/t104xqds.dtsi            |   6 ++
 arch/powerpc/boot/dts/fsl/t104xrdb.dtsi            |   6 ++
 arch/powerpc/boot/dts/fsl/t2081si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/t208xqds.dtsi            |   6 ++
 arch/powerpc/boot/dts/fsl/t208xrdb.dtsi            |   6 ++
 arch/powerpc/boot/dts/fsl/t4240qds.dts             |   6 ++
 arch/powerpc/boot/dts/fsl/t4240rdb.dts             |   6 ++
 arch/powerpc/boot/dts/fsl/t4240si-post.dtsi        |  15 ---
 drivers/soc/fsl/qbman/bman_ccsr.c                  |  27 ++++-
 drivers/soc/fsl/qbman/bman_priv.h                  |   3 +
 drivers/soc/fsl/qbman/qman_ccsr.c                  | 119 ++++++++++++---------
 drivers/soc/fsl/qbman/qman_priv.h                  |   4 +-
 drivers/soc/fsl/qbman/qman_test.h                  |   2 -
 40 files changed, 238 insertions(+), 235 deletions(-)

--
2.9.3

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

* [RFC PATCH 0/5] soc/fsl/qbman: Rework private memory allocations
@ 2017-03-29 21:13 ` Roy Pledge
  0 siblings, 0 replies; 44+ messages in thread
From: Roy Pledge @ 2017-03-29 21:13 UTC (permalink / raw)
  To: linux-arm-kernel

The QBMan device requires three separate memory areas that are only
accessed by the device. These areas are reserved using the OF reserved
memory mechanism and associated to the device in the device trees
memory-region attribute. However in order to be allocatable using
the dma_alloc() APIs the reservations compatiable string must
include "shared-dma-pool" and specify "no-map".

This set of changes updates the QBMan driver, PPC device trees and
bindings to use the above mechasism. This work was encouraged as part
of preparing this driver to work on ARM processors.

Roy Pledge (5):
  soc/fsl/qbman: Use shared-dma-pool for BMan private memory allocations
  soc/fsl/qbman: Use shared-dma-pool for QMan private memory allocations
  dts: arch/powerpc: Update Freescale DTS for QBMan memory allocations
  dt-bindings: soc/fsl: Update reserved memory binding for QBMan
  powerpc: Add HAVE_GENERIC_DMA_COHERENT options to Kconfig

 Documentation/devicetree/bindings/soc/fsl/bman.txt |  10 +-
 Documentation/devicetree/bindings/soc/fsl/qman.txt |  16 +--
 arch/powerpc/Kconfig                               |   1 +
 arch/powerpc/boot/dts/fsl/b4qds.dtsi               |   6 ++
 arch/powerpc/boot/dts/fsl/b4si-post.dtsi           |  15 ---
 arch/powerpc/boot/dts/fsl/cyrus_p5020.dts          |   6 ++
 arch/powerpc/boot/dts/fsl/kmcent2.dts              |   6 ++
 arch/powerpc/boot/dts/fsl/kmcoge4.dts              |   6 ++
 arch/powerpc/boot/dts/fsl/oca4080.dts              |   6 ++
 arch/powerpc/boot/dts/fsl/p1023rdb.dts             |   6 ++
 arch/powerpc/boot/dts/fsl/p1023si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/p2041rdb.dts             |   6 ++
 arch/powerpc/boot/dts/fsl/p2041si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/p3041ds.dts              |   6 ++
 arch/powerpc/boot/dts/fsl/p3041si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/p4080ds.dts              |   6 ++
 arch/powerpc/boot/dts/fsl/p4080si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/p5020ds.dts              |   6 ++
 arch/powerpc/boot/dts/fsl/p5020si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/p5040ds.dts              |   6 ++
 arch/powerpc/boot/dts/fsl/p5040si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/t1023rdb.dts             |   6 ++
 arch/powerpc/boot/dts/fsl/t1023si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/t1024qds.dts             |   6 ++
 arch/powerpc/boot/dts/fsl/t1024rdb.dts             |   6 ++
 arch/powerpc/boot/dts/fsl/t1040si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/t104xd4rdb.dtsi          |   6 ++
 arch/powerpc/boot/dts/fsl/t104xqds.dtsi            |   6 ++
 arch/powerpc/boot/dts/fsl/t104xrdb.dtsi            |   6 ++
 arch/powerpc/boot/dts/fsl/t2081si-post.dtsi        |  15 ---
 arch/powerpc/boot/dts/fsl/t208xqds.dtsi            |   6 ++
 arch/powerpc/boot/dts/fsl/t208xrdb.dtsi            |   6 ++
 arch/powerpc/boot/dts/fsl/t4240qds.dts             |   6 ++
 arch/powerpc/boot/dts/fsl/t4240rdb.dts             |   6 ++
 arch/powerpc/boot/dts/fsl/t4240si-post.dtsi        |  15 ---
 drivers/soc/fsl/qbman/bman_ccsr.c                  |  27 ++++-
 drivers/soc/fsl/qbman/bman_priv.h                  |   3 +
 drivers/soc/fsl/qbman/qman_ccsr.c                  | 119 ++++++++++++---------
 drivers/soc/fsl/qbman/qman_priv.h                  |   4 +-
 drivers/soc/fsl/qbman/qman_test.h                  |   2 -
 40 files changed, 238 insertions(+), 235 deletions(-)

--
2.9.3

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

* [RFC PATCH 1/5] soc/fsl/qbman: Use shared-dma-pool for BMan private memory allocations
  2017-03-29 21:13 ` Roy Pledge
  (?)
@ 2017-03-29 21:13     ` Roy Pledge
  -1 siblings, 0 replies; 44+ messages in thread
From: Roy Pledge @ 2017-03-29 21:13 UTC (permalink / raw)
  To: robin.murphy-5wv7dgnIgG8, oss-fOR+EgIDQEHk1uMJSBkQmQ,
	linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: madalin.bucur-3arQi8VN3Tc, Roy Pledge

Use the shared-memory-pool mechanism for free buffer proxy record
area allocation.

Signed-off-by: Roy Pledge <roy.pledge-3arQi8VN3Tc@public.gmane.org>
---
 drivers/soc/fsl/qbman/bman_ccsr.c | 27 ++++++++++++++++++++++++++-
 drivers/soc/fsl/qbman/bman_priv.h |  3 +++
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/fsl/qbman/bman_ccsr.c b/drivers/soc/fsl/qbman/bman_ccsr.c
index a8e8389..5485c3c 100644
--- a/drivers/soc/fsl/qbman/bman_ccsr.c
+++ b/drivers/soc/fsl/qbman/bman_ccsr.c
@@ -170,10 +170,11 @@ static int fsl_bman_probe(struct platform_device *pdev)
 {
 	int ret, err_irq;
 	struct device *dev = &pdev->dev;
-	struct device_node *node = dev->of_node;
+	struct device_node *mem_node, *node = dev->of_node;
 	struct resource *res;
 	u16 id, bm_pool_cnt;
 	u8 major, minor;
+	u64 size;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res) {
@@ -201,6 +202,30 @@ static int fsl_bman_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
+	ret = of_reserved_mem_device_init(dev);
+	if (ret) {
+		dev_err(dev, "of_reserved_mem_device_init() failed 0x%x\n", ret);
+		return -ENODEV;
+	}
+	mem_node = of_parse_phandle(dev->of_node, "memory-region", 0);
+	if (mem_node) {
+		ret = of_property_read_u64(mem_node, "size", &size);
+		if (ret) {
+			dev_err(dev, "FBPR: of_address_to_resource fails 0x%x\n", ret);
+			return -ENODEV;
+		}
+		fbpr_sz = size;
+	} else {
+		dev_err(dev, "No memory-region found for FBPR\n");
+		return -ENODEV;
+	}
+	if (!dma_zalloc_coherent(dev, fbpr_sz, &fbpr_a, 0)) {
+		dev_err(dev, "Alloc FBPR memory failed\n");
+		return -ENODEV;
+	}
+
+	dev_info(dev, "Allocated FBPR 0x%llx 0x%zx\n", fbpr_a, fbpr_sz);
+
 	bm_set_memory(fbpr_a, fbpr_sz);
 
 	err_irq = platform_get_irq(pdev, 0);
diff --git a/drivers/soc/fsl/qbman/bman_priv.h b/drivers/soc/fsl/qbman/bman_priv.h
index f6896a2..765a4bf 100644
--- a/drivers/soc/fsl/qbman/bman_priv.h
+++ b/drivers/soc/fsl/qbman/bman_priv.h
@@ -33,6 +33,9 @@
 #include "dpaa_sys.h"
 
 #include <soc/fsl/bman.h>
+#include <linux/dma-contiguous.h>
+#include <linux/of_address.h>
+#include <linux/dma-mapping.h>
 
 /* Portal processing (interrupt) sources */
 #define BM_PIRQ_RCRI	0x00000002	/* RCR Ring (below threshold) */
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [RFC PATCH 1/5] soc/fsl/qbman: Use shared-dma-pool for BMan private memory allocations
@ 2017-03-29 21:13     ` Roy Pledge
  0 siblings, 0 replies; 44+ messages in thread
From: Roy Pledge @ 2017-03-29 21:13 UTC (permalink / raw)
  To: robin.murphy, oss, linuxppc-dev, linux-arm-kernel, devicetree
  Cc: madalin.bucur, Roy Pledge

Use the shared-memory-pool mechanism for free buffer proxy record
area allocation.

Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
---
 drivers/soc/fsl/qbman/bman_ccsr.c | 27 ++++++++++++++++++++++++++-
 drivers/soc/fsl/qbman/bman_priv.h |  3 +++
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/fsl/qbman/bman_ccsr.c b/drivers/soc/fsl/qbman/bman_ccsr.c
index a8e8389..5485c3c 100644
--- a/drivers/soc/fsl/qbman/bman_ccsr.c
+++ b/drivers/soc/fsl/qbman/bman_ccsr.c
@@ -170,10 +170,11 @@ static int fsl_bman_probe(struct platform_device *pdev)
 {
 	int ret, err_irq;
 	struct device *dev = &pdev->dev;
-	struct device_node *node = dev->of_node;
+	struct device_node *mem_node, *node = dev->of_node;
 	struct resource *res;
 	u16 id, bm_pool_cnt;
 	u8 major, minor;
+	u64 size;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res) {
@@ -201,6 +202,30 @@ static int fsl_bman_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
+	ret = of_reserved_mem_device_init(dev);
+	if (ret) {
+		dev_err(dev, "of_reserved_mem_device_init() failed 0x%x\n", ret);
+		return -ENODEV;
+	}
+	mem_node = of_parse_phandle(dev->of_node, "memory-region", 0);
+	if (mem_node) {
+		ret = of_property_read_u64(mem_node, "size", &size);
+		if (ret) {
+			dev_err(dev, "FBPR: of_address_to_resource fails 0x%x\n", ret);
+			return -ENODEV;
+		}
+		fbpr_sz = size;
+	} else {
+		dev_err(dev, "No memory-region found for FBPR\n");
+		return -ENODEV;
+	}
+	if (!dma_zalloc_coherent(dev, fbpr_sz, &fbpr_a, 0)) {
+		dev_err(dev, "Alloc FBPR memory failed\n");
+		return -ENODEV;
+	}
+
+	dev_info(dev, "Allocated FBPR 0x%llx 0x%zx\n", fbpr_a, fbpr_sz);
+
 	bm_set_memory(fbpr_a, fbpr_sz);
 
 	err_irq = platform_get_irq(pdev, 0);
diff --git a/drivers/soc/fsl/qbman/bman_priv.h b/drivers/soc/fsl/qbman/bman_priv.h
index f6896a2..765a4bf 100644
--- a/drivers/soc/fsl/qbman/bman_priv.h
+++ b/drivers/soc/fsl/qbman/bman_priv.h
@@ -33,6 +33,9 @@
 #include "dpaa_sys.h"
 
 #include <soc/fsl/bman.h>
+#include <linux/dma-contiguous.h>
+#include <linux/of_address.h>
+#include <linux/dma-mapping.h>
 
 /* Portal processing (interrupt) sources */
 #define BM_PIRQ_RCRI	0x00000002	/* RCR Ring (below threshold) */
-- 
2.9.3

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

* [RFC PATCH 1/5] soc/fsl/qbman: Use shared-dma-pool for BMan private memory allocations
@ 2017-03-29 21:13     ` Roy Pledge
  0 siblings, 0 replies; 44+ messages in thread
From: Roy Pledge @ 2017-03-29 21:13 UTC (permalink / raw)
  To: linux-arm-kernel

Use the shared-memory-pool mechanism for free buffer proxy record
area allocation.

Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
---
 drivers/soc/fsl/qbman/bman_ccsr.c | 27 ++++++++++++++++++++++++++-
 drivers/soc/fsl/qbman/bman_priv.h |  3 +++
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/fsl/qbman/bman_ccsr.c b/drivers/soc/fsl/qbman/bman_ccsr.c
index a8e8389..5485c3c 100644
--- a/drivers/soc/fsl/qbman/bman_ccsr.c
+++ b/drivers/soc/fsl/qbman/bman_ccsr.c
@@ -170,10 +170,11 @@ static int fsl_bman_probe(struct platform_device *pdev)
 {
 	int ret, err_irq;
 	struct device *dev = &pdev->dev;
-	struct device_node *node = dev->of_node;
+	struct device_node *mem_node, *node = dev->of_node;
 	struct resource *res;
 	u16 id, bm_pool_cnt;
 	u8 major, minor;
+	u64 size;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res) {
@@ -201,6 +202,30 @@ static int fsl_bman_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
+	ret = of_reserved_mem_device_init(dev);
+	if (ret) {
+		dev_err(dev, "of_reserved_mem_device_init() failed 0x%x\n", ret);
+		return -ENODEV;
+	}
+	mem_node = of_parse_phandle(dev->of_node, "memory-region", 0);
+	if (mem_node) {
+		ret = of_property_read_u64(mem_node, "size", &size);
+		if (ret) {
+			dev_err(dev, "FBPR: of_address_to_resource fails 0x%x\n", ret);
+			return -ENODEV;
+		}
+		fbpr_sz = size;
+	} else {
+		dev_err(dev, "No memory-region found for FBPR\n");
+		return -ENODEV;
+	}
+	if (!dma_zalloc_coherent(dev, fbpr_sz, &fbpr_a, 0)) {
+		dev_err(dev, "Alloc FBPR memory failed\n");
+		return -ENODEV;
+	}
+
+	dev_info(dev, "Allocated FBPR 0x%llx 0x%zx\n", fbpr_a, fbpr_sz);
+
 	bm_set_memory(fbpr_a, fbpr_sz);
 
 	err_irq = platform_get_irq(pdev, 0);
diff --git a/drivers/soc/fsl/qbman/bman_priv.h b/drivers/soc/fsl/qbman/bman_priv.h
index f6896a2..765a4bf 100644
--- a/drivers/soc/fsl/qbman/bman_priv.h
+++ b/drivers/soc/fsl/qbman/bman_priv.h
@@ -33,6 +33,9 @@
 #include "dpaa_sys.h"
 
 #include <soc/fsl/bman.h>
+#include <linux/dma-contiguous.h>
+#include <linux/of_address.h>
+#include <linux/dma-mapping.h>
 
 /* Portal processing (interrupt) sources */
 #define BM_PIRQ_RCRI	0x00000002	/* RCR Ring (below threshold) */
-- 
2.9.3

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

* [RFC PATCH 2/5] soc/fsl/qbman: Use shared-dma-pool for QMan private memory allocations
  2017-03-29 21:13 ` Roy Pledge
  (?)
@ 2017-03-29 21:13     ` Roy Pledge
  -1 siblings, 0 replies; 44+ messages in thread
From: Roy Pledge @ 2017-03-29 21:13 UTC (permalink / raw)
  To: robin.murphy-5wv7dgnIgG8, oss-fOR+EgIDQEHk1uMJSBkQmQ,
	linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: madalin.bucur-3arQi8VN3Tc, Roy Pledge

Use the shared-memory-pool mechanism for frame queue descriptor and
packed frame descriptor record area allocations.

Signed-off-by: Roy Pledge <roy.pledge-3arQi8VN3Tc@public.gmane.org>
---
 drivers/soc/fsl/qbman/qman_ccsr.c | 119 +++++++++++++++++++++-----------------
 drivers/soc/fsl/qbman/qman_priv.h |   4 +-
 drivers/soc/fsl/qbman/qman_test.h |   2 -
 3 files changed, 68 insertions(+), 57 deletions(-)

diff --git a/drivers/soc/fsl/qbman/qman_ccsr.c b/drivers/soc/fsl/qbman/qman_ccsr.c
index 90bc40c..35c59ca 100644
--- a/drivers/soc/fsl/qbman/qman_ccsr.c
+++ b/drivers/soc/fsl/qbman/qman_ccsr.c
@@ -400,63 +400,19 @@ static int qm_init_pfdr(struct device *dev, u32 pfdr_start, u32 num)
 	return -ENODEV;
 }
 
-/*
- * Ideally we would use the DMA API to turn rmem->base into a DMA address
- * (especially if iommu translations ever get involved).  Unfortunately, the
- * DMA API currently does not allow mapping anything that is not backed with
- * a struct page.
- */
+/* QMan needs two global memory areas initialized at boot time:
+    1) FQD: Frame Queue Descriptors used to manage frame queues
+    2) PFDR: Packed Frame Queue Descriptor Records used to store frames
+   Both areas are reserved using the device tree reserved memory framework
+   and the addresses and sizes are initialized when the QMan device is probed */
 static dma_addr_t fqd_a, pfdr_a;
 static size_t fqd_sz, pfdr_sz;
 
-static int qman_fqd(struct reserved_mem *rmem)
-{
-	fqd_a = rmem->base;
-	fqd_sz = rmem->size;
-
-	WARN_ON(!(fqd_a && fqd_sz));
-
-	return 0;
-}
-RESERVEDMEM_OF_DECLARE(qman_fqd, "fsl,qman-fqd", qman_fqd);
-
-static int qman_pfdr(struct reserved_mem *rmem)
-{
-	pfdr_a = rmem->base;
-	pfdr_sz = rmem->size;
-
-	WARN_ON(!(pfdr_a && pfdr_sz));
-
-	return 0;
-}
-RESERVEDMEM_OF_DECLARE(qman_pfdr, "fsl,qman-pfdr", qman_pfdr);
-
 static unsigned int qm_get_fqid_maxcnt(void)
 {
 	return fqd_sz / 64;
 }
 
-/*
- * Flush this memory range from data cache so that QMAN originated
- * transactions for this memory region could be marked non-coherent.
- */
-static int zero_priv_mem(struct device *dev, struct device_node *node,
-			 phys_addr_t addr, size_t sz)
-{
-	/* map as cacheable, non-guarded */
-	void __iomem *tmpp = ioremap_prot(addr, sz, 0);
-
-	if (!tmpp)
-		return -ENOMEM;
-
-	memset_io(tmpp, 0, sz);
-	flush_dcache_range((unsigned long)tmpp,
-			   (unsigned long)tmpp + sz);
-	iounmap(tmpp);
-
-	return 0;
-}
-
 static void log_edata_bits(struct device *dev, u32 bit_count)
 {
 	u32 i, j, mask = 0xffffffff;
@@ -687,11 +643,12 @@ static int qman_resource_init(struct device *dev)
 static int fsl_qman_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	struct device_node *node = dev->of_node;
+	struct device_node *mem_node, *node = dev->of_node;
 	struct resource *res;
 	int ret, err_irq;
 	u16 id;
 	u8 major, minor;
+	u64 size;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res) {
@@ -727,10 +684,66 @@ static int fsl_qman_probe(struct platform_device *pdev)
 		qm_channel_caam = QMAN_CHANNEL_CAAM_REV3;
 	}
 
-	ret = zero_priv_mem(dev, node, fqd_a, fqd_sz);
-	WARN_ON(ret);
-	if (ret)
+	/* Order of memory regions is assumed as FQD followed by PFDR
+	   in order to ensure allocations from the correct regions the
+	   driver initializes then allocates each piece in order */
+
+	ret = of_reserved_mem_device_init_by_idx(dev, dev->of_node, 0);
+	if (ret) {
+		dev_err(dev, "of_reserved_mem_device_init_by_idx(0) failed 0x%x\n",
+			ret);
+		return -ENODEV;
+	}
+	mem_node = of_parse_phandle(dev->of_node, "memory-region", 0);
+	if (mem_node) {
+		ret = of_property_read_u64(mem_node, "size", &size);
+		if (ret) {
+			dev_err(dev, "FQD: of_address_to_resource fails 0x%x\n", ret);
+			return -ENODEV;
+		}
+		fqd_sz = size;
+	} else {
+		dev_err(dev, "No memory-region found for FQD\n");
+		return -ENODEV;
+	}
+	if (!dma_zalloc_coherent(dev, fqd_sz, &fqd_a, 0)) {
+		dev_err(dev, "Alloc FQD memory failed\n");
+		return -ENODEV;
+	}
+
+	dev_info(dev, "Allocated FQD 0x%llx 0x%zx\n", fqd_a, fqd_sz);
+
+	/* Disassociate the FQD reseverd memory area from the device because
+	   a device can only have one DMA memory area. This should be fine
+	   since the memory is allocated and initalized and only ever accessed
+	   by the QMan device from now on */
+	of_reserved_mem_device_release(dev);
+
+	/* Setup PFDR memory */
+	ret = of_reserved_mem_device_init_by_idx(dev, dev->of_node, 1);
+	if (ret) {
+		dev_err(dev, "of_reserved_mem_device_init(1) failed 0x%x\n",
+			ret);
+		return -ENODEV;
+	}
+	mem_node = of_parse_phandle(dev->of_node, "memory-region", 1);
+	if (mem_node) {
+		ret = of_property_read_u64(mem_node, "size", &size);
+		if (ret) {
+			dev_err(dev, "PFDR: of_address_to_resource fails 0x%x\n", ret);
+			return -ENODEV;
+		}
+		pfdr_sz = size;
+	} else {
+		dev_err(dev, "No memory-region found for PFDR\n");
+		return -ENODEV;
+	}
+	if (!dma_zalloc_coherent(dev, pfdr_sz, &pfdr_a, 0)) {
+		dev_err(dev, "Alloc PFDR Failed size 0x%zx\n", pfdr_sz);
 		return -ENODEV;
+	}
+
+	dev_info(dev, "Allocated PFDR 0x%llx 0x%zx\n", pfdr_a, pfdr_sz);
 
 	ret = qman_init_ccsr(dev);
 	if (ret) {
diff --git a/drivers/soc/fsl/qbman/qman_priv.h b/drivers/soc/fsl/qbman/qman_priv.h
index 22725bd..1e998ea5 100644
--- a/drivers/soc/fsl/qbman/qman_priv.h
+++ b/drivers/soc/fsl/qbman/qman_priv.h
@@ -28,12 +28,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include "dpaa_sys.h"
 
 #include <soc/fsl/qman.h>
 #include <linux/iommu.h>
+#include <linux/dma-contiguous.h>
+#include <linux/of_address.h>
 
 #if defined(CONFIG_FSL_PAMU)
 #include <asm/fsl_pamu_stash.h>
diff --git a/drivers/soc/fsl/qbman/qman_test.h b/drivers/soc/fsl/qbman/qman_test.h
index d5f8cb2..41bdbc48 100644
--- a/drivers/soc/fsl/qbman/qman_test.h
+++ b/drivers/soc/fsl/qbman/qman_test.h
@@ -30,7 +30,5 @@
 
 #include "qman_priv.h"
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 int qman_test_stash(void);
 int qman_test_api(void);
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [RFC PATCH 2/5] soc/fsl/qbman: Use shared-dma-pool for QMan private memory allocations
@ 2017-03-29 21:13     ` Roy Pledge
  0 siblings, 0 replies; 44+ messages in thread
From: Roy Pledge @ 2017-03-29 21:13 UTC (permalink / raw)
  To: robin.murphy, oss, linuxppc-dev, linux-arm-kernel, devicetree
  Cc: madalin.bucur, Roy Pledge

Use the shared-memory-pool mechanism for frame queue descriptor and
packed frame descriptor record area allocations.

Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
---
 drivers/soc/fsl/qbman/qman_ccsr.c | 119 +++++++++++++++++++++-----------------
 drivers/soc/fsl/qbman/qman_priv.h |   4 +-
 drivers/soc/fsl/qbman/qman_test.h |   2 -
 3 files changed, 68 insertions(+), 57 deletions(-)

diff --git a/drivers/soc/fsl/qbman/qman_ccsr.c b/drivers/soc/fsl/qbman/qman_ccsr.c
index 90bc40c..35c59ca 100644
--- a/drivers/soc/fsl/qbman/qman_ccsr.c
+++ b/drivers/soc/fsl/qbman/qman_ccsr.c
@@ -400,63 +400,19 @@ static int qm_init_pfdr(struct device *dev, u32 pfdr_start, u32 num)
 	return -ENODEV;
 }
 
-/*
- * Ideally we would use the DMA API to turn rmem->base into a DMA address
- * (especially if iommu translations ever get involved).  Unfortunately, the
- * DMA API currently does not allow mapping anything that is not backed with
- * a struct page.
- */
+/* QMan needs two global memory areas initialized at boot time:
+    1) FQD: Frame Queue Descriptors used to manage frame queues
+    2) PFDR: Packed Frame Queue Descriptor Records used to store frames
+   Both areas are reserved using the device tree reserved memory framework
+   and the addresses and sizes are initialized when the QMan device is probed */
 static dma_addr_t fqd_a, pfdr_a;
 static size_t fqd_sz, pfdr_sz;
 
-static int qman_fqd(struct reserved_mem *rmem)
-{
-	fqd_a = rmem->base;
-	fqd_sz = rmem->size;
-
-	WARN_ON(!(fqd_a && fqd_sz));
-
-	return 0;
-}
-RESERVEDMEM_OF_DECLARE(qman_fqd, "fsl,qman-fqd", qman_fqd);
-
-static int qman_pfdr(struct reserved_mem *rmem)
-{
-	pfdr_a = rmem->base;
-	pfdr_sz = rmem->size;
-
-	WARN_ON(!(pfdr_a && pfdr_sz));
-
-	return 0;
-}
-RESERVEDMEM_OF_DECLARE(qman_pfdr, "fsl,qman-pfdr", qman_pfdr);
-
 static unsigned int qm_get_fqid_maxcnt(void)
 {
 	return fqd_sz / 64;
 }
 
-/*
- * Flush this memory range from data cache so that QMAN originated
- * transactions for this memory region could be marked non-coherent.
- */
-static int zero_priv_mem(struct device *dev, struct device_node *node,
-			 phys_addr_t addr, size_t sz)
-{
-	/* map as cacheable, non-guarded */
-	void __iomem *tmpp = ioremap_prot(addr, sz, 0);
-
-	if (!tmpp)
-		return -ENOMEM;
-
-	memset_io(tmpp, 0, sz);
-	flush_dcache_range((unsigned long)tmpp,
-			   (unsigned long)tmpp + sz);
-	iounmap(tmpp);
-
-	return 0;
-}
-
 static void log_edata_bits(struct device *dev, u32 bit_count)
 {
 	u32 i, j, mask = 0xffffffff;
@@ -687,11 +643,12 @@ static int qman_resource_init(struct device *dev)
 static int fsl_qman_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	struct device_node *node = dev->of_node;
+	struct device_node *mem_node, *node = dev->of_node;
 	struct resource *res;
 	int ret, err_irq;
 	u16 id;
 	u8 major, minor;
+	u64 size;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res) {
@@ -727,10 +684,66 @@ static int fsl_qman_probe(struct platform_device *pdev)
 		qm_channel_caam = QMAN_CHANNEL_CAAM_REV3;
 	}
 
-	ret = zero_priv_mem(dev, node, fqd_a, fqd_sz);
-	WARN_ON(ret);
-	if (ret)
+	/* Order of memory regions is assumed as FQD followed by PFDR
+	   in order to ensure allocations from the correct regions the
+	   driver initializes then allocates each piece in order */
+
+	ret = of_reserved_mem_device_init_by_idx(dev, dev->of_node, 0);
+	if (ret) {
+		dev_err(dev, "of_reserved_mem_device_init_by_idx(0) failed 0x%x\n",
+			ret);
+		return -ENODEV;
+	}
+	mem_node = of_parse_phandle(dev->of_node, "memory-region", 0);
+	if (mem_node) {
+		ret = of_property_read_u64(mem_node, "size", &size);
+		if (ret) {
+			dev_err(dev, "FQD: of_address_to_resource fails 0x%x\n", ret);
+			return -ENODEV;
+		}
+		fqd_sz = size;
+	} else {
+		dev_err(dev, "No memory-region found for FQD\n");
+		return -ENODEV;
+	}
+	if (!dma_zalloc_coherent(dev, fqd_sz, &fqd_a, 0)) {
+		dev_err(dev, "Alloc FQD memory failed\n");
+		return -ENODEV;
+	}
+
+	dev_info(dev, "Allocated FQD 0x%llx 0x%zx\n", fqd_a, fqd_sz);
+
+	/* Disassociate the FQD reseverd memory area from the device because
+	   a device can only have one DMA memory area. This should be fine
+	   since the memory is allocated and initalized and only ever accessed
+	   by the QMan device from now on */
+	of_reserved_mem_device_release(dev);
+
+	/* Setup PFDR memory */
+	ret = of_reserved_mem_device_init_by_idx(dev, dev->of_node, 1);
+	if (ret) {
+		dev_err(dev, "of_reserved_mem_device_init(1) failed 0x%x\n",
+			ret);
+		return -ENODEV;
+	}
+	mem_node = of_parse_phandle(dev->of_node, "memory-region", 1);
+	if (mem_node) {
+		ret = of_property_read_u64(mem_node, "size", &size);
+		if (ret) {
+			dev_err(dev, "PFDR: of_address_to_resource fails 0x%x\n", ret);
+			return -ENODEV;
+		}
+		pfdr_sz = size;
+	} else {
+		dev_err(dev, "No memory-region found for PFDR\n");
+		return -ENODEV;
+	}
+	if (!dma_zalloc_coherent(dev, pfdr_sz, &pfdr_a, 0)) {
+		dev_err(dev, "Alloc PFDR Failed size 0x%zx\n", pfdr_sz);
 		return -ENODEV;
+	}
+
+	dev_info(dev, "Allocated PFDR 0x%llx 0x%zx\n", pfdr_a, pfdr_sz);
 
 	ret = qman_init_ccsr(dev);
 	if (ret) {
diff --git a/drivers/soc/fsl/qbman/qman_priv.h b/drivers/soc/fsl/qbman/qman_priv.h
index 22725bd..1e998ea5 100644
--- a/drivers/soc/fsl/qbman/qman_priv.h
+++ b/drivers/soc/fsl/qbman/qman_priv.h
@@ -28,12 +28,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include "dpaa_sys.h"
 
 #include <soc/fsl/qman.h>
 #include <linux/iommu.h>
+#include <linux/dma-contiguous.h>
+#include <linux/of_address.h>
 
 #if defined(CONFIG_FSL_PAMU)
 #include <asm/fsl_pamu_stash.h>
diff --git a/drivers/soc/fsl/qbman/qman_test.h b/drivers/soc/fsl/qbman/qman_test.h
index d5f8cb2..41bdbc48 100644
--- a/drivers/soc/fsl/qbman/qman_test.h
+++ b/drivers/soc/fsl/qbman/qman_test.h
@@ -30,7 +30,5 @@
 
 #include "qman_priv.h"
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 int qman_test_stash(void);
 int qman_test_api(void);
-- 
2.9.3

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

* [RFC PATCH 2/5] soc/fsl/qbman: Use shared-dma-pool for QMan private memory allocations
@ 2017-03-29 21:13     ` Roy Pledge
  0 siblings, 0 replies; 44+ messages in thread
From: Roy Pledge @ 2017-03-29 21:13 UTC (permalink / raw)
  To: linux-arm-kernel

Use the shared-memory-pool mechanism for frame queue descriptor and
packed frame descriptor record area allocations.

Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
---
 drivers/soc/fsl/qbman/qman_ccsr.c | 119 +++++++++++++++++++++-----------------
 drivers/soc/fsl/qbman/qman_priv.h |   4 +-
 drivers/soc/fsl/qbman/qman_test.h |   2 -
 3 files changed, 68 insertions(+), 57 deletions(-)

diff --git a/drivers/soc/fsl/qbman/qman_ccsr.c b/drivers/soc/fsl/qbman/qman_ccsr.c
index 90bc40c..35c59ca 100644
--- a/drivers/soc/fsl/qbman/qman_ccsr.c
+++ b/drivers/soc/fsl/qbman/qman_ccsr.c
@@ -400,63 +400,19 @@ static int qm_init_pfdr(struct device *dev, u32 pfdr_start, u32 num)
 	return -ENODEV;
 }
 
-/*
- * Ideally we would use the DMA API to turn rmem->base into a DMA address
- * (especially if iommu translations ever get involved).  Unfortunately, the
- * DMA API currently does not allow mapping anything that is not backed with
- * a struct page.
- */
+/* QMan needs two global memory areas initialized at boot time:
+    1) FQD: Frame Queue Descriptors used to manage frame queues
+    2) PFDR: Packed Frame Queue Descriptor Records used to store frames
+   Both areas are reserved using the device tree reserved memory framework
+   and the addresses and sizes are initialized when the QMan device is probed */
 static dma_addr_t fqd_a, pfdr_a;
 static size_t fqd_sz, pfdr_sz;
 
-static int qman_fqd(struct reserved_mem *rmem)
-{
-	fqd_a = rmem->base;
-	fqd_sz = rmem->size;
-
-	WARN_ON(!(fqd_a && fqd_sz));
-
-	return 0;
-}
-RESERVEDMEM_OF_DECLARE(qman_fqd, "fsl,qman-fqd", qman_fqd);
-
-static int qman_pfdr(struct reserved_mem *rmem)
-{
-	pfdr_a = rmem->base;
-	pfdr_sz = rmem->size;
-
-	WARN_ON(!(pfdr_a && pfdr_sz));
-
-	return 0;
-}
-RESERVEDMEM_OF_DECLARE(qman_pfdr, "fsl,qman-pfdr", qman_pfdr);
-
 static unsigned int qm_get_fqid_maxcnt(void)
 {
 	return fqd_sz / 64;
 }
 
-/*
- * Flush this memory range from data cache so that QMAN originated
- * transactions for this memory region could be marked non-coherent.
- */
-static int zero_priv_mem(struct device *dev, struct device_node *node,
-			 phys_addr_t addr, size_t sz)
-{
-	/* map as cacheable, non-guarded */
-	void __iomem *tmpp = ioremap_prot(addr, sz, 0);
-
-	if (!tmpp)
-		return -ENOMEM;
-
-	memset_io(tmpp, 0, sz);
-	flush_dcache_range((unsigned long)tmpp,
-			   (unsigned long)tmpp + sz);
-	iounmap(tmpp);
-
-	return 0;
-}
-
 static void log_edata_bits(struct device *dev, u32 bit_count)
 {
 	u32 i, j, mask = 0xffffffff;
@@ -687,11 +643,12 @@ static int qman_resource_init(struct device *dev)
 static int fsl_qman_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	struct device_node *node = dev->of_node;
+	struct device_node *mem_node, *node = dev->of_node;
 	struct resource *res;
 	int ret, err_irq;
 	u16 id;
 	u8 major, minor;
+	u64 size;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res) {
@@ -727,10 +684,66 @@ static int fsl_qman_probe(struct platform_device *pdev)
 		qm_channel_caam = QMAN_CHANNEL_CAAM_REV3;
 	}
 
-	ret = zero_priv_mem(dev, node, fqd_a, fqd_sz);
-	WARN_ON(ret);
-	if (ret)
+	/* Order of memory regions is assumed as FQD followed by PFDR
+	   in order to ensure allocations from the correct regions the
+	   driver initializes then allocates each piece in order */
+
+	ret = of_reserved_mem_device_init_by_idx(dev, dev->of_node, 0);
+	if (ret) {
+		dev_err(dev, "of_reserved_mem_device_init_by_idx(0) failed 0x%x\n",
+			ret);
+		return -ENODEV;
+	}
+	mem_node = of_parse_phandle(dev->of_node, "memory-region", 0);
+	if (mem_node) {
+		ret = of_property_read_u64(mem_node, "size", &size);
+		if (ret) {
+			dev_err(dev, "FQD: of_address_to_resource fails 0x%x\n", ret);
+			return -ENODEV;
+		}
+		fqd_sz = size;
+	} else {
+		dev_err(dev, "No memory-region found for FQD\n");
+		return -ENODEV;
+	}
+	if (!dma_zalloc_coherent(dev, fqd_sz, &fqd_a, 0)) {
+		dev_err(dev, "Alloc FQD memory failed\n");
+		return -ENODEV;
+	}
+
+	dev_info(dev, "Allocated FQD 0x%llx 0x%zx\n", fqd_a, fqd_sz);
+
+	/* Disassociate the FQD reseverd memory area from the device because
+	   a device can only have one DMA memory area. This should be fine
+	   since the memory is allocated and initalized and only ever accessed
+	   by the QMan device from now on */
+	of_reserved_mem_device_release(dev);
+
+	/* Setup PFDR memory */
+	ret = of_reserved_mem_device_init_by_idx(dev, dev->of_node, 1);
+	if (ret) {
+		dev_err(dev, "of_reserved_mem_device_init(1) failed 0x%x\n",
+			ret);
+		return -ENODEV;
+	}
+	mem_node = of_parse_phandle(dev->of_node, "memory-region", 1);
+	if (mem_node) {
+		ret = of_property_read_u64(mem_node, "size", &size);
+		if (ret) {
+			dev_err(dev, "PFDR: of_address_to_resource fails 0x%x\n", ret);
+			return -ENODEV;
+		}
+		pfdr_sz = size;
+	} else {
+		dev_err(dev, "No memory-region found for PFDR\n");
+		return -ENODEV;
+	}
+	if (!dma_zalloc_coherent(dev, pfdr_sz, &pfdr_a, 0)) {
+		dev_err(dev, "Alloc PFDR Failed size 0x%zx\n", pfdr_sz);
 		return -ENODEV;
+	}
+
+	dev_info(dev, "Allocated PFDR 0x%llx 0x%zx\n", pfdr_a, pfdr_sz);
 
 	ret = qman_init_ccsr(dev);
 	if (ret) {
diff --git a/drivers/soc/fsl/qbman/qman_priv.h b/drivers/soc/fsl/qbman/qman_priv.h
index 22725bd..1e998ea5 100644
--- a/drivers/soc/fsl/qbman/qman_priv.h
+++ b/drivers/soc/fsl/qbman/qman_priv.h
@@ -28,12 +28,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include "dpaa_sys.h"
 
 #include <soc/fsl/qman.h>
 #include <linux/iommu.h>
+#include <linux/dma-contiguous.h>
+#include <linux/of_address.h>
 
 #if defined(CONFIG_FSL_PAMU)
 #include <asm/fsl_pamu_stash.h>
diff --git a/drivers/soc/fsl/qbman/qman_test.h b/drivers/soc/fsl/qbman/qman_test.h
index d5f8cb2..41bdbc48 100644
--- a/drivers/soc/fsl/qbman/qman_test.h
+++ b/drivers/soc/fsl/qbman/qman_test.h
@@ -30,7 +30,5 @@
 
 #include "qman_priv.h"
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 int qman_test_stash(void);
 int qman_test_api(void);
-- 
2.9.3

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

* [RFC PATCH 3/5] dts: arch/powerpc: Update Freescale DTS for QBMan memory allocations
  2017-03-29 21:13 ` Roy Pledge
  (?)
@ 2017-03-29 21:13     ` Roy Pledge
  -1 siblings, 0 replies; 44+ messages in thread
From: Roy Pledge @ 2017-03-29 21:13 UTC (permalink / raw)
  To: robin.murphy-5wv7dgnIgG8, oss-fOR+EgIDQEHk1uMJSBkQmQ,
	linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: madalin.bucur-3arQi8VN3Tc, Roy Pledge

QBMan now uses the shared-dma-pool mechansim to manage early
memory reservations.

Signed-off-by: Roy Pledge <roy.pledge-3arQi8VN3Tc@public.gmane.org>
---
 arch/powerpc/boot/dts/fsl/b4qds.dtsi        |  6 ++++++
 arch/powerpc/boot/dts/fsl/b4si-post.dtsi    | 15 ---------------
 arch/powerpc/boot/dts/fsl/cyrus_p5020.dts   |  6 ++++++
 arch/powerpc/boot/dts/fsl/kmcent2.dts       |  6 ++++++
 arch/powerpc/boot/dts/fsl/kmcoge4.dts       |  6 ++++++
 arch/powerpc/boot/dts/fsl/oca4080.dts       |  6 ++++++
 arch/powerpc/boot/dts/fsl/p1023rdb.dts      |  6 ++++++
 arch/powerpc/boot/dts/fsl/p1023si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/p2041rdb.dts      |  6 ++++++
 arch/powerpc/boot/dts/fsl/p2041si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/p3041ds.dts       |  6 ++++++
 arch/powerpc/boot/dts/fsl/p3041si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/p4080ds.dts       |  6 ++++++
 arch/powerpc/boot/dts/fsl/p4080si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/p5020ds.dts       |  6 ++++++
 arch/powerpc/boot/dts/fsl/p5020si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/p5040ds.dts       |  6 ++++++
 arch/powerpc/boot/dts/fsl/p5040si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/t1023rdb.dts      |  6 ++++++
 arch/powerpc/boot/dts/fsl/t1023si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/t1024qds.dts      |  6 ++++++
 arch/powerpc/boot/dts/fsl/t1024rdb.dts      |  6 ++++++
 arch/powerpc/boot/dts/fsl/t1040si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/t104xd4rdb.dtsi   |  6 ++++++
 arch/powerpc/boot/dts/fsl/t104xqds.dtsi     |  6 ++++++
 arch/powerpc/boot/dts/fsl/t104xrdb.dtsi     |  6 ++++++
 arch/powerpc/boot/dts/fsl/t2081si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/t208xqds.dtsi     |  6 ++++++
 arch/powerpc/boot/dts/fsl/t208xrdb.dtsi     |  6 ++++++
 arch/powerpc/boot/dts/fsl/t4240qds.dts      |  6 ++++++
 arch/powerpc/boot/dts/fsl/t4240rdb.dts      |  6 ++++++
 arch/powerpc/boot/dts/fsl/t4240si-post.dtsi | 15 ---------------
 32 files changed, 126 insertions(+), 165 deletions(-)

diff --git a/arch/powerpc/boot/dts/fsl/b4qds.dtsi b/arch/powerpc/boot/dts/fsl/b4qds.dtsi
index 3785ef8..a2abd1e 100644
--- a/arch/powerpc/boot/dts/fsl/b4qds.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4qds.dtsi
@@ -110,16 +110,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/b4si-post.dtsi b/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
index 1b33f51..844d99b 100644
--- a/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
@@ -32,21 +32,6 @@
  * this software, even if advised of the possibility of such damage.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
 &ifc {
 	#address-cells = <2>;
 	#size-cells = <1>;
diff --git a/arch/powerpc/boot/dts/fsl/cyrus_p5020.dts b/arch/powerpc/boot/dts/fsl/cyrus_p5020.dts
index c603390..2b2227b 100644
--- a/arch/powerpc/boot/dts/fsl/cyrus_p5020.dts
+++ b/arch/powerpc/boot/dts/fsl/cyrus_p5020.dts
@@ -31,16 +31,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/kmcent2.dts b/arch/powerpc/boot/dts/fsl/kmcent2.dts
index 47afa43..98f5257 100644
--- a/arch/powerpc/boot/dts/fsl/kmcent2.dts
+++ b/arch/powerpc/boot/dts/fsl/kmcent2.dts
@@ -28,16 +28,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/kmcoge4.dts b/arch/powerpc/boot/dts/fsl/kmcoge4.dts
index e103c0f..6cfff87 100644
--- a/arch/powerpc/boot/dts/fsl/kmcoge4.dts
+++ b/arch/powerpc/boot/dts/fsl/kmcoge4.dts
@@ -31,16 +31,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/oca4080.dts b/arch/powerpc/boot/dts/fsl/oca4080.dts
index 17bc6f3..e06ce75 100644
--- a/arch/powerpc/boot/dts/fsl/oca4080.dts
+++ b/arch/powerpc/boot/dts/fsl/oca4080.dts
@@ -55,16 +55,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/p1023rdb.dts b/arch/powerpc/boot/dts/fsl/p1023rdb.dts
index 9716ca6..d4abdcf 100644
--- a/arch/powerpc/boot/dts/fsl/p1023rdb.dts
+++ b/arch/powerpc/boot/dts/fsl/p1023rdb.dts
@@ -53,16 +53,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/p1023si-post.dtsi b/arch/powerpc/boot/dts/fsl/p1023si-post.dtsi
index da6d3fc..9dbbba6 100644
--- a/arch/powerpc/boot/dts/fsl/p1023si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p1023si-post.dtsi
@@ -32,21 +32,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
 &lbc {
 	#address-cells = <2>;
 	#size-cells = <1>;
diff --git a/arch/powerpc/boot/dts/fsl/p2041rdb.dts b/arch/powerpc/boot/dts/fsl/p2041rdb.dts
index e50fea9..4f6c233 100644
--- a/arch/powerpc/boot/dts/fsl/p2041rdb.dts
+++ b/arch/powerpc/boot/dts/fsl/p2041rdb.dts
@@ -64,16 +64,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi b/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
index 51e975d..f8615bb 100644
--- a/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
@@ -32,21 +32,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
 &lbc {
 	compatible = "fsl,p2041-elbc", "fsl,elbc", "simple-bus";
 	interrupts = <25 2 0 0>;
diff --git a/arch/powerpc/boot/dts/fsl/p3041ds.dts b/arch/powerpc/boot/dts/fsl/p3041ds.dts
index 40748e4..50507c9 100644
--- a/arch/powerpc/boot/dts/fsl/p3041ds.dts
+++ b/arch/powerpc/boot/dts/fsl/p3041ds.dts
@@ -65,16 +65,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi b/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
index 187676f..a19b86c 100644
--- a/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
@@ -32,21 +32,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
 &lbc {
 	compatible = "fsl,p3041-elbc", "fsl,elbc", "simple-bus";
 	interrupts = <25 2 0 0>;
diff --git a/arch/powerpc/boot/dts/fsl/p4080ds.dts b/arch/powerpc/boot/dts/fsl/p4080ds.dts
index 816b978..813117a 100644
--- a/arch/powerpc/boot/dts/fsl/p4080ds.dts
+++ b/arch/powerpc/boot/dts/fsl/p4080ds.dts
@@ -65,16 +65,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi b/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
index a025208..42868c7 100644
--- a/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
@@ -32,21 +32,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
 &lbc {
 	compatible = "fsl,p4080-elbc", "fsl,elbc", "simple-bus";
 	interrupts = <25 2 0 0>;
diff --git a/arch/powerpc/boot/dts/fsl/p5020ds.dts b/arch/powerpc/boot/dts/fsl/p5020ds.dts
index cd6f373..479f772 100644
--- a/arch/powerpc/boot/dts/fsl/p5020ds.dts
+++ b/arch/powerpc/boot/dts/fsl/p5020ds.dts
@@ -65,16 +65,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi b/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi
index cd008cd..dec5e12 100644
--- a/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi
@@ -32,21 +32,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
 &lbc {
 	compatible = "fsl,p5020-elbc", "fsl,elbc", "simple-bus";
 	interrupts = <25 2 0 0>;
diff --git a/arch/powerpc/boot/dts/fsl/p5040ds.dts b/arch/powerpc/boot/dts/fsl/p5040ds.dts
index 4508473..b97ca39 100644
--- a/arch/powerpc/boot/dts/fsl/p5040ds.dts
+++ b/arch/powerpc/boot/dts/fsl/p5040ds.dts
@@ -77,16 +77,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/p5040si-post.dtsi b/arch/powerpc/boot/dts/fsl/p5040si-post.dtsi
index e2bd931..7a109d5 100644
--- a/arch/powerpc/boot/dts/fsl/p5040si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p5040si-post.dtsi
@@ -32,21 +32,6 @@
  * software, even if advised of the possibility of such damage.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
 &lbc {
 	compatible = "fsl,p5040-elbc", "fsl,elbc", "simple-bus";
 	interrupts = <25 2 0 0>;
diff --git a/arch/powerpc/boot/dts/fsl/t1023rdb.dts b/arch/powerpc/boot/dts/fsl/t1023rdb.dts
index 5ba6fbf..034ec42 100644
--- a/arch/powerpc/boot/dts/fsl/t1023rdb.dts
+++ b/arch/powerpc/boot/dts/fsl/t1023rdb.dts
@@ -47,18 +47,24 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi b/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi
index 4908af5..de951f8 100644
--- a/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi
@@ -34,21 +34,6 @@
 
 #include <dt-bindings/thermal/thermal.h>
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
 &ifc {
 	#address-cells = <2>;
 	#size-cells = <1>;
diff --git a/arch/powerpc/boot/dts/fsl/t1024qds.dts b/arch/powerpc/boot/dts/fsl/t1024qds.dts
index d6858b7..a6fa860 100644
--- a/arch/powerpc/boot/dts/fsl/t1024qds.dts
+++ b/arch/powerpc/boot/dts/fsl/t1024qds.dts
@@ -47,18 +47,24 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t1024rdb.dts b/arch/powerpc/boot/dts/fsl/t1024rdb.dts
index 73a6453..09cf13c 100644
--- a/arch/powerpc/boot/dts/fsl/t1024rdb.dts
+++ b/arch/powerpc/boot/dts/fsl/t1024rdb.dts
@@ -51,18 +51,24 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi b/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
index 145c7f4..3fa5a14 100644
--- a/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
@@ -34,21 +34,6 @@
 
 #include <dt-bindings/thermal/thermal.h>
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
 &ifc {
 	#address-cells = <2>;
 	#size-cells = <1>;
diff --git a/arch/powerpc/boot/dts/fsl/t104xd4rdb.dtsi b/arch/powerpc/boot/dts/fsl/t104xd4rdb.dtsi
index 863f943..531600b 100644
--- a/arch/powerpc/boot/dts/fsl/t104xd4rdb.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t104xd4rdb.dtsi
@@ -39,16 +39,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t104xqds.dtsi b/arch/powerpc/boot/dts/fsl/t104xqds.dtsi
index 2fd4cbe..bb7cc7b 100644
--- a/arch/powerpc/boot/dts/fsl/t104xqds.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t104xqds.dtsi
@@ -71,16 +71,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t104xrdb.dtsi b/arch/powerpc/boot/dts/fsl/t104xrdb.dtsi
index 5fdddbd..d0ba614 100644
--- a/arch/powerpc/boot/dts/fsl/t104xrdb.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t104xrdb.dtsi
@@ -45,16 +45,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi b/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
index a97296c..5215e86 100644
--- a/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
@@ -32,21 +32,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
 &ifc {
 	#address-cells = <2>;
 	#size-cells = <1>;
diff --git a/arch/powerpc/boot/dts/fsl/t208xqds.dtsi b/arch/powerpc/boot/dts/fsl/t208xqds.dtsi
index ec080bd..334da3b 100644
--- a/arch/powerpc/boot/dts/fsl/t208xqds.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t208xqds.dtsi
@@ -45,16 +45,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t208xrdb.dtsi b/arch/powerpc/boot/dts/fsl/t208xrdb.dtsi
index ff87e67..102fe75 100644
--- a/arch/powerpc/boot/dts/fsl/t208xrdb.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t208xrdb.dtsi
@@ -45,16 +45,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t4240qds.dts b/arch/powerpc/boot/dts/fsl/t4240qds.dts
index 9573cea..92375b4 100644
--- a/arch/powerpc/boot/dts/fsl/t4240qds.dts
+++ b/arch/powerpc/boot/dts/fsl/t4240qds.dts
@@ -326,16 +326,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t4240rdb.dts b/arch/powerpc/boot/dts/fsl/t4240rdb.dts
index 8166c66..5cd8a62 100644
--- a/arch/powerpc/boot/dts/fsl/t4240rdb.dts
+++ b/arch/powerpc/boot/dts/fsl/t4240rdb.dts
@@ -86,16 +86,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi b/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
index 68c4ead..97d5ae1 100644
--- a/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
@@ -32,21 +32,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
 &ifc {
 	#address-cells = <2>;
 	#size-cells = <1>;
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [RFC PATCH 3/5] dts: arch/powerpc: Update Freescale DTS for QBMan memory allocations
@ 2017-03-29 21:13     ` Roy Pledge
  0 siblings, 0 replies; 44+ messages in thread
From: Roy Pledge @ 2017-03-29 21:13 UTC (permalink / raw)
  To: robin.murphy, oss, linuxppc-dev, linux-arm-kernel, devicetree
  Cc: madalin.bucur, Roy Pledge

QBMan now uses the shared-dma-pool mechansim to manage early
memory reservations.

Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
---
 arch/powerpc/boot/dts/fsl/b4qds.dtsi        |  6 ++++++
 arch/powerpc/boot/dts/fsl/b4si-post.dtsi    | 15 ---------------
 arch/powerpc/boot/dts/fsl/cyrus_p5020.dts   |  6 ++++++
 arch/powerpc/boot/dts/fsl/kmcent2.dts       |  6 ++++++
 arch/powerpc/boot/dts/fsl/kmcoge4.dts       |  6 ++++++
 arch/powerpc/boot/dts/fsl/oca4080.dts       |  6 ++++++
 arch/powerpc/boot/dts/fsl/p1023rdb.dts      |  6 ++++++
 arch/powerpc/boot/dts/fsl/p1023si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/p2041rdb.dts      |  6 ++++++
 arch/powerpc/boot/dts/fsl/p2041si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/p3041ds.dts       |  6 ++++++
 arch/powerpc/boot/dts/fsl/p3041si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/p4080ds.dts       |  6 ++++++
 arch/powerpc/boot/dts/fsl/p4080si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/p5020ds.dts       |  6 ++++++
 arch/powerpc/boot/dts/fsl/p5020si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/p5040ds.dts       |  6 ++++++
 arch/powerpc/boot/dts/fsl/p5040si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/t1023rdb.dts      |  6 ++++++
 arch/powerpc/boot/dts/fsl/t1023si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/t1024qds.dts      |  6 ++++++
 arch/powerpc/boot/dts/fsl/t1024rdb.dts      |  6 ++++++
 arch/powerpc/boot/dts/fsl/t1040si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/t104xd4rdb.dtsi   |  6 ++++++
 arch/powerpc/boot/dts/fsl/t104xqds.dtsi     |  6 ++++++
 arch/powerpc/boot/dts/fsl/t104xrdb.dtsi     |  6 ++++++
 arch/powerpc/boot/dts/fsl/t2081si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/t208xqds.dtsi     |  6 ++++++
 arch/powerpc/boot/dts/fsl/t208xrdb.dtsi     |  6 ++++++
 arch/powerpc/boot/dts/fsl/t4240qds.dts      |  6 ++++++
 arch/powerpc/boot/dts/fsl/t4240rdb.dts      |  6 ++++++
 arch/powerpc/boot/dts/fsl/t4240si-post.dtsi | 15 ---------------
 32 files changed, 126 insertions(+), 165 deletions(-)

diff --git a/arch/powerpc/boot/dts/fsl/b4qds.dtsi b/arch/powerpc/boot/dts/fsl/b4qds.dtsi
index 3785ef8..a2abd1e 100644
--- a/arch/powerpc/boot/dts/fsl/b4qds.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4qds.dtsi
@@ -110,16 +110,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/b4si-post.dtsi b/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
index 1b33f51..844d99b 100644
--- a/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
@@ -32,21 +32,6 @@
  * this software, even if advised of the possibility of such damage.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
 &ifc {
 	#address-cells = <2>;
 	#size-cells = <1>;
diff --git a/arch/powerpc/boot/dts/fsl/cyrus_p5020.dts b/arch/powerpc/boot/dts/fsl/cyrus_p5020.dts
index c603390..2b2227b 100644
--- a/arch/powerpc/boot/dts/fsl/cyrus_p5020.dts
+++ b/arch/powerpc/boot/dts/fsl/cyrus_p5020.dts
@@ -31,16 +31,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/kmcent2.dts b/arch/powerpc/boot/dts/fsl/kmcent2.dts
index 47afa43..98f5257 100644
--- a/arch/powerpc/boot/dts/fsl/kmcent2.dts
+++ b/arch/powerpc/boot/dts/fsl/kmcent2.dts
@@ -28,16 +28,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/kmcoge4.dts b/arch/powerpc/boot/dts/fsl/kmcoge4.dts
index e103c0f..6cfff87 100644
--- a/arch/powerpc/boot/dts/fsl/kmcoge4.dts
+++ b/arch/powerpc/boot/dts/fsl/kmcoge4.dts
@@ -31,16 +31,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/oca4080.dts b/arch/powerpc/boot/dts/fsl/oca4080.dts
index 17bc6f3..e06ce75 100644
--- a/arch/powerpc/boot/dts/fsl/oca4080.dts
+++ b/arch/powerpc/boot/dts/fsl/oca4080.dts
@@ -55,16 +55,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/p1023rdb.dts b/arch/powerpc/boot/dts/fsl/p1023rdb.dts
index 9716ca6..d4abdcf 100644
--- a/arch/powerpc/boot/dts/fsl/p1023rdb.dts
+++ b/arch/powerpc/boot/dts/fsl/p1023rdb.dts
@@ -53,16 +53,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/p1023si-post.dtsi b/arch/powerpc/boot/dts/fsl/p1023si-post.dtsi
index da6d3fc..9dbbba6 100644
--- a/arch/powerpc/boot/dts/fsl/p1023si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p1023si-post.dtsi
@@ -32,21 +32,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
 &lbc {
 	#address-cells = <2>;
 	#size-cells = <1>;
diff --git a/arch/powerpc/boot/dts/fsl/p2041rdb.dts b/arch/powerpc/boot/dts/fsl/p2041rdb.dts
index e50fea9..4f6c233 100644
--- a/arch/powerpc/boot/dts/fsl/p2041rdb.dts
+++ b/arch/powerpc/boot/dts/fsl/p2041rdb.dts
@@ -64,16 +64,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi b/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
index 51e975d..f8615bb 100644
--- a/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
@@ -32,21 +32,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
 &lbc {
 	compatible = "fsl,p2041-elbc", "fsl,elbc", "simple-bus";
 	interrupts = <25 2 0 0>;
diff --git a/arch/powerpc/boot/dts/fsl/p3041ds.dts b/arch/powerpc/boot/dts/fsl/p3041ds.dts
index 40748e4..50507c9 100644
--- a/arch/powerpc/boot/dts/fsl/p3041ds.dts
+++ b/arch/powerpc/boot/dts/fsl/p3041ds.dts
@@ -65,16 +65,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi b/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
index 187676f..a19b86c 100644
--- a/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
@@ -32,21 +32,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
 &lbc {
 	compatible = "fsl,p3041-elbc", "fsl,elbc", "simple-bus";
 	interrupts = <25 2 0 0>;
diff --git a/arch/powerpc/boot/dts/fsl/p4080ds.dts b/arch/powerpc/boot/dts/fsl/p4080ds.dts
index 816b978..813117a 100644
--- a/arch/powerpc/boot/dts/fsl/p4080ds.dts
+++ b/arch/powerpc/boot/dts/fsl/p4080ds.dts
@@ -65,16 +65,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi b/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
index a025208..42868c7 100644
--- a/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
@@ -32,21 +32,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
 &lbc {
 	compatible = "fsl,p4080-elbc", "fsl,elbc", "simple-bus";
 	interrupts = <25 2 0 0>;
diff --git a/arch/powerpc/boot/dts/fsl/p5020ds.dts b/arch/powerpc/boot/dts/fsl/p5020ds.dts
index cd6f373..479f772 100644
--- a/arch/powerpc/boot/dts/fsl/p5020ds.dts
+++ b/arch/powerpc/boot/dts/fsl/p5020ds.dts
@@ -65,16 +65,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi b/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi
index cd008cd..dec5e12 100644
--- a/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi
@@ -32,21 +32,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
 &lbc {
 	compatible = "fsl,p5020-elbc", "fsl,elbc", "simple-bus";
 	interrupts = <25 2 0 0>;
diff --git a/arch/powerpc/boot/dts/fsl/p5040ds.dts b/arch/powerpc/boot/dts/fsl/p5040ds.dts
index 4508473..b97ca39 100644
--- a/arch/powerpc/boot/dts/fsl/p5040ds.dts
+++ b/arch/powerpc/boot/dts/fsl/p5040ds.dts
@@ -77,16 +77,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/p5040si-post.dtsi b/arch/powerpc/boot/dts/fsl/p5040si-post.dtsi
index e2bd931..7a109d5 100644
--- a/arch/powerpc/boot/dts/fsl/p5040si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p5040si-post.dtsi
@@ -32,21 +32,6 @@
  * software, even if advised of the possibility of such damage.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
 &lbc {
 	compatible = "fsl,p5040-elbc", "fsl,elbc", "simple-bus";
 	interrupts = <25 2 0 0>;
diff --git a/arch/powerpc/boot/dts/fsl/t1023rdb.dts b/arch/powerpc/boot/dts/fsl/t1023rdb.dts
index 5ba6fbf..034ec42 100644
--- a/arch/powerpc/boot/dts/fsl/t1023rdb.dts
+++ b/arch/powerpc/boot/dts/fsl/t1023rdb.dts
@@ -47,18 +47,24 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi b/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi
index 4908af5..de951f8 100644
--- a/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi
@@ -34,21 +34,6 @@
 
 #include <dt-bindings/thermal/thermal.h>
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
 &ifc {
 	#address-cells = <2>;
 	#size-cells = <1>;
diff --git a/arch/powerpc/boot/dts/fsl/t1024qds.dts b/arch/powerpc/boot/dts/fsl/t1024qds.dts
index d6858b7..a6fa860 100644
--- a/arch/powerpc/boot/dts/fsl/t1024qds.dts
+++ b/arch/powerpc/boot/dts/fsl/t1024qds.dts
@@ -47,18 +47,24 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t1024rdb.dts b/arch/powerpc/boot/dts/fsl/t1024rdb.dts
index 73a6453..09cf13c 100644
--- a/arch/powerpc/boot/dts/fsl/t1024rdb.dts
+++ b/arch/powerpc/boot/dts/fsl/t1024rdb.dts
@@ -51,18 +51,24 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi b/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
index 145c7f4..3fa5a14 100644
--- a/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
@@ -34,21 +34,6 @@
 
 #include <dt-bindings/thermal/thermal.h>
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
 &ifc {
 	#address-cells = <2>;
 	#size-cells = <1>;
diff --git a/arch/powerpc/boot/dts/fsl/t104xd4rdb.dtsi b/arch/powerpc/boot/dts/fsl/t104xd4rdb.dtsi
index 863f943..531600b 100644
--- a/arch/powerpc/boot/dts/fsl/t104xd4rdb.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t104xd4rdb.dtsi
@@ -39,16 +39,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t104xqds.dtsi b/arch/powerpc/boot/dts/fsl/t104xqds.dtsi
index 2fd4cbe..bb7cc7b 100644
--- a/arch/powerpc/boot/dts/fsl/t104xqds.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t104xqds.dtsi
@@ -71,16 +71,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t104xrdb.dtsi b/arch/powerpc/boot/dts/fsl/t104xrdb.dtsi
index 5fdddbd..d0ba614 100644
--- a/arch/powerpc/boot/dts/fsl/t104xrdb.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t104xrdb.dtsi
@@ -45,16 +45,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi b/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
index a97296c..5215e86 100644
--- a/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
@@ -32,21 +32,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
 &ifc {
 	#address-cells = <2>;
 	#size-cells = <1>;
diff --git a/arch/powerpc/boot/dts/fsl/t208xqds.dtsi b/arch/powerpc/boot/dts/fsl/t208xqds.dtsi
index ec080bd..334da3b 100644
--- a/arch/powerpc/boot/dts/fsl/t208xqds.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t208xqds.dtsi
@@ -45,16 +45,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t208xrdb.dtsi b/arch/powerpc/boot/dts/fsl/t208xrdb.dtsi
index ff87e67..102fe75 100644
--- a/arch/powerpc/boot/dts/fsl/t208xrdb.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t208xrdb.dtsi
@@ -45,16 +45,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t4240qds.dts b/arch/powerpc/boot/dts/fsl/t4240qds.dts
index 9573cea..92375b4 100644
--- a/arch/powerpc/boot/dts/fsl/t4240qds.dts
+++ b/arch/powerpc/boot/dts/fsl/t4240qds.dts
@@ -326,16 +326,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t4240rdb.dts b/arch/powerpc/boot/dts/fsl/t4240rdb.dts
index 8166c66..5cd8a62 100644
--- a/arch/powerpc/boot/dts/fsl/t4240rdb.dts
+++ b/arch/powerpc/boot/dts/fsl/t4240rdb.dts
@@ -86,16 +86,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi b/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
index 68c4ead..97d5ae1 100644
--- a/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
@@ -32,21 +32,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
 &ifc {
 	#address-cells = <2>;
 	#size-cells = <1>;
-- 
2.9.3

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

* [RFC PATCH 3/5] dts: arch/powerpc: Update Freescale DTS for QBMan memory allocations
@ 2017-03-29 21:13     ` Roy Pledge
  0 siblings, 0 replies; 44+ messages in thread
From: Roy Pledge @ 2017-03-29 21:13 UTC (permalink / raw)
  To: linux-arm-kernel

QBMan now uses the shared-dma-pool mechansim to manage early
memory reservations.

Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
---
 arch/powerpc/boot/dts/fsl/b4qds.dtsi        |  6 ++++++
 arch/powerpc/boot/dts/fsl/b4si-post.dtsi    | 15 ---------------
 arch/powerpc/boot/dts/fsl/cyrus_p5020.dts   |  6 ++++++
 arch/powerpc/boot/dts/fsl/kmcent2.dts       |  6 ++++++
 arch/powerpc/boot/dts/fsl/kmcoge4.dts       |  6 ++++++
 arch/powerpc/boot/dts/fsl/oca4080.dts       |  6 ++++++
 arch/powerpc/boot/dts/fsl/p1023rdb.dts      |  6 ++++++
 arch/powerpc/boot/dts/fsl/p1023si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/p2041rdb.dts      |  6 ++++++
 arch/powerpc/boot/dts/fsl/p2041si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/p3041ds.dts       |  6 ++++++
 arch/powerpc/boot/dts/fsl/p3041si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/p4080ds.dts       |  6 ++++++
 arch/powerpc/boot/dts/fsl/p4080si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/p5020ds.dts       |  6 ++++++
 arch/powerpc/boot/dts/fsl/p5020si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/p5040ds.dts       |  6 ++++++
 arch/powerpc/boot/dts/fsl/p5040si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/t1023rdb.dts      |  6 ++++++
 arch/powerpc/boot/dts/fsl/t1023si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/t1024qds.dts      |  6 ++++++
 arch/powerpc/boot/dts/fsl/t1024rdb.dts      |  6 ++++++
 arch/powerpc/boot/dts/fsl/t1040si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/t104xd4rdb.dtsi   |  6 ++++++
 arch/powerpc/boot/dts/fsl/t104xqds.dtsi     |  6 ++++++
 arch/powerpc/boot/dts/fsl/t104xrdb.dtsi     |  6 ++++++
 arch/powerpc/boot/dts/fsl/t2081si-post.dtsi | 15 ---------------
 arch/powerpc/boot/dts/fsl/t208xqds.dtsi     |  6 ++++++
 arch/powerpc/boot/dts/fsl/t208xrdb.dtsi     |  6 ++++++
 arch/powerpc/boot/dts/fsl/t4240qds.dts      |  6 ++++++
 arch/powerpc/boot/dts/fsl/t4240rdb.dts      |  6 ++++++
 arch/powerpc/boot/dts/fsl/t4240si-post.dtsi | 15 ---------------
 32 files changed, 126 insertions(+), 165 deletions(-)

diff --git a/arch/powerpc/boot/dts/fsl/b4qds.dtsi b/arch/powerpc/boot/dts/fsl/b4qds.dtsi
index 3785ef8..a2abd1e 100644
--- a/arch/powerpc/boot/dts/fsl/b4qds.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4qds.dtsi
@@ -110,16 +110,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/b4si-post.dtsi b/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
index 1b33f51..844d99b 100644
--- a/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
@@ -32,21 +32,6 @@
  * this software, even if advised of the possibility of such damage.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
 &ifc {
 	#address-cells = <2>;
 	#size-cells = <1>;
diff --git a/arch/powerpc/boot/dts/fsl/cyrus_p5020.dts b/arch/powerpc/boot/dts/fsl/cyrus_p5020.dts
index c603390..2b2227b 100644
--- a/arch/powerpc/boot/dts/fsl/cyrus_p5020.dts
+++ b/arch/powerpc/boot/dts/fsl/cyrus_p5020.dts
@@ -31,16 +31,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/kmcent2.dts b/arch/powerpc/boot/dts/fsl/kmcent2.dts
index 47afa43..98f5257 100644
--- a/arch/powerpc/boot/dts/fsl/kmcent2.dts
+++ b/arch/powerpc/boot/dts/fsl/kmcent2.dts
@@ -28,16 +28,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/kmcoge4.dts b/arch/powerpc/boot/dts/fsl/kmcoge4.dts
index e103c0f..6cfff87 100644
--- a/arch/powerpc/boot/dts/fsl/kmcoge4.dts
+++ b/arch/powerpc/boot/dts/fsl/kmcoge4.dts
@@ -31,16 +31,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/oca4080.dts b/arch/powerpc/boot/dts/fsl/oca4080.dts
index 17bc6f3..e06ce75 100644
--- a/arch/powerpc/boot/dts/fsl/oca4080.dts
+++ b/arch/powerpc/boot/dts/fsl/oca4080.dts
@@ -55,16 +55,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/p1023rdb.dts b/arch/powerpc/boot/dts/fsl/p1023rdb.dts
index 9716ca6..d4abdcf 100644
--- a/arch/powerpc/boot/dts/fsl/p1023rdb.dts
+++ b/arch/powerpc/boot/dts/fsl/p1023rdb.dts
@@ -53,16 +53,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/p1023si-post.dtsi b/arch/powerpc/boot/dts/fsl/p1023si-post.dtsi
index da6d3fc..9dbbba6 100644
--- a/arch/powerpc/boot/dts/fsl/p1023si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p1023si-post.dtsi
@@ -32,21 +32,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
 &lbc {
 	#address-cells = <2>;
 	#size-cells = <1>;
diff --git a/arch/powerpc/boot/dts/fsl/p2041rdb.dts b/arch/powerpc/boot/dts/fsl/p2041rdb.dts
index e50fea9..4f6c233 100644
--- a/arch/powerpc/boot/dts/fsl/p2041rdb.dts
+++ b/arch/powerpc/boot/dts/fsl/p2041rdb.dts
@@ -64,16 +64,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi b/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
index 51e975d..f8615bb 100644
--- a/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
@@ -32,21 +32,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
 &lbc {
 	compatible = "fsl,p2041-elbc", "fsl,elbc", "simple-bus";
 	interrupts = <25 2 0 0>;
diff --git a/arch/powerpc/boot/dts/fsl/p3041ds.dts b/arch/powerpc/boot/dts/fsl/p3041ds.dts
index 40748e4..50507c9 100644
--- a/arch/powerpc/boot/dts/fsl/p3041ds.dts
+++ b/arch/powerpc/boot/dts/fsl/p3041ds.dts
@@ -65,16 +65,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi b/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
index 187676f..a19b86c 100644
--- a/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
@@ -32,21 +32,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
 &lbc {
 	compatible = "fsl,p3041-elbc", "fsl,elbc", "simple-bus";
 	interrupts = <25 2 0 0>;
diff --git a/arch/powerpc/boot/dts/fsl/p4080ds.dts b/arch/powerpc/boot/dts/fsl/p4080ds.dts
index 816b978..813117a 100644
--- a/arch/powerpc/boot/dts/fsl/p4080ds.dts
+++ b/arch/powerpc/boot/dts/fsl/p4080ds.dts
@@ -65,16 +65,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi b/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
index a025208..42868c7 100644
--- a/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
@@ -32,21 +32,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10 0>;
-};
-
 &lbc {
 	compatible = "fsl,p4080-elbc", "fsl,elbc", "simple-bus";
 	interrupts = <25 2 0 0>;
diff --git a/arch/powerpc/boot/dts/fsl/p5020ds.dts b/arch/powerpc/boot/dts/fsl/p5020ds.dts
index cd6f373..479f772 100644
--- a/arch/powerpc/boot/dts/fsl/p5020ds.dts
+++ b/arch/powerpc/boot/dts/fsl/p5020ds.dts
@@ -65,16 +65,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi b/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi
index cd008cd..dec5e12 100644
--- a/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi
@@ -32,21 +32,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
 &lbc {
 	compatible = "fsl,p5020-elbc", "fsl,elbc", "simple-bus";
 	interrupts = <25 2 0 0>;
diff --git a/arch/powerpc/boot/dts/fsl/p5040ds.dts b/arch/powerpc/boot/dts/fsl/p5040ds.dts
index 4508473..b97ca39 100644
--- a/arch/powerpc/boot/dts/fsl/p5040ds.dts
+++ b/arch/powerpc/boot/dts/fsl/p5040ds.dts
@@ -77,16 +77,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/p5040si-post.dtsi b/arch/powerpc/boot/dts/fsl/p5040si-post.dtsi
index e2bd931..7a109d5 100644
--- a/arch/powerpc/boot/dts/fsl/p5040si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p5040si-post.dtsi
@@ -32,21 +32,6 @@
  * software, even if advised of the possibility of such damage.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
 &lbc {
 	compatible = "fsl,p5040-elbc", "fsl,elbc", "simple-bus";
 	interrupts = <25 2 0 0>;
diff --git a/arch/powerpc/boot/dts/fsl/t1023rdb.dts b/arch/powerpc/boot/dts/fsl/t1023rdb.dts
index 5ba6fbf..034ec42 100644
--- a/arch/powerpc/boot/dts/fsl/t1023rdb.dts
+++ b/arch/powerpc/boot/dts/fsl/t1023rdb.dts
@@ -47,18 +47,24 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi b/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi
index 4908af5..de951f8 100644
--- a/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi
@@ -34,21 +34,6 @@
 
 #include <dt-bindings/thermal/thermal.h>
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
 &ifc {
 	#address-cells = <2>;
 	#size-cells = <1>;
diff --git a/arch/powerpc/boot/dts/fsl/t1024qds.dts b/arch/powerpc/boot/dts/fsl/t1024qds.dts
index d6858b7..a6fa860 100644
--- a/arch/powerpc/boot/dts/fsl/t1024qds.dts
+++ b/arch/powerpc/boot/dts/fsl/t1024qds.dts
@@ -47,18 +47,24 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t1024rdb.dts b/arch/powerpc/boot/dts/fsl/t1024rdb.dts
index 73a6453..09cf13c 100644
--- a/arch/powerpc/boot/dts/fsl/t1024rdb.dts
+++ b/arch/powerpc/boot/dts/fsl/t1024rdb.dts
@@ -51,18 +51,24 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi b/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
index 145c7f4..3fa5a14 100644
--- a/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
@@ -34,21 +34,6 @@
 
 #include <dt-bindings/thermal/thermal.h>
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
 &ifc {
 	#address-cells = <2>;
 	#size-cells = <1>;
diff --git a/arch/powerpc/boot/dts/fsl/t104xd4rdb.dtsi b/arch/powerpc/boot/dts/fsl/t104xd4rdb.dtsi
index 863f943..531600b 100644
--- a/arch/powerpc/boot/dts/fsl/t104xd4rdb.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t104xd4rdb.dtsi
@@ -39,16 +39,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t104xqds.dtsi b/arch/powerpc/boot/dts/fsl/t104xqds.dtsi
index 2fd4cbe..bb7cc7b 100644
--- a/arch/powerpc/boot/dts/fsl/t104xqds.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t104xqds.dtsi
@@ -71,16 +71,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t104xrdb.dtsi b/arch/powerpc/boot/dts/fsl/t104xrdb.dtsi
index 5fdddbd..d0ba614 100644
--- a/arch/powerpc/boot/dts/fsl/t104xrdb.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t104xrdb.dtsi
@@ -45,16 +45,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi b/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
index a97296c..5215e86 100644
--- a/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
@@ -32,21 +32,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
 &ifc {
 	#address-cells = <2>;
 	#size-cells = <1>;
diff --git a/arch/powerpc/boot/dts/fsl/t208xqds.dtsi b/arch/powerpc/boot/dts/fsl/t208xqds.dtsi
index ec080bd..334da3b 100644
--- a/arch/powerpc/boot/dts/fsl/t208xqds.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t208xqds.dtsi
@@ -45,16 +45,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t208xrdb.dtsi b/arch/powerpc/boot/dts/fsl/t208xrdb.dtsi
index ff87e67..102fe75 100644
--- a/arch/powerpc/boot/dts/fsl/t208xrdb.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t208xrdb.dtsi
@@ -45,16 +45,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t4240qds.dts b/arch/powerpc/boot/dts/fsl/t4240qds.dts
index 9573cea..92375b4 100644
--- a/arch/powerpc/boot/dts/fsl/t4240qds.dts
+++ b/arch/powerpc/boot/dts/fsl/t4240qds.dts
@@ -326,16 +326,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t4240rdb.dts b/arch/powerpc/boot/dts/fsl/t4240rdb.dts
index 8166c66..5cd8a62 100644
--- a/arch/powerpc/boot/dts/fsl/t4240rdb.dts
+++ b/arch/powerpc/boot/dts/fsl/t4240rdb.dts
@@ -86,16 +86,22 @@
 		ranges;
 
 		bman_fbpr: bman-fbpr {
+			compatible = "shared-dma-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 		qman_fqd: qman-fqd {
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi b/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
index 68c4ead..97d5ae1 100644
--- a/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
@@ -32,21 +32,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-&bman_fbpr {
-	compatible = "fsl,bman-fbpr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_fqd {
-	compatible = "fsl,qman-fqd";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
-&qman_pfdr {
-	compatible = "fsl,qman-pfdr";
-	alloc-ranges = <0 0 0x10000 0>;
-};
-
 &ifc {
 	#address-cells = <2>;
 	#size-cells = <1>;
-- 
2.9.3

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

* [RFC PATCH 4/5] dt-bindings: soc/fsl: Update reserved memory binding for QBMan
  2017-03-29 21:13 ` Roy Pledge
  (?)
@ 2017-03-29 21:13     ` Roy Pledge
  -1 siblings, 0 replies; 44+ messages in thread
From: Roy Pledge @ 2017-03-29 21:13 UTC (permalink / raw)
  To: robin.murphy-5wv7dgnIgG8, oss-fOR+EgIDQEHk1uMJSBkQmQ,
	linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: madalin.bucur-3arQi8VN3Tc, Roy Pledge

Updates the QMan and BMan device tree bindings for reserved memory
nodes. This makes the reserved memory allocation compatiable with
the shared-dma-pool usage.

Signed-off-by: Roy Pledge <roy.pledge-3arQi8VN3Tc@public.gmane.org>
---
 Documentation/devicetree/bindings/soc/fsl/bman.txt | 10 +++++-----
 Documentation/devicetree/bindings/soc/fsl/qman.txt | 16 +++++++++-------
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/Documentation/devicetree/bindings/soc/fsl/bman.txt b/Documentation/devicetree/bindings/soc/fsl/bman.txt
index 47ac834..bdf2fae7 100644
--- a/Documentation/devicetree/bindings/soc/fsl/bman.txt
+++ b/Documentation/devicetree/bindings/soc/fsl/bman.txt
@@ -65,8 +65,8 @@ to the respective BMan instance
 BMan Private Memory Node
 
 BMan requires a contiguous range of physical memory used for the backing store
-for BMan Free Buffer Proxy Records (FBPR). This memory is reserved/allocated as a
-node under the /reserved-memory node
+for BMan Free Buffer Proxy Records (FBPR). This memory is reserved/allocated as
+a node under the /reserved-memory node.
 
 The BMan FBPR memory node must be named "bman-fbpr"
 
@@ -75,7 +75,7 @@ PROPERTIES
 - compatible
 	Usage:		required
 	Value type:	<stringlist>
-	Definition:	Must inclide "fsl,bman-fbpr"
+	Definition:	Must include "shared-mem-pool"
 
 The following constraints are relevant to the FBPR private memory:
 	- The size must be 2^(size + 1), with size = 11..33. That is 4 KiB to
@@ -100,10 +100,10 @@ The example below shows a BMan FBPR dynamic allocation memory node
 		ranges;
 
 		bman_fbpr: bman-fbpr {
-			compatible = "fsl,bman-fbpr";
-			alloc-ranges = <0 0 0x10 0>;
+			compatible = "shared-mem-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 	};
 
diff --git a/Documentation/devicetree/bindings/soc/fsl/qman.txt b/Documentation/devicetree/bindings/soc/fsl/qman.txt
index 556ebb8..3e7d863 100644
--- a/Documentation/devicetree/bindings/soc/fsl/qman.txt
+++ b/Documentation/devicetree/bindings/soc/fsl/qman.txt
@@ -74,7 +74,9 @@ QMan Private Memory Nodes
 
 QMan requires two contiguous range of physical memory used for the backing store
 for QMan Frame Queue Descriptor (FQD) and Packed Frame Descriptor Record (PFDR).
-This memory is reserved/allocated as a nodes under the /reserved-memory node
+This memory is reserved/allocated as a node under the /reserved-memory node.
+
+For additional details about reserved memory regions see reserved-memory.txt
 
 The QMan FQD memory node must be named "qman-fqd"
 
@@ -83,7 +85,7 @@ PROPERTIES
 - compatible
 	Usage:		required
 	Value type:	<stringlist>
-	Definition:	Must inclide "fsl,qman-fqd"
+	Definition:	Must include "shared-dma-pool"
 
 The QMan PFDR memory node must be named "qman-pfdr"
 
@@ -92,7 +94,7 @@ PROPERTIES
 - compatible
 	Usage:		required
 	Value type:	<stringlist>
-	Definition:	Must inclide "fsl,qman-pfdr"
+	Definition:	Must include "shared-dma-pool"
 
 The following constraints are relevant to the FQD and PFDR private memory:
 	- The size must be 2^(size + 1), with size = 11..29. That is 4 KiB to
@@ -117,16 +119,16 @@ The example below shows a QMan FQD and a PFDR dynamic allocation memory nodes
 		ranges;
 
 		qman_fqd: qman-fqd {
-			compatible = "fsl,qman-fqd";
-			alloc-ranges = <0 0 0x10 0>;
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
-			compatible = "fsl,qman-pfdr";
-			alloc-ranges = <0 0 0x10 0>;
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [RFC PATCH 4/5] dt-bindings: soc/fsl: Update reserved memory binding for QBMan
@ 2017-03-29 21:13     ` Roy Pledge
  0 siblings, 0 replies; 44+ messages in thread
From: Roy Pledge @ 2017-03-29 21:13 UTC (permalink / raw)
  To: robin.murphy, oss, linuxppc-dev, linux-arm-kernel, devicetree
  Cc: madalin.bucur, Roy Pledge

Updates the QMan and BMan device tree bindings for reserved memory
nodes. This makes the reserved memory allocation compatiable with
the shared-dma-pool usage.

Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
---
 Documentation/devicetree/bindings/soc/fsl/bman.txt | 10 +++++-----
 Documentation/devicetree/bindings/soc/fsl/qman.txt | 16 +++++++++-------
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/Documentation/devicetree/bindings/soc/fsl/bman.txt b/Documentation/devicetree/bindings/soc/fsl/bman.txt
index 47ac834..bdf2fae7 100644
--- a/Documentation/devicetree/bindings/soc/fsl/bman.txt
+++ b/Documentation/devicetree/bindings/soc/fsl/bman.txt
@@ -65,8 +65,8 @@ to the respective BMan instance
 BMan Private Memory Node
 
 BMan requires a contiguous range of physical memory used for the backing store
-for BMan Free Buffer Proxy Records (FBPR). This memory is reserved/allocated as a
-node under the /reserved-memory node
+for BMan Free Buffer Proxy Records (FBPR). This memory is reserved/allocated as
+a node under the /reserved-memory node.
 
 The BMan FBPR memory node must be named "bman-fbpr"
 
@@ -75,7 +75,7 @@ PROPERTIES
 - compatible
 	Usage:		required
 	Value type:	<stringlist>
-	Definition:	Must inclide "fsl,bman-fbpr"
+	Definition:	Must include "shared-mem-pool"
 
 The following constraints are relevant to the FBPR private memory:
 	- The size must be 2^(size + 1), with size = 11..33. That is 4 KiB to
@@ -100,10 +100,10 @@ The example below shows a BMan FBPR dynamic allocation memory node
 		ranges;
 
 		bman_fbpr: bman-fbpr {
-			compatible = "fsl,bman-fbpr";
-			alloc-ranges = <0 0 0x10 0>;
+			compatible = "shared-mem-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 	};
 
diff --git a/Documentation/devicetree/bindings/soc/fsl/qman.txt b/Documentation/devicetree/bindings/soc/fsl/qman.txt
index 556ebb8..3e7d863 100644
--- a/Documentation/devicetree/bindings/soc/fsl/qman.txt
+++ b/Documentation/devicetree/bindings/soc/fsl/qman.txt
@@ -74,7 +74,9 @@ QMan Private Memory Nodes
 
 QMan requires two contiguous range of physical memory used for the backing store
 for QMan Frame Queue Descriptor (FQD) and Packed Frame Descriptor Record (PFDR).
-This memory is reserved/allocated as a nodes under the /reserved-memory node
+This memory is reserved/allocated as a node under the /reserved-memory node.
+
+For additional details about reserved memory regions see reserved-memory.txt
 
 The QMan FQD memory node must be named "qman-fqd"
 
@@ -83,7 +85,7 @@ PROPERTIES
 - compatible
 	Usage:		required
 	Value type:	<stringlist>
-	Definition:	Must inclide "fsl,qman-fqd"
+	Definition:	Must include "shared-dma-pool"
 
 The QMan PFDR memory node must be named "qman-pfdr"
 
@@ -92,7 +94,7 @@ PROPERTIES
 - compatible
 	Usage:		required
 	Value type:	<stringlist>
-	Definition:	Must inclide "fsl,qman-pfdr"
+	Definition:	Must include "shared-dma-pool"
 
 The following constraints are relevant to the FQD and PFDR private memory:
 	- The size must be 2^(size + 1), with size = 11..29. That is 4 KiB to
@@ -117,16 +119,16 @@ The example below shows a QMan FQD and a PFDR dynamic allocation memory nodes
 		ranges;
 
 		qman_fqd: qman-fqd {
-			compatible = "fsl,qman-fqd";
-			alloc-ranges = <0 0 0x10 0>;
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
-			compatible = "fsl,qman-pfdr";
-			alloc-ranges = <0 0 0x10 0>;
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
-- 
2.9.3

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

* [RFC PATCH 4/5] dt-bindings: soc/fsl: Update reserved memory binding for QBMan
@ 2017-03-29 21:13     ` Roy Pledge
  0 siblings, 0 replies; 44+ messages in thread
From: Roy Pledge @ 2017-03-29 21:13 UTC (permalink / raw)
  To: linux-arm-kernel

Updates the QMan and BMan device tree bindings for reserved memory
nodes. This makes the reserved memory allocation compatiable with
the shared-dma-pool usage.

Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
---
 Documentation/devicetree/bindings/soc/fsl/bman.txt | 10 +++++-----
 Documentation/devicetree/bindings/soc/fsl/qman.txt | 16 +++++++++-------
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/Documentation/devicetree/bindings/soc/fsl/bman.txt b/Documentation/devicetree/bindings/soc/fsl/bman.txt
index 47ac834..bdf2fae7 100644
--- a/Documentation/devicetree/bindings/soc/fsl/bman.txt
+++ b/Documentation/devicetree/bindings/soc/fsl/bman.txt
@@ -65,8 +65,8 @@ to the respective BMan instance
 BMan Private Memory Node
 
 BMan requires a contiguous range of physical memory used for the backing store
-for BMan Free Buffer Proxy Records (FBPR). This memory is reserved/allocated as a
-node under the /reserved-memory node
+for BMan Free Buffer Proxy Records (FBPR). This memory is reserved/allocated as
+a node under the /reserved-memory node.
 
 The BMan FBPR memory node must be named "bman-fbpr"
 
@@ -75,7 +75,7 @@ PROPERTIES
 - compatible
 	Usage:		required
 	Value type:	<stringlist>
-	Definition:	Must inclide "fsl,bman-fbpr"
+	Definition:	Must include "shared-mem-pool"
 
 The following constraints are relevant to the FBPR private memory:
 	- The size must be 2^(size + 1), with size = 11..33. That is 4 KiB to
@@ -100,10 +100,10 @@ The example below shows a BMan FBPR dynamic allocation memory node
 		ranges;
 
 		bman_fbpr: bman-fbpr {
-			compatible = "fsl,bman-fbpr";
-			alloc-ranges = <0 0 0x10 0>;
+			compatible = "shared-mem-pool";
 			size = <0 0x1000000>;
 			alignment = <0 0x1000000>;
+			no-map;
 		};
 	};
 
diff --git a/Documentation/devicetree/bindings/soc/fsl/qman.txt b/Documentation/devicetree/bindings/soc/fsl/qman.txt
index 556ebb8..3e7d863 100644
--- a/Documentation/devicetree/bindings/soc/fsl/qman.txt
+++ b/Documentation/devicetree/bindings/soc/fsl/qman.txt
@@ -74,7 +74,9 @@ QMan Private Memory Nodes
 
 QMan requires two contiguous range of physical memory used for the backing store
 for QMan Frame Queue Descriptor (FQD) and Packed Frame Descriptor Record (PFDR).
-This memory is reserved/allocated as a nodes under the /reserved-memory node
+This memory is reserved/allocated as a node under the /reserved-memory node.
+
+For additional details about reserved memory regions see reserved-memory.txt
 
 The QMan FQD memory node must be named "qman-fqd"
 
@@ -83,7 +85,7 @@ PROPERTIES
 - compatible
 	Usage:		required
 	Value type:	<stringlist>
-	Definition:	Must inclide "fsl,qman-fqd"
+	Definition:	Must include "shared-dma-pool"
 
 The QMan PFDR memory node must be named "qman-pfdr"
 
@@ -92,7 +94,7 @@ PROPERTIES
 - compatible
 	Usage:		required
 	Value type:	<stringlist>
-	Definition:	Must inclide "fsl,qman-pfdr"
+	Definition:	Must include "shared-dma-pool"
 
 The following constraints are relevant to the FQD and PFDR private memory:
 	- The size must be 2^(size + 1), with size = 11..29. That is 4 KiB to
@@ -117,16 +119,16 @@ The example below shows a QMan FQD and a PFDR dynamic allocation memory nodes
 		ranges;
 
 		qman_fqd: qman-fqd {
-			compatible = "fsl,qman-fqd";
-			alloc-ranges = <0 0 0x10 0>;
+			compatible = "shared-dma-pool";
 			size = <0 0x400000>;
 			alignment = <0 0x400000>;
+			no-map;
 		};
 		qman_pfdr: qman-pfdr {
-			compatible = "fsl,qman-pfdr";
-			alloc-ranges = <0 0 0x10 0>;
+			compatible = "shared-dma-pool";
 			size = <0 0x2000000>;
 			alignment = <0 0x2000000>;
+			no-map;
 		};
 	};
 
-- 
2.9.3

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

* [RFC PATCH 5/5] powerpc: Add HAVE_GENERIC_DMA_COHERENT options to Kconfig
  2017-03-29 21:13 ` Roy Pledge
  (?)
@ 2017-03-29 21:13     ` Roy Pledge
  -1 siblings, 0 replies; 44+ messages in thread
From: Roy Pledge @ 2017-03-29 21:13 UTC (permalink / raw)
  To: robin.murphy-5wv7dgnIgG8, oss-fOR+EgIDQEHk1uMJSBkQmQ,
	linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: madalin.bucur-3arQi8VN3Tc, Roy Pledge

Enable HAVE_GENERIC_DMA_COHERENT to enable use of shared-dma-pool
reserved memory mappings

Signed-off-by: Roy Pledge <roy.pledge-3arQi8VN3Tc@public.gmane.org>
---
 arch/powerpc/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 186e060..0e80e8b 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -136,6 +136,7 @@ config PPC
 	select HAVE_FUNCTION_GRAPH_TRACER
 	select HAVE_FUNCTION_TRACER
 	select HAVE_GCC_PLUGINS
+	select HAVE_GENERIC_DMA_COHERENT
 	select HAVE_GENERIC_GUP
 	select HAVE_HW_BREAKPOINT		if PERF_EVENTS && (PPC_BOOK3S || PPC_8xx)
 	select HAVE_IDE
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [RFC PATCH 5/5] powerpc: Add HAVE_GENERIC_DMA_COHERENT options to Kconfig
@ 2017-03-29 21:13     ` Roy Pledge
  0 siblings, 0 replies; 44+ messages in thread
From: Roy Pledge @ 2017-03-29 21:13 UTC (permalink / raw)
  To: robin.murphy, oss, linuxppc-dev, linux-arm-kernel, devicetree
  Cc: madalin.bucur, Roy Pledge

Enable HAVE_GENERIC_DMA_COHERENT to enable use of shared-dma-pool
reserved memory mappings

Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
---
 arch/powerpc/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 186e060..0e80e8b 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -136,6 +136,7 @@ config PPC
 	select HAVE_FUNCTION_GRAPH_TRACER
 	select HAVE_FUNCTION_TRACER
 	select HAVE_GCC_PLUGINS
+	select HAVE_GENERIC_DMA_COHERENT
 	select HAVE_GENERIC_GUP
 	select HAVE_HW_BREAKPOINT		if PERF_EVENTS && (PPC_BOOK3S || PPC_8xx)
 	select HAVE_IDE
-- 
2.9.3

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

* [RFC PATCH 5/5] powerpc: Add HAVE_GENERIC_DMA_COHERENT options to Kconfig
@ 2017-03-29 21:13     ` Roy Pledge
  0 siblings, 0 replies; 44+ messages in thread
From: Roy Pledge @ 2017-03-29 21:13 UTC (permalink / raw)
  To: linux-arm-kernel

Enable HAVE_GENERIC_DMA_COHERENT to enable use of shared-dma-pool
reserved memory mappings

Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
---
 arch/powerpc/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 186e060..0e80e8b 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -136,6 +136,7 @@ config PPC
 	select HAVE_FUNCTION_GRAPH_TRACER
 	select HAVE_FUNCTION_TRACER
 	select HAVE_GCC_PLUGINS
+	select HAVE_GENERIC_DMA_COHERENT
 	select HAVE_GENERIC_GUP
 	select HAVE_HW_BREAKPOINT		if PERF_EVENTS && (PPC_BOOK3S || PPC_8xx)
 	select HAVE_IDE
-- 
2.9.3

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

* Re: [RFC PATCH 2/5] soc/fsl/qbman: Use shared-dma-pool for QMan private memory allocations
  2017-03-29 21:13     ` Roy Pledge
  (?)
@ 2017-03-30 14:09         ` Robin Murphy
  -1 siblings, 0 replies; 44+ messages in thread
From: Robin Murphy @ 2017-03-30 14:09 UTC (permalink / raw)
  To: roy.pledge-3arQi8VN3Tc, oss-fOR+EgIDQEHk1uMJSBkQmQ,
	linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: madalin.bucur-3arQi8VN3Tc

Hi Roy,

On 29/03/17 22:13, Roy Pledge wrote:
> Use the shared-memory-pool mechanism for frame queue descriptor and
> packed frame descriptor record area allocations.

Thanks for persevering with this - in my opinion it's now looking like
it was worth the effort :)

AFAICS the ioremap_wc() that this leads to does appear to give back
something non-cacheable on PPC (assuming "pgprot_noncached_wc" isn't
horrendously misnamed), and "no-map" should rule out any cacheable
linear map alias existing, so it would seem that this approach should
avert Scott's concerns about attribute mismatches.

> Signed-off-by: Roy Pledge <roy.pledge-3arQi8VN3Tc@public.gmane.org>
> ---
>  drivers/soc/fsl/qbman/qman_ccsr.c | 119 +++++++++++++++++++++-----------------
>  drivers/soc/fsl/qbman/qman_priv.h |   4 +-
>  drivers/soc/fsl/qbman/qman_test.h |   2 -
>  3 files changed, 68 insertions(+), 57 deletions(-)
> 
> diff --git a/drivers/soc/fsl/qbman/qman_ccsr.c b/drivers/soc/fsl/qbman/qman_ccsr.c
> index 90bc40c..35c59ca 100644
> --- a/drivers/soc/fsl/qbman/qman_ccsr.c
> +++ b/drivers/soc/fsl/qbman/qman_ccsr.c
> @@ -400,63 +400,19 @@ static int qm_init_pfdr(struct device *dev, u32 pfdr_start, u32 num)
>  	return -ENODEV;
>  }
>  
> -/*
> - * Ideally we would use the DMA API to turn rmem->base into a DMA address
> - * (especially if iommu translations ever get involved).  Unfortunately, the
> - * DMA API currently does not allow mapping anything that is not backed with
> - * a struct page.
> - */
> +/* QMan needs two global memory areas initialized at boot time:
> +    1) FQD: Frame Queue Descriptors used to manage frame queues
> +    2) PFDR: Packed Frame Queue Descriptor Records used to store frames
> +   Both areas are reserved using the device tree reserved memory framework
> +   and the addresses and sizes are initialized when the QMan device is probed */
>  static dma_addr_t fqd_a, pfdr_a;
>  static size_t fqd_sz, pfdr_sz;
>  
> -static int qman_fqd(struct reserved_mem *rmem)
> -{
> -	fqd_a = rmem->base;
> -	fqd_sz = rmem->size;
> -
> -	WARN_ON(!(fqd_a && fqd_sz));
> -
> -	return 0;
> -}
> -RESERVEDMEM_OF_DECLARE(qman_fqd, "fsl,qman-fqd", qman_fqd);
> -
> -static int qman_pfdr(struct reserved_mem *rmem)
> -{
> -	pfdr_a = rmem->base;
> -	pfdr_sz = rmem->size;
> -
> -	WARN_ON(!(pfdr_a && pfdr_sz));
> -
> -	return 0;
> -}
> -RESERVEDMEM_OF_DECLARE(qman_pfdr, "fsl,qman-pfdr", qman_pfdr);
> -

I notice that patch #1 isn't removing the equivalent bman_fbpr() handler
and declaration as here - is that deliberate or just an oversight?

>  static unsigned int qm_get_fqid_maxcnt(void)
>  {
>  	return fqd_sz / 64;
>  }
>  
> -/*
> - * Flush this memory range from data cache so that QMAN originated
> - * transactions for this memory region could be marked non-coherent.
> - */
> -static int zero_priv_mem(struct device *dev, struct device_node *node,
> -			 phys_addr_t addr, size_t sz)
> -{
> -	/* map as cacheable, non-guarded */
> -	void __iomem *tmpp = ioremap_prot(addr, sz, 0);
> -
> -	if (!tmpp)
> -		return -ENOMEM;
> -
> -	memset_io(tmpp, 0, sz);
> -	flush_dcache_range((unsigned long)tmpp,
> -			   (unsigned long)tmpp + sz);
> -	iounmap(tmpp);
> -
> -	return 0;
> -}
> -
>  static void log_edata_bits(struct device *dev, u32 bit_count)
>  {
>  	u32 i, j, mask = 0xffffffff;
> @@ -687,11 +643,12 @@ static int qman_resource_init(struct device *dev)
>  static int fsl_qman_probe(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
> -	struct device_node *node = dev->of_node;
> +	struct device_node *mem_node, *node = dev->of_node;
>  	struct resource *res;
>  	int ret, err_irq;
>  	u16 id;
>  	u8 major, minor;
> +	u64 size;
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	if (!res) {
> @@ -727,10 +684,66 @@ static int fsl_qman_probe(struct platform_device *pdev)
>  		qm_channel_caam = QMAN_CHANNEL_CAAM_REV3;
>  	}
>  
> -	ret = zero_priv_mem(dev, node, fqd_a, fqd_sz);
> -	WARN_ON(ret);
> -	if (ret)
> +	/* Order of memory regions is assumed as FQD followed by PFDR
> +	   in order to ensure allocations from the correct regions the
> +	   driver initializes then allocates each piece in order */
> +
> +	ret = of_reserved_mem_device_init_by_idx(dev, dev->of_node, 0);
> +	if (ret) {
> +		dev_err(dev, "of_reserved_mem_device_init_by_idx(0) failed 0x%x\n",
> +			ret);
> +		return -ENODEV;
> +	}
> +	mem_node = of_parse_phandle(dev->of_node, "memory-region", 0);
> +	if (mem_node) {
> +		ret = of_property_read_u64(mem_node, "size", &size);
> +		if (ret) {
> +			dev_err(dev, "FQD: of_address_to_resource fails 0x%x\n", ret);

Nit: of_address_to_resource?

> +			return -ENODEV;
> +		}
> +		fqd_sz = size;
> +	} else {
> +		dev_err(dev, "No memory-region found for FQD\n");
> +		return -ENODEV;
> +	}
> +	if (!dma_zalloc_coherent(dev, fqd_sz, &fqd_a, 0)) {
> +		dev_err(dev, "Alloc FQD memory failed\n");
> +		return -ENODEV;
> +	}

Between here, below, and patch #1, it looks like this "init, get size,
alloc" pattern could be nicely factored out into a common helper function.

> +
> +	dev_info(dev, "Allocated FQD 0x%llx 0x%zx\n", fqd_a, fqd_sz);
> +
> +	/* Disassociate the FQD reseverd memory area from the device because
> +	   a device can only have one DMA memory area. This should be fine
> +	   since the memory is allocated and initalized and only ever accessed
> +	   by the QMan device from now on */

Typos: reserved, initialized.

> +	of_reserved_mem_device_release(dev);

I see the driver does not implement a .remove method where you would
otherwise be technically expected to balance the allocation with a
dma_free_coherent(), so I think this trick is acceptable. If anyone
wants to change that in future, it wouldn't seem unreasonable to extend
the core code to handle multiple areas per device (and at worst, I guess
you could deviously juggle dev->dma_mem around the DMA API calls).

Other than those first few nits, and any possible PPC-specific angles
I'm not aware of, I think the series is looking good!

Thanks,
Robin.

> +
> +	/* Setup PFDR memory */
> +	ret = of_reserved_mem_device_init_by_idx(dev, dev->of_node, 1);
> +	if (ret) {
> +		dev_err(dev, "of_reserved_mem_device_init(1) failed 0x%x\n",
> +			ret);
> +		return -ENODEV;
> +	}
> +	mem_node = of_parse_phandle(dev->of_node, "memory-region", 1);
> +	if (mem_node) {
> +		ret = of_property_read_u64(mem_node, "size", &size);
> +		if (ret) {
> +			dev_err(dev, "PFDR: of_address_to_resource fails 0x%x\n", ret);
> +			return -ENODEV;
> +		}
> +		pfdr_sz = size;
> +	} else {
> +		dev_err(dev, "No memory-region found for PFDR\n");
> +		return -ENODEV;
> +	}
> +	if (!dma_zalloc_coherent(dev, pfdr_sz, &pfdr_a, 0)) {
> +		dev_err(dev, "Alloc PFDR Failed size 0x%zx\n", pfdr_sz);
>  		return -ENODEV;
> +	}
> +
> +	dev_info(dev, "Allocated PFDR 0x%llx 0x%zx\n", pfdr_a, pfdr_sz);
>  
>  	ret = qman_init_ccsr(dev);
>  	if (ret) {
> diff --git a/drivers/soc/fsl/qbman/qman_priv.h b/drivers/soc/fsl/qbman/qman_priv.h
> index 22725bd..1e998ea5 100644
> --- a/drivers/soc/fsl/qbman/qman_priv.h
> +++ b/drivers/soc/fsl/qbman/qman_priv.h
> @@ -28,12 +28,12 @@
>   * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>   */
>  
> -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> -
>  #include "dpaa_sys.h"
>  
>  #include <soc/fsl/qman.h>
>  #include <linux/iommu.h>
> +#include <linux/dma-contiguous.h>
> +#include <linux/of_address.h>
>  
>  #if defined(CONFIG_FSL_PAMU)
>  #include <asm/fsl_pamu_stash.h>
> diff --git a/drivers/soc/fsl/qbman/qman_test.h b/drivers/soc/fsl/qbman/qman_test.h
> index d5f8cb2..41bdbc48 100644
> --- a/drivers/soc/fsl/qbman/qman_test.h
> +++ b/drivers/soc/fsl/qbman/qman_test.h
> @@ -30,7 +30,5 @@
>  
>  #include "qman_priv.h"
>  
> -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> -
>  int qman_test_stash(void);
>  int qman_test_api(void);
> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [RFC PATCH 2/5] soc/fsl/qbman: Use shared-dma-pool for QMan private memory allocations
@ 2017-03-30 14:09         ` Robin Murphy
  0 siblings, 0 replies; 44+ messages in thread
From: Robin Murphy @ 2017-03-30 14:09 UTC (permalink / raw)
  To: roy.pledge, oss, linuxppc-dev, linux-arm-kernel, devicetree; +Cc: madalin.bucur

Hi Roy,

On 29/03/17 22:13, Roy Pledge wrote:
> Use the shared-memory-pool mechanism for frame queue descriptor and
> packed frame descriptor record area allocations.

Thanks for persevering with this - in my opinion it's now looking like
it was worth the effort :)

AFAICS the ioremap_wc() that this leads to does appear to give back
something non-cacheable on PPC (assuming "pgprot_noncached_wc" isn't
horrendously misnamed), and "no-map" should rule out any cacheable
linear map alias existing, so it would seem that this approach should
avert Scott's concerns about attribute mismatches.

> Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
> ---
>  drivers/soc/fsl/qbman/qman_ccsr.c | 119 +++++++++++++++++++++-----------------
>  drivers/soc/fsl/qbman/qman_priv.h |   4 +-
>  drivers/soc/fsl/qbman/qman_test.h |   2 -
>  3 files changed, 68 insertions(+), 57 deletions(-)
> 
> diff --git a/drivers/soc/fsl/qbman/qman_ccsr.c b/drivers/soc/fsl/qbman/qman_ccsr.c
> index 90bc40c..35c59ca 100644
> --- a/drivers/soc/fsl/qbman/qman_ccsr.c
> +++ b/drivers/soc/fsl/qbman/qman_ccsr.c
> @@ -400,63 +400,19 @@ static int qm_init_pfdr(struct device *dev, u32 pfdr_start, u32 num)
>  	return -ENODEV;
>  }
>  
> -/*
> - * Ideally we would use the DMA API to turn rmem->base into a DMA address
> - * (especially if iommu translations ever get involved).  Unfortunately, the
> - * DMA API currently does not allow mapping anything that is not backed with
> - * a struct page.
> - */
> +/* QMan needs two global memory areas initialized at boot time:
> +    1) FQD: Frame Queue Descriptors used to manage frame queues
> +    2) PFDR: Packed Frame Queue Descriptor Records used to store frames
> +   Both areas are reserved using the device tree reserved memory framework
> +   and the addresses and sizes are initialized when the QMan device is probed */
>  static dma_addr_t fqd_a, pfdr_a;
>  static size_t fqd_sz, pfdr_sz;
>  
> -static int qman_fqd(struct reserved_mem *rmem)
> -{
> -	fqd_a = rmem->base;
> -	fqd_sz = rmem->size;
> -
> -	WARN_ON(!(fqd_a && fqd_sz));
> -
> -	return 0;
> -}
> -RESERVEDMEM_OF_DECLARE(qman_fqd, "fsl,qman-fqd", qman_fqd);
> -
> -static int qman_pfdr(struct reserved_mem *rmem)
> -{
> -	pfdr_a = rmem->base;
> -	pfdr_sz = rmem->size;
> -
> -	WARN_ON(!(pfdr_a && pfdr_sz));
> -
> -	return 0;
> -}
> -RESERVEDMEM_OF_DECLARE(qman_pfdr, "fsl,qman-pfdr", qman_pfdr);
> -

I notice that patch #1 isn't removing the equivalent bman_fbpr() handler
and declaration as here - is that deliberate or just an oversight?

>  static unsigned int qm_get_fqid_maxcnt(void)
>  {
>  	return fqd_sz / 64;
>  }
>  
> -/*
> - * Flush this memory range from data cache so that QMAN originated
> - * transactions for this memory region could be marked non-coherent.
> - */
> -static int zero_priv_mem(struct device *dev, struct device_node *node,
> -			 phys_addr_t addr, size_t sz)
> -{
> -	/* map as cacheable, non-guarded */
> -	void __iomem *tmpp = ioremap_prot(addr, sz, 0);
> -
> -	if (!tmpp)
> -		return -ENOMEM;
> -
> -	memset_io(tmpp, 0, sz);
> -	flush_dcache_range((unsigned long)tmpp,
> -			   (unsigned long)tmpp + sz);
> -	iounmap(tmpp);
> -
> -	return 0;
> -}
> -
>  static void log_edata_bits(struct device *dev, u32 bit_count)
>  {
>  	u32 i, j, mask = 0xffffffff;
> @@ -687,11 +643,12 @@ static int qman_resource_init(struct device *dev)
>  static int fsl_qman_probe(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
> -	struct device_node *node = dev->of_node;
> +	struct device_node *mem_node, *node = dev->of_node;
>  	struct resource *res;
>  	int ret, err_irq;
>  	u16 id;
>  	u8 major, minor;
> +	u64 size;
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	if (!res) {
> @@ -727,10 +684,66 @@ static int fsl_qman_probe(struct platform_device *pdev)
>  		qm_channel_caam = QMAN_CHANNEL_CAAM_REV3;
>  	}
>  
> -	ret = zero_priv_mem(dev, node, fqd_a, fqd_sz);
> -	WARN_ON(ret);
> -	if (ret)
> +	/* Order of memory regions is assumed as FQD followed by PFDR
> +	   in order to ensure allocations from the correct regions the
> +	   driver initializes then allocates each piece in order */
> +
> +	ret = of_reserved_mem_device_init_by_idx(dev, dev->of_node, 0);
> +	if (ret) {
> +		dev_err(dev, "of_reserved_mem_device_init_by_idx(0) failed 0x%x\n",
> +			ret);
> +		return -ENODEV;
> +	}
> +	mem_node = of_parse_phandle(dev->of_node, "memory-region", 0);
> +	if (mem_node) {
> +		ret = of_property_read_u64(mem_node, "size", &size);
> +		if (ret) {
> +			dev_err(dev, "FQD: of_address_to_resource fails 0x%x\n", ret);

Nit: of_address_to_resource?

> +			return -ENODEV;
> +		}
> +		fqd_sz = size;
> +	} else {
> +		dev_err(dev, "No memory-region found for FQD\n");
> +		return -ENODEV;
> +	}
> +	if (!dma_zalloc_coherent(dev, fqd_sz, &fqd_a, 0)) {
> +		dev_err(dev, "Alloc FQD memory failed\n");
> +		return -ENODEV;
> +	}

Between here, below, and patch #1, it looks like this "init, get size,
alloc" pattern could be nicely factored out into a common helper function.

> +
> +	dev_info(dev, "Allocated FQD 0x%llx 0x%zx\n", fqd_a, fqd_sz);
> +
> +	/* Disassociate the FQD reseverd memory area from the device because
> +	   a device can only have one DMA memory area. This should be fine
> +	   since the memory is allocated and initalized and only ever accessed
> +	   by the QMan device from now on */

Typos: reserved, initialized.

> +	of_reserved_mem_device_release(dev);

I see the driver does not implement a .remove method where you would
otherwise be technically expected to balance the allocation with a
dma_free_coherent(), so I think this trick is acceptable. If anyone
wants to change that in future, it wouldn't seem unreasonable to extend
the core code to handle multiple areas per device (and at worst, I guess
you could deviously juggle dev->dma_mem around the DMA API calls).

Other than those first few nits, and any possible PPC-specific angles
I'm not aware of, I think the series is looking good!

Thanks,
Robin.

> +
> +	/* Setup PFDR memory */
> +	ret = of_reserved_mem_device_init_by_idx(dev, dev->of_node, 1);
> +	if (ret) {
> +		dev_err(dev, "of_reserved_mem_device_init(1) failed 0x%x\n",
> +			ret);
> +		return -ENODEV;
> +	}
> +	mem_node = of_parse_phandle(dev->of_node, "memory-region", 1);
> +	if (mem_node) {
> +		ret = of_property_read_u64(mem_node, "size", &size);
> +		if (ret) {
> +			dev_err(dev, "PFDR: of_address_to_resource fails 0x%x\n", ret);
> +			return -ENODEV;
> +		}
> +		pfdr_sz = size;
> +	} else {
> +		dev_err(dev, "No memory-region found for PFDR\n");
> +		return -ENODEV;
> +	}
> +	if (!dma_zalloc_coherent(dev, pfdr_sz, &pfdr_a, 0)) {
> +		dev_err(dev, "Alloc PFDR Failed size 0x%zx\n", pfdr_sz);
>  		return -ENODEV;
> +	}
> +
> +	dev_info(dev, "Allocated PFDR 0x%llx 0x%zx\n", pfdr_a, pfdr_sz);
>  
>  	ret = qman_init_ccsr(dev);
>  	if (ret) {
> diff --git a/drivers/soc/fsl/qbman/qman_priv.h b/drivers/soc/fsl/qbman/qman_priv.h
> index 22725bd..1e998ea5 100644
> --- a/drivers/soc/fsl/qbman/qman_priv.h
> +++ b/drivers/soc/fsl/qbman/qman_priv.h
> @@ -28,12 +28,12 @@
>   * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>   */
>  
> -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> -
>  #include "dpaa_sys.h"
>  
>  #include <soc/fsl/qman.h>
>  #include <linux/iommu.h>
> +#include <linux/dma-contiguous.h>
> +#include <linux/of_address.h>
>  
>  #if defined(CONFIG_FSL_PAMU)
>  #include <asm/fsl_pamu_stash.h>
> diff --git a/drivers/soc/fsl/qbman/qman_test.h b/drivers/soc/fsl/qbman/qman_test.h
> index d5f8cb2..41bdbc48 100644
> --- a/drivers/soc/fsl/qbman/qman_test.h
> +++ b/drivers/soc/fsl/qbman/qman_test.h
> @@ -30,7 +30,5 @@
>  
>  #include "qman_priv.h"
>  
> -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> -
>  int qman_test_stash(void);
>  int qman_test_api(void);
> 

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

* [RFC PATCH 2/5] soc/fsl/qbman: Use shared-dma-pool for QMan private memory allocations
@ 2017-03-30 14:09         ` Robin Murphy
  0 siblings, 0 replies; 44+ messages in thread
From: Robin Murphy @ 2017-03-30 14:09 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Roy,

On 29/03/17 22:13, Roy Pledge wrote:
> Use the shared-memory-pool mechanism for frame queue descriptor and
> packed frame descriptor record area allocations.

Thanks for persevering with this - in my opinion it's now looking like
it was worth the effort :)

AFAICS the ioremap_wc() that this leads to does appear to give back
something non-cacheable on PPC (assuming "pgprot_noncached_wc" isn't
horrendously misnamed), and "no-map" should rule out any cacheable
linear map alias existing, so it would seem that this approach should
avert Scott's concerns about attribute mismatches.

> Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
> ---
>  drivers/soc/fsl/qbman/qman_ccsr.c | 119 +++++++++++++++++++++-----------------
>  drivers/soc/fsl/qbman/qman_priv.h |   4 +-
>  drivers/soc/fsl/qbman/qman_test.h |   2 -
>  3 files changed, 68 insertions(+), 57 deletions(-)
> 
> diff --git a/drivers/soc/fsl/qbman/qman_ccsr.c b/drivers/soc/fsl/qbman/qman_ccsr.c
> index 90bc40c..35c59ca 100644
> --- a/drivers/soc/fsl/qbman/qman_ccsr.c
> +++ b/drivers/soc/fsl/qbman/qman_ccsr.c
> @@ -400,63 +400,19 @@ static int qm_init_pfdr(struct device *dev, u32 pfdr_start, u32 num)
>  	return -ENODEV;
>  }
>  
> -/*
> - * Ideally we would use the DMA API to turn rmem->base into a DMA address
> - * (especially if iommu translations ever get involved).  Unfortunately, the
> - * DMA API currently does not allow mapping anything that is not backed with
> - * a struct page.
> - */
> +/* QMan needs two global memory areas initialized at boot time:
> +    1) FQD: Frame Queue Descriptors used to manage frame queues
> +    2) PFDR: Packed Frame Queue Descriptor Records used to store frames
> +   Both areas are reserved using the device tree reserved memory framework
> +   and the addresses and sizes are initialized when the QMan device is probed */
>  static dma_addr_t fqd_a, pfdr_a;
>  static size_t fqd_sz, pfdr_sz;
>  
> -static int qman_fqd(struct reserved_mem *rmem)
> -{
> -	fqd_a = rmem->base;
> -	fqd_sz = rmem->size;
> -
> -	WARN_ON(!(fqd_a && fqd_sz));
> -
> -	return 0;
> -}
> -RESERVEDMEM_OF_DECLARE(qman_fqd, "fsl,qman-fqd", qman_fqd);
> -
> -static int qman_pfdr(struct reserved_mem *rmem)
> -{
> -	pfdr_a = rmem->base;
> -	pfdr_sz = rmem->size;
> -
> -	WARN_ON(!(pfdr_a && pfdr_sz));
> -
> -	return 0;
> -}
> -RESERVEDMEM_OF_DECLARE(qman_pfdr, "fsl,qman-pfdr", qman_pfdr);
> -

I notice that patch #1 isn't removing the equivalent bman_fbpr() handler
and declaration as here - is that deliberate or just an oversight?

>  static unsigned int qm_get_fqid_maxcnt(void)
>  {
>  	return fqd_sz / 64;
>  }
>  
> -/*
> - * Flush this memory range from data cache so that QMAN originated
> - * transactions for this memory region could be marked non-coherent.
> - */
> -static int zero_priv_mem(struct device *dev, struct device_node *node,
> -			 phys_addr_t addr, size_t sz)
> -{
> -	/* map as cacheable, non-guarded */
> -	void __iomem *tmpp = ioremap_prot(addr, sz, 0);
> -
> -	if (!tmpp)
> -		return -ENOMEM;
> -
> -	memset_io(tmpp, 0, sz);
> -	flush_dcache_range((unsigned long)tmpp,
> -			   (unsigned long)tmpp + sz);
> -	iounmap(tmpp);
> -
> -	return 0;
> -}
> -
>  static void log_edata_bits(struct device *dev, u32 bit_count)
>  {
>  	u32 i, j, mask = 0xffffffff;
> @@ -687,11 +643,12 @@ static int qman_resource_init(struct device *dev)
>  static int fsl_qman_probe(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
> -	struct device_node *node = dev->of_node;
> +	struct device_node *mem_node, *node = dev->of_node;
>  	struct resource *res;
>  	int ret, err_irq;
>  	u16 id;
>  	u8 major, minor;
> +	u64 size;
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	if (!res) {
> @@ -727,10 +684,66 @@ static int fsl_qman_probe(struct platform_device *pdev)
>  		qm_channel_caam = QMAN_CHANNEL_CAAM_REV3;
>  	}
>  
> -	ret = zero_priv_mem(dev, node, fqd_a, fqd_sz);
> -	WARN_ON(ret);
> -	if (ret)
> +	/* Order of memory regions is assumed as FQD followed by PFDR
> +	   in order to ensure allocations from the correct regions the
> +	   driver initializes then allocates each piece in order */
> +
> +	ret = of_reserved_mem_device_init_by_idx(dev, dev->of_node, 0);
> +	if (ret) {
> +		dev_err(dev, "of_reserved_mem_device_init_by_idx(0) failed 0x%x\n",
> +			ret);
> +		return -ENODEV;
> +	}
> +	mem_node = of_parse_phandle(dev->of_node, "memory-region", 0);
> +	if (mem_node) {
> +		ret = of_property_read_u64(mem_node, "size", &size);
> +		if (ret) {
> +			dev_err(dev, "FQD: of_address_to_resource fails 0x%x\n", ret);

Nit: of_address_to_resource?

> +			return -ENODEV;
> +		}
> +		fqd_sz = size;
> +	} else {
> +		dev_err(dev, "No memory-region found for FQD\n");
> +		return -ENODEV;
> +	}
> +	if (!dma_zalloc_coherent(dev, fqd_sz, &fqd_a, 0)) {
> +		dev_err(dev, "Alloc FQD memory failed\n");
> +		return -ENODEV;
> +	}

Between here, below, and patch #1, it looks like this "init, get size,
alloc" pattern could be nicely factored out into a common helper function.

> +
> +	dev_info(dev, "Allocated FQD 0x%llx 0x%zx\n", fqd_a, fqd_sz);
> +
> +	/* Disassociate the FQD reseverd memory area from the device because
> +	   a device can only have one DMA memory area. This should be fine
> +	   since the memory is allocated and initalized and only ever accessed
> +	   by the QMan device from now on */

Typos: reserved, initialized.

> +	of_reserved_mem_device_release(dev);

I see the driver does not implement a .remove method where you would
otherwise be technically expected to balance the allocation with a
dma_free_coherent(), so I think this trick is acceptable. If anyone
wants to change that in future, it wouldn't seem unreasonable to extend
the core code to handle multiple areas per device (and at worst, I guess
you could deviously juggle dev->dma_mem around the DMA API calls).

Other than those first few nits, and any possible PPC-specific angles
I'm not aware of, I think the series is looking good!

Thanks,
Robin.

> +
> +	/* Setup PFDR memory */
> +	ret = of_reserved_mem_device_init_by_idx(dev, dev->of_node, 1);
> +	if (ret) {
> +		dev_err(dev, "of_reserved_mem_device_init(1) failed 0x%x\n",
> +			ret);
> +		return -ENODEV;
> +	}
> +	mem_node = of_parse_phandle(dev->of_node, "memory-region", 1);
> +	if (mem_node) {
> +		ret = of_property_read_u64(mem_node, "size", &size);
> +		if (ret) {
> +			dev_err(dev, "PFDR: of_address_to_resource fails 0x%x\n", ret);
> +			return -ENODEV;
> +		}
> +		pfdr_sz = size;
> +	} else {
> +		dev_err(dev, "No memory-region found for PFDR\n");
> +		return -ENODEV;
> +	}
> +	if (!dma_zalloc_coherent(dev, pfdr_sz, &pfdr_a, 0)) {
> +		dev_err(dev, "Alloc PFDR Failed size 0x%zx\n", pfdr_sz);
>  		return -ENODEV;
> +	}
> +
> +	dev_info(dev, "Allocated PFDR 0x%llx 0x%zx\n", pfdr_a, pfdr_sz);
>  
>  	ret = qman_init_ccsr(dev);
>  	if (ret) {
> diff --git a/drivers/soc/fsl/qbman/qman_priv.h b/drivers/soc/fsl/qbman/qman_priv.h
> index 22725bd..1e998ea5 100644
> --- a/drivers/soc/fsl/qbman/qman_priv.h
> +++ b/drivers/soc/fsl/qbman/qman_priv.h
> @@ -28,12 +28,12 @@
>   * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>   */
>  
> -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> -
>  #include "dpaa_sys.h"
>  
>  #include <soc/fsl/qman.h>
>  #include <linux/iommu.h>
> +#include <linux/dma-contiguous.h>
> +#include <linux/of_address.h>
>  
>  #if defined(CONFIG_FSL_PAMU)
>  #include <asm/fsl_pamu_stash.h>
> diff --git a/drivers/soc/fsl/qbman/qman_test.h b/drivers/soc/fsl/qbman/qman_test.h
> index d5f8cb2..41bdbc48 100644
> --- a/drivers/soc/fsl/qbman/qman_test.h
> +++ b/drivers/soc/fsl/qbman/qman_test.h
> @@ -30,7 +30,5 @@
>  
>  #include "qman_priv.h"
>  
> -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> -
>  int qman_test_stash(void);
>  int qman_test_api(void);
> 

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

* Re: [RFC PATCH 2/5] soc/fsl/qbman: Use shared-dma-pool for QMan private memory allocations
  2017-03-30 14:09         ` Robin Murphy
  (?)
@ 2017-03-31  3:27             ` Michael Ellerman
  -1 siblings, 0 replies; 44+ messages in thread
From: Michael Ellerman @ 2017-03-31  3:27 UTC (permalink / raw)
  To: Robin Murphy, roy.pledge-3arQi8VN3Tc, oss-fOR+EgIDQEHk1uMJSBkQmQ,
	linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: madalin.bucur-3arQi8VN3Tc

Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org> writes:

> Hi Roy,
>
> On 29/03/17 22:13, Roy Pledge wrote:
>> Use the shared-memory-pool mechanism for frame queue descriptor and
>> packed frame descriptor record area allocations.
>
> Thanks for persevering with this - in my opinion it's now looking like
> it was worth the effort :)
>
> AFAICS the ioremap_wc() that this leads to does appear to give back
> something non-cacheable on PPC (assuming "pgprot_noncached_wc" isn't
> horrendously misnamed), and "no-map" should rule out any cacheable
> linear map alias existing, so it would seem that this approach should
> avert Scott's concerns about attribute mismatches.

How does 'no-map' translate into something being excluded from the
linear mapping?

cheers
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [RFC PATCH 2/5] soc/fsl/qbman: Use shared-dma-pool for QMan private memory allocations
@ 2017-03-31  3:27             ` Michael Ellerman
  0 siblings, 0 replies; 44+ messages in thread
From: Michael Ellerman @ 2017-03-31  3:27 UTC (permalink / raw)
  To: Robin Murphy, roy.pledge, oss, linuxppc-dev, linux-arm-kernel,
	devicetree
  Cc: madalin.bucur

Robin Murphy <robin.murphy@arm.com> writes:

> Hi Roy,
>
> On 29/03/17 22:13, Roy Pledge wrote:
>> Use the shared-memory-pool mechanism for frame queue descriptor and
>> packed frame descriptor record area allocations.
>
> Thanks for persevering with this - in my opinion it's now looking like
> it was worth the effort :)
>
> AFAICS the ioremap_wc() that this leads to does appear to give back
> something non-cacheable on PPC (assuming "pgprot_noncached_wc" isn't
> horrendously misnamed), and "no-map" should rule out any cacheable
> linear map alias existing, so it would seem that this approach should
> avert Scott's concerns about attribute mismatches.

How does 'no-map' translate into something being excluded from the
linear mapping?

cheers

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

* [RFC PATCH 2/5] soc/fsl/qbman: Use shared-dma-pool for QMan private memory allocations
@ 2017-03-31  3:27             ` Michael Ellerman
  0 siblings, 0 replies; 44+ messages in thread
From: Michael Ellerman @ 2017-03-31  3:27 UTC (permalink / raw)
  To: linux-arm-kernel

Robin Murphy <robin.murphy@arm.com> writes:

> Hi Roy,
>
> On 29/03/17 22:13, Roy Pledge wrote:
>> Use the shared-memory-pool mechanism for frame queue descriptor and
>> packed frame descriptor record area allocations.
>
> Thanks for persevering with this - in my opinion it's now looking like
> it was worth the effort :)
>
> AFAICS the ioremap_wc() that this leads to does appear to give back
> something non-cacheable on PPC (assuming "pgprot_noncached_wc" isn't
> horrendously misnamed), and "no-map" should rule out any cacheable
> linear map alias existing, so it would seem that this approach should
> avert Scott's concerns about attribute mismatches.

How does 'no-map' translate into something being excluded from the
linear mapping?

cheers

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

* Re: [RFC PATCH 2/5] soc/fsl/qbman: Use shared-dma-pool for QMan private memory allocations
  2017-03-31  3:27             ` Michael Ellerman
  (?)
@ 2017-03-31 17:55                 ` Robin Murphy
  -1 siblings, 0 replies; 44+ messages in thread
From: Robin Murphy @ 2017-03-31 17:55 UTC (permalink / raw)
  To: Michael Ellerman, roy.pledge-3arQi8VN3Tc,
	oss-fOR+EgIDQEHk1uMJSBkQmQ, linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: madalin.bucur-3arQi8VN3Tc, Mark Rutland

On 31/03/17 04:27, Michael Ellerman wrote:
> Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org> writes:
> 
>> Hi Roy,
>>
>> On 29/03/17 22:13, Roy Pledge wrote:
>>> Use the shared-memory-pool mechanism for frame queue descriptor and
>>> packed frame descriptor record area allocations.
>>
>> Thanks for persevering with this - in my opinion it's now looking like
>> it was worth the effort :)
>>
>> AFAICS the ioremap_wc() that this leads to does appear to give back
>> something non-cacheable on PPC (assuming "pgprot_noncached_wc" isn't
>> horrendously misnamed), and "no-map" should rule out any cacheable
>> linear map alias existing, so it would seem that this approach should
>> avert Scott's concerns about attribute mismatches.
> 
> How does 'no-map' translate into something being excluded from the
> linear mapping?

Reserved regions marked with "no-map" get memblock_remove()d by
early_init_dt_alloc_reserved_memory_arch(). As I understand things, the
linear map should only cover memblock areas, and it would be explicitly
violating the semantics of "no-map" to still cover such a region.

Robin.

> 
> cheers
> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [RFC PATCH 2/5] soc/fsl/qbman: Use shared-dma-pool for QMan private memory allocations
@ 2017-03-31 17:55                 ` Robin Murphy
  0 siblings, 0 replies; 44+ messages in thread
From: Robin Murphy @ 2017-03-31 17:55 UTC (permalink / raw)
  To: Michael Ellerman, roy.pledge, oss, linuxppc-dev,
	linux-arm-kernel, devicetree
  Cc: madalin.bucur, Mark Rutland

On 31/03/17 04:27, Michael Ellerman wrote:
> Robin Murphy <robin.murphy@arm.com> writes:
> 
>> Hi Roy,
>>
>> On 29/03/17 22:13, Roy Pledge wrote:
>>> Use the shared-memory-pool mechanism for frame queue descriptor and
>>> packed frame descriptor record area allocations.
>>
>> Thanks for persevering with this - in my opinion it's now looking like
>> it was worth the effort :)
>>
>> AFAICS the ioremap_wc() that this leads to does appear to give back
>> something non-cacheable on PPC (assuming "pgprot_noncached_wc" isn't
>> horrendously misnamed), and "no-map" should rule out any cacheable
>> linear map alias existing, so it would seem that this approach should
>> avert Scott's concerns about attribute mismatches.
> 
> How does 'no-map' translate into something being excluded from the
> linear mapping?

Reserved regions marked with "no-map" get memblock_remove()d by
early_init_dt_alloc_reserved_memory_arch(). As I understand things, the
linear map should only cover memblock areas, and it would be explicitly
violating the semantics of "no-map" to still cover such a region.

Robin.

> 
> cheers
> 

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

* [RFC PATCH 2/5] soc/fsl/qbman: Use shared-dma-pool for QMan private memory allocations
@ 2017-03-31 17:55                 ` Robin Murphy
  0 siblings, 0 replies; 44+ messages in thread
From: Robin Murphy @ 2017-03-31 17:55 UTC (permalink / raw)
  To: linux-arm-kernel

On 31/03/17 04:27, Michael Ellerman wrote:
> Robin Murphy <robin.murphy@arm.com> writes:
> 
>> Hi Roy,
>>
>> On 29/03/17 22:13, Roy Pledge wrote:
>>> Use the shared-memory-pool mechanism for frame queue descriptor and
>>> packed frame descriptor record area allocations.
>>
>> Thanks for persevering with this - in my opinion it's now looking like
>> it was worth the effort :)
>>
>> AFAICS the ioremap_wc() that this leads to does appear to give back
>> something non-cacheable on PPC (assuming "pgprot_noncached_wc" isn't
>> horrendously misnamed), and "no-map" should rule out any cacheable
>> linear map alias existing, so it would seem that this approach should
>> avert Scott's concerns about attribute mismatches.
> 
> How does 'no-map' translate into something being excluded from the
> linear mapping?

Reserved regions marked with "no-map" get memblock_remove()d by
early_init_dt_alloc_reserved_memory_arch(). As I understand things, the
linear map should only cover memblock areas, and it would be explicitly
violating the semantics of "no-map" to still cover such a region.

Robin.

> 
> cheers
> 

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

* Re: [RFC PATCH 2/5] soc/fsl/qbman: Use shared-dma-pool for QMan private memory allocations
  2017-03-31 17:55                 ` Robin Murphy
  (?)
@ 2017-04-01  7:25                     ` Scott Wood
  -1 siblings, 0 replies; 44+ messages in thread
From: Scott Wood @ 2017-04-01  7:25 UTC (permalink / raw)
  To: Robin Murphy, Michael Ellerman, roy.pledge-3arQi8VN3Tc,
	linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: Mark Rutland, madalin.bucur-3arQi8VN3Tc

On Fri, 2017-03-31 at 18:55 +0100, Robin Murphy wrote:
> On 31/03/17 04:27, Michael Ellerman wrote:
> > 
> > Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org> writes:
> > 
> > > 
> > > Hi Roy,
> > > 
> > > On 29/03/17 22:13, Roy Pledge wrote:
> > > > 
> > > > Use the shared-memory-pool mechanism for frame queue descriptor and
> > > > packed frame descriptor record area allocations.
> > > Thanks for persevering with this - in my opinion it's now looking like
> > > it was worth the effort :)
> > > 
> > > AFAICS the ioremap_wc() that this leads to does appear to give back
> > > something non-cacheable on PPC (assuming "pgprot_noncached_wc" isn't
> > > horrendously misnamed), and "no-map" should rule out any cacheable
> > > linear map alias existing, so it would seem that this approach should
> > > avert Scott's concerns about attribute mismatches.
> > How does 'no-map' translate into something being excluded from the
> > linear mapping?
> Reserved regions marked with "no-map" get memblock_remove()d by
> early_init_dt_alloc_reserved_memory_arch(). As I understand things, the
> linear map should only cover memblock areas, and it would be explicitly
> violating the semantics of "no-map" to still cover such a region.

Discontiguous memory isn't supported on these PPC chips.  Everything up to
memblock_end_of_DRAM() gets mapped -- and if that were to change, the
fragmentation would waste TLB1 entries.

This also breaks compatibility with existing device trees.  I suggest putting
an ifdef in the qbman driver to add the new scheme for non-PPC arches only.

-Scott

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [RFC PATCH 2/5] soc/fsl/qbman: Use shared-dma-pool for QMan private memory allocations
@ 2017-04-01  7:25                     ` Scott Wood
  0 siblings, 0 replies; 44+ messages in thread
From: Scott Wood @ 2017-04-01  7:25 UTC (permalink / raw)
  To: Robin Murphy, Michael Ellerman, roy.pledge, linuxppc-dev,
	linux-arm-kernel, devicetree
  Cc: Mark Rutland, madalin.bucur

On Fri, 2017-03-31 at 18:55 +0100, Robin Murphy wrote:
> On 31/03/17 04:27, Michael Ellerman wrote:
> > 
> > Robin Murphy <robin.murphy@arm.com> writes:
> > 
> > > 
> > > Hi Roy,
> > > 
> > > On 29/03/17 22:13, Roy Pledge wrote:
> > > > 
> > > > Use the shared-memory-pool mechanism for frame queue descriptor and
> > > > packed frame descriptor record area allocations.
> > > Thanks for persevering with this - in my opinion it's now looking like
> > > it was worth the effort :)
> > > 
> > > AFAICS the ioremap_wc() that this leads to does appear to give back
> > > something non-cacheable on PPC (assuming "pgprot_noncached_wc" isn't
> > > horrendously misnamed), and "no-map" should rule out any cacheable
> > > linear map alias existing, so it would seem that this approach should
> > > avert Scott's concerns about attribute mismatches.
> > How does 'no-map' translate into something being excluded from the
> > linear mapping?
> Reserved regions marked with "no-map" get memblock_remove()d by
> early_init_dt_alloc_reserved_memory_arch(). As I understand things, the
> linear map should only cover memblock areas, and it would be explicitly
> violating the semantics of "no-map" to still cover such a region.

Discontiguous memory isn't supported on these PPC chips.  Everything up to
memblock_end_of_DRAM() gets mapped -- and if that were to change, the
fragmentation would waste TLB1 entries.

This also breaks compatibility with existing device trees.  I suggest putting
an ifdef in the qbman driver to add the new scheme for non-PPC arches only.

-Scott

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

* [RFC PATCH 2/5] soc/fsl/qbman: Use shared-dma-pool for QMan private memory allocations
@ 2017-04-01  7:25                     ` Scott Wood
  0 siblings, 0 replies; 44+ messages in thread
From: Scott Wood @ 2017-04-01  7:25 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 2017-03-31 at 18:55 +0100, Robin Murphy wrote:
> On 31/03/17 04:27, Michael Ellerman wrote:
> > 
> > Robin Murphy <robin.murphy@arm.com> writes:
> > 
> > > 
> > > Hi Roy,
> > > 
> > > On 29/03/17 22:13, Roy Pledge wrote:
> > > > 
> > > > Use the shared-memory-pool mechanism for frame queue descriptor and
> > > > packed frame descriptor record area allocations.
> > > Thanks for persevering with this - in my opinion it's now looking like
> > > it was worth the effort :)
> > > 
> > > AFAICS the ioremap_wc() that this leads to does appear to give back
> > > something non-cacheable on PPC (assuming "pgprot_noncached_wc" isn't
> > > horrendously misnamed), and "no-map" should rule out any cacheable
> > > linear map alias existing, so it would seem that this approach should
> > > avert Scott's concerns about attribute mismatches.
> > How does 'no-map' translate into something being excluded from the
> > linear mapping?
> Reserved regions marked with "no-map" get memblock_remove()d by
> early_init_dt_alloc_reserved_memory_arch(). As I understand things, the
> linear map should only cover memblock areas, and it would be explicitly
> violating the semantics of "no-map" to still cover such a region.

Discontiguous memory isn't supported on these PPC chips. ?Everything up to
memblock_end_of_DRAM() gets mapped -- and if that were to change, the
fragmentation would waste TLB1 entries.

This also breaks compatibility with existing device trees. ?I suggest putting
an ifdef in the qbman driver to add the new scheme for non-PPC arches only.

-Scott

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

* Re: [RFC PATCH 2/5] soc/fsl/qbman: Use shared-dma-pool for QMan private memory allocations
  2017-04-01  7:25                     ` Scott Wood
@ 2017-04-03 14:52                       ` Robin Murphy
  -1 siblings, 0 replies; 44+ messages in thread
From: Robin Murphy @ 2017-04-03 14:52 UTC (permalink / raw)
  To: Scott Wood, Michael Ellerman, roy.pledge, linuxppc-dev,
	linux-arm-kernel, devicetree
  Cc: Mark Rutland, madalin.bucur

On 01/04/17 08:25, Scott Wood wrote:
> On Fri, 2017-03-31 at 18:55 +0100, Robin Murphy wrote:
>> On 31/03/17 04:27, Michael Ellerman wrote:
>>>
>>> Robin Murphy <robin.murphy@arm.com> writes:
>>>
>>>>
>>>> Hi Roy,
>>>>
>>>> On 29/03/17 22:13, Roy Pledge wrote:
>>>>>
>>>>> Use the shared-memory-pool mechanism for frame queue descriptor and
>>>>> packed frame descriptor record area allocations.
>>>> Thanks for persevering with this - in my opinion it's now looking like
>>>> it was worth the effort :)
>>>>
>>>> AFAICS the ioremap_wc() that this leads to does appear to give back
>>>> something non-cacheable on PPC (assuming "pgprot_noncached_wc" isn't
>>>> horrendously misnamed), and "no-map" should rule out any cacheable
>>>> linear map alias existing, so it would seem that this approach should
>>>> avert Scott's concerns about attribute mismatches.
>>> How does 'no-map' translate into something being excluded from the
>>> linear mapping?
>> Reserved regions marked with "no-map" get memblock_remove()d by
>> early_init_dt_alloc_reserved_memory_arch(). As I understand things, the
>> linear map should only cover memblock areas, and it would be explicitly
>> violating the semantics of "no-map" to still cover such a region.
> 
> Discontiguous memory isn't supported on these PPC chips.  Everything up to
> memblock_end_of_DRAM() gets mapped -- and if that were to change, the
> fragmentation would waste TLB1 entries.

Ah, so the "PPC-specific angles I'm not aware of" category is indeed
non-empty - I guess the lack of HAVE_GENERIC_DMA_COHERENT might be
related, then.

That said, though, AFAICS only certain x86 and s390 configurations ever
call memblock_set_bottom_up(true), so we should be able to assume that
the reserved region allocations always fall through to
__memblock_find_range_top_down(). Thus if your DRAM is contiguous, then
"no-map"-ing the reserved regions will simply end up pushing
memblock_end_of_DRAM() down in a manner that would appear to still avoid
overlaps. I can only see that going wrong if the end of DRAM wasn't at
least 32MB aligned to begin with - is that ever likely to happen in
practice?

Robin.

> This also breaks compatibility with existing device trees.  I suggest putting
> an ifdef in the qbman driver to add the new scheme for non-PPC arches only.
> 
> -Scott
> 

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

* [RFC PATCH 2/5] soc/fsl/qbman: Use shared-dma-pool for QMan private memory allocations
@ 2017-04-03 14:52                       ` Robin Murphy
  0 siblings, 0 replies; 44+ messages in thread
From: Robin Murphy @ 2017-04-03 14:52 UTC (permalink / raw)
  To: linux-arm-kernel

On 01/04/17 08:25, Scott Wood wrote:
> On Fri, 2017-03-31 at 18:55 +0100, Robin Murphy wrote:
>> On 31/03/17 04:27, Michael Ellerman wrote:
>>>
>>> Robin Murphy <robin.murphy@arm.com> writes:
>>>
>>>>
>>>> Hi Roy,
>>>>
>>>> On 29/03/17 22:13, Roy Pledge wrote:
>>>>>
>>>>> Use the shared-memory-pool mechanism for frame queue descriptor and
>>>>> packed frame descriptor record area allocations.
>>>> Thanks for persevering with this - in my opinion it's now looking like
>>>> it was worth the effort :)
>>>>
>>>> AFAICS the ioremap_wc() that this leads to does appear to give back
>>>> something non-cacheable on PPC (assuming "pgprot_noncached_wc" isn't
>>>> horrendously misnamed), and "no-map" should rule out any cacheable
>>>> linear map alias existing, so it would seem that this approach should
>>>> avert Scott's concerns about attribute mismatches.
>>> How does 'no-map' translate into something being excluded from the
>>> linear mapping?
>> Reserved regions marked with "no-map" get memblock_remove()d by
>> early_init_dt_alloc_reserved_memory_arch(). As I understand things, the
>> linear map should only cover memblock areas, and it would be explicitly
>> violating the semantics of "no-map" to still cover such a region.
> 
> Discontiguous memory isn't supported on these PPC chips.  Everything up to
> memblock_end_of_DRAM() gets mapped -- and if that were to change, the
> fragmentation would waste TLB1 entries.

Ah, so the "PPC-specific angles I'm not aware of" category is indeed
non-empty - I guess the lack of HAVE_GENERIC_DMA_COHERENT might be
related, then.

That said, though, AFAICS only certain x86 and s390 configurations ever
call memblock_set_bottom_up(true), so we should be able to assume that
the reserved region allocations always fall through to
__memblock_find_range_top_down(). Thus if your DRAM is contiguous, then
"no-map"-ing the reserved regions will simply end up pushing
memblock_end_of_DRAM() down in a manner that would appear to still avoid
overlaps. I can only see that going wrong if the end of DRAM wasn't at
least 32MB aligned to begin with - is that ever likely to happen in
practice?

Robin.

> This also breaks compatibility with existing device trees.  I suggest putting
> an ifdef in the qbman driver to add the new scheme for non-PPC arches only.
> 
> -Scott
> 

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

* Re: [RFC PATCH 4/5] dt-bindings: soc/fsl: Update reserved memory binding for QBMan
  2017-03-29 21:13     ` Roy Pledge
  (?)
@ 2017-04-03 15:42       ` Rob Herring
  -1 siblings, 0 replies; 44+ messages in thread
From: Rob Herring @ 2017-04-03 15:42 UTC (permalink / raw)
  To: Roy Pledge
  Cc: devicetree, madalin.bucur, robin.murphy, oss, linuxppc-dev,
	linux-arm-kernel

On Wed, Mar 29, 2017 at 05:13:56PM -0400, Roy Pledge wrote:
> Updates the QMan and BMan device tree bindings for reserved memory
> nodes. This makes the reserved memory allocation compatiable with

s/compatiable/compatible/

> the shared-dma-pool usage.

This change is not backwards compatible. Please state that and explain 
why that is okay. If PPC needs to not change, then the old strings and 
properties should remain, but deprecated.

> 
> Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
> ---
>  Documentation/devicetree/bindings/soc/fsl/bman.txt | 10 +++++-----
>  Documentation/devicetree/bindings/soc/fsl/qman.txt | 16 +++++++++-------
>  2 files changed, 14 insertions(+), 12 deletions(-)

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

* Re: [RFC PATCH 4/5] dt-bindings: soc/fsl: Update reserved memory binding for QBMan
@ 2017-04-03 15:42       ` Rob Herring
  0 siblings, 0 replies; 44+ messages in thread
From: Rob Herring @ 2017-04-03 15:42 UTC (permalink / raw)
  To: Roy Pledge
  Cc: robin.murphy, oss, linuxppc-dev, linux-arm-kernel, devicetree,
	madalin.bucur

On Wed, Mar 29, 2017 at 05:13:56PM -0400, Roy Pledge wrote:
> Updates the QMan and BMan device tree bindings for reserved memory
> nodes. This makes the reserved memory allocation compatiable with

s/compatiable/compatible/

> the shared-dma-pool usage.

This change is not backwards compatible. Please state that and explain 
why that is okay. If PPC needs to not change, then the old strings and 
properties should remain, but deprecated.

> 
> Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
> ---
>  Documentation/devicetree/bindings/soc/fsl/bman.txt | 10 +++++-----
>  Documentation/devicetree/bindings/soc/fsl/qman.txt | 16 +++++++++-------
>  2 files changed, 14 insertions(+), 12 deletions(-)

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

* [RFC PATCH 4/5] dt-bindings: soc/fsl: Update reserved memory binding for QBMan
@ 2017-04-03 15:42       ` Rob Herring
  0 siblings, 0 replies; 44+ messages in thread
From: Rob Herring @ 2017-04-03 15:42 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 29, 2017 at 05:13:56PM -0400, Roy Pledge wrote:
> Updates the QMan and BMan device tree bindings for reserved memory
> nodes. This makes the reserved memory allocation compatiable with

s/compatiable/compatible/

> the shared-dma-pool usage.

This change is not backwards compatible. Please state that and explain 
why that is okay. If PPC needs to not change, then the old strings and 
properties should remain, but deprecated.

> 
> Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
> ---
>  Documentation/devicetree/bindings/soc/fsl/bman.txt | 10 +++++-----
>  Documentation/devicetree/bindings/soc/fsl/qman.txt | 16 +++++++++-------
>  2 files changed, 14 insertions(+), 12 deletions(-)

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

* Re: [RFC PATCH 4/5] dt-bindings: soc/fsl: Update reserved memory binding for QBMan
  2017-04-03 15:42       ` Rob Herring
  (?)
@ 2017-04-03 19:49         ` Roy Pledge
  -1 siblings, 0 replies; 44+ messages in thread
From: Roy Pledge @ 2017-04-03 19:49 UTC (permalink / raw)
  To: Rob Herring
  Cc: robin.murphy-5wv7dgnIgG8, oss-fOR+EgIDQEHk1uMJSBkQmQ,
	linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Madalin-Cristian Bucur

On 4/3/2017 11:42 AM, Rob Herring wrote:
> On Wed, Mar 29, 2017 at 05:13:56PM -0400, Roy Pledge wrote:
>> Updates the QMan and BMan device tree bindings for reserved memory
>> nodes. This makes the reserved memory allocation compatiable with
> s/compatiable/compatible/
>
>> the shared-dma-pool usage.
> This change is not backwards compatible. Please state that and explain 
> why that is okay. If PPC needs to not change, then the old strings and 
> properties should remain, but deprecated.
I think I can make the old device trees compatible since the
"compatible" string changed without too much effort or ifdefery in the
code.  However I would like to eventually see all PPC users move to the
new mode as I do believe it is more in alignment with the spirit of the
reserved-memory framework that is in the kernel.  Do I need to mention
the old mode in the binding.txt file?  I'm trying to keep things clean
so someone reading the binding doesn't get a headache and trying to
preserve my own sanity as we move forward with adding new features to
this driver.

Roy
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [RFC PATCH 4/5] dt-bindings: soc/fsl: Update reserved memory binding for QBMan
@ 2017-04-03 19:49         ` Roy Pledge
  0 siblings, 0 replies; 44+ messages in thread
From: Roy Pledge @ 2017-04-03 19:49 UTC (permalink / raw)
  To: Rob Herring
  Cc: robin.murphy, oss, linuxppc-dev, linux-arm-kernel, devicetree,
	Madalin-Cristian Bucur

On 4/3/2017 11:42 AM, Rob Herring wrote:=0A=
> On Wed, Mar 29, 2017 at 05:13:56PM -0400, Roy Pledge wrote:=0A=
>> Updates the QMan and BMan device tree bindings for reserved memory=0A=
>> nodes. This makes the reserved memory allocation compatiable with=0A=
> s/compatiable/compatible/=0A=
>=0A=
>> the shared-dma-pool usage.=0A=
> This change is not backwards compatible. Please state that and explain =
=0A=
> why that is okay. If PPC needs to not change, then the old strings and =
=0A=
> properties should remain, but deprecated.=0A=
I think I can make the old device trees compatible since the=0A=
"compatible" string changed without too much effort or ifdefery in the=0A=
code.  However I would like to eventually see all PPC users move to the=0A=
new mode as I do believe it is more in alignment with the spirit of the=0A=
reserved-memory framework that is in the kernel.  Do I need to mention=0A=
the old mode in the binding.txt file?  I'm trying to keep things clean=0A=
so someone reading the binding doesn't get a headache and trying to=0A=
preserve my own sanity as we move forward with adding new features to=0A=
this driver.=0A=
=0A=
Roy=0A=

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

* [RFC PATCH 4/5] dt-bindings: soc/fsl: Update reserved memory binding for QBMan
@ 2017-04-03 19:49         ` Roy Pledge
  0 siblings, 0 replies; 44+ messages in thread
From: Roy Pledge @ 2017-04-03 19:49 UTC (permalink / raw)
  To: linux-arm-kernel

On 4/3/2017 11:42 AM, Rob Herring wrote:
> On Wed, Mar 29, 2017 at 05:13:56PM -0400, Roy Pledge wrote:
>> Updates the QMan and BMan device tree bindings for reserved memory
>> nodes. This makes the reserved memory allocation compatiable with
> s/compatiable/compatible/
>
>> the shared-dma-pool usage.
> This change is not backwards compatible. Please state that and explain 
> why that is okay. If PPC needs to not change, then the old strings and 
> properties should remain, but deprecated.
I think I can make the old device trees compatible since the
"compatible" string changed without too much effort or ifdefery in the
code.  However I would like to eventually see all PPC users move to the
new mode as I do believe it is more in alignment with the spirit of the
reserved-memory framework that is in the kernel.  Do I need to mention
the old mode in the binding.txt file?  I'm trying to keep things clean
so someone reading the binding doesn't get a headache and trying to
preserve my own sanity as we move forward with adding new features to
this driver.

Roy

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

* Re: [RFC PATCH 2/5] soc/fsl/qbman: Use shared-dma-pool for QMan private memory allocations
  2017-04-03 14:52                       ` Robin Murphy
  (?)
@ 2017-04-04  0:24                           ` Scott Wood
  -1 siblings, 0 replies; 44+ messages in thread
From: Scott Wood @ 2017-04-04  0:24 UTC (permalink / raw)
  To: Robin Murphy, Michael Ellerman, roy.pledge-3arQi8VN3Tc,
	linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: Mark Rutland, madalin.bucur-3arQi8VN3Tc

On Mon, 2017-04-03 at 15:52 +0100, Robin Murphy wrote:
> On 01/04/17 08:25, Scott Wood wrote:
> > 
> > On Fri, 2017-03-31 at 18:55 +0100, Robin Murphy wrote:
> > > 
> > > On 31/03/17 04:27, Michael Ellerman wrote:
> > > > 
> > > > 
> > > > Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org> writes:
> > > > 
> > > > > 
> > > > > 
> > > > > Hi Roy,
> > > > > 
> > > > > On 29/03/17 22:13, Roy Pledge wrote:
> > > > > > 
> > > > > > 
> > > > > > Use the shared-memory-pool mechanism for frame queue descriptor
> > > > > > and
> > > > > > packed frame descriptor record area allocations.
> > > > > Thanks for persevering with this - in my opinion it's now looking
> > > > > like
> > > > > it was worth the effort :)
> > > > > 
> > > > > AFAICS the ioremap_wc() that this leads to does appear to give back
> > > > > something non-cacheable on PPC (assuming "pgprot_noncached_wc" isn't
> > > > > horrendously misnamed), and "no-map" should rule out any cacheable
> > > > > linear map alias existing, so it would seem that this approach
> > > > > should
> > > > > avert Scott's concerns about attribute mismatches.
> > > > How does 'no-map' translate into something being excluded from the
> > > > linear mapping?
> > > Reserved regions marked with "no-map" get memblock_remove()d by
> > > early_init_dt_alloc_reserved_memory_arch(). As I understand things, the
> > > linear map should only cover memblock areas, and it would be explicitly
> > > violating the semantics of "no-map" to still cover such a region.
> > Discontiguous memory isn't supported on these PPC chips.  Everything up to
> > memblock_end_of_DRAM() gets mapped -- and if that were to change, the
> > fragmentation would waste TLB1 entries.
> Ah, so the "PPC-specific angles I'm not aware of" category is indeed
> non-empty - I guess the lack of HAVE_GENERIC_DMA_COHERENT might be
> related, then.
> 
> That said, though, AFAICS only certain x86 and s390 configurations ever
> call memblock_set_bottom_up(true), so we should be able to assume that
> the reserved region allocations always fall through to
> __memblock_find_range_top_down(). Thus if your DRAM is contiguous, then
> "no-map"-ing the reserved regions will simply end up pushing
> memblock_end_of_DRAM() down in a manner that would appear to still avoid
> overlaps.

Can you guarantee it will be at the end?  What if there were other early
memblock allocations (e.g. other reserved-memory regions without no-map) that
came first?

>  I can only see that going wrong if the end of DRAM wasn't at
> least 32MB aligned to begin with - is that ever likely to happen in
> practice?

Probably not, unless the user asks for an unusual memory size via mem= or
similar.

-Scott

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [RFC PATCH 2/5] soc/fsl/qbman: Use shared-dma-pool for QMan private memory allocations
@ 2017-04-04  0:24                           ` Scott Wood
  0 siblings, 0 replies; 44+ messages in thread
From: Scott Wood @ 2017-04-04  0:24 UTC (permalink / raw)
  To: Robin Murphy, Michael Ellerman, roy.pledge, linuxppc-dev,
	linux-arm-kernel, devicetree
  Cc: Mark Rutland, madalin.bucur

On Mon, 2017-04-03 at 15:52 +0100, Robin Murphy wrote:
> On 01/04/17 08:25, Scott Wood wrote:
> > 
> > On Fri, 2017-03-31 at 18:55 +0100, Robin Murphy wrote:
> > > 
> > > On 31/03/17 04:27, Michael Ellerman wrote:
> > > > 
> > > > 
> > > > Robin Murphy <robin.murphy@arm.com> writes:
> > > > 
> > > > > 
> > > > > 
> > > > > Hi Roy,
> > > > > 
> > > > > On 29/03/17 22:13, Roy Pledge wrote:
> > > > > > 
> > > > > > 
> > > > > > Use the shared-memory-pool mechanism for frame queue descriptor
> > > > > > and
> > > > > > packed frame descriptor record area allocations.
> > > > > Thanks for persevering with this - in my opinion it's now looking
> > > > > like
> > > > > it was worth the effort :)
> > > > > 
> > > > > AFAICS the ioremap_wc() that this leads to does appear to give back
> > > > > something non-cacheable on PPC (assuming "pgprot_noncached_wc" isn't
> > > > > horrendously misnamed), and "no-map" should rule out any cacheable
> > > > > linear map alias existing, so it would seem that this approach
> > > > > should
> > > > > avert Scott's concerns about attribute mismatches.
> > > > How does 'no-map' translate into something being excluded from the
> > > > linear mapping?
> > > Reserved regions marked with "no-map" get memblock_remove()d by
> > > early_init_dt_alloc_reserved_memory_arch(). As I understand things, the
> > > linear map should only cover memblock areas, and it would be explicitly
> > > violating the semantics of "no-map" to still cover such a region.
> > Discontiguous memory isn't supported on these PPC chips.  Everything up to
> > memblock_end_of_DRAM() gets mapped -- and if that were to change, the
> > fragmentation would waste TLB1 entries.
> Ah, so the "PPC-specific angles I'm not aware of" category is indeed
> non-empty - I guess the lack of HAVE_GENERIC_DMA_COHERENT might be
> related, then.
> 
> That said, though, AFAICS only certain x86 and s390 configurations ever
> call memblock_set_bottom_up(true), so we should be able to assume that
> the reserved region allocations always fall through to
> __memblock_find_range_top_down(). Thus if your DRAM is contiguous, then
> "no-map"-ing the reserved regions will simply end up pushing
> memblock_end_of_DRAM() down in a manner that would appear to still avoid
> overlaps.

Can you guarantee it will be at the end?  What if there were other early
memblock allocations (e.g. other reserved-memory regions without no-map) that
came first?

>  I can only see that going wrong if the end of DRAM wasn't at
> least 32MB aligned to begin with - is that ever likely to happen in
> practice?

Probably not, unless the user asks for an unusual memory size via mem= or
similar.

-Scott

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

* [RFC PATCH 2/5] soc/fsl/qbman: Use shared-dma-pool for QMan private memory allocations
@ 2017-04-04  0:24                           ` Scott Wood
  0 siblings, 0 replies; 44+ messages in thread
From: Scott Wood @ 2017-04-04  0:24 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 2017-04-03 at 15:52 +0100, Robin Murphy wrote:
> On 01/04/17 08:25, Scott Wood wrote:
> > 
> > On Fri, 2017-03-31 at 18:55 +0100, Robin Murphy wrote:
> > > 
> > > On 31/03/17 04:27, Michael Ellerman wrote:
> > > > 
> > > > 
> > > > Robin Murphy <robin.murphy@arm.com> writes:
> > > > 
> > > > > 
> > > > > 
> > > > > Hi Roy,
> > > > > 
> > > > > On 29/03/17 22:13, Roy Pledge wrote:
> > > > > > 
> > > > > > 
> > > > > > Use the shared-memory-pool mechanism for frame queue descriptor
> > > > > > and
> > > > > > packed frame descriptor record area allocations.
> > > > > Thanks for persevering with this - in my opinion it's now looking
> > > > > like
> > > > > it was worth the effort :)
> > > > > 
> > > > > AFAICS the ioremap_wc() that this leads to does appear to give back
> > > > > something non-cacheable on PPC (assuming "pgprot_noncached_wc" isn't
> > > > > horrendously misnamed), and "no-map" should rule out any cacheable
> > > > > linear map alias existing, so it would seem that this approach
> > > > > should
> > > > > avert Scott's concerns about attribute mismatches.
> > > > How does 'no-map' translate into something being excluded from the
> > > > linear mapping?
> > > Reserved regions marked with "no-map" get memblock_remove()d by
> > > early_init_dt_alloc_reserved_memory_arch(). As I understand things, the
> > > linear map should only cover memblock areas, and it would be explicitly
> > > violating the semantics of "no-map" to still cover such a region.
> > Discontiguous memory isn't supported on these PPC chips.??Everything up to
> > memblock_end_of_DRAM() gets mapped -- and if that were to change, the
> > fragmentation would waste TLB1 entries.
> Ah, so the "PPC-specific angles I'm not aware of" category is indeed
> non-empty - I guess the lack of HAVE_GENERIC_DMA_COHERENT might be
> related, then.
> 
> That said, though, AFAICS only certain x86 and s390 configurations ever
> call memblock_set_bottom_up(true), so we should be able to assume that
> the reserved region allocations always fall through to
> __memblock_find_range_top_down(). Thus if your DRAM is contiguous, then
> "no-map"-ing the reserved regions will simply end up pushing
> memblock_end_of_DRAM() down in a manner that would appear to still avoid
> overlaps.

Can you guarantee it will be at the end? ?What if there were other early
memblock allocations (e.g. other reserved-memory regions without no-map) that
came first?

>  I can only see that going wrong if the end of DRAM wasn't at
> least 32MB aligned to begin with - is that ever likely to happen in
> practice?

Probably not, unless the user asks for an unusual memory size via mem= or
similar.

-Scott

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

* Re: [RFC PATCH 4/5] dt-bindings: soc/fsl: Update reserved memory binding for QBMan
  2017-04-03 19:49         ` Roy Pledge
  (?)
@ 2017-04-04  0:32             ` Scott Wood
  -1 siblings, 0 replies; 44+ messages in thread
From: Scott Wood @ 2017-04-04  0:32 UTC (permalink / raw)
  To: Roy Pledge, Rob Herring
  Cc: robin.murphy-5wv7dgnIgG8, linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Madalin-Cristian Bucur

On Mon, 2017-04-03 at 19:49 +0000, Roy Pledge wrote:
> On 4/3/2017 11:42 AM, Rob Herring wrote:
> > 
> > On Wed, Mar 29, 2017 at 05:13:56PM -0400, Roy Pledge wrote:
> > > 
> > > Updates the QMan and BMan device tree bindings for reserved memory
> > > nodes. This makes the reserved memory allocation compatiable with
> > s/compatiable/compatible/
> > 
> > > 
> > > the shared-dma-pool usage.
> > This change is not backwards compatible. Please state that and explain 
> > why that is okay. If PPC needs to not change, then the old strings and 
> > properties should remain, but deprecated.
> I think I can make the old device trees compatible since the
> "compatible" string changed without too much effort or ifdefery in the
> code.  However I would like to eventually see all PPC users move to the
> new mode as I do believe it is more in alignment with the spirit of the
> reserved-memory framework that is in the kernel.

How much benefit is there to changing PPC if you have to retain the old method
anyway for compatibility?  Whereas if you don't convert, you retain test
coverage for the old device trees, and don't have to worry about
the memblock_end_of_DRAM() questions.

>   Do I need to mention the old mode in the binding.txt file? 

Yes.

>  I'm trying to keep things clean
> so someone reading the binding doesn't get a headache and trying to
> preserve my own sanity as we move forward with adding new features to
> this driver.

If they're sufficiently different then just describe the new and old nodes
separately rather than putting a bunch of if/else clauses in there.

-Scott

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [RFC PATCH 4/5] dt-bindings: soc/fsl: Update reserved memory binding for QBMan
@ 2017-04-04  0:32             ` Scott Wood
  0 siblings, 0 replies; 44+ messages in thread
From: Scott Wood @ 2017-04-04  0:32 UTC (permalink / raw)
  To: Roy Pledge, Rob Herring
  Cc: robin.murphy, linuxppc-dev, linux-arm-kernel, devicetree,
	Madalin-Cristian Bucur

On Mon, 2017-04-03 at 19:49 +0000, Roy Pledge wrote:
> On 4/3/2017 11:42 AM, Rob Herring wrote:
> > 
> > On Wed, Mar 29, 2017 at 05:13:56PM -0400, Roy Pledge wrote:
> > > 
> > > Updates the QMan and BMan device tree bindings for reserved memory
> > > nodes. This makes the reserved memory allocation compatiable with
> > s/compatiable/compatible/
> > 
> > > 
> > > the shared-dma-pool usage.
> > This change is not backwards compatible. Please state that and explain 
> > why that is okay. If PPC needs to not change, then the old strings and 
> > properties should remain, but deprecated.
> I think I can make the old device trees compatible since the
> "compatible" string changed without too much effort or ifdefery in the
> code.  However I would like to eventually see all PPC users move to the
> new mode as I do believe it is more in alignment with the spirit of the
> reserved-memory framework that is in the kernel.

How much benefit is there to changing PPC if you have to retain the old method
anyway for compatibility?  Whereas if you don't convert, you retain test
coverage for the old device trees, and don't have to worry about
the memblock_end_of_DRAM() questions.

>   Do I need to mention the old mode in the binding.txt file? 

Yes.

>  I'm trying to keep things clean
> so someone reading the binding doesn't get a headache and trying to
> preserve my own sanity as we move forward with adding new features to
> this driver.

If they're sufficiently different then just describe the new and old nodes
separately rather than putting a bunch of if/else clauses in there.

-Scott

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

* [RFC PATCH 4/5] dt-bindings: soc/fsl: Update reserved memory binding for QBMan
@ 2017-04-04  0:32             ` Scott Wood
  0 siblings, 0 replies; 44+ messages in thread
From: Scott Wood @ 2017-04-04  0:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 2017-04-03 at 19:49 +0000, Roy Pledge wrote:
> On 4/3/2017 11:42 AM, Rob Herring wrote:
> > 
> > On Wed, Mar 29, 2017 at 05:13:56PM -0400, Roy Pledge wrote:
> > > 
> > > Updates the QMan and BMan device tree bindings for reserved memory
> > > nodes. This makes the reserved memory allocation compatiable with
> > s/compatiable/compatible/
> > 
> > > 
> > > the shared-dma-pool usage.
> > This change is not backwards compatible. Please state that and explain?
> > why that is okay. If PPC needs to not change, then the old strings and?
> > properties should remain, but deprecated.
> I think I can make the old device trees compatible since the
> "compatible" string changed without too much effort or ifdefery in the
> code. ?However I would like to eventually see all PPC users move to the
> new mode as I do believe it is more in alignment with the spirit of the
> reserved-memory framework that is in the kernel.

How much benefit is there to changing PPC if you have to retain the old method
anyway for compatibility? ?Whereas if you don't convert, you retain test
coverage for the old device trees, and don't have to worry about
the?memblock_end_of_DRAM() questions.

> ??Do I need to mention the old mode in the binding.txt file??

Yes.

> ?I'm trying to keep things clean
> so someone reading the binding doesn't get a headache and trying to
> preserve my own sanity as we move forward with adding new features to
> this driver.

If they're sufficiently different then just describe the new and old nodes
separately rather than putting a bunch of if/else clauses in there.

-Scott

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

end of thread, other threads:[~2017-04-04  0:32 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-29 21:13 [RFC PATCH 0/5] soc/fsl/qbman: Rework private memory allocations Roy Pledge
2017-03-29 21:13 ` Roy Pledge
2017-03-29 21:13 ` Roy Pledge
     [not found] ` <1490822037-6752-1-git-send-email-roy.pledge-3arQi8VN3Tc@public.gmane.org>
2017-03-29 21:13   ` [RFC PATCH 1/5] soc/fsl/qbman: Use shared-dma-pool for BMan " Roy Pledge
2017-03-29 21:13     ` Roy Pledge
2017-03-29 21:13     ` Roy Pledge
2017-03-29 21:13   ` [RFC PATCH 2/5] soc/fsl/qbman: Use shared-dma-pool for QMan " Roy Pledge
2017-03-29 21:13     ` Roy Pledge
2017-03-29 21:13     ` Roy Pledge
     [not found]     ` <1490822037-6752-3-git-send-email-roy.pledge-3arQi8VN3Tc@public.gmane.org>
2017-03-30 14:09       ` Robin Murphy
2017-03-30 14:09         ` Robin Murphy
2017-03-30 14:09         ` Robin Murphy
     [not found]         ` <b1cd8d44-8c74-ab50-5dc9-1f978cae5bdf-5wv7dgnIgG8@public.gmane.org>
2017-03-31  3:27           ` Michael Ellerman
2017-03-31  3:27             ` Michael Ellerman
2017-03-31  3:27             ` Michael Ellerman
     [not found]             ` <871ste5dmw.fsf-W0DJWXSxmBNbyGPkN3NxC2scP1bn1w/D@public.gmane.org>
2017-03-31 17:55               ` Robin Murphy
2017-03-31 17:55                 ` Robin Murphy
2017-03-31 17:55                 ` Robin Murphy
     [not found]                 ` <dfaa1a28-66d8-15fb-7d2d-75e206161770-5wv7dgnIgG8@public.gmane.org>
2017-04-01  7:25                   ` Scott Wood
2017-04-01  7:25                     ` Scott Wood
2017-04-01  7:25                     ` Scott Wood
2017-04-03 14:52                     ` Robin Murphy
2017-04-03 14:52                       ` Robin Murphy
     [not found]                       ` <df00c0ab-22b8-1086-def1-69baf648df72-5wv7dgnIgG8@public.gmane.org>
2017-04-04  0:24                         ` Scott Wood
2017-04-04  0:24                           ` Scott Wood
2017-04-04  0:24                           ` Scott Wood
2017-03-29 21:13   ` [RFC PATCH 3/5] dts: arch/powerpc: Update Freescale DTS for QBMan " Roy Pledge
2017-03-29 21:13     ` Roy Pledge
2017-03-29 21:13     ` Roy Pledge
2017-03-29 21:13   ` [RFC PATCH 4/5] dt-bindings: soc/fsl: Update reserved memory binding for QBMan Roy Pledge
2017-03-29 21:13     ` Roy Pledge
2017-03-29 21:13     ` Roy Pledge
2017-04-03 15:42     ` Rob Herring
2017-04-03 15:42       ` Rob Herring
2017-04-03 15:42       ` Rob Herring
2017-04-03 19:49       ` Roy Pledge
2017-04-03 19:49         ` Roy Pledge
2017-04-03 19:49         ` Roy Pledge
     [not found]         ` <VI1PR04MB32166AA6361CD6F24DBC3AAF86080-mr6QIVyDiCHPlBEOArXH089NdZoXdze2vxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-04-04  0:32           ` Scott Wood
2017-04-04  0:32             ` Scott Wood
2017-04-04  0:32             ` Scott Wood
2017-03-29 21:13   ` [RFC PATCH 5/5] powerpc: Add HAVE_GENERIC_DMA_COHERENT options to Kconfig Roy Pledge
2017-03-29 21:13     ` Roy Pledge
2017-03-29 21:13     ` Roy Pledge

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.