* Extending /memreserve/ to allow defining descriptions @ 2017-03-04 21:40 Florian Fainelli [not found] ` <9c1cb5e8-2afd-e266-72b9-20ca6622956e-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Florian Fainelli @ 2017-03-04 21:40 UTC (permalink / raw) To: devicetree-spec-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: Rob Herring, david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+, glikely-s3s/WqlpOiPyB63q8FvJNQ Hello, I am considering extending the /memreserve node syntax with the ability to pass a description string that would be describing what kind of memory is being reserved here, e:g: /memreserve/ 0x0 0x10000 type = "psci" The rationale would be for a client program to be able to list these reserved regions e.g: from /proc/iomem in a way that could be made available to other applications. What do you think? -- Florian -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <9c1cb5e8-2afd-e266-72b9-20ca6622956e-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: Extending /memreserve/ to allow defining descriptions [not found] ` <9c1cb5e8-2afd-e266-72b9-20ca6622956e-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2017-03-06 3:58 ` David Gibson [not found] ` <20170306035856.GF12030-K0bRW+63XPQe6aEkudXLsA@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: David Gibson @ 2017-03-06 3:58 UTC (permalink / raw) To: Florian Fainelli Cc: devicetree-spec-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Rob Herring, glikely-s3s/WqlpOiPyB63q8FvJNQ [-- Attachment #1: Type: text/plain, Size: 2224 bytes --] On Sat, Mar 04, 2017 at 01:40:39PM -0800, Florian Fainelli wrote: > Hello, > > I am considering extending the /memreserve node syntax with the ability > to pass a description string that would be describing what kind of > memory is being reserved here, e:g: > > /memreserve/ 0x0 0x10000 type = "psci" > > The rationale would be for a client program to be able to list these > reserved regions e.g: from /proc/iomem in a way that could be made > available to other applications. > > What do you think? Suggestions like this have come up before, and I think it's a bad idea. First of all, note that it's not merely a matter of extending the dtc syntax - you'd need to add a way of encoding the extra labels into the flattened format as well. Second, the reserve list as a separate piece of the flattened tree exists for one reason: to allow really early boot code to exclude memory regions it needs to without having to parse the flat tree. Labels and other additional information doesn't help that purpose. BenH (who created the flattened tree format) has opined that having memory reserves as a separate structure (rather than properties within the tree) was probably a design error. Most fundamentally, there isn't always a clear 1:1 correspondance between each memory region and a single specific purpose. For example, firmware could reserve a single region which is uses for several purposes. What you could do is to add properties within the device tree further annotating the reservations, with the extra structure essentially just acting as an easy-to-parse summary of that. In fact I know that POWER systems firmware use 'reserved-ranges' and 'reserved-names' properties for this. I don't know if anyone else has adopted that though. I would certainly be willing to look at patches to have dtc verify the /memreserve/ statements against such properties, or to autogenerate the reserved table from the properties, instead of from explicit /memreserve/ statements. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <20170306035856.GF12030-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>]
* Re: Extending /memreserve/ to allow defining descriptions [not found] ` <20170306035856.GF12030-K0bRW+63XPQe6aEkudXLsA@public.gmane.org> @ 2017-03-06 23:28 ` Stewart Smith [not found] ` <87r32a6l43.fsf-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Stewart Smith @ 2017-03-06 23:28 UTC (permalink / raw) To: David Gibson, Florian Fainelli Cc: devicetree-spec-u79uwXL29TY76Z2rM5mHXA, devicetree@vger.kernel.org, Rob Herring, glikely-s3s/WqlpOiPyB63q8FvJNQ David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org> writes: > What you could do is to add properties within the device tree further > annotating the reservations, with the extra structure essentially just > acting as an easy-to-parse summary of that. In fact I know that POWER > systems firmware use 'reserved-ranges' and 'reserved-names' properties > for this. I don't know if anyone else has adopted that though. We've also been toying with the idea of creating a binding for "named reserved memory range that should probably show up in debugfs" I'd also be happy with a standard binding to do it. -- Stewart Smith OPAL Architect, IBM. ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <87r32a6l43.fsf-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>]
* Re: Extending /memreserve/ to allow defining descriptions [not found] ` <87r32a6l43.fsf-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> @ 2017-03-07 0:12 ` Florian Fainelli [not found] ` <fba988e1-40a0-4a7e-e680-45c7360c5aa3-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Florian Fainelli @ 2017-03-07 0:12 UTC (permalink / raw) To: Stewart Smith, David Gibson Cc: devicetree-spec-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Rob Herring, glikely-s3s/WqlpOiPyB63q8FvJNQ On 03/06/2017 03:28 PM, Stewart Smith wrote: > David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org> writes: >> What you could do is to add properties within the device tree further >> annotating the reservations, with the extra structure essentially just >> acting as an easy-to-parse summary of that. In fact I know that POWER >> systems firmware use 'reserved-ranges' and 'reserved-names' properties >> for this. I don't know if anyone else has adopted that though. > > We've also been toying with the idea of creating a binding for "named > reserved memory range that should probably show up in debugfs" > > I'd also be happy with a standard binding to do it. Seems like Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt may be a good place to add descriptive properties about what these reserved regions are? The code parsing this also seems to be easily extensible with adding custom "name" properties. Using "reserved-names" sounds like a good thing, I will be looking into submitting a binding update in the next few days, but if you beat me to it, happy to review it. Tangential: is it me, or it's possible for /memreserve/'s address and size cells to disagree with #address-cells and #size-cells defined by the top-level node? -- Florian ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <fba988e1-40a0-4a7e-e680-45c7360c5aa3-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: Extending /memreserve/ to allow defining descriptions [not found] ` <fba988e1-40a0-4a7e-e680-45c7360c5aa3-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2017-03-07 1:04 ` Grant Likely 2017-03-07 2:21 ` David Gibson 1 sibling, 0 replies; 6+ messages in thread From: Grant Likely @ 2017-03-07 1:04 UTC (permalink / raw) To: Florian Fainelli Cc: Stewart Smith, David Gibson, devicetree-spec-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Rob Herring On Tue, Mar 7, 2017 at 1:12 AM, Florian Fainelli <f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > On 03/06/2017 03:28 PM, Stewart Smith wrote: >> David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org> writes: >>> What you could do is to add properties within the device tree further >>> annotating the reservations, with the extra structure essentially just >>> acting as an easy-to-parse summary of that. In fact I know that POWER >>> systems firmware use 'reserved-ranges' and 'reserved-names' properties >>> for this. I don't know if anyone else has adopted that though. >> >> We've also been toying with the idea of creating a binding for "named >> reserved memory range that should probably show up in debugfs" >> >> I'd also be happy with a standard binding to do it. > > Seems like > Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt > may be a good place to add descriptive properties about what these > reserved regions are? The code parsing this also seems to be easily > extensible with adding custom "name" properties. > > Using "reserved-names" sounds like a good thing, I will be looking into > submitting a binding update in the next few days, but if you beat me to > it, happy to review it. > > Tangential: is it me, or it's possible for /memreserve/'s address and > size cells to disagree with #address-cells and #size-cells defined by > the top-level node? /memreserve/ is a shortcut to tell the kernel during very early boot to keep its paws of certain ranges of memory. Don't try to extend it into anything more. The reserved-memory.txt binding is the place to put tags and/or names on memory regions. g. -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Extending /memreserve/ to allow defining descriptions [not found] ` <fba988e1-40a0-4a7e-e680-45c7360c5aa3-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2017-03-07 1:04 ` Grant Likely @ 2017-03-07 2:21 ` David Gibson 1 sibling, 0 replies; 6+ messages in thread From: David Gibson @ 2017-03-07 2:21 UTC (permalink / raw) To: Florian Fainelli Cc: Stewart Smith, devicetree-spec-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Rob Herring, glikely-s3s/WqlpOiPyB63q8FvJNQ [-- Attachment #1: Type: text/plain, Size: 1701 bytes --] On Mon, Mar 06, 2017 at 04:12:59PM -0800, Florian Fainelli wrote: > On 03/06/2017 03:28 PM, Stewart Smith wrote: > > David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org> writes: > >> What you could do is to add properties within the device tree further > >> annotating the reservations, with the extra structure essentially just > >> acting as an easy-to-parse summary of that. In fact I know that POWER > >> systems firmware use 'reserved-ranges' and 'reserved-names' properties > >> for this. I don't know if anyone else has adopted that though. > > > > We've also been toying with the idea of creating a binding for "named > > reserved memory range that should probably show up in debugfs" > > > > I'd also be happy with a standard binding to do it. > > Seems like > Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt > may be a good place to add descriptive properties about what these > reserved regions are? The code parsing this also seems to be easily > extensible with adding custom "name" properties. > > Using "reserved-names" sounds like a good thing, I will be looking into > submitting a binding update in the next few days, but if you beat me to > it, happy to review it. > > Tangential: is it me, or it's possible for /memreserve/'s address and > size cells to disagree with #address-cells and #size-cells defined by > the top-level node? /memreserve/ has no address or size cells; they're simply 64-bit integers. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-03-07 2:21 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-03-04 21:40 Extending /memreserve/ to allow defining descriptions Florian Fainelli [not found] ` <9c1cb5e8-2afd-e266-72b9-20ca6622956e-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2017-03-06 3:58 ` David Gibson [not found] ` <20170306035856.GF12030-K0bRW+63XPQe6aEkudXLsA@public.gmane.org> 2017-03-06 23:28 ` Stewart Smith [not found] ` <87r32a6l43.fsf-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> 2017-03-07 0:12 ` Florian Fainelli [not found] ` <fba988e1-40a0-4a7e-e680-45c7360c5aa3-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2017-03-07 1:04 ` Grant Likely 2017-03-07 2:21 ` David Gibson
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).