2019-06-04 16:11:33 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2015-04-04 00:43:45 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
|
|
|
|
*
|
|
|
|
* Common Clock Framework support for all PLL's in Samsung platforms
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __SAMSUNG_CLK_CPU_H
|
|
|
|
#define __SAMSUNG_CLK_CPU_H
|
|
|
|
|
|
|
|
#include "clk.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct exynos_cpuclk_data: config data to setup cpu clocks.
|
|
|
|
* @prate: frequency of the primary parent clock (in KHz).
|
|
|
|
* @div0: value to be programmed in the div_cpu0 register.
|
|
|
|
* @div1: value to be programmed in the div_cpu1 register.
|
|
|
|
*
|
|
|
|
* This structure holds the divider configuration data for dividers in the CPU
|
|
|
|
* clock domain. The parent frequency at which these divider values are valid is
|
|
|
|
* specified in @prate. The @prate is the frequency of the primary parent clock.
|
|
|
|
* For CPU clock domains that do not have a DIV1 register, the @div1 member
|
|
|
|
* value is not used.
|
|
|
|
*/
|
|
|
|
struct exynos_cpuclk_cfg_data {
|
|
|
|
unsigned long prate;
|
|
|
|
unsigned long div0;
|
|
|
|
unsigned long div1;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct exynos_cpuclk: information about clock supplied to a CPU core.
|
|
|
|
* @hw: handle between CCF and CPU clock.
|
|
|
|
* @alt_parent: alternate parent clock to use when switching the speed
|
|
|
|
* of the primary parent clock.
|
|
|
|
* @ctrl_base: base address of the clock controller.
|
|
|
|
* @lock: cpu clock domain register access lock.
|
|
|
|
* @cfg: cpu clock rate configuration data.
|
|
|
|
* @num_cfgs: number of array elements in @cfg array.
|
|
|
|
* @clk_nb: clock notifier registered for changes in clock speed of the
|
|
|
|
* primary parent clock.
|
|
|
|
* @flags: configuration flags for the CPU clock.
|
|
|
|
*
|
|
|
|
* This structure holds information required for programming the CPU clock for
|
|
|
|
* various clock speeds.
|
|
|
|
*/
|
|
|
|
struct exynos_cpuclk {
|
|
|
|
struct clk_hw hw;
|
2020-08-27 01:15:29 +08:00
|
|
|
const struct clk_hw *alt_parent;
|
2015-04-04 00:43:45 +08:00
|
|
|
void __iomem *ctrl_base;
|
|
|
|
spinlock_t *lock;
|
|
|
|
const struct exynos_cpuclk_cfg_data *cfg;
|
|
|
|
const unsigned long num_cfgs;
|
|
|
|
struct notifier_block clk_nb;
|
|
|
|
unsigned long flags;
|
|
|
|
|
2016-05-24 21:19:16 +08:00
|
|
|
/* The CPU clock registers have DIV1 configuration register */
|
2015-04-04 00:43:45 +08:00
|
|
|
#define CLK_CPU_HAS_DIV1 (1 << 0)
|
|
|
|
/* When ALT parent is active, debug clocks need safe divider values */
|
|
|
|
#define CLK_CPU_NEEDS_DEBUG_ALT_DIV (1 << 1)
|
2016-05-24 21:19:16 +08:00
|
|
|
/* The CPU clock registers have Exynos5433-compatible layout */
|
|
|
|
#define CLK_CPU_HAS_E5433_REGS_LAYOUT (1 << 2)
|
2015-04-04 00:43:45 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __SAMSUNG_CLK_CPU_H */
|