lh7a400.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * See file CREDITS for list of people who contributed to this
  3. * project.
  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 as
  7. * published by the Free Software Foundation; either version 2 of
  8. * the License, or (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  18. * MA 02111-1307 USA
  19. */
  20. /*
  21. * lh7a400 SoC interface
  22. */
  23. #ifndef __LH7A400_H__
  24. #define __LH7A400_H__
  25. #include "lh7a40x.h"
  26. /* Interrupt Controller (userguide 8.2.1) */
  27. typedef struct {
  28. volatile u32 intsr;
  29. volatile u32 intrsr;
  30. volatile u32 intens;
  31. volatile u32 intenc;
  32. volatile u32 rsvd1;
  33. volatile u32 rsvd2;
  34. volatile u32 rsvd3;
  35. } /*__attribute__((__packed__))*/ lh7a400_interrupt_t;
  36. #define LH7A400_INTERRUPT_BASE (0x80000500)
  37. #define LH7A400_INTERRUPT_PTR ((lh7a400_interrupt_t*) LH7A400_INTERRUPT_BASE)
  38. /* (DMA) Direct Memory Access Controller (userguide 9.2.1) */
  39. typedef struct {
  40. lh7a40x_dmachan_t chan[15];
  41. volatile u32 glblint;
  42. volatile u32 rsvd1;
  43. volatile u32 rsvd2;
  44. volatile u32 rsvd3;
  45. } /*__attribute__((__packed__))*/ lh7a400_dma_t;
  46. #define LH7A400_DMA_BASE (0x80002800)
  47. #define DMA_USBTX_OFFSET (0x000)
  48. #define DMA_USBRX_OFFSET (0x040)
  49. #define DMA_MMCTX_OFFSET (0x080)
  50. #define DMA_MMCRX_OFFSET (0x0C0)
  51. #define DMA_AC97_BASE (0x80002A00)
  52. #define LH7A400_DMA_PTR ((lh7a400_dma_t*) LH7A400_DMA_BASE)
  53. #define LH7A400_DMA_USBTX \
  54. ((lh7a400_dmachan_t*) (LH7A400_DMA_BASE + DMA_USBTX_OFFSET))
  55. #define LH7A400_DMA_USBRX \
  56. ((lh7a400_dmachan_t*) (LH7A400_DMA_BASE + DMA_USBRX_OFFSET))
  57. #define LH7A400_DMA_MMCTX \
  58. ((lh7a400_dmachan_t*) (LH7A400_DMA_BASE + DMA_MMCTX_OFFSET))
  59. #define LH7A400_DMA_MMCRX \
  60. ((lh7a400_dmachan_t*) (LH7A400_DMA_BASE + DMA_MMCRX_OFFSET))
  61. #define LH7A400_AC97RX(n) \
  62. ((lh7a400_dmachan_t*) (LH7A400_AC97_BASE + \
  63. ((2*n) * sizeof(lh7a400_dmachan_t))))
  64. #define LH7A400_AC97TX(n) \
  65. ((lh7a400_dmachan_t*) (LH7A400_AC97_BASE + \
  66. (((2*n)+1) * sizeof(lh7a400_dmachan_t))))
  67. #endif /* __LH7A400_H__ */