From: Mike Turquette <mturquette@linaro.org>
To: zhangfei <zhangfei.gao@linaro.org>, Arnd Bergmann <arnd@arndb.de>,
dinguyen@altera.com
Cc: dinh.linux@gmail.com, cjb@laptop.org, jh80.chung@samsung.com,
tgih.jun@samsung.com, heiko@sntech.de, dianders@chromium.org,
alim.akhtar@samsung.com, bzhao@marvell.com,
rob.herring@calxeda.com, pawel.moll@arm.com,
mark.rutland@arm.com, ian.campbell@citrix.com,
devicetree@vger.kernel.org, linux-mmc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Peter De Schrijver <pdeschrijver@nvidia.com>
Subject: Re: [PATCHv6 2/5] clk: socfpga: Add a clock type for the SD/MMC driver
Date: Sat, 14 Dec 2013 20:51:16 -0800 [thread overview]
Message-ID: <20131215045116.23538.4@quantum> (raw)
In-Reply-To: <52AD1185.6090501@linaro.org>
Quoting zhangfei (2013-12-14 18:18:45)
> Dear Arnd
>
> On 12/15/2013 05:33 AM, Arnd Bergmann wrote:
> > On Thursday 12 December 2013, dinguyen@altera.com wrote:
> >> From: Dinh Nguyen <dinguyen@altera.com>
> >>
> >> Add a "altr,socfpga-sdmmc-sdr-clk" clock type in the SOCFPGA clock driver. This
> >> clock type is not really a "clock" for say, but a mechanism to set the phase
> >> shift of the clock that is used to feed the SD/MMC CIU's clock. This clock does
> >> not have parent so it is designated as a CLK_IS_ROOT.
> >>
> >> This clock implements the set_clk_rate method that is meant to receive the SDR
> >> settings that is designated by the "samsung,dw-mshc-sdr-timing" binding. The
> >> SD/MMC driver passes this clock phase information into the clock driver to use.
> >>
> >> This enables the SD/MMC driver to touch registers that are located outside of
> >> the SD/MMC IP, which helps make the core SD/MMC driver generic.
> >>
> >> Signed-off-by: Dinh Nguyen <dinguyen@alter.com>
> >
> > Ok, this looks like it will work, but we haven't concluded if this is the
> > best way to do it. I'm looking for guidance from Mike here.
> >
> > The alternatives I can see for this particular problem are:
> >
> > 1. fake a clock and use the 'clk_set_rate' callback to set the phase
> > rather than the clock frequency (as you do in this patch).
> > 2. extend the common clock API to provide a 'clk_set_phase' interface
> > that you can call on the CIU clock to set this, so you don't have
> > to fake anything. This seems to be the nicest interface if we have
> > the same problem in more drivers.
clk_set_phase has been proposed before and now may be the time to add
it. There are two things that need to be addressed:
1) what are the values for the phase? This needs to work for others that
must set clk phase, so we need to consider all those requirements before
making a new function declaration in clk.h
2) is setting a clock's phase something done dynamically? Put another
way, does the same clock has it's phase set multiple times while the
system is running? For static configuration that only happens during
initialization we do not need a new API. The clock driver can handle it
privately. For dynamic operations though we likely need a new API.
I've Cc'd Peter since I think Tegra has clock phase requirements as well
that we discussed some time back.
Regards,
Mike
> > 3. make the phase setting private to whichever clock is used for CIU
> > (as one of your previous patches did, which I did not like).
> > 4. make the phase an additional argument to the clock specifier,
> > so you would have <&mmcclock 12345 5678> rather than just <&mmcclock>
> > in the mmc host device node to specify the two possible phases.
> >
> > I would also like to get buy-in from Zhangfei Gao, since he is working
> > on the same thing. Please coordinate with him to make sure whatever
> > one of you comes up with works for the other one too. At the moment,
> > patches are flying so fast without much discussion inbetween that I'd
> > prefer Chris to hold off from merging either one until you have both
> > revieved and Acked each other's patches.
> >
>
> This is our case
> In this version ip, supported now.
> Only several mode (LEGACY, HS) are supported in the code, where fixed
> div and sample is need to be set, so we can hide them in clock.
> And each controller have different value & register, so different
> controller use different clock.
> These clock can be ciu_clock, whose parent are original clock input.
>
> In next version ip, which still not in hand.
> HS200 and other mode have to be supported, tuning process have to be
> included, good example is drivers/mmc/host/dw_mmc-exynos.c
> .execute_tuning = dw_mci_exynos_execute_tuning,
> It have to choose the best point during the tuning process.
> Some other mode may still need tuning, which is special in our case.
>
> Zhangfei
>
>
>
>
>
next prev parent reply other threads:[~2013-12-15 4:51 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-12 20:30 [PATCHv6 0/5] socfpga: Enable SD/MMC support dinguyen
2013-12-12 20:30 ` [PATCHv6 1/5] mmc: dw_mmc: Add support to set the SDR and DDR timing through clock framework dinguyen
2013-12-15 2:05 ` zhangfei
2013-12-15 3:16 ` Dinh Nguyen
2013-12-15 4:37 ` zhangfei
[not found] ` <52AD320A.4030502-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2013-12-16 3:24 ` Dinh Nguyen
2013-12-16 3:38 ` Zhangfei Gao
2013-12-16 4:20 ` Seungwon Jeon
[not found] ` <1386880245-10192-1-git-send-email-dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>
2013-12-12 20:30 ` [PATCHv6 2/5] clk: socfpga: Add a clock type for the SD/MMC driver dinguyen-EIB2kfCEclfQT0dZR+AlfA
2013-12-14 21:33 ` Arnd Bergmann
2013-12-15 2:18 ` zhangfei
2013-12-15 4:51 ` Mike Turquette [this message]
2013-12-16 20:55 ` Emilio López
2013-12-16 21:06 ` Hans de Goede
2013-12-16 21:54 ` David Lanzendörfer
2013-12-18 20:10 ` Mike Turquette
2013-12-17 2:17 ` Chen-Yu Tsai
2013-12-12 20:30 ` [PATCHv6 3/5] dts: socfpga: Add support for SD/MMC on the SOCFPGA platform dinguyen
2013-12-12 20:30 ` [PATCHv6 4/5] mmc: dw_mmc-socfpga: Remove the SOCFPGA specific platform for dw_mmc dinguyen
2013-12-12 20:30 ` [PATCHv6 5/5] ARM: socfpga_defconfig: enable SD/MMC support dinguyen
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=20131215045116.23538.4@quantum \
--to=mturquette@linaro.org \
--cc=alim.akhtar@samsung.com \
--cc=arnd@arndb.de \
--cc=bzhao@marvell.com \
--cc=cjb@laptop.org \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=dinguyen@altera.com \
--cc=dinh.linux@gmail.com \
--cc=heiko@sntech.de \
--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=pdeschrijver@nvidia.com \
--cc=rob.herring@calxeda.com \
--cc=tgih.jun@samsung.com \
--cc=zhangfei.gao@linaro.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).