2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
8 * Common Clock Framework support for all PLL's in Samsung platforms
11 #ifndef __SAMSUNG_CLK_CPU_H
12 #define __SAMSUNG_CLK_CPU_H
17 * struct exynos_cpuclk_data: config data to setup cpu clocks.
18 * @prate: frequency of the primary parent clock (in KHz).
19 * @div0: value to be programmed in the div_cpu0 register.
20 * @div1: value to be programmed in the div_cpu1 register.
22 * This structure holds the divider configuration data for dividers in the CPU
23 * clock domain. The parent frequency at which these divider values are valid is
24 * specified in @prate. The @prate is the frequency of the primary parent clock.
25 * For CPU clock domains that do not have a DIV1 register, the @div1 member
28 struct exynos_cpuclk_cfg_data
{
35 * struct exynos_cpuclk: information about clock supplied to a CPU core.
36 * @hw: handle between CCF and CPU clock.
37 * @alt_parent: alternate parent clock to use when switching the speed
38 * of the primary parent clock.
39 * @ctrl_base: base address of the clock controller.
40 * @lock: cpu clock domain register access lock.
41 * @cfg: cpu clock rate configuration data.
42 * @num_cfgs: number of array elements in @cfg array.
43 * @clk_nb: clock notifier registered for changes in clock speed of the
44 * primary parent clock.
45 * @flags: configuration flags for the CPU clock.
47 * This structure holds information required for programming the CPU clock for
48 * various clock speeds.
50 struct exynos_cpuclk
{
52 struct clk
*alt_parent
;
53 void __iomem
*ctrl_base
;
55 const struct exynos_cpuclk_cfg_data
*cfg
;
56 const unsigned long num_cfgs
;
57 struct notifier_block clk_nb
;
60 /* The CPU clock registers has DIV1 configuration register */
61 #define CLK_CPU_HAS_DIV1 (1 << 0)
62 /* When ALT parent is active, debug clocks need safe divider values */
63 #define CLK_CPU_NEEDS_DEBUG_ALT_DIV (1 << 1)
66 extern int __init
exynos_register_cpu_clock(struct samsung_clk_provider
*ctx
,
67 unsigned int lookup_id
, const char *name
,
68 const char *parent
, const char *alt_parent
,
70 const struct exynos_cpuclk_cfg_data
*cfg
,
71 unsigned long num_cfgs
, unsigned long flags
);
73 #endif /* __SAMSUNG_CLK_CPU_H */