/*****************************************************************************
* xr17d152_regs.h
*
*****************************************************************************/

#if !defined(__XR17D152_REGS_H__)
# define __XR17D152_REGS_H__

/* */
#define XR17D152_VENDOR_ID			0x13A8
#define XR17D152_DEVICE_ID			0x0152

#define XR17D152_MEMORY_SIZE			1024

/* Device configuration registers */
#define REG_XR17D152_INT0			0x80
#define BITS_XR17D152_IUART			0x00000003
#define BITS_XR17D152_ITIMER			0x00000700
#define IS_XR17D152_UART(ireg)						\
		((ireg) & BITS_XR17D152_IUART)
#define IS_XR17D152_ITIMER(ireg)					\
		(((ireg) & BITS_XR17D152_ITIMER) == BITS_XR17D152_ITIMER)
 
#define REG_XR17D152_TIMERCNTL			0x84
#define BITS_XR17D152_TCNTL_ENABLE		0x01
#define BITS_XR17D152_TCNTL_START		0x02
#define BITS_XR17D152_TCNTL_SINGLE		0x04
#define BITS_XR17D152_TCNTL_EXTERNAL		0x08
#define BITS_XR17D152_TCNTL_MPIOCTRL		0x10

#define IS_XR17D152_TIMERPENDING(cntl)		((cntl) & 0x01)

#define REG_XR17D152_TIMERLSB			0x86
#define REG_XR17D152_TIMERMSB			0x87

#define REG_XR17D152_DREV			0x8C

#define REG_XR17D152_DVID			0x8D
#define BITS_XR17D152_DVID			0x22
	
#define REG_XR17D152_MPIOLVL			0x90
#define BIT_XR17D152_MPIOLVL0			0x01
#define BIT_XR17D152_MPIOLVL1			0x02

#define REG_XR17D152_MPIO3T			0x91

#define REG_XR17D152_MPIOSEL			0x93

#endif /* __XR17D152_REGS_H__ */
