Re: [PATCH v2 2/2] dt-bindings: introduce Command DB for QCOM SoCs

2018-02-15 Thread Lina Iyer

On Wed, Feb 14 2018 at 19:34 +, Bjorn Andersson wrote:

On Thu 08 Feb 11:51 PST 2018, Lina Iyer wrote:


From: Mahesh Sivasubramanian 

Command DB provides information on shared resources like clocks,
regulators etc., probed at boot by the remote subsytem and made
available in shared memory.

Cc: devicet...@vger.kernel.org
Signed-off-by: Mahesh Sivasubramanian 
Signed-off-by: Lina Iyer 
---
 .../devicetree/bindings/arm/msm/cmd-db.txt | 38 ++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/msm/cmd-db.txt

diff --git a/Documentation/devicetree/bindings/arm/msm/cmd-db.txt 
b/Documentation/devicetree/bindings/arm/msm/cmd-db.txt
new file mode 100644
index ..e21666e40ebf
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/msm/cmd-db.txt
@@ -0,0 +1,38 @@
+Command DB
+-
+
+Command DB is a database that provides a mapping between resource key and the
+resource address for a system resource managed by a remote processor. The data
+is stored in a shared memory region and is loaded by the remote processor.
+
+Some of the Qualcomm Technologies Inc SoC's have hardware accelerators for
+controlling shared resources. Depending on the board configuration the shared
+resource properties may change. These properties are dynamically probed by the
+remote processor and made available in the shared memory.
+
+The devicetree representation of the command DB driver should be:
+
+PROPERTIES:
+- compatible:
+   Usage: required
+   Value type: 
+   Definition: Should be "qcom,cmd-db"
+
+- memory-region:
+   Usage: required
+   Value type: 
+   Definition: The phandle to the reserved memory region.
+
+Example:
+
+   reserved-memory {
+   [...]
+   cmd_db_mem: qcom,cmd-db@c3f000c {
+   reg = <0x0 0xc3f000c 0x0 0x8>;


I was hoping that we can describe the actual memory here, as I got the
impression that it will also be a chunk of memory carved out from System
RAM.


Yes, it can be described. But, the location should always be read from
the address above. Generally, the CMD DB memory would not change, but it
is not always guaranteed.


If not it would seem unlikely that there's a 8 byte carveout in the
middle of DDR, what else is here?


+   };
+   };
+
+   qcom,cmd-db@c3f000c {
+   compatible = "qcom,cmd-db";


Add "qcom,cmd-db" to "reserved_mem_matches" in drivers/of/platform.c,
use of_reserved_mem_lookup(pdev->dev.of_node) to get the reserved_mem
and you can just put the compatible directly on the reserved-memory
node.

That way you don't need this separate node that doesn't really represent
anything.


Oh okay. I can take care of that.

Thanks,
Lina

+   memory-region = <_db_mem>;
+   };


Re: [PATCH v2 2/2] dt-bindings: introduce Command DB for QCOM SoCs

2018-02-15 Thread Lina Iyer

On Wed, Feb 14 2018 at 19:34 +, Bjorn Andersson wrote:

On Thu 08 Feb 11:51 PST 2018, Lina Iyer wrote:


From: Mahesh Sivasubramanian 

Command DB provides information on shared resources like clocks,
regulators etc., probed at boot by the remote subsytem and made
available in shared memory.

Cc: devicet...@vger.kernel.org
Signed-off-by: Mahesh Sivasubramanian 
Signed-off-by: Lina Iyer 
---
 .../devicetree/bindings/arm/msm/cmd-db.txt | 38 ++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/msm/cmd-db.txt

diff --git a/Documentation/devicetree/bindings/arm/msm/cmd-db.txt 
b/Documentation/devicetree/bindings/arm/msm/cmd-db.txt
new file mode 100644
index ..e21666e40ebf
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/msm/cmd-db.txt
@@ -0,0 +1,38 @@
+Command DB
+-
+
+Command DB is a database that provides a mapping between resource key and the
+resource address for a system resource managed by a remote processor. The data
+is stored in a shared memory region and is loaded by the remote processor.
+
+Some of the Qualcomm Technologies Inc SoC's have hardware accelerators for
+controlling shared resources. Depending on the board configuration the shared
+resource properties may change. These properties are dynamically probed by the
+remote processor and made available in the shared memory.
+
+The devicetree representation of the command DB driver should be:
+
+PROPERTIES:
+- compatible:
+   Usage: required
+   Value type: 
+   Definition: Should be "qcom,cmd-db"
+
+- memory-region:
+   Usage: required
+   Value type: 
+   Definition: The phandle to the reserved memory region.
+
+Example:
+
+   reserved-memory {
+   [...]
+   cmd_db_mem: qcom,cmd-db@c3f000c {
+   reg = <0x0 0xc3f000c 0x0 0x8>;


I was hoping that we can describe the actual memory here, as I got the
impression that it will also be a chunk of memory carved out from System
RAM.


Yes, it can be described. But, the location should always be read from
the address above. Generally, the CMD DB memory would not change, but it
is not always guaranteed.


If not it would seem unlikely that there's a 8 byte carveout in the
middle of DDR, what else is here?


+   };
+   };
+
+   qcom,cmd-db@c3f000c {
+   compatible = "qcom,cmd-db";


Add "qcom,cmd-db" to "reserved_mem_matches" in drivers/of/platform.c,
use of_reserved_mem_lookup(pdev->dev.of_node) to get the reserved_mem
and you can just put the compatible directly on the reserved-memory
node.

That way you don't need this separate node that doesn't really represent
anything.


Oh okay. I can take care of that.

Thanks,
Lina

+   memory-region = <_db_mem>;
+   };


