ark_musb.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef __MUSB_ARK_H__
  2. #define __MUSB_ARK_H__
  3. #include <usb.h>
  4. #include "musb_core.h"
  5. /* Base address of Sys registers */
  6. #define MUSB_ARK_SYS_BASE 0xe4900000
  7. /* Base address of Gpio registers */
  8. #define MUSB_ARK_GPIO_BASE 0xe4600000
  9. /* Base address of MUSB registers */
  10. #define MUSB_ARK_USB_BASE 0xe0100000
  11. /* Base address of MUSB1 registers */
  12. #define MUSB_ARK_USB1_BASE 0xe0400000
  13. /* Base address of MUSB DMA registers */
  14. #define MUSB_ARK_USB_DMA_BASE (MUSB_ARK_USB_BASE + 0x200)
  15. /* No Dynamic FIFO */
  16. //#define MUSB_NO_DYNAMIC_FIFO
  17. /* Bit masks for USB_DMA_INTERRUPT */
  18. #define DMA0_INT 0x1 /* DMA0 pending interrupt */
  19. #define DMA1_INT 0x2 /* DMA1 pending interrupt */
  20. /* Bit masks for USB_DMAxCONTROL */
  21. #define DMA_ENA 0x1 /* DMA enable */
  22. #define DIRECTION 0x2 /* direction of DMA transfer */
  23. #define MODE 0x4 /* DMA Bus error */
  24. #define INT_ENA 0x8 /* Interrupt enable */
  25. #define EPNUM 0xf0 /* EP number */
  26. #define BUSERROR 0x100 /* DMA Bus error */
  27. struct ark1680_musb_dma_regs {
  28. u8 interrupt;
  29. u8 reserved0[3];
  30. u16 control;
  31. u16 reserved1;
  32. u32 addr;
  33. u32 count;
  34. } __attribute__((packed, aligned(USB_DMA_MINALIGN)));
  35. int musb_platform_init(void);
  36. #endif