mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] ddr: imx8m: add comment and print out prior to first DDRC read
Date: Wed, 26 Jul 2023 15:38:24 +0200	[thread overview]
Message-ID: <20230726133824.GW18491@pengutronix.de> (raw)
In-Reply-To: <20230706161640.843682-1-a.fatoum@pengutronix.de>

On Thu, Jul 06, 2023 at 06:16:40PM +0200, Ahmad Fatoum wrote:
> If board code low level entry forgets to call imx8m*_early_clock_init
> before DRAM setup, write access to DRAM controller will seem to work,
> but the first read access will hang the system.
> 
> Make debugging this board bring up mistake easier by adding a debug
> print along with a comment.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  drivers/ddr/imx8m/ddr_init.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/ddr/imx8m/ddr_init.c b/drivers/ddr/imx8m/ddr_init.c
> index 944cc3873e0c..9a86280d9c73 100644
> --- a/drivers/ddr/imx8m/ddr_init.c
> +++ b/drivers/ddr/imx8m/ddr_init.c
> @@ -106,7 +106,11 @@ int imx8m_ddr_init(struct dram_timing_info *dram_timing,
>  	reg32_write(DDRC_RFSHCTL3(0), 0x0000001);
>  	reg32_write(DDRC_PWRCTL(0), 0xa0);
>  
> -	/* if ddr type is LPDDR4, do it */
> +	pr_debug("checking ddr type\n");
> +	/*
> +	 * below is first read, so if boot hangs here, imx8m*_early_clock_init()
> +	 * might not have been called
> +	 */
>  	tmp = reg32_read(DDRC_MSTR(0));
>  	if (tmp & (0x1 << 5) && ddrc_type != DDRC_TYPE_MN)
>  		reg32_write(DDRC_DDR_SS_GPR0, 0x01); /* LPDDR4 mode */
> -- 
> 2.39.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



      parent reply	other threads:[~2023-07-26 13:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-06 16:16 Ahmad Fatoum
2023-07-07  6:25 ` Marco Felsch
2023-07-26 13:38 ` Sascha Hauer [this message]

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=20230726133824.GW18491@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.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