linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Add DT support for davinci remoteproc driver
@ 2017-05-26 20:21 Suman Anna
  2017-05-26 20:21 ` [PATCH 1/4] remoteproc/davinci: Switch to platform_get_resource_byname() Suman Anna
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Suman Anna @ 2017-05-26 20:21 UTC (permalink / raw)
  To: Bjorn Andersson, Ohad Ben-Cohen, Rob Herring
  Cc: Mark Rutland, devicetree, linux-remoteproc, Sekhar Nori,
	Robert Tivy, linux-arm-kernel, linux-kernel, Suman Anna

Hi,

The following series adds the device tree support to the Davinci
remoteproc driver. The TI Davinci family has boards booting both
in legacy mode and DT mode, so both modes are still supported by
this driver. Patches are baselined on 4.12-rc1 + the "Davinci
remoteproc cleanups/fixes" series [1].

Following is the patch summary:
 - Patch 1 uses resource names for retrieving resources to be
   independent of the resource order, and prepare the driver
   for DT.
 - Patch 2 parses the internal memory regions, to be able to
   support loading into DSP internal memory regions.
 - Patch 3 adds the binding
 - Patch 4 adds the DT adaptation to the existing driver.

The first 2 patches are dependent on the resource name additions
(no direct build dependencies) to the davinci-rproc devices added
in series [2] for maintaining functional parity for legacy-mode
devices. This series is already accepted and being staged to be
merged for v4.13. DTS nodes for the OMAP-L138 LCDK board will be
added for a subsequent merge window once these patches are picked
up.

regards
Suman

[1] http://marc.info/?l=linux-arm-kernel&m=149514538506046&w=2
[2] http://marc.info/?l=linux-kernel&m=149497287512869&w=2
[3] https://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci.git/?h=v4.13/soc

Suman Anna (4):
  remoteproc/davinci: Switch to platform_get_resource_byname()
  remoteproc/davinci: add support to parse internal memories
  Documentation: dt: Add bindings for Davinci DSP processors
  remoteproc/davinci: Add device tree support for OMAP-L138 DSP

 .../bindings/remoteproc/ti,davinci-rproc.txt       | 92 ++++++++++++++++++++
 drivers/remoteproc/da8xx_remoteproc.c              | 98 ++++++++++++++++++++--
 2 files changed, 185 insertions(+), 5 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/remoteproc/ti,davinci-rproc.txt

-- 
2.12.0

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

* [PATCH 1/4] remoteproc/davinci: Switch to platform_get_resource_byname()
  2017-05-26 20:21 [PATCH 0/4] Add DT support for davinci remoteproc driver Suman Anna
@ 2017-05-26 20:21 ` Suman Anna
  2017-05-26 20:21 ` [PATCH 2/4] remoteproc/davinci: add support to parse internal memories Suman Anna
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Suman Anna @ 2017-05-26 20:21 UTC (permalink / raw)
  To: Bjorn Andersson, Ohad Ben-Cohen, Rob Herring
  Cc: Mark Rutland, devicetree, linux-remoteproc, Sekhar Nori,
	Robert Tivy, linux-arm-kernel, linux-kernel, Suman Anna

The davinci remoteproc driver currently uses the platform_get_resource()
API for retrieving the IOMEM resources. Switch this function to use the
platform_get_resource_byname() API instead in preparation for adding the
DT support so that the binding can be agnostic of the IOMEM resource
order.

Signed-off-by: Suman Anna <s-anna@ti.com>
---
 drivers/remoteproc/da8xx_remoteproc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/remoteproc/da8xx_remoteproc.c b/drivers/remoteproc/da8xx_remoteproc.c
index c7ad818f7a48..0919176b52c1 100644
--- a/drivers/remoteproc/da8xx_remoteproc.c
+++ b/drivers/remoteproc/da8xx_remoteproc.c
@@ -195,12 +195,14 @@ static int da8xx_rproc_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	bootreg_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	bootreg_res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
+						   "host1cfg");
 	bootreg = devm_ioremap_resource(dev, bootreg_res);
 	if (IS_ERR(bootreg))
 		return PTR_ERR(bootreg);
 
-	chipsig_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+	chipsig_res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
+						   "chipsig");
 	chipsig = devm_ioremap_resource(dev, chipsig_res);
 	if (IS_ERR(chipsig))
 		return PTR_ERR(chipsig);
-- 
2.12.0

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

* [PATCH 2/4] remoteproc/davinci: add support to parse internal memories
  2017-05-26 20:21 [PATCH 0/4] Add DT support for davinci remoteproc driver Suman Anna
  2017-05-26 20:21 ` [PATCH 1/4] remoteproc/davinci: Switch to platform_get_resource_byname() Suman Anna
