head.S 1.7 KB

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