17
17
#include <linux/reset-controller.h>
18
18
#include <linux/arm-smccc.h>
19
19
20
- #if defined(CONFIG_ARM ) || defined(CONFIG_ARM64 )
21
- #include <asm/smp_plat.h>
22
- #endif
23
-
24
20
#include "qcom_scm.h"
25
21
26
22
static bool download_mode = IS_ENABLED (CONFIG_QCOM_SCM_DOWNLOAD_MODE_DEFAULT );
@@ -264,44 +260,15 @@ static bool __qcom_scm_is_call_available(struct device *dev, u32 svc_id,
264
260
return ret ? false : !!res .result [0 ];
265
261
}
266
262
267
- #if defined(CONFIG_ARM ) || defined(CONFIG_ARM64 )
268
- static int __qcom_scm_set_boot_addr_mc (void * entry , const cpumask_t * cpus ,
269
- unsigned int flags )
270
- {
271
- struct qcom_scm_desc desc = {
272
- .svc = QCOM_SCM_SVC_BOOT ,
273
- .cmd = QCOM_SCM_BOOT_SET_ADDR_MC ,
274
- .owner = ARM_SMCCC_OWNER_SIP ,
275
- .arginfo = QCOM_SCM_ARGS (6 ),
276
- };
277
- unsigned int cpu ;
278
- u64 map ;
279
-
280
- /* Need a device for DMA of the additional arguments */
281
- if (!__scm || __get_convention () == SMC_CONVENTION_LEGACY )
282
- return - EOPNOTSUPP ;
283
-
284
- desc .args [0 ] = virt_to_phys (entry );
285
- for_each_cpu (cpu , cpus ) {
286
- map = cpu_logical_map (cpu );
287
- desc .args [1 ] |= BIT (MPIDR_AFFINITY_LEVEL (map , 0 ));
288
- desc .args [2 ] |= BIT (MPIDR_AFFINITY_LEVEL (map , 1 ));
289
- desc .args [3 ] |= BIT (MPIDR_AFFINITY_LEVEL (map , 2 ));
290
- }
291
- desc .args [4 ] = ~0ULL ; /* Reserved for affinity level 3 */
292
- desc .args [5 ] = flags ;
293
-
294
- return qcom_scm_call (__scm -> dev , & desc , NULL );
295
- }
296
- #else
297
- static inline int __qcom_scm_set_boot_addr_mc (void * entry , const cpumask_t * cpus ,
298
- unsigned int flags )
299
- {
300
- return - EINVAL ;
301
- }
302
- #endif
303
-
304
- static int __qcom_scm_set_warm_boot_addr (void * entry , const cpumask_t * cpus )
263
+ /**
264
+ * qcom_scm_set_warm_boot_addr() - Set the warm boot address for cpus
265
+ * @entry: Entry point function for the cpus
266
+ * @cpus: The cpumask of cpus that will use the entry point
267
+ *
268
+ * Set the Linux entry point for the SCM to transfer control to when coming
269
+ * out of a power down. CPU power down may be executed on cpuidle or hotplug.
270
+ */
271
+ int qcom_scm_set_warm_boot_addr (void * entry , const cpumask_t * cpus )
305
272
{
306
273
int ret ;
307
274
int flags = 0 ;
@@ -337,28 +304,17 @@ static int __qcom_scm_set_warm_boot_addr(void *entry, const cpumask_t *cpus)
337
304
338
305
return ret ;
339
306
}
307
+ EXPORT_SYMBOL (qcom_scm_set_warm_boot_addr );
340
308
341
309
/**
342
- * qcom_scm_set_warm_boot_addr () - Set the warm boot address for cpus
310
+ * qcom_scm_set_cold_boot_addr () - Set the cold boot address for cpus
343
311
* @entry: Entry point function for the cpus
344
312
* @cpus: The cpumask of cpus that will use the entry point
345
313
*
346
- * Set the Linux entry point for the SCM to transfer control to when coming
347
- * out of a power down. CPU power down may be executed on cpuidle or hotplug .
314
+ * Set the cold boot address of the cpus. Any cpu outside the supported
315
+ * range would be removed from the cpu present mask .
348
316
*/
349
- int qcom_scm_set_warm_boot_addr (void * entry , const cpumask_t * cpus )
350
- {
351
- if (!cpus || cpumask_empty (cpus ))
352
- return - EINVAL ;
353
-
354
- if (__qcom_scm_set_boot_addr_mc (entry , cpus , QCOM_SCM_BOOT_MC_FLAG_WARMBOOT ))
355
- /* Fallback to old SCM call */
356
- return __qcom_scm_set_warm_boot_addr (entry , cpus );
357
- return 0 ;
358
- }
359
- EXPORT_SYMBOL (qcom_scm_set_warm_boot_addr );
360
-
361
- static int __qcom_scm_set_cold_boot_addr (void * entry , const cpumask_t * cpus )
317
+ int qcom_scm_set_cold_boot_addr (void * entry , const cpumask_t * cpus )
362
318
{
363
319
int flags = 0 ;
364
320
int cpu ;
@@ -375,6 +331,9 @@ static int __qcom_scm_set_cold_boot_addr(void *entry, const cpumask_t *cpus)
375
331
.owner = ARM_SMCCC_OWNER_SIP ,
376
332
};
377
333
334
+ if (!cpus || cpumask_empty (cpus ))
335
+ return - EINVAL ;
336
+
378
337
for_each_cpu (cpu , cpus ) {
379
338
if (cpu < ARRAY_SIZE (scm_cb_flags ))
380
339
flags |= scm_cb_flags [cpu ];
@@ -387,25 +346,6 @@ static int __qcom_scm_set_cold_boot_addr(void *entry, const cpumask_t *cpus)
387
346
388
347
return qcom_scm_call_atomic (__scm ? __scm -> dev : NULL , & desc , NULL );
389
348
}
390
-
391
- /**
392
- * qcom_scm_set_cold_boot_addr() - Set the cold boot address for cpus
393
- * @entry: Entry point function for the cpus
394
- * @cpus: The cpumask of cpus that will use the entry point
395
- *
396
- * Set the cold boot address of the cpus. Any cpu outside the supported
397
- * range would be removed from the cpu present mask.
398
- */
399
- int qcom_scm_set_cold_boot_addr (void * entry , const cpumask_t * cpus )
400
- {
401
- if (!cpus || cpumask_empty (cpus ))
402
- return - EINVAL ;
403
-
404
- if (__qcom_scm_set_boot_addr_mc (entry , cpus , QCOM_SCM_BOOT_MC_FLAG_COLDBOOT ))
405
- /* Fallback to old SCM call */
406
- return __qcom_scm_set_cold_boot_addr (entry , cpus );
407
- return 0 ;
408
- }
409
349
EXPORT_SYMBOL (qcom_scm_set_cold_boot_addr );
410
350
411
351
/**
0 commit comments