mx25 clocks: Fix MXC_FEC_CLK
authorBenoît Thébaudeau <benoit.thebaudeau@advansee.com>
Thu, 27 Sep 2012 10:27:44 +0000 (10:27 +0000)
committerTom Rini <trini@ti.com>
Mon, 15 Oct 2012 18:54:13 +0000 (11:54 -0700)
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@advansee.com>
Cc: Stefano Babic <sbabic@denx.de>
arch/arm/cpu/arm926ejs/mx25/generic.c
arch/arm/include/asm/arch-mx25/clock.h

index 0d1ae206ab50c4059e21ae31fc5db1b70ca5e323..fc92c9bf1d9a7c93490541de3953af2cd625205f 100644 (file)
@@ -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);
        }
index 9823f46adaf8c85dad03227848db4279b351bc86..a532da5dbeaea95138e8d1f2f07e5d562ba69f4a 100644 (file)
@@ -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);