public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Baruch Siach <baruch@tkos.co.il>
To: u-boot@lists.denx.de
Subject: [PATCH] imx: imx8mq: handle ESDHC in mxc_get_clock
Date: Wed, 08 Jan 2020 13:56:24 +0200	[thread overview]
Message-ID: <87v9pmyxef.fsf@tarshish> (raw)
In-Reply-To: <87o8wft6gl.fsf@tarshish>

Hi Stefano, Peng,

On Wed, Dec 11 2019, Baruch Siach wrote:
> On Wed, Dec 11 2019, Peng Fan wrote:
>> fsl_esdhc_imx driver will call "mxc_get_clock(MXC_ESDHC_CLK +
>> dev->seq)", however mxc_get_clock wrongly handle MXC_ESDHC_CLK
>> as root clk and cause sd card could not be detected in U-Boot proper,
>> as below:
>> "Loading Environment from MMC... unable to select a mode"
>>
>> Handle MXC_ESDHC_CLK in mxc_get_clock to fix the issue.
>>
>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>
> This fixes SD card and eMMC access on i.MX8MQ based SolidRun
> Hummingboard Pulse.
>
> Tested-by: Baruch Siach <baruch@tkos.co.il>

This patch missed v2020.01 unfortunately. I see it marked as "Awaiting
Upstream" in patchwork (patch 1207464), but I could not find it queued
anywhere. Am I missing anything?

baruch

>> ---
>>  arch/arm/mach-imx/imx8m/clock_imx8mq.c | 14 +++++++++-----
>>  1 file changed, 9 insertions(+), 5 deletions(-)
>>
>> diff --git a/arch/arm/mach-imx/imx8m/clock_imx8mq.c b/arch/arm/mach-imx/imx8m/clock_imx8mq.c
>> index 2db5bde211..878f2be166 100644
>> --- a/arch/arm/mach-imx/imx8m/clock_imx8mq.c
>> +++ b/arch/arm/mach-imx/imx8m/clock_imx8mq.c
>> @@ -326,16 +326,20 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
>>  {
>>  	u32 val;
>>
>> -	if (clk == MXC_ARM_CLK)
>> +	switch(clk) {
>> +	case MXC_ARM_CLK:
>>  		return get_root_clk(ARM_A53_CLK_ROOT);
>> -
>> -	if (clk == MXC_IPG_CLK) {
>> +	case MXC_IPG_CLK:
>>  		clock_get_target_val(IPG_CLK_ROOT, &val);
>>  		val = val & 0x3;
>>  		return get_root_clk(AHB_CLK_ROOT) / (val + 1);
>> +	case MXC_ESDHC_CLK:
>> +		return get_root_clk(USDHC1_CLK_ROOT);
>> +	case MXC_ESDHC2_CLK:
>> +		return get_root_clk(USDHC2_CLK_ROOT);
>> +	default:
>> +		return get_root_clk(clk);
>>  	}
>> -
>> -	return get_root_clk(clk);
>>  }
>>
>>  u32 imx_get_uartclk(void)


--
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

  reply	other threads:[~2020-01-08 11:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-11  6:17 [PATCH] imx: imx8mq: handle ESDHC in mxc_get_clock Peng Fan
2019-12-11 12:03 ` Baruch Siach
2020-01-08 11:56   ` Baruch Siach [this message]
2020-01-08 12:19     ` Stefano Babic
2019-12-11 13:38 ` Fabio Estevam
  -- strict thread matches above, loose matches on Subject: below --
2019-12-28 10:48 sbabic at denx.de

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=87v9pmyxef.fsf@tarshish \
    --to=baruch@tkos.co.il \
    --cc=u-boot@lists.denx.de \
    /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