mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 00:39:46 +07:00
3179d37ee1
This patch adds code to generate entry & exit code for various low power states available on systems based around the MIPS Coherent Processing System architecture (ie. those with a Coherence Manager, Global Interrupt Controller & for >=CM2 a Cluster Power Controller). States supported are: - Non-coherent wait. This state first leaves the coherent domain and then executes a regular MIPS wait instruction. Power savings are found from the elimination of coherency interventions between the core and any other coherent requestors in the system. - Clock gated. This state leaves the coherent domain and then gates the clock input to the core. This removes all dynamic power from the core but leaves the core at the mercy of another to restart its clock. Register state is preserved, but the core can not service interrupts whilst its clock is gated. - Power gated. This deepest state removes all power input to the core. All register state is lost and the core will restart execution from its BEV when another core powers it back up. Because register state is lost this state requires cooperation with the CONFIG_MIPS_CPS SMP implementation in order for the core to exit the state successfully. The code will detect which states are available on the current system during boot & generate the entry/exit code for those states. This will be used by cpuidle & hotplug implementations. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
45 lines
1.0 KiB
C
45 lines
1.0 KiB
C
/*
|
|
* Copyright (C) 2013 Imagination Technologies
|
|
* Author: Paul Burton <paul.burton@imgtec.com>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License as published by the
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
* option) any later version.
|
|
*/
|
|
|
|
#ifndef __MIPS_ASM_SMP_CPS_H__
|
|
#define __MIPS_ASM_SMP_CPS_H__
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
struct vpe_boot_config {
|
|
unsigned long pc;
|
|
unsigned long sp;
|
|
unsigned long gp;
|
|
};
|
|
|
|
struct core_boot_config {
|
|
atomic_t vpe_mask;
|
|
struct vpe_boot_config *vpe_config;
|
|
};
|
|
|
|
extern struct core_boot_config *mips_cps_core_bootcfg;
|
|
|
|
extern void mips_cps_core_entry(void);
|
|
extern void mips_cps_core_init(void);
|
|
|
|
extern struct vpe_boot_config *mips_cps_boot_vpes(void);
|
|
|
|
extern bool mips_cps_smp_in_use(void);
|
|
|
|
extern void mips_cps_pm_save(void);
|
|
extern void mips_cps_pm_restore(void);
|
|
|
|
#else /* __ASSEMBLY__ */
|
|
|
|
.extern mips_cps_bootcfg;
|
|
|
|
#endif /* __ASSEMBLY__ */
|
|
#endif /* __MIPS_ASM_SMP_CPS_H__ */
|