18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef __PXA3XX_GCU_H__
38c2ecf20Sopenharmony_ci#define __PXA3XX_GCU_H__
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <linux/types.h>
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci/* Number of 32bit words in display list (ring buffer). */
88c2ecf20Sopenharmony_ci#define PXA3XX_GCU_BUFFER_WORDS  ((256 * 1024 - 256) / 4)
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci/* To be increased when breaking the ABI */
118c2ecf20Sopenharmony_ci#define PXA3XX_GCU_SHARED_MAGIC  0x30000001
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#define PXA3XX_GCU_BATCH_WORDS   8192
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_cistruct pxa3xx_gcu_shared {
168c2ecf20Sopenharmony_ci	u32            buffer[PXA3XX_GCU_BUFFER_WORDS];
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci	bool           hw_running;
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci	unsigned long  buffer_phys;
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci	unsigned int   num_words;
238c2ecf20Sopenharmony_ci	unsigned int   num_writes;
248c2ecf20Sopenharmony_ci	unsigned int   num_done;
258c2ecf20Sopenharmony_ci	unsigned int   num_interrupts;
268c2ecf20Sopenharmony_ci	unsigned int   num_wait_idle;
278c2ecf20Sopenharmony_ci	unsigned int   num_wait_free;
288c2ecf20Sopenharmony_ci	unsigned int   num_idle;
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci	u32            magic;
318c2ecf20Sopenharmony_ci};
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci/* Initialization and synchronization.
348c2ecf20Sopenharmony_ci * Hardware is started upon write(). */
358c2ecf20Sopenharmony_ci#define PXA3XX_GCU_IOCTL_RESET		_IO('G', 0)
368c2ecf20Sopenharmony_ci#define PXA3XX_GCU_IOCTL_WAIT_IDLE	_IO('G', 2)
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci#endif /* __PXA3XX_GCU_H__ */
398c2ecf20Sopenharmony_ci
40