Home | History | Annotate | Line # | Download | only in xscale
i80321reg.h revision 1.4
      1 /*	$NetBSD: i80321reg.h,v 1.4 2002/07/29 17:28:06 thorpej Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 2002 Wasabi Systems, Inc.
      5  * All rights reserved.
      6  *
      7  * Written by Jason R. Thorpe for Wasabi Systems, Inc.
      8  *
      9  * Redistribution and use in source and binary forms, with or without
     10  * modification, are permitted provided that the following conditions
     11  * are met:
     12  * 1. Redistributions of source code must retain the above copyright
     13  *    notice, this list of conditions and the following disclaimer.
     14  * 2. Redistributions in binary form must reproduce the above copyright
     15  *    notice, this list of conditions and the following disclaimer in the
     16  *    documentation and/or other materials provided with the distribution.
     17  * 3. All advertising materials mentioning features or use of this software
     18  *    must display the following acknowledgement:
     19  *	This product includes software developed for the NetBSD Project by
     20  *	Wasabi Systems, Inc.
     21  * 4. The name of Wasabi Systems, Inc. may not be used to endorse
     22  *    or promote products derived from this software without specific prior
     23  *    written permission.
     24  *
     25  * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
     26  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     27  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     28  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
     29  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     30  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     31  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     32  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     33  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     34  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     35  * POSSIBILITY OF SUCH DAMAGE.
     36  */
     37 
     38 #ifndef _ARM_XSCALE_I80321REG_H_
     39 #define _ARM_XSCALE_I80321REG_H_
     40 
     41 /*
     42  * Register definitions for the Intel 80321 (``Verde'') I/O processor,
     43  * based on the XScale core.
     44  */
     45 
     46 /*
     47  * Base i80321 memory map:
     48  *
     49  *	0x0000.0000 - 0x7fff.ffff	ATU Outbound Direct Addressing Window
     50  *	0x8000.0000 - 0x9001.ffff	ATU Outbound Translation Windows
     51  *	0x9002.0000 - 0xffff.dfff	External Memory
     52  *	0xffff.e000 - 0xffff.e8ff	Peripheral Memory Mapped Registers
     53  *	0xffff.e900 - 0xffff.ffff	Reserved
     54  */
     55 
     56 #define	VERDE_OUT_DIRECT_WIN_BASE	0x00000000UL
     57 #define	VERDE_OUT_DIRECT_WIN_SIZE	0x80000000UL
     58 
     59 #define	VERDE_OUT_XLATE_MEM_WIN_SIZE	0x04000000UL
     60 #define	VERDE_OUT_XLATE_IO_WIN_SIZE	0x00010000UL
     61 
     62 #define	VERDE_OUT_XLATE_MEM_WIN0_BASE	0x80000000UL
     63 #define	VERDE_OUT_XLATE_MEM_WIN1_BASE	0x84000000UL
     64 
     65 #define	VERDE_OUT_XLATE_IO_WIN0_BASE	0x90000000UL
     66 
     67 #define	VERDE_EXTMEM_BASE		0x90020000UL
     68 
     69 #define	VERDE_PMMR_BASE			0xffffe000UL
     70 #define	VERDE_PMMR_SIZE			0x00000900UL
     71 
     72 /*
     73  * Peripheral Memory Mapped Registers.  Defined as offsets
     74  * from the VERDE_PMMR_BASE.
     75  */
     76 #define	VERDE_ATU_BASE			0x0100
     77 #define	VERDE_ATU_SIZE			0x0100
     78 
     79 #define	VERDE_DMA_BASE			0x0400
     80 #define	VERDE_DMA_SIZE			0x0100
     81 
     82 #define	VERDE_MCU_BASE			0x0500
     83 #define	VERDE_MCU_SIZE			0x0100
     84 
     85 #define	VERDE_SSP_BASE			0x0600
     86 #define	VERDE_SSP_SIZE			0x0100
     87 
     88 #define	VERDE_AAU_BASE			0x0800
     89 #define	VERDE_AAU_SIZE			0x0100
     90 
     91 /*
     92  * Address Translation Unit
     93  */
     94 	/* 0x00 - 0x38 -- PCI configuration space header */
     95 #define	ATU_IALR0	0x40	/* Inbound ATU Limit 0 */
     96 #define	ATU_IATVR0	0x44	/* Inbound ATU Xlate Value 0 */
     97 #define	ATU_ERLR	0x48	/* Expansion ROM Limit */
     98 #define	ATU_ERTVR	0x4c	/* Expansion ROM Xlate Value */
     99 #define	ATU_IALR1	0x50	/* Inbound ATU Limit 1 */
    100 #define	ATU_IALR2	0x54	/* Inbound ATU Limit 2 */
    101 #define	ATU_IATVR2	0x58	/* Inbound ATU Xlate Value 2 */
    102 #define	ATU_OIOWTVR	0x5c	/* Outbound I/O Window Xlate Value */
    103 #define	ATU_OMWTVR0	0x60	/* Outbound Mem Window Xlate Value 0 */
    104 #define	ATU_OUMWTVR0	0x64	/* Outbound Mem Window Xlate Value 0 Upper */
    105 #define	ATU_OMWTVR1	0x68	/* Outbound Mem Window Xlate Value 1 */
    106 #define	ATU_OUMWTVR1	0x6c	/* Outbound Mem Window Xlate Value 1 Upper */
    107 #define	ATU_OUDWTVR	0x78	/* Outbound Mem Direct Xlate Value Upper */
    108 #define	ATU_ATUCR	0x80	/* ATU Configuration */
    109 #define	ATU_PCSR	0x84	/* PCI Configuration and Status */
    110 #define	ATU_ATUISR	0x88	/* ATU Interrupt Status */
    111 #define	ATU_ATUIMR	0x8c	/* ATU Interrupt Mask */
    112 #define	ATU_IABAR3	0x90	/* Inbound ATU Base Address 3 */
    113 #define	ATU_IAUBAR3	0x94	/* Inbound ATU Base Address 3 Upper */
    114 #define	ATU_IALR3	0x98	/* Inbound ATU Limit 3 */
    115 #define	ATU_IATVR3	0x9c	/* Inbound ATU Xlate Value 3 */
    116 #define	ATU_OCCAR	0xa4	/* Outbound Configuration Cycle Address */
    117 #define	ATU_OCCDR	0xac	/* Outbound Configuration Cycle Data */
    118 #define	ATU_MSI_PORT	0xb4	/* MSI port */
    119 #define	ATU_PDSCR	0xbc	/* PCI Bus Drive Strength Control */
    120 #define	ATU_PCI_X_CAP_ID 0xe0	/* (1) */
    121 #define	ATU_PCI_X_NEXT	0xe1	/* (1) */
    122 #define	ATU_PCIXCMD	0xe2	/* PCI-X Command Register (2) */
    123 #define	ATU_PCIXSR	0xe4	/* PCI-X Status Register */
    124 
    125 #define	ATUCR_DRC_ALIAS		(1U << 19)
    126 #define	ATUCR_DAU2GXEN		(1U << 18)
    127 #define	ATUCR_P_SERR_MA		(1U << 16)
    128 #define	ATUCR_DTS		(1U << 15)
    129 #define	ATUCR_P_SERR_DIE	(1U << 9)
    130 #define	ATUCR_DAE		(1U << 8)
    131 #define	ATUCR_BIST_IE		(1U << 3)
    132 #define	ATUCR_OUT_EN		(1U << 1)
    133 
    134 #define	PCSR_DAAAPE		(1U << 18)
    135 #define	PCSR_PCI_X_CAP		(3U << 16)
    136 #define	PCSR_PCI_X_CAP_BORING	(0 << 16)
    137 #define	PCSR_PCI_X_CAP_66	(1U << 16)
    138 #define	PCSR_PCI_X_CAP_100	(2U << 16)
    139 #define	PCSR_PCI_X_CAP_133	(3U << 16)
    140 #define	PCSR_OTQB		(1U << 15)
    141 #define	PCSR_IRTQB		(1U << 14)
    142 #define	PCSR_DTV		(1U << 12)
    143 #define	PCSR_BUS66		(1U << 10)
    144 #define	PCSR_BUS64		(1U << 8)
    145 #define	PCSR_RIB		(1U << 5)
    146 #define	PCSR_RPB		(1U << 4)
    147 #define	PCSR_CCR		(1U << 2)
    148 #define	PCSR_CPR		(1U << 1)
    149 
    150 #define	ATUISR_IMW1BU		(1U << 14)
    151 #define	ATUISR_ISCEM		(1U << 13)
    152 #define	ATUISR_RSCEM		(1U << 12)
    153 #define	ATUISR_PST		(1U << 11)
    154 #define	ATUISR_P_SERR_ASRT	(1U << 10)
    155 #define	ATUISR_DPE		(1U << 9)
    156 #define	ATUISR_BIST		(1U << 8)
    157 #define	ATUISR_IBMA		(1U << 7)
    158 #define	ATUISR_P_SERR_DET	(1U << 4)
    159 #define	ATUISR_PMA		(1U << 3)
    160 #define	ATUISR_PTAM		(1U << 2)
    161 #define	ATUISR_PTAT		(1U << 1)
    162 #define	ATUISR_PMPE		(1U << 0)
    163 
    164 #define	ATUIMR_IMW1BU		(1U << 11)
    165 #define	ATUIMR_ISCEM		(1U << 10)
    166 #define	ATUIMR_RSCEM		(1U << 9)
    167 #define	ATUIMR_PST		(1U << 8)
    168 #define	ATUIMR_DPE		(1U << 7)
    169 #define	ATUIMR_P_SERR_ASRT	(1U << 6)
    170 #define	ATUIMR_PMA		(1U << 5)
    171 #define	ATUIMR_PTAM		(1U << 4)
    172 #define	ATUIMR_PTAT		(1U << 3)
    173 #define	ATUIMR_PMPE		(1U << 2)
    174 #define	ATUIMR_IE_SERR_EN	(1U << 1)
    175 #define	ATUIMR_ECC_TAE		(1U << 0)
    176 
    177 #define	PCIXCMD_MOST_1		(0 << 4)
    178 #define	PCIXCMD_MOST_2		(1 << 4)
    179 #define	PCIXCMD_MOST_3		(2 << 4)
    180 #define	PCIXCMD_MOST_4		(3 << 4)
    181 #define	PCIXCMD_MOST_8		(4 << 4)
    182 #define	PCIXCMD_MOST_12		(5 << 4)
    183 #define	PCIXCMD_MOST_16		(6 << 4)
    184 #define	PCIXCMD_MOST_32		(7 << 4)
    185 #define	PCIXCMD_MOST_MASK	(7 << 4)
    186 #define	PCIXCMD_MMRBC_512	(0 << 2)
    187 #define	PCIXCMD_MMRBC_1024	(1 << 2)
    188 #define	PCIXCMD_MMRBC_2048	(2 << 2)
    189 #define	PCIXCMD_MMRBC_4096	(3 << 2)
    190 #define	PCIXCMD_MMRBC_MASK	(3 << 2)
    191 #define	PCIXCMD_ERO		(1U << 1)
    192 #define	PCIXCMD_DPERE		(1U << 0)
    193 
    194 #define	PCIXSR_RSCEM		(1U << 29)
    195 #define	PCIXSR_DMCRS_MASK	(7 << 26)
    196 #define	PCIXSR_DMOST_MASK	(7 << 23)
    197 #define	PCIXSR_COMPLEX		(1U << 20)
    198 #define	PCIXSR_USC		(1U << 19)
    199 #define	PCIXSR_SCD		(1U << 18)
    200 #define	PCIXSR_133_CAP		(1U << 17)
    201 #define	PCIXSR_32PCI		(1U << 16)	/* 0 = 32, 1 = 64 */
    202 #define	PCIXSR_BUSNO(x)		(((x) & 0xff) >> 8)
    203 #define	PCIXSR_DEVNO(x)		(((x) & 0x1f) >> 3)
    204 #define	PCIXSR_FUNCNO(x)	((x) & 0x7)
    205 
    206 /*
    207  * Memory Controller Unit
    208  */
    209 #define	MCU_SDIR		0x00	/* DDR SDRAM Init. Register */
    210 #define	MCU_SDCR		0x04	/* DDR SDRAM Control Register */
    211 #define	MCU_SDBR		0x08	/* SDRAM Base Register */
    212 #define	MCU_SBR0		0x0c	/* SDRAM Boundary 0 */
    213 #define	MCU_SBR1		0x10	/* SDRAM Boundary 1 */
    214 #define	MCU_ECCR		0x34	/* ECC Control Register */
    215 #define	MCU_ELOG0		0x38	/* ECC Log 0 */
    216 #define	MCU_ELOG1		0x3c	/* ECC Log 1 */
    217 #define	MCU_ECAR0		0x40	/* ECC address 0 */
    218 #define	MCU_ECAR1		0x44	/* ECC address 1 */
    219 #define	MCU_ECTST		0x48	/* ECC test register */
    220 #define	MCU_MCISR		0x4c	/* MCU Interrupt Status Register */
    221 #define	MCU_RFR			0x50	/* Refresh Frequency Register */
    222 #define	MCU_DBUDSR		0x54	/* Data Bus Pull-up Drive Strength */
    223 #define	MCU_DBDDSR		0x58	/* Data Bus Pull-down Drive Strength */
    224 #define	MCU_CUDSR		0x5c	/* Clock Pull-up Drive Strength */
    225 #define	MCU_CDDSR		0x60	/* Clock Pull-down Drive Strength */
    226 #define	MCU_CEUDSR		0x64	/* Clock En Pull-up Drive Strength */
    227 #define	MCU_CEDDSR		0x68	/* Clock En Pull-down Drive Strength */
    228 #define	MCU_CSUDSR		0x6c	/* Chip Sel Pull-up Drive Strength */
    229 #define	MCU_CSDDSR		0x70	/* Chip Sel Pull-down Drive Strength */
    230 #define	MCU_REUDSR		0x74	/* Rx En Pull-up Drive Strength */
    231 #define	MCU_REDDSR		0x78	/* Rx En Pull-down Drive Strength */
    232 #define	MCU_ABUDSR		0x7c	/* Addr Bus Pull-up Drive Strength */
    233 #define	MCU_ABDDSR		0x80	/* Addr Bus Pull-down Drive Strength */
    234 #define	MCU_DSDR		0x84	/* Data Strobe Delay Register */
    235 #define	MCU_REDR		0x88	/* Rx Enable Delay Register */
    236 
    237 #define	SDCR_DIMMTYPE		(1U << 1)	/* 0 = unbuf, 1 = reg */
    238 #define	SDCR_BUSWIDTH		(1U << 2)	/* 0 = 64, 1 = 32 */
    239 
    240 #define	SBRx_TECH		(1U << 31)
    241 #define	SBRx_BOUND		0x0000003f
    242 
    243 #define	ECCR_SBERE		(1U << 0)
    244 #define	ECCR_MBERE		(1U << 1)
    245 #define	ECCR_SBECE		(1U << 2)
    246 #define	ECCR_ECCEN		(1U << 3)
    247 
    248 #define	ELOGx_SYNDROME		0x000000ff
    249 #define	ELOGx_ERRTYPE		(1U << 8)	/* 1 = multi-bit */
    250 #define	ELOGx_RW		(1U << 12)	/* 1 = write error */
    251 	/*
    252 	 * Dev ID	Func		Requester
    253 	 * 2		0		XScale core
    254 	 * 2		1		ATU
    255 	 * 13		0		DMA channel 0
    256 	 * 13		1		DMA channel 1
    257 	 * 26		0		ATU
    258 	 */
    259 #define	ELOGx_REQ_DEV(x)	(((x) >> 19) & 0x1f)
    260 #define	ELOGx_REQ_FUNC(x)	(((x) >> 16) & 0x3)
    261 
    262 #define	MCISR_ECC_ERR0		(1U << 0)
    263 #define	MCISR_ECC_ERR1		(1U << 1)
    264 #define	MCISR_ECC_ERRN		(1U << 2)
    265 
    266 /*
    267  * Timers
    268  *
    269  * The i80321 timer registers are available in both memory-mapped
    270  * and coprocessor spaces.  Most of the registers are read-only
    271  * if memory-mapped, so we access them via coprocessor space.
    272  *
    273  *	TMR0	cp6 c0,1	0xffffe7e0
    274  *	TMR1	cp6 c1,1	0xffffe7e4
    275  *	TCR0	cp6 c2,1	0xffffe7e8
    276  *	TCR1	cp6 c3,1	0xffffe7ec
    277  *	TRR0	cp6 c4,1	0xffffe7f0
    278  *	TRR1	cp6 c5,1	0xffffe7f4
    279  *	TISR	cp6 c6,1	0xffffe7f8
    280  *	WDTCR	cp6 c7,1	0xffffe7fc
    281  */
    282 
    283 #define	TMRx_TC			(1U << 0)
    284 #define	TMRx_ENABLE		(1U << 1)
    285 #define	TMRx_RELOAD		(1U << 2)
    286 #define	TMRx_CSEL_CORE		(0 << 4)
    287 #define	TMRx_CSEL_CORE_div4	(1 << 4)
    288 #define	TMRx_CSEL_CORE_div8	(2 << 4)
    289 #define	TMRx_CSEL_CORE_div16	(3 << 4)
    290 
    291 #define	TISR_TMR0		(1U << 0)
    292 #define	TISR_TMR1		(1U << 1)
    293 
    294 #define	WDTCR_ENABLE1		0x1e1e1e1e
    295 #define	WDTCR_ENABLE2		0xe1e1e1e1
    296 
    297 /*
    298  * Interrupt Controller Unit.
    299  *
    300  *	INTCTL	cp6 c0,0	0xffffe7d0
    301  *	INTSTR	cp6 c4,0	0xffffe7d4
    302  *	IINTSRC	cp6 c8,0	0xffffe7d8
    303  *	FINTSRC	cp6 c9,0	0xffffe7dc
    304  *	PIRSR			0xffffe2ec
    305  */
    306 
    307 #define	ICU_PIRSR		0x02ec
    308 #define	ICU_GPOE		0x07c4
    309 #define	ICU_GPID		0x07c8
    310 #define	ICU_GPOD		0x07cc
    311 
    312 /*
    313  * NOTE: WE USE THE `bitXX' BITS TO INDICATE PENDING SOFTWARE
    314  * INTERRUPTS.  See i80321_icu.c
    315  */
    316 #define	ICU_INT_HPI		31	/* high priority interrupt */
    317 #define	ICU_INT_XINT(x)		((x) + 27) /* external interrupts */
    318 #define	ICU_INT_bit26		26
    319 #define	ICU_INT_SSP		25	/* SSP serial port */
    320 #define	ICU_INT_MUE		24	/* msg unit error */
    321 #define	ICU_INT_AAUE		23	/* AAU error */
    322 #define	ICU_INT_bit22		22
    323 #define	ICU_INT_DMA1E		21	/* DMA Ch 1 error */
    324 #define	ICU_INT_DMA0E		20	/* DMA Ch 0 error */
    325 #define	ICU_INT_MCUE		19	/* memory controller error */
    326 #define	ICU_INT_ATUE		18	/* ATU error */
    327 #define	ICU_INT_BIUE		17	/* bus interface unit error */
    328 #define	ICU_INT_PMU		16	/* XScale PMU */
    329 #define	ICU_INT_PPM		15	/* peripheral PMU */
    330 #define	ICU_INT_BIST		14	/* ATU Start BIST */
    331 #define	ICU_INT_MU		13	/* messaging unit */
    332 #define	ICU_INT_I2C1		12	/* i2c unit 1 */
    333 #define	ICU_INT_I2C0		11	/* i2c unit 0 */
    334 #define	ICU_INT_TMR1		10	/* timer 1 */
    335 #define	ICU_INT_TMR0		9	/* timer 0 */
    336 #define	ICU_INT_CPPM		8	/* core processor PMU */
    337 #define	ICU_INT_AAU_EOC		7	/* AAU end-of-chain */
    338 #define	ICU_INT_AAU_EOT		6	/* AAU end-of-transfer */
    339 #define	ICU_INT_bit5		5
    340 #define	ICU_INT_bit4		4
    341 #define	ICU_INT_DMA1_EOC	3	/* DMA1 end-of-chain */
    342 #define	ICU_INT_DMA1_EOT	2	/* DMA1 end-of-transfer */
    343 #define	ICU_INT_DMA0_EOC	1	/* DMA0 end-of-chain */
    344 #define	ICU_INT_DMA0_EOT	0	/* DMA0 end-of-transfer */
    345 
    346 #define	ICU_INT_HWMASK		(0xffffffff & ~(ICU_INT_bit26|ICU_INT_bit22| \
    347 						ICU_INT_bit5|ICU_INT_bit4))
    348 
    349 /*
    350  * DMA Controller
    351  */
    352 
    353 struct dma_chain_desc {
    354 	uint32_t	dcd_nda;	/* next descriptor address */
    355 	uint32_t	dcd_pad;	/* PCI address (lower) */
    356 	uint32_t	dcd_puad;	/* PCI address (upper) */
    357 	uint32_t	dcd_lad;	/* local address */
    358 	uint32_t	dcd_bc;		/* byte count */
    359 	uint32_t	dcd_dc;		/* descriptor control */
    360 } __attribute__((__packed__));
    361 
    362 #define	DMA_CHAN1_OFF	0x40		/* offset to channel 1 regs */
    363 
    364 #define	DMA_CCR		0x00		/* channel control register */
    365 #define	DMA_CSR		0x04		/* channel status register */
    366 #define	DMA_DAR		0x0c		/* descriptor address */
    367 #define	DMA_DNAR	0x10		/* next descriptor address */
    368 #define	DMA_PADR	0x14		/* PCI address (low) */
    369 #define	DMA_PUADR	0x18		/* PCI address (high) */
    370 #define	DMA_LADR	0x1c		/* local address */
    371 #define	DMA_BCR		0x20		/* byte count */
    372 #define	DMA_DCR		0x24		/* descriptor control */
    373 
    374 #define	DMA_CCR_CE	(1U << 0)	/* channel enable */
    375 #define	DMA_CCR_CR	(1U << 1)	/* chain resume */
    376 
    377 #define	DMA_SSR_STE	(1U << 1)	/* PCI-X split transaction error */
    378 #define	DMA_SSR_TAF	(1U << 2)	/* PCI target abort flag */
    379 #define	DMA_SSR_MAF	(1U << 3)	/* PCI master abort flag */
    380 #define	DMA_SSR_IBMAF	(1U << 5)	/* Internal bus master abort flag */
    381 #define	DMA_SSR_ECIF	(1U << 8)	/* end-of-chain interrupt */
    382 #define	DMA_SSR_ETIF	(1U << 9)	/* end-of-transfer interrupt */
    383 #define	DMA_SSR_CAF	(1U << 10)	/* channel active flag */
    384 
    385 #define	DMA_BCR_MASK	0x00ffffff	/* 24-bit count */
    386 
    387 #define	DMA_DCR_TTYPE	0x0000000f	/* PCI transaction type */
    388 #define	DMA_DCR_IE	(1U << 4)	/* interrupt enable */
    389 #define	DMA_DCR_DACE	(1U << 5)	/* dual address cycle enable */
    390 #define	DMA_DCR_MMTE	(1U << 6)	/* memory->memory transfer enable */
    391 
    392 #define	DMA_DCR_TTYPE_MR	0x06	/* Memory Read */
    393 #define	DMA_DCR_TTYPE_MW	0x07	/* Memory Write */
    394 #define	DMA_DCR_TTYPE_MRM	0x0c	/* Memory Read Multiple */
    395 #define	DMA_DCR_TTYPE_MRL	0x0e	/* Memory Read Line */
    396 #define	DMA_DCR_TTYPE_MW2	0x0f	/* Memory Write */
    397 
    398 /*
    399  * SSP Serial Port
    400  */
    401 
    402 #define	SSP_SSCR0	0x00		/* SSC control 0 */
    403 #define	SSP_SSCR1	0x04		/* SSC control 1 */
    404 #define	SSP_SSSR	0x08		/* SSP status */
    405 #define	SSP_SSITR	0x0c		/* SSP interrupt test */
    406 #define	SSP_SSDR	0x10		/* SSP data */
    407 
    408 #define	SSP_SSCR0_DSIZE(x)	((x) - 1)/* data size: 4..16 */
    409 #define	SSP_SSCR0_FRF_SPI	(0 << 4) /* Motorola Serial Periph Iface */
    410 #define	SSP_SSCR0_FRF_SSP	(1U << 4)/* TI Sync. Serial Protocol */
    411 #define	SSP_SSCR0_FRF_UWIRE	(2U << 4)/* NatSemi Microwire */
    412 #define	SSP_SSCR0_FRF_rsvd	(3U << 4)/* reserved */
    413 #define	SSP_SSCR0_ECS		(1U << 6)/* external clock select */
    414 #define	SSP_SSCR0_SSE		(1U << 7)/* sync. serial port enable */
    415 #define	SSP_SSCR0_SCR(x)	((x) << 8)/* serial clock rate */
    416 					  /* bit rate = 3.6864 * 10e6 /
    417 					        (2 * (SCR + 1)) */
    418 
    419 #define	SSP_SSCR1_RIE		(1U << 0)/* Rx FIFO interrupt enable */
    420 #define	SSP_SSCR1_TIE		(1U << 1)/* Tx FIFO interrupt enable */
    421 #define	SSP_SSCR1_LBM		(1U << 2)/* loopback mode enable */
    422 #define	SSP_SSCR1_SPO		(1U << 3)/* Moto SPI SSCLK pol. (1 = high) */
    423 #define	SSP_SSCR1_SPH		(1U << 4)/* Moto SPI SSCLK phase:
    424 					    0 = inactive full at start,
    425 						1/2 at end of frame
    426 					    1 = inactive 1/2 at start,
    427 						full at end of frame */
    428 #define	SSP_SSCR1_MWDS		(1U << 5)/* Microwire data size:
    429 					    0 = 8 bit
    430 					    1 = 16 bit */
    431 #define	SSP_SSCR1_TFT		(((x) - 1) << 6) /* Tx FIFO threshold */
    432 #define	SSP_SSCR1_RFT		(((x) - 1) << 10)/* Rx FIFO threshold */
    433 #define	SSP_SSCR1_EFWR		(1U << 14)/* enab. FIFO write/read */
    434 #define	SSP_SSCR1_STRF		(1U << 15)/* FIFO write/read FIFO select:
    435 					     0 = Tx FIFO
    436 					     1 = Rx FIFO */
    437 
    438 #define	SSP_SSSR_TNF		(1U << 2)/* Tx FIFO not full */
    439 #define	SSP_SSSR_RNE		(1U << 3)/* Rx FIFO not empty */
    440 #define	SSP_SSSR_BSY		(1U << 4)/* SSP is busy */
    441 #define	SSP_SSSR_TFS		(1U << 5)/* Tx FIFO service request */
    442 #define	SSP_SSSR_RFS		(1U << 6)/* Rx FIFO service request */
    443 #define	SSP_SSSR_ROR		(1U << 7)/* Rx FIFO overrun */
    444 #define	SSP_SSSR_TFL(x)		(((x) >> 8) & 0xf) /* Tx FIFO level */
    445 #define	SSP_SSSR_RFL(x)		(((x) >> 12) & 0xf)/* Rx FIFO level */
    446 
    447 #define	SSP_SSITR_TTFS		(1U << 5)/* Test Tx FIFO service */
    448 #define	SSP_SSITR_TRFS		(1U << 6)/* Test Rx FIFO service */
    449 #define	SSP_SSITR_TROR		(1U << 7)/* Test Rx overrun */
    450 
    451 /*
    452  * Application Accelerator Unit
    453  */
    454 
    455 #define	AAU_ACR		0x00		/* accelerator control */
    456 #define	AAU_ASR		0x04		/* accelerator status */
    457 #define	AAU_ADAR	0x08		/* descriptor address */
    458 #define	AAU_ANDAR	0x0c		/* next descriptor address */
    459 #define	AAU_DAR		0x20		/* destination address */
    460 #define	AAU_ABCR	0x24		/* byte count */
    461 #define	AAU_ADCR	0x28		/* descriptor control */
    462 #define	AAU_EDCR0	0x3c		/* extended descriptor control 0 */
    463 #define	AAU_EDCR1	0x60		/* extended descriptor control 1 */
    464 #define	AAU_EDCR2	0x84		/* extended descriptor control 2 */
    465 
    466 #define	AAU_ACR_AAE	(1U << 0)	/* accelerator enable */
    467 #define	AAU_ACR_CR	(1U << 1)	/* chain resume */
    468 #define	AAU_ACR_512	(1U << 2)	/* 512-byte buffer enable */
    469 
    470 #define	AAU_ASR_MA	(1U << 5)	/* master abort */
    471 #define	AAU_ASR_ECIF	(1U << 8)	/* end of chain interrupt */
    472 #define	AAU_ASR_ETIF	(1U << 9)	/* end of transfer interrupt */
    473 #define	AAU_ASR_AAF	(1U << 10)	/* acellerator active */
    474 
    475 #define	AAU_ABCR_MASK	0x00ffffff	/* 24-bit count */
    476 
    477 #endif /* _ARM_XSCALE_I80321REG_H_ */
    478