arm1176_vfp_fast_gcc.s 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. @*******************************************************************************
  2. @*******************************************************************************
  3. @**
  4. @** ARM1176 Startup, VFP initialization for fast mode
  5. @**
  6. @** This module initializes the VFP co-processor unit in fast mode
  7. @**
  8. @** Version: $Id: arm1176_vfp_fast.s 5280 2011-02-21 16:39:28Z wlaris $
  9. @**
  10. @** (C) Copyright 2006-2010 by Fujitsu Microelectronics Europe GmbH;**
  11. @** (C) Copyright 2010-2011 by Fujitsu Semiconductor Europe GmbH
  12. @*******************************************************************************
  13. @*******************************************************************************
  14. #if ARM1176_USE_VFP == 1
  15. .text
  16. .section ".ARM1176INIT"
  17. .code 32
  18. @*******************************************************************************
  19. @** Bit pattern to enable RunFast mode
  20. @** - FPSCR [24] - Flush to Zero mode
  21. @** - FPSCR [25] - Default NaN mode
  22. @*******************************************************************************
  23. .equ ARM1176_VFP_ENABLE, 0x40000000 @
  24. .equ ARM1176_VFP_FASTMODE, 0x03000000 @ 2_11:SHL:24
  25. @*******************************************************************************
  26. @** enable the fast-mode of the VFP block
  27. @*******************************************************************************
  28. .global ARM1176_VfpSetFastmode
  29. ARM1176_VfpSetFastmode:
  30. mov r0,#ARM1176_VFP_FASTMODE
  31. fmxr fpscr,r0
  32. bx lr
  33. @*******************************************************************************
  34. @** enable the the VFP block
  35. @*******************************************************************************
  36. .global ARM1176_VfpInitialise
  37. ARM1176_VfpInitialise:
  38. mrc p15,0,r1,c1,c0,2 @ r1 = Access Control Register
  39. orr r1,r1,#(0xf<<20) @ enable full access for p10,11
  40. mcr p15,0,r1,c1,c0,2 @ Access Control Register = r1
  41. mov r1,#0 @
  42. mcr p15,0,r1,c7,c5,4 @ flush prefetch buffer because of FMXR below and
  43. @ CP 10 & 11 were only just enabled
  44. @ Enable VFP itself
  45. mov r0,#ARM1176_VFP_ENABLE
  46. fmxr fpexc,r0
  47. bx lr
  48. @*******************************************************************************
  49. @** End of file
  50. @*******************************************************************************
  51. .end
  52. #endif