From d91e719fc830e011b182abb9712ed09b76f1d400 Mon Sep 17 00:00:00 2001 From: Breno Lima Date: Wed, 23 Oct 2019 22:03:35 -0300 Subject: [PATCH] MLK-22836 imx8m: soc: Fix secure boot support for i.MX8MM and i.MX8MN targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since commit c98b47f1ff60 ("MLK-22749 imx8mq: Add workaround to fix sticky bits lock up") it's not possible to build i.MX8MM and i.MX8MN targets with CONFIG_SECURE_BOOT enabled: CC cmd/version.o arch/arm/mach-imx/imx8m/soc.c:326:23: error: ‘CONFIG_IMX_UNIQUE_ID’ undeclared \ (first use in this function); did you mean ‘CONFIG_IMX_VIDEO_SKIP’? if (!is_uid_matched(CONFIG_IMX_UNIQUE_ID)) ^~~~~~~~~~~~~~~~~~~~ The OCOTP sticky bit workaround is only needed for i.MX8MQ devices, other devices should not build the secure_lockup() function. Add CONFIG_IMX8MQ to the conditional compilation to avoid such issue. Fixes: c98b47f1ff60 ("MLK-22749 imx8mq: Add workaround to fix sticky bits lock up") Signed-off-by: Breno Lima Reviewed-by: Ye Li (cherry picked from commit be033bff3c718e8bd7d4ac5ecfe4361892fc6e61) --- arch/arm/mach-imx/imx8m/soc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 4c2cbee..76e3ce9 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -280,7 +280,7 @@ static void imx_set_wdog_powerdown(bool enable) writew(enable, &wdog3->wmcr); } -#ifdef CONFIG_SECURE_BOOT +#if defined(CONFIG_SECURE_BOOT) && defined(CONFIG_IMX8MQ) static bool is_hdmi_fused(void) { struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR; struct fuse_bank *bank = &ocotp->bank[1]; @@ -345,7 +345,7 @@ int arch_cpu_init(void) clock_init(); imx_set_wdog_powerdown(false); -#ifdef CONFIG_SECURE_BOOT +#if defined(CONFIG_SECURE_BOOT) && defined(CONFIG_IMX8MQ) secure_lockup(); #endif if (is_imx8md() || is_imx8mmd() || is_imx8mmdl() || is_imx8mms() || is_imx8mmsl() || -- 1.9.1