@ 2017-05-26 20:21 ` Suman Anna
  2017-05-26 20:21 ` [PATCH 3/4] Documentation: dt: Add bindings for Davinci DSP processors Suman Anna
  2017-05-26 20:21 ` [PATCH 4/4] remoteproc/davinci: Add device tree support for OMAP-L138 DSP Suman Anna
  3 siblings, 0 replies; 7+ messages in thread
From: Suman Anna @ 2017-05-26 20:21 UTC (permalink / raw)
  To: Bjorn Andersson, Ohad Ben-Cohen, Rob Herring
  Cc: Mark Rutland, devicetree, linux-remoteproc, Sekhar Nori,
	Robert Tivy, linux-arm-kernel, linux-kernel, Suman Anna

The DSP subsystem on OMAP-L13x SoCs has various internal RAM
memories that can accessed from the ARM side. These memories
can be configured to be used as either RAM or Cache.

The Davinci remoteproc driver has been enhanced to parse and
store the kernel mappings for these internal RAM memories.
These mappings can then be used to support direct loading of
text/data into these memories from the remoteproc driver.

Signed-off-by: Suman Anna <s-anna@ti.com>
---
 drivers/remoteproc/da8xx_remoteproc.c | 62 +++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/drivers/remoteproc/da8xx_remoteproc.c b/drivers/remoteproc/da8xx_remoteproc.c
index 0919176b52c1..5250cc494775 100644
--- a/drivers/remoteproc/da8xx_remoteproc.c
+++ b/drivers/remoteproc/da8xx_remoteproc.c
@@ -38,9 +38,27 @@ MODULE_PARM_DESC(da8xx_fw_name,
 #define SYSCFG_CHIPSIG3 BIT(3)
 #define SYSCFG_CHIPSIG4 BIT(4)
 
+#define DA8XX_RPROC_LOCAL_ADDRESS_MASK	(SZ_16M - 1)
+
+/**
+ * struct da8xx_rproc_mem - internal memory structure
+ * @cpu_addr: MPU virtual address of the memory region
+ * @bus_addr: Bus address used to access the memory region
+ * @dev_addr: Device address of the memory region from DSP view
+ * @size: Size of the memory region
+ */
+struct da8xx_rproc_mem {
+	void __iomem *cpu_addr;
+	phys_addr_t bus_addr;
+	u32 dev_addr;
+	size_t size;
+};
+
 /**
  * struct da8xx_rproc - da8xx remote processor instance state
  * @rproc: rproc handle
+ * @mem: internal memory regions data
+ * @num_mems: number of internal memory regions
  * @dsp_clk: placeholder for platform's DSP clk
  * @ack_fxn: chip-specific ack function for ack'ing irq
  * @irq_data: ack_fxn function parameter
@@ -50,6 +68,8 @@ MODULE_PARM_DESC(da8xx_fw_name,
  */
 struct da8xx_rproc {
 	struct rproc *rproc;
+	struct da8xx_rproc_mem *mem;
+	int num_mems;
 	struct clk *dsp_clk;
 	void (*ack_fxn)(struct irq_data *data);
 	struct irq_data *irq_data;
@@ -169,6 +189,44 @@ static const struct rproc_ops da8xx_rproc_ops = {
 	.kick = da8xx_rproc_kick,
 };
 
+static int da8xx_rproc_get_internal_memories(struct platform_device *pdev,
+					     struct da8xx_rproc *drproc)
+{
+	static const char * const mem_names[] = {"l2sram", "l1pram", "l1dram"};
+	int num_mems = ARRAY_SIZE(mem_names);
+	struct device *dev = &pdev->dev;
+	struct resource *res;
+	int i;
+
+	drproc->mem = devm_kcalloc(dev, num_mems, sizeof(*drproc->mem),
+				   GFP_KERNEL);
+	if (!drproc->mem)
+		return -ENOMEM;
+
+	for (i = 0; i < num_mems; i++) {
+		res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
+						   mem_names[i]);
+		drproc->mem[i].cpu_addr = devm_ioremap_resource(dev, res);
+		if (IS_ERR(drproc->mem[i].cpu_addr)) {
+			dev_err(dev, "failed to parse and map %s memory\n",
+				mem_names[i]);
+			return PTR_ERR(drproc->mem[i].cpu_addr);
+		}
+		drproc->mem[i].bus_addr = res->start;
+		drproc->mem[i].dev_addr =
+				res->start & DA8XX_RPROC_LOCAL_ADDRESS_MASK;
+		drproc->mem[i].size = resource_size(res);
+
+		dev_dbg(dev, "memory %8s: bus addr %pa size 0x%x va %p da 0x%x\n",
+			mem_names[i], &drproc->mem[i].bus_addr,
+			drproc->mem[i].size, drproc->mem[i].cpu_addr,
+			drproc->mem[i].dev_addr);
+	}
+	drproc->num_mems = num_mems;
+
+	return 0;
+}
+
 static int da8xx_rproc_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -224,6 +282,10 @@ static int da8xx_rproc_probe(struct platform_device *pdev)
 	drproc->dsp_clk = dsp_clk;
 	rproc->has_iommu = false;
 
+	ret = da8xx_rproc_get_internal_memories(pdev, drproc);
+	if (ret)
+		goto free_rproc;
+
 	platform_set_drvdata(pdev, rproc);
 
 	/*
-- 
2.12.0

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

* [PATCH 3/4] Documentation: dt: Add bindings for Davinci DSP processors
  2017-05-26 20:21 [PATCH 0/4] Add DT support for davinci remoteproc driver Suman Anna
  2017-05-26 20:21 ` [PATCH 1/4] remoteproc/davinci: Switch to platform_get_resource_byname() Suman Anna
  2017-05-26 20:21 ` [PATCH 2/4] remoteproc/davinci: add support to parse internal memories Suman Anna
@ 2017-05-26 20:21 ` Suman Anna
  2017-05-31 19:22   ` Rob Herring
  2017-05-26 20:21 ` [PATCH 4/4] remoteproc/davinci: Add device tree support for OMAP-L138 DSP Suman Anna
  3 siblings, 1 reply; 7+ messages in thread
