From: "Andreas Bießmann" <andreas.devel@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] arm: at91/spl: mpddrc: use IP version to check configuration
Date: Fri, 27 Nov 2015 22:39:41 +0100 [thread overview]
Message-ID: <5658CD9D.3050604@googlemail.com> (raw)
In-Reply-To: <1446618755-11300-4-git-send-email-wenyou.yang@atmel.com>
Hi Wenyou,
On 04.11.15 07:32, Wenyou Yang wrote:
> To remove the unnecessary #ifdef-endif, use the mpddrc IP version
> to check whether or not the interleaved decoding type is supported.
>
> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
> ---
>
> arch/arm/mach-at91/mpddrc.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-at91/mpddrc.c b/arch/arm/mach-at91/mpddrc.c
> index ae8b0ff..5a75541 100644
> --- a/arch/arm/mach-at91/mpddrc.c
> +++ b/arch/arm/mach-at91/mpddrc.c
> @@ -12,6 +12,8 @@
> #include <asm/io.h>
> #include <asm/arch/atmel_mpddrc.h>
>
> +#define SAMA5D3_MPDDRC_VERSION 0x140
> +
> static inline void atmel_mpddr_op(const struct atmel_mpddr *mpddr,
> int mode,
> u32 ram_address)
> @@ -22,11 +24,13 @@ static inline void atmel_mpddr_op(const struct atmel_mpddr *mpddr,
>
> static int ddr2_decodtype_is_seq(u32 cr)
> {
> -#if defined(CONFIG_SAMA5D3) || defined(CONFIG_SAMA5D4) || \
> - defined(CONFIG_AT91SAM9X5) || defined(CONFIG_AT91SAM9N12)
> - if (cr & ATMEL_MPDDRC_CR_DECOD_INTERLEAVED)
> + struct atmel_mpddr *mpddr = (struct atmel_mpddr *)ATMEL_BASE_MPDDRC;
> + u16 version = readl(&mpddr->version) & 0xffff;
Unfortunately I can't check the version thing ...
But the code looks good to me
Reviewed-by: Andreas Bie?mann <andreas.devel@googlemail.com>
> +
> + if ((version >= SAMA5D3_MPDDRC_VERSION) &&
> + (cr & ATMEL_MPDDRC_CR_DECOD_INTERLEAVED))
> return 0;
> -#endif
> +
> return 1;
> }
>
>
prev parent reply other threads:[~2015-11-27 21:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-04 6:32 [U-Boot] [PATCH 0/3] arm: at91/spl: add DDR3-SDRAM initialization support Wenyou Yang
2015-11-04 6:32 ` [U-Boot] [PATCH 1/3] arm: at91/spl: mpddrc: add struct atmel_mpddrc_config Wenyou Yang
2015-11-27 21:22 ` Andreas Bießmann
2015-11-04 6:32 ` [U-Boot] [PATCH 2/3] arm: at91/spl: mpddrc: add mpddrc DDR3-SDRAM initialization Wenyou Yang
2015-11-27 21:36 ` Andreas Bießmann
2015-12-01 1:37 ` Yang, Wenyou
2015-11-04 6:32 ` [U-Boot] [PATCH 3/3] arm: at91/spl: mpddrc: use IP version to check configuration Wenyou Yang
2015-11-27 21:39 ` Andreas Bießmann [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=5658CD9D.3050604@googlemail.com \
--to=andreas.devel@googlemail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.