platsmp.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 <linux/smp.h>
  15. #include <asm/cacheflush.h>
  16. #include <asm/smp_plat.h>
  17. #include <mach/common.h>
  18. void __init shmobile_smp_init_cpus(unsigned int ncores)
  19. {
  20. unsigned int i;
  21. if (ncores > nr_cpu_ids) {
  22. pr_warn("SMP: %u cores greater than maximum (%u), clipping\n",
  23. ncores, nr_cpu_ids);
  24. ncores = nr_cpu_ids;
  25. }
  26. for (i = 0; i < ncores; i++)
  27. set_cpu_possible(i, true);
  28. }
  29. extern unsigned long shmobile_smp_fn[];
  30. extern unsigned long shmobile_smp_arg[];
  31. extern unsigned long shmobile_smp_mpidr[];
  32. void shmobile_smp_hook(unsigned int cpu, unsigned long fn, unsigned long arg)
  33. {
  34. shmobile_smp_fn[cpu] = 0;
  35. flush_cache_all();
  36. shmobile_smp_mpidr[cpu] = cpu_logical_map(cpu);
  37. shmobile_smp_fn[cpu] = fn;
  38. shmobile_smp_arg[cpu] = arg;
  39. flush_cache_all();
  40. }