All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dinh Nguyen <dinh.linux@gmail.com>
To: Doug Anderson <dianders@chromium.org>,
	Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	setka@vsis.cz, "Seungwon Jeon" <tgih.jun@samsung.com>,
	"Jaehoon Chung" <jh80.chung@samsung.com>,
	"Chris Ball" <chris@printf.net>,
	"Ulf Hansson" <ulf.hansson@linaro.org>,
	"Alexandru Stan" <amstan@chromium.org>,
	"Heiko Stübner" <heiko@sntech.de>
Subject: Re: [PATCH] mmc: dw_mmc: add fixed divider for ciu_clk on SoCFPGA
Date: Fri, 10 Apr 2015 13:08:41 -0500	[thread overview]
Message-ID: <552811A9.1090009@gmail.com> (raw)
In-Reply-To: <CAD=FV=V9biPquZN+oejF0s4poqRi+-CT99AiXDfJa5R4LQPOZA@mail.gmail.com>



On 4/10/15 10:15 AM, Doug Anderson wrote:
> Dinh,
> 
> On Fri, Apr 10, 2015 at 6:56 AM,  <dinguyen@opensource.altera.com> wrote:
>> From: Dinh Nguyen <dinguyen@opensource.altera.com>
>>
>> The ciu_clk(Card Interface Unit Clock) on the SoCFPGA platform has a fixed
>> divider of 4. Add the fixed clock divide code in the platform's clock
>> setup code.
> 
> It might actually be better to do this a different way for SoCFPGA.  I
> sorta wish we had done it differently for Rockchip as well, but at
> this point you end up with the complexity of changing device tree
> bindings in conjunction with code and it gets ugly.

Yes, I started going down this path and realized that.

> 
> Specifically, you've probably got the following clocks:
> 
> SD_prediv = 400MHz
> -> SD postdiv = 100MHz
> -> SD sample = 100MHz, shifted
> -> SD drive = 100MHz, shifted
> 
> Right now you're specifying "SD_prediv" as the SD card clock.  If you
> instead expose "SD postdiv" as a new clock (from your clock driver)
> that is "SD prediv" divided by 4 then you'll magically get all the
> behavior that you want with no modifications to dw_mmc.  Just make
> sure that "SD postdiv" passes on rate changes to its parent (that's
> just a flag in the common clock framework).
> 

That's a great idea, thanks for pointing that out.

> 
> At some point in time you'll also want to expose the sample and drive
> clocks once you get UHS modes working.  Alexandru posted some patches
> for this a while ago to support tuning in dw_mmc using just drive and
> sample clocks, but the patch still needed some more work.  Either he
> or I will probably pick it up again soon.

I think I have already done this by representing the sdmmc_clk with a
"clk-phase" property for this clock.

Dinh

  reply	other threads:[~2015-04-10 18:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-10 13:56 [PATCH] mmc: dw_mmc: add fixed divider for ciu_clk on SoCFPGA dinguyen
2015-04-10 13:56 ` dinguyen
2015-04-10 15:15 ` Doug Anderson
2015-04-10 18:08   ` Dinh Nguyen [this message]
2015-04-10 18:21     ` Doug Anderson

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=552811A9.1090009@gmail.com \
    --to=dinh.linux@gmail.com \
    --cc=amstan@chromium.org \
    --cc=chris@printf.net \
    --cc=dianders@chromium.org \
    --cc=dinguyen@opensource.altera.com \
    --cc=heiko@sntech.de \
    --cc=jh80.chung@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=setka@vsis.cz \
    --cc=tgih.jun@samsung.com \
    --cc=ulf.hansson@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 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.