18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright (C) 2013,2014 ARM Limited
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
58c2ecf20Sopenharmony_ci * License.  See the file COPYING in the main directory of this archive
68c2ecf20Sopenharmony_ci * for more details.
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci *  ARM HDLCD Controller register definition
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#ifndef __HDLCD_REGS_H__
128c2ecf20Sopenharmony_ci#define __HDLCD_REGS_H__
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci/* register offsets */
158c2ecf20Sopenharmony_ci#define HDLCD_REG_VERSION		0x0000	/* ro */
168c2ecf20Sopenharmony_ci#define HDLCD_REG_INT_RAWSTAT		0x0010	/* rw */
178c2ecf20Sopenharmony_ci#define HDLCD_REG_INT_CLEAR		0x0014	/* wo */
188c2ecf20Sopenharmony_ci#define HDLCD_REG_INT_MASK		0x0018	/* rw */
198c2ecf20Sopenharmony_ci#define HDLCD_REG_INT_STATUS		0x001c	/* ro */
208c2ecf20Sopenharmony_ci#define HDLCD_REG_FB_BASE		0x0100	/* rw */
218c2ecf20Sopenharmony_ci#define HDLCD_REG_FB_LINE_LENGTH	0x0104	/* rw */
228c2ecf20Sopenharmony_ci#define HDLCD_REG_FB_LINE_COUNT		0x0108	/* rw */
238c2ecf20Sopenharmony_ci#define HDLCD_REG_FB_LINE_PITCH		0x010c	/* rw */
248c2ecf20Sopenharmony_ci#define HDLCD_REG_BUS_OPTIONS		0x0110	/* rw */
258c2ecf20Sopenharmony_ci#define HDLCD_REG_V_SYNC		0x0200	/* rw */
268c2ecf20Sopenharmony_ci#define HDLCD_REG_V_BACK_PORCH		0x0204	/* rw */
278c2ecf20Sopenharmony_ci#define HDLCD_REG_V_DATA		0x0208	/* rw */
288c2ecf20Sopenharmony_ci#define HDLCD_REG_V_FRONT_PORCH		0x020c	/* rw */
298c2ecf20Sopenharmony_ci#define HDLCD_REG_H_SYNC		0x0210	/* rw */
308c2ecf20Sopenharmony_ci#define HDLCD_REG_H_BACK_PORCH		0x0214	/* rw */
318c2ecf20Sopenharmony_ci#define HDLCD_REG_H_DATA		0x0218	/* rw */
328c2ecf20Sopenharmony_ci#define HDLCD_REG_H_FRONT_PORCH		0x021c	/* rw */
338c2ecf20Sopenharmony_ci#define HDLCD_REG_POLARITIES		0x0220	/* rw */
348c2ecf20Sopenharmony_ci#define HDLCD_REG_COMMAND		0x0230	/* rw */
358c2ecf20Sopenharmony_ci#define HDLCD_REG_PIXEL_FORMAT		0x0240	/* rw */
368c2ecf20Sopenharmony_ci#define HDLCD_REG_RED_SELECT		0x0244	/* rw */
378c2ecf20Sopenharmony_ci#define HDLCD_REG_GREEN_SELECT		0x0248	/* rw */
388c2ecf20Sopenharmony_ci#define HDLCD_REG_BLUE_SELECT		0x024c	/* rw */
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci/* version */
418c2ecf20Sopenharmony_ci#define HDLCD_PRODUCT_ID		0x1CDC0000
428c2ecf20Sopenharmony_ci#define HDLCD_PRODUCT_MASK		0xFFFF0000
438c2ecf20Sopenharmony_ci#define HDLCD_VERSION_MAJOR_MASK	0x0000FF00
448c2ecf20Sopenharmony_ci#define HDLCD_VERSION_MINOR_MASK	0x000000FF
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci/* interrupts */
478c2ecf20Sopenharmony_ci#define HDLCD_INTERRUPT_DMA_END		(1 << 0)
488c2ecf20Sopenharmony_ci#define HDLCD_INTERRUPT_BUS_ERROR	(1 << 1)
498c2ecf20Sopenharmony_ci#define HDLCD_INTERRUPT_VSYNC		(1 << 2)
508c2ecf20Sopenharmony_ci#define HDLCD_INTERRUPT_UNDERRUN	(1 << 3)
518c2ecf20Sopenharmony_ci#define HDLCD_DEBUG_INT_MASK		(HDLCD_INTERRUPT_DMA_END |  \
528c2ecf20Sopenharmony_ci					HDLCD_INTERRUPT_BUS_ERROR | \
538c2ecf20Sopenharmony_ci					HDLCD_INTERRUPT_UNDERRUN)
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci/* polarities */
568c2ecf20Sopenharmony_ci#define HDLCD_POLARITY_VSYNC		(1 << 0)
578c2ecf20Sopenharmony_ci#define HDLCD_POLARITY_HSYNC		(1 << 1)
588c2ecf20Sopenharmony_ci#define HDLCD_POLARITY_DATAEN		(1 << 2)
598c2ecf20Sopenharmony_ci#define HDLCD_POLARITY_DATA		(1 << 3)
608c2ecf20Sopenharmony_ci#define HDLCD_POLARITY_PIXELCLK		(1 << 4)
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci/* commands */
638c2ecf20Sopenharmony_ci#define HDLCD_COMMAND_DISABLE		(0 << 0)
648c2ecf20Sopenharmony_ci#define HDLCD_COMMAND_ENABLE		(1 << 0)
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci/* pixel format */
678c2ecf20Sopenharmony_ci#define HDLCD_PIXEL_FMT_LITTLE_ENDIAN	(0 << 31)
688c2ecf20Sopenharmony_ci#define HDLCD_PIXEL_FMT_BIG_ENDIAN	(1 << 31)
698c2ecf20Sopenharmony_ci#define HDLCD_BYTES_PER_PIXEL_MASK	(3 << 3)
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci/* bus options */
728c2ecf20Sopenharmony_ci#define HDLCD_BUS_BURST_MASK		0x01f
738c2ecf20Sopenharmony_ci#define HDLCD_BUS_MAX_OUTSTAND		0xf00
748c2ecf20Sopenharmony_ci#define HDLCD_BUS_BURST_NONE		(0 << 0)
758c2ecf20Sopenharmony_ci#define HDLCD_BUS_BURST_1		(1 << 0)
768c2ecf20Sopenharmony_ci#define HDLCD_BUS_BURST_2		(1 << 1)
778c2ecf20Sopenharmony_ci#define HDLCD_BUS_BURST_4		(1 << 2)
788c2ecf20Sopenharmony_ci#define HDLCD_BUS_BURST_8		(1 << 3)
798c2ecf20Sopenharmony_ci#define HDLCD_BUS_BURST_16		(1 << 4)
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci/* Max resolution supported is 4096x4096, 32bpp */
828c2ecf20Sopenharmony_ci#define HDLCD_MAX_XRES			4096
838c2ecf20Sopenharmony_ci#define HDLCD_MAX_YRES			4096
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci#define NR_PALETTE			256
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ci#endif /* __HDLCD_REGS_H__ */
88