m68k: Move CONFIG_EXTRA_CLOCK to arch_global_data
authorSimon Glass <sjg@chromium.org>
Thu, 13 Dec 2012 20:49:07 +0000 (20:49 +0000)
committerTom Rini <trini@ti.com>
Mon, 4 Feb 2013 14:05:44 +0000 (09:05 -0500)
Move inp_clk, vco_clk and flb_clk into arch_global_data and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
arch/m68k/cpu/mcf5227x/cpu.c
arch/m68k/cpu/mcf5227x/speed.c
arch/m68k/cpu/mcf5445x/cpu.c
arch/m68k/cpu/mcf5445x/speed.c
arch/m68k/include/asm/global_data.h
arch/m68k/lib/board.c

index 3a0ab9746b457215b6bcab033993e3a4d7e61ba9..705bd4428cb7be5366522d7618727caadc6e58b3 100644 (file)
@@ -68,10 +68,10 @@ int checkcpu(void)
                printf("       CPU CLK %s MHz BUS CLK %s MHz FLB CLK %s MHz\n",
                       strmhz(buf1, gd->cpu_clk),
                       strmhz(buf2, gd->bus_clk),
-                      strmhz(buf3, gd->flb_clk));
+                      strmhz(buf3, gd->arch.flb_clk));
                printf("       INP CLK %s MHz VCO CLK %s MHz\n",
-                      strmhz(buf1, gd->inp_clk),
-                      strmhz(buf2, gd->vco_clk));
+                      strmhz(buf1, gd->arch.inp_clk),
+                      strmhz(buf2, gd->arch.vco_clk));
        }
 
        return 0;
index c1d59309ff3617c0416975721d414ffe1aa39759..98f554aa7f5099d409271b18cac05deec43dc361 100644 (file)
@@ -114,24 +114,24 @@ int get_clocks(void)
                            ((in_be32(&pll->pcr) & 0xFF000000) >> 24) *
                            CONFIG_SYS_INPUT_CLKSRC;
                }
-               gd->vco_clk = vco;      /* Vco clock */
+               gd->arch.vco_clk = vco; /* Vco clock */
        } else if (bootmode == 3) {
                /* serial mode */
                vco = ((in_be32(&pll->pcr) & 0xFF000000) >> 24) * CONFIG_SYS_INPUT_CLKSRC;
-               gd->vco_clk = vco;      /* Vco clock */
+               gd->arch.vco_clk = vco; /* Vco clock */
        }
 
        if ((in_be16(&ccm->ccr) & CCM_MISCCR_LIMP) == CCM_MISCCR_LIMP) {
                /* Limp mode */
        } else {
-               gd->inp_clk = CONFIG_SYS_INPUT_CLKSRC;  /* Input clock */
+               gd->arch.inp_clk = CONFIG_SYS_INPUT_CLKSRC; /* Input clock */
 
                temp = (in_be32(&pll->pcr) & PLL_PCR_OUTDIV1_MASK) + 1;
                gd->cpu_clk = vco / temp;       /* cpu clock */
 
                temp = ((in_be32(&pll->pcr) & PLL_PCR_OUTDIV2_MASK) >> 4) + 1;
-               gd->flb_clk = vco / temp;       /* flexbus clock */
-               gd->bus_clk = gd->flb_clk;
+               gd->arch.flb_clk = vco / temp;  /* flexbus clock */
+               gd->bus_clk = gd->arch.flb_clk;
        }
 
 #ifdef CONFIG_FSL_I2C
index b612cdaea1ac28975184fbb090c79c40f69d7ab6..08930f48d7be4d0dc8605a4b962cfb4471cc7fab 100644 (file)
@@ -101,16 +101,16 @@ int checkcpu(void)
                printf("       CPU CLK %s MHz BUS CLK %s MHz FLB CLK %s MHz\n",
                       strmhz(buf1, gd->cpu_clk),
                       strmhz(buf2, gd->bus_clk),
-                      strmhz(buf3, gd->flb_clk));
+                      strmhz(buf3, gd->arch.flb_clk));
 #ifdef CONFIG_PCI
                printf("       PCI CLK %s MHz INP CLK %s MHz VCO CLK %s MHz\n",
                       strmhz(buf1, gd->pci_clk),
-                      strmhz(buf2, gd->inp_clk),
-                      strmhz(buf3, gd->vco_clk));
+                      strmhz(buf2, gd->arch.inp_clk),
+                      strmhz(buf3, gd->arch.vco_clk));
 #else
                printf("       INP CLK %s MHz VCO CLK %s MHz\n",
-                      strmhz(buf1, gd->inp_clk),
-                      strmhz(buf2, gd->vco_clk));
+                      strmhz(buf1, gd->arch.inp_clk),
+                      strmhz(buf2, gd->arch.vco_clk));
 #endif
        }
 
