public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] i.mx28: Replaced magic numbers for scratch register addresses with register definitions
Date: Tue, 7 Feb 2012 17:51:19 +0100	[thread overview]
Message-ID: <201202071751.20057.marek.vasut@gmail.com> (raw)
In-Reply-To: <1328623736-24872-3-git-send-email-robert@delien.nl>

> From: Robert Delien <robert@delien.nl>
> 
> This patch replaces the use of magice numbers for scratch register
> addresses with earlier defined register definitions.
> 
> Signed-off-by: Robert Delien <robert@delien.nl>
> ---
>  arch/arm/cpu/arm926ejs/mx28/mx28.c         |    8 ++++----
>  arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c |    8 ++++----
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm/cpu/arm926ejs/mx28/mx28.c
> b/arch/arm/cpu/arm926ejs/mx28/mx28.c index 0e69193..9bfd83b 100644
> --- a/arch/arm/cpu/arm926ejs/mx28/mx28.c
> +++ b/arch/arm/cpu/arm926ejs/mx28/mx28.c
> @@ -261,14 +261,14 @@ void imx_get_mac_from_fuse(int dev_id, unsigned char
> *mac) }
>  #endif
> 
> -#define	HW_DIGCTRL_SCRATCH0	0x8001c280
> -#define	HW_DIGCTRL_SCRATCH1	0x8001c290
>  int mx28_dram_init(void)
>  {
> +	struct mx28_digctl_regs *digctl_regs =
> +		(struct mx28_digctl_regs *)MXS_DIGCTL_BASE;
>  	uint32_t sz[2];
> 
> -	sz[0] = readl(HW_DIGCTRL_SCRATCH0);
> -	sz[1] = readl(HW_DIGCTRL_SCRATCH1);
> +	sz[0] = readl(&digctl_regs->hw_digctl_scratch0);
> +	sz[1] = readl(&digctl_regs->hw_digctl_scratch1);
> 
>  	if (sz[0] != sz[1]) {
>  		printf("MX28:\n"
> diff --git a/arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c
> b/arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c index cf4361c..30d8a60 100644
> --- a/arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c
> +++ b/arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c
> @@ -159,8 +159,6 @@ void mx28_mem_setup_vddd(void)
>  		&power_regs->hw_power_vdddctrl);
>  }
> 
> -#define	HW_DIGCTRL_SCRATCH0	0x8001c280
> -#define	HW_DIGCTRL_SCRATCH1	0x8001c290
>  void data_abort_memdetect_handler(void) __attribute__((naked));
>  void data_abort_memdetect_handler(void)
>  {
> @@ -169,6 +167,8 @@ void data_abort_memdetect_handler(void)
> 
>  void mx28_mem_get_size(void)
>  {
> +	struct mx28_digctl_regs *digctl_regs =
> +		(struct mx28_digctl_regs *)MXS_DIGCTL_BASE;
>  	uint32_t sz, da;
>  	uint32_t *vt = (uint32_t *)0x20;
> 
> @@ -177,8 +177,8 @@ void mx28_mem_get_size(void)
>  	vt[4] = (uint32_t)&data_abort_memdetect_handler;
> 
>  	sz = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);
> -	writel(sz, HW_DIGCTRL_SCRATCH0);
> -	writel(sz, HW_DIGCTRL_SCRATCH1);
> +	writel(sz, &digctl_regs->hw_digctl_scratch0);
> +	writel(sz, &digctl_regs->hw_digctl_scratch1);
> 
>  	/* Restore the old DABT handler. */
>  	vt[4] = da;

This is good.

M

  reply	other threads:[~2012-02-07 16:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-07 14:08 [U-Boot] [PATCH 0/2] i.mx28: Elimintated magic numbers for scratch register addresses robert at delien.nl
2012-02-07 14:08 ` [U-Boot] [PATCH 1/2] i.mx28: Added register definitions for DIGCTL registers robert at delien.nl
2012-02-07 16:51   ` Marek Vasut
2012-02-07 17:01     ` Robert Deliën
2012-02-20  9:24   ` Stefano Babic
2012-02-07 14:08 ` [U-Boot] [PATCH 2/2] i.mx28: Replaced magic numbers for scratch register addresses with register definitions robert at delien.nl
2012-02-07 16:51   ` Marek Vasut [this message]
2012-02-20  9:25   ` Stefano Babic
2012-02-20  7:53 ` [U-Boot] [PATCH 0/2] i.mx28: Elimintated magic numbers for scratch register addresses Matthias Fuchs
2012-02-20  8:32   ` Marek Vasut
2012-02-20  8:56     ` Matthias Fuchs
2012-02-20  9:18     ` Stefano Babic

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=201202071751.20057.marek.vasut@gmail.com \
    --to=marek.vasut@gmail.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