Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7638e7a authored by Olof Johansson's avatar Olof Johansson
Browse files

Merge branch 'v3.19-next/pm-samsung-2' of...

Merge branch 'v3.19-next/pm-samsung-2' of http://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into next/soc

Merge "1st Round of Samsung PM updates for v3.19" from Kukjin Kim:

Samsung PM (v2) updates for v3.19

- added fix build with ARM_CPU_SUSPEND=n based on previous
  tags/samsung-pm

- Refactor the pm code to use DT based lookup instead of
  using "soc_is_exynosxxxx"

- Firmware supporting suspend and resume to excute of low
  level operations to enter and leave power mode for exynos
  : introduce suspend() and resume() firmware operations

- Fix AFTR mode on boards with secure firmware enabled and
  allows exynos cpuidle driver usage on exynos4x12 SoCs

- Fix build with PM_SLEEP=n and ARM_EXYNOS_CPUIDLE=y

- SWRESET is needed to boot secondary CPU on exynos3250

* 'v3.19-next/pm-samsung-2' of http://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung

:
  ARM: EXYNOS: Fix build with ARM_CPU_SUSPEND=n
  ARM: EXYNOS: SWRESET is needed to boot secondary CPU on exynos3250
  ARM: EXYNOS: Fix build with PM_SLEEP=n and ARM_EXYNOS_CPUIDLE=y
  ARM: EXYNOS: allow driver usage on Exynos4x12 SoCs
  ARM: EXYNOS: fix register setup for AFTR mode code
  ARM: EXYNOS: add secure firmware support to AFTR mode code
  ARM: firmware: add AFTR mode support to firmware do_idle method
  ARM: EXYNOS: replace EXYNOS_BOOT_VECTOR_* macros by static inlines
  ARM: EXYNOS: Add support for firmware-assisted suspend/resume
  ARM: firmware: Introduce suspend and resume operations
  ARM: EXYNOS: Refactor the pm code to use DT based lookup
  ARM: EXYNOS: Move Disabling of JPEG USE_RETENTION for exynos5250 to pmu.c

Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
parents 69178178 03c1b760
Loading
Loading
Loading
Loading
+5 −23
Original line number Diff line number Diff line
@@ -7,32 +7,14 @@ world, which changes the way some things have to be initialized. This makes
a need to provide an interface for such platforms to specify available firmware
operations and call them when needed.

Firmware operations can be specified using struct firmware_ops

	struct firmware_ops {
		/*
		* Enters CPU idle mode
		*/
		int (*do_idle)(void);
		/*
		* Sets boot address of specified physical CPU
		*/
		int (*set_cpu_boot_addr)(int cpu, unsigned long boot_addr);
		/*
		* Boots specified physical CPU
		*/
		int (*cpu_boot)(int cpu);
		/*
		* Initializes L2 cache
		*/
		int (*l2x0_init)(void);
	};

and then registered with register_firmware_ops function
Firmware operations can be specified by filling in a struct firmware_ops
with appropriate callbacks and then registering it with register_firmware_ops()
function.

	void register_firmware_ops(const struct firmware_ops *ops)

the ops pointer must be non-NULL.
The ops pointer must be non-NULL. More information about struct firmware_ops
and its members can be found in arch/arm/include/asm/firmware.h header.

There is a default, empty set of operations provided, so there is no need to
set anything if platform does not require firmware operations.
+9 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ struct firmware_ops {
	/*
	 * Enters CPU idle mode
	 */
	int (*do_idle)(void);
	int (*do_idle)(unsigned long mode);
	/*
	 * Sets boot address of specified physical CPU
	 */
@@ -41,6 +41,14 @@ struct firmware_ops {
	 * Initializes L2 cache
	 */
	int (*l2x0_init)(void);
	/*
	 * Enter system-wide suspend.
	 */
	int (*suspend)(void);
	/*
	 * Restore state of privileged hardware after system-wide suspend.
	 */
	int (*resume)(void);
};

/* Global pointer for current firmware_ops structure, can't be NULL. */
+5 −0
Original line number Diff line number Diff line
@@ -123,4 +123,9 @@ config EXYNOS5420_MCPM
	  This is needed to provide CPU and cluster power management
	  on Exynos5420 implementing big.LITTLE.

config EXYNOS_CPU_SUSPEND
	bool
	select ARM_CPU_SUSPEND
	default PM_SLEEP || ARM_EXYNOS_CPUIDLE

endif
+3 −1
Original line number Diff line number Diff line
@@ -11,7 +11,8 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) += -I$(srctree)/$(src)/include -I$(srctree)

obj-$(CONFIG_ARCH_EXYNOS)	+= exynos.o pmu.o exynos-smc.o firmware.o

obj-$(CONFIG_PM_SLEEP)		+= pm.o sleep.o
obj-$(CONFIG_EXYNOS_CPU_SUSPEND) += pm.o sleep.o
obj-$(CONFIG_PM_SLEEP)		+= suspend.o
obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o

obj-$(CONFIG_SMP)		+= platsmp.o headsmp.o
@@ -21,6 +22,7 @@ CFLAGS_hotplug.o += -march=armv7-a

plus_sec := $(call as-instr,.arch_extension sec,+sec)
AFLAGS_exynos-smc.o		:=-Wa,-march=armv7-a$(plus_sec)
AFLAGS_sleep.o			:=-Wa,-march=armv7-a$(plus_sec)

obj-$(CONFIG_EXYNOS5420_MCPM)	+= mcpm-exynos.o
CFLAGS_mcpm-exynos.o		+= -march=armv7-a
+13 −0
Original line number Diff line number Diff line
@@ -111,11 +111,19 @@ IS_SAMSUNG_CPU(exynos5800, EXYNOS5800_SOC_ID, EXYNOS5_SOC_MASK)
#define soc_is_exynos5() (soc_is_exynos5250() || soc_is_exynos5410() || \
			  soc_is_exynos5420() || soc_is_exynos5800())

extern u32 cp15_save_diag;
extern u32 cp15_save_power;

extern void __iomem *sysram_ns_base_addr;
extern void __iomem *sysram_base_addr;
extern void __iomem *pmu_base_addr;
void exynos_sysram_init(void);

enum {
	FW_DO_IDLE_SLEEP,
	FW_DO_IDLE_AFTR,
};

void exynos_firmware_init(void);

extern u32 exynos_get_eint_wake_mask(void);
@@ -127,6 +135,7 @@ static inline void exynos_pm_init(void) {}
#endif

extern void exynos_cpu_resume(void);
extern void exynos_cpu_resume_ns(void);

extern struct smp_operations exynos_smp_ops;

@@ -155,6 +164,10 @@ extern int exynos_cpu_power_state(int cpu);
extern void exynos_cluster_power_down(int cluster);
extern void exynos_cluster_power_up(int cluster);
extern int  exynos_cluster_power_state(int cluster);
extern void exynos_cpu_save_register(void);
extern void exynos_cpu_restore_register(void);
extern void exynos_pm_central_suspend(void);
extern int exynos_pm_central_resume(void);
extern void exynos_enter_aftr(void);

extern void s5p_init_cpu(void __iomem *cpuid_addr);
Loading