From: York Sun <york.sun@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] drivers/ddr/fsl: Update clk_adjust of sdram_clk_cntl
Date: Mon, 16 May 2016 09:55:10 -0700 [thread overview]
Message-ID: <5739FB6E.1020306@nxp.com> (raw)
In-Reply-To: <1462328422-37229-1-git-send-email-Shengzhou.Liu@nxp.com>
On 05/03/2016 07:30 PM, Shengzhou Liu wrote:
> The clk_adjust is of SDRAM_CLK_CNTL[5:8] 4-bits on MPC85xx and P-series,
> but is of SDRAM_CLK_CNTL[5:9] 5-bits on T-series and LS-series SoCs.
> We should update it to adapt the case that clk_adjust is odd data.
>
> Signed-off-by: Shengzhou Liu <Shengzhou.Liu@nxp.com>
> ---
> drivers/ddr/fsl/ctrl_regs.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ddr/fsl/ctrl_regs.c b/drivers/ddr/fsl/ctrl_regs.c
> index 9073917..b26269c 100644
> --- a/drivers/ddr/fsl/ctrl_regs.c
> +++ b/drivers/ddr/fsl/ctrl_regs.c
> @@ -1835,10 +1835,17 @@ static void set_ddr_sdram_clk_cntl(fsl_ddr_cfg_regs_t *ddr,
> /* Per FSL Application Note: AN2805 */
> ss_en = 1;
> #endif
> - clk_adjust = popts->clk_adjust;
> + if (fsl_ddr_get_version(0) >= 0x40701) {
> + /* clk_adjust in 5-bits on T-series and LS-series */
> + clk_adjust = (popts->clk_adjust & 0x1F) << 22;
> + } else {
> + /* clk_adjust in 4-bits on earlier MPC85xx and P-series */
> + clk_adjust = (popts->clk_adjust & 0xF) << 23;
> + }
> +
> ddr->ddr_sdram_clk_cntl = (0
> | ((ss_en & 0x1) << 31)
> - | ((clk_adjust & 0xF) << 23)
> + | clk_adjust
> );
> debug("FSLDDR: clk_cntl = 0x%08x\n", ddr->ddr_sdram_clk_cntl);
> }
>
Shengzhou,
Your understanding is correct. However, we have done analysis that the
additional bit is not used for finer adjustment. So unless you have a case
requiring values in the middle, I suggest to keep current code.
York
next prev parent reply other threads:[~2016-05-16 16:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-04 2:20 [U-Boot] [PATCH 1/2] drivers/ddr/fsl: Update clk_adjust of sdram_clk_cntl Shengzhou Liu
2016-05-04 2:20 ` [U-Boot] [PATCH 2/2] board/freescale: Update ddr clk_adjust Shengzhou Liu
2016-06-04 5:03 ` York Sun
2016-05-16 16:55 ` York Sun [this message]
2016-05-31 3:18 ` [U-Boot] [PATCH 1/2] drivers/ddr/fsl: Update clk_adjust of sdram_clk_cntl Shengzhou Liu
2016-05-31 16:03 ` York Sun
2016-06-01 5:12 ` Shengzhou Liu
2016-06-01 15:49 ` York Sun
2016-06-04 5:02 ` York Sun
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=5739FB6E.1020306@nxp.com \
--to=york.sun@nxp.com \
--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