kernel-entry-init.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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_LOONGSON_KERNEL_ENTRY_H
  12. #define __ASM_MACH_LOONGSON_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. li t0, (0x1 << 29)
  26. mtc0 t0, $5, 1
  27. _ehb
  28. .set pop
  29. #endif
  30. .endm
  31. /*
  32. * Do SMP slave processor setup.
  33. */
  34. .macro smp_slave_setup
  35. #ifdef CONFIG_CPU_LOONGSON3
  36. .set push
  37. .set mips64
  38. /* Set LPA on LOONGSON3 config3 */
  39. mfc0 t0, $16, 3
  40. or t0, (0x1 << 7)
  41. mtc0 t0, $16, 3
  42. /* Set ELPA on LOONGSON3 pagegrain */
  43. li t0, (0x1 << 29)
  44. mtc0 t0, $5, 1
  45. _ehb
  46. .set pop
  47. #endif
  48. .endm
  49. #endif /* __ASM_MACH_LOONGSON_KERNEL_ENTRY_H */