1
0
Fork 0

soc: imx: fix build error of missing imx_src_is_m4_enabled

drivers/clk/imx/clk-gate2.o: In function `clk_gate2_do_shared_clks':
/home/b29396/Work/linux/dash-linux-devel/build_v8/../drivers/clk/imx/clk-gate2.c:61: undefined reference to `imx_src_is_m4_enabled'
drivers/clk/imx/clk-pfd.o: In function `clk_pfd_do_shared_clks':
/home/b29396/Work/linux/dash-linux-devel/build_v8/../drivers/clk/imx/clk-pfd.c:55: undefined reference to `imx_src_is_m4_enabled'
/home/b29396/Work/linux/dash-linux-devel/build_v8/../drivers/clk/imx/clk-pfd.c:55: undefined reference to `imx_src_is_m4_enabled'
drivers/clk/imx/clk-pllv3.o: In function `clk_pllv3_do_shared_clks':
/home/b29396/Work/linux/dash-linux-devel/build_v8/../drivers/clk/imx/clk-pllv3.c:109: undefined reference to `imx_src_is_m4_enabled'
/home/b29396/Work/linux/dash-linux-devel/Makefile:1047: recipe for target 'vmlinux' failed
make[1]: *** [vmlinux] Error 1
make[1]: Leaving directory '/home/b29396/Work/linux/dash-linux-devel/build_v8'
Makefile:179: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Dong Aisheng 2019-04-19 16:51:04 +08:00
parent e12ffa41c1
commit b199c5a470
2 changed files with 48 additions and 0 deletions

View File

@ -3,6 +3,7 @@
* Copyright 2019 NXP.
*/
#include <linux/arm-smccc.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/of_address.h>
@ -11,6 +12,8 @@
#include <linux/platform_device.h>
#include <linux/of.h>
#include <soc/imx/src.h>
#define REV_B1 0x21
#define IMX8MQ_SW_INFO_B1 0x40
@ -198,3 +201,28 @@ free_soc:
return ret;
}
device_initcall(imx8_soc_init);
#define FSL_SIP_SRC 0xc2000005
#define FSL_SIP_SRC_M4_START 0x00
#define FSL_SIP_SRC_M4_STARTED 0x01
/* To indicate M4 enabled or not on i.MX8MQ */
static bool m4_is_enabled;
bool imx_src_is_m4_enabled(void)
{
return m4_is_enabled;
}
int check_m4_enabled(void)
{
struct arm_smccc_res res;
arm_smccc_smc(FSL_SIP_SRC, FSL_SIP_SRC_M4_STARTED, 0,
0, 0, 0, 0, 0, &res);
m4_is_enabled = !!res.a0;
if (m4_is_enabled)
printk("M4 is started\n");
return 0;
}

View File

@ -0,0 +1,20 @@
/*
* Copyright 2017 NXP
*
* 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.
*
* This program is distributed in the hope that 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_IMX8_SOC_H__
#define __SOC_IMX8_SOC_H__
int check_m4_enabled(void);
#endif