All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ayan Halder <Ayan.Halder@arm.com>
To: "robh+dt@kernel.org" <robh+dt@kernel.org>,
	Mark Rutland <Mark.Rutland@arm.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"m.szyprowski@samsung.com" <m.szyprowski@samsung.com>
Cc: "dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Liviu Dudau <Liviu.Dudau@arm.com>,
	Mihail Atanassov <Mihail.Atanassov@arm.com>,
	"james qian wang (Arm Technology China)"
	<james.qian.wang@arm.com>, Brian Starkey <Brian.Starkey@arm.com>,
	nd <nd@arm.com>
Subject: Question regarding "reserved-memory"
Date: Thu, 24 Oct 2019 14:22:17 +0000	[thread overview]
Message-ID: <20191024142211.GA29467@arm.com> (raw)


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


WARNING: multiple messages have this Message-ID (diff)
From: Ayan Halder <Ayan.Halder@arm.com>
To: "robh+dt@kernel.org" <robh+dt@kernel.org>,
	Mark Rutland <Mark.Rutland@arm.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"m.szyprowski@samsung.com" <m.szyprowski@samsung.com>
Cc: nd <nd@arm.com>, Liviu Dudau <Liviu.Dudau@arm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"james qian wang (Arm Technology China)"
	<james.qian.wang@arm.com>,
	Mihail Atanassov <Mihail.Atanassov@arm.com>
Subject: Question regarding "reserved-memory"
Date: Thu, 24 Oct 2019 14:22:17 +0000	[thread overview]
Message-ID: <20191024142211.GA29467@arm.com> (raw)


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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Ayan Halder <Ayan.Halder@arm.com>
To: "robh+dt@kernel.org" <robh+dt@kernel.org>,
	Mark Rutland <Mark.Rutland@arm.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"m.szyprowski@samsung.com" <m.szyprowski@samsung.com>
Cc: nd <nd@arm.com>, Liviu Dudau <Liviu.Dudau@arm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"james qian wang \(Arm Technology China\)"
	<james.qian.wang@arm.com>,
	Mihail Atanassov <Mihail.Atanassov@arm.com>
Subject: Question regarding "reserved-memory"
Date: Thu, 24 Oct 2019 14:22:17 +0000	[thread overview]
Message-ID: <20191024142211.GA29467@arm.com> (raw)
Message-ID: <20191024142217.5kKNQiQNdGjS-R1_MB3Phx8DF3kuUj66EyNxzrOQiYk@z> (raw)


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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2019-10-24 14:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-24 14:22 Ayan Halder [this message]
2019-10-24 14:22 ` Question regarding "reserved-memory" Ayan Halder
2019-10-24 14:22 ` Ayan Halder
2019-10-24 14:51 ` Rob Herring
2019-10-24 14:51   ` Rob Herring
2019-10-24 14:51   ` Rob Herring
2019-10-24 15:19   ` Ayan Halder
2019-10-24 15:19     ` Ayan Halder
2019-10-24 15:19     ` Ayan Halder

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=20191024142211.GA29467@arm.com \
    --to=ayan.halder@arm.com \
    --cc=Brian.Starkey@arm.com \
    --cc=Liviu.Dudau@arm.com \
    --cc=Mark.Rutland@arm.com \
    --cc=Mihail.Atanassov@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=james.qian.wang@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=nd@arm.com \
    --cc=robh+dt@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.