platsmp.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * linux/arch/arm/mach-vexpress/platsmp.c
  3. *
  4. * Copyright (C) 2002 ARM Ltd.
  5. * All Rights Reserved
  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 version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #include <linux/init.h>
  12. #include <linux/errno.h>
  13. #include <linux/smp.h>
  14. #include <linux/io.h>
  15. #include <asm/unified.h>
  16. #include <mach/motherboard.h>
  17. #define V2M_PA_CS7 0x10000000
  18. #include "core.h"
  19. extern void versatile_secondary_startup(void);
  20. /*
  21. * Initialise the CPU possible map early - this describes the CPUs
  22. * which may be present or become present in the system.
  23. */
  24. void __init smp_init_cpus(void)
  25. {
  26. ct_desc->init_cpu_map();
  27. }
  28. void __init platform_smp_prepare_cpus(unsigned int max_cpus)
  29. {
  30. /*
  31. * Initialise the present map, which describes the set of CPUs
  32. * actually populated at the present time.
  33. */
  34. ct_desc->smp_enable(max_cpus);
  35. /*
  36. * Write the address of secondary startup into the
  37. * system-wide flags register. The boot monitor waits
  38. * until it receives a soft interrupt, and then the
  39. * secondary CPU branches to this address.
  40. */
  41. writel(~0, MMIO_P2V(V2M_SYS_FLAGSCLR));
  42. writel(BSYM(virt_to_phys(versatile_secondary_startup)),
  43. MMIO_P2V(V2M_SYS_FLAGSSET));
  44. }