From bb7513767e116903dbb048c5bf2bf150b8cd04a7 Mon Sep 17 00:00:00 2001 From: Vinoth Gnanasekaran Date: Thu, 14 Jun 2018 11:44:22 +0530 Subject: [PATCH] ipq806x: Secondary core boot address gets decided dynamically 'forever' (Infinite while loop) function gets called in dump collection path. 'ak_secondary_cpu_init' function gets called in runmulticore path. Change-Id: Ie7bcf618fd6da5ce968954db538ae345c4f43d92 Signed-off-by: Vinoth Gnanasekaran --- board/qca/arm/common/cmd_bootqca.c | 4 ++-- board/qca/arm/ipq806x/ipq806x.c | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/board/qca/arm/common/cmd_bootqca.c b/board/qca/arm/common/cmd_bootqca.c index 94ecbcdad9..cedc698603 100644 --- a/board/qca/arm/common/cmd_bootqca.c +++ b/board/qca/arm/common/cmd_bootqca.c @@ -71,7 +71,7 @@ kernel_img_info_t kernel_img_info; char dtb_config_name[64]; -__weak int scm_set_boot_addr(void) +__weak int scm_set_boot_addr(bool enable_sec_core) { return -1; } @@ -170,7 +170,7 @@ static int do_dumpqca_data(void) dump_entries = dump_entries_s; } - if (scm_set_boot_addr() == 0) { + if (scm_set_boot_addr(false) == 0) { /* Pull Core-1 out of reset, iff scm call succeeds */ krait_release_secondary(); } diff --git a/board/qca/arm/ipq806x/ipq806x.c b/board/qca/arm/ipq806x/ipq806x.c index 65a550ab36..e006ac432a 100644 --- a/board/qca/arm/ipq806x/ipq806x.c +++ b/board/qca/arm/ipq806x/ipq806x.c @@ -922,12 +922,13 @@ int ipq_get_tz_version(char *version_name, int buf_size) return 0; } +void forever(void) { while (1); } extern void ak_secondary_cpu_init(void); extern void send_event(void); /* * Set the cold/warm boot address for one of the CPU cores. */ -int scm_set_boot_addr(void) +int scm_set_boot_addr(bool enable_sec_core) { int ret; struct { @@ -935,7 +936,11 @@ int scm_set_boot_addr(void) unsigned long addr; } cmd; - cmd.addr = (unsigned long)ak_secondary_cpu_init; + if (enable_sec_core) + cmd.addr = (unsigned long)ak_secondary_cpu_init; + else + cmd.addr = (unsigned long)forever; + cmd.flags = SCM_FLAG_COLDBOOT_CPU1; ret = scm_call(SCM_SVC_BOOT, SCM_BOOT_ADDR, @@ -1034,7 +1039,7 @@ int bring_sec_core_up(unsigned int cpuid, unsigned int entry, unsigned int arg) dcache_old_status = dcache_status(); if (!secondary_core_already_reset) { secondary_core_already_reset = 1; - if (scm_set_boot_addr() == 0) { + if (scm_set_boot_addr(true) == 0) { /* Pull Core-1 out of reset, iff scm call succeeds */ krait_release_secondary(); }