mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
firmware: qcom: scm: Clean cold boot entry to export only the API
We dont need to export the SCM specific cold boot flags to the platform code. Export only a function to set the cold boot address. Signed-off-by: Lina Iyer <lina.iyer@linaro.org> Signed-off-by: Kumar Gala <galak@codeaurora.org>
This commit is contained in:
parent
916f743da3
commit
a353e4a06f
3 changed files with 43 additions and 24 deletions
|
@ -319,25 +319,10 @@ static int kpssv2_boot_secondary(unsigned int cpu, struct task_struct *idle)
|
||||||
|
|
||||||
static void __init qcom_smp_prepare_cpus(unsigned int max_cpus)
|
static void __init qcom_smp_prepare_cpus(unsigned int max_cpus)
|
||||||
{
|
{
|
||||||
int cpu, map;
|
int cpu;
|
||||||
unsigned int flags = 0;
|
|
||||||
static const int cold_boot_flags[] = {
|
|
||||||
0,
|
|
||||||
QCOM_SCM_FLAG_COLDBOOT_CPU1,
|
|
||||||
QCOM_SCM_FLAG_COLDBOOT_CPU2,
|
|
||||||
QCOM_SCM_FLAG_COLDBOOT_CPU3,
|
|
||||||
};
|
|
||||||
|
|
||||||
for_each_present_cpu(cpu) {
|
if (qcom_scm_set_cold_boot_addr(secondary_startup_arm,
|
||||||
map = cpu_logical_map(cpu);
|
cpu_present_mask)) {
|
||||||
if (WARN_ON(map >= ARRAY_SIZE(cold_boot_flags))) {
|
|
||||||
set_cpu_present(cpu, false);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
flags |= cold_boot_flags[map];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (qcom_scm_set_boot_addr(virt_to_phys(secondary_startup_arm), flags)) {
|
|
||||||
for_each_present_cpu(cpu) {
|
for_each_present_cpu(cpu) {
|
||||||
if (cpu == smp_processor_id())
|
if (cpu == smp_processor_id())
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -34,6 +34,11 @@
|
||||||
#define QCOM_SCM_ERROR -1
|
#define QCOM_SCM_ERROR -1
|
||||||
#define QCOM_SCM_INTERRUPTED 1
|
#define QCOM_SCM_INTERRUPTED 1
|
||||||
|
|
||||||
|
#define QCOM_SCM_FLAG_COLDBOOT_CPU0 0x00
|
||||||
|
#define QCOM_SCM_FLAG_COLDBOOT_CPU1 0x01
|
||||||
|
#define QCOM_SCM_FLAG_COLDBOOT_CPU2 0x08
|
||||||
|
#define QCOM_SCM_FLAG_COLDBOOT_CPU3 0x20
|
||||||
|
|
||||||
static DEFINE_MUTEX(qcom_scm_lock);
|
static DEFINE_MUTEX(qcom_scm_lock);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -329,7 +334,7 @@ EXPORT_SYMBOL(qcom_scm_get_version);
|
||||||
/*
|
/*
|
||||||
* Set the cold/warm boot address for one of the CPU cores.
|
* Set the cold/warm boot address for one of the CPU cores.
|
||||||
*/
|
*/
|
||||||
int qcom_scm_set_boot_addr(u32 addr, int flags)
|
static int qcom_scm_set_boot_addr(u32 addr, int flags)
|
||||||
{
|
{
|
||||||
struct {
|
struct {
|
||||||
__le32 flags;
|
__le32 flags;
|
||||||
|
@ -341,4 +346,36 @@ int qcom_scm_set_boot_addr(u32 addr, int flags)
|
||||||
return qcom_scm_call(QCOM_SCM_SVC_BOOT, QCOM_SCM_BOOT_ADDR,
|
return qcom_scm_call(QCOM_SCM_SVC_BOOT, QCOM_SCM_BOOT_ADDR,
|
||||||
&cmd, sizeof(cmd), NULL, 0);
|
&cmd, sizeof(cmd), NULL, 0);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(qcom_scm_set_boot_addr);
|
|
||||||
|
/**
|
||||||
|
* qcom_scm_set_cold_boot_addr() - Set the cold boot address for cpus
|
||||||
|
* @entry: Entry point function for the cpus
|
||||||
|
* @cpus: The cpumask of cpus that will use the entry point
|
||||||
|
*
|
||||||
|
* Set the cold boot address of the cpus. Any cpu outside the supported
|
||||||
|
* range would be removed from the cpu present mask.
|
||||||
|
*/
|
||||||
|
int qcom_scm_set_cold_boot_addr(void *entry, const cpumask_t *cpus)
|
||||||
|
{
|
||||||
|
int flags = 0;
|
||||||
|
int cpu;
|
||||||
|
int scm_cb_flags[] = {
|
||||||
|
QCOM_SCM_FLAG_COLDBOOT_CPU0,
|
||||||
|
QCOM_SCM_FLAG_COLDBOOT_CPU1,
|
||||||
|
QCOM_SCM_FLAG_COLDBOOT_CPU2,
|
||||||
|
QCOM_SCM_FLAG_COLDBOOT_CPU3,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!cpus || (cpus && cpumask_empty(cpus)))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
for_each_cpu(cpu, cpus) {
|
||||||
|
if (cpu < ARRAY_SIZE(scm_cb_flags))
|
||||||
|
flags |= scm_cb_flags[cpu];
|
||||||
|
else
|
||||||
|
set_cpu_present(cpu, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return qcom_scm_set_boot_addr(virt_to_phys(entry), flags);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(qcom_scm_set_cold_boot_addr);
|
||||||
|
|
|
@ -12,15 +12,12 @@
|
||||||
#ifndef __QCOM_SCM_H
|
#ifndef __QCOM_SCM_H
|
||||||
#define __QCOM_SCM_H
|
#define __QCOM_SCM_H
|
||||||
|
|
||||||
#define QCOM_SCM_FLAG_COLDBOOT_CPU1 0x01
|
|
||||||
#define QCOM_SCM_FLAG_COLDBOOT_CPU2 0x08
|
|
||||||
#define QCOM_SCM_FLAG_COLDBOOT_CPU3 0x20
|
|
||||||
#define QCOM_SCM_FLAG_WARMBOOT_CPU0 0x04
|
#define QCOM_SCM_FLAG_WARMBOOT_CPU0 0x04
|
||||||
#define QCOM_SCM_FLAG_WARMBOOT_CPU1 0x02
|
#define QCOM_SCM_FLAG_WARMBOOT_CPU1 0x02
|
||||||
#define QCOM_SCM_FLAG_WARMBOOT_CPU2 0x10
|
#define QCOM_SCM_FLAG_WARMBOOT_CPU2 0x10
|
||||||
#define QCOM_SCM_FLAG_WARMBOOT_CPU3 0x40
|
#define QCOM_SCM_FLAG_WARMBOOT_CPU3 0x40
|
||||||
|
|
||||||
extern int qcom_scm_set_boot_addr(u32 addr, int flags);
|
extern int qcom_scm_set_cold_boot_addr(void *entry, const cpumask_t *cpus);
|
||||||
|
|
||||||
#define QCOM_SCM_VERSION(major, minor) (((major) << 16) | ((minor) & 0xFF))
|
#define QCOM_SCM_VERSION(major, minor) (((major) << 16) | ((minor) & 0xFF))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue