platsmp.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * SMP support for R-Mobile / SH-Mobile
  3. *
  4. * Copyright (C) 2010 Magnus Damm
  5. * Copyright (C) 2011 Paul Mundt
  6. *
  7. * Based on vexpress, Copyright (C) 2002 ARM Ltd, All Rights Reserved
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. */
  13. #include <linux/init.h>
  14. #include <asm/cacheflush.h>
  15. #include <asm/smp_plat.h>
  16. #include "common.h"
  17. extern unsigned long shmobile_smp_fn[];
  18. extern unsigned long shmobile_smp_arg[];
  19. extern unsigned long shmobile_smp_mpidr[];
  20. void shmobile_smp_hook(unsigned int cpu, unsigned long fn, unsigned long arg)
  21. {
  22. shmobile_smp_fn[cpu] = 0;
  23. flush_cache_all();
  24. shmobile_smp_mpidr[cpu] = cpu_logical_map(cpu);
  25. shmobile_smp_fn[cpu] = fn;
  26. shmobile_smp_arg[cpu] = arg;
  27. flush_cache_all();
  28. }
  29. #ifdef CONFIG_HOTPLUG_CPU
  30. bool shmobile_smp_cpu_can_disable(unsigned int cpu)
  31. {
  32. return true; /* Hotplug of any CPU is supported */
  33. }
  34. #endif
  35. bool __init shmobile_smp_init_fallback_ops(void)
  36. {
  37. /* fallback on PSCI/smp_ops if no other DT based method is detected */
  38. if (!IS_ENABLED(CONFIG_SMP))
  39. return false;
  40. return platform_can_secondary_boot() ? true : false;
  41. }