diff options
author | Dinh Nguyen <dinguyen@altera.com> | 2014-05-12 21:27:22 +0400 |
---|---|---|
committer | Dinh Nguyen <dinguyen@altera.com> | 2014-05-12 21:27:22 +0400 |
commit | 0691bb1b5a1865b3bbc9b7ce6e26eff546abb1cf (patch) | |
tree | 1011296d0c0a3ec703f73880c96667be0f569eee /drivers/clk/socfpga/clk.h | |
parent | d1db0eea852497762cab43b905b879dfcd3b8987 (diff) | |
download | linux-0691bb1b5a1865b3bbc9b7ce6e26eff546abb1cf.tar.xz |
clk: socfpga: add divider registers to the main pll outputs
The C0(mpu_clk), C1(main_clk), and C2(dbg_base_clk) outputs from the main
PLL go through a pre-divider before coming into the system. These registers
were hidden for the CycloneV platform, but are now used for the ArriaV
platform.
This patch updates the clock driver to read the div-reg property for the
socfpga-periph-clk clocks. Also moves the div_mask define to clk.h for re-use.
Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
Diffstat (limited to 'drivers/clk/socfpga/clk.h')
-rw-r--r-- | drivers/clk/socfpga/clk.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/clk/socfpga/clk.h b/drivers/clk/socfpga/clk.h index d2e54019c94f..d291f60c46e1 100644 --- a/drivers/clk/socfpga/clk.h +++ b/drivers/clk/socfpga/clk.h @@ -27,6 +27,7 @@ #define CLKMGR_PERPLL_SRC 0xAC #define SOCFPGA_MAX_PARENTS 3 +#define div_mask(width) ((1 << (width)) - 1) extern void __iomem *clk_mgr_base_addr; @@ -52,6 +53,9 @@ struct socfpga_periph_clk { struct clk_gate hw; char *parent_name; u32 fixed_div; + void __iomem *div_reg; + u32 width; /* only valid if div_reg != 0 */ + u32 shift; /* only valid if div_reg != 0 */ }; #endif /* SOCFPGA_CLK_H */ |