head-sa1100.S
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:2k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /* 
  2.  * linux/arch/arm/boot/compressed/head-sa1100.S
  3.  * 
  4.  * Copyright (C) 1999 Nicolas Pitre <nico@cam.org>
  5.  * 
  6.  * SA1100 specific tweaks.  This is merged into head.S by the linker.
  7.  *
  8.  */
  9. #include <linux/config.h>
  10. #include <linux/linkage.h>
  11. #include <asm/mach-types.h>
  12. .section        ".start", #alloc, #execinstr
  13. __SA1100_start:
  14. @ Preserve r8/r7 i.e. kernel entry values
  15. #if defined(CONFIG_SA1100_GRAPHICSCLIENT) && !defined(CONFIG_ANGELBOOT)
  16. mov r7, #MACH_TYPE_GRAPHICSCLIENT
  17. mov r8, #0
  18. #endif
  19. #if defined(CONFIG_SA1100_GRAPHICSMASTER) && !defined(CONFIG_ANGELBOOT)
  20. mov r7, #MACH_TYPE_GRAPHICSMASTER
  21. mov r8, #0
  22. #endif
  23. #if defined(CONFIG_SA1100_ADSBITSY) && !defined(CONFIG_ANGELBOOT)
  24. mov r7, #MACH_TYPE_ADSBITSY
  25. mov r8, #0
  26. #endif
  27. #ifdef CONFIG_SA1100_PFS168
  28. @ REVISIT_PFS168: Temporary until firmware updated to use assigned machine number
  29. mov r7, #MACH_TYPE_PFS168
  30. #endif
  31. #ifdef CONFIG_SA1100_VICTOR
  32. teq r7, #MACH_TYPE_VICTOR
  33. bne 10f
  34. @ Copy cmdline to 0xc0000000
  35. mov r1, #0xc0000000
  36. cmp r0, #0
  37. moveq r2, #0
  38. 1: ldrneb r2, [r0], #1
  39. cmpne r2, #0
  40. strb r2, [r1], #1
  41. bne 1b
  42. 10:
  43. #endif
  44. @ Data cache might be active.
  45. @ Be sure to flush kernel binary out of the cache,
  46. @ whatever state it is, before it is turned off.
  47. @ This is done by fetching through currently executed
  48. @ memory to be sure we hit the same cache.
  49. bic r2, pc, #0x1f
  50. add r3, r2, #0x4000 @ 16 kb is quite enough...
  51. 1: ldr r0, [r2], #32
  52. teq r2, r3
  53. bne 1b
  54. mcr p15, 0, r0, c7, c10, 4 @ drain WB
  55. mcr p15, 0, r0, c7, c7, 0 @ flush I & D caches
  56. @ disabling MMU and caches
  57. mrc p15, 0, r0, c1, c0, 0 @ read control reg
  58. bic r0, r0, #0x0d @ clear WB, DC, MMU
  59. bic r0, r0, #0x1000 @ clear Icache
  60. mcr p15, 0, r0, c1, c0, 0
  61. /*
  62.  * Pause for a short time so that we give enough time
  63.  * for the host to start a terminal up.
  64.  */
  65. mov r0, #0x00200000
  66. 1: subs r0, r0, #1
  67. bne 1b