kernel-entry-init.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2005 Embedded Alley Solutions, Inc
  7. * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
  8. * Copyright (C) 2009 Jiajie Chen (chenjiajie@cse.buaa.edu.cn)
  9. * Copyright (C) 2012 Huacai Chen (chenhc@lemote.com)
  10. */
  11. #ifndef __ASM_MACH_LOONGSON64_KERNEL_ENTRY_H
  12. #define __ASM_MACH_LOONGSON64_KERNEL_ENTRY_H
  13. /*
  14. * Override macros used in arch/mips/kernel/head.S.
  15. */
  16. .macro kernel_entry_setup
  17. #ifdef CONFIG_CPU_LOONGSON3
  18. .set push
  19. .set mips64
  20. /* Set LPA on LOONGSON3 config3 */
  21. mfc0 t0, $16, 3
  22. or t0, (0x1 << 7)
  23. mtc0 t0, $16, 3
  24. /* Set ELPA on LOONGSON3 pagegrain */
  25. mfc0 t0, $5, 1
  26. or t0, (0x1 << 29)
  27. mtc0 t0, $5, 1
  28. #ifdef CONFIG_LOONGSON3_ENHANCEMENT
  29. /* Enable STFill Buffer */
  30. mfc0 t0, $16, 6
  31. or t0, 0x100
  32. mtc0 t0, $16, 6
  33. #endif
  34. _ehb
  35. .set pop
  36. #endif
  37. .endm
  38. /*
  39. * Do SMP slave processor setup.
  40. */
  41. .macro smp_slave_setup
  42. #ifdef CONFIG_CPU_LOONGSON3
  43. .set push
  44. .set mips64
  45. /* Set LPA on LOONGSON3 config3 */
  46. mfc0 t0, $16, 3
  47. or t0, (0x1 << 7)
  48. mtc0 t0, $16, 3
  49. /* Set ELPA on LOONGSON3 pagegrain */
  50. mfc0 t0, $5, 1
  51. or t0, (0x1 << 29)
  52. mtc0 t0, $5, 1
  53. #ifdef CONFIG_LOONGSON3_ENHANCEMENT
  54. /* Enable STFill Buffer */
  55. mfc0 t0, $16, 6
  56. or t0, 0x100
  57. mtc0 t0, $16, 6
  58. #endif
  59. _ehb
  60. .set pop
  61. #endif
  62. .endm
  63. #endif /* __ASM_MACH_LOONGSON64_KERNEL_ENTRY_H */