blob: a552f38cd07539dadb123ff9ee7c59777c866ff1 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Simon Glasse7e88232015-04-14 21:03:42 -06002/*
3 * Copyright 2014 Google Inc.
4 *
Simon Glasse7e88232015-04-14 21:03:42 -06005 * Extracted from Chromium coreboot commit 3f59b13d
6 */
7
8#include <common.h>
Simon Glass52f24232020-05-10 11:40:00 -06009#include <bootstage.h>
Simon Glasse7e88232015-04-14 21:03:42 -060010#include <dm.h>
11#include <edid.h>
12#include <errno.h>
Simon Glass2dcf1432016-01-21 19:45:00 -070013#include <display.h>
Simon Glasse7e88232015-04-14 21:03:42 -060014#include <edid.h>
Simon Glasse7e88232015-04-14 21:03:42 -060015#include <lcd.h>
Simon Glasse6f6f9e2020-05-10 11:39:58 -060016#include <part.h>
Simon Glassd7659212016-01-30 16:37:50 -070017#include <video.h>
Simon Glasse7e88232015-04-14 21:03:42 -060018#include <asm/gpio.h>
19#include <asm/io.h>
20#include <asm/arch/clock.h>
21#include <asm/arch/pwm.h>
22#include <asm/arch-tegra/dc.h>
Simon Glassd7659212016-01-30 16:37:50 -070023#include <dm/uclass-internal.h>
Simon Glasse7e88232015-04-14 21:03:42 -060024#include "displayport.h"
25
Simon Glasse7e88232015-04-14 21:03:42 -060026/* return in 1000ths of a Hertz */
27static int tegra_dc_calc_refresh(const struct display_timing *timing)
28{
29 int h_total, v_total, refresh;
30 int pclk = timing->pixelclock.typ;
31
32 h_total = timing->hactive.typ + timing->hfront_porch.typ +
33 timing->hback_porch.typ + timing->hsync_len.typ;
34 v_total = timing->vactive.typ + timing->vfront_porch.typ +
35 timing->vback_porch.typ + timing->vsync_len.typ;
36 if (!pclk || !h_total || !v_total)
37 return 0;
38 refresh = pclk / h_total;
39 refresh *= 1000;
40 refresh /= v_total;
41
42 return refresh;
43}
44
45static void print_mode(const struct display_timing *timing)
46{
47 int refresh = tegra_dc_calc_refresh(timing);
48
49 debug("MODE:%dx%d@%d.%03uHz pclk=%d\n",
50 timing->hactive.typ, timing->vactive.typ, refresh / 1000,
51 refresh % 1000, timing->pixelclock.typ);
52}
53
54static int update_display_mode(struct dc_ctlr *disp_ctrl,
55 const struct display_timing *timing,
56 int href_to_sync, int vref_to_sync)
57{
58 print_mode(timing);
59
60 writel(0x1, &disp_ctrl->disp.disp_timing_opt);
61
62 writel(vref_to_sync << 16 | href_to_sync,
63 &disp_ctrl->disp.ref_to_sync);
64
65 writel(timing->vsync_len.typ << 16 | timing->hsync_len.typ,
66 &disp_ctrl->disp.sync_width);
67
68 writel(((timing->vback_porch.typ - vref_to_sync) << 16) |
69 timing->hback_porch.typ, &disp_ctrl->disp.back_porch);
70
71 writel(((timing->vfront_porch.typ + vref_to_sync) << 16) |
72 timing->hfront_porch.typ, &disp_ctrl->disp.front_porch);
73
74 writel(timing->hactive.typ | (timing->vactive.typ << 16),
75 &disp_ctrl->disp.disp_active);
76
77 /**
78 * We want to use PLLD_out0, which is PLLD / 2:
79 * PixelClock = (PLLD / 2) / ShiftClockDiv / PixelClockDiv.
80 *
81 * Currently most panels work inside clock range 50MHz~100MHz, and PLLD
82 * has some requirements to have VCO in range 500MHz~1000MHz (see
83 * clock.c for more detail). To simplify calculation, we set
84 * PixelClockDiv to 1 and ShiftClockDiv to 1. In future these values
85 * may be calculated by clock_display, to allow wider frequency range.
86 *
87 * Note ShiftClockDiv is a 7.1 format value.
88 */
89 const u32 shift_clock_div = 1;
90 writel((PIXEL_CLK_DIVIDER_PCD1 << PIXEL_CLK_DIVIDER_SHIFT) |
91 ((shift_clock_div - 1) * 2) << SHIFT_CLK_DIVIDER_SHIFT,
92 &disp_ctrl->disp.disp_clk_ctrl);
93 debug("%s: PixelClock=%u, ShiftClockDiv=%u\n", __func__,
94 timing->pixelclock.typ, shift_clock_div);
95 return 0;
96}
97
Simon Glassdedc44b2015-04-14 21:03:44 -060098static u32 tegra_dc_poll_register(void *reg,
99 u32 mask, u32 exp_val, u32 poll_interval_us, u32 timeout_us)
100{
101 u32 temp = timeout_us;
102 u32 reg_val = 0;
103
104 do {
105 udelay(poll_interval_us);
106 reg_val = readl(reg);
107 if (timeout_us > poll_interval_us)
108 timeout_us -= poll_interval_us;
109 else
110 break;
111 } while ((reg_val & mask) != exp_val);
112
113 if ((reg_val & mask) == exp_val)
114 return 0; /* success */
115
116 return temp;
117}
118
119int tegra_dc_sor_general_act(struct dc_ctlr *disp_ctrl)
120{
121 writel(GENERAL_ACT_REQ, &disp_ctrl->cmd.state_ctrl);
122
123 if (tegra_dc_poll_register(&disp_ctrl->cmd.state_ctrl,
124 GENERAL_ACT_REQ, 0, 100,
125 DC_POLL_TIMEOUT_MS * 1000)) {
126 debug("dc timeout waiting for DC to stop\n");
127 return -ETIMEDOUT;
128 }
129
130 return 0;
131}
132
133static struct display_timing min_mode = {
134 .hsync_len = { .typ = 1 },
135 .vsync_len = { .typ = 1 },
136 .hback_porch = { .typ = 20 },
137 .vback_porch = { .typ = 0 },
138 .hactive = { .typ = 16 },
139 .vactive = { .typ = 16 },
140 .hfront_porch = { .typ = 1 },
141 .vfront_porch = { .typ = 2 },
142};
143
144/* Disable windows and set minimum raster timings */
145void tegra_dc_sor_disable_win_short_raster(struct dc_ctlr *disp_ctrl,
146 int *dc_reg_ctx)
147{
148 const int href_to_sync = 0, vref_to_sync = 1;
149 int selected_windows, i;
150
151 selected_windows = readl(&disp_ctrl->cmd.disp_win_header);
152
153 /* Store and clear window options */
154 for (i = 0; i < DC_N_WINDOWS; ++i) {
155 writel(WINDOW_A_SELECT << i, &disp_ctrl->cmd.disp_win_header);
156 dc_reg_ctx[i] = readl(&disp_ctrl->win.win_opt);
157 writel(0, &disp_ctrl->win.win_opt);
158 writel(WIN_A_ACT_REQ << i, &disp_ctrl->cmd.state_ctrl);
159 }
160
161 writel(selected_windows, &disp_ctrl->cmd.disp_win_header);
162
163 /* Store current raster timings and set minimum timings */
164 dc_reg_ctx[i++] = readl(&disp_ctrl->disp.ref_to_sync);
165 writel(href_to_sync | (vref_to_sync << 16),
166 &disp_ctrl->disp.ref_to_sync);
167
168 dc_reg_ctx[i++] = readl(&disp_ctrl->disp.sync_width);
169 writel(min_mode.hsync_len.typ | (min_mode.vsync_len.typ << 16),
170 &disp_ctrl->disp.sync_width);
171
172 dc_reg_ctx[i++] = readl(&disp_ctrl->disp.back_porch);
173 writel(min_mode.hback_porch.typ | (min_mode.vback_porch.typ << 16),
174 &disp_ctrl->disp.back_porch);
175
176 dc_reg_ctx[i++] = readl(&disp_ctrl->disp.front_porch);
177 writel(min_mode.hfront_porch.typ | (min_mode.vfront_porch.typ << 16),
178 &disp_ctrl->disp.front_porch);
179
180 dc_reg_ctx[i++] = readl(&disp_ctrl->disp.disp_active);
181 writel(min_mode.hactive.typ | (min_mode.vactive.typ << 16),
182 &disp_ctrl->disp.disp_active);
183
184 writel(GENERAL_ACT_REQ, &disp_ctrl->cmd.state_ctrl);
185}
186
187/* Restore previous windows status and raster timings */
188void tegra_dc_sor_restore_win_and_raster(struct dc_ctlr *disp_ctrl,
189 int *dc_reg_ctx)
190{
191 int selected_windows, i;
192
193 selected_windows = readl(&disp_ctrl->cmd.disp_win_header);
194
195 for (i = 0; i < DC_N_WINDOWS; ++i) {
196 writel(WINDOW_A_SELECT << i, &disp_ctrl->cmd.disp_win_header);
197 writel(dc_reg_ctx[i], &disp_ctrl->win.win_opt);
198 writel(WIN_A_ACT_REQ << i, &disp_ctrl->cmd.state_ctrl);
199 }
200
201 writel(selected_windows, &disp_ctrl->cmd.disp_win_header);
202
203 writel(dc_reg_ctx[i++], &disp_ctrl->disp.ref_to_sync);
204 writel(dc_reg_ctx[i++], &disp_ctrl->disp.sync_width);
205 writel(dc_reg_ctx[i++], &disp_ctrl->disp.back_porch);
206 writel(dc_reg_ctx[i++], &disp_ctrl->disp.front_porch);
207 writel(dc_reg_ctx[i++], &disp_ctrl->disp.disp_active);
208
209 writel(GENERAL_UPDATE, &disp_ctrl->cmd.state_ctrl);
210}
211
Simon Glasse7e88232015-04-14 21:03:42 -0600212static int tegra_depth_for_bpp(int bpp)
213{
214 switch (bpp) {
215 case 32:
216 return COLOR_DEPTH_R8G8B8A8;
217 case 16:
218 return COLOR_DEPTH_B5G6R5;
219 default:
220 debug("Unsupported LCD bit depth");
221 return -1;
222 }
223}
224
225static int update_window(struct dc_ctlr *disp_ctrl,
226 u32 frame_buffer, int fb_bits_per_pixel,
227 const struct display_timing *timing)
228{
229 const u32 colour_white = 0xffffff;
230 int colour_depth;
231 u32 val;
232
233 writel(WINDOW_A_SELECT, &disp_ctrl->cmd.disp_win_header);
234
235 writel(((timing->vactive.typ << 16) | timing->hactive.typ),
236 &disp_ctrl->win.size);
237 writel(((timing->vactive.typ << 16) |
238 (timing->hactive.typ * fb_bits_per_pixel / 8)),
239 &disp_ctrl->win.prescaled_size);
240 writel(((timing->hactive.typ * fb_bits_per_pixel / 8 + 31) /
241 32 * 32), &disp_ctrl->win.line_stride);
242
243 colour_depth = tegra_depth_for_bpp(fb_bits_per_pixel);
244 if (colour_depth == -1)
245 return -EINVAL;
246
247 writel(colour_depth, &disp_ctrl->win.color_depth);
248
249 writel(frame_buffer, &disp_ctrl->winbuf.start_addr);
250 writel(0x1000 << V_DDA_INC_SHIFT | 0x1000 << H_DDA_INC_SHIFT,
251 &disp_ctrl->win.dda_increment);
252
253 writel(colour_white, &disp_ctrl->disp.blend_background_color);
254 writel(CTRL_MODE_C_DISPLAY << CTRL_MODE_SHIFT,
255 &disp_ctrl->cmd.disp_cmd);
256
257 writel(WRITE_MUX_ACTIVE, &disp_ctrl->cmd.state_access);
258
259 val = GENERAL_ACT_REQ | WIN_A_ACT_REQ;
260 val |= GENERAL_UPDATE | WIN_A_UPDATE;
261 writel(val, &disp_ctrl->cmd.state_ctrl);
262
263 /* Enable win_a */
264 val = readl(&disp_ctrl->win.win_opt);
265 writel(val | WIN_ENABLE, &disp_ctrl->win.win_opt);
266
267 return 0;
268}
269
270static int tegra_dc_init(struct dc_ctlr *disp_ctrl)
271{
272 /* do not accept interrupts during initialization */
273 writel(0x00000000, &disp_ctrl->cmd.int_mask);
274 writel(WRITE_MUX_ASSEMBLY | READ_MUX_ASSEMBLY,
275 &disp_ctrl->cmd.state_access);
276 writel(WINDOW_A_SELECT, &disp_ctrl->cmd.disp_win_header);
277 writel(0x00000000, &disp_ctrl->win.win_opt);
278 writel(0x00000000, &disp_ctrl->win.byte_swap);
279 writel(0x00000000, &disp_ctrl->win.buffer_ctrl);
280
281 writel(0x00000000, &disp_ctrl->win.pos);
282 writel(0x00000000, &disp_ctrl->win.h_initial_dda);
283 writel(0x00000000, &disp_ctrl->win.v_initial_dda);
284 writel(0x00000000, &disp_ctrl->win.dda_increment);
285 writel(0x00000000, &disp_ctrl->win.dv_ctrl);
286
287 writel(0x01000000, &disp_ctrl->win.blend_layer_ctrl);
288 writel(0x00000000, &disp_ctrl->win.blend_match_select);
289 writel(0x00000000, &disp_ctrl->win.blend_nomatch_select);
290 writel(0x00000000, &disp_ctrl->win.blend_alpha_1bit);
291
292 writel(0x00000000, &disp_ctrl->winbuf.start_addr_hi);
293 writel(0x00000000, &disp_ctrl->winbuf.addr_h_offset);
294 writel(0x00000000, &disp_ctrl->winbuf.addr_v_offset);
295
296 writel(0x00000000, &disp_ctrl->com.crc_checksum);
297 writel(0x00000000, &disp_ctrl->com.pin_output_enb[0]);
298 writel(0x00000000, &disp_ctrl->com.pin_output_enb[1]);
299 writel(0x00000000, &disp_ctrl->com.pin_output_enb[2]);
300 writel(0x00000000, &disp_ctrl->com.pin_output_enb[3]);
301 writel(0x00000000, &disp_ctrl->disp.disp_signal_opt0);
302
303 return 0;
304}
305
306static void dump_config(int panel_bpp, struct display_timing *timing)
307{
308 printf("timing->hactive.typ = %d\n", timing->hactive.typ);
309 printf("timing->vactive.typ = %d\n", timing->vactive.typ);
310 printf("timing->pixelclock.typ = %d\n", timing->pixelclock.typ);
311
312 printf("timing->hfront_porch.typ = %d\n", timing->hfront_porch.typ);
313 printf("timing->hsync_len.typ = %d\n", timing->hsync_len.typ);
314 printf("timing->hback_porch.typ = %d\n", timing->hback_porch.typ);
315
316 printf("timing->vfront_porch.typ %d\n", timing->vfront_porch.typ);
317 printf("timing->vsync_len.typ = %d\n", timing->vsync_len.typ);
318 printf("timing->vback_porch.typ = %d\n", timing->vback_porch.typ);
319
320 printf("panel_bits_per_pixel = %d\n", panel_bpp);
321}
322
323static int display_update_config_from_edid(struct udevice *dp_dev,
324 int *panel_bppp,
325 struct display_timing *timing)
326{
Masahiro Yamada720873b2016-09-06 22:17:33 +0900327 return display_read_timing(dp_dev, timing);
Simon Glasse7e88232015-04-14 21:03:42 -0600328}
329
Simon Glassd7659212016-01-30 16:37:50 -0700330static int display_init(struct udevice *dev, void *lcdbase,
331 int fb_bits_per_pixel, struct display_timing *timing)
Simon Glasse7e88232015-04-14 21:03:42 -0600332{
Simon Glassd7659212016-01-30 16:37:50 -0700333 struct display_plat *disp_uc_plat;
Simon Glasse7e88232015-04-14 21:03:42 -0600334 struct dc_ctlr *dc_ctlr;
Simon Glasse7e88232015-04-14 21:03:42 -0600335 struct udevice *dp_dev;
336 const int href_to_sync = 1, vref_to_sync = 1;
337 int panel_bpp = 18; /* default 18 bits per pixel */
338 u32 plld_rate;
Simon Glasse7e88232015-04-14 21:03:42 -0600339 int ret;
340
Simon Glassd7659212016-01-30 16:37:50 -0700341 /*
342 * Before we probe the display device (eDP), tell it that this device
Marcel Ziswilerd5c453a2016-12-19 15:38:04 +0100343 * is the source of the display data.
Simon Glassd7659212016-01-30 16:37:50 -0700344 */
345 ret = uclass_find_first_device(UCLASS_DISPLAY, &dp_dev);
346 if (ret) {
347 debug("%s: device '%s' display not found (ret=%d)\n", __func__,
348 dev->name, ret);
Simon Glasse7e88232015-04-14 21:03:42 -0600349 return ret;
Simon Glassd7659212016-01-30 16:37:50 -0700350 }
Simon Glasse7e88232015-04-14 21:03:42 -0600351
Simon Glassd7659212016-01-30 16:37:50 -0700352 disp_uc_plat = dev_get_uclass_platdata(dp_dev);
353 debug("Found device '%s', disp_uc_priv=%p\n", dp_dev->name,
354 disp_uc_plat);
355 disp_uc_plat->src_dev = dev;
356
357 ret = uclass_get_device(UCLASS_DISPLAY, 0, &dp_dev);
358 if (ret) {
359 debug("%s: Failed to probe eDP, ret=%d\n", __func__, ret);
360 return ret;
361 }
362
Simon Glass079ff3b2017-07-25 08:30:01 -0600363 dc_ctlr = (struct dc_ctlr *)dev_read_addr(dev);
364 if (ofnode_decode_display_timing(dev_ofnode(dev), 0, timing)) {
Simon Glassd7659212016-01-30 16:37:50 -0700365 debug("%s: Failed to decode display timing\n", __func__);
Simon Glasse7e88232015-04-14 21:03:42 -0600366 return -EINVAL;
Simon Glassd7659212016-01-30 16:37:50 -0700367 }
Simon Glasse7e88232015-04-14 21:03:42 -0600368
369 ret = display_update_config_from_edid(dp_dev, &panel_bpp, timing);
370 if (ret) {
371 debug("%s: Failed to decode EDID, using defaults\n", __func__);
372 dump_config(panel_bpp, timing);
373 }
374
Simon Glasse7e88232015-04-14 21:03:42 -0600375 /*
376 * The plld is programmed with the assumption of the SHIFT_CLK_DIVIDER
377 * and PIXEL_CLK_DIVIDER are zero (divide by 1). See the
378 * update_display_mode() for detail.
379 */
380 plld_rate = clock_set_display_rate(timing->pixelclock.typ * 2);
381 if (plld_rate == 0) {
382 printf("dc: clock init failed\n");
383 return -EIO;
384 } else if (plld_rate != timing->pixelclock.typ * 2) {
385 debug("dc: plld rounded to %u\n", plld_rate);
386 timing->pixelclock.typ = plld_rate / 2;
387 }
388
389 /* Init dc */
390 ret = tegra_dc_init(dc_ctlr);
391 if (ret) {
392 debug("dc: init failed\n");
393 return ret;
394 }
395
396 /* Configure dc mode */
397 ret = update_display_mode(dc_ctlr, timing, href_to_sync, vref_to_sync);
398 if (ret) {
399 debug("dc: failed to configure display mode\n");
400 return ret;
401 }
402
403 /* Enable dp */
Simon Glass2dcf1432016-01-21 19:45:00 -0700404 ret = display_enable(dp_dev, panel_bpp, timing);
Simon Glassd7659212016-01-30 16:37:50 -0700405 if (ret) {
406 debug("dc: failed to enable display: ret=%d\n", ret);
Simon Glasse7e88232015-04-14 21:03:42 -0600407 return ret;
Simon Glassd7659212016-01-30 16:37:50 -0700408 }
Simon Glasse7e88232015-04-14 21:03:42 -0600409
410 ret = update_window(dc_ctlr, (ulong)lcdbase, fb_bits_per_pixel, timing);
Simon Glassd7659212016-01-30 16:37:50 -0700411 if (ret) {
412 debug("dc: failed to update window\n");
Simon Glasse7e88232015-04-14 21:03:42 -0600413 return ret;
Simon Glasse7e88232015-04-14 21:03:42 -0600414 }
Simon Glass079ff3b2017-07-25 08:30:01 -0600415 debug("%s: ready\n", __func__);
Simon Glasse7e88232015-04-14 21:03:42 -0600416
417 return 0;
418}
Simon Glass4dd81152016-01-30 16:37:47 -0700419
420enum {
421 /* Maximum LCD size we support */
422 LCD_MAX_WIDTH = 1920,
423 LCD_MAX_HEIGHT = 1200,
424 LCD_MAX_LOG2_BPP = 4, /* 2^4 = 16 bpp */
425};
426
Simon Glassd7659212016-01-30 16:37:50 -0700427static int tegra124_lcd_init(struct udevice *dev, void *lcdbase,
428 enum video_log2_bpp l2bpp)
Simon Glass4dd81152016-01-30 16:37:47 -0700429{
Simon Glassd7659212016-01-30 16:37:50 -0700430 struct video_priv *uc_priv = dev_get_uclass_priv(dev);
Simon Glass4dd81152016-01-30 16:37:47 -0700431 struct display_timing timing;
432 int ret;
433
434 clock_set_up_plldp();
435 clock_start_periph_pll(PERIPH_ID_HOST1X, CLOCK_ID_PERIPH, 408000000);
436
437 clock_enable(PERIPH_ID_HOST1X);
438 clock_enable(PERIPH_ID_DISP1);
439 clock_enable(PERIPH_ID_PWM);
440 clock_enable(PERIPH_ID_DPAUX);
441 clock_enable(PERIPH_ID_SOR0);
442 udelay(2);
443
444 reset_set_enable(PERIPH_ID_HOST1X, 0);
445 reset_set_enable(PERIPH_ID_DISP1, 0);
446 reset_set_enable(PERIPH_ID_PWM, 0);
447 reset_set_enable(PERIPH_ID_DPAUX, 0);
448 reset_set_enable(PERIPH_ID_SOR0, 0);
449
Simon Glassd7659212016-01-30 16:37:50 -0700450 ret = display_init(dev, lcdbase, 1 << l2bpp, &timing);
Simon Glass4dd81152016-01-30 16:37:47 -0700451 if (ret)
452 return ret;
453
Simon Glassd7659212016-01-30 16:37:50 -0700454 uc_priv->xsize = roundup(timing.hactive.typ, 16);
455 uc_priv->ysize = timing.vactive.typ;
456 uc_priv->bpix = l2bpp;
Simon Glass4dd81152016-01-30 16:37:47 -0700457
Simon Glassd7659212016-01-30 16:37:50 -0700458 video_set_flush_dcache(dev, 1);
459 debug("%s: done\n", __func__);
Simon Glass4dd81152016-01-30 16:37:47 -0700460
461 return 0;
462}
463
Simon Glassd7659212016-01-30 16:37:50 -0700464static int tegra124_lcd_probe(struct udevice *dev)
Simon Glass4dd81152016-01-30 16:37:47 -0700465{
Simon Glassd7659212016-01-30 16:37:50 -0700466 struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
Simon Glass4dd81152016-01-30 16:37:47 -0700467 ulong start;
468 int ret;
469
470 start = get_timer(0);
Simon Glass23acc482017-06-12 06:21:32 -0600471 bootstage_start(BOOTSTAGE_ID_ACCUM_LCD, "lcd");
Simon Glassd7659212016-01-30 16:37:50 -0700472 ret = tegra124_lcd_init(dev, (void *)plat->base, VIDEO_BPP16);
Simon Glass23acc482017-06-12 06:21:32 -0600473 bootstage_accum(BOOTSTAGE_ID_ACCUM_LCD);
Simon Glass4dd81152016-01-30 16:37:47 -0700474 debug("LCD init took %lu ms\n", get_timer(start));
475 if (ret)
476 printf("%s: Error %d\n", __func__, ret);
Simon Glassd7659212016-01-30 16:37:50 -0700477
478 return 0;
Simon Glass4dd81152016-01-30 16:37:47 -0700479}
480
Simon Glassd7659212016-01-30 16:37:50 -0700481static int tegra124_lcd_bind(struct udevice *dev)
Simon Glass4dd81152016-01-30 16:37:47 -0700482{
Simon Glassd7659212016-01-30 16:37:50 -0700483 struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
484
485 uc_plat->size = LCD_MAX_WIDTH * LCD_MAX_HEIGHT *
486 (1 << VIDEO_BPP16) / 8;
487 debug("%s: Frame buffer size %x\n", __func__, uc_plat->size);
488
489 return 0;
Simon Glass4dd81152016-01-30 16:37:47 -0700490}
Simon Glassd7659212016-01-30 16:37:50 -0700491
492static const struct udevice_id tegra124_lcd_ids[] = {
493 { .compatible = "nvidia,tegra124-dc" },
494 { }
495};
496
497U_BOOT_DRIVER(tegra124_dc) = {
498 .name = "tegra124-dc",
499 .id = UCLASS_VIDEO,
500 .of_match = tegra124_lcd_ids,
501 .bind = tegra124_lcd_bind,
502 .probe = tegra124_lcd_probe,
503};