head.S 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. ; SPDX-License-Identifier: GPL-2.0-only
  2. ;
  3. ; Port on Texas Instruments TMS320C6x architecture
  4. ;
  5. ; Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
  6. ; Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
  7. ;
  8. #include <linux/linkage.h>
  9. #include <linux/of_fdt.h>
  10. #include <asm/asm-offsets.h>
  11. __HEAD
  12. ENTRY(_c_int00)
  13. ;; Save magic and pointer
  14. MV .S1 A4,A10
  15. MV .S2 B4,B10
  16. MVKL .S2 __bss_start,B5
  17. MVKH .S2 __bss_start,B5
  18. MVKL .S2 __bss_stop,B6
  19. MVKH .S2 __bss_stop,B6
  20. SUB .L2 B6,B5,B6 ; bss size
  21. ;; Set the stack pointer
  22. MVKL .S2 current_ksp,B0
  23. MVKH .S2 current_ksp,B0
  24. LDW .D2T2 *B0,B15
  25. ;; clear bss
  26. SHR .S2 B6,3,B0 ; number of dwords to clear
  27. ZERO .L2 B13
  28. ZERO .L2 B12
  29. bss_loop:
  30. BDEC .S2 bss_loop,B0
  31. NOP 3
  32. CMPLT .L2 B0,0,B1
  33. [!B1] STDW .D2T2 B13:B12,*B5++[1]
  34. NOP 4
  35. AND .D2 ~7,B15,B15
  36. ;; Clear GIE and PGIE
  37. MVC .S2 CSR,B2
  38. CLR .S2 B2,0,1,B2
  39. MVC .S2 B2,CSR
  40. MVC .S2 TSR,B2
  41. CLR .S2 B2,0,1,B2
  42. MVC .S2 B2,TSR
  43. MVC .S2 ITSR,B2
  44. CLR .S2 B2,0,1,B2
  45. MVC .S2 B2,ITSR
  46. MVC .S2 NTSR,B2
  47. CLR .S2 B2,0,1,B2
  48. MVC .S2 B2,NTSR
  49. ;; pass DTB pointer to machine_init (or zero if none)
  50. MVKL .S1 OF_DT_HEADER,A0
  51. MVKH .S1 OF_DT_HEADER,A0
  52. CMPEQ .L1 A10,A0,A0
  53. [A0] MV .S1X B10,A4
  54. [!A0] MVK .S1 0,A4
  55. #ifdef CONFIG_C6X_BIG_KERNEL
  56. MVKL .S1 machine_init,A0
  57. MVKH .S1 machine_init,A0
  58. B .S2X A0
  59. ADDKPC .S2 0f,B3,4
  60. 0:
  61. #else
  62. CALLP .S2 machine_init,B3
  63. #endif
  64. ;; Jump to Linux init
  65. #ifdef CONFIG_C6X_BIG_KERNEL
  66. MVKL .S1 start_kernel,A0
  67. MVKH .S1 start_kernel,A0
  68. B .S2X A0
  69. #else
  70. B .S2 start_kernel
  71. #endif
  72. NOP 5
  73. L1: BNOP .S2 L1,5