From: Suman Anna @ 2017-05-26 20:21 UTC (permalink / raw)
  To: Bjorn Andersson, Ohad Ben-Cohen, Rob Herring
  Cc: Mark Rutland, devicetree, linux-remoteproc, Sekhar Nori,
	Robert Tivy, linux-arm-kernel, linux-kernel, Suman Anna

Add the device tree bindings document for the DSP processor
subsystem devices on TI Davinci DA8xx/OMAP-L13x SoCs.

Signed-off-by: Suman Anna <s-anna@ti.com>
---
 .../bindings/remoteproc/ti,davinci-rproc.txt       | 92 ++++++++++++++++++++++
 1 file changed, 92 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/remoteproc/ti,davinci-rproc.txt

diff --git a/Documentation/devicetree/bindings/remoteproc/ti,davinci-rproc.txt b/Documentation/devicetree/bindings/remoteproc/ti,davinci-rproc.txt
new file mode 100644
index 000000000000..e53572e22002
--- /dev/null
+++ b/Documentation/devicetree/bindings/remoteproc/ti,davinci-rproc.txt
@@ -0,0 +1,92 @@
+TI Davinci DSP devices
+=======================
+
+Binding status: Unstable - Subject to changes for DT clocks and resets
+
+The TI Davinci family of SoCs usually contains a TI DSP Core sub-system that
+is used to offload some of the processor-intensive tasks or algorithms, for
+achieving various system level goals.
+
+The processor cores in the sub-system usually contain additional sub-modules
+like L1 and/or L2 caches/SRAMs, an Interrupt Controller, an external memory
+controller, a dedicated local power/sleep controller etc. The DSP processor
+core used in Davinci SoCs is usually a C674x DSP CPU.
+
+DSP Device Node:
+================
+Each DSP Core sub-system is represented as a single DT node.
+
+Required properties:
+--------------------
+The following are the mandatory properties:
+
+- compatible:		Should be one of the following,
+			    "ti,da850-dsp" for DSPs on OMAP-L138 SoCs
+
+- reg:			Should contain an entry for each value in 'reg-names'.
+			Each entry should have the memory region's start address
+			and the size of the region, the representation matching
+			the parent node's '#address-cells' and '#size-cells' values.
+
+- reg-names:		Should contain strings with the following names, each
+			representing a specific internal memory region or a
+			specific register space,
+			     "l2sram", "l1pram", "l1dram", "host1cfg", "chipsig_base"
+
+- interrupts: 		Should contain the interrupt number used to receive the
+			interrupts from the DSP. The value should follow the
+			interrupt-specifier format as dictated by the
+			'interrupt-parent' node.
+
+- memory-region:	phandle to the reserved memory node to be associated
+			with the remoteproc device. The reserved memory node
+			can be a CMA memory node, and should be defined as
+			per the bindings in
+			Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
+
+Optional properties:
+--------------------
+- interrupt-parent:	phandle to the interrupt controller node. This property
+			is needed if the device node hierarchy doesn't have an
+			interrupt controller.
+
+
+Example:
+--------
+
+	/* DA850 DTS file */
+	{
+		dsp: dsp@11800000 {
+			compatible = "ti,da850-dsp";
+			reg = <0x11800000 0x40000>,
+			      <0x11e00000 0x8000>,
+			      <0x11f00000 0x8000>,
+			      <0x01c14044 0x4>,
+			      <0x01c14174 0x8>;
+			reg-names = "l2sram", "l1pram", "l1dram", "host1cfg",
+				    "chipsig";
+			interrupt-parent = <&intc>;
+			interrupts = <28>;
+			status = "disabled";
+		};
+
+	};
+
+	/* OMAP-L138 LCDK Board file */
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		dsp_cma_pool: dsp_cma@c3000000 {
+                        compatible = "shared-dma-pool";
+                        reg = <0xc3000000 0x1000000>;
+                        reusable;
+                        status = "okay";
+                };
+	};
+
+	&dsp {
+		status = "okay";
+		memory-region = <&dsp_cma_pool>;
+	};
-- 
2.12.0

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

