From: Arnd Bergmann <arnd@arndb.de> To: Kukjin Kim <kgene@kernel.org>, Krzysztof Kozlowski <krzk@kernel.org>, Kyungmin Park <kyungmin.park@samsung.com> Cc: linux-samsung-soc@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>, Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>, Pankaj Dubey <pankaj.dubey@samsung.com>, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, Sylwester Nawrocki <s.nawrocki@samsung.com>, Mauro Carvalho Chehab <mchehab+samsung@kernel.org>, linux-arm-kernel@lists.infradead.org, Marek Szyprowski <m.szyprowski@samsung.com> Subject: [PATCH 09/36] ARM: samsung: move pm check code to drivers/soc Date: Thu, 10 Oct 2019 22:29:53 +0200 [thread overview] Message-ID: <20191010203043.1241612-9-arnd@arndb.de> (raw) In-Reply-To: <20191010203043.1241612-1-arnd@arndb.de> This is the only part of plat-samsung that is really shared between the s3c and s5p ports. Moving it to drivers/soc/ lets us make them completely independent. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- arch/arm/mach-s5pv210/Kconfig | 1 + arch/arm/plat-samsung/Kconfig | 49 +---------- arch/arm/plat-samsung/Makefile | 2 - .../arm/plat-samsung/include/plat/pm-common.h | 70 +--------------- drivers/soc/samsung/Kconfig | 48 ++++++++++- drivers/soc/samsung/Makefile | 3 + .../soc/samsung/s3c-pm-check.c | 2 +- .../soc/samsung/s3c-pm-debug.c | 3 +- include/linux/soc/samsung/s3c-pm.h | 84 +++++++++++++++++++ 9 files changed, 139 insertions(+), 123 deletions(-) rename arch/arm/plat-samsung/pm-check.c => drivers/soc/samsung/s3c-pm-check.c (99%) rename arch/arm/plat-samsung/pm-debug.c => drivers/soc/samsung/s3c-pm-debug.c (97%) create mode 100644 include/linux/soc/samsung/s3c-pm.h diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig index 03984a791879..d2b0e64bad7e 100644 --- a/arch/arm/mach-s5pv210/Kconfig +++ b/arch/arm/mach-s5pv210/Kconfig @@ -18,6 +18,7 @@ config ARCH_S5PV210 select HAVE_S3C_RTC if RTC_CLASS select PINCTRL select PINCTRL_EXYNOS + select SOC_SAMSUNG help Samsung S5PV210/S5PC110 series based systems diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig index e31a156a27df..740bdb23f38a 100644 --- a/arch/arm/plat-samsung/Kconfig +++ b/arch/arm/plat-samsung/Kconfig @@ -8,6 +8,7 @@ config PLAT_SAMSUNG default y select GENERIC_IRQ_CHIP select NO_IOPORT_MAP + select SOC_SAMSUNG help Base platform code for all Samsung SoC based systems @@ -234,54 +235,6 @@ config SAMSUNG_PM_GPIO pinctrl-samsung driver. endif -comment "Power management" - -config SAMSUNG_PM_DEBUG - bool "Samsung PM Suspend debug" - depends on PM && DEBUG_KERNEL - depends on PLAT_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210 - depends on DEBUG_S3C24XX_UART || DEBUG_S3C2410_UART - help - Say Y here if you want verbose debugging from the PM Suspend and - Resume code. See <file:Documentation/arm/samsung-s3c24xx/suspend.rst> - for more information. - -config S3C_PM_DEBUG_LED_SMDK - bool "SMDK LED suspend/resume debugging" - depends on PM && (MACH_SMDK6410) - help - Say Y here to enable the use of the SMDK LEDs on the baseboard - for debugging of the state of the suspend and resume process. - - Note, this currently only works for S3C64XX based SMDK boards. - -config SAMSUNG_PM_CHECK - bool "S3C2410 PM Suspend Memory CRC" - depends on PM && (PLAT_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210) - select CRC32 - help - Enable the PM code's memory area checksum over sleep. This option - will generate CRCs of all blocks of memory, and store them before - going to sleep. The blocks are then checked on resume for any - errors. - - Note, this can take several seconds depending on memory size - and CPU speed. - - See <file:Documentation/arm/samsung-s3c24xx/suspend.rst> - -config SAMSUNG_PM_CHECK_CHUNKSIZE - int "S3C2410 PM Suspend CRC Chunksize (KiB)" - depends on PM && SAMSUNG_PM_CHECK - default 64 - help - Set the chunksize in Kilobytes of the CRC for checking memory - corruption over suspend and resume. A smaller value will mean that - the CRC data block will take more memory, but will identify any - faults with better precision. - - See <file:Documentation/arm/samsung-s3c24xx/suspend.rst> - config SAMSUNG_WAKEMASK bool depends on PM diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile index 3db9d2c38258..d88b9b84f3a9 100644 --- a/arch/arm/plat-samsung/Makefile +++ b/arch/arm/plat-samsung/Makefile @@ -28,8 +28,6 @@ obj-$(CONFIG_PM_SLEEP) += pm-common.o obj-$(CONFIG_EXYNOS_CPU_SUSPEND) += pm-common.o obj-$(CONFIG_SAMSUNG_PM) += pm.o obj-$(CONFIG_SAMSUNG_PM_GPIO) += pm-gpio.o -obj-$(CONFIG_SAMSUNG_PM_CHECK) += pm-check.o -obj-$(CONFIG_SAMSUNG_PM_DEBUG) += pm-debug.o obj-$(CONFIG_SAMSUNG_WAKEMASK) += wakeup-mask.o obj-$(CONFIG_SAMSUNG_WDT_RESET) += watchdog-reset.o diff --git a/arch/arm/plat-samsung/include/plat/pm-common.h b/arch/arm/plat-samsung/include/plat/pm-common.h index 87fa97fd6e8b..18b9607e1e39 100644 --- a/arch/arm/plat-samsung/include/plat/pm-common.h +++ b/arch/arm/plat-samsung/include/plat/pm-common.h @@ -11,6 +11,7 @@ #define __PLAT_SAMSUNG_PM_COMMON_H __FILE__ #include <linux/irq.h> +#include <linux/soc/samsung/s3c-pm.h> /* sleep save info */ @@ -36,73 +37,4 @@ extern void s3c_pm_do_save(struct sleep_save *ptr, int count); extern void s3c_pm_do_restore(const struct sleep_save *ptr, int count); extern void s3c_pm_do_restore_core(const struct sleep_save *ptr, int count); -/* PM debug functions */ - -/** - * struct pm_uart_save - save block for core UART - * @ulcon: Save value for S3C2410_ULCON - * @ucon: Save value for S3C2410_UCON - * @ufcon: Save value for S3C2410_UFCON - * @umcon: Save value for S3C2410_UMCON - * @ubrdiv: Save value for S3C2410_UBRDIV - * - * Save block for UART registers to be held over sleep and restored if they - * are needed (say by debug). -*/ -struct pm_uart_save { - u32 ulcon; - u32 ucon; - u32 ufcon; - u32 umcon; - u32 ubrdiv; - u32 udivslot; -}; - -#ifdef CONFIG_SAMSUNG_PM_DEBUG -/** - * s3c_pm_dbg() - low level debug function for use in suspend/resume. - * @msg: The message to print. - * - * This function is used mainly to debug the resume process before the system - * can rely on printk/console output. It uses the low-level debugging output - * routine printascii() to do its work. - */ -extern void s3c_pm_dbg(const char *msg, ...); - -#define S3C_PMDBG(fmt...) s3c_pm_dbg(fmt) - -extern void s3c_pm_save_uarts(bool is_s3c24xx); -extern void s3c_pm_restore_uarts(bool is_s3c24xx); - -#ifdef CONFIG_ARCH_S3C64XX -extern void s3c_pm_arch_update_uart(void __iomem *regs, - struct pm_uart_save *save); -#else -static inline void -s3c_pm_arch_update_uart(void __iomem *regs, struct pm_uart_save *save) -{ -} -#endif - -#else -#define S3C_PMDBG(fmt...) pr_debug(fmt) - -static inline void s3c_pm_save_uarts(bool is_s3c24xx) { } -static inline void s3c_pm_restore_uarts(bool is_s3c24xx) { } -#endif - -/* suspend memory checking */ - -#ifdef CONFIG_SAMSUNG_PM_CHECK -extern void s3c_pm_check_prepare(void); -extern void s3c_pm_check_restore(void); -extern void s3c_pm_check_cleanup(void); -extern void s3c_pm_check_store(void); -#else -#define s3c_pm_check_prepare() do { } while (0) -#define s3c_pm_check_restore() do { } while (0) -#define s3c_pm_check_cleanup() do { } while (0) -#define s3c_pm_check_store() do { } while (0) -#endif - #endif diff --git a/drivers/soc/samsung/Kconfig b/drivers/soc/samsung/Kconfig index 33ad0de2de3c..0ea7402ffba3 100644 --- a/drivers/soc/samsung/Kconfig +++ b/drivers/soc/samsung/Kconfig @@ -25,6 +25,52 @@ config EXYNOS_PMU_ARM_DRIVERS config EXYNOS_PM_DOMAINS bool "Exynos PM domains" if COMPILE_TEST - depends on PM_GENERIC_DOMAINS || COMPILE_TEST + depends on (ARCH_EXYNOS && PM_GENERIC_DOMAINS) || COMPILE_TEST + +config SAMSUNG_PM_DEBUG + bool "Samsung PM Suspend debug" + depends on PM && DEBUG_KERNEL + depends on PLAT_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210 + depends on DEBUG_S3C24XX_UART || DEBUG_S3C2410_UART + help + Say Y here if you want verbose debugging from the PM Suspend and + Resume code. See <file:Documentation/arm/samsung-s3c24xx/suspend.rst> + for more information. + +config S3C_PM_DEBUG_LED_SMDK + bool "SMDK LED suspend/resume debugging" + depends on PM && (MACH_SMDK6410) + help + Say Y here to enable the use of the SMDK LEDs on the baseboard + for debugging of the state of the suspend and resume process. + + Note, this currently only works for S3C64XX based SMDK boards. + +config SAMSUNG_PM_CHECK + bool "S3C2410 PM Suspend Memory CRC" + depends on PM && (PLAT_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210) + select CRC32 + help + Enable the PM code's memory area checksum over sleep. This option + will generate CRCs of all blocks of memory, and store them before + going to sleep. The blocks are then checked on resume for any + errors. + + Note, this can take several seconds depending on memory size + and CPU speed. + + See <file:Documentation/arm/samsung-s3c24xx/suspend.rst> + +config SAMSUNG_PM_CHECK_CHUNKSIZE + int "S3C2410 PM Suspend CRC Chunksize (KiB)" + depends on PM && SAMSUNG_PM_CHECK + default 64 + help + Set the chunksize in Kilobytes of the CRC for checking memory + corruption over suspend and resume. A smaller value will mean that + the CRC data block will take more memory, but will identify any + faults with better precision. + + See <file:Documentation/arm/samsung-s3c24xx/suspend.rst> endif diff --git a/drivers/soc/samsung/Makefile b/drivers/soc/samsung/Makefile index 3b6a8797416c..88ae7a522055 100644 --- a/drivers/soc/samsung/Makefile +++ b/drivers/soc/samsung/Makefile @@ -6,3 +6,6 @@ obj-$(CONFIG_EXYNOS_PMU) += exynos-pmu.o obj-$(CONFIG_EXYNOS_PMU_ARM_DRIVERS) += exynos3250-pmu.o exynos4-pmu.o \ exynos5250-pmu.o exynos5420-pmu.o obj-$(CONFIG_EXYNOS_PM_DOMAINS) += pm_domains.o + +obj-$(CONFIG_SAMSUNG_PM_CHECK) += s3c-pm-check.o +obj-$(CONFIG_SAMSUNG_PM_DEBUG) += s3c-pm-debug.o diff --git a/arch/arm/plat-samsung/pm-check.c b/drivers/soc/samsung/s3c-pm-check.c similarity index 99% rename from arch/arm/plat-samsung/pm-check.c rename to drivers/soc/samsung/s3c-pm-check.c index cd2c02c68bc3..ff3e099fc208 100644 --- a/arch/arm/plat-samsung/pm-check.c +++ b/drivers/soc/samsung/s3c-pm-check.c @@ -15,7 +15,7 @@ #include <linux/ioport.h> #include <linux/slab.h> -#include <plat/pm-common.h> +#include <linux/soc/samsung/s3c-pm.h> #if CONFIG_SAMSUNG_PM_CHECK_CHUNKSIZE < 1 #error CONFIG_SAMSUNG_PM_CHECK_CHUNKSIZE must be a positive non-zero value diff --git a/arch/arm/plat-samsung/pm-debug.c b/drivers/soc/samsung/s3c-pm-debug.c similarity index 97% rename from arch/arm/plat-samsung/pm-debug.c rename to drivers/soc/samsung/s3c-pm-debug.c index 482d53753e93..b5ce0e9a41e5 100644 --- a/arch/arm/plat-samsung/pm-debug.c +++ b/drivers/soc/samsung/s3c-pm-debug.c @@ -15,8 +15,7 @@ #include <asm/mach/map.h> -#include <plat/cpu.h> -#include <plat/pm-common.h> +#include <linux/soc/samsung/s3c-pm.h> static struct pm_uart_save uart_save; diff --git a/include/linux/soc/samsung/s3c-pm.h b/include/linux/soc/samsung/s3c-pm.h new file mode 100644 index 000000000000..d477b314d034 --- /dev/null +++ b/include/linux/soc/samsung/s3c-pm.h @@ -0,0 +1,84 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2013 Samsung Electronics Co., Ltd. + * Tomasz Figa <t.figa@samsung.com> + * Copyright (c) 2004 Simtec Electronics + * http://armlinux.simtec.co.uk/ + * Written by Ben Dooks, <ben@simtec.co.uk> + */ + +#ifndef __SAMSUNG_SOC_S3C_PM_H +#define __SAMSUNG_SOC_S3C_PM_H __FILE__ + +#include <linux/types.h> + +/* PM debug functions */ + +/** + * struct pm_uart_save - save block for core UART + * @ulcon: Save value for S3C2410_ULCON + * @ucon: Save value for S3C2410_UCON + * @ufcon: Save value for S3C2410_UFCON + * @umcon: Save value for S3C2410_UMCON + * @ubrdiv: Save value for S3C2410_UBRDIV + * + * Save block for UART registers to be held over sleep and restored if they + * are needed (say by debug). +*/ +struct pm_uart_save { + u32 ulcon; + u32 ucon; + u32 ufcon; + u32 umcon; + u32 ubrdiv; + u32 udivslot; +}; + +#ifdef CONFIG_SAMSUNG_PM_DEBUG +/** + * s3c_pm_dbg() - low level debug function for use in suspend/resume. + * @msg: The message to print. + * + * This function is used mainly to debug the resume process before the system + * can rely on printk/console output. It uses the low-level debugging output + * routine printascii() to do its work. + */ +extern void s3c_pm_dbg(const char *msg, ...); + +#define S3C_PMDBG(fmt...) s3c_pm_dbg(fmt) + +extern void s3c_pm_save_uarts(bool is_s3c24xx); +extern void s3c_pm_restore_uarts(bool is_s3c24xx); + +#ifdef CONFIG_ARCH_S3C64XX +extern void s3c_pm_arch_update_uart(void __iomem *regs, + struct pm_uart_save *save); +#else +static inline void +s3c_pm_arch_update_uart(void __iomem *regs, struct pm_uart_save *save) +{ +} +#endif + +#else +#define S3C_PMDBG(fmt...) pr_debug(fmt) + +static inline void s3c_pm_save_uarts(bool is_s3c24xx) { } +static inline void s3c_pm_restore_uarts(bool is_s3c24xx) { } +#endif + +/* suspend memory checking */ + +#ifdef CONFIG_SAMSUNG_PM_CHECK +extern void s3c_pm_check_prepare(void); +extern void s3c_pm_check_restore(void); +extern void s3c_pm_check_cleanup(void); +extern void s3c_pm_check_store(void); +#else +#define s3c_pm_check_prepare() do { } while (0) +#define s3c_pm_check_restore() do { } while (0) +#define s3c_pm_check_cleanup() do { } while (0) +#define s3c_pm_check_store() do { } while (0) +#endif + +#endif -- 2.20.0
WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de> To: Kukjin Kim <kgene@kernel.org>, Krzysztof Kozlowski <krzk@kernel.org>, Kyungmin Park <kyungmin.park@samsung.com> Cc: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linus.walleij@linaro.org, Arnd Bergmann <arnd@arndb.de>, Mauro Carvalho Chehab <mchehab+samsung@kernel.org>, Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>, Sylwester Nawrocki <s.nawrocki@samsung.com>, Pankaj Dubey <pankaj.dubey@samsung.com>, Marek Szyprowski <m.szyprowski@samsung.com>, linux-kernel@vger.kernel.org Subject: [PATCH 09/36] ARM: samsung: move pm check code to drivers/soc Date: Thu, 10 Oct 2019 22:29:53 +0200 [thread overview] Message-ID: <20191010203043.1241612-9-arnd@arndb.de> (raw) Message-ID: <20191010202953.4imk4JCgBKunOi53HewXVSaJfbPoQ9qd4ZoxmZKDvcA@z> (raw) In-Reply-To: <20191010203043.1241612-1-arnd@arndb.de> This is the only part of plat-samsung that is really shared between the s3c and s5p ports. Moving it to drivers/soc/ lets us make them completely independent. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- arch/arm/mach-s5pv210/Kconfig | 1 + arch/arm/plat-samsung/Kconfig | 49 +---------- arch/arm/plat-samsung/Makefile | 2 - .../arm/plat-samsung/include/plat/pm-common.h | 70 +--------------- drivers/soc/samsung/Kconfig | 48 ++++++++++- drivers/soc/samsung/Makefile | 3 + .../soc/samsung/s3c-pm-check.c | 2 +- .../soc/samsung/s3c-pm-debug.c | 3 +- include/linux/soc/samsung/s3c-pm.h | 84 +++++++++++++++++++ 9 files changed, 139 insertions(+), 123 deletions(-) rename arch/arm/plat-samsung/pm-check.c => drivers/soc/samsung/s3c-pm-check.c (99%) rename arch/arm/plat-samsung/pm-debug.c => drivers/soc/samsung/s3c-pm-debug.c (97%) create mode 100644 include/linux/soc/samsung/s3c-pm.h diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig index 03984a791879..d2b0e64bad7e 100644 --- a/arch/arm/mach-s5pv210/Kconfig +++ b/arch/arm/mach-s5pv210/Kconfig @@ -18,6 +18,7 @@ config ARCH_S5PV210 select HAVE_S3C_RTC if RTC_CLASS select PINCTRL select PINCTRL_EXYNOS + select SOC_SAMSUNG help Samsung S5PV210/S5PC110 series based systems diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig index e31a156a27df..740bdb23f38a 100644 --- a/arch/arm/plat-samsung/Kconfig +++ b/arch/arm/plat-samsung/Kconfig @@ -8,6 +8,7 @@ config PLAT_SAMSUNG default y select GENERIC_IRQ_CHIP select NO_IOPORT_MAP + select SOC_SAMSUNG help Base platform code for all Samsung SoC based systems @@ -234,54 +235,6 @@ config SAMSUNG_PM_GPIO pinctrl-samsung driver. endif -comment "Power management" - -config SAMSUNG_PM_DEBUG - bool "Samsung PM Suspend debug" - depends on PM && DEBUG_KERNEL - depends on PLAT_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210 - depends on DEBUG_S3C24XX_UART || DEBUG_S3C2410_UART - help - Say Y here if you want verbose debugging from the PM Suspend and - Resume code. See <file:Documentation/arm/samsung-s3c24xx/suspend.rst> - for more information. - -config S3C_PM_DEBUG_LED_SMDK - bool "SMDK LED suspend/resume debugging" - depends on PM && (MACH_SMDK6410) - help - Say Y here to enable the use of the SMDK LEDs on the baseboard - for debugging of the state of the suspend and resume process. - - Note, this currently only works for S3C64XX based SMDK boards. - -config SAMSUNG_PM_CHECK - bool "S3C2410 PM Suspend Memory CRC" - depends on PM && (PLAT_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210) - select CRC32 - help - Enable the PM code's memory area checksum over sleep. This option - will generate CRCs of all blocks of memory, and store them before - going to sleep. The blocks are then checked on resume for any - errors. - - Note, this can take several seconds depending on memory size - and CPU speed. - - See <file:Documentation/arm/samsung-s3c24xx/suspend.rst> - -config SAMSUNG_PM_CHECK_CHUNKSIZE - int "S3C2410 PM Suspend CRC Chunksize (KiB)" - depends on PM && SAMSUNG_PM_CHECK - default 64 - help - Set the chunksize in Kilobytes of the CRC for checking memory - corruption over suspend and resume. A smaller value will mean that - the CRC data block will take more memory, but will identify any - faults with better precision. - - See <file:Documentation/arm/samsung-s3c24xx/suspend.rst> - config SAMSUNG_WAKEMASK bool depends on PM diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile index 3db9d2c38258..d88b9b84f3a9 100644 --- a/arch/arm/plat-samsung/Makefile +++ b/arch/arm/plat-samsung/Makefile @@ -28,8 +28,6 @@ obj-$(CONFIG_PM_SLEEP) += pm-common.o obj-$(CONFIG_EXYNOS_CPU_SUSPEND) += pm-common.o obj-$(CONFIG_SAMSUNG_PM) += pm.o obj-$(CONFIG_SAMSUNG_PM_GPIO) += pm-gpio.o -obj-$(CONFIG_SAMSUNG_PM_CHECK) += pm-check.o -obj-$(CONFIG_SAMSUNG_PM_DEBUG) += pm-debug.o obj-$(CONFIG_SAMSUNG_WAKEMASK) += wakeup-mask.o obj-$(CONFIG_SAMSUNG_WDT_RESET) += watchdog-reset.o diff --git a/arch/arm/plat-samsung/include/plat/pm-common.h b/arch/arm/plat-samsung/include/plat/pm-common.h index 87fa97fd6e8b..18b9607e1e39 100644 --- a/arch/arm/plat-samsung/include/plat/pm-common.h +++ b/arch/arm/plat-samsung/include/plat/pm-common.h @@ -11,6 +11,7 @@ #define __PLAT_SAMSUNG_PM_COMMON_H __FILE__ #include <linux/irq.h> +#include <linux/soc/samsung/s3c-pm.h> /* sleep save info */ @@ -36,73 +37,4 @@ extern void s3c_pm_do_save(struct sleep_save *ptr, int count); extern void s3c_pm_do_restore(const struct sleep_save *ptr, int count); extern void s3c_pm_do_restore_core(const struct sleep_save *ptr, int count); -/* PM debug functions */ - -/** - * struct pm_uart_save - save block for core UART - * @ulcon: Save value for S3C2410_ULCON - * @ucon: Save value for S3C2410_UCON - * @ufcon: Save value for S3C2410_UFCON - * @umcon: Save value for S3C2410_UMCON - * @ubrdiv: Save value for S3C2410_UBRDIV - * - * Save block for UART registers to be held over sleep and restored if they - * are needed (say by debug). -*/ -struct pm_uart_save { - u32 ulcon; - u32 ucon; - u32 ufcon; - u32 umcon; - u32 ubrdiv; - u32 udivslot; -}; - -#ifdef CONFIG_SAMSUNG_PM_DEBUG -/** - * s3c_pm_dbg() - low level debug function for use in suspend/resume. - * @msg: The message to print. - * - * This function is used mainly to debug the resume process before the system - * can rely on printk/console output. It uses the low-level debugging output - * routine printascii() to do its work. - */ -extern void s3c_pm_dbg(const char *msg, ...); - -#define S3C_PMDBG(fmt...) s3c_pm_dbg(fmt) - -extern void s3c_pm_save_uarts(bool is_s3c24xx); -extern void s3c_pm_restore_uarts(bool is_s3c24xx); - -#ifdef CONFIG_ARCH_S3C64XX -extern void s3c_pm_arch_update_uart(void __iomem *regs, - struct pm_uart_save *save); -#else -static inline void -s3c_pm_arch_update_uart(void __iomem *regs, struct pm_uart_save *save) -{ -} -#endif - -#else -#define S3C_PMDBG(fmt...) pr_debug(fmt) - -static inline void s3c_pm_save_uarts(bool is_s3c24xx) { } -static inline void s3c_pm_restore_uarts(bool is_s3c24xx) { } -#endif - -/* suspend memory checking */ - -#ifdef CONFIG_SAMSUNG_PM_CHECK -extern void s3c_pm_check_prepare(void); -extern void s3c_pm_check_restore(void); -extern void s3c_pm_check_cleanup(void); -extern void s3c_pm_check_store(void); -#else -#define s3c_pm_check_prepare() do { } while (0) -#define s3c_pm_check_restore() do { } while (0) -#define s3c_pm_check_cleanup() do { } while (0) -#define s3c_pm_check_store() do { } while (0) -#endif - #endif diff --git a/drivers/soc/samsung/Kconfig b/drivers/soc/samsung/Kconfig index 33ad0de2de3c..0ea7402ffba3 100644 --- a/drivers/soc/samsung/Kconfig +++ b/drivers/soc/samsung/Kconfig @@ -25,6 +25,52 @@ config EXYNOS_PMU_ARM_DRIVERS config EXYNOS_PM_DOMAINS bool "Exynos PM domains" if COMPILE_TEST - depends on PM_GENERIC_DOMAINS || COMPILE_TEST + depends on (ARCH_EXYNOS && PM_GENERIC_DOMAINS) || COMPILE_TEST + +config SAMSUNG_PM_DEBUG + bool "Samsung PM Suspend debug" + depends on PM && DEBUG_KERNEL + depends on PLAT_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210 + depends on DEBUG_S3C24XX_UART || DEBUG_S3C2410_UART + help + Say Y here if you want verbose debugging from the PM Suspend and + Resume code. See <file:Documentation/arm/samsung-s3c24xx/suspend.rst> + for more information. + +config S3C_PM_DEBUG_LED_SMDK + bool "SMDK LED suspend/resume debugging" + depends on PM && (MACH_SMDK6410) + help + Say Y here to enable the use of the SMDK LEDs on the baseboard + for debugging of the state of the suspend and resume process. + + Note, this currently only works for S3C64XX based SMDK boards. + +config SAMSUNG_PM_CHECK + bool "S3C2410 PM Suspend Memory CRC" + depends on PM && (PLAT_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210) + select CRC32 + help + Enable the PM code's memory area checksum over sleep. This option + will generate CRCs of all blocks of memory, and store them before + going to sleep. The blocks are then checked on resume for any + errors. + + Note, this can take several seconds depending on memory size + and CPU speed. + + See <file:Documentation/arm/samsung-s3c24xx/suspend.rst> + +config SAMSUNG_PM_CHECK_CHUNKSIZE + int "S3C2410 PM Suspend CRC Chunksize (KiB)" + depends on PM && SAMSUNG_PM_CHECK + default 64 + help + Set the chunksize in Kilobytes of the CRC for checking memory + corruption over suspend and resume. A smaller value will mean that + the CRC data block will take more memory, but will identify any + faults with better precision. + + See <file:Documentation/arm/samsung-s3c24xx/suspend.rst> endif diff --git a/drivers/soc/samsung/Makefile b/drivers/soc/samsung/Makefile index 3b6a8797416c..88ae7a522055 100644 --- a/drivers/soc/samsung/Makefile +++ b/drivers/soc/samsung/Makefile @@ -6,3 +6,6 @@ obj-$(CONFIG_EXYNOS_PMU) += exynos-pmu.o obj-$(CONFIG_EXYNOS_PMU_ARM_DRIVERS) += exynos3250-pmu.o exynos4-pmu.o \ exynos5250-pmu.o exynos5420-pmu.o obj-$(CONFIG_EXYNOS_PM_DOMAINS) += pm_domains.o + +obj-$(CONFIG_SAMSUNG_PM_CHECK) += s3c-pm-check.o +obj-$(CONFIG_SAMSUNG_PM_DEBUG) += s3c-pm-debug.o diff --git a/arch/arm/plat-samsung/pm-check.c b/drivers/soc/samsung/s3c-pm-check.c similarity index 99% rename from arch/arm/plat-samsung/pm-check.c rename to drivers/soc/samsung/s3c-pm-check.c index cd2c02c68bc3..ff3e099fc208 100644 --- a/arch/arm/plat-samsung/pm-check.c +++ b/drivers/soc/samsung/s3c-pm-check.c @@ -15,7 +15,7 @@ #include <linux/ioport.h> #include <linux/slab.h> -#include <plat/pm-common.h> +#include <linux/soc/samsung/s3c-pm.h> #if CONFIG_SAMSUNG_PM_CHECK_CHUNKSIZE < 1 #error CONFIG_SAMSUNG_PM_CHECK_CHUNKSIZE must be a positive non-zero value diff --git a/arch/arm/plat-samsung/pm-debug.c b/drivers/soc/samsung/s3c-pm-debug.c similarity index 97% rename from arch/arm/plat-samsung/pm-debug.c rename to drivers/soc/samsung/s3c-pm-debug.c index 482d53753e93..b5ce0e9a41e5 100644 --- a/arch/arm/plat-samsung/pm-debug.c +++ b/drivers/soc/samsung/s3c-pm-debug.c @@ -15,8 +15,7 @@ #include <asm/mach/map.h> -#include <plat/cpu.h> -#include <plat/pm-common.h> +#include <linux/soc/samsung/s3c-pm.h> static struct pm_uart_save uart_save; diff --git a/include/linux/soc/samsung/s3c-pm.h b/include/linux/soc/samsung/s3c-pm.h new file mode 100644 index 000000000000..d477b314d034 --- /dev/null +++ b/include/linux/soc/samsung/s3c-pm.h @@ -0,0 +1,84 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2013 Samsung Electronics Co., Ltd. + * Tomasz Figa <t.figa@samsung.com> + * Copyright (c) 2004 Simtec Electronics + * http://armlinux.simtec.co.uk/ + * Written by Ben Dooks, <ben@simtec.co.uk> + */ + +#ifndef __SAMSUNG_SOC_S3C_PM_H +#define __SAMSUNG_SOC_S3C_PM_H __FILE__ + +#include <linux/types.h> + +/* PM debug functions */ + +/** + * struct pm_uart_save - save block for core UART + * @ulcon: Save value for S3C2410_ULCON + * @ucon: Save value for S3C2410_UCON + * @ufcon: Save value for S3C2410_UFCON + * @umcon: Save value for S3C2410_UMCON + * @ubrdiv: Save value for S3C2410_UBRDIV + * + * Save block for UART registers to be held over sleep and restored if they + * are needed (say by debug). +*/ +struct pm_uart_save { + u32 ulcon; + u32 ucon; + u32 ufcon; + u32 umcon; + u32 ubrdiv; + u32 udivslot; +}; + +#ifdef CONFIG_SAMSUNG_PM_DEBUG +/** + * s3c_pm_dbg() - low level debug function for use in suspend/resume. + * @msg: The message to print. + * + * This function is used mainly to debug the resume process before the system + * can rely on printk/console output. It uses the low-level debugging output + * routine printascii() to do its work. + */ +extern void s3c_pm_dbg(const char *msg, ...); + +#define S3C_PMDBG(fmt...) s3c_pm_dbg(fmt) + +extern void s3c_pm_save_uarts(bool is_s3c24xx); +extern void s3c_pm_restore_uarts(bool is_s3c24xx); + +#ifdef CONFIG_ARCH_S3C64XX +extern void s3c_pm_arch_update_uart(void __iomem *regs, + struct pm_uart_save *save); +#else +static inline void +s3c_pm_arch_update_uart(void __iomem *regs, struct pm_uart_save *save) +{ +} +#endif + +#else +#define S3C_PMDBG(fmt...) pr_debug(fmt) + +static inline void s3c_pm_save_uarts(bool is_s3c24xx) { } +static inline void s3c_pm_restore_uarts(bool is_s3c24xx) { } +#endif + +/* suspend memory checking */ + +#ifdef CONFIG_SAMSUNG_PM_CHECK +extern void s3c_pm_check_prepare(void); +extern void s3c_pm_check_restore(void); +extern void s3c_pm_check_cleanup(void); +extern void s3c_pm_check_store(void); +#else +#define s3c_pm_check_prepare() do { } while (0) +#define s3c_pm_check_restore() do { } while (0) +#define s3c_pm_check_cleanup() do { } while (0) +#define s3c_pm_check_store() do { } while (0) +#endif + +#endif -- 2.20.0
next prev parent reply other threads:[~2019-10-10 20:29 UTC|newest] Thread overview: 135+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-10-10 20:28 [PATCH 00/36] ARM: samsung platform cleanup Arnd Bergmann 2019-10-10 20:28 ` Arnd Bergmann 2019-10-10 20:29 ` [PATCH 01/36] ARM: samsung: make S3C24XX_MISCCR access indirect Arnd Bergmann 2019-10-10 20:29 ` Arnd Bergmann 2019-10-10 20:29 ` [PATCH 02/36] ARM: s3c: simplify mach/io.h Arnd Bergmann 2019-10-10 20:29 ` Arnd Bergmann 2019-10-10 20:29 ` [PATCH 03/36] usb: gadget: s3c: use platform resources Arnd Bergmann 2019-10-10 20:29 ` Arnd Bergmann 2019-10-23 10:06 ` Krzysztof Kozlowski 2019-10-23 12:46 ` Krzysztof Kozlowski 2019-10-23 13:26 ` Arnd Bergmann 2019-10-10 20:29 ` [PATCH 04/36] usb: gadget: s3c-hsudc: remove platform header dependency Arnd Bergmann 2019-10-10 20:29 ` Arnd Bergmann 2019-10-23 10:09 ` Krzysztof Kozlowski 2019-10-23 12:21 ` Arnd Bergmann 2019-10-10 20:29 ` [PATCH 05/36] ARM: samsung: make pm-debug platform independent Arnd Bergmann 2019-10-10 20:29 ` Arnd Bergmann 2019-10-23 10:27 ` Krzysztof Kozlowski 2019-10-23 12:13 ` Arnd Bergmann 2019-10-10 20:29 ` [PATCH 06/36] ARM: samsung: move CONFIG_DEBUG_S3C_UART to Kconfig.debug Arnd Bergmann 2019-10-10 20:29 ` Arnd Bergmann 2019-10-23 10:12 ` Krzysztof Kozlowski 2019-10-23 12:22 ` Arnd Bergmann 2019-10-10 20:29 ` [PATCH 07/36] ARM: exynos: use private samsung_cpu_id copy Arnd Bergmann 2019-10-10 20:29 ` Arnd Bergmann 2019-10-23 10:54 ` Krzysztof Kozlowski 2019-10-23 12:37 ` Arnd Bergmann 2019-10-10 20:29 ` [PATCH 08/36] ARM: exynos: stop selecting PLAT_SAMSUNG Arnd Bergmann 2019-10-10 20:29 ` Arnd Bergmann 2019-10-15 14:12 ` Ulf Hansson 2019-10-23 10:57 ` Krzysztof Kozlowski 2019-10-23 12:43 ` Arnd Bergmann 2019-10-10 20:29 ` Arnd Bergmann [this message] 2019-10-10 20:29 ` [PATCH 09/36] ARM: samsung: move pm check code to drivers/soc Arnd Bergmann 2019-10-23 11:32 ` Krzysztof Kozlowski 2019-10-23 12:45 ` Arnd Bergmann 2019-10-10 20:29 ` [PATCH 10/36] ARM: s5pv210: use private pm save/restore Arnd Bergmann 2019-10-10 20:29 ` Arnd Bergmann 2019-10-23 11:55 ` Krzysztof Kozlowski 2019-10-23 13:12 ` Arnd Bergmann 2019-10-10 20:29 ` [PATCH 11/36] ARM: s5pv210: split from plat-samsung Arnd Bergmann 2019-10-10 20:29 ` Arnd Bergmann 2019-10-11 5:51 ` Uwe Kleine-König 2019-10-11 5:51 ` Uwe Kleine-König 2019-10-22 14:01 ` Arnd Bergmann 2019-10-22 15:53 ` Uwe Kleine-König 2019-10-22 16:20 ` Arnd Bergmann 2019-10-15 14:13 ` Ulf Hansson 2019-10-15 14:23 ` Thierry Reding 2019-10-23 12:14 ` Krzysztof Kozlowski 2019-10-23 13:17 ` Arnd Bergmann 2019-10-23 14:12 ` Krzysztof Kozlowski 2019-10-10 20:29 ` [PATCH 12/36] ARM: s3c64xx: remove mach/hardware.h Arnd Bergmann 2019-10-10 20:29 ` Arnd Bergmann 2019-10-16 10:09 ` Charles Keepax 2019-10-10 20:29 ` [PATCH 13/36] ARM: s3c: move regs-spi.h into spi driver Arnd Bergmann 2019-10-10 20:29 ` Arnd Bergmann 2019-10-23 12:32 ` Krzysztof Kozlowski 2019-10-23 13:21 ` Arnd Bergmann 2019-10-10 20:29 ` [PATCH 14/36] ARM: s3c: move irqchip driver back into platform Arnd Bergmann 2019-10-10 20:29 ` Arnd Bergmann 2019-10-10 20:29 ` [PATCH 15/36] ARM: s3c: adc: move header to linux/soc/samsung Arnd Bergmann 2019-10-10 20:29 ` Arnd Bergmann 2019-10-10 22:20 ` Guenter Roeck 2019-10-10 22:20 ` Guenter Roeck 2019-10-10 22:29 ` Dmitry Torokhov 2019-10-10 22:29 ` Dmitry Torokhov 2019-10-10 22:44 ` Sebastian Reichel 2019-10-10 22:44 ` Sebastian Reichel 2019-10-23 12:37 ` Krzysztof Kozlowski 2019-10-23 13:23 ` Arnd Bergmann 2019-10-10 20:30 ` [PATCH 16/36] ARM: s3c: move spi fiq handler into platform Arnd Bergmann 2019-10-10 20:30 ` Arnd Bergmann 2019-10-10 20:30 ` [PATCH 17/36] ARM: s3c: h1940-audio: turn into platform driver Arnd Bergmann 2019-10-10 20:30 ` Arnd Bergmann 2019-10-10 20:30 ` [PATCH 18/36] ARM: s3c: gta02-audio: " Arnd Bergmann 2019-10-10 20:30 ` Arnd Bergmann 2019-10-10 20:30 ` [PATCH 19/36] ARM: s3c: rx1950: " Arnd Bergmann 2019-10-10 20:30 ` Arnd Bergmann 2019-10-10 20:30 ` [PATCH 20/36] ASoC: samsung: s3c2412-i2s: avoid hardcoded S3C2410_PA_IIS Arnd Bergmann 2019-10-10 20:30 ` Arnd Bergmann 2019-10-11 10:50 ` Mark Brown 2019-10-11 10:50 ` Mark Brown 2019-10-10 20:30 ` [PATCH 21/36] ARM: s3c: move iis pinctrl config into boards Arnd Bergmann 2019-10-10 20:30 ` Arnd Bergmann 2019-10-23 12:50 ` Krzysztof Kozlowski 2019-10-23 13:29 ` Arnd Bergmann 2019-10-10 20:30 ` [PATCH 22/36] ARM: s3c: leds: move setpull() calls into board files Arnd Bergmann 2019-10-10 20:30 ` Arnd Bergmann 2019-10-10 20:30 ` [PATCH 23/36] ARM: s3c: move s3cmci pinctrl handling " Arnd Bergmann 2019-10-10 20:30 ` Arnd Bergmann 2019-10-15 14:12 ` Ulf Hansson 2019-10-16 13:12 ` Linus Walleij 2019-10-10 20:30 ` [PATCH 24/36] ARM: s3c: include mach/irqs.h where needed Arnd Bergmann 2019-10-10 20:30 ` Arnd Bergmann 2019-10-10 20:30 ` [PATCH 25/36] ARM: s3c: spi: avoid hardcoding fiq number in driver Arnd Bergmann 2019-10-10 20:30 ` Arnd Bergmann 2019-10-10 20:30 ` [PATCH 26/36] ARM: s3c: bast: avoid irq_desc array usage Arnd Bergmann 2019-10-10 20:30 ` Arnd Bergmann 2019-10-10 20:30 ` [PATCH 27/36] ARM: s3c: fix mmc gpio lookup tables Arnd Bergmann 2019-10-10 20:30 ` Arnd Bergmann 2019-10-10 20:30 ` [PATCH 28/36] fbdev: s3c2410fb: remove mach header dependency Arnd Bergmann 2019-10-10 20:30 ` Arnd Bergmann 2019-10-23 13:13 ` Krzysztof Kozlowski 2019-10-23 13:35 ` Arnd Bergmann 2019-10-10 20:30 ` [PATCH 29/36] ARM: s3c: cpufreq: split out registers Arnd Bergmann 2019-10-10 20:30 ` Arnd Bergmann 2019-10-10 20:30 ` [PATCH 30/36] ARM: s3c: remove cpufreq header dependencies Arnd Bergmann 2019-10-10 20:30 ` Arnd Bergmann 2019-10-23 13:38 ` Krzysztof Kozlowski 2019-10-23 13:46 ` Arnd Bergmann 2019-10-10 20:30 ` [PATCH 31/36] ARM: s3c: cpufreq: use global s3c2412_cpufreq_setrefresh Arnd Bergmann 2019-10-10 20:30 ` Arnd Bergmann 2019-10-23 13:44 ` Krzysztof Kozlowski 2019-10-23 13:57 ` Arnd Bergmann 2019-10-10 20:30 ` [PATCH 32/36] ARM: s3c: iotiming: make functions static Arnd Bergmann 2019-10-10 20:30 ` Arnd Bergmann 2019-10-10 20:30 ` [PATCH 33/36] ARM: s3c: move low-level clk reg access into platform code Arnd Bergmann 2019-10-10 20:30 ` Arnd Bergmann 2019-10-23 13:49 ` Krzysztof Kozlowski 2019-10-23 13:54 ` Arnd Bergmann 2019-10-10 20:30 ` [PATCH 34/36] ARM: s3c: stop including mach/hardware.h from mach/io.h Arnd Bergmann 2019-10-10 20:30 ` Arnd Bergmann 2019-10-10 21:02 ` Russell King - ARM Linux admin 2019-10-10 21:02 ` Russell King - ARM Linux admin 2019-10-10 21:53 ` Arnd Bergmann 2019-10-10 21:53 ` Arnd Bergmann 2019-10-15 14:52 ` [PATCH 01/36] ARM: samsung: make S3C24XX_MISCCR access indirect Tomasz Figa 2019-10-10 21:07 ` [PATCH 35/36] ARM: s3c: move into a common directory Arnd Bergmann 2019-10-10 21:07 ` Arnd Bergmann 2019-10-23 14:05 ` Krzysztof Kozlowski 2019-10-10 21:07 ` [PATCH 36/36] ARM: s3c: make headers local if possible Arnd Bergmann 2019-10-10 21:07 ` Arnd Bergmann 2019-10-23 13:10 ` [PATCH 00/36] ARM: samsung platform cleanup Krzysztof Kozlowski 2019-10-23 13:39 ` Arnd Bergmann
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20191010203043.1241612-9-arnd@arndb.de \ --to=arnd@arndb.de \ --cc=b.zolnierkie@samsung.com \ --cc=kgene@kernel.org \ --cc=krzk@kernel.org \ --cc=kyungmin.park@samsung.com \ --cc=linus.walleij@linaro.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-samsung-soc@vger.kernel.org \ --cc=m.szyprowski@samsung.com \ --cc=mchehab+samsung@kernel.org \ --cc=pankaj.dubey@samsung.com \ --cc=s.nawrocki@samsung.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).