blob: bc033c9f3508f89bb15433bcb7ec5f1ace88b51e [file] [log] [blame]
Angel Ponsa2ee7612020-04-04 18:51:15 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Gabe Blackd40be112013-10-09 23:45:07 -07002
3#ifndef __SOC_NVIDIA_TEGRA124_CHIP_H__
4#define __SOC_NVIDIA_TEGRA124_CHIP_H__
Elyes HAOUASb7731572019-12-29 11:05:31 +01005
Julius Wernereaa9c452014-09-24 15:40:49 -07006#include <gpio.h>
Gabe Blackd40be112013-10-09 23:45:07 -07007#include <soc/addressmap.h>
Gabe Blackd40be112013-10-09 23:45:07 -07008
Jimmy Zhangbd5925a2014-03-10 12:42:05 -07009#define EFAULT 1
10#define EINVAL 2
11
Gabe Blackd40be112013-10-09 23:45:07 -070012/* this is a misuse of the device tree. We're going to let it go for now but
13 * we should at minimum have a struct for the display controller, since
14 * the chip supports two.
15 */
16struct soc_nvidia_tegra124_config {
Jimmy Zhangbd5925a2014-03-10 12:42:05 -070017 u32 xres;
18 u32 yres;
19 u32 framebuffer_bits_per_pixel;
20 u32 color_depth;
21 u32 panel_bits_per_pixel;
Gabe Blackd40be112013-10-09 23:45:07 -070022 /* there are two. It's not unimaginable that we might someday
23 * have two of these structs in a single mainboard.
24 */
25 u32 display_controller;
26 u32 framebuffer_base;
27 /* Technically, we can compute this. At the same time, some platforms
28 * might want to specify a specific size for their own reasons. If it is
29 * zero the soc code will compute it as xres*yres*framebuffer_bits_per_pixel/4
30 */
31 u32 framebuffer_size;
32 /* GPIOs -- all, some, or none are used. Unused ones can be ignored
33 * in devicetree.cb since if they are not set there they default to 0,
34 * and 0 for a gpio means 'unused GPIO'.
35 */
36 gpio_t backlight_en_gpio;
37 gpio_t lvds_shutdown_gpio;
38 gpio_t backlight_vdd_gpio;
39 gpio_t panel_vdd_gpio;
40
41 /* required info. */
42 /* pwm to use to set display contrast */
43 int pwm;
44 /* timings -- five numbers, all relative to the previous
45 * event, not to absolute time. e.g., vdd_data_delay is the
46 * delay from vdd on to data, not from power on to data.
47 * This is stated to be four timings in the
48 * u-boot docs. In any event, in coreboot, we generally
49 * only delay long enough to let the panel wake up and then
Jimmy Zhangbd5925a2014-03-10 12:42:05 -070050 * do the control operations -- meaning, for *coreboot*
Gabe Blackd40be112013-10-09 23:45:07 -070051 * we probably only need the vdd_delay, but payloads may
52 * need the other info.
53 */
54 /* Delay before from power on asserting vdd */
Jimmy Zhangbd5925a2014-03-10 12:42:05 -070055 int vdd_delay_ms;
56
Martin Roth26f97f92021-10-01 14:53:22 -060057 /* Delay between pwm and backlight_en_gpio is asserted */
Ken Chang5a056d32014-04-22 12:55:00 +080058 int pwm_to_bl_delay_ms;
59
Jimmy Zhangbd5925a2014-03-10 12:42:05 -070060 /* Delay before HPD high */
61 int vdd_to_hpd_delay_ms;
62
63 int hpd_unplug_min_us;
64 int hpd_plug_min_us;
Elyes HAOUAS88607a42018-10-05 10:36:45 +020065 int hpd_irq_min_us;
Jimmy Zhangbd5925a2014-03-10 12:42:05 -070066
67 int href_to_sync;
Gabe Blackd40be112013-10-09 23:45:07 -070068 int hsync_width;
69 int hback_porch;
70 int hfront_porch;
Jimmy Zhangbd5925a2014-03-10 12:42:05 -070071 int vref_to_sync;
Gabe Blackd40be112013-10-09 23:45:07 -070072 int vsync_width;
73 int vback_porch;
74 int vfront_porch;
75
76 int pixel_clock;
Jimmy Zhangbd5925a2014-03-10 12:42:05 -070077
Elyes HAOUAS809aeee2018-08-07 12:14:33 +020078 /* The minimum link configuration settings */
Jimmy Zhangbd5925a2014-03-10 12:42:05 -070079 u32 lane_count;
80 u32 enhanced_framing;
81 u32 link_bw;
82 u32 drive_current;
83 u32 preemphasis;
84 u32 postcursor;
85
86 void *dc_data;
Gabe Blackd40be112013-10-09 23:45:07 -070087};
88
89#endif /* __SOC_NVIDIA_TEGRA124_CHIP_H__ */