* [PATCH 4/4] remoteproc/davinci: Add device tree support for OMAP-L138 DSP
  2017-05-26 20:21 [PATCH 0/4] Add DT support for davinci remoteproc driver Suman Anna
                   ` (2 preceding siblings ...)
  2017-05-26 20:21 ` [PATCH 3/4] Documentation: dt: Add bindings for Davinci DSP processors Suman Anna
@ 2017-05-26 20:21 ` Suman Anna
  3 siblings, 0 replies; 7+ messages in thread
From: Suman Anna @ 2017-05-26 20:21 UTC (permalink / raw)
  To: Bjorn Andersson, Ohad Ben-Cohen, Rob Herring
  Cc: Mark Rutland, devicetree, linux-remoteproc, Sekhar Nori,
	Robert Tivy, linux-arm-kernel, linux-kernel, Suman Anna

The Davinci remoteproc driver currently supports the DSP remoteproc
device created in legacy-style on OMAP-L13x SoCs. The driver has been
enhanced to support the DSP remoteproc device created through Device
Tree now. The current DT support handles the C674x DSP processor
subsystem on OMAP-L138 SoCs.

Signed-off-by: Suman Anna <s-anna@ti.com>
---
 drivers/remoteproc/da8xx_remoteproc.c | 30 +++++++++++++++++++++++++++---
 1 file changed, 27 insertions(+), 3 deletions(-)

diff --git a/drivers/remoteproc/da8xx_remoteproc.c b/drivers/remoteproc/da8xx_remoteproc.c
index 5250cc494775..02a4920d1af2 100644
--- a/drivers/remoteproc/da8xx_remoteproc.c
+++ b/drivers/remoteproc/da8xx_remoteproc.c
@@ -16,6 +16,7 @@
 #include <linux/irq.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/of_reserved_mem.h>
 #include <linux/platform_device.h>
 #include <linux/remoteproc.h>
 
@@ -272,10 +273,21 @@ static int da8xx_rproc_probe(struct platform_device *pdev)
 		return PTR_ERR(dsp_clk);
 	}
 
+	if (dev->of_node) {
+		ret = of_reserved_mem_device_init(dev);
+		if (ret) {
+			dev_err(dev, "device does not have specific CMA pool: %d\n",
+				ret);
+			return ret;
+		}
+	}
+
 	rproc = rproc_alloc(dev, "dsp", &da8xx_rproc_ops, da8xx_fw_name,
 		sizeof(*drproc));
-	if (!rproc)
-		return -ENOMEM;
+	if (!rproc) {
+		ret = -ENOMEM;
+		goto free_mem;
+	}
 
 	drproc = rproc->priv;
 	drproc->rproc = rproc;
@@ -313,25 +325,37 @@ static int da8xx_rproc_probe(struct platform_device *pdev)
 
 free_rproc:
 	rproc_free(rproc);
-
+free_mem:
+	if (dev->of_node)
+		of_reserved_mem_device_release(dev);
 	return ret;
 }
 
 static int da8xx_rproc_remove(struct platform_device *pdev)
 {
 	struct rproc *rproc = platform_get_drvdata(pdev);
+	struct device *dev = &pdev->dev;
 
 	rproc_del(rproc);
 	rproc_free(rproc);
+	if (dev->of_node)
+		of_reserved_mem_device_release(dev);
 
 	return 0;
 }
 
+static const struct of_device_id davinci_rproc_of_match[] = {
+	{ .compatible = "ti,da850-dsp", },
+	{ /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(of, davinci_rproc_of_match);
+
 static struct platform_driver da8xx_rproc_driver = {
 	.probe = da8xx_rproc_probe,
 	.remove = da8xx_rproc_remove,
 	.driver = {
 		.name = "davinci-rproc",
+		.of_match_table = davinci_rproc_of_match,
 	},
 };
 
-- 
2.12.0

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

* Re: [PATCH 3/4] Documentation: dt: Add bindings for Davinci DSP processors
  2017-05-26 20:21 ` [PATCH 3/4] Documentation: dt: Add bindings for Davinci DSP processors Suman Anna
