1*efeeaefeSPaul Kocialkowski /* SPDX-License-Identifier: GPL-2.0+ */ 2*efeeaefeSPaul Kocialkowski /* 3*efeeaefeSPaul Kocialkowski * Copyright (C) 2019-2022 Bootlin 4*efeeaefeSPaul Kocialkowski * Author: Paul Kocialkowski <paul.kocialkowski@bootlin.com> 5*efeeaefeSPaul Kocialkowski * 6*efeeaefeSPaul Kocialkowski * Copyright (C) 2014 Xylon d.o.o. 7*efeeaefeSPaul Kocialkowski * Author: Davor Joja <davor.joja@logicbricks.com> 8*efeeaefeSPaul Kocialkowski */ 9*efeeaefeSPaul Kocialkowski 10*efeeaefeSPaul Kocialkowski #ifndef _LOGICVC_REGS_H_ 11*efeeaefeSPaul Kocialkowski #define _LOGICVC_REGS_H_ 12*efeeaefeSPaul Kocialkowski 13*efeeaefeSPaul Kocialkowski #define LOGICVC_DIMENSIONS_MAX (BIT(16) - 1) 14*efeeaefeSPaul Kocialkowski 15*efeeaefeSPaul Kocialkowski #define LOGICVC_HSYNC_FRONT_PORCH_REG 0x00 16*efeeaefeSPaul Kocialkowski #define LOGICVC_HSYNC_REG 0x08 17*efeeaefeSPaul Kocialkowski #define LOGICVC_HSYNC_BACK_PORCH_REG 0x10 18*efeeaefeSPaul Kocialkowski #define LOGICVC_HRES_REG 0x18 19*efeeaefeSPaul Kocialkowski #define LOGICVC_VSYNC_FRONT_PORCH_REG 0x20 20*efeeaefeSPaul Kocialkowski #define LOGICVC_VSYNC_REG 0x28 21*efeeaefeSPaul Kocialkowski #define LOGICVC_VSYNC_BACK_PORCH_REG 0x30 22*efeeaefeSPaul Kocialkowski #define LOGICVC_VRES_REG 0x38 23*efeeaefeSPaul Kocialkowski 24*efeeaefeSPaul Kocialkowski #define LOGICVC_CTRL_REG 0x40 25*efeeaefeSPaul Kocialkowski #define LOGICVC_CTRL_CLOCK_INVERT BIT(8) 26*efeeaefeSPaul Kocialkowski #define LOGICVC_CTRL_PIXEL_INVERT BIT(7) 27*efeeaefeSPaul Kocialkowski #define LOGICVC_CTRL_DE_INVERT BIT(5) 28*efeeaefeSPaul Kocialkowski #define LOGICVC_CTRL_DE_ENABLE BIT(4) 29*efeeaefeSPaul Kocialkowski #define LOGICVC_CTRL_VSYNC_INVERT BIT(3) 30*efeeaefeSPaul Kocialkowski #define LOGICVC_CTRL_VSYNC_ENABLE BIT(2) 31*efeeaefeSPaul Kocialkowski #define LOGICVC_CTRL_HSYNC_INVERT BIT(1) 32*efeeaefeSPaul Kocialkowski #define LOGICVC_CTRL_HSYNC_ENABLE BIT(0) 33*efeeaefeSPaul Kocialkowski 34*efeeaefeSPaul Kocialkowski #define LOGICVC_DTYPE_REG 0x48 35*efeeaefeSPaul Kocialkowski #define LOGICVC_BACKGROUND_COLOR_REG 0x50 36*efeeaefeSPaul Kocialkowski 37*efeeaefeSPaul Kocialkowski #define LOGICVC_BUFFER_SEL_REG 0x58 38*efeeaefeSPaul Kocialkowski #define LOGICVC_BUFFER_SEL_VALUE(i, v) \ 39*efeeaefeSPaul Kocialkowski (BIT(10 + (i)) | ((v) << (2 * (i)))) 40*efeeaefeSPaul Kocialkowski #define LOGICVC_BUFFER_SEL_MAX 2 41*efeeaefeSPaul Kocialkowski 42*efeeaefeSPaul Kocialkowski #define LOGICVC_DOUBLE_CLUT_REG 0x60 43*efeeaefeSPaul Kocialkowski 44*efeeaefeSPaul Kocialkowski #define LOGICVC_INT_STAT_REG 0x68 45*efeeaefeSPaul Kocialkowski #define LOGICVC_INT_STAT_V_SYNC BIT(5) 46*efeeaefeSPaul Kocialkowski 47*efeeaefeSPaul Kocialkowski #define LOGICVC_INT_MASK_REG 0x70 48*efeeaefeSPaul Kocialkowski #define LOGICVC_INT_MASK_V_SYNC BIT(5) 49*efeeaefeSPaul Kocialkowski 50*efeeaefeSPaul Kocialkowski #define LOGICVC_POWER_CTRL_REG 0x78 51*efeeaefeSPaul Kocialkowski #define LOGICVC_POWER_CTRL_BACKLIGHT_ENABLE BIT(0) 52*efeeaefeSPaul Kocialkowski #define LOGICVC_POWER_CTRL_VDD_ENABLE BIT(1) 53*efeeaefeSPaul Kocialkowski #define LOGICVC_POWER_CTRL_VEE_ENABLE BIT(2) 54*efeeaefeSPaul Kocialkowski #define LOGICVC_POWER_CTRL_VIDEO_ENABLE BIT(3) 55*efeeaefeSPaul Kocialkowski 56*efeeaefeSPaul Kocialkowski #define LOGICVC_IP_VERSION_REG 0xf8 57*efeeaefeSPaul Kocialkowski #define LOGICVC_IP_VERSION_MAJOR_MASK GENMASK(16, 11) 58*efeeaefeSPaul Kocialkowski #define LOGICVC_IP_VERSION_MINOR_MASK GENMASK(10, 5) 59*efeeaefeSPaul Kocialkowski #define LOGICVC_IP_VERSION_LEVEL_MASK GENMASK(4, 0) 60*efeeaefeSPaul Kocialkowski 61*efeeaefeSPaul Kocialkowski #define LOGICVC_LAYER_ADDRESS_REG(i) (0x100 + (i) * 0x80) 62*efeeaefeSPaul Kocialkowski #define LOGICVC_LAYER_HOFFSET_REG(i) (0x100 + (i) * 0x80) 63*efeeaefeSPaul Kocialkowski 64*efeeaefeSPaul Kocialkowski #define LOGICVC_LAYER_VOFFSET_REG(i) (0x108 + (i) * 0x80) 65*efeeaefeSPaul Kocialkowski #define LOGICVC_LAYER_VOFFSET_MAX 4095 66*efeeaefeSPaul Kocialkowski 67*efeeaefeSPaul Kocialkowski #define LOGICVC_LAYER_HPOSITION_REG(i) (0x110 + (i) * 0x80) 68*efeeaefeSPaul Kocialkowski #define LOGICVC_LAYER_VPOSITION_REG(i) (0x118 + (i) * 0x80) 69*efeeaefeSPaul Kocialkowski #define LOGICVC_LAYER_WIDTH_REG(i) (0x120 + (i) * 0x80) 70*efeeaefeSPaul Kocialkowski #define LOGICVC_LAYER_HEIGHT_REG(i) (0x128 + (i) * 0x80) 71*efeeaefeSPaul Kocialkowski #define LOGICVC_LAYER_ALPHA_REG(i) (0x130 + (i) * 0x80) 72*efeeaefeSPaul Kocialkowski 73*efeeaefeSPaul Kocialkowski #define LOGICVC_LAYER_CTRL_REG(i) (0x138 + (i) * 0x80) 74*efeeaefeSPaul Kocialkowski #define LOGICVC_LAYER_CTRL_ENABLE BIT(0) 75*efeeaefeSPaul Kocialkowski #define LOGICVC_LAYER_CTRL_COLOR_KEY_DISABLE BIT(1) 76*efeeaefeSPaul Kocialkowski #define LOGICVC_LAYER_CTRL_PIXEL_FORMAT_INVERT BIT(4) 77*efeeaefeSPaul Kocialkowski 78*efeeaefeSPaul Kocialkowski #define LOGICVC_LAYER_COLOR_KEY_REG(i) (0x140 + (i) * 0x80) 79*efeeaefeSPaul Kocialkowski 80*efeeaefeSPaul Kocialkowski #endif 81