README 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. CONTENT:
  2. dma.h
  3. dma1.c
  4. dma2.s
  5. WHAT ARE THESE FILES:
  6. These files contain MPC8240 (Kahlua) DMA controller
  7. driver routines. The driver routines are not
  8. written for any specific operating system.
  9. They serves the purpose of code sample, and
  10. jump-start for using the MPC8240 DMA controller.
  11. For the reason of correctness of C language
  12. syntax, these files are compiled by Metaware
  13. C compiler and assembler.
  14. ENDIAN NOTATION:
  15. The algorithm is designed for big-endian mode,
  16. software is responsible for byte swapping.
  17. USAGE:
  18. 1. The host system that is running on MPC8240
  19. or using MPC8240 as I/O device shall link
  20. the files listed here. The memory location
  21. of driver routines shall take into account of
  22. that driver routines need to run in supervisor
  23. mode and they process DMA controller interrupt.
  24. 2. The host system is responsible for configuring
  25. the MPC8240 including Embedded Utilities Memory
  26. Block. Since the DMA controller on MPC8240 can
  27. be accessed by either local 603e core or the host
  28. that MPC8240 serves as I/O processor through host
  29. PCI configuration, it is important that the local
  30. processor uses EUMBBAR to access its local DMA
  31. controller while the PCI master uses I/O
  32. processor's PCSRBAR to access the DMA controller
  33. on I/O device.
  34. To qualify whether is EUMBBAR or PCSRBAR, one
  35. additional parameter is requied from the host
  36. system, LOCAL or REMOTE so that the base value
  37. can be correctly interpreted.
  38. 3. If the host system is also using the EPIC unit
  39. on MPC8240, the system can register the
  40. DMA_ISR with the EPIC including other
  41. desired resources.
  42. If the host system does not using the EPIC unit
  43. on MPC8240, DMA_ISR function can be called for
  44. each desired time interval.
  45. In both cases, the host system is free to
  46. provide its own interrupt service routine.
  47. 4. To start a direct mode DMA transaction,
  48. use DMA_Bld_Curr with the start parameter
  49. set to 1.
  50. To start a chaining mode DMA transaction,
  51. the application shall build descriptors
  52. in memory first, next, use DMA_Bld_Desp
  53. with the start parameter set to 1.
  54. 5. DMA_Start function clears, then sets the CS
  55. bit of DMA mode register.
  56. DMA_Halt function clears the CS bit of DMA
  57. mode register.
  58. These functions can be used to start and
  59. halt the DMA transaction.
  60. If the chaining descriptors has been
  61. modified since the last time a DMA
  62. transaction started, use DMA_Chn_Cnt
  63. function to let DMA controller process
  64. the modified descriptor chain without
  65. stopping or disturbing the current DMA
  66. transaction.
  67. It is the host system's responsibility of
  68. setting up the correct DMA transfer mode
  69. and pass the correct memory address parameters.
  70. 6. It is the host system's responsibility of
  71. queueing the DMA I/O request. The host
  72. system can call the DMA_ISR with its own
  73. desired interrupt service subroutines to
  74. handle each individual interrupt and queued
  75. DMA I/O requests.
  76. 7. The DMA driver routines contains a set
  77. of utilities, Set and Get, for host system
  78. to query and modify the desired DMA registers.