18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * drivers/video/geode/display_gx1.h
48c2ecf20Sopenharmony_ci *   -- Geode GX1 display controller
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Copyright (C) 2005 Arcom Control Systems Ltd.
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * Based on AMD's original 2.4 driver:
98c2ecf20Sopenharmony_ci *   Copyright (C) 2004 Advanced Micro Devices, Inc.
108c2ecf20Sopenharmony_ci */
118c2ecf20Sopenharmony_ci#ifndef __DISPLAY_GX1_H__
128c2ecf20Sopenharmony_ci#define __DISPLAY_GX1_H__
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ciunsigned gx1_gx_base(void);
158c2ecf20Sopenharmony_ciint gx1_frame_buffer_size(void);
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ciextern const struct geode_dc_ops gx1_dc_ops;
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci/* GX1 configuration I/O registers */
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#define CONFIG_CCR3 0xc3
228c2ecf20Sopenharmony_ci#  define CONFIG_CCR3_MAPEN 0x10
238c2ecf20Sopenharmony_ci#define CONFIG_GCR  0xb8
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci/* Memory controller registers */
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci#define MC_BANK_CFG		0x08
288c2ecf20Sopenharmony_ci#  define MC_BCFG_DIMM0_SZ_MASK		0x00000700
298c2ecf20Sopenharmony_ci#  define MC_BCFG_DIMM0_PG_SZ_MASK	0x00000070
308c2ecf20Sopenharmony_ci#  define MC_BCFG_DIMM0_PG_SZ_NO_DIMM	0x00000070
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#define MC_GBASE_ADD		0x14
338c2ecf20Sopenharmony_ci#  define MC_GADD_GBADD_MASK		0x000003ff
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci/* Display controller registers */
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci#define DC_PAL_ADDRESS		0x70
388c2ecf20Sopenharmony_ci#define DC_PAL_DATA		0x74
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci#define DC_UNLOCK		0x00
418c2ecf20Sopenharmony_ci#  define DC_UNLOCK_CODE		0x00004758
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci#define DC_GENERAL_CFG		0x04
448c2ecf20Sopenharmony_ci#  define DC_GCFG_DFLE			0x00000001
458c2ecf20Sopenharmony_ci#  define DC_GCFG_CURE			0x00000002
468c2ecf20Sopenharmony_ci#  define DC_GCFG_VCLK_DIV		0x00000004
478c2ecf20Sopenharmony_ci#  define DC_GCFG_PLNO			0x00000004
488c2ecf20Sopenharmony_ci#  define DC_GCFG_PPC			0x00000008
498c2ecf20Sopenharmony_ci#  define DC_GCFG_CMPE			0x00000010
508c2ecf20Sopenharmony_ci#  define DC_GCFG_DECE			0x00000020
518c2ecf20Sopenharmony_ci#  define DC_GCFG_DCLK_MASK		0x000000C0
528c2ecf20Sopenharmony_ci#  define DC_GCFG_DCLK_DIV_1		0x00000080
538c2ecf20Sopenharmony_ci#  define DC_GCFG_DFHPSL_MASK		0x00000F00
548c2ecf20Sopenharmony_ci#  define DC_GCFG_DFHPSL_POS			 8
558c2ecf20Sopenharmony_ci#  define DC_GCFG_DFHPEL_MASK		0x0000F000
568c2ecf20Sopenharmony_ci#  define DC_GCFG_DFHPEL_POS			12
578c2ecf20Sopenharmony_ci#  define DC_GCFG_CIM_MASK		0x00030000
588c2ecf20Sopenharmony_ci#  define DC_GCFG_CIM_POS			16
598c2ecf20Sopenharmony_ci#  define DC_GCFG_FDTY			0x00040000
608c2ecf20Sopenharmony_ci#  define DC_GCFG_RTPM			0x00080000
618c2ecf20Sopenharmony_ci#  define DC_GCFG_DAC_RS_MASK		0x00700000
628c2ecf20Sopenharmony_ci#  define DC_GCFG_DAC_RS_POS			20
638c2ecf20Sopenharmony_ci#  define DC_GCFG_CKWR			0x00800000
648c2ecf20Sopenharmony_ci#  define DC_GCFG_LDBL			0x01000000
658c2ecf20Sopenharmony_ci#  define DC_GCFG_DIAG			0x02000000
668c2ecf20Sopenharmony_ci#  define DC_GCFG_CH4S			0x04000000
678c2ecf20Sopenharmony_ci#  define DC_GCFG_SSLC			0x08000000
688c2ecf20Sopenharmony_ci#  define DC_GCFG_VIDE			0x10000000
698c2ecf20Sopenharmony_ci#  define DC_GCFG_VRDY			0x20000000
708c2ecf20Sopenharmony_ci#  define DC_GCFG_DPCK			0x40000000
718c2ecf20Sopenharmony_ci#  define DC_GCFG_DDCK			0x80000000
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci#define DC_TIMING_CFG		0x08
748c2ecf20Sopenharmony_ci#  define DC_TCFG_FPPE			0x00000001
758c2ecf20Sopenharmony_ci#  define DC_TCFG_HSYE			0x00000002
768c2ecf20Sopenharmony_ci#  define DC_TCFG_VSYE			0x00000004
778c2ecf20Sopenharmony_ci#  define DC_TCFG_BLKE			0x00000008
788c2ecf20Sopenharmony_ci#  define DC_TCFG_DDCK			0x00000010
798c2ecf20Sopenharmony_ci#  define DC_TCFG_TGEN			0x00000020
808c2ecf20Sopenharmony_ci#  define DC_TCFG_VIEN			0x00000040
818c2ecf20Sopenharmony_ci#  define DC_TCFG_BLNK			0x00000080
828c2ecf20Sopenharmony_ci#  define DC_TCFG_CHSP			0x00000100
838c2ecf20Sopenharmony_ci#  define DC_TCFG_CVSP			0x00000200
848c2ecf20Sopenharmony_ci#  define DC_TCFG_FHSP			0x00000400
858c2ecf20Sopenharmony_ci#  define DC_TCFG_FVSP			0x00000800
868c2ecf20Sopenharmony_ci#  define DC_TCFG_FCEN			0x00001000
878c2ecf20Sopenharmony_ci#  define DC_TCFG_CDCE			0x00002000
888c2ecf20Sopenharmony_ci#  define DC_TCFG_PLNR			0x00002000
898c2ecf20Sopenharmony_ci#  define DC_TCFG_INTL			0x00004000
908c2ecf20Sopenharmony_ci#  define DC_TCFG_PXDB			0x00008000
918c2ecf20Sopenharmony_ci#  define DC_TCFG_BKRT			0x00010000
928c2ecf20Sopenharmony_ci#  define DC_TCFG_PSD_MASK		0x000E0000
938c2ecf20Sopenharmony_ci#  define DC_TCFG_PSD_POS			17
948c2ecf20Sopenharmony_ci#  define DC_TCFG_DDCI			0x08000000
958c2ecf20Sopenharmony_ci#  define DC_TCFG_SENS			0x10000000
968c2ecf20Sopenharmony_ci#  define DC_TCFG_DNA			0x20000000
978c2ecf20Sopenharmony_ci#  define DC_TCFG_VNA			0x40000000
988c2ecf20Sopenharmony_ci#  define DC_TCFG_VINT			0x80000000
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci#define DC_OUTPUT_CFG		0x0C
1018c2ecf20Sopenharmony_ci#  define DC_OCFG_8BPP			0x00000001
1028c2ecf20Sopenharmony_ci#  define DC_OCFG_555			0x00000002
1038c2ecf20Sopenharmony_ci#  define DC_OCFG_PCKE			0x00000004
1048c2ecf20Sopenharmony_ci#  define DC_OCFG_FRME			0x00000008
1058c2ecf20Sopenharmony_ci#  define DC_OCFG_DITE			0x00000010
1068c2ecf20Sopenharmony_ci#  define DC_OCFG_2PXE			0x00000020
1078c2ecf20Sopenharmony_ci#  define DC_OCFG_2XCK			0x00000040
1088c2ecf20Sopenharmony_ci#  define DC_OCFG_2IND			0x00000080
1098c2ecf20Sopenharmony_ci#  define DC_OCFG_34ADD			0x00000100
1108c2ecf20Sopenharmony_ci#  define DC_OCFG_FRMS			0x00000200
1118c2ecf20Sopenharmony_ci#  define DC_OCFG_CKSL			0x00000400
1128c2ecf20Sopenharmony_ci#  define DC_OCFG_PRMP			0x00000800
1138c2ecf20Sopenharmony_ci#  define DC_OCFG_PDEL			0x00001000
1148c2ecf20Sopenharmony_ci#  define DC_OCFG_PDEH			0x00002000
1158c2ecf20Sopenharmony_ci#  define DC_OCFG_CFRW			0x00004000
1168c2ecf20Sopenharmony_ci#  define DC_OCFG_DIAG			0x00008000
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci#define DC_FB_ST_OFFSET		0x10
1198c2ecf20Sopenharmony_ci#define DC_CB_ST_OFFSET		0x14
1208c2ecf20Sopenharmony_ci#define DC_CURS_ST_OFFSET	0x18
1218c2ecf20Sopenharmony_ci#define DC_ICON_ST_OFFSET	0x1C
1228c2ecf20Sopenharmony_ci#define DC_VID_ST_OFFSET	0x20
1238c2ecf20Sopenharmony_ci#define DC_LINE_DELTA		0x24
1248c2ecf20Sopenharmony_ci#define DC_BUF_SIZE		0x28
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ci#define DC_H_TIMING_1		0x30
1278c2ecf20Sopenharmony_ci#define DC_H_TIMING_2		0x34
1288c2ecf20Sopenharmony_ci#define DC_H_TIMING_3		0x38
1298c2ecf20Sopenharmony_ci#define DC_FP_H_TIMING		0x3C
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_ci#define DC_V_TIMING_1		0x40
1328c2ecf20Sopenharmony_ci#define DC_V_TIMING_2		0x44
1338c2ecf20Sopenharmony_ci#define DC_V_TIMING_3		0x48
1348c2ecf20Sopenharmony_ci#define DC_FP_V_TIMING		0x4C
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ci#define DC_CURSOR_X		0x50
1378c2ecf20Sopenharmony_ci#define DC_ICON_X		0x54
1388c2ecf20Sopenharmony_ci#define DC_V_LINE_CNT		0x54
1398c2ecf20Sopenharmony_ci#define DC_CURSOR_Y		0x58
1408c2ecf20Sopenharmony_ci#define DC_ICON_Y		0x5C
1418c2ecf20Sopenharmony_ci#define DC_SS_LINE_CMP		0x5C
1428c2ecf20Sopenharmony_ci#define DC_CURSOR_COLOR		0x60
1438c2ecf20Sopenharmony_ci#define DC_ICON_COLOR		0x64
1448c2ecf20Sopenharmony_ci#define DC_BORDER_COLOR		0x68
1458c2ecf20Sopenharmony_ci#define DC_PAL_ADDRESS		0x70
1468c2ecf20Sopenharmony_ci#define DC_PAL_DATA		0x74
1478c2ecf20Sopenharmony_ci#define DC_DFIFO_DIAG		0x78
1488c2ecf20Sopenharmony_ci#define DC_CFIFO_DIAG		0x7C
1498c2ecf20Sopenharmony_ci
1508c2ecf20Sopenharmony_ci#endif /* !__DISPLAY_GX1_H__ */
151