[U-Boot] [PATCH 5/7] mx25: Clean up clocks API

Stefano Babic sbabic at denx.de
Fri Sep 28 12:31:51 CEST 2012


On 27/09/2012 22:27, Benoît Thébaudeau wrote:
> Use the standard mxc_get_clock() instead of exporting internal functions and
> using literal constant values.
> 
> Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau at advansee.com>
> Cc: Stefano Babic <sbabic at denx.de>
> ---
>  .../arch/arm/cpu/arm926ejs/mx25/generic.c          |    6 +++---
>  .../arch/arm/include/asm/arch-mx25/clock.h         |    9 +++------
>  2 files changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git u-boot-imx-e1eb75b.orig/arch/arm/cpu/arm926ejs/mx25/generic.c u-boot-imx-e1eb75b/arch/arm/cpu/arm926ejs/mx25/generic.c
> index 5879b18..5da2582 100644
> --- u-boot-imx-e1eb75b.orig/arch/arm/cpu/arm926ejs/mx25/generic.c
> +++ u-boot-imx-e1eb75b/arch/arm/cpu/arm926ejs/mx25/generic.c
> @@ -72,7 +72,7 @@ static ulong imx_get_mpllclk(void)
>  	return imx_decode_pll(readl(&ccm->mpctl), fref);
>  }
>  
> -ulong imx_get_armclk(void)
> +static ulong imx_get_armclk(void)
>  {
>  	struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE;
>  	ulong cctl = readl(&ccm->cctl);
> @@ -88,7 +88,7 @@ ulong imx_get_armclk(void)
>  	return fref / div;
>  }
>  
> -ulong imx_get_ahbclk(void)
> +static ulong imx_get_ahbclk(void)
>  {
>  	struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE;
>  	ulong cctl = readl(&ccm->cctl);
> @@ -106,7 +106,7 @@ static ulong imx_get_ipgclk(void)
>  	return imx_get_ahbclk() / 2;
>  }
>  
> -ulong imx_get_perclk(int clk)
> +static ulong imx_get_perclk(int clk)
>  {
>  	struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE;
>  	ulong fref = imx_get_ahbclk();
> diff --git u-boot-imx-e1eb75b.orig/arch/arm/include/asm/arch-mx25/clock.h u-boot-imx-e1eb75b/arch/arm/include/asm/arch-mx25/clock.h
> index a532da5..efbe038 100644
> --- u-boot-imx-e1eb75b.orig/arch/arm/include/asm/arch-mx25/clock.h
> +++ u-boot-imx-e1eb75b/arch/arm/include/asm/arch-mx25/clock.h
> @@ -67,12 +67,9 @@ enum mxc_clock {
>  	MXC_CLK_NUM
>  };
>  
> -ulong imx_get_perclk(int clk);
> -ulong imx_get_ahbclk(void);
> -
> -#define imx_get_uartclk() imx_get_perclk(15)
> -#define imx_get_fecclk() mxc_get_clock(MXC_FEC_CLK)
> -
>  unsigned int mxc_get_clock(enum mxc_clock clk);
>  
> +#define imx_get_uartclk()	mxc_get_clock(MXC_UART_CLK)
> +#define imx_get_fecclk()	mxc_get_clock(MXC_FEC_CLK)
> +
>  #endif /* __ASM_ARCH_CLOCK_H */
> 

Tested on tx25.

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

Regards,
Stefano


-- 
=====================================================================
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
=====================================================================


More information about the U-Boot mailing list