malta_smtc.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * Malta Platform-specific hooks for SMP operation
  3. */
  4. #include <linux/init.h>
  5. #include <asm/mipsregs.h>
  6. #include <asm/mipsmtregs.h>
  7. #include <asm/smtc.h>
  8. #include <asm/smtc_ipi.h>
  9. /* VPE/SMP Prototype implements platform interfaces directly */
  10. /*
  11. * Cause the specified action to be performed on a targeted "CPU"
  12. */
  13. void core_send_ipi(int cpu, unsigned int action)
  14. {
  15. /* "CPU" may be TC of same VPE, VPE of same CPU, or different CPU */
  16. smtc_send_ipi(cpu, LINUX_SMP_IPI, action);
  17. }
  18. /*
  19. * Platform "CPU" startup hook
  20. */
  21. void prom_boot_secondary(int cpu, struct task_struct *idle)
  22. {
  23. smtc_boot_secondary(cpu, idle);
  24. }
  25. /*
  26. * Post-config but pre-boot cleanup entry point
  27. */
  28. void prom_init_secondary(void)
  29. {
  30. void smtc_init_secondary(void);
  31. int myvpe;
  32. /* Don't enable Malta I/O interrupts (IP2) for secondary VPEs */
  33. myvpe = read_c0_tcbind() & TCBIND_CURVPE;
  34. if (myvpe != 0) {
  35. /* Ideally, this should be done only once per VPE, but... */
  36. clear_c0_status(STATUSF_IP2);
  37. set_c0_status(STATUSF_IP0 | STATUSF_IP1 | STATUSF_IP3
  38. | STATUSF_IP4 | STATUSF_IP5 | STATUSF_IP6
  39. | STATUSF_IP7);
  40. }
  41. smtc_init_secondary();
  42. }
  43. /*
  44. * Platform SMP pre-initialization
  45. *
  46. * As noted above, we can assume a single CPU for now
  47. * but it may be multithreaded.
  48. */
  49. void plat_smp_setup(void)
  50. {
  51. if (read_c0_config3() & (1<<2))
  52. mipsmt_build_cpu_map(0);
  53. }
  54. void __init plat_prepare_cpus(unsigned int max_cpus)
  55. {
  56. if (read_c0_config3() & (1<<2))
  57. mipsmt_prepare_cpus();
  58. }
  59. /*
  60. * SMP initialization finalization entry point
  61. */
  62. void prom_smp_finish(void)
  63. {
  64. smtc_smp_finish();
  65. }
  66. /*
  67. * Hook for after all CPUs are online
  68. */
  69. void prom_cpus_done(void)
  70. {
  71. }