@ 2017-05-31 19:22   ` Rob Herring
  2017-05-31 19:53     ` Suman Anna
  0 siblings, 1 reply; 7+ messages in thread
From: Rob Herring @ 2017-05-31 19:22 UTC (permalink / raw)
  To: Suman Anna
  Cc: Bjorn Andersson, Ohad Ben-Cohen, Mark Rutland, devicetree,
	linux-remoteproc, Sekhar Nori, Robert Tivy, linux-arm-kernel,
	linux-kernel

On Fri, May 26, 2017 at 03:21:39PM -0500, Suman Anna wrote:
> Add the device tree bindings document for the DSP processor
> subsystem devices on TI Davinci DA8xx/OMAP-L13x SoCs.

"dt-bindings: remoteproc:  ..." for the subject.

> 
> Signed-off-by: Suman Anna <s-anna@ti.com>
> ---
>  .../bindings/remoteproc/ti,davinci-rproc.txt       | 92 ++++++++++++++++++++++
>  1 file changed, 92 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/remoteproc/ti,davinci-rproc.txt
> 
> diff --git a/Documentation/devicetree/bindings/remoteproc/ti,davinci-rproc.txt b/Documentation/devicetree/bindings/remoteproc/ti,davinci-rproc.txt
> new file mode 100644
> index 000000000000..e53572e22002
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/remoteproc/ti,davinci-rproc.txt
> @@ -0,0 +1,92 @@
> +TI Davinci DSP devices
> +=======================
> +
> +Binding status: Unstable - Subject to changes for DT clocks and resets

Sorry, understandable if you didn't have documentation, but you work for 
TI, figure out what the clocks and resets are.

> +
> +The TI Davinci family of SoCs usually contains a TI DSP Core sub-system that
> +is used to offload some of the processor-intensive tasks or algorithms, for
> +achieving various system level goals.
> +
> +The processor cores in the sub-system usually contain additional sub-modules
> +like L1 and/or L2 caches/SRAMs, an Interrupt Controller, an external memory
> +controller, a dedicated local power/sleep controller etc. The DSP processor
> +core used in Davinci SoCs is usually a C674x DSP CPU.

I'm wondering if your compatible string is specific enough with this 
statement.

