]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: S3C24XX: Add infrastructure to transmit armdiv to common code
authorHeiko Stuebner <heiko@sntech.de>
Fri, 14 Oct 2011 06:08:56 +0000 (15:08 +0900)
committerKukjin Kim <kgene.kim@samsung.com>
Fri, 14 Oct 2011 06:15:49 +0000 (15:15 +0900)
This is needed for making the armdiv clock common to S3C2443
and S3C2416/2450.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
arch/arm/mach-s3c2416/clock.c
arch/arm/mach-s3c2443/clock.c
arch/arm/plat-s3c24xx/s3c2443-clock.c
arch/arm/plat-samsung/include/plat/s3c2443.h

index 5569def1a10724d73ee28d3b6e912ae6a4514c22..3060796b0e7dc05569cdf27fd54712dae0bc7273 100644 (file)
@@ -158,7 +158,9 @@ void __init s3c2416_init_clocks(int xtal)
 
        clk_epll.parent = &clk_epllref.clk;
 
-       s3c2443_common_init_clocks(xtal, s3c2416_get_pll, s3c2416_fclk_div);
+       s3c2443_common_init_clocks(xtal, s3c2416_get_pll, s3c2416_fclk_div,
+                                  armdiv, ARRAY_SIZE(armdiv),
+                                  S3C2416_CLKDIV0_ARMDIV_MASK);
 
        for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++)
                s3c_register_clksrc(clksrcs[ptr], 1);
index cd51d04e1de7f429a3fce43ff1db4e801a5ed480..88edc55838a1a4e43a67de71da1c8146028898b4 100644 (file)
@@ -283,7 +283,9 @@ void __init s3c2443_init_clocks(int xtal)
        clk_epll.rate = s3c2443_get_epll(epllcon, xtal);
        clk_epll.parent = &clk_epllref.clk;
 
-       s3c2443_common_init_clocks(xtal, s3c2443_get_mpll, s3c2443_fclk_div);
+       s3c2443_common_init_clocks(xtal, s3c2443_get_mpll, s3c2443_fclk_div,
+                                  armdiv, ARRAY_SIZE(armdiv),
+                                  S3C2443_CLKDIV0_ARMDIV_MASK);
 
        s3c2443_setup_clocks();
 
index 07a4c81587acbc9788e959e507e04d6c319b51f4..3f2117b8c0d4d0c44234ed8470134e6d672b61fd 100644 (file)
@@ -160,6 +160,10 @@ static struct clk clk_prediv = {
        },
 };
 
+static unsigned int *armdiv;
+static int nr_armdiv;
+static int armdivmask;
+
 /* usbhost
  *
  * usb host bus-clock, usually 48MHz to provide USB bus clock timing
@@ -470,10 +474,16 @@ static struct clksrc_clk *clksrcs[] __initdata = {
 };
 
 void __init s3c2443_common_init_clocks(int xtal, pll_fn get_mpll,
-                                      fdiv_fn get_fdiv)
+                                      fdiv_fn get_fdiv,
+                                      unsigned int *divs, int nr_divs,
+                                      int divmask)
 {
        int ptr;
 
+       armdiv = divs;
+       nr_armdiv = nr_divs;
+       armdivmask = divmask;
+
        /* s3c2443 parents h and p clocks from prediv */
        clk_h.parent = &clk_prediv;
        clk_p.parent = &clk_prediv;
index 4b2ac9a272b2bfd3dde71da16874b9d1e0598636..5fc4ad0fd756ce6223f30a18215afd32e038bb0d 100644 (file)
@@ -40,7 +40,9 @@ typedef unsigned int (*pll_fn)(unsigned int reg, unsigned int base);
 typedef unsigned int (*fdiv_fn)(unsigned long clkcon0);
 
 extern void s3c2443_common_setup_clocks(pll_fn get_mpll, fdiv_fn fdiv);
-extern void s3c2443_common_init_clocks(int xtal, pll_fn get_mpll, fdiv_fn fdiv);
+extern void s3c2443_common_init_clocks(int xtal, pll_fn get_mpll, fdiv_fn fdiv,
+                                      unsigned int *divs, int nr_divs,
+                                      int divmask);
 
 extern int s3c2443_clkcon_enable_h(struct clk *clk, int enable);
 extern int s3c2443_clkcon_enable_p(struct clk *clk, int enable);