public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] mx6: Remove duplication of iomuxc structure
Date: Fri, 11 Jul 2014 09:41:45 +0200	[thread overview]
Message-ID: <53BF9539.4060703@denx.de> (raw)
In-Reply-To: <1404939595-16151-1-git-send-email-festevam@gmail.com>

Hi Fabio,

On 09/07/2014 22:59, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> There is no need to keep iomuxc_base_regs structure as it serves the exact same
> purpose of the iomuxc structure, which is to provide access to the GPR 
> registers.
> 
> The additional fields of iomuxc_base_regs are not used. Other advantage of
> 'iomuxc' is that it has a shorter name and the variable declarations can fit
> into a single line.
> 
> So remove iomuxc_base_regs structure and use iomuxc instead.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> This applies against 'next' branch.
> 
>  arch/arm/imx-common/sata.c                 | 3 +--
>  arch/arm/include/asm/arch-mx6/imx-regs.h   | 9 ---------
>  board/boundary/nitrogen6x/nitrogen6x.c     | 3 +--
>  board/freescale/mx6slevk/mx6slevk.c        | 3 +--
>  board/gateworks/gw_ventana/gw_ventana.c    | 3 +--
>  board/solidrun/hummingboard/hummingboard.c | 3 +--
>  6 files changed, 5 insertions(+), 19 deletions(-)
> 
> diff --git a/arch/arm/imx-common/sata.c b/arch/arm/imx-common/sata.c
> index c10dd28..d174a46 100644
> --- a/arch/arm/imx-common/sata.c
> +++ b/arch/arm/imx-common/sata.c
> @@ -12,8 +12,7 @@
>  
>  int setup_sata(void)
>  {
> -	struct iomuxc_base_regs *const iomuxc_regs
> -		= (struct iomuxc_base_regs *)IOMUXC_BASE_ADDR;
> +	struct iomuxc *const iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
>  	int ret;
>  
>  	if (!is_cpu_type(MXC_CPU_MX6Q) && !is_cpu_type(MXC_CPU_MX6D))
> diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h b/arch/arm/include/asm/arch-mx6/imx-regs.h
> index df87123..782d9c4 100644
> --- a/arch/arm/include/asm/arch-mx6/imx-regs.h
> +++ b/arch/arm/include/asm/arch-mx6/imx-regs.h
> @@ -764,15 +764,6 @@ struct anatop_regs {
>  #define ANATOP_PFD_CLKGATE_SHIFT(n)	(7+((n)*8))
>  #define ANATOP_PFD_CLKGATE_MASK(n)	(1<<ANATOP_PFD_CLKGATE_SHIFT(n))
>  
> -struct iomuxc_base_regs {
> -	u32     gpr[14];        /* 0x000 */
> -	u32     obsrv[5];       /* 0x038 */
> -	u32     swmux_ctl[197]; /* 0x04c */
> -	u32     swpad_ctl[250]; /* 0x360 */
> -	u32     swgrp[26];      /* 0x748 */
> -	u32     daisy[104];     /* 0x7b0..94c */
> -};
> -
>  struct wdog_regs {
>  	u16	wcr;	/* Control */
>  	u16	wsr;	/* Service */
> diff --git a/board/boundary/nitrogen6x/nitrogen6x.c b/board/boundary/nitrogen6x/nitrogen6x.c
> index 84294db..60a09f4 100644
> --- a/board/boundary/nitrogen6x/nitrogen6x.c
> +++ b/board/boundary/nitrogen6x/nitrogen6x.c
> @@ -644,8 +644,7 @@ int overwrite_console(void)
>  
>  int board_init(void)
>  {
> -	struct iomuxc_base_regs *const iomuxc_regs
> -		= (struct iomuxc_base_regs *)IOMUXC_BASE_ADDR;
> +	struct iomuxc *const iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
>  
>  	clrsetbits_le32(&iomuxc_regs->gpr[1],
>  			IOMUXC_GPR1_OTG_ID_MASK,
> diff --git a/board/freescale/mx6slevk/mx6slevk.c b/board/freescale/mx6slevk/mx6slevk.c
> index d2b64cc..a990b4c 100644
> --- a/board/freescale/mx6slevk/mx6slevk.c
> +++ b/board/freescale/mx6slevk/mx6slevk.c
> @@ -130,8 +130,7 @@ int board_eth_init(bd_t *bis)
>  
>  static int setup_fec(void)
>  {
> -	struct iomuxc_base_regs *iomuxc_regs =
> -				(struct iomuxc_base_regs *)IOMUXC_BASE_ADDR;
> +	struct iomuxc *iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
>  	int ret;
>  
>  	/* clear gpr1[14], gpr1[18:17] to select anatop clock */
> diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c
> index 9d2651f..9967f80 100644
> --- a/board/gateworks/gw_ventana/gw_ventana.c
> +++ b/board/gateworks/gw_ventana/gw_ventana.c
> @@ -1122,8 +1122,7 @@ int dram_init(void)
>  
>  int board_init(void)
>  {
> -	struct iomuxc_base_regs *const iomuxc_regs
> -		= (struct iomuxc_base_regs *)IOMUXC_BASE_ADDR;
> +	struct iomuxc *const iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
>  
>  	clrsetbits_le32(&iomuxc_regs->gpr[1],
>  			IOMUXC_GPR1_OTG_ID_MASK,
> diff --git a/board/solidrun/hummingboard/hummingboard.c b/board/solidrun/hummingboard/hummingboard.c
> index 2e2fb2a..6d204b3 100644
> --- a/board/solidrun/hummingboard/hummingboard.c
> +++ b/board/solidrun/hummingboard/hummingboard.c
> @@ -144,8 +144,7 @@ int board_phy_config(struct phy_device *phydev)
>  
>  int board_eth_init(bd_t *bis)
>  {
> -	struct iomuxc_base_regs *const iomuxc_regs =
> -			(struct iomuxc_base_regs *)IOMUXC_BASE_ADDR;
> +	struct iomuxc *const iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
>  
>  	int ret = enable_fec_anatop_clock(ENET_25MHz);
>  	if (ret)
> 

Good cleanup, thanks !

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

  parent reply	other threads:[~2014-07-11  7:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-09 20:59 [U-Boot] [PATCH 1/2] mx6: Remove duplication of iomuxc structure Fabio Estevam
2014-07-09 20:59 ` [U-Boot] [PATCH 2/2] mx6: Adjust the GPR offset for mx6solox Fabio Estevam
2014-07-11  7:42   ` Stefano Babic
2014-07-23 10:36   ` Stefano Babic
2014-07-11  7:41 ` Stefano Babic [this message]
2014-07-23 10:36 ` [U-Boot] [PATCH 1/2] mx6: Remove duplication of iomuxc structure 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=53BF9539.4060703@denx.de \
    --to=sbabic@denx.de \
    --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