0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef __ASMARM_HARDWARE_IOMD_H
0011 #define __ASMARM_HARDWARE_IOMD_H
0012
0013
0014 #ifndef __ASSEMBLY__
0015
0016
0017
0018
0019
0020 #define iomd_readb(off) __raw_readb(IOMD_BASE + (off))
0021 #define iomd_readl(off) __raw_readl(IOMD_BASE + (off))
0022 #define iomd_writeb(val,off) __raw_writeb(val, IOMD_BASE + (off))
0023 #define iomd_writel(val,off) __raw_writel(val, IOMD_BASE + (off))
0024
0025 #endif
0026
0027 #define IOMD_CONTROL (0x000)
0028 #define IOMD_KARTTX (0x004)
0029 #define IOMD_KARTRX (0x004)
0030 #define IOMD_KCTRL (0x008)
0031
0032 #define IOMD_IRQSTATA (0x010)
0033 #define IOMD_IRQREQA (0x014)
0034 #define IOMD_IRQCLRA (0x014)
0035 #define IOMD_IRQMASKA (0x018)
0036
0037 #define IOMD_IRQSTATB (0x020)
0038 #define IOMD_IRQREQB (0x024)
0039 #define IOMD_IRQMASKB (0x028)
0040
0041 #define IOMD_FIQSTAT (0x030)
0042 #define IOMD_FIQREQ (0x034)
0043 #define IOMD_FIQMASK (0x038)
0044
0045 #define IOMD_T0CNTL (0x040)
0046 #define IOMD_T0LTCHL (0x040)
0047 #define IOMD_T0CNTH (0x044)
0048 #define IOMD_T0LTCHH (0x044)
0049 #define IOMD_T0GO (0x048)
0050 #define IOMD_T0LATCH (0x04c)
0051
0052 #define IOMD_T1CNTL (0x050)
0053 #define IOMD_T1LTCHL (0x050)
0054 #define IOMD_T1CNTH (0x054)
0055 #define IOMD_T1LTCHH (0x054)
0056 #define IOMD_T1GO (0x058)
0057 #define IOMD_T1LATCH (0x05c)
0058
0059 #define IOMD_ROMCR0 (0x080)
0060 #define IOMD_ROMCR1 (0x084)
0061 #ifdef CONFIG_ARCH_RPC
0062 #define IOMD_DRAMCR (0x088)
0063 #endif
0064 #define IOMD_REFCR (0x08C)
0065
0066 #define IOMD_FSIZE (0x090)
0067 #define IOMD_ID0 (0x094)
0068 #define IOMD_ID1 (0x098)
0069 #define IOMD_VERSION (0x09C)
0070
0071 #ifdef CONFIG_ARCH_RPC
0072 #define IOMD_MOUSEX (0x0A0)
0073 #define IOMD_MOUSEY (0x0A4)
0074 #endif
0075
0076 #ifdef CONFIG_ARCH_RPC
0077 #define IOMD_DMATCR (0x0C0)
0078 #endif
0079 #define IOMD_IOTCR (0x0C4)
0080 #define IOMD_ECTCR (0x0C8)
0081 #ifdef CONFIG_ARCH_RPC
0082 #define IOMD_DMAEXT (0x0CC)
0083 #endif
0084
0085 #ifdef CONFIG_ARCH_RPC
0086 #define DMA_EXT_IO0 1
0087 #define DMA_EXT_IO1 2
0088 #define DMA_EXT_IO2 4
0089 #define DMA_EXT_IO3 8
0090
0091 #define IOMD_IO0CURA (0x100)
0092 #define IOMD_IO0ENDA (0x104)
0093 #define IOMD_IO0CURB (0x108)
0094 #define IOMD_IO0ENDB (0x10C)
0095 #define IOMD_IO0CR (0x110)
0096 #define IOMD_IO0ST (0x114)
0097
0098 #define IOMD_IO1CURA (0x120)
0099 #define IOMD_IO1ENDA (0x124)
0100 #define IOMD_IO1CURB (0x128)
0101 #define IOMD_IO1ENDB (0x12C)
0102 #define IOMD_IO1CR (0x130)
0103 #define IOMD_IO1ST (0x134)
0104
0105 #define IOMD_IO2CURA (0x140)
0106 #define IOMD_IO2ENDA (0x144)
0107 #define IOMD_IO2CURB (0x148)
0108 #define IOMD_IO2ENDB (0x14C)
0109 #define IOMD_IO2CR (0x150)
0110 #define IOMD_IO2ST (0x154)
0111
0112 #define IOMD_IO3CURA (0x160)
0113 #define IOMD_IO3ENDA (0x164)
0114 #define IOMD_IO3CURB (0x168)
0115 #define IOMD_IO3ENDB (0x16C)
0116 #define IOMD_IO3CR (0x170)
0117 #define IOMD_IO3ST (0x174)
0118 #endif
0119
0120 #define IOMD_SD0CURA (0x180)
0121 #define IOMD_SD0ENDA (0x184)
0122 #define IOMD_SD0CURB (0x188)
0123 #define IOMD_SD0ENDB (0x18C)
0124 #define IOMD_SD0CR (0x190)
0125 #define IOMD_SD0ST (0x194)
0126
0127 #ifdef CONFIG_ARCH_RPC
0128 #define IOMD_SD1CURA (0x1A0)
0129 #define IOMD_SD1ENDA (0x1A4)
0130 #define IOMD_SD1CURB (0x1A8)
0131 #define IOMD_SD1ENDB (0x1AC)
0132 #define IOMD_SD1CR (0x1B0)
0133 #define IOMD_SD1ST (0x1B4)
0134 #endif
0135
0136 #define IOMD_CURSCUR (0x1C0)
0137 #define IOMD_CURSINIT (0x1C4)
0138
0139 #define IOMD_VIDCUR (0x1D0)
0140 #define IOMD_VIDEND (0x1D4)
0141 #define IOMD_VIDSTART (0x1D8)
0142 #define IOMD_VIDINIT (0x1DC)
0143 #define IOMD_VIDCR (0x1E0)
0144
0145 #define IOMD_DMASTAT (0x1F0)
0146 #define IOMD_DMAREQ (0x1F4)
0147 #define IOMD_DMAMASK (0x1F8)
0148
0149 #define DMA_END_S (1 << 31)
0150 #define DMA_END_L (1 << 30)
0151
0152 #define DMA_CR_C 0x80
0153 #define DMA_CR_D 0x40
0154 #define DMA_CR_E 0x20
0155
0156 #define DMA_ST_OFL 4
0157 #define DMA_ST_INT 2
0158 #define DMA_ST_AB 1
0159
0160
0161
0162
0163 #define HALF_SAM vram_half_sam
0164 #define VDMA_ALIGNMENT (HALF_SAM * 2)
0165 #define VDMA_XFERSIZE (HALF_SAM)
0166 #define VDMA_INIT IOMD_VIDINIT
0167 #define VDMA_START IOMD_VIDSTART
0168 #define VDMA_END IOMD_VIDEND
0169
0170 #ifndef __ASSEMBLY__
0171 extern unsigned int vram_half_sam;
0172 #define video_set_dma(start,end,offset) \
0173 do { \
0174 outl (SCREEN_START + start, VDMA_START); \
0175 outl (SCREEN_START + end - VDMA_XFERSIZE, VDMA_END); \
0176 if (offset >= end - VDMA_XFERSIZE) \
0177 offset |= 0x40000000; \
0178 outl (SCREEN_START + offset, VDMA_INIT); \
0179 } while (0)
0180 #endif
0181
0182 #endif