pio_phys.S 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2000-2005 Silicon Graphics, Inc. All rights reserved.
  7. *
  8. * This file contains macros used to access MMR registers via
  9. * uncached physical addresses.
  10. * pio_phys_read_mmr - read an MMR
  11. * pio_phys_write_mmr - write an MMR
  12. * pio_atomic_phys_write_mmrs - atomically write 1 or 2 MMRs with psr.ic=0
  13. * Second MMR will be skipped if address is NULL
  14. *
  15. * Addresses passed to these routines should be uncached physical addresses
  16. * ie., 0x80000....
  17. */
  18. #include <asm/asmmacro.h>
  19. #include <asm/page.h>
  20. GLOBAL_ENTRY(pio_phys_read_mmr)
  21. .prologue
  22. .regstk 1,0,0,0
  23. .body
  24. mov r2=psr
  25. rsm psr.i | psr.dt
  26. ;;
  27. srlz.d
  28. ld8.acq r8=[r32]
  29. ;;
  30. mov psr.l=r2;;
  31. srlz.d
  32. br.ret.sptk.many rp
  33. END(pio_phys_read_mmr)
  34. GLOBAL_ENTRY(pio_phys_write_mmr)
  35. .prologue
  36. .regstk 2,0,0,0
  37. .body
  38. mov r2=psr
  39. rsm psr.i | psr.dt
  40. ;;
  41. srlz.d
  42. st8.rel [r32]=r33
  43. ;;
  44. mov psr.l=r2;;
  45. srlz.d
  46. br.ret.sptk.many rp
  47. END(pio_phys_write_mmr)
  48. GLOBAL_ENTRY(pio_atomic_phys_write_mmrs)
  49. .prologue
  50. .regstk 4,0,0,0
  51. .body
  52. mov r2=psr
  53. cmp.ne p9,p0=r34,r0;
  54. rsm psr.i | psr.dt | psr.ic
  55. ;;
  56. srlz.d
  57. st8.rel [r32]=r33
  58. (p9) st8.rel [r34]=r35
  59. ;;
  60. mov psr.l=r2;;
  61. srlz.d
  62. br.ret.sptk.many rp
  63. END(pio_atomic_phys_write_mmrs)