lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAD=FV=XSBuS33pUpRayO8Ok10kLzOxSZ=x97MMOXvQ0Hegrp0g@mail.gmail.com>
Date:	Fri, 10 Apr 2015 11:21:06 -0700
From:	Doug Anderson <dianders@...omium.org>
To:	Dinh Nguyen <dinh.linux@...il.com>
Cc:	Dinh Nguyen <dinguyen@...nsource.altera.com>,
	"linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	setka@...s.cz, Seungwon Jeon <tgih.jun@...sung.com>,
	Jaehoon Chung <jh80.chung@...sung.com>,
	Chris Ball <chris@...ntf.net>,
	Ulf Hansson <ulf.hansson@...aro.org>,
	Alexandru Stan <amstan@...omium.org>,
	Heiko Stübner <heiko@...ech.de>
Subject: Re: [PATCH] mmc: dw_mmc: add fixed divider for ciu_clk on SoCFPGA

Dinh,

On Fri, Apr 10, 2015 at 11:08 AM, Dinh Nguyen <dinh.linux@...il.com> wrote:
>
>
> On 4/10/15 10:15 AM, Doug Anderson wrote:
>> Dinh,
>>
>> On Fri, Apr 10, 2015 at 6:56 AM,  <dinguyen@...nsource.altera.com> wrote:
>>> From: Dinh Nguyen <dinguyen@...nsource.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.

I think there needs to be a separate sample and drive clock at least,
since they can have different phases, right?  I haven't looked, but if
that's what you have then you're all set!  :)  Above I was suggesting
a 3rd clock instead of arbitrarily using either the sample/drive clock
as the main clock for dw_mmc.

-Doug
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