> +
> +DSP Device Node:
> +================
> +Each DSP Core sub-system is represented as a single DT node.
> +
> +Required properties:
> +--------------------
> +The following are the mandatory properties:
> +
> +- compatible:		Should be one of the following,
> +			    "ti,da850-dsp" for DSPs on OMAP-L138 SoCs
> +
> +- reg:			Should contain an entry for each value in 'reg-names'.
> +			Each entry should have the memory region's start address
> +			and the size of the region, the representation matching
> +			the parent node's '#address-cells' and '#size-cells' values.
> +
> +- reg-names:		Should contain strings with the following names, each
> +			representing a specific internal memory region or a
> +			specific register space,
> +			     "l2sram", "l1pram", "l1dram", "host1cfg", "chipsig_base"
> +
> +- interrupts: 		Should contain the interrupt number used to receive the
> +			interrupts from the DSP. The value should follow the
> +			interrupt-specifier format as dictated by the
> +			'interrupt-parent' node.
> +
> +- memory-region:	phandle to the reserved memory node to be associated
> +			with the remoteproc device. The reserved memory node
> +			can be a CMA memory node, and should be defined as
> +			per the bindings in
> +			Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
> +
> +Optional properties:
> +--------------------
> +- interrupt-parent:	phandle to the interrupt controller node. This property
> +			is needed if the device node hierarchy doesn't have an
> +			interrupt controller.
> +
> +
> +Example:
> +--------
> +
> +	/* DA850 DTS file */

Don't show the dts split in examples.

> +	{
> +		dsp: dsp@11800000 {
> +			compatible = "ti,da850-dsp";
> +			reg = <0x11800000 0x40000>,
> +			      <0x11e00000 0x8000>,
> +			      <0x11f00000 0x8000>,
> +			      <0x01c14044 0x4>,
> +			      <0x01c14174 0x8>;
> +			reg-names = "l2sram", "l1pram", "l1dram", "host1cfg",
> +				    "chipsig";
> +			interrupt-parent = <&intc>;
> +			interrupts = <28>;
> +			status = "disabled";

Don't show status in examples.

> +		};
> +
> +	};
> +
> +	/* OMAP-L138 LCDK Board file */
> +	reserved-memory {
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		ranges;
> +
> +		dsp_cma_pool: dsp_cma@c3000000 {

cma is a linuxism. dsp-memory@...

> +                        compatible = "shared-dma-pool";
> +                        reg = <0xc3000000 0x1000000>;
> +                        reusable;
> +                        status = "okay";
> +                };
> +	};
> +
> +	&dsp {
> +		status = "okay";
> +		memory-region = <&dsp_cma_pool>;
> +	};
> -- 
> 2.12.0
> 

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

* Re: [PATCH 3/4] Documentation: dt: Add bindings for Davinci DSP processors
  2017-05-31 19:22   ` Rob Herring
@ 2017-05-31 19:53     ` Suman Anna
  0 siblings, 0 replies; 7+ messages in thread
From: Suman Anna @ 2017-05-31 19:53 UTC (permalink / raw)
  To: Rob Herring
  Cc: Bjorn Andersson, Ohad Ben-Cohen, Mark Rutland, devicetree,
	linux-remoteproc, Sekhar Nori, Robert Tivy, linux-arm-kernel,
	linux-kernel

Hi Rob,

On 05/31/2017 02:22 PM, Rob Herring wrote:
> On Fri, May 26, 2017 at 03:21:39PM -0500, Suman Anna wrote:
>> Add the device tree bindings document for the DSP processor
>> subsystem devices on TI Davinci DA8xx/OMAP-L13x SoCs.
> 
> "dt-bindings: remoteproc:  ..." for the subject.

Ok, will fix this on v2

> 
>>
>> Signed-off-by: Suman Anna <s-anna@ti.com>
>> ---
>>  .../bindings/remoteproc/ti,davinci-rproc.txt       | 92 ++++++++++++++++++++++
>>  1 file changed, 92 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/remoteproc/ti,davinci-rproc.txt
>>
>> diff --git a/Documentation/devicetree/bindings/remoteproc/ti,davinci-rproc.txt b/Documentation/devicetree/bindings/remoteproc/ti,davinci-rproc.txt
>> new file mode 100644
>> index 000000000000..e53572e22002
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/remoteproc/ti,davinci-rproc.txt
>> @@ -0,0 +1,92 @@
>> +TI Davinci DSP devices
>> +=======================
>> +
>> +Binding status: Unstable - Subject to changes for DT clocks and resets
> 
> Sorry, understandable if you didn't have documentation, but you work for 
> TI, figure out what the clocks and resets are.

Well, what I meant here is that the clocks and resets do not have a DT
representation yet on these SoCs. And when they do have a DT
representation, I would need to add the additional _required_ clocks and
resets properties, hence the marking.

