omap-smc.S 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * OMAP44xx secure APIs file.
  3. *
  4. * Copyright (C) 2010 Texas Instruments, Inc.
  5. * Written by Santosh Shilimkar <santosh.shilimkar@ti.com>
  6. *
  7. *
  8. * This program is free software,you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #include <linux/linkage.h>
  13. /*
  14. * This is common routine to manage secure monitor API
  15. * used to modify the PL310 secure registers.
  16. * 'r0' contains the value to be modified and 'r12' contains
  17. * the monitor API number. It uses few CPU registers
  18. * internally and hence they need be backed up including
  19. * link register "lr".
  20. * Function signature : void omap_smc1(u32 fn, u32 arg)
  21. */
  22. ENTRY(omap_smc1)
  23. stmfd sp!, {r2-r12, lr}
  24. mov r12, r0
  25. mov r0, r1
  26. dsb
  27. smc #0
  28. ldmfd sp!, {r2-r12, pc}
  29. ENDPROC(omap_smc1)
  30. /**
  31. * u32 omap_smc2(u32 id, u32 falg, u32 pargs)
  32. * Low level common routine for secure HAL and PPA APIs.
  33. * @id: Application ID of HAL APIs
  34. * @flag: Flag to indicate the criticality of operation
  35. * @pargs: Physical address of parameter list starting
  36. * with number of parametrs
  37. */
  38. ENTRY(omap_smc2)
  39. stmfd sp!, {r4-r12, lr}
  40. mov r3, r2
  41. mov r2, r1
  42. mov r1, #0x0 @ Process ID
  43. mov r6, #0xff
  44. mov r12, #0x00 @ Secure Service ID
  45. mov r7, #0
  46. mcr p15, 0, r7, c7, c5, 6
  47. dsb
  48. dmb
  49. smc #0
  50. ldmfd sp!, {r4-r12, pc}
  51. ENDPROC(omap_smc2)
  52. ENTRY(omap_modify_auxcoreboot0)
  53. stmfd sp!, {r1-r12, lr}
  54. ldr r12, =0x104
  55. dsb
  56. smc #0
  57. ldmfd sp!, {r1-r12, pc}
  58. ENDPROC(omap_modify_auxcoreboot0)
  59. ENTRY(omap_auxcoreboot_addr)
  60. stmfd sp!, {r2-r12, lr}
  61. ldr r12, =0x105
  62. dsb
  63. smc #0
  64. ldmfd sp!, {r2-r12, pc}
  65. ENDPROC(omap_auxcoreboot_addr)
  66. ENTRY(omap_read_auxcoreboot0)
  67. stmfd sp!, {r2-r12, lr}
  68. ldr r12, =0x103
  69. dsb
  70. smc #0
  71. mov r0, r0, lsr #9
  72. ldmfd sp!, {r2-r12, pc}
  73. ENDPROC(omap_read_auxcoreboot0)