[U-Boot] [PATCH 4/7] mx25 clocks: Fix MXC_FEC_CLK

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


On 27/09/2012 22:27, Benoît Thébaudeau wrote:
> mxc_get_clock(MXC_FEC_CLK) should return the IPG clock, not the AHB clock.
> 
> Also, imx_get_fecclk() was correct but reimplemented the calculation of the IPG
> clock, so remove the duplicated code.
> 
> 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          |    3 +--
>  .../arch/arm/include/asm/arch-mx25/clock.h         |    2 +-
>  2 files changed, 2 insertions(+), 3 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 219c9eb..5879b18 100644
> --- u-boot-imx-e1eb75b.orig/arch/arm/cpu/arm926ejs/mx25/generic.c
> +++ u-boot-imx-e1eb75b/arch/arm/cpu/arm926ejs/mx25/generic.c
> @@ -129,9 +129,8 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
>  		return imx_get_ahbclk();
>  	case MXC_IPG_CLK:
>  	case MXC_CSPI_CLK:
> -		return imx_get_ipgclk();
>  	case MXC_FEC_CLK:
> -		return imx_get_ahbclk();
> +		return imx_get_ipgclk();
>  	default:
>  		return imx_get_perclk(clk);
>  	}
> 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 9823f46..a532da5 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
> @@ -71,7 +71,7 @@ ulong imx_get_perclk(int clk);
>  ulong imx_get_ahbclk(void);
>  
>  #define imx_get_uartclk() imx_get_perclk(15)
> -#define imx_get_fecclk() (imx_get_ahbclk()/2)
> +#define imx_get_fecclk() mxc_get_clock(MXC_FEC_CLK)
>  
>  unsigned int mxc_get_clock(enum mxc_clock clk);
>  
> 
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