misc_44x.S 1005 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * This file contains miscellaneous low-level functions for PPC 44x.
  3. * Copyright 2007 David Gibson <dwg@au1.ibm.com>, IBM Corporation.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation; either version
  8. * 2 of the License, or (at your option) any later version.
  9. *
  10. */
  11. #include <asm/reg.h>
  12. #include <asm/ppc_asm.h>
  13. .text
  14. /*
  15. * Do an IO access in AS1
  16. */
  17. _GLOBAL(as1_readb)
  18. mfmsr r7
  19. ori r0,r7,MSR_DS
  20. sync
  21. mtmsr r0
  22. sync
  23. isync
  24. lbz r3,0(r3)
  25. sync
  26. mtmsr r7
  27. sync
  28. isync
  29. blr
  30. _GLOBAL(as1_writeb)
  31. mfmsr r7
  32. ori r0,r7,MSR_DS
  33. sync
  34. mtmsr r0
  35. sync
  36. isync
  37. stb r3,0(r4)
  38. sync
  39. mtmsr r7
  40. sync
  41. isync
  42. blr
  43. /*
  44. * void ppc44x_reset_system(char *cmd)
  45. *
  46. * At present, this routine just applies a system reset.
  47. */
  48. _GLOBAL(ppc44x_reset_system)
  49. mfspr r13,SPRN_DBCR0
  50. oris r13,r13,DBCR0_RST_SYSTEM@h
  51. mtspr SPRN_DBCR0,r13
  52. b . /* Just in case the reset doesn't work */