blob: 7e930d11d63ae912f6f93037b3f8932db7c647e6 [file] [log] [blame]
Gabe Blackd40be112013-10-09 23:45:07 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright 2013 Google Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Gabe Blackd40be112013-10-09 23:45:07 -070014 */
15
16#ifndef __SOC_NVIDIA_TEGRA124_CHIP_H__
17#define __SOC_NVIDIA_TEGRA124_CHIP_H__
18#include <arch/cache.h>
Julius Wernereaa9c452014-09-24 15:40:49 -070019#include <gpio.h>
Gabe Blackd40be112013-10-09 23:45:07 -070020#include <soc/addressmap.h>
Gabe Blackd40be112013-10-09 23:45:07 -070021
Jimmy Zhangbd5925a2014-03-10 12:42:05 -070022#define EFAULT 1
23#define EINVAL 2
24
Gabe Blackd40be112013-10-09 23:45:07 -070025/* this is a misuse of the device tree. We're going to let it go for now but
26 * we should at minimum have a struct for the display controller, since
27 * the chip supports two.
28 */
29struct soc_nvidia_tegra124_config {
Jimmy Zhangbd5925a2014-03-10 12:42:05 -070030 u32 xres;
31 u32 yres;
32 u32 framebuffer_bits_per_pixel;
33 u32 color_depth;
34 u32 panel_bits_per_pixel;
Gabe Blackd40be112013-10-09 23:45:07 -070035 /* there are two. It's not unimaginable that we might someday
36 * have two of these structs in a single mainboard.
37 */
38 u32 display_controller;
39 u32 framebuffer_base;
40 /* Technically, we can compute this. At the same time, some platforms
41 * might want to specify a specific size for their own reasons. If it is
42 * zero the soc code will compute it as xres*yres*framebuffer_bits_per_pixel/4
43 */
44 u32 framebuffer_size;
45 /* GPIOs -- all, some, or none are used. Unused ones can be ignored
46 * in devicetree.cb since if they are not set there they default to 0,
47 * and 0 for a gpio means 'unused GPIO'.
48 */
49 gpio_t backlight_en_gpio;
50 gpio_t lvds_shutdown_gpio;
51 gpio_t backlight_vdd_gpio;
52 gpio_t panel_vdd_gpio;
53
54 /* required info. */
55 /* pwm to use to set display contrast */
56 int pwm;
57 /* timings -- five numbers, all relative to the previous
58 * event, not to absolute time. e.g., vdd_data_delay is the
59 * delay from vdd on to data, not from power on to data.
60 * This is stated to be four timings in the
61 * u-boot docs. In any event, in coreboot, we generally
62 * only delay long enough to let the panel wake up and then
Jimmy Zhangbd5925a2014-03-10 12:42:05 -070063 * do the control operations -- meaning, for *coreboot*
Gabe Blackd40be112013-10-09 23:45:07 -070064 * we probably only need the vdd_delay, but payloads may
65 * need the other info.
66 */
67 /* Delay before from power on asserting vdd */
Jimmy Zhangbd5925a2014-03-10 12:42:05 -070068 int vdd_delay_ms;
69
Ken Chang5a056d32014-04-22 12:55:00 +080070 /* Delay beween pwm and backlight_en_gpio is asserted */
71 int pwm_to_bl_delay_ms;
72
Jimmy Zhangbd5925a2014-03-10 12:42:05 -070073 /* Delay before HPD high */
74 int vdd_to_hpd_delay_ms;
75
76 int hpd_unplug_min_us;
77 int hpd_plug_min_us;
Elyes HAOUAS88607a42018-10-05 10:36:45 +020078 int hpd_irq_min_us;
Jimmy Zhangbd5925a2014-03-10 12:42:05 -070079
80 int href_to_sync;
Gabe Blackd40be112013-10-09 23:45:07 -070081 int hsync_width;
82 int hback_porch;
83 int hfront_porch;
Jimmy Zhangbd5925a2014-03-10 12:42:05 -070084 int vref_to_sync;
Gabe Blackd40be112013-10-09 23:45:07 -070085 int vsync_width;
86 int vback_porch;
87 int vfront_porch;
88
89 int pixel_clock;
Jimmy Zhangbd5925a2014-03-10 12:42:05 -070090
Elyes HAOUAS809aeee2018-08-07 12:14:33 +020091 /* The minimum link configuration settings */
Jimmy Zhangbd5925a2014-03-10 12:42:05 -070092 u32 lane_count;
93 u32 enhanced_framing;
94 u32 link_bw;
95 u32 drive_current;
96 u32 preemphasis;
97 u32 postcursor;
98
99 void *dc_data;
Gabe Blackd40be112013-10-09 23:45:07 -0700100};
101
102#endif /* __SOC_NVIDIA_TEGRA124_CHIP_H__ */