smp-low.S 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* SMP IPI low-level handler
  2. *
  3. * Copyright (C) 2006-2007 Matsushita Electric Industrial Co., Ltd.
  4. * All Rights Reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. *
  11. */
  12. #include <linux/sys.h>
  13. #include <linux/linkage.h>
  14. #include <asm/smp.h>
  15. #include <asm/thread_info.h>
  16. #include <asm/cpu-regs.h>
  17. #include <asm/intctl-regs.h>
  18. #include <proc/smp-regs.h>
  19. #include <asm/asm-offsets.h>
  20. #include <asm/frame.inc>
  21. .am33_2
  22. ###############################################################################
  23. #
  24. # IPI interrupt handler
  25. #
  26. ###############################################################################
  27. .globl mn10300_low_ipi_handler
  28. mn10300_low_ipi_handler:
  29. add -4,sp
  30. mov d0,(sp)
  31. movhu (IAGR),d0
  32. and IAGR_GN,d0
  33. lsr 0x2,d0
  34. #ifdef CONFIG_MN10300_CACHE_ENABLED
  35. cmp FLUSH_CACHE_IPI,d0
  36. beq mn10300_flush_cache_ipi
  37. #endif
  38. cmp SMP_BOOT_IRQ,d0
  39. beq mn10300_smp_boot_ipi
  40. /* OTHERS */
  41. mov (sp),d0
  42. add 4,sp
  43. #ifdef CONFIG_GDBSTUB
  44. jmp gdbstub_io_rx_handler
  45. #else
  46. jmp end
  47. #endif
  48. ###############################################################################
  49. #
  50. # Cache flush IPI interrupt handler
  51. #
  52. ###############################################################################
  53. #ifdef CONFIG_MN10300_CACHE_ENABLED
  54. mn10300_flush_cache_ipi:
  55. mov (sp),d0
  56. add 4,sp
  57. /* FLUSH_CACHE_IPI */
  58. add -4,sp
  59. SAVE_ALL
  60. mov GxICR_DETECT,d2
  61. movbu d2,(GxICR(FLUSH_CACHE_IPI)) # ACK the interrupt
  62. movhu (GxICR(FLUSH_CACHE_IPI)),d2
  63. call smp_cache_interrupt[],0
  64. RESTORE_ALL
  65. jmp end
  66. #endif
  67. ###############################################################################
  68. #
  69. # SMP boot CPU IPI interrupt handler
  70. #
  71. ###############################################################################
  72. mn10300_smp_boot_ipi:
  73. /* clear interrupt */
  74. movhu (GxICR(SMP_BOOT_IRQ)),d0
  75. and ~GxICR_REQUEST,d0
  76. movhu d0,(GxICR(SMP_BOOT_IRQ))
  77. mov (sp),d0
  78. add 4,sp
  79. # get stack
  80. mov (CPUID),a0
  81. add -1,a0
  82. add a0,a0
  83. add a0,a0
  84. mov (start_stack,a0),a0
  85. mov a0,sp
  86. jmp initialize_secondary
  87. # Jump here after RTI to suppress the icache lookahead
  88. end: