Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 1 | /* |
| 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 Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #ifndef __SOC_NVIDIA_TEGRA124_CHIP_H__ |
| 17 | #define __SOC_NVIDIA_TEGRA124_CHIP_H__ |
| 18 | #include <arch/cache.h> |
Julius Werner | eaa9c45 | 2014-09-24 15:40:49 -0700 | [diff] [blame] | 19 | #include <gpio.h> |
Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 20 | #include <soc/addressmap.h> |
Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 21 | |
Jimmy Zhang | bd5925a | 2014-03-10 12:42:05 -0700 | [diff] [blame] | 22 | #define EFAULT 1 |
| 23 | #define EINVAL 2 |
| 24 | |
Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 25 | /* 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 | */ |
| 29 | struct soc_nvidia_tegra124_config { |
Jimmy Zhang | bd5925a | 2014-03-10 12:42:05 -0700 | [diff] [blame] | 30 | u32 xres; |
| 31 | u32 yres; |
| 32 | u32 framebuffer_bits_per_pixel; |
| 33 | u32 color_depth; |
| 34 | u32 panel_bits_per_pixel; |
Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 35 | 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 Zhang | bd5925a | 2014-03-10 12:42:05 -0700 | [diff] [blame] | 64 | * do the control operations -- meaning, for *coreboot* |
Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 65 | * 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 Zhang | bd5925a | 2014-03-10 12:42:05 -0700 | [diff] [blame] | 69 | int vdd_delay_ms; |
| 70 | |
Ken Chang | 5a056d3 | 2014-04-22 12:55:00 +0800 | [diff] [blame] | 71 | /* Delay beween pwm and backlight_en_gpio is asserted */ |
| 72 | int pwm_to_bl_delay_ms; |
| 73 | |
Jimmy Zhang | bd5925a | 2014-03-10 12:42:05 -0700 | [diff] [blame] | 74 | /* 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 Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 82 | int hsync_width; |
| 83 | int hback_porch; |
| 84 | int hfront_porch; |
Jimmy Zhang | bd5925a | 2014-03-10 12:42:05 -0700 | [diff] [blame] | 85 | int vref_to_sync; |
Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 86 | int vsync_width; |
| 87 | int vback_porch; |
| 88 | int vfront_porch; |
| 89 | |
| 90 | int pixel_clock; |
Jimmy Zhang | bd5925a | 2014-03-10 12:42:05 -0700 | [diff] [blame] | 91 | |
| 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 Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 101 | }; |
| 102 | |
| 103 | #endif /* __SOC_NVIDIA_TEGRA124_CHIP_H__ */ |