Skip to content

Commit

Permalink
ARM: EXYNOS: Remove duplicated define of SLEEP_MAGIC
Browse files Browse the repository at this point in the history
The magic cookie for entering sleep state was defined and used in
two different places: firmware.c and suspend.c. Move it to one common
place to reduce duplication.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Kukjin Kim <[email protected]>
  • Loading branch information
krzk authored and Kukjin Kim committed Jul 21, 2015
1 parent b69bef9 commit 054e6aa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 6 additions & 0 deletions arch/arm/mach-exynos/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ void exynos_firmware_init(void);

/* CPU BOOT mode flag for Exynos3250 SoC bootloader */
#define C2_STATE (1 << 3)
/*
* Magic values for bootloader indicating chosen low power mode.
* See also Documentation/arm/Samsung/Bootloader-interface.txt
*/
#define EXYNOS_SLEEP_MAGIC 0x00000bad
#define EXYNOS_AFTR_MAGIC 0xfcba0d10

void exynos_set_boot_flag(unsigned int cpu, unsigned int mode);
void exynos_clear_boot_flag(unsigned int cpu, unsigned int mode);
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/mach-exynos/firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
#include "common.h"
#include "smc.h"

#define EXYNOS_SLEEP_MAGIC 0x00000bad
#define EXYNOS_AFTR_MAGIC 0xfcba0d10
#define EXYNOS_BOOT_ADDR 0x8
#define EXYNOS_BOOT_FLAG 0xc

Expand Down
4 changes: 1 addition & 3 deletions arch/arm/mach-exynos/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
#include "regs-pmu.h"
#include "exynos-pmu.h"

#define S5P_CHECK_SLEEP 0x00000BAD

#define REG_TABLE_END (-1U)

#define EXYNOS5420_CPU_STATE 0x28
Expand Down Expand Up @@ -331,7 +329,7 @@ static void exynos_pm_enter_sleep_mode(void)
{
/* Set value of power down register for sleep mode */
exynos_sys_powerdown_conf(SYS_SLEEP);
pmu_raw_writel(S5P_CHECK_SLEEP, S5P_INFORM1);
pmu_raw_writel(EXYNOS_SLEEP_MAGIC, S5P_INFORM1);
}

static void exynos_pm_prepare(void)
Expand Down

0 comments on commit 054e6aa

Please sign in to comment.