Samsung mach/soc changes for v4.21

Just cleanups of: legacy way of setting external wakeup interrupts, old
 power management debugging functions and duplicated secondary startup
 initialization.
 -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEE3dJiKD0RGyM7briowTdm5oaLg9cFAlwM80UQHGtyemtAa2Vy
 bmVsLm9yZwAKCRDBN2bmhouD17ZID/48/RAAbBENx47QTwsjh/e8dEEZnIxzDl6Q
 krjuPmZNr9mzuOQ2qGLaw2rcZ0GNX2EswgUXWY0JkcfCqFQVzxWhe+y4GFeENx9E
 rc4p8TjtuQX1ZY4lXKUCmUin8lS46+wBwkdwUoDMhqJpYmyqvz1nAYey1Lal8l25
 eIJoIYKXkxmfpEYMAO5QgPJI74m5yeibV7uREE1DentmZIW/KrWzkaKzRkCc0fOh
 jmFXLVMqZg/CnWfNJNhgQNyM9HjFwW4VhHoF6Puq+DKP6o6yEH6AdJzQ410Mnxi8
 4CAytkEfrL5FbwwRUkc3I0Ej4vs3LZiGRtmtIVMkxfHXsDMuroSt+vJKCCb74vq/
 3JEBeb1uLEJIBiMcE0OhH8Rery6egiUwOxKdsLoBLcih7c2570ki2I0e1k6q65ww
 2tPSrPWIUOJ52Ru9ekCj1GveUfhsz2rbs0eIvTVlnLssPhTZiYTgF8Sl5QOHX/WB
 yZYoS8YD8AJYouv0adDX88TgqulV7Kea2DIOMZTYBKS30i7Edmd/+ioNGYmLml3t
 Z7ekJ71omi5CmuxMzA9Am7pY+6JpVsHTyBWk2BW1TZFNc3o18uTxDCW1Evd1X/dE
 T7n2M3OZxv9rQgJlUt8lk/0fwzjP+Tx/psUxJyjc/wn8U2vnoANGMPjxSRORSPVA
 2UpPbfutfQ==
 =w8pa
 -----END PGP SIGNATURE-----

Merge tag 'samsung-soc-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into next/soc

Samsung mach/soc changes for v4.21

Just cleanups of: legacy way of setting external wakeup interrupts, old
power management debugging functions and duplicated secondary startup
initialization.

* tag 'samsung-soc-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux:
  ARM: exynos: Remove secondary startup initialization from smp_prepare_cpus
  ARM: samsung: Limit SAMSUNG_PM_DEBUG config option to non-Exynos platforms
  ARM: exynos: Remove no longer needed s3c_pm_check_*() calls
  ARM: exynos: Remove legacy setting of external wakeup interrupts
  ARM: s5pv210: Remove legacy setting of external wakeup interrupts

Signed-off-by: Olof Johansson <olof@lixom.net>
This commit is contained in:
Olof Johansson 2018-12-12 13:52:15 -08:00
commit 3aab54033a
6 changed files with 29 additions and 54 deletions

View File

@ -114,8 +114,6 @@ bool __init exynos_secure_firmware_available(void);
void exynos_set_boot_flag(unsigned int cpu, unsigned int mode);
void exynos_clear_boot_flag(unsigned int cpu, unsigned int mode);
extern u32 exynos_get_eint_wake_mask(void);
#ifdef CONFIG_PM_SLEEP
extern void __init exynos_pm_init(void);
#else

View File

@ -397,38 +397,12 @@ fail:
static void __init exynos_smp_prepare_cpus(unsigned int max_cpus)
{
int i;
exynos_sysram_init();
exynos_set_delayed_reset_assertion(true);
if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9)
exynos_scu_enable();
/*
* Write the address of secondary startup into the
* system-wide flags register. The boot monitor waits
* until it receives a soft interrupt, and then the
* secondary CPU branches to this address.
*
* Try using firmware operation first and fall back to
* boot register if it fails.
*/
for (i = 1; i < max_cpus; ++i) {
unsigned long boot_addr;
u32 mpidr;
u32 core_id;
int ret;
mpidr = cpu_logical_map(i);
core_id = MPIDR_AFFINITY_LEVEL(mpidr, 0);
boot_addr = __pa_symbol(exynos4_secondary_startup);
ret = exynos_set_boot_addr(core_id, boot_addr);
if (ret)
break;
}
}
#ifdef CONFIG_HOTPLUG_CPU

View File

