From f2800a472ed4ca0d4bc422a82012a1f6bdf414ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Date: Tue, 6 Apr 2021 19:18:30 +0200 Subject: [PATCH] plat: marvell: armada: a3k: Add new compile option A3720_DB_PM_WAKEUP_SRC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This new compile option is only for Armada 3720 Development Board. When it is set to 1 then TF-A will setup PM wake up src configuration. By default this new option is disabled as it is board specific and no other A37xx board has PM wake up src configuration. Currently neither upstream U-Boot nor upstream Linux kernel has wakeup support for A37xx platforms, so having it disabled does not cause any issue. Prior this commit PM wake up src configuration specific for Armada 3720 Development Board was enabled for every A37xx board. After this change it is enabled only when compiling with build flag A3720_DB_PM_WAKEUP_SRC=1 Signed-off-by: Pali Rohár Change-Id: I09fea1172c532df639acb3bb009cfde32d3c5766 --- docs/plat/marvell/armada/build.rst | 5 +++++ plat/marvell/armada/a3k/a3700/board/pm_src.c | 2 +- plat/marvell/armada/a3k/common/a3700_common.mk | 7 ++++--- plat/marvell/armada/a3k/common/plat_pm.c | 7 +++++++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/docs/plat/marvell/armada/build.rst b/docs/plat/marvell/armada/build.rst index c74ff7a57..c9f5e8224 100644 --- a/docs/plat/marvell/armada/build.rst +++ b/docs/plat/marvell/armada/build.rst @@ -112,6 +112,11 @@ There are several build options: This option is needed on Turris MOX as a workaround to a HW bug which causes reset to sometime hang the board. +- A3720_DB_PM_WAKEUP_SRC + + For Armada 3720 Develpment Board only, when ``A3720_DB_PM_WAKEUP_SRC=1``, + TF-A will setup PM wake up src configuration. This option is disabled by default. + - MARVELL_SECURE_BOOT Build trusted(=1)/non trusted(=0) image, default is non trusted. diff --git a/plat/marvell/armada/a3k/a3700/board/pm_src.c b/plat/marvell/armada/a3k/a3700/board/pm_src.c index d6eca5d16..247f73bc4 100644 --- a/plat/marvell/armada/a3k/a3700/board/pm_src.c +++ b/plat/marvell/armada/a3k/a3700/board/pm_src.c @@ -8,7 +8,7 @@ #include #include -/* This struct provides the PM wake up src configuration */ +/* This struct provides the PM wake up src configuration for A3720 Development Board */ static struct pm_wake_up_src_config wake_up_src_cfg = { .wake_up_src_num = 3, .wake_up_src[0] = { diff --git a/plat/marvell/armada/a3k/common/a3700_common.mk b/plat/marvell/armada/a3k/common/a3700_common.mk index 8775e8934..79097f399 100644 --- a/plat/marvell/armada/a3k/common/a3700_common.mk +++ b/plat/marvell/armada/a3k/common/a3700_common.mk @@ -43,8 +43,6 @@ PLAT_BL_COMMON_SOURCES := $(PLAT_COMMON_BASE)/aarch64/a3700_common.c \ BL1_SOURCES += $(PLAT_COMMON_BASE)/aarch64/plat_helpers.S \ lib/cpus/aarch64/cortex_a53.S -BL31_PORTING_SOURCES := $(PLAT_FAMILY_BASE)/$(PLAT)/board/pm_src.c - MARVELL_DRV := $(MARVELL_DRV_BASE)/comphy/phy-comphy-3700.c BL31_SOURCES += lib/cpus/aarch64/cortex_a53.S \ @@ -61,7 +59,6 @@ BL31_SOURCES += lib/cpus/aarch64/cortex_a53.S \ $(MARVELL_COMMON_BASE)/marvell_gicv3.c \ $(MARVELL_GIC_SOURCES) \ drivers/arm/cci/cci.c \ - $(BL31_PORTING_SOURCES) \ $(PLAT_COMMON_BASE)/a3700_sip_svc.c \ $(MARVELL_DRV) @@ -69,6 +66,10 @@ ifeq ($(CM3_SYSTEM_RESET),1) BL31_SOURCES += $(PLAT_COMMON_BASE)/cm3_system_reset.c endif +ifeq ($(A3720_DB_PM_WAKEUP_SRC),1) +BL31_SOURCES += $(PLAT_FAMILY_BASE)/$(PLAT)/board/pm_src.c +endif + ifdef WTP $(if $(wildcard $(value WTP)/*),,$(error "'WTP=$(value WTP)' was specified, but '$(value WTP)' directory does not exist")) diff --git a/plat/marvell/armada/a3k/common/plat_pm.c b/plat/marvell/armada/a3k/common/plat_pm.c index 2bae37e3f..e2d15abf9 100644 --- a/plat/marvell/armada/a3k/common/plat_pm.c +++ b/plat/marvell/armada/a3k/common/plat_pm.c @@ -590,6 +590,13 @@ static wake_up_src_func a3700_get_wake_up_src_func( return NULL; } +#pragma weak mv_wake_up_src_config_get +struct pm_wake_up_src_config *mv_wake_up_src_config_get(void) +{ + static struct pm_wake_up_src_config wake_up_src_cfg = {}; + return &wake_up_src_cfg; +} + static void a3700_set_wake_up_source(void) { struct pm_wake_up_src_config *wake_up_src;