From 2519b6cd920f6d315bc463ba292aa89177c52fe7 Mon Sep 17 00:00:00 2001 From: Ye Li Date: Mon, 11 Feb 2019 19:09:52 -0800 Subject: [PATCH] MLK-20971 imx8mq: Not disable DCSS for 8MQLite new part The iMX8MQLite new part will not disable DCSS in fuse. So change the codes to check the DCSS fuse before disable relevant FDT nodes and u-boot HDMI splash screen. Signed-off-by: Ye Li (cherry picked from commit 9e6ab0397b8d94de8b904250884726e58633066b) --- arch/arm/include/asm/arch-imx8m/sys_proto.h | 5 ++++- arch/arm/mach-imx/imx8m/soc.c | 21 +++++++++++++++++++-- arch/arm/mach-imx/imx8m/video_common.c | 4 ++-- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/arch/arm/include/asm/arch-imx8m/sys_proto.h b/arch/arm/include/asm/arch-imx8m/sys_proto.h index cdf268f..e01a685 100644 --- a/arch/arm/include/asm/arch-imx8m/sys_proto.h +++ b/arch/arm/include/asm/arch-imx8m/sys_proto.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 NXP + * Copyright (C) 2017-2019 NXP * * SPDX-License-Identifier: GPL-2.0+ */ @@ -16,4 +16,7 @@ int imx8m_usb_power(int usb_id, bool on); extern unsigned long rom_pointer[]; enum boot_device get_boot_device(void); bool is_usb_boot(void); +#ifdef CONFIG_IMX8MQ +bool check_dcss_fused(void); +#endif #endif diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index ff7b16e..c8d2af8 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -398,6 +398,20 @@ add_status: } #ifdef CONFIG_IMX8MQ +bool check_dcss_fused(void) +{ + struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR; + struct fuse_bank *bank = &ocotp->bank[1]; + struct fuse_bank1_regs *fuse = + (struct fuse_bank1_regs *)bank->fuse_regs; + + u32 value = readl(&fuse->tester4); + if (value & 0x4000000) + return true; + + return false; +} + static int disable_mipi_dsi_nodes(void *blob) { const char *nodes_path[] = { @@ -596,8 +610,11 @@ usb_modify_speed: if (is_imx8mql()) { disable_vpu_nodes(blob); - disable_dcss_nodes(blob); - check_mipi_dsi_nodes(blob); + if (check_dcss_fused()) { + printf("DCSS is fused\n"); + disable_dcss_nodes(blob); + check_mipi_dsi_nodes(blob); + } } if (is_imx8md()) diff --git a/arch/arm/mach-imx/imx8m/video_common.c b/arch/arm/mach-imx/imx8m/video_common.c index de2ffe3..e2c7c01 100644 --- a/arch/arm/mach-imx/imx8m/video_common.c +++ b/arch/arm/mach-imx/imx8m/video_common.c @@ -1,5 +1,5 @@ /* - * Copyright 2018 NXP + * Copyright 2018-2019 NXP * * SPDX-License-Identifier: GPL-2.0+ */ @@ -709,7 +709,7 @@ int imx8m_fb_init(struct fb_videomode const *mode, { debug("entering %s()\n", __func__); - if (is_imx8mql()) { + if (is_imx8mql() && check_dcss_fused()) { printf("dcss is diabled on i.MX8MQL\n"); return -EPERM; } -- 1.9.1