blob: 920752295354d01c26708ccebe89a18e2f25ff9e [file] [log] [blame]
Rajeshwari Birjee106bd92013-12-26 09:44:24 +05301/*
2 * Copyright (C) 2013 Samsung Electronics
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
8#include <fdtdec.h>
9#include <asm/io.h>
10#include <i2c.h>
11#include <lcd.h>
12#include <spi.h>
13#include <asm/arch/board.h>
14#include <asm/arch/cpu.h>
15#include <asm/arch/gpio.h>
16#include <asm/arch/pinmux.h>
17#include <asm/arch/dp_info.h>
18
19DECLARE_GLOBAL_DATA_PTR;
20
21#ifdef CONFIG_USB_EHCI_EXYNOS
22static int board_usb_vbus_init(void)
23{
Rajeshwari Birjee106bd92013-12-26 09:44:24 +053024 /* Enable VBUS power switch */
Akshay Saraswatf6ae1ca2014-05-13 10:30:14 +053025 gpio_direction_output(EXYNOS5420_GPIO_X26, 1);
Rajeshwari Birjee106bd92013-12-26 09:44:24 +053026
27 /* VBUS turn ON time */
28 mdelay(3);
29
30 return 0;
31}
32#endif
33
34int exynos_init(void)
35{
36#ifdef CONFIG_USB_EHCI_EXYNOS
37 board_usb_vbus_init();
38#endif
39 return 0;
40}
41
42#ifdef CONFIG_LCD
43void cfg_lcd_gpio(void)
44{
45 struct exynos5_gpio_part1 *gpio1 =
46 (struct exynos5_gpio_part1 *)samsung_get_base_gpio_part1();
47
48 /* For Backlight */
Akshay Saraswatf6ae1ca2014-05-13 10:30:14 +053049 gpio_cfg_pin(EXYNOS5420_GPIO_B20, S5P_GPIO_OUTPUT);
50 gpio_set_value(EXYNOS5420_GPIO_B20, 1);
Rajeshwari Birjee106bd92013-12-26 09:44:24 +053051
52 /* LCD power on */
Akshay Saraswatf6ae1ca2014-05-13 10:30:14 +053053 gpio_cfg_pin(EXYNOS5420_GPIO_X15, S5P_GPIO_OUTPUT);
54 gpio_set_value(EXYNOS5420_GPIO_X15, 1);
Rajeshwari Birjee106bd92013-12-26 09:44:24 +053055
56 /* Set Hotplug detect for DP */
Akshay Saraswatf6ae1ca2014-05-13 10:30:14 +053057 gpio_cfg_pin(EXYNOS5420_GPIO_X07, S5P_GPIO_FUNC(0x3));
Rajeshwari Birjee106bd92013-12-26 09:44:24 +053058}
59
60vidinfo_t panel_info = {
61 .vl_freq = 60,
62 .vl_col = 2560,
63 .vl_row = 1600,
64 .vl_width = 2560,
65 .vl_height = 1600,
66 .vl_clkp = CONFIG_SYS_LOW,
67 .vl_hsp = CONFIG_SYS_LOW,
68 .vl_vsp = CONFIG_SYS_LOW,
69 .vl_dp = CONFIG_SYS_LOW,
70 .vl_bpix = 4, /* LCD_BPP = 2^4, for output conosle on LCD */
71
72 /* wDP panel timing infomation */
73 .vl_hspw = 32,
74 .vl_hbpd = 80,
75 .vl_hfpd = 48,
76
77 .vl_vspw = 6,
78 .vl_vbpd = 37,
79 .vl_vfpd = 3,
80 .vl_cmd_allow_len = 0xf,
81
82 .win_id = 3,
83 .cfg_gpio = cfg_lcd_gpio,
84 .backlight_on = NULL,
85 .lcd_power_on = NULL,
86 .reset_lcd = NULL,
87 .dual_lcd_enabled = 0,
88
89 .init_delay = 0,
90 .power_on_delay = 0,
91 .reset_delay = 0,
92 .interface_mode = FIMD_RGB_INTERFACE,
93 .dp_enabled = 1,
94};
95
96static struct edp_device_info edp_info = {
97 .disp_info = {
98 .h_res = 2560,
99 .h_sync_width = 32,
100 .h_back_porch = 80,
101 .h_front_porch = 48,
102 .v_res = 1600,
103 .v_sync_width = 6,
104 .v_back_porch = 37,
105 .v_front_porch = 3,
106 .v_sync_rate = 60,
107 },
108 .lt_info = {
109 .lt_status = DP_LT_NONE,
110 },
111 .video_info = {
112 .master_mode = 0,
113 .bist_mode = DP_DISABLE,
114 .bist_pattern = NO_PATTERN,
115 .h_sync_polarity = 0,
116 .v_sync_polarity = 0,
117 .interlaced = 0,
118 .color_space = COLOR_RGB,
119 .dynamic_range = VESA,
120 .ycbcr_coeff = COLOR_YCBCR601,
121 .color_depth = COLOR_8,
122 },
123};
124
125static struct exynos_dp_platform_data dp_platform_data = {
126 .phy_enable = set_dp_phy_ctrl,
127 .edp_dev_info = &edp_info,
128};
129
130void init_panel_info(vidinfo_t *vid)
131{
132 vid->rgb_mode = MODE_RGB_P;
133
134 exynos_set_dp_platform_data(&dp_platform_data);
135}
136#endif
137
138int board_get_revision(void)
139{
140 return 0;
141}