Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1359744 > unrolled thread

Re: [RESEND RFC 3/3] nvmem: Add 'nvmem-composite' driver

Started bySrinivas Kandagatla <srinivas.kandagatla@linaro.org>
First post2016-03-17 12:30 +0100
Last post2016-03-21 18:00 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [RESEND RFC 3/3] nvmem: Add 'nvmem-composite' driver Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2016-03-17 12:30 +0100
    Re: [RESEND RFC 3/3] nvmem: Add 'nvmem-composite' driver Andrey Smirnov <andrew.smirnov@gmail.com> - 2016-03-21 17:20 +0100
      Re: [RESEND RFC 3/3] nvmem: Add 'nvmem-composite' driver Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2016-03-21 18:00 +0100

#1359744 — Re: [RESEND RFC 3/3] nvmem: Add 'nvmem-composite' driver

FromSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Date2016-03-17 12:30 +0100
SubjectRe: [RESEND RFC 3/3] nvmem: Add 'nvmem-composite' driver
Message-ID<rdEhP-6LW-1@gated-at.bofh.it>

On 02/03/16 18:33, Andrey Smirnov wrote:
> On Wed, Mar 2, 2016 at 5:59 AM, Srinivas Kandagatla
> <srinivas.kandagatla@linaro.org> wrote:
>>
>> On 01/03/16 16:59, Andrey Smirnov wrote:
>>>
>>> Add 'nvmem-composite' driver which allows to combine multiple chunks of
>>> various NVMEM cells into a single continuous NVMEM device.
>>
>>
>> My plan on this feature was add support inside the nvmem_cell_get itself,
>> this makes the nvmem bindings more inline with bindings like pinctrl.
>> Also I still want to keep nvmem simple as it can.
>
> That's perfectly fine with me, I can change my patch to do that. My
> thinking on implementing it as a standalone module was that this seems
> to be a very niche functionality which not a lot of people would use,
> so the code would be a part of your kernel only if you directly use
> this feature.
>
>>
>> DT would look something like this.
>>
>> nvmem-provider-a {
>>          cell_a {
>>                  reg = <0 2>;
>>          };
>> };
>>
>> nvmem-provider-b {
>>          cell_b: cell_c {
>>                  reg = <0 1>;
>>          };
>> };
>>
>> nvmem-provider-c {
>>          cell_c: cell_c {
>>                  reg = <3 2>;
>>          }
>> };
>>
>> a-node {
>>          nvmem-cells = <&cell_a &cell_b &cell_c>
>>          nvmem-cell-names = "some-data";
>> };
>>
>
> It's not very clear to me, possibly to my DT ignorance, how this would
> handle the case of multiple variables. Say we have
>
> a-node {
>           nvmem-cells = <&cell_a &cell_b>, ????;
>           nvmem-cell-names = "some-data", "more-data";
> };
>
Should have replied you long back :-)
> and I want "more-data" to reference only one phandle, how would this be handled?
>
yes this would fail.

The device tree compiler would concatenate all the cells and we have no 
means to know where did "more-data" starts.

sounds like composite driver is the way forward.


--srini
> Another minor nitpick about his is that if one's goal is to just
> byteswap already defined nvmem_cell:
>    - N, where N is the length of the variable, new nvmem cells would
> have to be defined
>    - All of them would have to use absolute address within the nvmem
> provided, instead of referencing a byte relative to the position of
> pre-defined cell
>
> Thanks,
> Andrey
>

[toc] | [next] | [standalone]


#1361964

FromAndrey Smirnov <andrew.smirnov@gmail.com>
Date2016-03-21 17:20 +0100
Message-ID<rfaIF-8aj-5@gated-at.bofh.it>
In reply to#1359744
>> a-node {
>>           nvmem-cells = <&cell_a &cell_b>, ????;
>>           nvmem-cell-names = "some-data", "more-data";
>> };
>>
> Should have replied you long back :-)

No worries :-)

>>
>> and I want "more-data" to reference only one phandle, how would this be
>> handled?
>>
> yes this would fail.
>
> The device tree compiler would concatenate all the cells and we have no
> means to know where did "more-data" starts.
>
> sounds like composite driver is the way forward.

What's your preference on "separate driver" vs. "part of the NVMEM
framework"? Should I keep it as a separate driver or try to fold it
into NVMEM core?

Thanks,
Andrey

[toc] | [prev] | [next] | [standalone]


#1361994

FromSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Date2016-03-21 18:00 +0100
Message-ID<rfblo-8qY-13@gated-at.bofh.it>
In reply to#1361964

On 21/03/16 16:12, Andrey Smirnov wrote:
>>> a-node {
>>>            nvmem-cells = <&cell_a &cell_b>, ????;
>>>            nvmem-cell-names = "some-data", "more-data";
>>> };
>>>
>> Should have replied you long back :-)
>
> No worries :-)
>
>>>
>>> and I want "more-data" to reference only one phandle, how would this be
>>> handled?
>>>
>> yes this would fail.
>>
>> The device tree compiler would concatenate all the cells and we have no
>> means to know where did "more-data" starts.
>>
>> sounds like composite driver is the way forward.
>
> What's your preference on "separate driver" vs. "part of the NVMEM
> framework"? Should I keep it as a separate driver or try to fold it
> into NVMEM core?

It does not make sense to have this driver as a separate nvmem provider, 
can you fold it in the nvmem core itself for now.


Thanks,
srini
>
> Thanks,
> Andrey
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web