i2c2.S 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /**************************************
  2. *
  3. * copyright @ Motorola, 1999
  4. *
  5. **************************************/
  6. #include <config.h>
  7. #ifdef CONFIG_HARD_I2C
  8. #include <ppc_asm.tmpl>
  9. #include <asm/mmu.h>
  10. /**********************************************************
  11. * function: load_runtime_reg
  12. *
  13. * input: r3 - value of eumbbar
  14. * r4 - register offset in embedded utility space
  15. *
  16. * output: r3 - register content
  17. **********************************************************/
  18. .text
  19. .align 2
  20. .global load_runtime_reg
  21. load_runtime_reg:
  22. /* xor r5,r5,r5
  23. * or r5,r5,r3
  24. *
  25. * lwbrx r3,r4,r5
  26. */
  27. lwbrx r3,r4,r3
  28. sync
  29. bclr 20, 0
  30. /****************************************************************
  31. * function: store_runtime_reg
  32. *
  33. * input: r3 - value of eumbbar
  34. * r4 - register offset in embedded utility space
  35. * r5 - new value to be stored
  36. *
  37. ****************************************************************/
  38. .text
  39. .align 2
  40. .global store_runtime_reg
  41. store_runtime_reg:
  42. stwbrx r5, r4, r3
  43. sync
  44. bclr 20,0
  45. #endif /* CONFIG_HARD_I2C */