Commit ecd138df authored by Masahiro Yamada's avatar Masahiro Yamada
Browse files

uniphier: call uniphier_scp_is_running() only when on-chip STM is supported



uniphier_scp_is_running() reads the UNIPHIER_STMBE2COM register,
but it does not exist on all SoCs.

Do not call this function if the on-chip SCP is not supported.

Change-Id: I7c71ca0735e3a8e095c3f22ba6165f82a2986362
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent 86ed8953
...@@ -60,6 +60,7 @@ BL31_SOURCES += drivers/arm/cci/cci.c \ ...@@ -60,6 +60,7 @@ BL31_SOURCES += drivers/arm/cci/cci.c \
plat/common/plat_gicv3.c \ plat/common/plat_gicv3.c \
plat/common/plat_psci_common.c \ plat/common/plat_psci_common.c \
$(PLAT_PATH)/uniphier_bl31_setup.c \ $(PLAT_PATH)/uniphier_bl31_setup.c \
$(PLAT_PATH)/uniphier_boot_device.c \
$(PLAT_PATH)/uniphier_cci.c \ $(PLAT_PATH)/uniphier_cci.c \
$(PLAT_PATH)/uniphier_gicv3.c \ $(PLAT_PATH)/uniphier_gicv3.c \
$(PLAT_PATH)/uniphier_psci.c \ $(PLAT_PATH)/uniphier_psci.c \
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <arch_helpers.h> #include <arch_helpers.h>
#include <common/debug.h> #include <common/debug.h>
#include <errno.h>
#include <lib/mmio.h> #include <lib/mmio.h>
#include <lib/psci/psci.h> #include <lib/psci/psci.h>
...@@ -113,16 +114,26 @@ static const struct plat_psci_ops uniphier_psci_ops = { ...@@ -113,16 +114,26 @@ static const struct plat_psci_ops uniphier_psci_ops = {
int plat_setup_psci_ops(uintptr_t sec_entrypoint, int plat_setup_psci_ops(uintptr_t sec_entrypoint,
const struct plat_psci_ops **psci_ops) const struct plat_psci_ops **psci_ops)
{ {
uniphier_sec_entrypoint = sec_entrypoint; unsigned int soc;
flush_dcache_range((uint64_t)&uniphier_sec_entrypoint,
sizeof(uniphier_sec_entrypoint)); soc = uniphier_get_soc_id();
if (soc == UNIPHIER_SOC_UNKNOWN) {
ERROR("unsupported SoC\n");
return -ENOTSUP;
}
if (uniphier_get_boot_master(soc) == UNIPHIER_BOOT_MASTER_SCP) {
uniphier_psci_scp_mode = uniphier_scp_is_running(); uniphier_psci_scp_mode = uniphier_scp_is_running();
flush_dcache_range((uint64_t)&uniphier_psci_scp_mode, flush_dcache_range((uint64_t)&uniphier_psci_scp_mode,
sizeof(uniphier_psci_scp_mode)); sizeof(uniphier_psci_scp_mode));
if (uniphier_psci_scp_mode) if (uniphier_psci_scp_mode)
uniphier_scp_open_com(); uniphier_scp_open_com();
}
uniphier_sec_entrypoint = sec_entrypoint;
flush_dcache_range((uint64_t)&uniphier_sec_entrypoint,
sizeof(uniphier_sec_entrypoint));
*psci_ops = &uniphier_psci_ops; *psci_ops = &uniphier_psci_ops;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment