18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved. 48c2ecf20Sopenharmony_ci * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved. 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci */ 78c2ecf20Sopenharmony_ci#ifndef __CHIP_H__ 88c2ecf20Sopenharmony_ci#define __CHIP_H__ 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci#include "global.h" 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci/***************************************/ 138c2ecf20Sopenharmony_ci/* Definition Graphic Chip Information */ 148c2ecf20Sopenharmony_ci/***************************************/ 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci#define PCI_VIA_VENDOR_ID 0x1106 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci/* Define VIA Graphic Chip Name */ 198c2ecf20Sopenharmony_ci#define UNICHROME_CLE266 1 208c2ecf20Sopenharmony_ci#define UNICHROME_CLE266_DID 0x3122 218c2ecf20Sopenharmony_ci#define CLE266_REVISION_AX 0x0A 228c2ecf20Sopenharmony_ci#define CLE266_REVISION_CX 0x0C 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci#define UNICHROME_K400 2 258c2ecf20Sopenharmony_ci#define UNICHROME_K400_DID 0x7205 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci#define UNICHROME_K800 3 288c2ecf20Sopenharmony_ci#define UNICHROME_K800_DID 0x3108 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci#define UNICHROME_PM800 4 318c2ecf20Sopenharmony_ci#define UNICHROME_PM800_DID 0x3118 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci#define UNICHROME_CN700 5 348c2ecf20Sopenharmony_ci#define UNICHROME_CN700_DID 0x3344 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ci#define UNICHROME_CX700 6 378c2ecf20Sopenharmony_ci#define UNICHROME_CX700_DID 0x3157 388c2ecf20Sopenharmony_ci#define CX700_REVISION_700 0x0 398c2ecf20Sopenharmony_ci#define CX700_REVISION_700M 0x1 408c2ecf20Sopenharmony_ci#define CX700_REVISION_700M2 0x2 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_ci#define UNICHROME_CN750 7 438c2ecf20Sopenharmony_ci#define UNICHROME_CN750_DID 0x3225 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ci#define UNICHROME_K8M890 8 468c2ecf20Sopenharmony_ci#define UNICHROME_K8M890_DID 0x3230 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_ci#define UNICHROME_P4M890 9 498c2ecf20Sopenharmony_ci#define UNICHROME_P4M890_DID 0x3343 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_ci#define UNICHROME_P4M900 10 528c2ecf20Sopenharmony_ci#define UNICHROME_P4M900_DID 0x3371 538c2ecf20Sopenharmony_ci 548c2ecf20Sopenharmony_ci#define UNICHROME_VX800 11 558c2ecf20Sopenharmony_ci#define UNICHROME_VX800_DID 0x1122 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_ci#define UNICHROME_VX855 12 588c2ecf20Sopenharmony_ci#define UNICHROME_VX855_DID 0x5122 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_ci#define UNICHROME_VX900 13 618c2ecf20Sopenharmony_ci#define UNICHROME_VX900_DID 0x7122 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_ci/**************************************************/ 648c2ecf20Sopenharmony_ci/* Definition TMDS Trasmitter Information */ 658c2ecf20Sopenharmony_ci/**************************************************/ 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_ci/* Definition TMDS Trasmitter Index */ 688c2ecf20Sopenharmony_ci#define NON_TMDS_TRANSMITTER 0x00 698c2ecf20Sopenharmony_ci#define VT1632_TMDS 0x01 708c2ecf20Sopenharmony_ci#define INTEGRATED_TMDS 0x42 718c2ecf20Sopenharmony_ci 728c2ecf20Sopenharmony_ci/* Definition TMDS Trasmitter I2C Slave Address */ 738c2ecf20Sopenharmony_ci#define VT1632_TMDS_I2C_ADDR 0x10 748c2ecf20Sopenharmony_ci 758c2ecf20Sopenharmony_ci/**************************************************/ 768c2ecf20Sopenharmony_ci/* Definition LVDS Trasmitter Information */ 778c2ecf20Sopenharmony_ci/**************************************************/ 788c2ecf20Sopenharmony_ci 798c2ecf20Sopenharmony_ci/* Definition LVDS Trasmitter Index */ 808c2ecf20Sopenharmony_ci#define NON_LVDS_TRANSMITTER 0x00 818c2ecf20Sopenharmony_ci#define VT1631_LVDS 0x01 828c2ecf20Sopenharmony_ci#define VT1636_LVDS 0x0E 838c2ecf20Sopenharmony_ci#define INTEGRATED_LVDS 0x41 848c2ecf20Sopenharmony_ci 858c2ecf20Sopenharmony_ci/* Definition Digital Transmitter Mode */ 868c2ecf20Sopenharmony_ci#define TX_DATA_12_BITS 0x01 878c2ecf20Sopenharmony_ci#define TX_DATA_24_BITS 0x02 888c2ecf20Sopenharmony_ci#define TX_DATA_DDR_MODE 0x04 898c2ecf20Sopenharmony_ci#define TX_DATA_SDR_MODE 0x08 908c2ecf20Sopenharmony_ci 918c2ecf20Sopenharmony_ci/* Definition LVDS Trasmitter I2C Slave Address */ 928c2ecf20Sopenharmony_ci#define VT1631_LVDS_I2C_ADDR 0x70 938c2ecf20Sopenharmony_ci#define VT3271_LVDS_I2C_ADDR 0x80 948c2ecf20Sopenharmony_ci#define VT1636_LVDS_I2C_ADDR 0x80 958c2ecf20Sopenharmony_ci 968c2ecf20Sopenharmony_cistruct tmds_chip_information { 978c2ecf20Sopenharmony_ci int tmds_chip_name; 988c2ecf20Sopenharmony_ci int tmds_chip_slave_addr; 998c2ecf20Sopenharmony_ci int output_interface; 1008c2ecf20Sopenharmony_ci int i2c_port; 1018c2ecf20Sopenharmony_ci}; 1028c2ecf20Sopenharmony_ci 1038c2ecf20Sopenharmony_cistruct lvds_chip_information { 1048c2ecf20Sopenharmony_ci int lvds_chip_name; 1058c2ecf20Sopenharmony_ci int lvds_chip_slave_addr; 1068c2ecf20Sopenharmony_ci int output_interface; 1078c2ecf20Sopenharmony_ci int i2c_port; 1088c2ecf20Sopenharmony_ci}; 1098c2ecf20Sopenharmony_ci 1108c2ecf20Sopenharmony_ci/* The type of 2D engine */ 1118c2ecf20Sopenharmony_cienum via_2d_engine { 1128c2ecf20Sopenharmony_ci VIA_2D_ENG_H2, 1138c2ecf20Sopenharmony_ci VIA_2D_ENG_H5, 1148c2ecf20Sopenharmony_ci VIA_2D_ENG_M1, 1158c2ecf20Sopenharmony_ci}; 1168c2ecf20Sopenharmony_ci 1178c2ecf20Sopenharmony_cistruct chip_information { 1188c2ecf20Sopenharmony_ci int gfx_chip_name; 1198c2ecf20Sopenharmony_ci int gfx_chip_revision; 1208c2ecf20Sopenharmony_ci enum via_2d_engine twod_engine; 1218c2ecf20Sopenharmony_ci struct tmds_chip_information tmds_chip_info; 1228c2ecf20Sopenharmony_ci struct lvds_chip_information lvds_chip_info; 1238c2ecf20Sopenharmony_ci struct lvds_chip_information lvds_chip_info2; 1248c2ecf20Sopenharmony_ci}; 1258c2ecf20Sopenharmony_ci 1268c2ecf20Sopenharmony_cistruct tmds_setting_information { 1278c2ecf20Sopenharmony_ci int iga_path; 1288c2ecf20Sopenharmony_ci int h_active; 1298c2ecf20Sopenharmony_ci int v_active; 1308c2ecf20Sopenharmony_ci int max_pixel_clock; 1318c2ecf20Sopenharmony_ci}; 1328c2ecf20Sopenharmony_ci 1338c2ecf20Sopenharmony_cistruct lvds_setting_information { 1348c2ecf20Sopenharmony_ci int iga_path; 1358c2ecf20Sopenharmony_ci int lcd_panel_hres; 1368c2ecf20Sopenharmony_ci int lcd_panel_vres; 1378c2ecf20Sopenharmony_ci int display_method; 1388c2ecf20Sopenharmony_ci int device_lcd_dualedge; 1398c2ecf20Sopenharmony_ci int LCDDithering; 1408c2ecf20Sopenharmony_ci int lcd_mode; 1418c2ecf20Sopenharmony_ci u32 vclk; /*panel mode clock value */ 1428c2ecf20Sopenharmony_ci}; 1438c2ecf20Sopenharmony_ci 1448c2ecf20Sopenharmony_cistruct GFX_DPA_SETTING { 1458c2ecf20Sopenharmony_ci int ClkRangeIndex; 1468c2ecf20Sopenharmony_ci u8 DVP0; /* CR96[3:0] */ 1478c2ecf20Sopenharmony_ci u8 DVP0DataDri_S1; /* SR2A[5] */ 1488c2ecf20Sopenharmony_ci u8 DVP0DataDri_S; /* SR1B[1] */ 1498c2ecf20Sopenharmony_ci u8 DVP0ClockDri_S1; /* SR2A[4] */ 1508c2ecf20Sopenharmony_ci u8 DVP0ClockDri_S; /* SR1E[2] */ 1518c2ecf20Sopenharmony_ci u8 DVP1; /* CR9B[3:0] */ 1528c2ecf20Sopenharmony_ci u8 DVP1Driving; /* SR65[3:0], Data and Clock driving */ 1538c2ecf20Sopenharmony_ci u8 DFPHigh; /* CR97[3:0] */ 1548c2ecf20Sopenharmony_ci u8 DFPLow; /* CR99[3:0] */ 1558c2ecf20Sopenharmony_ci 1568c2ecf20Sopenharmony_ci}; 1578c2ecf20Sopenharmony_ci 1588c2ecf20Sopenharmony_cistruct VT1636_DPA_SETTING { 1598c2ecf20Sopenharmony_ci u8 CLK_SEL_ST1; 1608c2ecf20Sopenharmony_ci u8 CLK_SEL_ST2; 1618c2ecf20Sopenharmony_ci}; 1628c2ecf20Sopenharmony_ci#endif /* __CHIP_H__ */ 163