From a4f0a38f21d3bf5d958b414abf547e69aac884fe Mon Sep 17 00:00:00 2001 From: Mao Jinlong Date: Thu, 19 Mar 2020 19:14:22 +0800 Subject: [PATCH 1/2] soc: memory_dump: Add moudle support for mem_dump driver Add support to build the memory dump driver as moudle on gki build. Change-Id: I8cf227d0b0044b935bbf224d1191ec84fa497509 Signed-off-by: Mao Jinlong --- drivers/soc/qcom/Kconfig | 2 +- drivers/soc/qcom/memory_dump_v2.c | 8 +++----- include/soc/qcom/memory_dump.h | 6 +++--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig index 3906c604fe93..1fe53ae91b98 100644 --- a/drivers/soc/qcom/Kconfig +++ b/drivers/soc/qcom/Kconfig @@ -386,7 +386,7 @@ config QCOM_SMD_RPM module. This will build a module called "qcom-smd-rpm". config QCOM_MEMORY_DUMP_V2 - bool "QCOM Memory Dump V2 Support" + tristate "QCOM Memory Dump V2 Support" help This enables memory dump feature. It allows various client subsystems to register respective dump regions. At the time diff --git a/drivers/soc/qcom/memory_dump_v2.c b/drivers/soc/qcom/memory_dump_v2.c index f1b37a222967..e997ae357602 100644 --- a/drivers/soc/qcom/memory_dump_v2.c +++ b/drivers/soc/qcom/memory_dump_v2.c @@ -892,9 +892,7 @@ static struct platform_driver mem_dump_driver = { }, }; -static int __init mem_dump_init(void) -{ - return platform_driver_register(&mem_dump_driver); -} +module_platform_driver(mem_dump_driver); -pure_initcall(mem_dump_init); +MODULE_DESCRIPTION("Memory Dump V2 Driver"); +MODULE_LICENSE("GPL v2"); diff --git a/include/soc/qcom/memory_dump.h b/include/soc/qcom/memory_dump.h index 96bf9304bc2a..00bd60c28f67 100644 --- a/include/soc/qcom/memory_dump.h +++ b/include/soc/qcom/memory_dump.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* - * Copyright (c) 2012, 2014-2017, 2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2012, 2014-2017, 2020, The Linux Foundation. All rights reserved. */ #ifndef __MSM_MEMORY_DUMP_H @@ -42,7 +42,7 @@ static inline int msm_dump_tbl_register(struct msm_client_dump *entry) #endif -#if defined(CONFIG_QCOM_MEMORY_DUMP) || defined(CONFIG_QCOM_MEMORY_DUMP_V2) +#if IS_ENABLED(CONFIG_QCOM_MEMORY_DUMP_V2) extern uint32_t msm_dump_table_version(void); #else static inline uint32_t msm_dump_table_version(void) @@ -114,7 +114,7 @@ struct msm_dump_entry { uint64_t addr; }; -#ifdef CONFIG_QCOM_MEMORY_DUMP_V2 +#if IS_ENABLED(CONFIG_QCOM_MEMORY_DUMP_V2) extern int msm_dump_data_register(enum msm_dump_table_ids id, struct msm_dump_entry *entry); extern int msm_dump_data_register_nominidump(enum msm_dump_table_ids id, From 0a667f929387c8508ee0a3b35af475be51fda52d Mon Sep 17 00:00:00 2001 From: Mao Jinlong Date: Thu, 19 Mar 2020 19:12:08 +0800 Subject: [PATCH 2/2] defconfig: Enable mem_dump driver on gki build for lahaina Enable memory dump driver to be build as a module in the defconfig on Lahaina. Change-Id: I284e5d082d5a595f794b15fd66163137596e714e Signed-off-by: Mao Jinlong --- arch/arm64/configs/vendor/lahaina_GKI.config | 1 + arch/arm64/configs/vendor/lahaina_QGKI.config | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/configs/vendor/lahaina_GKI.config b/arch/arm64/configs/vendor/lahaina_GKI.config index 4bd75b37fb12..4f0eda5d5eac 100644 --- a/arch/arm64/configs/vendor/lahaina_GKI.config +++ b/arch/arm64/configs/vendor/lahaina_GKI.config @@ -55,6 +55,7 @@ CONFIG_QCOM_LAHAINA_LLCC=m CONFIG_QCOM_IPCC=m CONFIG_QCOM_WATCHDOG=m CONFIG_QCOM_FORCE_WDOG_BITE_ON_PANIC=y +CONFIG_QCOM_MEMORY_DUMP_V2=m CONFIG_QCOM_SCM=m CONFIG_QTEE_SHM_BRIDGE=y # CONFIG_QCOM_SCM_DOWNLOAD_MODE_DEFAULT is not set diff --git a/arch/arm64/configs/vendor/lahaina_QGKI.config b/arch/arm64/configs/vendor/lahaina_QGKI.config index 5e3c61b90f55..5a1cb0949552 100644 --- a/arch/arm64/configs/vendor/lahaina_QGKI.config +++ b/arch/arm64/configs/vendor/lahaina_QGKI.config @@ -77,7 +77,6 @@ CONFIG_QCOM_DEVFREQ_ICC=y CONFIG_QCOM_LLCC_PMU=y CONFIG_QCOM_GUESTVM=y CONFIG_QTI_TZ_LOG=y -CONFIG_QCOM_MEMORY_DUMP_V2=y CONFIG_MSM_REMOTEQDSS=y CONFIG_QCOM_DCC_V2=y CONFIG_CLD_LL_CORE=y