From: Srinivas KANDAGATLA <srinivas.kandagatla@st.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: dong.aisheng@linaro.org, sameo@linux.intel.com,
Rob Landley <rob@landley.net>,
Grant Likely <grant.likely@secretlab.ca>,
Rob Herring <rob.herring@calxeda.com>,
Russell King <linux@arm.linux.org.uk>,
Linus Walleij <linus.walleij@linaro.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.cz>, Stuart Menefy <stuart.menefy@st.com>,
Shawn Guo <shawn.guo@linaro.org>, Olof Johansson <olof@lixom.net>,
Jason Cooper <jason@lakedaemon.net>,
Stephen Warren <swarren@nvidia.com>,
Maxime Ripard <maxime.ripard@free-electrons.com>,
Nicolas Pitre <nico@linaro.org>,
Will Deacon <will.deacon@arm.com>,
Dave Martin <dave.martin@linaro.org>,
Marc Zyngier <marc.zyngier@arm.com>,
Viresh Kumar <viresh.kumar@linaro.org>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree-discuss@lists.ozlabs.org
Subject: Re: [RFC 3/8] mfd:syscon: Introduce claim/read/write/release APIs
Date: Fri, 24 May 2013 17:06:38 +0100 [thread overview]
Message-ID: <519F900E.308@st.com> (raw)
In-Reply-To: <201305232344.11974.arnd@arndb.de>
On 23/05/13 22:44, Arnd Bergmann wrote:
Thankyou Arnd for extending this discussion.
> On Monday 20 May 2013, Srinivas KANDAGATLA wrote:
>> On 17/05/13 15:36, Arnd Bergmann wrote:
>>
>> On the other hand using device trees to describe the HW
>> configuration(sysconfs) made more sense and got rid of SOC specific
>> callbacks.
>
> I'm sure it's possible to reduce the duplication without going all
> the way to describing every bit in DT.
Yes, I agree with you. I think just passing the offset information from
DT would enough in cases like Ethernet or USB where the sysconf
registers tend to be mostly standard. And the generic higher level
function should be able to do the rest.
>> I forget to mention a important point here, the protection is at bit
>> level for the sysconfs. Some of sysconfs have bits shared across IPs, so
>> protecting them while the IP is still using it is what we are trying to
>> achieve with sysconf-claim/release apis.
>> While it may be overkill, but In past it has found bugs and been helpful
>> with a meaning full debug output.
>
> Can you give an example of something that is shared across multiple IPs?
>
> Are those always done in the way that you have e.g. the ethernet pinctrl
> in the same register as the usb pinctrl, or could you have an ethernet
> pinctrl setting mixed together with the usb clock setting for instance?
>
> If the hardware has been designed in a sensible way rather than just
> grown by randomly adding bits in open spaces, I would assume that it's
> possible to have high-level interfaces built around ranges of registers
> rather than arbitrary subsets of registers.
We have decided to go with using higher level functions as you
suggested, hopefully based on regmap with some helper functions on top
of it.
System configuration registers in the past used to very much shared
across IPs, However with the new chips they seems be mostly dedicated
registers for specific IP configurations.
As we have no plans to support very old chips, So I think I can move
this out bit level information from device tree and add a higher level
functions to be accessed by the drivers.
As an example the below sysconf register for a STi7105 chip(Very old
SOC) looks like:
SYSTEM_CONFIG7 Comms/Ethernet config control register
[31:28] RESERVED
[27] ENMII:
1: MII mode 0: Reverse MII mode
[26:25] PHY_INTF_SELECT: Selects the type of Ethernet mode
00: MII mode (Default)
01: Reserved
1x: Reserved
[23] GLOBAL_POWER_DOWN:
1: Activate low power
[24] RESERVED
0: Normal mode
[22] DAA_CONFIG_CTRL: DAA configuration control
[21] RESERVED
[20] MAC_SPEED_SEL:
1: Indicates that the MAC is running at 100 Mbps speed
0: Indicates that the MAC is running at 10 Mbps speed
[19] RESERVED
[18] RMII_MODE:
1: RMII interface activated
0: MII interface activated
[17] MIIM_DIO_SELECT:
1: MIIM_DIO from external input, else from GMAC
0: All MII pads in input mode
[16] ETHERNET_INTERFACE_ON:
1: Ethernet on (pads enables controlled by MAC)
[15:13] RESERVED
[12] DAA_SERIAL_MODE: DAA serial interface mode select pin
[11] SC1_COND_VCC_ENABLE: Enables control of smart card VCC upon
bit in the PDES.
[10] SC_DETECT_VPP_POL:
1: Output pin SC_NOT_SETVPP is inverted of PDES_SC_SETVPP
0: Output pin SC_NOT_SETVPP is PDES_SC_SETVPP
[9] IRB_DATA_OUT_POL_OD: Selection of polarity of IRB output signal
routed as alternate function
...
...
Thanks,
srini
>
> Arnd
>
>
next prev parent reply other threads:[~2013-05-24 16:15 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-08 14:09 [RFC 0/8] ARM:STiH41x: Add STiH41x platform and board support Srinivas KANDAGATLA
2013-05-08 14:11 ` [RFC 2/8] ARM:global_timer: Add ARM global timer support Srinivas KANDAGATLA
2013-05-08 14:26 ` Rob Herring
2013-05-08 15:06 ` Stuart MENEFY
2013-05-08 14:38 ` Arnd Bergmann
[not found] ` <201305081638.23100.arnd-r2nGTMty4D4@public.gmane.org>
2013-05-08 14:49 ` Will Deacon
2013-05-08 15:48 ` Stuart MENEFY
[not found] ` <518A73CF.8000309-qxv4g6HH51o@public.gmane.org>
2013-05-08 16:23 ` Arnd Bergmann
2013-05-08 14:51 ` Steffen Trumtrar
2013-05-09 14:07 ` Srinivas KANDAGATLA
2013-05-09 14:51 ` Arnd Bergmann
2013-05-09 14:51 ` Srinivas KANDAGATLA
[not found] ` <1368022260-2197-1-git-send-email-srinivas.kandagatla-qxv4g6HH51o@public.gmane.org>
2013-05-13 19:05 ` Linus Walleij
[not found] ` <CACRpkdZCP=w=4Q3bnuMQxm=Oe-uZke+Cc5NgddM5vsQbgr9E-Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-05-13 19:30 ` Thomas Gleixner
2013-05-14 8:46 ` Srinivas KANDAGATLA
[not found] ` <5191F9EE.6070008-qxv4g6HH51o@public.gmane.org>
2013-05-14 9:23 ` Linus Walleij
[not found] ` <CACRpkdYh72hQHSK-a9r8R9qfnQv06412YqVNeYpc_rZhMeiXww-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-05-14 10:26 ` Srinivas KANDAGATLA
2013-05-08 14:11 ` [RFC 3/8] mfd:syscon: Introduce claim/read/write/release APIs Srinivas KANDAGATLA
2013-05-08 14:50 ` Arnd Bergmann
2013-05-08 15:01 ` Mark Brown
2013-05-08 17:42 ` Srinivas KANDAGATLA
[not found] ` <518A8E6C.6070907-qxv4g6HH51o@public.gmane.org>
2013-05-09 9:51 ` Mark Brown
2013-05-09 11:58 ` Srinivas KANDAGATLA
2013-05-09 13:26 ` Mark Brown
[not found] ` <20130509132600.GA3200-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-05-09 14:00 ` Srinivas KANDAGATLA
2013-05-09 14:40 ` Mark Brown
2013-05-09 14:47 ` Srinivas KANDAGATLA
2013-05-10 12:51 ` Srinivas KANDAGATLA
2013-05-08 17:32 ` Srinivas KANDAGATLA
[not found] ` <518A8C1D.3090600-qxv4g6HH51o@public.gmane.org>
2013-05-08 19:48 ` Arnd Bergmann
2013-05-09 10:17 ` Srinivas KANDAGATLA
[not found] ` <518B77C1.70107-qxv4g6HH51o@public.gmane.org>
2013-05-17 14:36 ` Arnd Bergmann
2013-05-20 12:48 ` Srinivas KANDAGATLA
2013-05-23 21:44 ` Arnd Bergmann
2013-05-24 16:06 ` Srinivas KANDAGATLA [this message]
[not found] ` <201305081650.23264.arnd-r2nGTMty4D4@public.gmane.org>
2013-05-08 19:41 ` Re[2]: " Alexander Shiyan
2013-05-08 14:11 ` =?y?q?=5BRFC=205/8=5D=20ARM=3Astih41x=3A=20Add=20STiH415=20SOC=20support?= Srinivas KANDAGATLA
2013-05-08 16:18 ` [RFC 5/8] ARM:stih41x: Add STiH415 SOC support Arnd Bergmann
2013-05-08 16:21 ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-08 17:03 ` Srinivas KANDAGATLA
2013-05-08 14:11 ` [RFC 6/8] ARM:stih41x: Add STiH416 " Srinivas KANDAGATLA
[not found] ` <1368022318-2380-1-git-send-email-srinivas.kandagatla-qxv4g6HH51o@public.gmane.org>
2013-05-15 19:41 ` Linus Walleij
[not found] ` <1368022187-1633-1-git-send-email-srinivas.kandagatla-qxv4g6HH51o@public.gmane.org>
2013-05-08 14:10 ` [RFC 1/8] serial:st-asc: Add ST ASC driver Srinivas KANDAGATLA
2013-05-08 14:34 ` Arnd Bergmann
2013-05-08 14:39 ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-08 18:18 ` Srinivas KANDAGATLA
2013-05-08 19:55 ` Arnd Bergmann
[not found] ` <201305081634.43498.arnd-r2nGTMty4D4@public.gmane.org>
2013-05-08 15:34 ` Greg KH
[not found] ` <20130508153459.GA17186-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2013-05-08 15:40 ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-08 15:53 ` Greg KH
2013-05-08 16:03 ` Jean-Christophe PLAGNIOL-VILLARD
[not found] ` <B5A00B86-5332-427E-A82A-5B71EC0979A8-sclMFOaUSTBWk0Htik3J/w@public.gmane.org>
2013-05-08 16:15 ` Greg KH
2013-05-08 16:31 ` Arnd Bergmann
2013-05-08 16:36 ` Greg KH
2013-05-10 23:29 ` Russell King - ARM Linux
2013-05-08 16:39 ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-08 16:45 ` Nicolas Pitre
[not found] ` <alpine.LFD.2.03.1305081239260.13109-hIgblCxmbi8OMTOF05IoTw@public.gmane.org>
2013-05-08 18:35 ` Arnd Bergmann
2013-05-09 13:36 ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-08 16:10 ` Stephen GALLIMORE
2013-05-10 13:50 ` Stephen GALLIMORE
2013-05-10 14:08 ` Greg KH
2013-05-10 14:45 ` Ben Dooks
[not found] ` <518D07FB.7010606-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org>
2013-05-10 15:23 ` Greg KH
2013-05-10 15:31 ` Ben Dooks
2013-05-10 15:40 ` Stuart MENEFY
2013-05-08 18:02 ` Srinivas KANDAGATLA
2013-05-20 11:49 ` Stephen GALLIMORE
2013-05-22 15:13 ` Arnd Bergmann
2013-05-23 16:26 ` Stephen GALLIMORE
2013-05-08 14:11 ` [RFC 4/8] pinctrl:stixxxx: Add pinctrl and pinconf support Srinivas KANDAGATLA
[not found] ` <1368022284-2283-1-git-send-email-srinivas.kandagatla-qxv4g6HH51o@public.gmane.org>
2013-05-08 15:06 ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-08 16:27 ` Srinivas KANDAGATLA
[not found] ` <518A7CFD.1010602-qxv4g6HH51o@public.gmane.org>
2013-05-08 16:38 ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-08 14:12 ` [RFC 7/8] ARM:stih41x: Add B2000 board support Srinivas KANDAGATLA
[not found] ` <1368022329-2424-1-git-send-email-srinivas.kandagatla-qxv4g6HH51o@public.gmane.org>
2013-05-08 16:20 ` Arnd Bergmann
[not found] ` <201305081820.23968.arnd-r2nGTMty4D4@public.gmane.org>
2013-05-08 16:24 ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-08 17:04 ` Srinivas KANDAGATLA
2013-05-08 14:12 ` [RFC 8/8] ARM:stih41x: Add B2020 " 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=519F900E.308@st.com \
--to=srinivas.kandagatla@st.com \
--cc=arnd@arndb.de \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=dave.martin@linaro.org \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=dong.aisheng@linaro.org \
--cc=grant.likely@secretlab.ca \
--cc=gregkh@linuxfoundation.org \
--cc=jason@lakedaemon.net \
--cc=jslaby@suse.cz \
--cc=linus.walleij@linaro.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=marc.zyngier@arm.com \
--cc=maxime.ripard@free-electrons.com \
--cc=nico@linaro.org \
--cc=olof@lixom.net \
--cc=rob.herring@calxeda.com \
--cc=rob@landley.net \
--cc=sameo@linux.intel.com \
--cc=shawn.guo@linaro.org \
--cc=stuart.menefy@st.com \
--cc=swarren@nvidia.com \
--cc=viresh.kumar@linaro.org \
--cc=will.deacon@arm.com \
/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).