Path: blob/main/sys/arm/nvidia/drm2/tegra_dc_reg.h
39482 views
/*-1* Copyright 1992-2015 Michal Meloun2* All rights reserved.3*4* Redistribution and use in source and binary forms, with or without5* modification, are permitted provided that the following conditions6* are met:7* 1. Redistributions of source code must retain the above copyright8* notice, this list of conditions and the following disclaimer.9* 2. Redistributions in binary form must reproduce the above copyright10* notice, this list of conditions and the following disclaimer in the11* documentation and/or other materials provided with the distribution.12*13* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND14* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE15* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE16* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE17* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL18* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS19* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)20* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT21* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY22* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF23* SUCH DAMAGE.24*/25#ifndef _TEGRA_DC_REG_H_26#define _TEGRA_DC_REG_H_2728/*29* !!! WARNING !!!30* Tegra manual uses registers index (and not register addreses).31* We follow the TRM notation and index is converted to offset in32* WR4 / RD4 macros33*/3435/* --------------------------- DC CMD -------------------------------------- */36#define DC_CMD_GENERAL_INCR_SYNCPT 0x00037#define DC_CMD_GENERAL_INCR_SYNCPT_CNTRL 0x00138#define SYNCPT_CNTRL_NO_STALL (1 << 8)39#define SYNCPT_CNTRL_SOFT_RESET (1 << 0)4041#define DC_CMD_GENERAL_INCR_SYNCPT_ERROR 0x00242#define DC_CMD_WIN_A_INCR_SYNCPT 0x00843#define DC_CMD_WIN_A_INCR_SYNCPT_CNTRL 0x00944#define DC_CMD_WIN_A_INCR_SYNCPT_ERROR 0x00a45#define DC_CMD_WIN_B_INCR_SYNCPT 0x01046#define DC_CMD_WIN_B_INCR_SYNCPT_CNTRL 0x01147#define DC_CMD_WIN_B_INCR_SYNCPT_ERROR 0x01248#define DC_CMD_WIN_C_INCR_SYNCPT 0x01849#define DC_CMD_WIN_C_INCR_SYNCPT_CNTRL 0x01950#define DC_CMD_WIN_C_INCR_SYNCPT_ERROR 0x01a51#define DC_CMD_CONT_SYNCPT_VSYNC 0x02852#define SYNCPT_VSYNC_ENABLE (1 << 8)5354#define DC_CMD_CTXSW 0x03055#define DC_CMD_DISPLAY_COMMAND_OPTION0 0x03156#define DC_CMD_DISPLAY_COMMAND 0x03257#define DISPLAY_CTRL_MODE(x) ((x) << 5)58#define CTRL_MODE_STOP 059#define CTRL_MODE_C_DISPLAY 160#define CTRL_MODE_NC_DISPLAY 26162#define DC_CMD_SIGNAL_RAISE 0x03363#define DC_CMD_DISPLAY_POWER_CONTROL 0x03664#define PM1_ENABLE (1 << 18)65#define PM0_ENABLE (1 << 16)66#define PW4_ENABLE (1 << 8)67#define PW3_ENABLE (1 << 6)68#define PW2_ENABLE (1 << 4)69#define PW1_ENABLE (1 << 2)70#define PW0_ENABLE (1 << 0)7172#define DC_CMD_INT_STATUS 0x03773#define DC_CMD_INT_MASK 0x03874#define DC_CMD_INT_ENABLE 0x03975#define DC_CMD_INT_TYPE 0x03a76#define DC_CMD_INT_POLARITY 0x03b77#define WIN_T_UF_INT (1 << 25)78#define WIN_D_UF_INT (1 << 24)79#define HC_UF_INT (1 << 23)80#define CMU_LUT_CONFLICT_INT (1 << 22)81#define WIN_C_OF_INT (1 << 16)82#define WIN_B_OF_INT (1 << 15)83#define WIN_A_OF_INT (1 << 14)84#define SSF_INT (1 << 13)85#define MSF_INT (1 << 12)86#define WIN_C_UF_INT (1 << 10)87#define WIN_B_UF_INT (1 << 9)88#define WIN_A_UF_INT (1 << 8)89#define SPI_BUSY_INT (1 << 6)90#define V_PULSE2_INT (1 << 5)91#define V_PULSE3_INT (1 << 4)92#define HBLANK_INT (1 << 3)93#define VBLANK_INT (1 << 2)94#define FRAME_END_INT (1 << 1)9596#define DC_CMD_STATE_ACCESS 0x04097#define WRITE_MUX (1 << 2)98#define READ_MUX (1 << 0)99100#define DC_CMD_STATE_CONTROL 0x041101#define NC_HOST_TRIG (1 << 24)102#define CURSOR_UPDATE (1 << 15)103#define WIN_C_UPDATE (1 << 11)104#define WIN_B_UPDATE (1 << 10)105#define WIN_A_UPDATE (1 << 9)106#define WIN_UPDATE(x) (1 << (9 + (x)))107#define GENERAL_UPDATE (1 << 8)108#define CURSOR_ACT_REQ (1 << 7)109#define WIN_D_ACT_REQ (1 << 4)110#define WIN_C_ACT_REQ (1 << 3)111#define WIN_B_ACT_REQ (1 << 2)112#define WIN_A_ACT_REQ (1 << 1)113#define WIN_ACT_REQ(x) (1 << (1 + (x)))114#define GENERAL_ACT_REQ (1 << 0)115116#define DC_CMD_DISPLAY_WINDOW_HEADER 0x042117#define WINDOW_D_SELECT (1 << 7)118#define WINDOW_C_SELECT (1 << 6)119#define WINDOW_B_SELECT (1 << 5)120#define WINDOW_A_SELECT (1 << 4)121#define WINDOW_SELECT(x) (1 << (4 + (x)))122123#define DC_CMD_REG_ACT_CONTROL 0x043124#define DC_CMD_WIN_D_INCR_SYNCPT 0x04c125#define DC_CMD_WIN_D_INCR_SYNCPT_CNTRL 0x04d126#define DC_CMD_WIN_D_INCR_SYNCPT_ERROR 0x04e127128/* ---------------------------- DC COM ------------------------------------- */129130/* --------------------------- DC DISP ------------------------------------- */131132#define DC_DISP_DISP_SIGNAL_OPTIONS0 0x400133#define M1_ENABLE (1 << 26)134#define M0_ENABLE (1 << 24)135#define V_PULSE2_ENABLE (1 << 18)136#define V_PULSE1_ENABLE (1 << 16)137#define V_PULSE0_ENABLE (1 << 14)138#define H_PULSE2_ENABLE (1 << 12)139#define H_PULSE1_ENABLE (1 << 10)140#define H_PULSE0_ENABLE (1 << 8)141142#define DC_DISP_DISP_SIGNAL_OPTIONS1 0x401143144#define DC_DISP_DISP_WIN_OPTIONS 0x402145#define HDMI_ENABLE (1 << 30)146#define DSI_ENABLE (1 << 29)147#define SOR1_TIMING_CYA (1 << 27)148#define SOR1_ENABLE (1 << 26)149#define SOR_ENABLE (1 << 25)150#define CURSOR_ENABLE (1 << 16)151152#define DC_DISP_DISP_TIMING_OPTIONS 0x405153#define VSYNC_H_POSITION(x) (((x) & 0xfff) << 0)154155#define DC_DISP_REF_TO_SYNC 0x406156#define DC_DISP_SYNC_WIDTH 0x407157#define DC_DISP_BACK_PORCH 0x408158#define DC_DISP_DISP_ACTIVE 0x409159#define DC_DISP_FRONT_PORCH 0x40a160#define DC_DISP_H_PULSE0_CONTROL 0x40b161#define DC_DISP_H_PULSE0_POSITION_A 0x40c162#define DC_DISP_H_PULSE0_POSITION_B 0x40d163#define DC_DISP_H_PULSE0_POSITION_C 0x40e164#define DC_DISP_H_PULSE0_POSITION_D 0x40f165#define DC_DISP_H_PULSE1_CONTROL 0x410166#define DC_DISP_H_PULSE1_POSITION_A 0x411167#define DC_DISP_H_PULSE1_POSITION_B 0x412168#define DC_DISP_H_PULSE1_POSITION_C 0x413169#define DC_DISP_H_PULSE1_POSITION_D 0x414170#define DC_DISP_H_PULSE2_CONTROL 0x415171#define DC_DISP_H_PULSE2_POSITION_A 0x416172#define DC_DISP_H_PULSE2_POSITION_B 0x417173#define DC_DISP_H_PULSE2_POSITION_C 0x418174#define DC_DISP_H_PULSE2_POSITION_D 0x419175#define DC_DISP_V_PULSE0_CONTROL 0x41a176#define DC_DISP_V_PULSE0_POSITION_A 0x41b177#define DC_DISP_V_PULSE0_POSITION_B 0x41c178#define DC_DISP_V_PULSE0_POSITION_C 0x41d179#define DC_DISP_V_PULSE1_CONTROL 0x41e180#define DC_DISP_V_PULSE1_POSITION_A 0x41f181#define DC_DISP_V_PULSE1_POSITION_B 0x420182#define DC_DISP_V_PULSE1_POSITION_C 0x421183#define DC_DISP_V_PULSE2_CONTROL 0x422184#define DC_DISP_V_PULSE2_POSITION_A 0x423185#define DC_DISP_V_PULSE3_CONTROL 0x424186#define PULSE_CONTROL_LAST(x) (((x) & 0x7f) << 8)187#define LAST_START_A 0188#define LAST_END_A 1189#define LAST_START_B 2190#define LAST_END_B 3191#define LAST_START_C 4192#define LAST_END_C 5193#define LAST_START_D 6194#define LAST_END_D 7195#define PULSE_CONTROL_QUAL(x) (((x) & 0x3) << 8)196#define QUAL_ALWAYS 0197#define QUAL_VACTIVE 2198#define QUAL_VACTIVE1 3199#define PULSE_POLARITY (1 << 4)200#define PULSE_MODE (1 << 3)201202#define DC_DISP_V_PULSE3_POSITION_A 0x425203#define PULSE_END(x) (((x) & 0xfff) << 16)204#define PULSE_START(x) (((x) & 0xfff) << 0)205206#define DC_DISP_DISP_CLOCK_CONTROL 0x42e207#define PIXEL_CLK_DIVIDER(x) (((x) & 0xf) << 8)208#define PCD1 0209#define PCD1H 1210#define PCD2 2211#define PCD3 3212#define PCD4 4213#define PCD6 5214#define PCD8 6215#define PCD9 7216#define PCD12 8217#define PCD16 9218#define PCD18 10219#define PCD24 11220#define PCD13 12221#define SHIFT_CLK_DIVIDER(x) ((x) & 0xff)222223#define DC_DISP_DISP_INTERFACE_CONTROL 0x42f224#define DISP_ORDER_BLUE_RED ( 1 << 9)225#define DISP_ALIGNMENT_LSB ( 1 << 8)226#define DISP_DATA_FORMAT(x) (((x) & 0xf) << 8)227#define DF1P1C 0228#define DF1P2C24B 1229#define DF1P2C18B 2230#define DF1P2C16B 3231#define DF1S 4232#define DF2S 5233#define DF3S 6234#define DFSPI 7235#define DF1P3C24B 8236#define DF2P1C18B 9237#define DFDUAL1P1C18B 10238239#define DC_DISP_DISP_COLOR_CONTROL 0x430240#define NON_BASE_COLOR (1 << 18)241#define BLANK_COLOR (1 << 17)242#define DISP_COLOR_SWAP (1 << 16)243#define ORD_DITHER_ROTATION(x) (((x) & 0x3) << 12)244#define DITHER_CONTROL(x) (((x) & 0x3) << 8)245#define DITHER_DISABLE 0246#define DITHER_ORDERED 2247#define DITHER_TEMPORAL 3248#define BASE_COLOR_SIZE(x) (((x) & 0xF) << 0)249#define SIZE_BASE666 0250#define SIZE_BASE111 1251#define SIZE_BASE222 2252#define SIZE_BASE333 3253#define SIZE_BASE444 4254#define SIZE_BASE555 5255#define SIZE_BASE565 6256#define SIZE_BASE332 7257#define SIZE_BASE888 8258259#define DC_DISP_CURSOR_START_ADDR 0x43e260#define CURSOR_CLIP(x) (((x) & 0x3) << 28)261#define CC_DISPLAY 0262#define CC_WA 1263#define CC_WB 2264#define CC_WC 3265#define CURSOR_SIZE(x) (((x) & 0x3) << 24)266#define C32x32 0267#define C64x64 1268#define C128x128 2269#define C256x256 3270#define CURSOR_START_ADDR(x) (((x) >> 10) & 0x3FFFFF)271272#define DC_DISP_CURSOR_POSITION 0x440273#define CURSOR_POSITION(h, v) ((((h) & 0x3fff) << 0) | \274(((v) & 0x3fff) << 16))275#define DC_DISP_CURSOR_UNDERFLOW_CTRL 0x4eb276#define DC_DISP_BLEND_CURSOR_CONTROL 0x4f1277#define CURSOR_MODE_SELECT (1 << 24)278#define CURSOR_DST_BLEND_FACTOR_SELECT(x) (((x) & 0x3) << 16)279#define DST_BLEND_ZERO 0280#define DST_BLEND_K1 1281#define DST_NEG_K1_TIMES_SRC 2282#define CURSOR_SRC_BLEND_FACTOR_SELECT(x) (((x) & 0x3) << 8)283#define SRC_BLEND_K1 0284#define SRC_BLEND_K1_TIMES_SRC 1285#define CURSOR_ALPHA(x) (((x) & 0xFF) << 0)286287#define DC_DISP_CURSOR_UFLOW_DBG_PIXEL 0x4f3288#define CURSOR_UFLOW_CYA (1 << 7)289#define CURSOR_UFLOW_CTRL_DBG_MODE (1 << 0)290/* --------------------------- DC WIN ------------------------------------- */291292#define DC_WINC_COLOR_PALETTE 0x500293#define DC_WINC_CSC_YOF 0x611294#define DC_WINC_CSC_KYRGB 0x612295#define DC_WINC_CSC_KUR 0x613296#define DC_WINC_CSC_KVR 0x614297#define DC_WINC_CSC_KUG 0x615298#define DC_WINC_CSC_KVG 0x616299#define DC_WINC_CSC_KUB 0x617300#define DC_WINC_CSC_KVB 0x618301302#define DC_WINC_WIN_OPTIONS 0x700303#define H_FILTER_MODE (1U << 31)304#define WIN_ENABLE (1 << 30)305#define INTERLACE_ENABLE (1 << 23)306#define YUV_RANGE_EXPAND (1 << 22)307#define DV_ENABLE (1 << 20)308#define CSC_ENABLE (1 << 18)309#define CP_ENABLE (1 << 16)310#define V_FILTER_UV_ALIGN (1 << 14)311#define V_FILTER_OPTIMIZE (1 << 12)312#define V_FILTER_ENABLE (1 << 10)313#define H_FILTER_ENABLE (1 << 8)314#define COLOR_EXPAND (1 << 6)315#define SCAN_COLUMN (1 << 4)316#define V_DIRECTION (1 << 2)317#define H_DIRECTION (1 << 0)318319#define DC_WIN_BYTE_SWAP 0x701320#define BYTE_SWAP(x) (((x) & 0x7) << 0)321#define NOSWAP 0322#define SWAP2 1323#define SWAP4 2324#define SWAP4HW 3325#define SWAP02 4326#define SWAPLEFT 5327328#define DC_WIN_COLOR_DEPTH 0x703329#define WIN_COLOR_DEPTH_P8 3330#define WIN_COLOR_DEPTH_B4G4R4A4 4331#define WIN_COLOR_DEPTH_B5G5R5A 5332#define WIN_COLOR_DEPTH_B5G6R5 6333#define WIN_COLOR_DEPTH_AB5G5R5 7334#define WIN_COLOR_DEPTH_B8G8R8A8 12335#define WIN_COLOR_DEPTH_R8G8B8A8 13336#define WIN_COLOR_DEPTH_YCbCr422 16337#define WIN_COLOR_DEPTH_YUV422 17338#define WIN_COLOR_DEPTH_YCbCr420P 18339#define WIN_COLOR_DEPTH_YUV420P 19340#define WIN_COLOR_DEPTH_YCbCr422P 20341#define WIN_COLOR_DEPTH_YUV422P 21342#define WIN_COLOR_DEPTH_YCbCr422R 22343#define WIN_COLOR_DEPTH_YUV422R 23344#define WIN_COLOR_DEPTH_YCbCr422RA 24345#define WIN_COLOR_DEPTH_YUV422RA 25346347#define DC_WIN_POSITION 0x704348#define WIN_POSITION(h, v) ((((h) & 0x1fff) << 0) | \349(((v) & 0x1fff) << 16))350351#define DC_WIN_SIZE 0x705352#define WIN_SIZE(h, v) ((((h) & 0x1fff) << 0) | \353(((v) & 0x1fff) << 16))354355#define DC_WIN_PRESCALED_SIZE 0x706356#define WIN_PRESCALED_SIZE(h, v) ((((h) & 0x7fff) << 0) | \357(((v) & 0x1fff) << 16))358359#define DC_WIN_H_INITIAL_DDA 0x707360#define DC_WIN_V_INITIAL_DDA 0x708361#define DC_WIN_DDA_INCREMENT 0x709362#define WIN_DDA_INCREMENT(h, v) ((((h) & 0xffff) << 0) | \363(((v) & 0xffff) << 16))364#define DC_WIN_LINE_STRIDE 0x70a365366/* -------------------------- DC WINBUF ------------------------------------ */367368#define DC_WINBUF_START_ADDR 0x800369#define DC_WINBUF_START_ADDR_NS 0x801370#define DC_WINBUF_START_ADDR_U 0x802371#define DC_WINBUF_START_ADDR_U_NS 0x803372#define DC_WINBUF_START_ADDR_V 0x804373#define DC_WINBUF_START_ADDR_V_NS 0x805374#define DC_WINBUF_ADDR_H_OFFSET 0x806375#define DC_WINBUF_ADDR_H_OFFSET_NS 0x807376#define DC_WINBUF_ADDR_V_OFFSET 0x808377#define DC_WINBUF_ADDR_V_OFFSET_NS 0x809378#define DC_WINBUF_UFLOW_STATUS 0x80a379#define DC_WINBUF_SURFACE_KIND 0x80b380#define SURFACE_KIND_BLOCK_HEIGHT(x) (((x) & 0x7) << 4)381#define SURFACE_KIND_PITCH 0382#define SURFACE_KIND_TILED 1383#define SURFACE_KIND_BL_16B2 2384#define DC_WINBUF_SURFACE_WEIGHT 0x80c385#define DC_WINBUF_START_ADDR_HI 0x80d386#define DC_WINBUF_START_ADDR_HI_NS 0x80e387#define DC_WINBUF_START_ADDR_U_HI 0x80f388#define DC_WINBUF_START_ADDR_U_HI_NS 0x810389#define DC_WINBUF_START_ADDR_V_HI 0x811390#define DC_WINBUF_START_ADDR_V_HI_NS 0x812391#define DC_WINBUF_UFLOW_CTRL 0x824392#define UFLOW_CTR_ENABLE (1 << 0)393#define DC_WINBUF_UFLOW_DBG_PIXEL 0x825394395#endif /* _TEGRA_DC_REG_H_ */396397398