dma.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * (C) Copyright 2003
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. *
  5. * This file is based on code
  6. * (C) Copyright Motorola, Inc., 2000
  7. *
  8. * MPC8220 dma header file
  9. */
  10. #ifndef __MPC8220_DMA_H
  11. #define __MPC8220_DMA_H
  12. #include <common.h>
  13. #include <mpc8220.h>
  14. /* Task number assignment */
  15. #define FEC_RECV_TASK_NO 0
  16. #define FEC_XMIT_TASK_NO 1
  17. /*---------------------------------------------------------------------
  18. * Stuff for Ethernet Tx/Rx tasks
  19. *---------------------------------------------------------------------
  20. */
  21. /* Layout of Ethernet controller Parameter SRAM area:
  22. * ----------------------------------------------------------------
  23. * 0x00: TBD_BASE, base address of TX BD ring
  24. * 0x04: TBD_NEXT, address of next TX BD to be processed
  25. * 0x08: RBD_BASE, base address of RX BD ring
  26. * 0x0C: RBD_NEXT, address of next RX BD to be processed
  27. * ---------------------------------------------------------------
  28. * ALL PARAMETERS ARE ALL LONGWORDS (FOUR BYTES EACH).
  29. */
  30. /* base address of SRAM area to store parameters used by Ethernet tasks */
  31. #define FEC_PARAM_BASE (MMAP_SRAM + 0x5b00)
  32. /* base address of SRAM area for buffer descriptors */
  33. #define FEC_BD_BASE (MMAP_SRAM + 0x5b20)
  34. /*---------------------------------------------------------------------
  35. * common shortcuts used by driver C code
  36. *---------------------------------------------------------------------
  37. */
  38. /* Disable SmartDMA task */
  39. #define DMA_TASK_DISABLE(tasknum) \
  40. { \
  41. volatile ushort *tcr = (ushort *)(MMAP_DMA + 0x0000001c + 2 * tasknum); \
  42. *tcr = (*tcr) & (~0x8000); \
  43. }
  44. /* Enable SmartDMA task */
  45. #define DMA_TASK_ENABLE(tasknum) \
  46. { \
  47. volatile ushort *tcr = (ushort *) (MMAP_DMA + 0x0000001c + 2 * tasknum);\
  48. *tcr = (*tcr) | 0x8000; \
  49. }
  50. /* Clear interrupt pending bits */
  51. #define DMA_CLEAR_IEVENT(tasknum) \
  52. { \
  53. struct mpc8220_dma *dma = (struct mpc8220_dma *)MMAP_DMA; \
  54. dma->IntPend = (1 << tasknum); \
  55. }
  56. #endif /* __MPC8220_DMA_H */