From: Dinh Nguyen <dinguyen@altera.com>
To: Stephen Warren <swarren@wwwdotorg.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
devicetree@vger.kernel.org, dinh.linux@gmail.com,
Ian Campbell <ian.campbell@citrix.com>,
Pawel Moll <pawel.moll@arm.com>,
Seungwon Jeon <tgih.jun@samsung.com>,
linux-mmc@vger.kernel.org, Rob Herring <rob.herring@calxeda.com>,
Jaehoon Chung <jh80.chung@samsung.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCHv4 2/3] ARM: socfpga: dts: Add support for SD/MMC
Date: Thu, 22 Aug 2013 17:39:22 -0500 [thread overview]
Message-ID: <1377211162.30624.26.camel@linux-builds1> (raw)
In-Reply-To: <521670CE.4000202@wwwdotorg.org>
On Thu, 2013-08-22 at 14:13 -0600, Stephen Warren wrote:
> On 08/21/2013 01:48 PM, Dinh Nguyen wrote:
> > On Fri, 2013-08-16 at 16:36 -0600, Stephen Warren wrote:
> >> On 08/14/2013 10:48 AM, dinguyen@altera.com wrote:
> >>> From: Dinh Nguyen <dinguyen@altera.com>
> >>>
> >>> Add bindings for SD/MMC for SOCFPGA.
> >>
> >>> diff --git a/Documentation/devicetree/bindings/mmc/socfpga-dw-mshc.txt b/Documentation/devicetree/bindings/mmc/socfpga-dw-mshc.txt
> >>
> >>> +* altr,sysmgr: Should be the phandle to the system_mgr node. As this is where
> >>> + this where the register that controls the CIU clock phases
> >>> + reside.
> >>
> >> On the surface, this binding series seems OK, but I do have a question:
> >> how is the sysmgr phandle used?
> >>
> >> I assume there's some register in this syscon device that resets or
> >> enables or otherwise controls this MSHC module. How does the code know
> >> which register it is? The phandle in the altr,sysmgr property would
> >> usually be followed by a/some cell(s) that encode this information, so
> >> that the MSHC driver doesn't have to know anything about the layout of
> >> the syscon registers, and so the sysconf driver doesn't have to know
> >> anything about the identity of the MSHC client device.
> >
> > There is a #define SYSMGR_SDMMCGRP_CTRL_OFFSET that is in
> > dw_mmc-socfpga.c. This defines the offset from the base address that the
> > sysmgr phandle will give me.
>
> Hmmm. That doesn't sound good. That means that the SDMMC driver knows
> internal details about some other HW module. It'd be better if either:
>
> a) The sysmgr driver was required to provide an API to the SDMMC driver
> to set up the CIU register as requested.
>
> or:
>
> b) The CIU register details were represented in DT.
>
> Either of these would allow the SDMMC driver to operate unchanged on an
> SoC with a different sysmgr register layout.
Thanks Stephen...will rework accordingly.
Dinh
>
WARNING: multiple messages have this Message-ID (diff)
From: dinguyen@altera.com (Dinh Nguyen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv4 2/3] ARM: socfpga: dts: Add support for SD/MMC
Date: Thu, 22 Aug 2013 17:39:22 -0500 [thread overview]
Message-ID: <1377211162.30624.26.camel@linux-builds1> (raw)
In-Reply-To: <521670CE.4000202@wwwdotorg.org>
On Thu, 2013-08-22 at 14:13 -0600, Stephen Warren wrote:
> On 08/21/2013 01:48 PM, Dinh Nguyen wrote:
> > On Fri, 2013-08-16 at 16:36 -0600, Stephen Warren wrote:
> >> On 08/14/2013 10:48 AM, dinguyen at altera.com wrote:
> >>> From: Dinh Nguyen <dinguyen@altera.com>
> >>>
> >>> Add bindings for SD/MMC for SOCFPGA.
> >>
> >>> diff --git a/Documentation/devicetree/bindings/mmc/socfpga-dw-mshc.txt b/Documentation/devicetree/bindings/mmc/socfpga-dw-mshc.txt
> >>
> >>> +* altr,sysmgr: Should be the phandle to the system_mgr node. As this is where
> >>> + this where the register that controls the CIU clock phases
> >>> + reside.
> >>
> >> On the surface, this binding series seems OK, but I do have a question:
> >> how is the sysmgr phandle used?
> >>
> >> I assume there's some register in this syscon device that resets or
> >> enables or otherwise controls this MSHC module. How does the code know
> >> which register it is? The phandle in the altr,sysmgr property would
> >> usually be followed by a/some cell(s) that encode this information, so
> >> that the MSHC driver doesn't have to know anything about the layout of
> >> the syscon registers, and so the sysconf driver doesn't have to know
> >> anything about the identity of the MSHC client device.
> >
> > There is a #define SYSMGR_SDMMCGRP_CTRL_OFFSET that is in
> > dw_mmc-socfpga.c. This defines the offset from the base address that the
> > sysmgr phandle will give me.
>
> Hmmm. That doesn't sound good. That means that the SDMMC driver knows
> internal details about some other HW module. It'd be better if either:
>
> a) The sysmgr driver was required to provide an API to the SDMMC driver
> to set up the CIU register as requested.
>
> or:
>
> b) The CIU register details were represented in DT.
>
> Either of these would allow the SDMMC driver to operate unchanged on an
> SoC with a different sysmgr register layout.
Thanks Stephen...will rework accordingly.
Dinh
>
next prev parent reply other threads:[~2013-08-22 22:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-14 16:48 [PATCHv4 1/3] arm: socfpga: dts: Add a syscon binding for sys-mgr dinguyen at altera.com
2013-08-14 16:48 ` [PATCHv4 2/3] ARM: socfpga: dts: Add support for SD/MMC dinguyen
2013-08-14 16:48 ` dinguyen at altera.com
2013-08-16 22:36 ` Stephen Warren
2013-08-16 22:36 ` Stephen Warren
2013-08-21 19:48 ` Dinh Nguyen
2013-08-21 19:48 ` Dinh Nguyen
2013-08-22 20:13 ` Stephen Warren
2013-08-22 20:13 ` Stephen Warren
2013-08-22 22:39 ` Dinh Nguyen [this message]
2013-08-22 22:39 ` Dinh Nguyen
2013-08-14 16:48 ` [PATCHv4 3/3] mmc: dw_mmc: Use phandle to get SDR timing values from sys-mgr dinguyen
2013-08-14 16:48 ` dinguyen at altera.com
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=1377211162.30624.26.camel@linux-builds1 \
--to=dinguyen@altera.com \
--cc=devicetree@vger.kernel.org \
--cc=dinh.linux@gmail.com \
--cc=ian.campbell@citrix.com \
--cc=jh80.chung@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=rob.herring@calxeda.com \
--cc=swarren@wwwdotorg.org \
--cc=tgih.jun@samsung.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 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.