diff options
author | Lina Iyer <lina.iyer@linaro.org> | 2015-03-02 18:30:28 -0500 |
---|---|---|
committer | Kumar Gala <galak@codeaurora.org> | 2015-03-11 16:15:05 -0400 |
commit | a353e4a06f24235138d483a2625726a5fc472949 (patch) | |
tree | 87c373a4ae708b8f2df901ff9c16592ae02e6338 /drivers/firmware | |
parent | 916f743da3546c28a2f350d197e3bea95d97ba15 (diff) |
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>
Diffstat (limited to 'drivers/firmware')
-rw-r--r-- | drivers/firmware/qcom_scm.c | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c index 6e7a72bdb176..c953cc38918f 100644 --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c | |||
@@ -34,6 +34,11 @@ | |||
34 | #define QCOM_SCM_ERROR -1 | 34 | #define QCOM_SCM_ERROR -1 |
35 | #define QCOM_SCM_INTERRUPTED 1 | 35 | #define QCOM_SCM_INTERRUPTED 1 |
36 | 36 | ||
37 | #define QCOM_SCM_FLAG_COLDBOOT_CPU0 0x00 | ||
38 | #define QCOM_SCM_FLAG_COLDBOOT_CPU1 0x01 | ||
39 | #define QCOM_SCM_FLAG_COLDBOOT_CPU2 0x08 | ||
40 | #define QCOM_SCM_FLAG_COLDBOOT_CPU3 0x20 | ||
41 | |||
37 | static DEFINE_MUTEX(qcom_scm_lock); | 42 | static DEFINE_MUTEX(qcom_scm_lock); |
38 | 43 | ||
39 | /** | 44 | /** |
@@ -329,7 +334,7 @@ EXPORT_SYMBOL(qcom_scm_get_version); | |||
329 | /* | 334 | /* |
330 | * Set the cold/warm boot address for one of the CPU cores. | 335 | * Set the cold/warm boot address for one of the CPU cores. |
331 | */ | 336 | */ |
332 | int qcom_scm_set_boot_addr(u32 addr, int flags) | 337 | static int qcom_scm_set_boot_addr(u32 addr, int flags) |
333 | { | 338 | { |
334 | struct { | 339 | struct { |
335 | __le32 flags; | 340 | __le32 flags; |
@@ -341,4 +346,36 @@ int qcom_scm_set_boot_addr(u32 addr, int flags) | |||
341 | return qcom_scm_call(QCOM_SCM_SVC_BOOT, QCOM_SCM_BOOT_ADDR, | 346 | return qcom_scm_call(QCOM_SCM_SVC_BOOT, QCOM_SCM_BOOT_ADDR, |
342 | &cmd, sizeof(cmd), NULL, 0); | 347 | &cmd, sizeof(cmd), NULL, 0); |
343 | } | 348 | } |
344 | EXPORT_SYMBOL(qcom_scm_set_boot_addr); | 349 | |
350 | /** | ||
351 | * qcom_scm_set_cold_boot_addr() - Set the cold boot address for cpus | ||
352 | * @entry: Entry point function for the cpus | ||
353 | * @cpus: The cpumask of cpus that will use the entry point | ||
354 | * | ||
355 | * Set the cold boot address of the cpus. Any cpu outside the supported | ||
356 | * range would be removed from the cpu present mask. | ||
357 | */ | ||
358 | int qcom_scm_set_cold_boot_addr(void *entry, const cpumask_t *cpus) | ||
359 | { | ||
360 | int flags = 0; | ||
361 | int cpu; | ||
362 | int scm_cb_flags[] = { | ||
363 | QCOM_SCM_FLAG_COLDBOOT_CPU0, | ||
364 | QCOM_SCM_FLAG_COLDBOOT_CPU1, | ||
365 | QCOM_SCM_FLAG_COLDBOOT_CPU2, | ||
366 | QCOM_SCM_FLAG_COLDBOOT_CPU3, | ||
367 | }; | ||
368 | |||
369 | if (!cpus || (cpus && cpumask_empty(cpus))) | ||
370 | return -EINVAL; | ||
371 | |||
372 | for_each_cpu(cpu, cpus) { | ||
373 | if (cpu < ARRAY_SIZE(scm_cb_flags)) | ||
374 | flags |= scm_cb_flags[cpu]; | ||
375 | else | ||
376 | set_cpu_present(cpu, false); | ||
377 | } | ||
378 | |||
379 | return qcom_scm_set_boot_addr(virt_to_phys(entry), flags); | ||
380 | } | ||
381 | EXPORT_SYMBOL(qcom_scm_set_cold_boot_addr); | ||