Re: [PATCH v2 2/2] dt-bindings: introduce Command DB for QCOM SoCs

2018-02-14 Thread Bjorn Andersson
On Thu 08 Feb 11:51 PST 2018, Lina Iyer wrote:

> From: Mahesh Sivasubramanian 
> 
> Command DB provides information on shared resources like clocks,
> regulators etc., probed at boot by the remote subsytem and made
> available in shared memory.
> 
> Cc: devicet...@vger.kernel.org
> Signed-off-by: Mahesh Sivasubramanian 
> Signed-off-by: Lina Iyer 
> ---
>  .../devicetree/bindings/arm/msm/cmd-db.txt | 38 
> ++
>  1 file changed, 38 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/arm/msm/cmd-db.txt
> 
> diff --git a/Documentation/devicetree/bindings/arm/msm/cmd-db.txt 
> b/Documentation/devicetree/bindings/arm/msm/cmd-db.txt
> new file mode 100644
> index ..e21666e40ebf
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/arm/msm/cmd-db.txt
> @@ -0,0 +1,38 @@
> +Command DB
> +-
> +
> +Command DB is a database that provides a mapping between resource key and the
> +resource address for a system resource managed by a remote processor. The 
> data
> +is stored in a shared memory region and is loaded by the remote processor.
> +
> +Some of the Qualcomm Technologies Inc SoC's have hardware accelerators for
> +controlling shared resources. Depending on the board configuration the shared
> +resource properties may change. These properties are dynamically probed by 
> the
> +remote processor and made available in the shared memory.
> +
> +The devicetree representation of the command DB driver should be:
> +
> +PROPERTIES:
> +- compatible:
> + Usage: required
> + Value type: 
> + Definition: Should be "qcom,cmd-db"
> +
> +- memory-region:
> + Usage: required
> + Value type: 
> + Definition: The phandle to the reserved memory region.
> +
> +Example:
> +
> + reserved-memory {
> + [...]
> + cmd_db_mem: qcom,cmd-db@c3f000c {
> + reg = <0x0 0xc3f000c 0x0 0x8>;

I was hoping that we can describe the actual memory here, as I got the
impression that it will also be a chunk of memory carved out from System
RAM.

If not it would seem unlikely that there's a 8 byte carveout in the
middle of DDR, what else is here?

> + };
> + };
> +
> + qcom,cmd-db@c3f000c {
> + compatible = "qcom,cmd-db";

Add "qcom,cmd-db" to "reserved_mem_matches" in drivers/of/platform.c,
use of_reserved_mem_lookup(pdev->dev.of_node) to get the reserved_mem
and you can just put the compatible directly on the reserved-memory
node.

That way you don't need this separate node that doesn't really represent
anything.

> + memory-region = <_db_mem>;
> + };

Regards,
Bjorn


Re: [PATCH v2 2/2] dt-bindings: introduce Command DB for QCOM SoCs

2018-02-14 Thread Bjorn Andersson
On Thu 08 Feb 11:51 PST 2018, Lina Iyer wrote:

> From: Mahesh Sivasubramanian 
> 
> Command DB provides information on shared resources like clocks,
> regulators etc., probed at boot by the remote subsytem and made
> available in shared memory.
> 
> Cc: devicet...@vger.kernel.org
> Signed-off-by: Mahesh Sivasubramanian 
> Signed-off-by: Lina Iyer 
> ---
>  .../devicetree/bindings/arm/msm/cmd-db.txt | 38 
> ++
>  1 file changed, 38 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/arm/msm/cmd-db.txt
> 
> diff --git a/Documentation/devicetree/bindings/arm/msm/cmd-db.txt 
> b/Documentation/devicetree/bindings/arm/msm/cmd-db.txt
> new file mode 100644
> index ..e21666e40ebf
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/arm/msm/cmd-db.txt
> @@ -0,0 +1,38 @@
> +Command DB
> +-
> +
> +Command DB is a database that provides a mapping between resource key and the
> +resource address for a system resource managed by a remote processor. The 
> data
> +is stored in a shared memory region and is loaded by the remote processor.
> +
> +Some of the Qualcomm Technologies Inc SoC's have hardware accelerators for
> +controlling shared resources. Depending on the board configuration the shared
> +resource properties may change. These properties are dynamically probed by 
> the
> +remote processor and made available in the shared memory.
> +
> +The devicetree representation of the command DB driver should be:
> +
> +PROPERTIES:
> +- compatible:
> + Usage: required
> + Value type: 
> + Definition: Should be "qcom,cmd-db"
> +
> +- memory-region:
> + Usage: required
> + Value type: 
> + Definition: The phandle to the reserved memory region.
> +
> +Example:
> +
> + reserved-memory {
> + [...]
> + cmd_db_mem: qcom,cmd-db@c3f000c {
> + reg = <0x0 0xc3f000c 0x0 0x8>;

I was hoping that we can describe the actual memory here, as I got the
impression that it will also be a chunk of memory carved out from System
RAM.

If not it would seem unlikely that there's a 8 byte carveout in the
middle of DDR, what else is here?

> + };
> + };
> +
> + qcom,cmd-db@c3f000c {
> + compatible = "qcom,cmd-db";

Add "qcom,cmd-db" to "reserved_mem_matches" in drivers/of/platform.c,
use of_reserved_mem_lookup(pdev->dev.of_node) to get the reserved_mem
and you can just put the compatible directly on the reserved-memory
node.

That way you don't need this separate node that doesn't really represent
anything.

> + memory-region = <_db_mem>;
> + };

Regards,
Bjorn