From: Frank Wang Date: Wed, 5 Apr 2017 01:35:37 +0000 (+0800) Subject: soc: rockchip: amend rk3368-mbox related *.h to soc/rockchip X-Git-Tag: firefly_0821_release~136 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=51abcbf5c17c860da5092a485cb8bd4b37a6d51b;p=firefly-linux-kernel-4.4.55.git soc: rockchip: amend rk3368-mbox related *.h to soc/rockchip This adds move rk3368-mbox related *.h files from linux/rockchip to soc/rockchip. Change-Id: I2d57b6baa64d531e89766a5384d8c217cf347ebf Signed-off-by: Frank Wang --- diff --git a/drivers/mailbox/rk3368-mailbox.c b/drivers/mailbox/rk3368-mailbox.c index 34263d7453d2..03f3a74d4623 100644 --- a/drivers/mailbox/rk3368-mailbox.c +++ b/drivers/mailbox/rk3368-mailbox.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Fuzhou Rockchip Electronics Co., Ltd + * Copyright (c) 2017, Fuzhou Rockchip Electronics Co., Ltd * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -22,8 +22,8 @@ #include #include -#include -#include +#include +#include #define MAILBOX_VERSION "V1.00" diff --git a/drivers/mailbox/scpi_protocol.c b/drivers/mailbox/scpi_protocol.c index 9cc5384e070e..4ace0a2d4f62 100644 --- a/drivers/mailbox/scpi_protocol.c +++ b/drivers/mailbox/scpi_protocol.c @@ -2,7 +2,7 @@ * System Control and Power Interface (SCPI) Message Protocol driver * * Copyright (C) 2014 ARM Ltd. - * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd + * Copyright (c) 2017, Fuzhou Rockchip Electronics Co., Ltd * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -25,8 +25,8 @@ #include #include #include -#include -#include +#include +#include #define SCPI_VERSION 0x01000002 /* version: 1.0.0.2 */ diff --git a/include/linux/rockchip/rk3368-mailbox.h b/include/linux/rockchip/rk3368-mailbox.h deleted file mode 100644 index 659375c7d874..000000000000 --- a/include/linux/rockchip/rk3368-mailbox.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - */ - -#ifndef __MAILBOX_ROCKCHIP_H__ -#define __MAILBOX_ROCKCHIP_H__ - -struct rk3368_mbox_msg { - u32 cmd; - int tx_size; - void *tx_buf; - int rx_size; - void *rx_buf; - void *cl_data; -}; - -#endif /* __MAILBOX_ROCKCHIP_H__ */ diff --git a/include/linux/rockchip/scpi.h b/include/linux/rockchip/scpi.h deleted file mode 100644 index 468a35095c13..000000000000 --- a/include/linux/rockchip/scpi.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - * SCPI Message Protocol driver header - * - * Copyright (C) 2014 ARM Ltd. - * Copyright (C) 2014, Fuzhou Rockchip Electronics Co., Ltd - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - */ -#include -#include - -#ifdef CONFIG_RK3368_SCPI_PROTOCOL -struct scpi_opp_entry { - u32 freq_hz; - u32 volt_mv; -} __packed; - -struct scpi_opp { - struct scpi_opp_entry *opp; - u32 latency; /* in usecs */ - int count; -} __packed; - -unsigned long scpi_clk_get_val(u16 clk_id); -int scpi_clk_set_val(u16 clk_id, unsigned long rate); -int scpi_dvfs_get_idx(u8 domain); -int scpi_dvfs_set_idx(u8 domain, u8 idx); -struct scpi_opp *scpi_dvfs_get_opps(u8 domain); -int scpi_get_sensor(char *name); -int scpi_get_sensor_value(u16 sensor, u32 *val); -int scpi_sys_set_jtagmux_on_off(u32 en); -int scpi_sys_set_mcu_state_suspend(void); -int scpi_sys_set_mcu_state_resume(void); - -int scpi_ddr_init(u32 dram_speed_bin, u32 freq, u32 lcdc_type, - u32 addr_mcu_el3); -int scpi_ddr_set_clk_rate(u32 rate, u32 lcdc_type); -int scpi_ddr_send_timing(u32 *p, u32 size); -int scpi_ddr_round_rate(u32 m_hz); -int scpi_ddr_set_auto_self_refresh(u32 en); -int scpi_ddr_bandwidth_get(struct ddr_bw_info *ddr_bw_ch0, - struct ddr_bw_info *ddr_bw_ch1); -int scpi_ddr_get_clk_rate(void); -int scpi_thermal_get_temperature(void); -int scpi_thermal_set_clk_cycle(u32 cycle); -#else -static inline unsigned long scpi_clk_get_val(u16 clk_id) -{ - return -EPERM; -} - -static inline int scpi_clk_set_val(u16 clk_id, unsigned long rate) -{ - return -EPERM; -} - -static inline int scpi_dvfs_get_idx(u8 domain) -{ - return -EPERM; -} - -static inline int scpi_dvfs_set_idx(u8 domain, u8 idx) -{ - return -EPERM; -} - -static inline struct scpi_opp *scpi_dvfs_get_opps(u8 domain) -{ - return ERR_PTR(-EPERM); -} - -static inline int scpi_get_sensor(char *name) -{ - return -EPERM; -} - -static inline int scpi_get_sensor_value(u16 sensor, u32 *val) -{ - return -EPERM; -} - -static int scpi_sys_set_jtagmux_on_off(u32 en) -{ - return -EPERM; -} - -static inline int scpi_sys_set_mcu_state_suspend(void) -{ - return -EPERM; -} - -static inline int scpi_sys_set_mcu_state_resume(void) -{ - return -EPERM; -} - -static inline int scpi_ddr_init(u32 dram_speed_bin, u32 freq, u32 lcdc_type, - u32 addr_mcu_el3) -{ - return -EPERM; -} - -static inline int scpi_ddr_set_clk_rate(u32 rate, u32 lcdc_type) -{ - return -EPERM; -} - -static inline int scpi_ddr_send_timing(u32 *p, u32 size) -{ - return -EPERM; -} - -static inline int scpi_ddr_round_rate(u32 m_hz) -{ - return -EPERM; -} - -static inline int scpi_ddr_set_auto_self_refresh(u32 en) -{ - return -EPERM; -} - -static inline int scpi_ddr_bandwidth_get(struct ddr_bw_info *ddr_bw_ch0, - struct ddr_bw_info *ddr_bw_ch1) -{ - return -EPERM; -} - -static inline int scpi_ddr_get_clk_rate(void) -{ - return -EPERM; -} - -static inline int scpi_thermal_get_temperature(void) -{ - return -EPERM; -} - -static inline int scpi_thermal_set_clk_cycle(u32 cycle) -{ - return -EPERM; -} -#endif diff --git a/include/soc/rockchip/rk3368-mailbox.h b/include/soc/rockchip/rk3368-mailbox.h new file mode 100644 index 000000000000..77208277f419 --- /dev/null +++ b/include/soc/rockchip/rk3368-mailbox.h @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2017, Fuzhou Rockchip Electronics Co., Ltd + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#ifndef __RK3368_MAILBOX_H__ +#define __RK3368_MAILBOX_H__ + +struct rk3368_mbox_msg { + u32 cmd; + int tx_size; + void *tx_buf; + int rx_size; + void *rx_buf; + void *cl_data; +}; + +#endif /* __RK3368_MAILBOX_H__ */ diff --git a/include/soc/rockchip/scpi.h b/include/soc/rockchip/scpi.h new file mode 100644 index 000000000000..a2fc901f9cd2 --- /dev/null +++ b/include/soc/rockchip/scpi.h @@ -0,0 +1,151 @@ +/* + * Copyright (C) 2017, Fuzhou Rockchip Electronics Co., Ltd + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __SOC_ROCKCHIP_SCPI_H +#define __SOC_ROCKCHIP_SCPI_H + +#include + +#ifdef CONFIG_RK3368_SCPI_PROTOCOL +struct scpi_opp_entry { + u32 freq_hz; + u32 volt_mv; +} __packed; + +struct scpi_opp { + struct scpi_opp_entry *opp; + u32 latency; /* in usecs */ + int count; +} __packed; + +unsigned long scpi_clk_get_val(u16 clk_id); +int scpi_clk_set_val(u16 clk_id, unsigned long rate); +int scpi_dvfs_get_idx(u8 domain); +int scpi_dvfs_set_idx(u8 domain, u8 idx); +struct scpi_opp *scpi_dvfs_get_opps(u8 domain); +int scpi_get_sensor(char *name); +int scpi_get_sensor_value(u16 sensor, u32 *val); +int scpi_sys_set_jtagmux_on_off(u32 en); +int scpi_sys_set_mcu_state_suspend(void); +int scpi_sys_set_mcu_state_resume(void); + +int scpi_ddr_init(u32 dram_speed_bin, u32 freq, u32 lcdc_type, + u32 addr_mcu_el3); +int scpi_ddr_set_clk_rate(u32 rate, u32 lcdc_type); +int scpi_ddr_send_timing(u32 *p, u32 size); +int scpi_ddr_round_rate(u32 m_hz); +int scpi_ddr_set_auto_self_refresh(u32 en); +int scpi_ddr_bandwidth_get(struct ddr_bw_info *ddr_bw_ch0, + struct ddr_bw_info *ddr_bw_ch1); +int scpi_ddr_get_clk_rate(void); +int scpi_thermal_get_temperature(void); +int scpi_thermal_set_clk_cycle(u32 cycle); +#else +static inline unsigned long scpi_clk_get_val(u16 clk_id) +{ + return -EPERM; +} + +static inline int scpi_clk_set_val(u16 clk_id, unsigned long rate) +{ + return -EPERM; +} + +static inline int scpi_dvfs_get_idx(u8 domain) +{ + return -EPERM; +} + +static inline int scpi_dvfs_set_idx(u8 domain, u8 idx) +{ + return -EPERM; +} + +static inline struct scpi_opp *scpi_dvfs_get_opps(u8 domain) +{ + return ERR_PTR(-EPERM); +} + +static inline int scpi_get_sensor(char *name) +{ + return -EPERM; +} + +static inline int scpi_get_sensor_value(u16 sensor, u32 *val) +{ + return -EPERM; +} + +static int scpi_sys_set_jtagmux_on_off(u32 en) +{ + return -EPERM; +} + +static inline int scpi_sys_set_mcu_state_suspend(void) +{ + return -EPERM; +} + +static inline int scpi_sys_set_mcu_state_resume(void) +{ + return -EPERM; +} + +static inline int scpi_ddr_init(u32 dram_speed_bin, u32 freq, u32 lcdc_type, + u32 addr_mcu_el3) +{ + return -EPERM; +} + +static inline int scpi_ddr_set_clk_rate(u32 rate, u32 lcdc_type) +{ + return -EPERM; +} + +static inline int scpi_ddr_send_timing(u32 *p, u32 size) +{ + return -EPERM; +} + +static inline int scpi_ddr_round_rate(u32 m_hz) +{ + return -EPERM; +} + +static inline int scpi_ddr_set_auto_self_refresh(u32 en) +{ + return -EPERM; +} + +static inline int scpi_ddr_bandwidth_get(struct ddr_bw_info *ddr_bw_ch0, + struct ddr_bw_info *ddr_bw_ch1) +{ + return -EPERM; +} + +static inline int scpi_ddr_get_clk_rate(void) +{ + return -EPERM; +} + +static inline int scpi_thermal_get_temperature(void) +{ + return -EPERM; +} + +static inline int scpi_thermal_set_clk_cycle(u32 cycle) +{ + return -EPERM; +} +#endif +#endif