> 
>> +
>> +The TI Davinci family of SoCs usually contains a TI DSP Core sub-system that
>> +is used to offload some of the processor-intensive tasks or algorithms, for
>> +achieving various system level goals.
>> +
>> +The processor cores in the sub-system usually contain additional sub-modules
>> +like L1 and/or L2 caches/SRAMs, an Interrupt Controller, an external memory
>> +controller, a dedicated local power/sleep controller etc. The DSP processor
>> +core used in Davinci SoCs is usually a C674x DSP CPU.
> 
> I'm wondering if your compatible string is specific enough with this 
> statement.

We always have integration aspects around these IPs into different SoCs,
so the compatible is following the SoC name. Also note that the C674x is
just the DSP core - one part of the DSP subsystem.

> 
>> +
>> +DSP Device Node:
>> +================
>> +Each DSP Core sub-system is represented as a single DT node.
>> +
>> +Required properties:
>> +--------------------
>> +The following are the mandatory properties:
>> +
>> +- compatible:		Should be one of the following,
>> +			    "ti,da850-dsp" for DSPs on OMAP-L138 SoCs
>> +
>> +- reg:			Should contain an entry for each value in 'reg-names'.
>> +			Each entry should have the memory region's start address
>> +			and the size of the region, the representation matching
>> +			the parent node's '#address-cells' and '#size-cells' values.
>> +
>> +- reg-names:		Should contain strings with the following names, each
>> +			representing a specific internal memory region or a
>> +			specific register space,
>> +			     "l2sram", "l1pram", "l1dram", "host1cfg", "chipsig_base"
>> +
>> +- interrupts: 		Should contain the interrupt number used to receive the
>> +			interrupts from the DSP. The value should follow the
>> +			interrupt-specifier format as dictated by the
>> +			'interrupt-parent' node.
>> +
>> +- memory-region:	phandle to the reserved memory node to be associated
>> +			with the remoteproc device. The reserved memory node
>> +			can be a CMA memory node, and should be defined as
>> +			per the bindings in
>> +			Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
>> +
>> +Optional properties:
>> +--------------------
>> +- interrupt-parent:	phandle to the interrupt controller node. This property
>> +			is needed if the device node hierarchy doesn't have an
>> +			interrupt controller.
>> +
>> +
>> +Example:
>> +--------
>> +
>> +	/* DA850 DTS file */
> 
> Don't show the dts split in examples.
> 
>> +	{
>> +		dsp: dsp@11800000 {
>> +			compatible = "ti,da850-dsp";
>> +			reg = <0x11800000 0x40000>,
>> +			      <0x11e00000 0x8000>,
>> +			      <0x11f00000 0x8000>,
>> +			      <0x01c14044 0x4>,
>> +			      <0x01c14174 0x8>;
>> +			reg-names = "l2sram", "l1pram", "l1dram", "host1cfg",
>> +				    "chipsig";
>> +			interrupt-parent = <&intc>;
>> +			interrupts = <28>;
>> +			status = "disabled";
> 
> Don't show status in examples.
> 
>> +		};
>> +
>> +	};
>> +
>> +	/* OMAP-L138 LCDK Board file */
>> +	reserved-memory {
>> +		#address-cells = <1>;
>> +		#size-cells = <1>;
>> +		ranges;
>> +
>> +		dsp_cma_pool: dsp_cma@c3000000 {
> 
> cma is a linuxism. dsp-memory@...

OK will fix up all these comments as well.

regards
Suman

> 
>> +                        compatible = "shared-dma-pool";
>> +                        reg = <0xc3000000 0x1000000>;
>> +                        reusable;
>> +                        status = "okay";
>> +                };
>> +	};
>> +
>> +	&dsp {
>> +		status = "okay";
>> +		memory-region = <&dsp_cma_pool>;
>> +	};
>> -- 
>> 2.12.0
>>

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

end of thread, other threads:[~2017-05-31 19:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-26 20:21 [PATCH 0/4] Add DT support for davinci remoteproc driver Suman Anna
2017-05-26 20:21 ` [PATCH 1/4] remoteproc/davinci: Switch to platform_get_resource_byname() Suman Anna
2017-05-26 20:21 ` [PATCH 2/4] remoteproc/davinci: add support to parse internal memories Suman Anna
2017-05-26 20:21 ` [PATCH 3/4] Documentation: dt: Add bindings for Davinci DSP processors Suman Anna
2017-05-31 19:22   ` Rob Herring
2017-05-31 19:53     ` Suman Anna
2017-05-26 20:21 ` [PATCH 4/4] remoteproc/davinci: Add device tree support for OMAP-L138 DSP Suman Anna

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).