tegra: video: Merge the two config structures together
[oweals/u-boot.git] / arch / arm / include / asm / arch-tegra20 / display.h
1 /*
2  *  (C) Copyright 2010
3  *  NVIDIA Corporation <www.nvidia.com>
4  *
5  * SPDX-License-Identifier:     GPL-2.0+
6  */
7
8 #ifndef __ASM_ARCH_TEGRA_DISPLAY_H
9 #define __ASM_ARCH_TEGRA_DISPLAY_H
10
11 #include <asm/arch-tegra/dc.h>
12 #include <fdtdec.h>
13 #include <asm/gpio.h>
14
15 /* This holds information about a window which can be displayed */
16 struct disp_ctl_win {
17         enum win_color_depth_id fmt;    /* Color depth/format */
18         unsigned        bpp;            /* Bits per pixel */
19         phys_addr_t     phys_addr;      /* Physical address in memory */
20         unsigned        x;              /* Horizontal address offset (bytes) */
21         unsigned        y;              /* Veritical address offset (bytes) */
22         unsigned        w;              /* Width of source window */
23         unsigned        h;              /* Height of source window */
24         unsigned        stride;         /* Number of bytes per line */
25         unsigned        out_x;          /* Left edge of output window (col) */
26         unsigned        out_y;          /* Top edge of output window (row) */
27         unsigned        out_w;          /* Width of output window in pixels */
28         unsigned        out_h;          /* Height of output window in pixels */
29 };
30
31 #define FDT_LCD_TIMINGS 4
32
33 enum {
34         FDT_LCD_TIMING_REF_TO_SYNC,
35         FDT_LCD_TIMING_SYNC_WIDTH,
36         FDT_LCD_TIMING_BACK_PORCH,
37         FDT_LCD_TIMING_FRONT_PORCH,
38
39         FDT_LCD_TIMING_COUNT,
40 };
41
42 enum lcd_cache_t {
43         FDT_LCD_CACHE_OFF               = 0,
44         FDT_LCD_CACHE_WRITE_THROUGH     = 1 << 0,
45         FDT_LCD_CACHE_WRITE_BACK        = 1 << 1,
46         FDT_LCD_CACHE_FLUSH             = 1 << 2,
47         FDT_LCD_CACHE_WRITE_BACK_FLUSH  = FDT_LCD_CACHE_WRITE_BACK |
48                                                 FDT_LCD_CACHE_FLUSH,
49 };
50
51 /**
52  * Perform the next stage of the LCD init if it is time to do so.
53  *
54  * LCD init can be time-consuming because of the number of delays we need
55  * while waiting for the backlight power supply, etc. This function can
56  * be called at various times during U-Boot operation to advance the
57  * initialization of the LCD to the next stage if sufficient time has
58  * passed since the last stage. It keeps track of what stage it is up to
59  * and the time that it is permitted to move to the next stage.
60  *
61  * The final call should have wait=1 to complete the init.
62  *
63  * @param blob  fdt blob containing LCD information
64  * @param wait  1 to wait until all init is complete, and then return
65  *              0 to return immediately, potentially doing nothing if it is
66  *              not yet time for the next init.
67  */
68 int tegra_lcd_check_next_stage(const void *blob, int wait);
69
70 /**
71  * Set up the maximum LCD size so we can size the frame buffer.
72  *
73  * @param blob  fdt blob containing LCD information
74  */
75 void tegra_lcd_early_init(const void *blob);
76
77 #endif /*__ASM_ARCH_TEGRA_DISPLAY_H*/