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