2 * See file CREDITS for list of people who contributed to this
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.
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.
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,
22 * lh7a400 SoC interface
30 /* Interrupt Controller (userguide 8.2.1) */
39 } /*__attribute__((__packed__))*/ lh7a400_interrupt_t;
40 #define LH7A400_INTERRUPT_BASE (0x80000500)
41 #define LH7A400_INTERRUPT_PTR(name) lh7a400_interrupt_t* name = (lh7a400_interrupt_t*) LH7A400_INTERRUPT_BASE
43 /* (DMA) Direct Memory Access Controller (userguide 9.2.1) */
53 volatile u32 interrupt;
60 lh7a400_dmabuf_t buf[2];
61 } /*__attribute__((__packed__))*/ lh7a400_dmachan_t;
64 lh7a400_dmachan_t chan[15];
69 } /*__attribute__((__packed__))*/ lh7a400_dma_t;
70 #define LH7A400_DMA_BASE (0x80002800)
71 #define DMA_USBTX_OFFSET (0x000)
72 #define DMA_USBRX_OFFSET (0x040)
73 #define DMA_MMCTX_OFFSET (0x080)
74 #define DMA_MMCRX_OFFSET (0x0C0)
75 #define DMA_AC97_BASE (0x80002A00)
77 #define LH7A400_DMA_PTR(name) lh7a400_dma_t* name = (lh7a400_dma_t*) LH7A400_DMA_BASE
78 #define LH7A400_DMA_USBTX(name) \
79 lh7a400_dmachan_t* name = (lh7a400_dmachan_t*) (LH7A400_DMA_BASE + DMA_USBTX_OFFSET)
80 #define LH7A400_DMA_USBRX(name) \
81 lh7a400_dmachan_t* name = (lh7a400_dmachan_t*) (LH7A400_DMA_BASE + DMA_USBRX_OFFSET)
82 #define LH7A400_DMA_MMCTX(name) \
83 lh7a400_dmachan_t* name = (lh7a400_dmachan_t*) (LH7A400_DMA_BASE + DMA_MMCTX_OFFSET)
84 #define LH7A400_DMA_MMCRX(name) \
85 lh7a400_dmachan_t* name = (lh7a400_dmachan_t*) (LH7A400_DMA_BASE + DMA_MMCRX_OFFSET)
86 #define LH7A400_AC97RX(name,n) \
87 lh7a400_dmachan_t* name = (lh7a400_dmachan_t*) (LH7A400_AC97_BASE + \
88 ((2*n) * sizeof(lh7a400_dmachan_t)))
89 #define LH7A400_AC97TX(name,n) \
90 lh7a400_dmachan_t* name = (lh7a400_dmachan_t*) (LH7A400_AC97_BASE + \
91 (((2*n)+1) * sizeof(lh7a400_dmachan_t)))
93 #endif /* __LH7A400_H__ */