aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/mediatek
diff options
context:
space:
mode:
authorJie Qiu <jie.qiu@mediatek.com>2016-01-04 12:36:39 -0500
committerPhilipp Zabel <p.zabel@pengutronix.de>2016-06-16 10:30:38 -0400
commit56ba355d6b45c74fb9e93361e3af922fcc5d1129 (patch)
tree3a87970c72524348a6ae7fd8f75eb5004087784e /drivers/gpu/drm/mediatek
parent8f83f26891e12570780dcfc8ae376b655915ff6d (diff)
drm/mediatek: enable hdmi output control bit
MT8173 HDMI hardware has a output control bit to enable/disable HDMI output. Because of security reason, so this bit can ONLY be controlled in ARM supervisor mode. Now the only way to enter ARM supervisor is the ARM trusted firmware. So atf provides a API for HDMI driver to call to setup this HDMI control bit to enable HDMI output in supervisor mode. Signed-off-by: Jie Qiu <jie.qiu@mediatek.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'drivers/gpu/drm/mediatek')
-rw-r--r--drivers/gpu/drm/mediatek/mtk_hdmi.c12
-rw-r--r--drivers/gpu/drm/mediatek/mtk_hdmi_regs.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c
index 8ec1ea4477e2..ba812ef2c9d1 100644
--- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
+++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
@@ -16,6 +16,7 @@
16#include <drm/drm_crtc.h> 16#include <drm/drm_crtc.h>
17#include <drm/drm_crtc_helper.h> 17#include <drm/drm_crtc_helper.h>
18#include <drm/drm_edid.h> 18#include <drm/drm_edid.h>
19#include <linux/arm-smccc.h>
19#include <linux/clk.h> 20#include <linux/clk.h>
20#include <linux/delay.h> 21#include <linux/delay.h>
21#include <linux/hdmi.h> 22#include <linux/hdmi.h>
@@ -230,6 +231,17 @@ static void mtk_hdmi_hw_vid_black(struct mtk_hdmi *hdmi, bool black)
230 231
231static void mtk_hdmi_hw_make_reg_writable(struct mtk_hdmi *hdmi, bool enable) 232static void mtk_hdmi_hw_make_reg_writable(struct mtk_hdmi *hdmi, bool enable)
232{ 233{
234 struct arm_smccc_res res;
235
236 /*
237 * MT8173 HDMI hardware has an output control bit to enable/disable HDMI
238 * output. This bit can only be controlled in ARM supervisor mode.
239 * The ARM trusted firmware provides an API for the HDMI driver to set
240 * this control bit to enable HDMI output in supervisor mode.
241 */
242 arm_smccc_smc(MTK_SIP_SET_AUTHORIZED_SECURE_REG, 0x14000904, 0x80000000,
243 0, 0, 0, 0, 0, &res);
244
233 regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG20, 245 regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG20,
234 HDMI_PCLK_FREE_RUN, enable ? HDMI_PCLK_FREE_RUN : 0); 246 HDMI_PCLK_FREE_RUN, enable ? HDMI_PCLK_FREE_RUN : 0);
235 regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG1C, 247 regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG1C,
diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi_regs.h b/drivers/gpu/drm/mediatek/mtk_hdmi_regs.h
index 209fbe194442..a5cb07d12c9c 100644
--- a/drivers/gpu/drm/mediatek/mtk_hdmi_regs.h
+++ b/drivers/gpu/drm/mediatek/mtk_hdmi_regs.h
@@ -234,4 +234,5 @@
234#define MHL_SYNC_AUTO_EN BIT(30) 234#define MHL_SYNC_AUTO_EN BIT(30)
235#define HDMI_PCLK_FREE_RUN BIT(31) 235#define HDMI_PCLK_FREE_RUN BIT(31)
236 236
237#define MTK_SIP_SET_AUTHORIZED_SECURE_REG 0x82000001
237#endif 238#endif