From: Murali Karicheri <m-karicheri2@ti.com>
To: Roger Quadros <rogerq@ti.com>, Tony Lindgren <tony@atomide.com>,
s-anna@ti.com
Cc: ohad@wizery.com, bjorn.andersson@linaro.org,
david@lechnology.com, nsekhar@ti.com, t-kristo@ti.com,
nsaulnier@ti.com, jreeder@ti.com, woods.technical@gmail.com,
linux-omap@vger.kernel.org, linux-remoteproc@vger.kernel.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 01/14] dt-bindings: remoteproc: Add TI PRUSS bindings
Date: Tue, 5 Feb 2019 11:15:13 -0500 [thread overview]
Message-ID: <124e9f09-fb60-071d-e2ba-ec6f7fb3955c@ti.com> (raw)
In-Reply-To: <5C59AEA3.1080400@ti.com>
Roger,
On 02/05/2019 10:41 AM, Roger Quadros wrote:
> Murali,
>
> On 05/02/19 17:08, Murali Karicheri wrote:
>> Hi Roger,
>>
>> On 02/05/2019 04:39 AM, Roger Quadros wrote:
>>> Hi Tony & Suman,
>>>
>>> On 04/02/19 18:33, Tony Lindgren wrote:
>>>> Hi,
>>>>
>>>> * Roger Quadros <rogerq@ti.com> [190204 14:23]:
>>>>> From: Suman Anna <s-anna@ti.com>
>>>> ...
>>>>> +Example:
>>>>> +========
>>>>> +1. /* AM33xx PRU-ICSS */
>>>>> +
>>>>> + pruss: pruss@0 {
>>>>> + compatible = "ti,am3356-pruss";
>>>>> + reg = <0x0 0x2000>,
>>>>> + <0x2000 0x2000>,
>>>>> + <0x10000 0x3000>;
>>>>> + reg-names = "dram0", "dram1",
>>>>> + "shrdram2";
>>>>> + #address-cells = <1>;
>>>>> + #size-cells = <1>;
>>>>> + ranges;
>>>>
>>>> Thanks for fixing up the reg ranges for the top level node.
>>>>
>>>> Ideally there would not even be a top level node here as
>>>> AFAIK the whole PRUSS is a collection of devices on a PRU
>>>> internal interconnect. So following that path a bit further..
>>>> How about just get rid of the top level node and just do:
>>>>
>>>> pruss: pruss@0 {
>>>> dram0: memory@0 {
>>>> device_type = "memory";
>>>> reg = <0x0 0x2000>;
>>>> };
>>>>
>>>> dram1: memory@2000 {
>>>> device_type = "memory";
>>>> reg = <0x2000 0x2000>;
>>>> };
>>>
>>> Actually dram0 and dram1 are data memories for PRU0 and PRU1 respectively.
>>> Isn't it better if they are moved to the pru node?
>>> e.g.
>>>
>>> pru0: pru@34000 {
>>> compatible = "ti,am3356-pru";
>>> reg = <0x34000 0x2000>,
>>> <0x22000 0x400>,
>>> <0x22400 0x100>,
>>> <0x0 0x2000>;
>>> reg-names = "iram", "control", "debug", "dram";
>>> ...
>>> };
>>>
>>> pru1: pru@38000 {
>>> compatible = "ti,am3356-pru";
>>> reg = <0x38000 0x2000>,
>>> <0x24000 0x400>,
>>> <0x24400 0x100>,
>>> <0x2000 0x2000>;
>>> reg-names = "iram", "control", "debug", "dram";
>>> ...
>>> };
>>>
>>> I think it is better to place a restriction that firmware on PRU0 cannot use data
>>> memory of PRU1 and vice versa.
>>>
>> That will not work as there are switch firmware cases where PRU access
>> DRAM of other PRU and is a valid case to support in the future. So let
>> us not do that.
>
> PRU firmware accessing DRAM of other PRU is a design contract and that use case
> requires both PRUs to be loaded with matching firmware. That should continue to work.
>
> What I'm suggesting here is that kernel remoteproc driver should have nothing to do
> with the other PRU's data RAM.
>
> The application driver if needs both PRUs then it can obviously access both DRAMs
> as it has a phandle to both PRUs.
>
That should be fine.
Regards,
Murali
> cheers,
> -roger
>
>>
>> Murali
>>> Application drivers do sometimes need to read/write to data memory. The pru_rproc
>>> driver could provide a API for the application drivers to get virtual address of
>>> the respective PRU's data memory.
>>>
>>>>
>>>> shrdram2: memory@10000 {
>>>> device_type = "memory";
>>>> reg = <0x10000 0x3000>;
>>>> };
>>>
>>> Shared RAM is not so straight forward. Both PRU firmwares and both application drivers
>>> might need to read/write here. The area split is decided by firmware design and there
>>> is no hardware protection to prevent from stomping on each others toes.
>>>
>>> We need a carveout based memory allocator at least I think that can do a
>>> allocate(base_offset, size); into shared RAM.
>>>
>>> This could be used by pru_rproc driver at firmware load time and by application drivers
>>> at initialization time.
>>>
>>> Thoughts?
>>>
>>>>
>>>> pruss_cfg: cfg@26000 {
>>>> ...
>>>> };
>>>> ...
>>>> };
>>>>
>>>> If the device_type = "memory" cannot be used here for
>>>> being specific to the top level properties, then
>>>> there's probably some other generic property usable
>>>> here :)
>>>>
>>>>> + pruss_mii_rt: mii_rt@32000 {
>>>>> + reg = <0x32000 0x58>;
>>>>> + };
>>>>
>>>> The node name should not have underscores so
>>>> pruss_mii_rt: mii-rt@32000. Please check the others
>>>> too, like app_node.
>>>>
>>>
>>> OK.
>>>
>>>>> + app_node: app_node {
>>>>> + prus = <&pru0>, <&pru1>;
>>>>> + firmware-name = "pruss-app-fw", "pruss-app-fw-2";
>>>>> + ti,pruss-gp-mux-sel = <2>, <1>;
>>>>> + /* setup interrupts for prus:
>>>>> + prus[0] => pru1_0: ev=16, chnl=2, host-irq=7,
>>>>> + prus[1] => pru1_1: ev=19, chnl=1, host-irq=3 */
>>>>> + ti,pru-interrupt-map = <0 16 2 7 >, <1 19 1 3>;
>>>>> + }
>>>>
>>>> If the ti,pruss-gp-mux-sel and ti,pru-interrupt-map are
>>>> firmware configuration options, maybe leave them out of
>>>> the dts completely and make the app-node optional.
>>>
>>> Yes the app-node is optional. I will mention it.
>>>
>>> No, ti,pruss-gp-mux-sel and ti,pru-interrupt-map are not firmware options.
>>> But these settings are application/firmware specific.
>>>
>>> ti,pru-interrupt-map specifies the configuration to be used for the INTC interrupt
>>> controller.
>>>
>>> ti,pruss-gp-mux-sel is used to configure this register.
>>> "Table 30-20. PRUSS_GPCFG0" in http://www.tij.co.jp/jp/lit/ug/spruhz7h/spruhz7h.pdf
>>> "29:26 PR1_PRU0_GP_MUX_SEL"
>>>
>>> It configures how the pins from the PRUSS module are routed internally
>>> to the various modules.
>>>
>>> see "30.2.1 PRU-ICSS I/O Interface"
>>> and "Table 30-1. PRU-ICSS1 I/O Signals"
>>>
>>>>
>>>> And have a proper compatible for this node such as
>>>> "ti,pruss-app-xyz". And this should be only set if the the
>>>> hardware is wired up in such way that things need to be
>>>> configured in the dts rather than by the firmware.
>>>
>>> Yes, compatible is a required property as we need to load
>>> the appropriate application (kernel space) driver for it.
>>> I will fix the example.
>>>
>>>>
>>>> And then you can just hide mux-sel and interrupt-map
>>>> behind the compatible property for that hardware. And
>>>> leave them out from the dts and have the handling driver
>>>> would set mux-sel and interrupt-map based on the
>>>> match->data during probe.
>>>
>>> To summarize:
>>>
>>> I'll mark the app node as optional. Only required if a kernel
>>> driver is required for the application.
>>> Compatible is mandatory for app node.
>>> ti,pruss-gp-mux-sel and ti,pru-interrupt-map are optional
>>> for app node.
>>>
>>> cheers,
>>> -roger
>>>
>
next prev parent reply other threads:[~2019-02-05 16:15 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-04 14:22 [PATCH v2 00/14] Add support for TI PRU ICSS Roger Quadros
2019-02-04 14:22 ` [PATCH v2 01/14] dt-bindings: remoteproc: Add TI PRUSS bindings Roger Quadros
2019-02-04 16:33 ` Tony Lindgren
2019-02-05 9:39 ` Roger Quadros
2019-02-05 15:08 ` Murali Karicheri
2019-02-05 15:41 ` Roger Quadros
2019-02-05 16:15 ` Murali Karicheri [this message]
2019-02-05 16:19 ` Tony Lindgren
2019-02-06 15:04 ` Roger Quadros
2019-02-14 2:47 ` Suman Anna
2019-02-05 16:41 ` Tony Lindgren
2019-02-14 3:01 ` Suman Anna
2019-02-08 13:51 ` Linus Walleij
2019-02-14 3:12 ` Suman Anna
2019-02-14 8:37 ` Linus Walleij
2019-02-14 10:55 ` Roger Quadros
[not found] ` <86ef8asfap.wl-marc.zyngier@arm.com>
2019-02-14 15:44 ` Roger Quadros
2019-02-14 15:48 ` Roger Quadros
2019-02-15 0:59 ` Suman Anna
2019-02-20 9:51 ` Linus Walleij
2019-02-14 15:51 ` Marc Zyngier
2019-02-14 16:50 ` Roger Quadros
2019-02-14 2:52 ` Suman Anna
2019-02-14 11:08 ` Roger Quadros
2019-02-14 15:56 ` Tony Lindgren
2019-02-15 1:22 ` Suman Anna
2019-02-15 1:08 ` Suman Anna
2019-02-15 13:43 ` Matthijs van Duin
2019-02-04 14:22 ` [PATCH v2 02/14] soc: ti: pruss: Add a platform driver for PRUSS in TI SoCs Roger Quadros
2019-02-04 14:52 ` Andrew F. Davis
2019-02-04 15:32 ` Roger Quadros
2019-02-04 16:35 ` Tony Lindgren
2019-02-04 14:22 ` [PATCH v2 03/14] dt-binding: irqchip: Add pruss-intc-irq driver for PRUSS interrupts Roger Quadros
2019-02-04 16:36 ` Tony Lindgren
2019-02-14 2:40 ` Suman Anna
2019-02-18 19:32 ` Rob Herring
2019-02-04 14:22 ` [PATCH v2 04/14] irqchip: pruss: Add a PRUSS irqchip " Roger Quadros
2019-02-04 15:11 ` Andrew F. Davis
2019-02-04 15:33 ` Roger Quadros
2019-02-05 8:51 ` Roger Quadros
2019-02-14 2:15 ` Suman Anna
2019-02-04 18:15 ` Tony Lindgren
2019-02-05 10:35 ` Roger Quadros
2019-02-05 11:04 ` Marc Zyngier
2019-02-14 2:16 ` Suman Anna
2019-02-04 14:22 ` [PATCH v2 05/14] remoteproc: add map parameter to da_to_va Roger Quadros
2019-02-04 14:22 ` [PATCH v2 06/14] remoteproc: add page lookup for TI PRU to ELF loader Roger Quadros
2019-02-04 15:19 ` Andrew F. Davis
2019-02-14 2:22 ` Suman Anna
2019-02-04 14:22 ` [PATCH v2 07/14] remoteproc: Add a rproc_set_firmware() API Roger Quadros
2019-02-04 14:22 ` [PATCH v2 08/14] remoteproc: Add support to handle device specific resource types Roger Quadros
2019-02-04 14:22 ` [PATCH v2 09/14] dt-binding: remoteproc: Add binding doc for PRU Cores in the PRU-ICSS Roger Quadros
2019-02-18 19:36 ` Rob Herring
2019-02-04 14:22 ` [PATCH v2 10/14] remoteproc/pru: Add PRU remoteproc driver Roger Quadros
2019-02-14 2:35 ` Suman Anna
2019-02-14 3:44 ` Suman Anna
2019-02-04 14:22 ` [PATCH v2 11/14] remoteproc/pru: Add pru_rproc_set_ctable() and pru_rproc_set_gpimode() Roger Quadros
2019-02-04 14:22 ` [PATCH v2 12/14] remoteproc/pru: Add support for virtio rpmsg stack Roger Quadros
2019-02-04 14:22 ` [PATCH v2 13/14] rpmsg: virtio_rpmsg_bus: move back rpmsg_hdr into a public header Roger Quadros
2019-02-04 14:22 ` [PATCH v2 14/14] rpmsg: pru: add a PRU RPMsg driver Roger Quadros
2019-02-04 15:26 ` Andrew F. Davis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=124e9f09-fb60-071d-e2ba-ec6f7fb3955c@ti.com \
--to=m-karicheri2@ti.com \
--cc=bjorn.andersson@linaro.org \
--cc=david@lechnology.com \
--cc=devicetree@vger.kernel.org \
--cc=jreeder@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=nsaulnier@ti.com \
--cc=nsekhar@ti.com \
--cc=ohad@wizery.com \
--cc=rogerq@ti.com \
--cc=s-anna@ti.com \
--cc=t-kristo@ti.com \
--cc=tony@atomide.com \
--cc=woods.technical@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).