devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Question regarding "reserved-memory"
@ 2019-10-24 14:22 Ayan Halder
  2019-10-24 14:51 ` Rob Herring
  0 siblings, 1 reply; 3+ messages in thread
From: Ayan Halder @ 2019-10-24 14:22 UTC (permalink / raw)
  To: robh+dt@kernel.org, Mark Rutland, devicetree@vger.kernel.org,
	m.szyprowski@samsung.com
  Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Liviu Dudau, Mihail Atanassov,
	james qian wang (Arm Technology China), Brian Starkey, nd


Hi Folks,

I have a question regarding "reserved-memory". I am using an Arm Juno
platform which has a chunk of ram in its fpga. I intend to make this
memory as reserved so that it can be shared between various devices
for passing framebuffer.

My dts looks like the following:-

/ {
        .... // some nodes

        tlx@60000000 {
                compatible = "simple-bus";
                ...

                juno_wrapper {

                        ... /* here we have all the nodes */
                            /* corresponding to the devices in the fpga */

                        memory@d000000 {
                               device_type = "memory";
                               reg = <0x00 0x60000000 0x00 0x8000000>;
                        };

                        reserved-memory {
                               #address-cells = <0x01>;
                               #size-cells = <0x01>;
                               ranges;

                               framebuffer@d000000 {
                                        compatible = "shared-dma-pool";
                                        linux,cma-default;
                                        reusable;
                                        reg = <0x00 0x60000000 0x00 0x8000000>;
                                        phandle = <0x44>;
                                };
                        };
                        ...
                }
        }
...
}

Note that the depth of the "reserved-memory" node is 3.

Refer __fdt_scan_reserved_mem() :-

        if (!found && depth == 1 && strcmp(uname, "reserved-memory") == 0) {

                if (__reserved_mem_check_root(node) != 0) {
                        pr_err("Reserved memory: unsupported node
format, ignoring\n");
                        /* break scan */
                        return 1;
                }
                found = 1;

                /* scan next node */
                return 0;
        }

It expects the "reserved-memory" node to be at depth == 1 and so it
does not probe it in our case.

Niether from the
Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
 nor from commit - e8d9d1f5485b52ec3c4d7af839e6914438f6c285,
I could understand the reason for such restriction.

So, I seek the community's advice as to whether I should fix up
__fdt_scan_reserved_mem() so as to do away with the restriction or
put the "reserved-memory" node outside of 'tlx@60000000' (which looks
 logically incorrect as the memory is on the fpga platform).


Thanks,
Ayan


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

end of thread, other threads:[~2019-10-24 15:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-24 14:22 Question regarding "reserved-memory" Ayan Halder
2019-10-24 14:51 ` Rob Herring
2019-10-24 15:19   ` Ayan Halder

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).