Merge branch 'u-boot-samsung/master' into 'u-boot-arm/master'
[oweals/u-boot.git] / arch / arm / include / asm / arch-exynos / fb.h
index b10b0da07e009537bc1d820d7577ef770e1b4f12..f0d69b730e4ca30fce031eda9c649af20f5b77a0 100644 (file)
@@ -2,28 +2,14 @@
  * (C) Copyright 2012 Samsung Electronics
  * Donghwa Lee <dh09.lee@samsung.com>
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * aint with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #ifndef __ASM_ARM_ARCH_FB_H_
 #define __ASM_ARM_ARCH_FB_H_
 
 #ifndef __ASSEMBLY__
-struct exynos4_fb {
+struct exynos_fb {
        unsigned int vidcon0;
        unsigned int vidcon1;
        unsigned int vidcon2;
@@ -151,9 +137,23 @@ struct exynos4_fb {
 
        unsigned char res15[156];
        unsigned int dualrgb;
+       unsigned char res16[16];
+       unsigned int dp_mie_clkcon;
 };
 #endif
 
+/* LCD IF register offset */
+#define EXYNOS4_LCD_IF_BASE_OFFSET                     0x0
+#define EXYNOS5_LCD_IF_BASE_OFFSET                     0x20000
+
+static inline unsigned int exynos_fimd_get_base_offset(void)
+{
+       if (cpu_is_exynos5())
+               return EXYNOS5_LCD_IF_BASE_OFFSET;
+       else
+               return EXYNOS4_LCD_IF_BASE_OFFSET;
+}
+
 /*
  *  Register offsets
 */
@@ -253,6 +253,8 @@ struct exynos4_fb {
 /* VIDTCON2 */
 #define EXYNOS_VIDTCON2_LINEVAL(x)                     (((x) & 0x7ff) << 11)
 #define EXYNOS_VIDTCON2_HOZVAL(x)                      (((x) & 0x7ff) << 0)
+#define EXYNOS_VIDTCON2_LINEVAL_E(x)                   ((((x) & 0x800) >> 11) << 23)
+#define EXYNOS_VIDTCON2_HOZVAL_E(x)                    ((((x) & 0x800) >> 11) << 22)
 
 /* Window 0~4 Control - WINCONx */
 #define EXYNOS_WINCON_DATAPATH_DMA                     (0 << 22)
@@ -330,6 +332,8 @@ struct exynos4_fb {
 #define EXYNOS_VIDOSD_TOP_Y(x)                         (((x) & 0x7ff) << 0)
 #define EXYNOS_VIDOSD_RIGHT_X(x)                       (((x) & 0x7ff) << 11)
 #define EXYNOS_VIDOSD_BOTTOM_Y(x)                      (((x) & 0x7ff) << 0)
+#define EXYNOS_VIDOSD_RIGHT_X_E(x)                     (((x) & 0x1) << 23)
+#define EXYNOS_VIDOSD_BOTTOM_Y_E(x)                    (((x) & 0x1) << 22)
 
 /* VIDOSD0C, VIDOSDxD */
 #define EXYNOS_VIDOSD_SIZE(x)                          (((x) & 0xffffff) << 0)
@@ -354,6 +358,8 @@ struct exynos4_fb {
 /* Buffer Size */
 #define EXYNOS_VIDADDR_OFFSIZE(x)                      (((x) & 0x1fff) << 13)
 #define EXYNOS_VIDADDR_PAGEWIDTH(x)                    (((x) & 0x1fff) << 0)
+#define EXYNOS_VIDADDR_OFFSIZE_E(x)                    ((((x) & 0x2000) >> 13) << 27)
+#define EXYNOS_VIDADDR_PAGEWIDTH_E(x)                  ((((x) & 0x2000) >> 13) << 26)
 
 /* WIN Color Map */
 #define EXYNOS_WINMAP_COLOR(x)                         ((x) & 0xffffff)
@@ -443,4 +449,9 @@ struct exynos4_fb {
 #define EXYNOS_I80START_TRIG                           (1 << 1)
 #define EXYNOS_I80STATUS_TRIG_DONE                     (1 << 2)
 
+/* DP_MIE_CLKCON */
+#define EXYNOS_DP_MIE_DISABLE                          (0 << 0)
+#define EXYNOS_DP_CLK_ENABLE                           (1 << 1)
+#define EXYNOS_MIE_CLK_ENABLE                          (3 << 0)
+
 #endif /* _REGS_FB_H */