rk3368 ddr: add configure ddr timing function
[firefly-linux-kernel-4.4.55.git] / include / linux / scpi_protocol.h
1 /*
2  * SCPI Message Protocol driver header
3  *
4  * Copyright (C) 2014 ARM Ltd.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms and conditions of the GNU General Public License,
8  * version 2, as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along with
16  * this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 #include <linux/types.h>
19 #include <linux/rockchip/common.h>
20
21 struct scpi_opp_entry {
22         u32 freq_hz;
23         u32 volt_mv;
24 } __packed;
25
26 struct scpi_opp {
27         struct scpi_opp_entry *opp;
28         u32 latency; /* in usecs */
29         int count;
30 } __packed;
31
32 unsigned long scpi_clk_get_val(u16 clk_id);
33 int scpi_clk_set_val(u16 clk_id, unsigned long rate);
34 int scpi_dvfs_get_idx(u8 domain);
35 int scpi_dvfs_set_idx(u8 domain, u8 idx);
36 struct scpi_opp *scpi_dvfs_get_opps(u8 domain);
37 int scpi_get_sensor(char *name);
38 int scpi_get_sensor_value(u16 sensor, u32 *val);
39
40 int scpi_sys_set_mcu_state_suspend(void);
41 int scpi_sys_set_mcu_state_resume(void);
42
43 int scpi_ddr_init(u32 dram_speed_bin, u32 freq, u32 lcdc_type,
44                   u32 addr_mcu_el3);
45 int scpi_ddr_set_clk_rate(u32 rate, u32 lcdc_type);
46 int scpi_ddr_send_timing(u32 *p, u32 size);
47 int scpi_ddr_round_rate(u32 m_hz);
48 int scpi_ddr_set_auto_self_refresh(u32 en);
49 int scpi_ddr_bandwidth_get(struct ddr_bw_info *ddr_bw_ch0,
50                            struct ddr_bw_info *ddr_bw_ch1);
51 int scpi_ddr_get_clk_rate(void);
52 int scpi_thermal_get_temperature(void);
53 int scpi_thermal_set_clk_cycle(u32 cycle);