blob: 186657f02fbcaf03746cb42d8d13d5e03640f8ae [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 int cache_policy;
36 /* there are two. It's not unimaginable that we might someday
37 * have two of these structs in a single mainboard.
38 */
39 u32 display_controller;
40 u32 framebuffer_base;
41 /* Technically, we can compute this. At the same time, some platforms
42 * might want to specify a specific size for their own reasons. If it is
43 * zero the soc code will compute it as xres*yres*framebuffer_bits_per_pixel/4
44 */
45 u32 framebuffer_size;
46 /* GPIOs -- all, some, or none are used. Unused ones can be ignored
47 * in devicetree.cb since if they are not set there they default to 0,
48 * and 0 for a gpio means 'unused GPIO'.
49 */
50 gpio_t backlight_en_gpio;
51 gpio_t lvds_shutdown_gpio;
52 gpio_t backlight_vdd_gpio;
53 gpio_t panel_vdd_gpio;
54
55 /* required info. */
56 /* pwm to use to set display contrast */
57 int pwm;
58 /* timings -- five numbers, all relative to the previous
59 * event, not to absolute time. e.g., vdd_data_delay is the
60 * delay from vdd on to data, not from power on to data.
61 * This is stated to be four timings in the
62 * u-boot docs. In any event, in coreboot, we generally
63 * only delay long enough to let the panel wake up and then
Jimmy Zhangbd5925a2014-03-10 12:42:05 -070064 * do the control operations -- meaning, for *coreboot*
Gabe Blackd40be112013-10-09 23:45:07 -070065 * we probably only need the vdd_delay, but payloads may
66 * need the other info.
67 */
68 /* Delay before from power on asserting vdd */
Jimmy Zhangbd5925a2014-03-10 12:42:05 -070069 int vdd_delay_ms;
70
Ken Chang5a056d32014-04-22 12:55:00 +080071 /* Delay beween pwm and backlight_en_gpio is asserted */
72 int pwm_to_bl_delay_ms;
73
Jimmy Zhangbd5925a2014-03-10 12:42:05 -070074 /* Delay before HPD high */
75 int vdd_to_hpd_delay_ms;
76
77 int hpd_unplug_min_us;
78 int hpd_plug_min_us;
79 int hpd_irq_min_us;
80
81 int href_to_sync;
Gabe Blackd40be112013-10-09 23:45:07 -070082 int hsync_width;
83 int hback_porch;
84 int hfront_porch;
Jimmy Zhangbd5925a2014-03-10 12:42:05 -070085 int vref_to_sync;
Gabe Blackd40be112013-10-09 23:45:07 -070086 int vsync_width;
87 int vback_porch;
88 int vfront_porch;
89
90 int pixel_clock;
Jimmy Zhangbd5925a2014-03-10 12:42:05 -070091
92 /* The minimum link configuraton settings */
93 u32 lane_count;
94 u32 enhanced_framing;
95 u32 link_bw;
96 u32 drive_current;
97 u32 preemphasis;
98 u32 postcursor;
99
100 void *dc_data;
Gabe Blackd40be112013-10-09 23:45:07 -0700101};
102
103#endif /* __SOC_NVIDIA_TEGRA124_CHIP_H__ */