public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Marcin Wojtas <mw@semihalf.com>
To: Leif Lindholm <leif.lindholm@linaro.org>
Cc: edk2-devel-01 <edk2-devel@lists.01.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	 nadavh@marvell.com, Neta Zur Hershkovits <neta@marvell.com>,
	 Kostya Porotchkin <kostap@marvell.com>,
	Hua Jing <jinghua@marvell.com>,
	 semihalf-dabros-jan <jsd@semihalf.com>
Subject: Re: [platforms: PATCH 09/10] Marvell/Drivers: XenonDxe: Fix base clock frequency
Date: Thu, 26 Oct 2017 17:07:14 +0200	[thread overview]
Message-ID: <CAPv3WKfR2Cntfta207MWXCB_ki2dbqat80V6V_dtth7uyMh8Gw@mail.gmail.com> (raw)
In-Reply-To: <20171026145242.zyzx7tysxq653sex@bivouac.eciton.net>

2017-10-26 16:52 GMT+02:00 Leif Lindholm <leif.lindholm@linaro.org>:
> On Thu, Oct 26, 2017 at 04:29:39PM +0200, Marcin Wojtas wrote:
>> 2017-10-26 16:02 GMT+02:00 Leif Lindholm <leif.lindholm@linaro.org>:
>> >> > Why is Capability.BaseClkFreq the wrong frequency to use?
>> >>
>> >> The Capability.BaseClkFreq is UINT8 and can hold up to 0xff -> 255MHz.
>> >> An alternative would be change this generic type to UINT16 and update
>> >> field properly during initialization - do you prefer that?
>> >
>> > No, I'm still dreaming we might be able to reintegrate this into the
>> > MdeModulePkg driver in some glorious future.
>>
>> Yes, that would be great. I imagine some SDMMC_HOST_PROTOCOL exposing
>> callbacks to set UHS, custom clock handling, etc (like it's done in
>> the Linux).
>
> Yes, *waves hands*, something like that.

Just 'a bit' spare time needed.

>
>> > So what you are basically saying is that this controller is running at
>> > a higher frequency than is permitted (or even describable) by the
>> > specification? If so, _that_ needs to be in the commit message (and
>> > really, a comment by the code as well).
>>
>> Yes, this clock value is Xenon controller's quirk. I will mention it
>> in commit log/comment, but please let know if you wish me to:
>> a. extend BaseClkFreq to UINT16 and configure it properly during init
>> b. leave as is with better description only
>> I lean towards a., it's a very low-cost quirk to be applied.
>
> I would actually lean towards b. That way it stands out and is less
> likely to actually _confuse_ someone in the future.
>

If we dream about possible merge with edk2 original code, I'd really
suggest not to spoil (well, I'm criticizing my own patch:)) the
SdMmcHcClockSupply and continue to rely on BaseClkFreq field there.
This way the code can be common for various hosts.

Let's take look at linux - there is SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN
flag, thanks to which the host controller driver can override the
capability register value during initialization. Most common method
here ends up in clk_get_rate () call and this quirk is used by overall
10 different controllers. Modifying BaseClkFreq type and assignment
during driver initialization (if needed) will be IMO better for
maintenance than creating a custom version of SdMmcHcClockSupply
routine.

Is there any chance I might have convinced you?:)

Thanks,
Marcin


  reply	other threads:[~2017-10-26 15:03 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-26  1:19 [platforms: PATCH 00/10] Armada 7k/8k - misc improvements pt.2 Marcin Wojtas
2017-10-26  1:19 ` [platforms: PATCH 01/10] Marvell/Drivers: MvI2cDxe: Abort transaction immediately upon fail Marcin Wojtas
2017-10-26 12:51   ` Leif Lindholm
2017-10-26 13:19     ` Marcin Wojtas
2017-10-26 13:54       ` Leif Lindholm
2017-10-26 13:55         ` Marcin Wojtas
2017-10-26  1:19 ` [platforms: PATCH 02/10] Marvell/Drivers: MvI2cDxe: Fix returning status in MvI2cStartRequest Marcin Wojtas
2017-10-26 13:11   ` Leif Lindholm
2017-10-26 13:22     ` Marcin Wojtas
2017-10-26 13:55       ` Leif Lindholm
2017-10-26  1:19 ` [platforms: PATCH 03/10] Marvell/Drivers: MvI2cDxe: Reduce bus occupation time Marcin Wojtas
2017-10-26 13:13   ` Leif Lindholm
2017-10-26  1:19 ` [platforms: PATCH 04/10] Marvell/Library: MppLib: Prevent overwriting PCD values Marcin Wojtas
2017-10-26 13:15   ` Leif Lindholm
2017-10-26  1:19 ` [platforms: PATCH 05/10] Marvell/Library: MppLib: Disable the stack protector Marcin Wojtas
2017-10-26 13:26   ` Leif Lindholm
2017-10-26 13:29     ` Ard Biesheuvel
2017-10-26 13:57       ` Leif Lindholm
2017-10-26  1:19 ` [platforms: PATCH 06/10] Marvell/Library: MppLib: Take 0xFF placeholders into account Marcin Wojtas
2017-10-26 13:30   ` Leif Lindholm
2017-10-26  1:19 ` [platforms: PATCH 07/10] Marvell/Drivers: Pp2Dxe: Change settings for the always-up link Marcin Wojtas
2017-10-26 13:38   ` Leif Lindholm
2017-10-26  1:19 ` [platforms: PATCH 08/10] Marvell/Drivers: XenonDxe: Fix UHS signalling mode setting Marcin Wojtas
2017-10-26 13:41   ` Leif Lindholm
2017-10-26  1:19 ` [platforms: PATCH 09/10] Marvell/Drivers: XenonDxe: Fix base clock frequency Marcin Wojtas
2017-10-26 13:46   ` Leif Lindholm
2017-10-26 13:54     ` Marcin Wojtas
2017-10-26 13:55       ` Ard Biesheuvel
2017-10-26 13:59         ` Marcin Wojtas
2017-10-26 14:02       ` Leif Lindholm
2017-10-26 14:29         ` Marcin Wojtas
2017-10-26 14:52           ` Leif Lindholm
2017-10-26 15:07             ` Marcin Wojtas [this message]
2017-10-26  1:19 ` [platforms: PATCH 10/10] Marvell/Drivers: XenonDxe: Do not modify FIFO default values Marcin Wojtas
2017-10-26 13:47   ` Leif Lindholm

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-list 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=CAPv3WKfR2Cntfta207MWXCB_ki2dbqat80V6V_dtth7uyMh8Gw@mail.gmail.com \
    --to=devel@edk2.groups.io \
    /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