@ -30,8 +30,6 @@
#include <asm/smp_scu.h>
#include <asm/suspend.h>
#include <plat/pm-common.h>
#include "common.h"
#define REG_TABLE_END (-1U)
@ -93,6 +91,11 @@ static const struct exynos_wkup_irq exynos5250_wkup_irq[] = {
{ /* sentinel */ },
};
static u32 exynos_read_eint_wakeup_mask(void)
{
return pmu_raw_readl(EXYNOS_EINT_WAKEUP_MASK);
}
static int exynos_irq_set_wake(struct irq_data *data, unsigned int state)
{
const struct exynos_wkup_irq *wkup_irq;
@ -277,8 +280,10 @@ static int exynos5420_cpu_suspend(unsigned long arg)
static void exynos_pm_set_wakeup_mask(void)
{
/* Set wake-up mask registers */
pmu_raw_writel(exynos_get_eint_wake_mask(), EXYNOS_EINT_WAKEUP_MASK);
/*
* Set wake-up mask registers
* EXYNOS_EINT_WAKEUP_MASK is set by pinctrl driver in late suspend.
*/
pmu_raw_writel(exynos_irqwake_intmask & ~(1 << 31), S5P_WAKEUP_MASK);
}
@ -488,27 +493,24 @@ early_wakeup:
static int exynos_suspend_enter(suspend_state_t state)
{
u32 eint_wakeup_mask = exynos_read_eint_wakeup_mask();
int ret;
s3c_pm_debug_init();
pr_debug("%s: suspending the system...\n", __func__);
S3C_PMDBG("%s: suspending the system...\n", __func__);
S3C_PMDBG("%s: wakeup masks: %08x,%08x\n", __func__,
exynos_irqwake_intmask, exynos_get_eint_wake_mask());
pr_debug("%s: wakeup masks: %08x,%08x\n", __func__,
exynos_irqwake_intmask, eint_wakeup_mask);
if (exynos_irqwake_intmask == -1U
&& exynos_get_eint_wake_mask() == -1U) {
&& eint_wakeup_mask == EXYNOS_EINT_WAKEUP_MASK_DISABLED) {
pr_err("%s: No wake-up sources!\n", __func__);
pr_err("%s: Aborting sleep\n", __func__);
return -EINVAL;
}
s3c_pm_save_uarts();
if (pm_data->pm_prepare)
pm_data->pm_prepare();
flush_cache_all();
s3c_pm_check_store();
ret = call_firmware_op(suspend);
if (ret == -ENOSYS)
@ -518,14 +520,11 @@ static int exynos_suspend_enter(suspend_state_t state)
if (pm_data->pm_resume_prepare)
pm_data->pm_resume_prepare();
s3c_pm_restore_uarts();
S3C_PMDBG("%s: wakeup stat: %08x\n", __func__,
pr_debug("%s: wakeup stat: %08x\n", __func__,
pmu_raw_readl(S5P_WAKEUP_STAT));
s3c_pm_check_restore();
S3C_PMDBG("%s: resuming the system...\n", __func__);
pr_debug("%s: resuming the system...\n", __func__);
return 0;
}
@ -548,8 +547,6 @@ static int exynos_suspend_prepare(void)
return ret;
}
s3c_pm_check_prepare();
return 0;
}
@ -557,8 +554,6 @@ static void exynos_suspend_finish(void)
{
int ret;
s3c_pm_check_cleanup();
ret = regulator_suspend_finish();
if (ret)
pr_warn("Failed to resume regulators from suspend (%d)\n", ret);

View File

@ -10,7 +10,6 @@
#define __ARCH_ARM_MACH_S5PV210_COMMON_H
#ifdef CONFIG_PM_SLEEP
u32 exynos_get_eint_wake_mask(void);
void s5pv210_cpu_resume(void);
void s5pv210_pm_init(void);
#else

View File

@ -32,6 +32,11 @@ static struct sleep_save s5pv210_core_save[] = {
*/
static u32 s5pv210_irqwake_intmask = 0xffffffff;
static u32 s5pv210_read_eint_wakeup_mask(void)
{
return __raw_readl(S5P_EINT_WAKEUP_MASK);
}
/*
* Suspend helpers.
*/
@ -59,8 +64,10 @@ static void s5pv210_pm_prepare(void)
{
unsigned int tmp;
/* Set wake-up mask registers */
__raw_writel(exynos_get_eint_wake_mask(), S5P_EINT_WAKEUP_MASK);
/*
* Set wake-up mask registers
* S5P_EINT_WAKEUP_MASK is set by pinctrl driver in late suspend.
*/
__raw_writel(s5pv210_irqwake_intmask, S5P_WAKEUP_MASK);
/* ensure at least INFORM0 has the resume address */
@ -89,6 +96,7 @@ static void s5pv210_pm_prepare(void)
*/
static int s5pv210_suspend_enter(suspend_state_t state)
{
u32 eint_wakeup_mask = s5pv210_read_eint_wakeup_mask();
int ret;
s3c_pm_debug_init();
@ -96,10 +104,10 @@ static int s5pv210_suspend_enter(suspend_state_t state)
S3C_PMDBG("%s: suspending the system...\n", __func__);
S3C_PMDBG("%s: wakeup masks: %08x,%08x\n", __func__,
s5pv210_irqwake_intmask, exynos_get_eint_wake_mask());
s5pv210_irqwake_intmask, eint_wakeup_mask);
if (s5pv210_irqwake_intmask == -1U
&& exynos_get_eint_wake_mask() == -1U) {
&& eint_wakeup_mask == -1U) {
pr_err("%s: No wake-up sources!\n", __func__);
pr_err("%s: Aborting sleep\n", __func__);
return -EINVAL;

View File

@ -239,6 +239,7 @@ 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_EXYNOS_UART || DEBUG_S3C24XX_UART || DEBUG_S3C2410_UART
help
Say Y here if you want verbose debugging from the PM Suspend and