index b7dbc65988d52fcbcd60a383d24aa2473a7beeef..aa73e1f0252e33f1b9b9d95b7cf0e35fb06f15b7 100644 (file)
@@ -233,7 +233,7 @@ void setup_5445x_clocks(void)
 
                        out_be32(&pll->pcr, pcrvalue);
                }
-               gd->vco_clk = vco;      /* Vco clock */
+               gd->arch.vco_clk = vco; /* Vco clock */
        } else if (bootmode == 2) {
                /* Normal mode */
                vco =  ((in_be32(&pll->pcr) & 0xFF000000) >> 24) * CONFIG_SYS_INPUT_CLKSRC;
@@ -244,17 +244,17 @@ void setup_5445x_clocks(void)
                        out_be32(&pll->pcr, pcrvalue);
                        vco = ((in_be32(&pll->pcr) & 0xFF000000) >> 24) * CONFIG_SYS_INPUT_CLKSRC;
                }
-               gd->vco_clk = vco;      /* Vco clock */
+               gd->arch.vco_clk = vco; /* Vco clock */
        } else if (bootmode == 3) {
                /* serial mode */
                vco =  ((in_be32(&pll->pcr) & 0xFF000000) >> 24) * CONFIG_SYS_INPUT_CLKSRC;
-               gd->vco_clk = vco;      /* Vco clock */
+               gd->arch.vco_clk = vco; /* Vco clock */
        }
 
        if ((in_be16(&ccm->ccr) & CCM_MISCCR_LIMP) == CCM_MISCCR_LIMP) {
                /* Limp mode */
        } else {
-               gd->inp_clk = CONFIG_SYS_INPUT_CLKSRC;  /* Input clock */
+               gd->arch.inp_clk = CONFIG_SYS_INPUT_CLKSRC; /* Input clock */
 
                temp = (in_be32(&pll->pcr) & PLL_PCR_OUTDIV1_MASK) + 1;
                gd->cpu_clk = vco / temp;       /* cpu clock */
@@ -263,7 +263,7 @@ void setup_5445x_clocks(void)
                gd->bus_clk = vco / temp;       /* bus clock */
 
                temp = ((in_be32(&pll->pcr) & PLL_PCR_OUTDIV3_MASK) >> 8) + 1;
-               gd->flb_clk = vco / temp;       /* FlexBus clock */
+               gd->arch.flb_clk = vco / temp;  /* FlexBus clock */
 
 #ifdef CONFIG_PCI
                if (bPci) {
index d9be8b121dd21bf2490d91c3a94dda6e6f2ffa32..9f37dcce4c6636e9c10813133462690484c50684 100644 (file)
@@ -30,6 +30,11 @@ struct arch_global_data {
        unsigned long   i2c1_clk;
        unsigned long   i2c2_clk;
 #endif
+#ifdef CONFIG_EXTRA_CLOCK
+       unsigned long inp_clk;
+       unsigned long vco_clk;
+       unsigned long flb_clk;
+#endif
 };
 
 /*
@@ -48,11 +53,6 @@ typedef      struct  global_data {
        unsigned long   bus_clk;
 #ifdef CONFIG_PCI
        unsigned long   pci_clk;
-#endif
-#ifdef CONFIG_EXTRA_CLOCK
-       unsigned long   inp_clk;
-       unsigned long   vco_clk;
-       unsigned long   flb_clk;
 #endif
        phys_size_t     ram_size;       /* RAM size */
        unsigned long   reloc_off;      /* Relocation Offset */
index e934cb6c25f5d49eebcb50b8535d1e74ae6f7e92..c372ae228b5572c2208daa6a07973ffc48c73e9d 100644 (file)
@@ -349,9 +349,9 @@ board_init_f (ulong bootflag)
        bd->bi_pcifreq = gd->pci_clk;           /* PCI Freq in Hz */
 #endif
 #ifdef CONFIG_EXTRA_CLOCK
-       bd->bi_inpfreq = gd->inp_clk;           /* input Freq in Hz */
-       bd->bi_vcofreq = gd->vco_clk;           /* vco Freq in Hz */
-       bd->bi_flbfreq = gd->flb_clk;           /* flexbus Freq in Hz */
+       bd->bi_inpfreq = gd->arch.inp_clk;              /* input Freq in Hz */
+       bd->bi_vcofreq = gd->arch.vco_clk;              /* vco Freq in Hz */
+       bd->bi_flbfreq = gd->arch.flb_clk;              /* flexbus Freq in Hz */
 #endif
        bd->bi_baudrate = gd->baudrate; /* Console Baudrate     */