head.S 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * linux/arch/sh/boot/romimage/head.S
  3. *
  4. * Board specific setup code, executed before zImage loader
  5. */
  6. .text
  7. #include <asm/page.h>
  8. .global romstart
  9. romstart:
  10. /* include board specific setup code */
  11. #include <mach/romimage.h>
  12. #ifdef CONFIG_ROMIMAGE_MMCIF
  13. /* load the romImage to above the empty zero page */
  14. mov.l empty_zero_page_dst, r4
  15. mov.l empty_zero_page_dst_adj, r5
  16. add r5, r4
  17. mov.l bytes_to_load, r5
  18. mov.l loader_function, r7
  19. jsr @r7
  20. mov r4, r15
  21. mov.l empty_zero_page_dst, r4
  22. mov.l empty_zero_page_dst_adj, r5
  23. add r5, r4
  24. mov.l loaded_code_offs, r5
  25. add r5, r4
  26. jmp @r4
  27. nop
  28. .balign 4
  29. empty_zero_page_dst_adj:
  30. .long PAGE_SIZE
  31. bytes_to_load:
  32. .long end_data - romstart
  33. loader_function:
  34. .long mmcif_loader
  35. loaded_code_offs:
  36. .long loaded_code - romstart
  37. loaded_code:
  38. #endif /* CONFIG_ROMIMAGE_MMCIF */
  39. /* copy the empty_zero_page contents to where vmlinux expects it */
  40. mova extra_data_pos, r0
  41. mov.l extra_data_size, r1
  42. add r1, r0
  43. mov.l empty_zero_page_dst, r1
  44. mov #(PAGE_SHIFT - 4), r4
  45. mov #1, r3
  46. shld r4, r3 /* r3 = PAGE_SIZE / 16 */
  47. 1:
  48. mov.l @r0, r4
  49. mov.l @(4, r0), r5
  50. mov.l @(8, r0), r6
  51. mov.l @(12, r0), r7
  52. add #16,r0
  53. mov.l r4, @r1
  54. mov.l r5, @(4, r1)
  55. mov.l r6, @(8, r1)
  56. mov.l r7, @(12, r1)
  57. dt r3
  58. add #16,r1
  59. bf 1b
  60. /* jump to the zImage entry point located after the zero page data */
  61. mov #PAGE_SHIFT, r4
  62. mov #1, r1
  63. shld r4, r1
  64. mova extra_data_pos, r0
  65. add r1, r0
  66. mov.l extra_data_size, r1
  67. add r1, r0
  68. jmp @r0
  69. nop
  70. .align 2
  71. empty_zero_page_dst:
  72. .long _text
  73. extra_data_pos:
  74. extra_data_size:
  75. .long zero_page_pos - extra_data_pos