xref: /rk3399_rockchip-uboot/arch/arm/include/asm/arch-tegra124/display.h (revision 62a3b7dd086ef8ceba91e99cceb19704efc1b482)
1e7e8823cSSimon Glass /*
2e7e8823cSSimon Glass  *  (C) Copyright 2010
3e7e8823cSSimon Glass  *  NVIDIA Corporation <www.nvidia.com>
4e7e8823cSSimon Glass  *
5e7e8823cSSimon Glass  * SPDX-License-Identifier:	GPL-2.0+
6e7e8823cSSimon Glass  */
7e7e8823cSSimon Glass 
8e7e8823cSSimon Glass #ifndef __ASM_ARCH_TEGRA_DISPLAY_H
9e7e8823cSSimon Glass #define __ASM_ARCH_TEGRA_DISPLAY_H
10e7e8823cSSimon Glass 
11e7e8823cSSimon Glass /**
12e7e8823cSSimon Glass  * Register a new display based on device tree configuration.
13e7e8823cSSimon Glass  *
14*62a3b7ddSRobert P. J. Day  * The frame buffer can be positioned by U-Boot or overridden by the fdt.
15e7e8823cSSimon Glass  * You should pass in the U-Boot address here, and check the contents of
16e7e8823cSSimon Glass  * struct fdt_disp_config to see what was actually chosen.
17e7e8823cSSimon Glass  *
18e7e8823cSSimon Glass  * @param blob			Device tree blob
19e7e8823cSSimon Glass  * @param default_lcd_base	Default address of LCD frame buffer
20e7e8823cSSimon Glass  * @return 0 if ok, -1 on error (unsupported bits per pixel)
21e7e8823cSSimon Glass  */
22e7e8823cSSimon Glass int tegra_display_probe(const void *blob, void *default_lcd_base);
23e7e8823cSSimon Glass 
24e7e8823cSSimon Glass /**
25e7e8823cSSimon Glass  * Return the current display configuration
26e7e8823cSSimon Glass  *
27e7e8823cSSimon Glass  * @return pointer to display configuration, or NULL if there is no valid
28e7e8823cSSimon Glass  * config
29e7e8823cSSimon Glass  */
30e7e8823cSSimon Glass struct fdt_disp_config *tegra_display_get_config(void);
31e7e8823cSSimon Glass 
32e7e8823cSSimon Glass /**
33e7e8823cSSimon Glass  * Perform the next stage of the LCD init if it is time to do so.
34e7e8823cSSimon Glass  *
35e7e8823cSSimon Glass  * LCD init can be time-consuming because of the number of delays we need
36e7e8823cSSimon Glass  * while waiting for the backlight power supply, etc. This function can
37e7e8823cSSimon Glass  * be called at various times during U-Boot operation to advance the
38e7e8823cSSimon Glass  * initialization of the LCD to the next stage if sufficient time has
39e7e8823cSSimon Glass  * passed since the last stage. It keeps track of what stage it is up to
40e7e8823cSSimon Glass  * and the time that it is permitted to move to the next stage.
41e7e8823cSSimon Glass  *
42e7e8823cSSimon Glass  * The final call should have wait=1 to complete the init.
43e7e8823cSSimon Glass  *
44e7e8823cSSimon Glass  * @param blob	fdt blob containing LCD information
45e7e8823cSSimon Glass  * @param wait	1 to wait until all init is complete, and then return
46e7e8823cSSimon Glass  *		0 to return immediately, potentially doing nothing if it is
47e7e8823cSSimon Glass  *		not yet time for the next init.
48e7e8823cSSimon Glass  */
49e7e8823cSSimon Glass int tegra_lcd_check_next_stage(const void *blob, int wait);
50e7e8823cSSimon Glass 
51e7e8823cSSimon Glass /**
52e7e8823cSSimon Glass  * Set up the maximum LCD size so we can size the frame buffer.
53e7e8823cSSimon Glass  *
54e7e8823cSSimon Glass  * @param blob	fdt blob containing LCD information
55e7e8823cSSimon Glass  */
56e7e8823cSSimon Glass void tegra_lcd_early_init(const void *blob);
57e7e8823cSSimon Glass 
58e7e8823cSSimon Glass #endif /*__ASM_ARCH_TEGRA_DISPLAY_H*/
59