2010-08-27 21:01:23 +04:00
|
|
|
/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
|
2015-03-03 02:30:29 +03:00
|
|
|
* Copyright (C) 2015 Linaro Ltd.
|
2010-08-27 21:01:23 +04:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 and
|
|
|
|
* only version 2 as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
|
|
* 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
2015-03-12 00:28:10 +03:00
|
|
|
#include <linux/cpumask.h>
|
|
|
|
#include <linux/export.h>
|
|
|
|
#include <linux/types.h>
|
2015-02-27 00:49:09 +03:00
|
|
|
#include <linux/qcom_scm.h>
|
2010-08-27 21:01:23 +04:00
|
|
|
|
2015-03-12 00:28:10 +03:00
|
|
|
#include "qcom_scm.h"
|
2015-03-03 02:30:28 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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)
|
|
|
|
{
|
2015-03-12 00:28:10 +03:00
|
|
|
return __qcom_scm_set_cold_boot_addr(entry, cpus);
|
2015-03-03 02:30:28 +03:00
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(qcom_scm_set_cold_boot_addr);
|
2015-03-03 02:30:29 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* qcom_scm_set_warm_boot_addr() - Set the warm boot address for cpus
|
|
|
|
* @entry: Entry point function for the cpus
|
|
|
|
* @cpus: The cpumask of cpus that will use the entry point
|
|
|
|
*
|
|
|
|
* Set the Linux entry point for the SCM to transfer control to when coming
|
|
|
|
* out of a power down. CPU power down may be executed on cpuidle or hotplug.
|
|
|
|
*/
|
|
|
|
int qcom_scm_set_warm_boot_addr(void *entry, const cpumask_t *cpus)
|
|
|
|
{
|
2015-03-12 00:28:10 +03:00
|
|
|
return __qcom_scm_set_warm_boot_addr(entry, cpus);
|
2015-03-03 02:30:29 +03:00
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(qcom_scm_set_warm_boot_addr);
|
2015-03-03 02:30:30 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* qcom_scm_cpu_power_down() - Power down the cpu
|
|
|
|
* @flags - Flags to flush cache
|
|
|
|
*
|
|
|
|
* This is an end point to power down cpu. If there was a pending interrupt,
|
|
|
|
* the control would return from this function, otherwise, the cpu jumps to the
|
|
|
|
* warm boot entry point set for this cpu upon reset.
|
|
|
|
*/
|
|
|
|
void qcom_scm_cpu_power_down(u32 flags)
|
|
|
|
{
|
2015-03-12 00:28:10 +03:00
|
|
|
__qcom_scm_cpu_power_down(flags);
|
2015-03-03 02:30:30 +03:00
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(qcom_scm_cpu_power_down);
|