blob: 2ac53b538dc682fe99830e93d888e3749947cfae [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Jorge Ramirez-Ortiz92c1eff2018-01-10 11:33:49 +01002/*
Dzmitry Sankouski038f2b92021-10-17 13:44:30 +03003 * Qualcomm APQ8016, APQ8096, SDM845
Jorge Ramirez-Ortiz92c1eff2018-01-10 11:33:49 +01004 *
5 * (C) Copyright 2017 Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Jorge Ramirez-Ortiz92c1eff2018-01-10 11:33:49 +01006 */
7#ifndef _CLOCK_SNAPDRAGON_H
8#define _CLOCK_SNAPDRAGON_H
9
10#define CFG_CLK_SRC_CXO (0 << 8)
11#define CFG_CLK_SRC_GPLL0 (1 << 8)
Dzmitry Sankouski038f2b92021-10-17 13:44:30 +030012#define CFG_CLK_SRC_GPLL0_EVEN (6 << 8)
Jorge Ramirez-Ortiz92c1eff2018-01-10 11:33:49 +010013#define CFG_CLK_SRC_MASK (7 << 8)
14
Ramon Friedae299772018-05-16 12:13:39 +030015struct pll_vote_clk {
Jorge Ramirez-Ortiz92c1eff2018-01-10 11:33:49 +010016 uintptr_t status;
17 int status_bit;
18 uintptr_t ena_vote;
19 int vote_bit;
20};
21
Ramon Friedae299772018-05-16 12:13:39 +030022struct vote_clk {
23 uintptr_t cbcr_reg;
24 uintptr_t ena_vote;
25 int vote_bit;
26};
Jorge Ramirez-Ortiz92c1eff2018-01-10 11:33:49 +010027struct bcr_regs {
28 uintptr_t cfg_rcgr;
29 uintptr_t cmd_rcgr;
30 uintptr_t M;
31 uintptr_t N;
32 uintptr_t D;
33};
34
35struct msm_clk_priv {
36 phys_addr_t base;
37};
38
Ramon Friedae299772018-05-16 12:13:39 +030039void clk_enable_gpll0(phys_addr_t base, const struct pll_vote_clk *gpll0);
Jorge Ramirez-Ortiz92c1eff2018-01-10 11:33:49 +010040void clk_bcr_update(phys_addr_t apps_cmd_rgcr);
41void clk_enable_cbc(phys_addr_t cbcr);
Ramon Friedae299772018-05-16 12:13:39 +030042void clk_enable_vote_clk(phys_addr_t base, const struct vote_clk *vclk);
Jorge Ramirez-Ortiz92c1eff2018-01-10 11:33:49 +010043void clk_rcg_set_rate_mnd(phys_addr_t base, const struct bcr_regs *regs,
44 int div, int m, int n, int source);
45
46#endif