board_f: Remove sdram_adjust_866() from the init sequence
authorSimon Glass <sjg@chromium.org>
Tue, 28 Mar 2017 16:27:21 +0000 (10:27 -0600)
committerTom Rini <trini@konsulko.com>
Wed, 5 Apr 2017 17:52:51 +0000 (13:52 -0400)
We can just call this from the only function that needs it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
arch/powerpc/cpu/mpc8xx/speed.c
common/board_f.c
include/common.h

index 613209c..7a532cc 100644 (file)
@@ -237,6 +237,21 @@ int get_clocks (void)
 
 static long init_pll_866 (long clk);
 
+/* Adjust sdram refresh rate to actual CPU clock.
+ */
+static int sdram_adjust_866(void)
+{
+       volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
+       long              mamr;
+
+       mamr = immr->im_memctl.memc_mamr;
+       mamr &= ~MAMR_PTA_MSK;
+       mamr |= ((gd->cpu_clk / CONFIG_SYS_PTA_PER_CLK) << MAMR_PTA_SHIFT);
+       immr->im_memctl.memc_mamr = mamr;
+
+       return 0;
+}
+
 /* This function sets up PLL (init_pll_866() is called) and
  * fills gd->cpu_clk and gd->bus_clk according to the environment
  * variable 'cpuclk' or to CONFIG_8xx_CPUCLK_DEFAULT (if 'cpuclk'
@@ -278,22 +293,7 @@ int get_clocks(void)
        }
        immr->im_clkrst.car_sccr = sccr_reg;
 
-       return (0);
-}
-
-/* Adjust sdram refresh rate to actual CPU clock.
- */
-int sdram_adjust_866 (void)
-{
-       volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
-       long              mamr;
-
-       mamr = immr->im_memctl.memc_mamr;
-       mamr &= ~MAMR_PTA_MSK;
-       mamr |= ((gd->cpu_clk / CONFIG_SYS_PTA_PER_CLK) << MAMR_PTA_SHIFT);
-       immr->im_memctl.memc_mamr = mamr;
-
-       return (0);
+       return sdram_adjust_866();
 }
 
 /* Configure PLL for MPC866/859/885 CPU series
index 84ffc90..4b5ef1f 100644 (file)
@@ -832,8 +832,6 @@ static const init_fnc_t init_sequence_f[] = {
 #if defined(CONFIG_8xx_CPUCLK_DEFAULT)
        /* get CPU and bus clocks according to the environment variable */
        get_clocks,
-       /* adjust sdram refresh rate according to the new clock */
-       sdram_adjust_866,
        init_timebase,
 #elif defined(CONFIG_PPC)
        get_clocks,             /* get CPU and bus clocks (etc.) */
index ad8c18c..6e35990 100644 (file)
@@ -637,7 +637,6 @@ int serial_stub_tstc(struct stdio_dev *sdev);
 
 /* $(CPU)/speed.c */
 int    get_clocks (void);
-int    sdram_adjust_866 (void);
 int    adjust_sdram_tbs_8xx (void);
 #if defined(CONFIG_MPC8260)
 int    prt_8260_clks (void);