2 * Copyright 2014 Google Inc.
4 * SPDX-License-Identifier: GPL-2.0+
13 #include <asm/arch-tegra/clk_rst.h>
14 #include <asm/arch/clock.h>
15 #include <asm/arch-tegra/dc.h>
18 DECLARE_GLOBAL_DATA_PTR;
21 /* Maximum LCD size we support */
23 LCD_MAX_HEIGHT = 1200,
24 LCD_MAX_LOG2_BPP = 4, /* 2^4 = 16 bpp */
27 vidinfo_t panel_info = {
28 /* Insert a value here so that we don't end up in the BSS */
32 int tegra_lcd_check_next_stage(const void *blob, int wait)
37 void tegra_lcd_early_init(const void *blob)
40 * Go with the maximum size for now. We will fix this up after
41 * relocation. These values are only used for memory alocation.
43 panel_info.vl_col = LCD_MAX_WIDTH;
44 panel_info.vl_row = LCD_MAX_HEIGHT;
45 panel_info.vl_bpix = LCD_MAX_LOG2_BPP;
48 static int tegra124_lcd_init(void *lcdbase)
50 struct display_timing timing;
54 clock_start_periph_pll(PERIPH_ID_HOST1X, CLOCK_ID_PERIPH, 408000000);
56 clock_enable(PERIPH_ID_HOST1X);
57 clock_enable(PERIPH_ID_DISP1);
58 clock_enable(PERIPH_ID_PWM);
59 clock_enable(PERIPH_ID_DPAUX);
60 clock_enable(PERIPH_ID_SOR0);
63 reset_set_enable(PERIPH_ID_HOST1X, 0);
64 reset_set_enable(PERIPH_ID_DISP1, 0);
65 reset_set_enable(PERIPH_ID_PWM, 0);
66 reset_set_enable(PERIPH_ID_DPAUX, 0);
67 reset_set_enable(PERIPH_ID_SOR0, 0);
69 ret = display_init(lcdbase, 1 << LCD_BPP, &timing);
73 panel_info.vl_col = roundup(timing.hactive.typ, 16);
74 panel_info.vl_row = timing.vactive.typ;
76 lcd_set_flush_dcache(1);
81 void lcd_ctrl_init(void *lcdbase)
87 ret = tegra124_lcd_init(lcdbase);
88 debug("LCD init took %lu ms\n", get_timer(start));
90 printf("%s: Error %d\n", __func__, ret);