smp-r8a7791.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * SMP support for r8a7791
  3. *
  4. * Copyright (C) 2013 Renesas Solutions Corp.
  5. * Copyright (C) 2013 Magnus Damm
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; version 2 of the License.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. */
  16. #include <linux/kernel.h>
  17. #include <linux/init.h>
  18. #include <linux/smp.h>
  19. #include <linux/io.h>
  20. #include <asm/smp_plat.h>
  21. #include "common.h"
  22. #include "platsmp-apmu.h"
  23. #include "r8a7791.h"
  24. #include "rcar-gen2.h"
  25. static struct rcar_apmu_config r8a7791_apmu_config[] = {
  26. {
  27. .iomem = DEFINE_RES_MEM(0xe6152000, 0x188),
  28. .cpus = { 0, 1 },
  29. }
  30. };
  31. static void __init r8a7791_smp_prepare_cpus(unsigned int max_cpus)
  32. {
  33. /* let APMU code install data related to shmobile_boot_vector */
  34. shmobile_smp_apmu_prepare_cpus(max_cpus,
  35. r8a7791_apmu_config,
  36. ARRAY_SIZE(r8a7791_apmu_config));
  37. rcar_gen2_pm_init();
  38. }
  39. const struct smp_operations r8a7791_smp_ops __initconst = {
  40. .smp_prepare_cpus = r8a7791_smp_prepare_cpus,
  41. .smp_boot_secondary = shmobile_smp_apmu_boot_secondary,
  42. #ifdef CONFIG_HOTPLUG_CPU
  43. .cpu_can_disable = shmobile_smp_cpu_can_disable,
  44. .cpu_die = shmobile_smp_apmu_cpu_die,
  45. .cpu_kill = shmobile_smp_apmu_cpu_kill,
  46. #endif
  47. };