18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci edid.S: EDID data template 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ci Copyright (C) 2012 Carsten Emde <C.Emde@osadl.org> 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci This program is free software; you can redistribute it and/or 78c2ecf20Sopenharmony_ci modify it under the terms of the GNU General Public License 88c2ecf20Sopenharmony_ci as published by the Free Software Foundation; either version 2 98c2ecf20Sopenharmony_ci of the License, or (at your option) any later version. 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci This program is distributed in the hope that it will be useful, 128c2ecf20Sopenharmony_ci but WITHOUT ANY WARRANTY; without even the implied warranty of 138c2ecf20Sopenharmony_ci MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 148c2ecf20Sopenharmony_ci GNU General Public License for more details. 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci You should have received a copy of the GNU General Public License 178c2ecf20Sopenharmony_ci along with this program; if not, write to the Free Software 188c2ecf20Sopenharmony_ci Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 198c2ecf20Sopenharmony_ci*/ 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci/* Manufacturer */ 238c2ecf20Sopenharmony_ci#define MFG_LNX1 'L' 248c2ecf20Sopenharmony_ci#define MFG_LNX2 'N' 258c2ecf20Sopenharmony_ci#define MFG_LNX3 'X' 268c2ecf20Sopenharmony_ci#define SERIAL 0 278c2ecf20Sopenharmony_ci#define YEAR 2012 288c2ecf20Sopenharmony_ci#define WEEK 5 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci/* EDID 1.3 standard definitions */ 318c2ecf20Sopenharmony_ci#define XY_RATIO_16_10 0b00 328c2ecf20Sopenharmony_ci#define XY_RATIO_4_3 0b01 338c2ecf20Sopenharmony_ci#define XY_RATIO_5_4 0b10 348c2ecf20Sopenharmony_ci#define XY_RATIO_16_9 0b11 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ci/* Provide defaults for the timing bits */ 378c2ecf20Sopenharmony_ci#ifndef ESTABLISHED_TIMING1_BITS 388c2ecf20Sopenharmony_ci#define ESTABLISHED_TIMING1_BITS 0x00 398c2ecf20Sopenharmony_ci#endif 408c2ecf20Sopenharmony_ci#ifndef ESTABLISHED_TIMING2_BITS 418c2ecf20Sopenharmony_ci#define ESTABLISHED_TIMING2_BITS 0x00 428c2ecf20Sopenharmony_ci#endif 438c2ecf20Sopenharmony_ci#ifndef ESTABLISHED_TIMING3_BITS 448c2ecf20Sopenharmony_ci#define ESTABLISHED_TIMING3_BITS 0x00 458c2ecf20Sopenharmony_ci#endif 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_ci#define mfgname2id(v1,v2,v3) \ 488c2ecf20Sopenharmony_ci ((((v1-'@')&0x1f)<<10)+(((v2-'@')&0x1f)<<5)+((v3-'@')&0x1f)) 498c2ecf20Sopenharmony_ci#define swap16(v1) ((v1>>8)+((v1&0xff)<<8)) 508c2ecf20Sopenharmony_ci#define lsbs2(v1,v2) (((v1&0x0f)<<4)+(v2&0x0f)) 518c2ecf20Sopenharmony_ci#define msbs2(v1,v2) ((((v1>>8)&0x0f)<<4)+((v2>>8)&0x0f)) 528c2ecf20Sopenharmony_ci#define msbs4(v1,v2,v3,v4) \ 538c2ecf20Sopenharmony_ci ((((v1>>8)&0x03)<<6)+(((v2>>8)&0x03)<<4)+\ 548c2ecf20Sopenharmony_ci (((v3>>4)&0x03)<<2)+((v4>>4)&0x03)) 558c2ecf20Sopenharmony_ci#define pixdpi2mm(pix,dpi) ((pix*25)/dpi) 568c2ecf20Sopenharmony_ci#define xsize pixdpi2mm(XPIX,DPI) 578c2ecf20Sopenharmony_ci#define ysize pixdpi2mm(YPIX,DPI) 588c2ecf20Sopenharmony_ci 598c2ecf20Sopenharmony_ci .data 608c2ecf20Sopenharmony_ci 618c2ecf20Sopenharmony_ci/* Fixed header pattern */ 628c2ecf20Sopenharmony_ciheader: .byte 0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_cimfg_id: .hword swap16(mfgname2id(MFG_LNX1, MFG_LNX2, MFG_LNX3)) 658c2ecf20Sopenharmony_ci 668c2ecf20Sopenharmony_ciprod_code: .hword 0 678c2ecf20Sopenharmony_ci 688c2ecf20Sopenharmony_ci/* Serial number. 32 bits, little endian. */ 698c2ecf20Sopenharmony_ciserial_number: .long SERIAL 708c2ecf20Sopenharmony_ci 718c2ecf20Sopenharmony_ci/* Week of manufacture */ 728c2ecf20Sopenharmony_ciweek: .byte WEEK 738c2ecf20Sopenharmony_ci 748c2ecf20Sopenharmony_ci/* Year of manufacture, less 1990. (1990-2245) 758c2ecf20Sopenharmony_ci If week=255, it is the model year instead */ 768c2ecf20Sopenharmony_ciyear: .byte YEAR-1990 778c2ecf20Sopenharmony_ci 788c2ecf20Sopenharmony_civersion: .byte VERSION /* EDID version, usually 1 (for 1.3) */ 798c2ecf20Sopenharmony_cirevision: .byte REVISION /* EDID revision, usually 3 (for 1.3) */ 808c2ecf20Sopenharmony_ci 818c2ecf20Sopenharmony_ci/* If Bit 7=1 Digital input. If set, the following bit definitions apply: 828c2ecf20Sopenharmony_ci Bits 6-1 Reserved, must be 0 838c2ecf20Sopenharmony_ci Bit 0 Signal is compatible with VESA DFP 1.x TMDS CRGB, 848c2ecf20Sopenharmony_ci 1 pixel per clock, up to 8 bits per color, MSB aligned, 858c2ecf20Sopenharmony_ci If Bit 7=0 Analog input. If clear, the following bit definitions apply: 868c2ecf20Sopenharmony_ci Bits 6-5 Video white and sync levels, relative to blank 878c2ecf20Sopenharmony_ci 00=+0.7/-0.3 V; 01=+0.714/-0.286 V; 888c2ecf20Sopenharmony_ci 10=+1.0/-0.4 V; 11=+0.7/0 V 898c2ecf20Sopenharmony_ci Bit 4 Blank-to-black setup (pedestal) expected 908c2ecf20Sopenharmony_ci Bit 3 Separate sync supported 918c2ecf20Sopenharmony_ci Bit 2 Composite sync (on HSync) supported 928c2ecf20Sopenharmony_ci Bit 1 Sync on green supported 938c2ecf20Sopenharmony_ci Bit 0 VSync pulse must be serrated when somposite or 948c2ecf20Sopenharmony_ci sync-on-green is used. */ 958c2ecf20Sopenharmony_civideo_parms: .byte 0x6d 968c2ecf20Sopenharmony_ci 978c2ecf20Sopenharmony_ci/* Maximum horizontal image size, in centimetres 988c2ecf20Sopenharmony_ci (max 292 cm/115 in at 16:9 aspect ratio) */ 998c2ecf20Sopenharmony_cimax_hor_size: .byte xsize/10 1008c2ecf20Sopenharmony_ci 1018c2ecf20Sopenharmony_ci/* Maximum vertical image size, in centimetres. 1028c2ecf20Sopenharmony_ci If either byte is 0, undefined (e.g. projector) */ 1038c2ecf20Sopenharmony_cimax_vert_size: .byte ysize/10 1048c2ecf20Sopenharmony_ci 1058c2ecf20Sopenharmony_ci/* Display gamma, minus 1, times 100 (range 1.00-3.5 */ 1068c2ecf20Sopenharmony_cigamma: .byte 120 1078c2ecf20Sopenharmony_ci 1088c2ecf20Sopenharmony_ci/* Bit 7 DPMS standby supported 1098c2ecf20Sopenharmony_ci Bit 6 DPMS suspend supported 1108c2ecf20Sopenharmony_ci Bit 5 DPMS active-off supported 1118c2ecf20Sopenharmony_ci Bits 4-3 Display type: 00=monochrome; 01=RGB colour; 1128c2ecf20Sopenharmony_ci 10=non-RGB multicolour; 11=undefined 1138c2ecf20Sopenharmony_ci Bit 2 Standard sRGB colour space. Bytes 25-34 must contain 1148c2ecf20Sopenharmony_ci sRGB standard values. 1158c2ecf20Sopenharmony_ci Bit 1 Preferred timing mode specified in descriptor block 1. 1168c2ecf20Sopenharmony_ci Bit 0 GTF supported with default parameter values. */ 1178c2ecf20Sopenharmony_cidsp_features: .byte 0xea 1188c2ecf20Sopenharmony_ci 1198c2ecf20Sopenharmony_ci/* Chromaticity coordinates. */ 1208c2ecf20Sopenharmony_ci/* Red and green least-significant bits 1218c2ecf20Sopenharmony_ci Bits 7-6 Red x value least-significant 2 bits 1228c2ecf20Sopenharmony_ci Bits 5-4 Red y value least-significant 2 bits 1238c2ecf20Sopenharmony_ci Bits 3-2 Green x value lst-significant 2 bits 1248c2ecf20Sopenharmony_ci Bits 1-0 Green y value least-significant 2 bits */ 1258c2ecf20Sopenharmony_cired_green_lsb: .byte 0x5e 1268c2ecf20Sopenharmony_ci 1278c2ecf20Sopenharmony_ci/* Blue and white least-significant 2 bits */ 1288c2ecf20Sopenharmony_ciblue_white_lsb: .byte 0xc0 1298c2ecf20Sopenharmony_ci 1308c2ecf20Sopenharmony_ci/* Red x value most significant 8 bits. 1318c2ecf20Sopenharmony_ci 0-255 encodes 0-0.996 (255/256); 0-0.999 (1023/1024) with lsbits */ 1328c2ecf20Sopenharmony_cired_x_msb: .byte 0xa4 1338c2ecf20Sopenharmony_ci 1348c2ecf20Sopenharmony_ci/* Red y value most significant 8 bits */ 1358c2ecf20Sopenharmony_cired_y_msb: .byte 0x59 1368c2ecf20Sopenharmony_ci 1378c2ecf20Sopenharmony_ci/* Green x and y value most significant 8 bits */ 1388c2ecf20Sopenharmony_cigreen_x_y_msb: .byte 0x4a,0x98 1398c2ecf20Sopenharmony_ci 1408c2ecf20Sopenharmony_ci/* Blue x and y value most significant 8 bits */ 1418c2ecf20Sopenharmony_ciblue_x_y_msb: .byte 0x25,0x20 1428c2ecf20Sopenharmony_ci 1438c2ecf20Sopenharmony_ci/* Default white point x and y value most significant 8 bits */ 1448c2ecf20Sopenharmony_ciwhite_x_y_msb: .byte 0x50,0x54 1458c2ecf20Sopenharmony_ci 1468c2ecf20Sopenharmony_ci/* Established timings */ 1478c2ecf20Sopenharmony_ci/* Bit 7 720x400 @ 70 Hz 1488c2ecf20Sopenharmony_ci Bit 6 720x400 @ 88 Hz 1498c2ecf20Sopenharmony_ci Bit 5 640x480 @ 60 Hz 1508c2ecf20Sopenharmony_ci Bit 4 640x480 @ 67 Hz 1518c2ecf20Sopenharmony_ci Bit 3 640x480 @ 72 Hz 1528c2ecf20Sopenharmony_ci Bit 2 640x480 @ 75 Hz 1538c2ecf20Sopenharmony_ci Bit 1 800x600 @ 56 Hz 1548c2ecf20Sopenharmony_ci Bit 0 800x600 @ 60 Hz */ 1558c2ecf20Sopenharmony_ciestbl_timing1: .byte ESTABLISHED_TIMING1_BITS 1568c2ecf20Sopenharmony_ci 1578c2ecf20Sopenharmony_ci/* Bit 7 800x600 @ 72 Hz 1588c2ecf20Sopenharmony_ci Bit 6 800x600 @ 75 Hz 1598c2ecf20Sopenharmony_ci Bit 5 832x624 @ 75 Hz 1608c2ecf20Sopenharmony_ci Bit 4 1024x768 @ 87 Hz, interlaced (1024x768) 1618c2ecf20Sopenharmony_ci Bit 3 1024x768 @ 60 Hz 1628c2ecf20Sopenharmony_ci Bit 2 1024x768 @ 72 Hz 1638c2ecf20Sopenharmony_ci Bit 1 1024x768 @ 75 Hz 1648c2ecf20Sopenharmony_ci Bit 0 1280x1024 @ 75 Hz */ 1658c2ecf20Sopenharmony_ciestbl_timing2: .byte ESTABLISHED_TIMING2_BITS 1668c2ecf20Sopenharmony_ci 1678c2ecf20Sopenharmony_ci/* Bit 7 1152x870 @ 75 Hz (Apple Macintosh II) 1688c2ecf20Sopenharmony_ci Bits 6-0 Other manufacturer-specific display mod */ 1698c2ecf20Sopenharmony_ciestbl_timing3: .byte ESTABLISHED_TIMING3_BITS 1708c2ecf20Sopenharmony_ci 1718c2ecf20Sopenharmony_ci/* Standard timing */ 1728c2ecf20Sopenharmony_ci/* X resolution, less 31, divided by 8 (256-2288 pixels) */ 1738c2ecf20Sopenharmony_cistd_xres: .byte (XPIX/8)-31 1748c2ecf20Sopenharmony_ci/* Y resolution, X:Y pixel ratio 1758c2ecf20Sopenharmony_ci Bits 7-6 X:Y pixel ratio: 00=16:10; 01=4:3; 10=5:4; 11=16:9. 1768c2ecf20Sopenharmony_ci Bits 5-0 Vertical frequency, less 60 (60-123 Hz) */ 1778c2ecf20Sopenharmony_cistd_vres: .byte (XY_RATIO<<6)+VFREQ-60 1788c2ecf20Sopenharmony_ci .fill 7,2,0x0101 /* Unused */ 1798c2ecf20Sopenharmony_ci 1808c2ecf20Sopenharmony_cidescriptor1: 1818c2ecf20Sopenharmony_ci/* Pixel clock in 10 kHz units. (0.-655.35 MHz, little-endian) */ 1828c2ecf20Sopenharmony_ciclock: .hword CLOCK/10 1838c2ecf20Sopenharmony_ci 1848c2ecf20Sopenharmony_ci/* Horizontal active pixels 8 lsbits (0-4095) */ 1858c2ecf20Sopenharmony_cix_act_lsb: .byte XPIX&0xff 1868c2ecf20Sopenharmony_ci/* Horizontal blanking pixels 8 lsbits (0-4095) 1878c2ecf20Sopenharmony_ci End of active to start of next active. */ 1888c2ecf20Sopenharmony_cix_blk_lsb: .byte XBLANK&0xff 1898c2ecf20Sopenharmony_ci/* Bits 7-4 Horizontal active pixels 4 msbits 1908c2ecf20Sopenharmony_ci Bits 3-0 Horizontal blanking pixels 4 msbits */ 1918c2ecf20Sopenharmony_cix_msbs: .byte msbs2(XPIX,XBLANK) 1928c2ecf20Sopenharmony_ci 1938c2ecf20Sopenharmony_ci/* Vertical active lines 8 lsbits (0-4095) */ 1948c2ecf20Sopenharmony_ciy_act_lsb: .byte YPIX&0xff 1958c2ecf20Sopenharmony_ci/* Vertical blanking lines 8 lsbits (0-4095) */ 1968c2ecf20Sopenharmony_ciy_blk_lsb: .byte YBLANK&0xff 1978c2ecf20Sopenharmony_ci/* Bits 7-4 Vertical active lines 4 msbits 1988c2ecf20Sopenharmony_ci Bits 3-0 Vertical blanking lines 4 msbits */ 1998c2ecf20Sopenharmony_ciy_msbs: .byte msbs2(YPIX,YBLANK) 2008c2ecf20Sopenharmony_ci 2018c2ecf20Sopenharmony_ci/* Horizontal sync offset pixels 8 lsbits (0-1023) From blanking start */ 2028c2ecf20Sopenharmony_cix_snc_off_lsb: .byte XOFFSET&0xff 2038c2ecf20Sopenharmony_ci/* Horizontal sync pulse width pixels 8 lsbits (0-1023) */ 2048c2ecf20Sopenharmony_cix_snc_pls_lsb: .byte XPULSE&0xff 2058c2ecf20Sopenharmony_ci/* Bits 7-4 Vertical sync offset lines 4 lsbits (0-63) 2068c2ecf20Sopenharmony_ci Bits 3-0 Vertical sync pulse width lines 4 lsbits (0-63) */ 2078c2ecf20Sopenharmony_ciy_snc_lsb: .byte lsbs2(YOFFSET, YPULSE) 2088c2ecf20Sopenharmony_ci/* Bits 7-6 Horizontal sync offset pixels 2 msbits 2098c2ecf20Sopenharmony_ci Bits 5-4 Horizontal sync pulse width pixels 2 msbits 2108c2ecf20Sopenharmony_ci Bits 3-2 Vertical sync offset lines 2 msbits 2118c2ecf20Sopenharmony_ci Bits 1-0 Vertical sync pulse width lines 2 msbits */ 2128c2ecf20Sopenharmony_cixy_snc_msbs: .byte msbs4(XOFFSET,XPULSE,YOFFSET,YPULSE) 2138c2ecf20Sopenharmony_ci 2148c2ecf20Sopenharmony_ci/* Horizontal display size, mm, 8 lsbits (0-4095 mm, 161 in) */ 2158c2ecf20Sopenharmony_cix_dsp_size: .byte xsize&0xff 2168c2ecf20Sopenharmony_ci 2178c2ecf20Sopenharmony_ci/* Vertical display size, mm, 8 lsbits (0-4095 mm, 161 in) */ 2188c2ecf20Sopenharmony_ciy_dsp_size: .byte ysize&0xff 2198c2ecf20Sopenharmony_ci 2208c2ecf20Sopenharmony_ci/* Bits 7-4 Horizontal display size, mm, 4 msbits 2218c2ecf20Sopenharmony_ci Bits 3-0 Vertical display size, mm, 4 msbits */ 2228c2ecf20Sopenharmony_cidsp_size_mbsb: .byte msbs2(xsize,ysize) 2238c2ecf20Sopenharmony_ci 2248c2ecf20Sopenharmony_ci/* Horizontal border pixels (each side; total is twice this) */ 2258c2ecf20Sopenharmony_cix_border: .byte 0 2268c2ecf20Sopenharmony_ci/* Vertical border lines (each side; total is twice this) */ 2278c2ecf20Sopenharmony_ciy_border: .byte 0 2288c2ecf20Sopenharmony_ci 2298c2ecf20Sopenharmony_ci/* Bit 7 Interlaced 2308c2ecf20Sopenharmony_ci Bits 6-5 Stereo mode: 00=No stereo; other values depend on bit 0: 2318c2ecf20Sopenharmony_ci Bit 0=0: 01=Field sequential, sync=1 during right; 10=similar, 2328c2ecf20Sopenharmony_ci sync=1 during left; 11=4-way interleaved stereo 2338c2ecf20Sopenharmony_ci Bit 0=1 2-way interleaved stereo: 01=Right image on even lines; 2348c2ecf20Sopenharmony_ci 10=Left image on even lines; 11=side-by-side 2358c2ecf20Sopenharmony_ci Bits 4-3 Sync type: 00=Analog composite; 01=Bipolar analog composite; 2368c2ecf20Sopenharmony_ci 10=Digital composite (on HSync); 11=Digital separate 2378c2ecf20Sopenharmony_ci Bit 2 If digital separate: Vertical sync polarity (1=positive) 2388c2ecf20Sopenharmony_ci Other types: VSync serrated (HSync during VSync) 2398c2ecf20Sopenharmony_ci Bit 1 If analog sync: Sync on all 3 RGB lines (else green only) 2408c2ecf20Sopenharmony_ci Digital: HSync polarity (1=positive) 2418c2ecf20Sopenharmony_ci Bit 0 2-way line-interleaved stereo, if bits 4-3 are not 00. */ 2428c2ecf20Sopenharmony_cifeatures: .byte 0x18+(VSYNC_POL<<2)+(HSYNC_POL<<1) 2438c2ecf20Sopenharmony_ci 2448c2ecf20Sopenharmony_cidescriptor2: .byte 0,0 /* Not a detailed timing descriptor */ 2458c2ecf20Sopenharmony_ci .byte 0 /* Must be zero */ 2468c2ecf20Sopenharmony_ci .byte 0xff /* Descriptor is monitor serial number (text) */ 2478c2ecf20Sopenharmony_ci .byte 0 /* Must be zero */ 2488c2ecf20Sopenharmony_cistart1: .ascii "Linux #0" 2498c2ecf20Sopenharmony_ciend1: .byte 0x0a /* End marker */ 2508c2ecf20Sopenharmony_ci .fill 12-(end1-start1), 1, 0x20 /* Padded spaces */ 2518c2ecf20Sopenharmony_cidescriptor3: .byte 0,0 /* Not a detailed timing descriptor */ 2528c2ecf20Sopenharmony_ci .byte 0 /* Must be zero */ 2538c2ecf20Sopenharmony_ci .byte 0xfd /* Descriptor is monitor range limits */ 2548c2ecf20Sopenharmony_ci .byte 0 /* Must be zero */ 2558c2ecf20Sopenharmony_cistart2: .byte VFREQ-1 /* Minimum vertical field rate (1-255 Hz) */ 2568c2ecf20Sopenharmony_ci .byte VFREQ+1 /* Maximum vertical field rate (1-255 Hz) */ 2578c2ecf20Sopenharmony_ci .byte (CLOCK/(XPIX+XBLANK))-1 /* Minimum horizontal line rate 2588c2ecf20Sopenharmony_ci (1-255 kHz) */ 2598c2ecf20Sopenharmony_ci .byte (CLOCK/(XPIX+XBLANK))+1 /* Maximum horizontal line rate 2608c2ecf20Sopenharmony_ci (1-255 kHz) */ 2618c2ecf20Sopenharmony_ci .byte (CLOCK/10000)+1 /* Maximum pixel clock rate, rounded up 2628c2ecf20Sopenharmony_ci to 10 MHz multiple (10-2550 MHz) */ 2638c2ecf20Sopenharmony_ci .byte 0 /* No extended timing information type */ 2648c2ecf20Sopenharmony_ciend2: .byte 0x0a /* End marker */ 2658c2ecf20Sopenharmony_ci .fill 12-(end2-start2), 1, 0x20 /* Padded spaces */ 2668c2ecf20Sopenharmony_cidescriptor4: .byte 0,0 /* Not a detailed timing descriptor */ 2678c2ecf20Sopenharmony_ci .byte 0 /* Must be zero */ 2688c2ecf20Sopenharmony_ci .byte 0xfc /* Descriptor is text */ 2698c2ecf20Sopenharmony_ci .byte 0 /* Must be zero */ 2708c2ecf20Sopenharmony_cistart3: .ascii TIMING_NAME 2718c2ecf20Sopenharmony_ciend3: .byte 0x0a /* End marker */ 2728c2ecf20Sopenharmony_ci .fill 12-(end3-start3), 1, 0x20 /* Padded spaces */ 2738c2ecf20Sopenharmony_ciextensions: .byte 0 /* Number of extensions to follow */ 2748c2ecf20Sopenharmony_cichecksum: .byte CRC /* Sum of all bytes must be 0 */ 275