diff options
author | Ye.Li <B37916@freescale.com> | 2014-07-16 13:53:34 +0800 |
---|---|---|
committer | Ye.Li <B37916@freescale.com> | 2014-07-17 13:15:11 +0800 |
commit | b643cfaa486f090cfc91daaaa0dec0d611eba150 (patch) | |
tree | c2b6765145a28cd2325e5d7860660d9114fd6912 | |
parent | 6e78b7fb154a07b741e583bb83c0b0f996ed6e96 (diff) | |
download | u-boot-imx-b643cfaa486f090cfc91daaaa0dec0d611eba150.zip u-boot-imx-b643cfaa486f090cfc91daaaa0dec0d611eba150.tar.gz u-boot-imx-b643cfaa486f090cfc91daaaa0dec0d611eba150.tar.bz2 |
ENGR00322860 iMX6SX: Add function to check M4 status before booting
Add new function "arch_auxiliary_core_check_up" to check whether M4
is already up. Therefore, avoid starting M4 again when it is running.
Signed-off-by: Ye.Li <B37916@freescale.com>
(cherry picked from commit 54a0803b29c5ab459bedfb2c68c1e94b89866aa1)
-rw-r--r-- | arch/arm/cpu/armv7/mx6/soc.c | 13 | ||||
-rw-r--r-- | arch/arm/include/asm/arch-mx6/sys_proto.h | 1 | ||||
-rw-r--r-- | common/cmd_bootaux.c | 18 |
3 files changed, 31 insertions, 1 deletions
diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c index 001b9ab..e4393b3 100644 --- a/arch/arm/cpu/armv7/mx6/soc.c +++ b/arch/arm/cpu/armv7/mx6/soc.c @@ -628,6 +628,19 @@ int arch_auxiliary_core_up(u32 core_id, u32 boot_private_data) return 0; } + +int arch_auxiliary_core_check_up(u32 core_id) +{ + struct src *src_reg = (struct src *)SRC_BASE_ADDR; + unsigned val; + + val = readl(&src_reg->scr); + + if (val & 0x00000010) + return 0; /* assert in reset */ + + return 1; +} #endif void boot_mode_apply(unsigned cfg_val) diff --git a/arch/arm/include/asm/arch-mx6/sys_proto.h b/arch/arm/include/asm/arch-mx6/sys_proto.h index df7a0a2..f358c36 100644 --- a/arch/arm/include/asm/arch-mx6/sys_proto.h +++ b/arch/arm/include/asm/arch-mx6/sys_proto.h @@ -32,6 +32,7 @@ void ldo_mode_set(int ldo_bypass); #ifdef CONFIG_MX6SX int arch_auxiliary_core_up(u32 core_id, u32 boot_private_data); +int arch_auxiliary_core_check_up(u32 core_id); #endif /* diff --git a/common/cmd_bootaux.c b/common/cmd_bootaux.c index 188cb73..b15de0e 100644 --- a/common/cmd_bootaux.c +++ b/common/cmd_bootaux.c @@ -16,14 +16,30 @@ static int __arch_auxiliary_core_up(u32 core_id, u32 boot_private_data) int arch_auxiliary_core_up(u32 core_id, u32 boot_private_data) __attribute__((weak, alias("__arch_auxiliary_core_up"))); +/* Allow for arch specific config before we boot */ +static int __arch_auxiliary_core_check_up(u32 core_id) +{ + /* please define platform specific arch_auxiliary_core_check_up() */ + return 0; +} + +int arch_auxiliary_core_check_up(u32 core_id) + __attribute__((weak, alias("__arch_auxiliary_core_check_up"))); + int do_bootaux(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong addr; - int ret; + int ret, up; if (argc < 2) return CMD_RET_USAGE; + up = arch_auxiliary_core_check_up(0); + if (up) { + printf("## Auxiliary core is already up\n"); + return CMD_RET_SUCCESS; + } + addr = simple_strtoul(argv[1], NULL, 16); printf("## Starting auxiliary core at 0x%08lX ...\n", addr); |