From: Srinivas Kandagatla <srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Stefan Wahren <stefan.wahren-eS4NqCHxEME@public.gmane.org>,
Greg Kroah-Hartman
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc: wxt-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
arnd-r2nGTMty4D4@public.gmane.org,
sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
mporter-OWPKS81ov/FWk0Htik3J/w@public.gmane.org,
pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org,
ezequiel-30ULvvUtt6G51wMPkGsGjgyUoB5FGQPZ@public.gmane.org,
Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v7 0/9] Add simple NVMEM Framework via regmap.
Date: Mon, 13 Jul 2015 22:39:46 +0100 [thread overview]
Message-ID: <55A43022.5040000@linaro.org> (raw)
In-Reply-To: <139301016.164015.1436818270753.JavaMail.open-xchange-0SF9iQWekqKZU4JK52HgGMgmgJlYmuWJ@public.gmane.org>
On 13/07/15 21:11, Stefan Wahren wrote:
> Hi Srinivas,
>
>> Srinivas Kandagatla <srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> hat am 13. Juli 2015 um
>> 21:35 geschrieben:
>>
>> On 13/07/15 19:54, Stefan Wahren wrote:
>>> Hi Srinivas,
>>>
>>>> [...]
>>>>
>>>> Providers APIs:
>>>> nvmem_register/unregister();
>>>
>>> How do i get the cell info from the devicetree into the nvmem_config?
>>>
>> Not sure what is the real use-case here, But this is how it is supposed
>> to work.
>>
>> cellinfo in nvmem_config is used to pass cell information in non-dt
>> style to the core. The core would parse it and convert into nvmem-cells.
>> Am not sure why would you want to do other way round. Could you explain
>> the real use case here?
>>
>
> my question comes from porting mxs_ocotp to NVMEM framework.
>
> Here is the devicetree part:
>
> ocotp: ocotp@8002c000 {
> compatible = "fsl,imx28-ocotp", "fsl,ocotp";
> #address-cells = <1>;
> #size-cells = <1>;
> reg = <0x8002c000 0x2000>;
> clocks = <&clks 25>;
> read-only;
>
> /* Data cells */
> ocotp_customer: costumer@20 {
> reg = <0x20 0x10>;
> };
>
> ocotp_rom0: rom0@1a0 {
> reg = <0x1a0 0x4>;
> };
> };
>
> After calling nvmem_register() in the provider driver [1] no data cell is
> registered. So
> i looked at the core code and i thought that retrieving the cell info and put it
> into the nvmem_config
> is job of the provider driver.
>
> Did i missed something?
Ok,
There are 2 possible ways to specify nvmem cells
1> via the DT cell entries.
2> via provider driver directly using cell_info struct.
In the ocotp case its done via dt, so you dont need pass the cell info
in nvmem_config.
You should also note that cell structure in DT is only created when an
attempt to access is made as the provider lookup is straight forward in
this case. In non-DT case the cell structure is created immediately and
added to the global cell list.
--srini
>
> [1] -
> https://github.com/lategoodbye/fsl_ocotp/commit/7c98e19755b69f761885b0e1ceb2c258a7c47ade
>
>>
>>
>>>
>> ...
>>
>>>> userspace interface: binary file in /sys/bus/nvmem/devices/*/nvmem
>>>>
>>>> ex:
>>>> hexdump /sys/bus/nvmem/devices/qfprom0/nvmem
>>>>
>>>> 0000000 0000 0000 0000 0000 0000 0000 0000 0000
>>>> *
>>>> 00000a0 db10 2240 0000 e000 0c00 0c00 0000 0c00
>>>> 0000000 0000 0000 0000 0000 0000 0000 0000 0000
>>>> ...
>>>> *
>>>> 0001000
>>>
>>> Since we're entering userspace the behavior should be clear.
>>>
>>> How do we treat register gaps? Fill them with zero?
>> nvmem file would read full nvmem size which is passed to it as regmap.
>> So It would dump whatever the provider returns.
>
> Sure, but wouldn't it be nice if different provider behave the same?
>
>>
>>
>> --srini
>>>
>>> Best regards
>>> Stefan
>>>
next prev parent reply other threads:[~2015-07-13 21:39 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-10 9:43 [PATCH v7 0/9] Add simple NVMEM Framework via regmap Srinivas Kandagatla
2015-07-10 9:44 ` [PATCH v7 2/9] nvmem: Add a simple NVMEM framework for consumers Srinivas Kandagatla
[not found] ` <1436521495-10728-1-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-07-10 10:42 ` Joe Perches
2015-07-13 19:06 ` Stefan Wahren
2015-07-13 19:24 ` Srinivas Kandagatla
2015-07-10 9:45 ` [PATCH v7 3/9] nvmem: Add nvmem_device based consumer apis Srinivas Kandagatla
[not found] ` <1436521505-10779-1-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-07-10 10:49 ` Joe Perches
2015-07-14 22:06 ` Stephen Boyd
[not found] ` <20150714220607.GP30412-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2015-07-15 8:21 ` Srinivas Kandagatla
2015-07-10 9:45 ` [PATCH v7 4/9] nvmem: Add bindings for simple nvmem framework Srinivas Kandagatla
[not found] ` <1436521513-10838-1-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-07-10 19:04 ` Rob Herring
[not found] ` <CAL_JsqKYT-+T=D=TKCb1TcydOvBTE8_yc-EEe1cwdmhr1B0dHQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-13 10:21 ` Srinivas Kandagatla
2015-07-10 9:45 ` [PATCH v7 5/9] Documentation: nvmem: add nvmem api level and how-to doc Srinivas Kandagatla
[not found] ` <1436521521-10889-1-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-07-14 21:32 ` Stephen Boyd
2015-07-14 22:00 ` Srinivas Kandagatla
2015-07-10 9:45 ` [PATCH v7 6/9] nvmem: qfprom: Add Qualcomm QFPROM support Srinivas Kandagatla
[not found] ` <1436521529-10931-1-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-07-14 21:18 ` Stephen Boyd
[not found] ` <20150714211831.GN30412-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2015-07-14 22:02 ` Srinivas Kandagatla
[not found] ` <1436521427-10568-1-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-07-10 9:44 ` [PATCH v7 1/9] nvmem: Add a simple NVMEM framework for nvmem providers Srinivas Kandagatla
[not found] ` <1436521486-10682-1-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-07-10 10:29 ` Joe Perches
2015-07-10 10:39 ` Srinivas Kandagatla
2015-07-13 16:50 ` Philipp Zabel
2015-07-10 9:45 ` [PATCH v7 7/9] nvmem: qfprom: Add bindings for qfprom Srinivas Kandagatla
2015-07-13 18:54 ` [PATCH v7 0/9] Add simple NVMEM Framework via regmap Stefan Wahren
2015-07-13 19:35 ` Srinivas Kandagatla
2015-07-13 20:11 ` Stefan Wahren
[not found] ` <139301016.164015.1436818270753.JavaMail.open-xchange-0SF9iQWekqKZU4JK52HgGMgmgJlYmuWJ@public.gmane.org>
2015-07-13 21:39 ` Srinivas Kandagatla [this message]
2015-07-10 9:45 ` [PATCH v7 8/9] nvmem: sunxi: Move the SID driver to the nvmem framework Srinivas Kandagatla
2015-07-10 9:46 ` [PATCH v7 9/9] nvmem: Add to MAINTAINERS for " Srinivas Kandagatla
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=55A43022.5040000@linaro.org \
--to=srinivas.kandagatla-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=ezequiel-30ULvvUtt6G51wMPkGsGjgyUoB5FGQPZ@public.gmane.org \
--cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mporter-OWPKS81ov/FWk0Htik3J/w@public.gmane.org \
--cc=pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=stefan.wahren-eS4NqCHxEME@public.gmane.org \
--cc=wxt-TNX95d0MmH7DzftRWevZcw@public.gmane.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 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).