blob: 69992b3c2ba062fe82e4a7c274e3fc64d0424b04 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Donghwa Lee0112fed2012-04-05 19:36:17 +00002/*
3 * Copyright (C) 2012 Samsung Electronics
4 *
5 * Author: InKi Dae <inki.dae@samsung.com>
6 * Author: Donghwa Lee <dh09.lee@samsung.com>
Donghwa Lee0112fed2012-04-05 19:36:17 +00007 */
8
9#include <config.h>
10#include <common.h>
Simon Glassa1015ad2016-02-21 21:09:01 -070011#include <display.h>
Simon Glassc9ed7a42016-02-21 21:08:48 -070012#include <div64.h>
Simon Glassa1015ad2016-02-21 21:09:01 -070013#include <dm.h>
Ajay Kumarebbace32013-02-21 23:53:01 +000014#include <fdtdec.h>
Simon Glass0f2af882020-05-10 11:40:05 -060015#include <log.h>
Simon Glass3ba929a2020-10-30 21:38:53 -060016#include <asm/global_data.h>
Masahiro Yamada75f82d02018-03-05 01:20:11 +090017#include <linux/libfdt.h>
Simon Glassa1015ad2016-02-21 21:09:01 -070018#include <panel.h>
19#include <video.h>
20#include <video_bridge.h>
Donghwa Lee0112fed2012-04-05 19:36:17 +000021#include <asm/io.h>
22#include <asm/arch/cpu.h>
23#include <asm/arch/clock.h>
24#include <asm/arch/clk.h>
25#include <asm/arch/mipi_dsim.h>
Donghwa Leebc72aeb2012-07-02 01:16:08 +000026#include <asm/arch/dp_info.h>
Simon Glassa1015ad2016-02-21 21:09:01 -070027#include <asm/arch/fb.h>
28#include <asm/arch/pinmux.h>
Donghwa Lee0112fed2012-04-05 19:36:17 +000029#include <asm/arch/system.h>
Ajay Kumar39ea08b2015-03-04 19:05:26 +053030#include <asm/gpio.h>
Masahiro Yamada64e4f7f2016-09-21 11:28:57 +090031#include <linux/errno.h>
Donghwa Lee0112fed2012-04-05 19:36:17 +000032
Ajay Kumarebbace32013-02-21 23:53:01 +000033DECLARE_GLOBAL_DATA_PTR;
34
Simon Glassa1015ad2016-02-21 21:09:01 -070035enum {
36 FIMD_RGB_INTERFACE = 1,
37 FIMD_CPU_INTERFACE = 2,
38};
39
40enum exynos_fb_rgb_mode_t {
41 MODE_RGB_P = 0,
42 MODE_BGR_P = 1,
43 MODE_RGB_S = 2,
44 MODE_BGR_S = 3,
Ajay Kumarebbace32013-02-21 23:53:01 +000045};
Ajay Kumarebbace32013-02-21 23:53:01 +000046
Simon Glassa1015ad2016-02-21 21:09:01 -070047struct exynos_fb_priv {
48 ushort vl_col; /* Number of columns (i.e. 640) */
49 ushort vl_row; /* Number of rows (i.e. 480) */
50 ushort vl_rot; /* Rotation of Display (0, 1, 2, 3) */
51 ushort vl_width; /* Width of display area in millimeters */
52 ushort vl_height; /* Height of display area in millimeters */
53
54 /* LCD configuration register */
55 u_char vl_freq; /* Frequency */
56 u_char vl_clkp; /* Clock polarity */
57 u_char vl_oep; /* Output Enable polarity */
58 u_char vl_hsp; /* Horizontal Sync polarity */
59 u_char vl_vsp; /* Vertical Sync polarity */
60 u_char vl_dp; /* Data polarity */
61 u_char vl_bpix; /* Bits per pixel */
62
63 /* Horizontal control register. Timing from data sheet */
64 u_char vl_hspw; /* Horz sync pulse width */
65 u_char vl_hfpd; /* Wait before of line */
66 u_char vl_hbpd; /* Wait end of line */
67
68 /* Vertical control register. */
69 u_char vl_vspw; /* Vertical sync pulse width */
70 u_char vl_vfpd; /* Wait before of frame */
71 u_char vl_vbpd; /* Wait end of frame */
72 u_char vl_cmd_allow_len; /* Wait end of frame */
73
74 unsigned int win_id;
75 unsigned int init_delay;
76 unsigned int power_on_delay;
77 unsigned int reset_delay;
78 unsigned int interface_mode;
79 unsigned int mipi_enabled;
80 unsigned int dp_enabled;
81 unsigned int cs_setup;
82 unsigned int wr_setup;
83 unsigned int wr_act;
84 unsigned int wr_hold;
85 unsigned int logo_on;
86 unsigned int logo_width;
87 unsigned int logo_height;
88 int logo_x_offset;
89 int logo_y_offset;
90 unsigned long logo_addr;
91 unsigned int rgb_mode;
92 unsigned int resolution;
93
94 /* parent clock name(MPLL, EPLL or VPLL) */
95 unsigned int pclk_name;
96 /* ratio value for source clock from parent clock. */
97 unsigned int sclk_div;
98
99 unsigned int dual_lcd_enabled;
100 struct exynos_fb *reg;
101 struct exynos_platform_mipi_dsim *dsim_platform_data_dt;
102};
103
104static void exynos_fimd_set_dualrgb(struct exynos_fb_priv *priv, bool enabled)
Simon Glassc9ed7a42016-02-21 21:08:48 -0700105{
Simon Glass305f5812016-02-21 21:09:00 -0700106 struct exynos_fb *reg = priv->reg;
Simon Glassc9ed7a42016-02-21 21:08:48 -0700107 unsigned int cfg = 0;
108
109 if (enabled) {
110 cfg = EXYNOS_DUALRGB_BYPASS_DUAL | EXYNOS_DUALRGB_LINESPLIT |
111 EXYNOS_DUALRGB_VDEN_EN_ENABLE;
112
113 /* in case of Line Split mode, MAIN_CNT doesn't neet to set. */
Simon Glass305f5812016-02-21 21:09:00 -0700114 cfg |= EXYNOS_DUALRGB_SUB_CNT(priv->vl_col / 2) |
Simon Glassc9ed7a42016-02-21 21:08:48 -0700115 EXYNOS_DUALRGB_MAIN_CNT(0);
116 }
117
Simon Glass305f5812016-02-21 21:09:00 -0700118 writel(cfg, &reg->dualrgb);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700119}
120
Simon Glassa1015ad2016-02-21 21:09:01 -0700121static void exynos_fimd_set_dp_clkcon(struct exynos_fb_priv *priv,
Simon Glassc9ed7a42016-02-21 21:08:48 -0700122 unsigned int enabled)
123{
Simon Glass305f5812016-02-21 21:09:00 -0700124 struct exynos_fb *reg = priv->reg;
Simon Glassc9ed7a42016-02-21 21:08:48 -0700125 unsigned int cfg = 0;
126
127 if (enabled)
128 cfg = EXYNOS_DP_CLK_ENABLE;
129
Simon Glass305f5812016-02-21 21:09:00 -0700130 writel(cfg, &reg->dp_mie_clkcon);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700131}
132
Simon Glassa1015ad2016-02-21 21:09:01 -0700133static void exynos_fimd_set_par(struct exynos_fb_priv *priv,
134 unsigned int win_id)
Simon Glassc9ed7a42016-02-21 21:08:48 -0700135{
Simon Glass305f5812016-02-21 21:09:00 -0700136 struct exynos_fb *reg = priv->reg;
Simon Glassc9ed7a42016-02-21 21:08:48 -0700137 unsigned int cfg = 0;
138
139 /* set window control */
Simon Glass305f5812016-02-21 21:09:00 -0700140 cfg = readl((unsigned int)&reg->wincon0 +
Simon Glassc9ed7a42016-02-21 21:08:48 -0700141 EXYNOS_WINCON(win_id));
142
143 cfg &= ~(EXYNOS_WINCON_BITSWP_ENABLE | EXYNOS_WINCON_BYTESWP_ENABLE |
144 EXYNOS_WINCON_HAWSWP_ENABLE | EXYNOS_WINCON_WSWP_ENABLE |
145 EXYNOS_WINCON_BURSTLEN_MASK | EXYNOS_WINCON_BPPMODE_MASK |
146 EXYNOS_WINCON_INRGB_MASK | EXYNOS_WINCON_DATAPATH_MASK);
147
148 /* DATAPATH is DMA */
149 cfg |= EXYNOS_WINCON_DATAPATH_DMA;
150
151 cfg |= EXYNOS_WINCON_HAWSWP_ENABLE;
152
153 /* dma burst is 16 */
154 cfg |= EXYNOS_WINCON_BURSTLEN_16WORD;
155
Simon Glass305f5812016-02-21 21:09:00 -0700156 switch (priv->vl_bpix) {
Simon Glassc9ed7a42016-02-21 21:08:48 -0700157 case 4:
158 cfg |= EXYNOS_WINCON_BPPMODE_16BPP_565;
159 break;
160 default:
161 cfg |= EXYNOS_WINCON_BPPMODE_24BPP_888;
162 break;
163 }
164
Simon Glass305f5812016-02-21 21:09:00 -0700165 writel(cfg, (unsigned int)&reg->wincon0 +
Simon Glassc9ed7a42016-02-21 21:08:48 -0700166 EXYNOS_WINCON(win_id));
167
168 /* set window position to x=0, y=0*/
169 cfg = EXYNOS_VIDOSD_LEFT_X(0) | EXYNOS_VIDOSD_TOP_Y(0);
Simon Glass305f5812016-02-21 21:09:00 -0700170 writel(cfg, (unsigned int)&reg->vidosd0a +
Simon Glassc9ed7a42016-02-21 21:08:48 -0700171 EXYNOS_VIDOSD(win_id));
172
Simon Glass305f5812016-02-21 21:09:00 -0700173 cfg = EXYNOS_VIDOSD_RIGHT_X(priv->vl_col - 1) |
174 EXYNOS_VIDOSD_BOTTOM_Y(priv->vl_row - 1) |
Simon Glassc9ed7a42016-02-21 21:08:48 -0700175 EXYNOS_VIDOSD_RIGHT_X_E(1) |
176 EXYNOS_VIDOSD_BOTTOM_Y_E(0);
177
Simon Glass305f5812016-02-21 21:09:00 -0700178 writel(cfg, (unsigned int)&reg->vidosd0b +
Simon Glassc9ed7a42016-02-21 21:08:48 -0700179 EXYNOS_VIDOSD(win_id));
180
181 /* set window size for window0*/
Simon Glass305f5812016-02-21 21:09:00 -0700182 cfg = EXYNOS_VIDOSD_SIZE(priv->vl_col * priv->vl_row);
183 writel(cfg, (unsigned int)&reg->vidosd0c +
Simon Glassc9ed7a42016-02-21 21:08:48 -0700184 EXYNOS_VIDOSD(win_id));
185}
186
Simon Glassa1015ad2016-02-21 21:09:01 -0700187static void exynos_fimd_set_buffer_address(struct exynos_fb_priv *priv,
Simon Glassc9ed7a42016-02-21 21:08:48 -0700188 unsigned int win_id,
189 ulong lcd_base_addr)
190{
Simon Glass305f5812016-02-21 21:09:00 -0700191 struct exynos_fb *reg = priv->reg;
Simon Glassc9ed7a42016-02-21 21:08:48 -0700192 unsigned long start_addr, end_addr;
193
194 start_addr = lcd_base_addr;
Simon Glassa1015ad2016-02-21 21:09:01 -0700195 end_addr = start_addr + ((priv->vl_col * (VNBITS(priv->vl_bpix) / 8)) *
Simon Glass305f5812016-02-21 21:09:00 -0700196 priv->vl_row);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700197
Simon Glass305f5812016-02-21 21:09:00 -0700198 writel(start_addr, (unsigned int)&reg->vidw00add0b0 +
Simon Glassc9ed7a42016-02-21 21:08:48 -0700199 EXYNOS_BUFFER_OFFSET(win_id));
Simon Glass305f5812016-02-21 21:09:00 -0700200 writel(end_addr, (unsigned int)&reg->vidw00add1b0 +
Simon Glassc9ed7a42016-02-21 21:08:48 -0700201 EXYNOS_BUFFER_OFFSET(win_id));
202}
203
Simon Glassa1015ad2016-02-21 21:09:01 -0700204static void exynos_fimd_set_clock(struct exynos_fb_priv *priv)
Simon Glassc9ed7a42016-02-21 21:08:48 -0700205{
Simon Glass305f5812016-02-21 21:09:00 -0700206 struct exynos_fb *reg = priv->reg;
Simon Glassc9ed7a42016-02-21 21:08:48 -0700207 unsigned int cfg = 0, div = 0, remainder, remainder_div;
208 unsigned long pixel_clock;
209 unsigned long long src_clock;
210
Simon Glass305f5812016-02-21 21:09:00 -0700211 if (priv->dual_lcd_enabled) {
212 pixel_clock = priv->vl_freq *
213 (priv->vl_hspw + priv->vl_hfpd +
214 priv->vl_hbpd + priv->vl_col / 2) *
215 (priv->vl_vspw + priv->vl_vfpd +
216 priv->vl_vbpd + priv->vl_row);
217 } else if (priv->interface_mode == FIMD_CPU_INTERFACE) {
218 pixel_clock = priv->vl_freq *
219 priv->vl_width * priv->vl_height *
220 (priv->cs_setup + priv->wr_setup +
221 priv->wr_act + priv->wr_hold + 1);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700222 } else {
Simon Glass305f5812016-02-21 21:09:00 -0700223 pixel_clock = priv->vl_freq *
224 (priv->vl_hspw + priv->vl_hfpd +
225 priv->vl_hbpd + priv->vl_col) *
226 (priv->vl_vspw + priv->vl_vfpd +
227 priv->vl_vbpd + priv->vl_row);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700228 }
229
Simon Glass305f5812016-02-21 21:09:00 -0700230 cfg = readl(&reg->vidcon0);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700231 cfg &= ~(EXYNOS_VIDCON0_CLKSEL_MASK | EXYNOS_VIDCON0_CLKVALUP_MASK |
232 EXYNOS_VIDCON0_CLKVAL_F(0xFF) | EXYNOS_VIDCON0_VCLKEN_MASK |
233 EXYNOS_VIDCON0_CLKDIR_MASK);
234 cfg |= (EXYNOS_VIDCON0_CLKSEL_SCLK | EXYNOS_VIDCON0_CLKVALUP_ALWAYS |
235 EXYNOS_VIDCON0_VCLKEN_NORMAL | EXYNOS_VIDCON0_CLKDIR_DIVIDED);
236
237 src_clock = (unsigned long long) get_lcd_clk();
238
239 /* get quotient and remainder. */
240 remainder = do_div(src_clock, pixel_clock);
241 div = src_clock;
242
243 remainder *= 10;
244 remainder_div = remainder / pixel_clock;
245
246 /* round about one places of decimals. */
247 if (remainder_div >= 5)
248 div++;
249
250 /* in case of dual lcd mode. */
Simon Glass305f5812016-02-21 21:09:00 -0700251 if (priv->dual_lcd_enabled)
Simon Glassc9ed7a42016-02-21 21:08:48 -0700252 div--;
253
254 cfg |= EXYNOS_VIDCON0_CLKVAL_F(div - 1);
Simon Glass305f5812016-02-21 21:09:00 -0700255 writel(cfg, &reg->vidcon0);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700256}
257
Simon Glassa1015ad2016-02-21 21:09:01 -0700258void exynos_set_trigger(struct exynos_fb_priv *priv)
Simon Glassc9ed7a42016-02-21 21:08:48 -0700259{
Simon Glass305f5812016-02-21 21:09:00 -0700260 struct exynos_fb *reg = priv->reg;
Simon Glassc9ed7a42016-02-21 21:08:48 -0700261 unsigned int cfg = 0;
262
Simon Glass305f5812016-02-21 21:09:00 -0700263 cfg = readl(&reg->trigcon);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700264
265 cfg |= (EXYNOS_I80SOFT_TRIG_EN | EXYNOS_I80START_TRIG);
266
Simon Glass305f5812016-02-21 21:09:00 -0700267 writel(cfg, &reg->trigcon);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700268}
269
Simon Glassa1015ad2016-02-21 21:09:01 -0700270int exynos_is_i80_frame_done(struct exynos_fb_priv *priv)
Simon Glassc9ed7a42016-02-21 21:08:48 -0700271{
Simon Glass305f5812016-02-21 21:09:00 -0700272 struct exynos_fb *reg = priv->reg;
Simon Glassc9ed7a42016-02-21 21:08:48 -0700273 unsigned int cfg = 0;
274 int status;
275
Simon Glass305f5812016-02-21 21:09:00 -0700276 cfg = readl(&reg->trigcon);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700277
278 /* frame done func is valid only when TRIMODE[0] is set to 1. */
279 status = (cfg & EXYNOS_I80STATUS_TRIG_DONE) ==
280 EXYNOS_I80STATUS_TRIG_DONE;
281
282 return status;
283}
284
Simon Glassa1015ad2016-02-21 21:09:01 -0700285static void exynos_fimd_lcd_on(struct exynos_fb_priv *priv)
Simon Glassc9ed7a42016-02-21 21:08:48 -0700286{
Simon Glass305f5812016-02-21 21:09:00 -0700287 struct exynos_fb *reg = priv->reg;
Simon Glassc9ed7a42016-02-21 21:08:48 -0700288 unsigned int cfg = 0;
289
290 /* display on */
Simon Glass305f5812016-02-21 21:09:00 -0700291 cfg = readl(&reg->vidcon0);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700292 cfg |= (EXYNOS_VIDCON0_ENVID_ENABLE | EXYNOS_VIDCON0_ENVID_F_ENABLE);
Simon Glass305f5812016-02-21 21:09:00 -0700293 writel(cfg, &reg->vidcon0);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700294}
295
Simon Glassa1015ad2016-02-21 21:09:01 -0700296static void exynos_fimd_window_on(struct exynos_fb_priv *priv,
297 unsigned int win_id)
Simon Glassc9ed7a42016-02-21 21:08:48 -0700298{
Simon Glass305f5812016-02-21 21:09:00 -0700299 struct exynos_fb *reg = priv->reg;
Simon Glassc9ed7a42016-02-21 21:08:48 -0700300 unsigned int cfg = 0;
301
302 /* enable window */
Simon Glass305f5812016-02-21 21:09:00 -0700303 cfg = readl((unsigned int)&reg->wincon0 +
Simon Glassc9ed7a42016-02-21 21:08:48 -0700304 EXYNOS_WINCON(win_id));
305 cfg |= EXYNOS_WINCON_ENWIN_ENABLE;
Simon Glass305f5812016-02-21 21:09:00 -0700306 writel(cfg, (unsigned int)&reg->wincon0 +
Simon Glassc9ed7a42016-02-21 21:08:48 -0700307 EXYNOS_WINCON(win_id));
308
Simon Glass305f5812016-02-21 21:09:00 -0700309 cfg = readl(&reg->winshmap);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700310 cfg |= EXYNOS_WINSHMAP_CH_ENABLE(win_id);
Simon Glass305f5812016-02-21 21:09:00 -0700311 writel(cfg, &reg->winshmap);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700312}
313
Simon Glassa1015ad2016-02-21 21:09:01 -0700314void exynos_fimd_lcd_off(struct exynos_fb_priv *priv)
Simon Glassc9ed7a42016-02-21 21:08:48 -0700315{
Simon Glass305f5812016-02-21 21:09:00 -0700316 struct exynos_fb *reg = priv->reg;
Simon Glassc9ed7a42016-02-21 21:08:48 -0700317 unsigned int cfg = 0;
318
Simon Glass305f5812016-02-21 21:09:00 -0700319 cfg = readl(&reg->vidcon0);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700320 cfg &= (EXYNOS_VIDCON0_ENVID_DISABLE | EXYNOS_VIDCON0_ENVID_F_DISABLE);
Simon Glass305f5812016-02-21 21:09:00 -0700321 writel(cfg, &reg->vidcon0);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700322}
323
Simon Glassa1015ad2016-02-21 21:09:01 -0700324void exynos_fimd_window_off(struct exynos_fb_priv *priv, unsigned int win_id)
Simon Glassc9ed7a42016-02-21 21:08:48 -0700325{
Simon Glass305f5812016-02-21 21:09:00 -0700326 struct exynos_fb *reg = priv->reg;
Simon Glassc9ed7a42016-02-21 21:08:48 -0700327 unsigned int cfg = 0;
328
Simon Glass305f5812016-02-21 21:09:00 -0700329 cfg = readl((unsigned int)&reg->wincon0 +
Simon Glassc9ed7a42016-02-21 21:08:48 -0700330 EXYNOS_WINCON(win_id));
331 cfg &= EXYNOS_WINCON_ENWIN_DISABLE;
Simon Glass305f5812016-02-21 21:09:00 -0700332 writel(cfg, (unsigned int)&reg->wincon0 +
Simon Glassc9ed7a42016-02-21 21:08:48 -0700333 EXYNOS_WINCON(win_id));
334
Simon Glass305f5812016-02-21 21:09:00 -0700335 cfg = readl(&reg->winshmap);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700336 cfg &= ~EXYNOS_WINSHMAP_CH_DISABLE(win_id);
Simon Glass305f5812016-02-21 21:09:00 -0700337 writel(cfg, &reg->winshmap);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700338}
339
340/*
341* The reset value for FIMD SYSMMU register MMU_CTRL is 3
342* on Exynos5420 and newer versions.
343* This means FIMD SYSMMU is on by default on Exynos5420
344* and newer versions.
345* Since in u-boot we don't use SYSMMU, we should disable
346* those FIMD SYSMMU.
347* Note that there are 2 SYSMMU for FIMD: m0 and m1.
348* m0 handles windows 0 and 4, and m1 handles windows 1, 2 and 3.
349* We disable both of them here.
350*/
351void exynos_fimd_disable_sysmmu(void)
352{
353 u32 *sysmmufimd;
354 unsigned int node;
355 int node_list[2];
356 int count;
357 int i;
358
359 count = fdtdec_find_aliases_for_id(gd->fdt_blob, "fimd",
360 COMPAT_SAMSUNG_EXYNOS_SYSMMU, node_list, 2);
361 for (i = 0; i < count; i++) {
362 node = node_list[i];
363 if (node <= 0) {
364 debug("Can't get device node for fimd sysmmu\n");
365 return;
366 }
367
368 sysmmufimd = (u32 *)fdtdec_get_addr(gd->fdt_blob, node, "reg");
369 if (!sysmmufimd) {
370 debug("Can't get base address for sysmmu fimdm0");
371 return;
372 }
373
374 writel(0x0, sysmmufimd);
375 }
376}
377
Simon Glassa1015ad2016-02-21 21:09:01 -0700378void exynos_fimd_lcd_init(struct udevice *dev)
Simon Glassc9ed7a42016-02-21 21:08:48 -0700379{
Simon Glassa1015ad2016-02-21 21:09:01 -0700380 struct exynos_fb_priv *priv = dev_get_priv(dev);
Simon Glassb75b15b2020-12-03 16:55:23 -0700381 struct video_uc_plat *plat = dev_get_uclass_plat(dev);
Simon Glassa1015ad2016-02-21 21:09:01 -0700382 struct exynos_fb *reg = priv->reg;
Simon Glassc9ed7a42016-02-21 21:08:48 -0700383 unsigned int cfg = 0, rgb_mode;
384 unsigned int offset;
385 unsigned int node;
386
Simon Glassdd79d6e2017-01-17 16:52:55 -0700387 node = dev_of_offset(dev);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700388 if (fdtdec_get_bool(gd->fdt_blob, node, "samsung,disable-sysmmu"))
389 exynos_fimd_disable_sysmmu();
390
391 offset = exynos_fimd_get_base_offset();
392
Simon Glass305f5812016-02-21 21:09:00 -0700393 rgb_mode = priv->rgb_mode;
Simon Glassc9ed7a42016-02-21 21:08:48 -0700394
Simon Glass305f5812016-02-21 21:09:00 -0700395 if (priv->interface_mode == FIMD_RGB_INTERFACE) {
Simon Glassc9ed7a42016-02-21 21:08:48 -0700396 cfg |= EXYNOS_VIDCON0_VIDOUT_RGB;
Simon Glass305f5812016-02-21 21:09:00 -0700397 writel(cfg, &reg->vidcon0);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700398
Simon Glass305f5812016-02-21 21:09:00 -0700399 cfg = readl(&reg->vidcon2);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700400 cfg &= ~(EXYNOS_VIDCON2_WB_MASK |
401 EXYNOS_VIDCON2_TVFORMATSEL_MASK |
402 EXYNOS_VIDCON2_TVFORMATSEL_YUV_MASK);
403 cfg |= EXYNOS_VIDCON2_WB_DISABLE;
Simon Glass305f5812016-02-21 21:09:00 -0700404 writel(cfg, &reg->vidcon2);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700405
406 /* set polarity */
407 cfg = 0;
Simon Glass305f5812016-02-21 21:09:00 -0700408 if (!priv->vl_clkp)
Simon Glassc9ed7a42016-02-21 21:08:48 -0700409 cfg |= EXYNOS_VIDCON1_IVCLK_RISING_EDGE;
Simon Glass305f5812016-02-21 21:09:00 -0700410 if (!priv->vl_hsp)
Simon Glassc9ed7a42016-02-21 21:08:48 -0700411 cfg |= EXYNOS_VIDCON1_IHSYNC_INVERT;
Simon Glass305f5812016-02-21 21:09:00 -0700412 if (!priv->vl_vsp)
Simon Glassc9ed7a42016-02-21 21:08:48 -0700413 cfg |= EXYNOS_VIDCON1_IVSYNC_INVERT;
Simon Glass305f5812016-02-21 21:09:00 -0700414 if (!priv->vl_dp)
Simon Glassc9ed7a42016-02-21 21:08:48 -0700415 cfg |= EXYNOS_VIDCON1_IVDEN_INVERT;
416
Simon Glass305f5812016-02-21 21:09:00 -0700417 writel(cfg, (unsigned int)&reg->vidcon1 + offset);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700418
419 /* set timing */
Simon Glass305f5812016-02-21 21:09:00 -0700420 cfg = EXYNOS_VIDTCON0_VFPD(priv->vl_vfpd - 1);
421 cfg |= EXYNOS_VIDTCON0_VBPD(priv->vl_vbpd - 1);
422 cfg |= EXYNOS_VIDTCON0_VSPW(priv->vl_vspw - 1);
423 writel(cfg, (unsigned int)&reg->vidtcon0 + offset);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700424
Simon Glass305f5812016-02-21 21:09:00 -0700425 cfg = EXYNOS_VIDTCON1_HFPD(priv->vl_hfpd - 1);
426 cfg |= EXYNOS_VIDTCON1_HBPD(priv->vl_hbpd - 1);
427 cfg |= EXYNOS_VIDTCON1_HSPW(priv->vl_hspw - 1);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700428
Simon Glass305f5812016-02-21 21:09:00 -0700429 writel(cfg, (unsigned int)&reg->vidtcon1 + offset);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700430
431 /* set lcd size */
Simon Glass305f5812016-02-21 21:09:00 -0700432 cfg = EXYNOS_VIDTCON2_HOZVAL(priv->vl_col - 1) |
433 EXYNOS_VIDTCON2_LINEVAL(priv->vl_row - 1) |
434 EXYNOS_VIDTCON2_HOZVAL_E(priv->vl_col - 1) |
435 EXYNOS_VIDTCON2_LINEVAL_E(priv->vl_row - 1);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700436
Simon Glass305f5812016-02-21 21:09:00 -0700437 writel(cfg, (unsigned int)&reg->vidtcon2 + offset);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700438 }
439
440 /* set display mode */
Simon Glass305f5812016-02-21 21:09:00 -0700441 cfg = readl(&reg->vidcon0);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700442 cfg &= ~EXYNOS_VIDCON0_PNRMODE_MASK;
443 cfg |= (rgb_mode << EXYNOS_VIDCON0_PNRMODE_SHIFT);
Simon Glass305f5812016-02-21 21:09:00 -0700444 writel(cfg, &reg->vidcon0);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700445
446 /* set par */
Simon Glass305f5812016-02-21 21:09:00 -0700447 exynos_fimd_set_par(priv, priv->win_id);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700448
449 /* set memory address */
Simon Glassa1015ad2016-02-21 21:09:01 -0700450 exynos_fimd_set_buffer_address(priv, priv->win_id, plat->base);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700451
452 /* set buffer size */
Simon Glass305f5812016-02-21 21:09:00 -0700453 cfg = EXYNOS_VIDADDR_PAGEWIDTH(priv->vl_col *
Simon Glassa1015ad2016-02-21 21:09:01 -0700454 VNBITS(priv->vl_bpix) / 8) |
Simon Glass305f5812016-02-21 21:09:00 -0700455 EXYNOS_VIDADDR_PAGEWIDTH_E(priv->vl_col *
Simon Glassa1015ad2016-02-21 21:09:01 -0700456 VNBITS(priv->vl_bpix) / 8) |
Simon Glassc9ed7a42016-02-21 21:08:48 -0700457 EXYNOS_VIDADDR_OFFSIZE(0) |
458 EXYNOS_VIDADDR_OFFSIZE_E(0);
459
Simon Glass305f5812016-02-21 21:09:00 -0700460 writel(cfg, (unsigned int)&reg->vidw00add2 +
461 EXYNOS_BUFFER_SIZE(priv->win_id));
Simon Glassc9ed7a42016-02-21 21:08:48 -0700462
463 /* set clock */
Simon Glass305f5812016-02-21 21:09:00 -0700464 exynos_fimd_set_clock(priv);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700465
466 /* set rgb mode to dual lcd. */
Simon Glass305f5812016-02-21 21:09:00 -0700467 exynos_fimd_set_dualrgb(priv, priv->dual_lcd_enabled);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700468
469 /* display on */
Simon Glass305f5812016-02-21 21:09:00 -0700470 exynos_fimd_lcd_on(priv);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700471
472 /* window on */
Simon Glass305f5812016-02-21 21:09:00 -0700473 exynos_fimd_window_on(priv, priv->win_id);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700474
Simon Glass305f5812016-02-21 21:09:00 -0700475 exynos_fimd_set_dp_clkcon(priv, priv->dp_enabled);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700476}
477
Simon Glassa1015ad2016-02-21 21:09:01 -0700478unsigned long exynos_fimd_calc_fbsize(struct exynos_fb_priv *priv)
Simon Glassc9ed7a42016-02-21 21:08:48 -0700479{
Simon Glassa1015ad2016-02-21 21:09:01 -0700480 return priv->vl_col * priv->vl_row * (VNBITS(priv->vl_bpix) / 8);
Simon Glassc9ed7a42016-02-21 21:08:48 -0700481}
482
Simon Glassaad29ae2020-12-03 16:55:21 -0700483int exynos_fb_of_to_plat(struct udevice *dev)
Donghwa Lee0112fed2012-04-05 19:36:17 +0000484{
Simon Glassa1015ad2016-02-21 21:09:01 -0700485 struct exynos_fb_priv *priv = dev_get_priv(dev);
Simon Glassdd79d6e2017-01-17 16:52:55 -0700486 unsigned int node = dev_of_offset(dev);
Simon Glassa1015ad2016-02-21 21:09:01 -0700487 const void *blob = gd->fdt_blob;
488 fdt_addr_t addr;
Donghwa Lee0112fed2012-04-05 19:36:17 +0000489
Masahiro Yamadaa89b4de2020-07-17 14:36:48 +0900490 addr = dev_read_addr(dev);
Simon Glassa1015ad2016-02-21 21:09:01 -0700491 if (addr == FDT_ADDR_T_NONE) {
492 debug("Can't get the FIMD base address\n");
493 return -EINVAL;
Ajay Kumarebbace32013-02-21 23:53:01 +0000494 }
Simon Glassa1015ad2016-02-21 21:09:01 -0700495 priv->reg = (struct exynos_fb *)addr;
Ajay Kumarebbace32013-02-21 23:53:01 +0000496
Simon Glassa1015ad2016-02-21 21:09:01 -0700497 priv->vl_col = fdtdec_get_int(blob, node, "samsung,vl-col", 0);
498 if (priv->vl_col == 0) {
Ajay Kumarebbace32013-02-21 23:53:01 +0000499 debug("Can't get XRES\n");
500 return -ENXIO;
501 }
502
Simon Glassa1015ad2016-02-21 21:09:01 -0700503 priv->vl_row = fdtdec_get_int(blob, node, "samsung,vl-row", 0);
504 if (priv->vl_row == 0) {
Ajay Kumarebbace32013-02-21 23:53:01 +0000505 debug("Can't get YRES\n");
506 return -ENXIO;
507 }
508
Simon Glassa1015ad2016-02-21 21:09:01 -0700509 priv->vl_width = fdtdec_get_int(blob, node,
Ajay Kumarebbace32013-02-21 23:53:01 +0000510 "samsung,vl-width", 0);
511
Simon Glassa1015ad2016-02-21 21:09:01 -0700512 priv->vl_height = fdtdec_get_int(blob, node,
Ajay Kumarebbace32013-02-21 23:53:01 +0000513 "samsung,vl-height", 0);
514
Simon Glassa1015ad2016-02-21 21:09:01 -0700515 priv->vl_freq = fdtdec_get_int(blob, node, "samsung,vl-freq", 0);
516 if (priv->vl_freq == 0) {
Ajay Kumarebbace32013-02-21 23:53:01 +0000517 debug("Can't get refresh rate\n");
518 return -ENXIO;
519 }
520
521 if (fdtdec_get_bool(blob, node, "samsung,vl-clkp"))
Simon Glassa1015ad2016-02-21 21:09:01 -0700522 priv->vl_clkp = VIDEO_ACTIVE_LOW;
Ajay Kumarebbace32013-02-21 23:53:01 +0000523
524 if (fdtdec_get_bool(blob, node, "samsung,vl-oep"))
Simon Glassa1015ad2016-02-21 21:09:01 -0700525 priv->vl_oep = VIDEO_ACTIVE_LOW;
Ajay Kumarebbace32013-02-21 23:53:01 +0000526
527 if (fdtdec_get_bool(blob, node, "samsung,vl-hsp"))
Simon Glassa1015ad2016-02-21 21:09:01 -0700528 priv->vl_hsp = VIDEO_ACTIVE_LOW;
Ajay Kumarebbace32013-02-21 23:53:01 +0000529
530 if (fdtdec_get_bool(blob, node, "samsung,vl-vsp"))
Simon Glassa1015ad2016-02-21 21:09:01 -0700531 priv->vl_vsp = VIDEO_ACTIVE_LOW;
Ajay Kumarebbace32013-02-21 23:53:01 +0000532
533 if (fdtdec_get_bool(blob, node, "samsung,vl-dp"))
Simon Glassa1015ad2016-02-21 21:09:01 -0700534 priv->vl_dp = VIDEO_ACTIVE_LOW;
Ajay Kumarebbace32013-02-21 23:53:01 +0000535
Simon Glassa1015ad2016-02-21 21:09:01 -0700536 priv->vl_bpix = fdtdec_get_int(blob, node, "samsung,vl-bpix", 0);
537 if (priv->vl_bpix == 0) {
Ajay Kumarebbace32013-02-21 23:53:01 +0000538 debug("Can't get bits per pixel\n");
539 return -ENXIO;
540 }
541
Simon Glassa1015ad2016-02-21 21:09:01 -0700542 priv->vl_hspw = fdtdec_get_int(blob, node, "samsung,vl-hspw", 0);
543 if (priv->vl_hspw == 0) {
Ajay Kumarebbace32013-02-21 23:53:01 +0000544 debug("Can't get hsync width\n");
545 return -ENXIO;
546 }
547
Simon Glassa1015ad2016-02-21 21:09:01 -0700548 priv->vl_hfpd = fdtdec_get_int(blob, node, "samsung,vl-hfpd", 0);
549 if (priv->vl_hfpd == 0) {
Ajay Kumarebbace32013-02-21 23:53:01 +0000550 debug("Can't get right margin\n");
551 return -ENXIO;
552 }
553
Simon Glassa1015ad2016-02-21 21:09:01 -0700554 priv->vl_hbpd = (u_char)fdtdec_get_int(blob, node,
Ajay Kumarebbace32013-02-21 23:53:01 +0000555 "samsung,vl-hbpd", 0);
Simon Glassa1015ad2016-02-21 21:09:01 -0700556 if (priv->vl_hbpd == 0) {
Ajay Kumarebbace32013-02-21 23:53:01 +0000557 debug("Can't get left margin\n");
558 return -ENXIO;
559 }
560
Simon Glassa1015ad2016-02-21 21:09:01 -0700561 priv->vl_vspw = (u_char)fdtdec_get_int(blob, node,
Ajay Kumarebbace32013-02-21 23:53:01 +0000562 "samsung,vl-vspw", 0);
Simon Glassa1015ad2016-02-21 21:09:01 -0700563 if (priv->vl_vspw == 0) {
Ajay Kumarebbace32013-02-21 23:53:01 +0000564 debug("Can't get vsync width\n");
565 return -ENXIO;
566 }
567
Simon Glassa1015ad2016-02-21 21:09:01 -0700568 priv->vl_vfpd = fdtdec_get_int(blob, node,
Ajay Kumarebbace32013-02-21 23:53:01 +0000569 "samsung,vl-vfpd", 0);
Simon Glassa1015ad2016-02-21 21:09:01 -0700570 if (priv->vl_vfpd == 0) {
Ajay Kumarebbace32013-02-21 23:53:01 +0000571 debug("Can't get lower margin\n");
572 return -ENXIO;
573 }
574
Simon Glassa1015ad2016-02-21 21:09:01 -0700575 priv->vl_vbpd = fdtdec_get_int(blob, node, "samsung,vl-vbpd", 0);
576 if (priv->vl_vbpd == 0) {
Ajay Kumarebbace32013-02-21 23:53:01 +0000577 debug("Can't get upper margin\n");
578 return -ENXIO;
579 }
580
Simon Glassa1015ad2016-02-21 21:09:01 -0700581 priv->vl_cmd_allow_len = fdtdec_get_int(blob, node,
Ajay Kumarebbace32013-02-21 23:53:01 +0000582 "samsung,vl-cmd-allow-len", 0);
583
Simon Glassa1015ad2016-02-21 21:09:01 -0700584 priv->win_id = fdtdec_get_int(blob, node, "samsung,winid", 0);
585 priv->init_delay = fdtdec_get_int(blob, node,
Ajay Kumarebbace32013-02-21 23:53:01 +0000586 "samsung,init-delay", 0);
Simon Glassa1015ad2016-02-21 21:09:01 -0700587 priv->power_on_delay = fdtdec_get_int(blob, node,
Ajay Kumarebbace32013-02-21 23:53:01 +0000588 "samsung,power-on-delay", 0);
Simon Glassa1015ad2016-02-21 21:09:01 -0700589 priv->reset_delay = fdtdec_get_int(blob, node,
Ajay Kumarebbace32013-02-21 23:53:01 +0000590 "samsung,reset-delay", 0);
Simon Glassa1015ad2016-02-21 21:09:01 -0700591 priv->interface_mode = fdtdec_get_int(blob, node,
Ajay Kumarebbace32013-02-21 23:53:01 +0000592 "samsung,interface-mode", 0);
Simon Glassa1015ad2016-02-21 21:09:01 -0700593 priv->mipi_enabled = fdtdec_get_int(blob, node,
Ajay Kumarebbace32013-02-21 23:53:01 +0000594 "samsung,mipi-enabled", 0);
Simon Glassa1015ad2016-02-21 21:09:01 -0700595 priv->dp_enabled = fdtdec_get_int(blob, node,
Ajay Kumarebbace32013-02-21 23:53:01 +0000596 "samsung,dp-enabled", 0);
Simon Glassa1015ad2016-02-21 21:09:01 -0700597 priv->cs_setup = fdtdec_get_int(blob, node,
Ajay Kumarebbace32013-02-21 23:53:01 +0000598 "samsung,cs-setup", 0);
Simon Glassa1015ad2016-02-21 21:09:01 -0700599 priv->wr_setup = fdtdec_get_int(blob, node,
Ajay Kumarebbace32013-02-21 23:53:01 +0000600 "samsung,wr-setup", 0);
Simon Glassa1015ad2016-02-21 21:09:01 -0700601 priv->wr_act = fdtdec_get_int(blob, node, "samsung,wr-act", 0);
602 priv->wr_hold = fdtdec_get_int(blob, node, "samsung,wr-hold", 0);
Ajay Kumarebbace32013-02-21 23:53:01 +0000603
Simon Glassa1015ad2016-02-21 21:09:01 -0700604 priv->logo_on = fdtdec_get_int(blob, node, "samsung,logo-on", 0);
605 if (priv->logo_on) {
606 priv->logo_width = fdtdec_get_int(blob, node,
Ajay Kumarebbace32013-02-21 23:53:01 +0000607 "samsung,logo-width", 0);
Simon Glassa1015ad2016-02-21 21:09:01 -0700608 priv->logo_height = fdtdec_get_int(blob, node,
Ajay Kumarebbace32013-02-21 23:53:01 +0000609 "samsung,logo-height", 0);
Simon Glassa1015ad2016-02-21 21:09:01 -0700610 priv->logo_addr = fdtdec_get_int(blob, node,
Ajay Kumarebbace32013-02-21 23:53:01 +0000611 "samsung,logo-addr", 0);
612 }
613
Simon Glassa1015ad2016-02-21 21:09:01 -0700614 priv->rgb_mode = fdtdec_get_int(blob, node,
Ajay Kumarebbace32013-02-21 23:53:01 +0000615 "samsung,rgb-mode", 0);
Simon Glassa1015ad2016-02-21 21:09:01 -0700616 priv->pclk_name = fdtdec_get_int(blob, node,
Ajay Kumarebbace32013-02-21 23:53:01 +0000617 "samsung,pclk-name", 0);
Simon Glassa1015ad2016-02-21 21:09:01 -0700618 priv->sclk_div = fdtdec_get_int(blob, node,
Ajay Kumarebbace32013-02-21 23:53:01 +0000619 "samsung,sclk-div", 0);
Simon Glassa1015ad2016-02-21 21:09:01 -0700620 priv->dual_lcd_enabled = fdtdec_get_int(blob, node,
Ajay Kumarebbace32013-02-21 23:53:01 +0000621 "samsung,dual-lcd-enabled", 0);
622
623 return 0;
624}
Donghwa Lee0112fed2012-04-05 19:36:17 +0000625
Simon Glassa1015ad2016-02-21 21:09:01 -0700626static int exynos_fb_probe(struct udevice *dev)
Donghwa Lee0112fed2012-04-05 19:36:17 +0000627{
Simon Glassa1015ad2016-02-21 21:09:01 -0700628 struct video_priv *uc_priv = dev_get_uclass_priv(dev);
629 struct exynos_fb_priv *priv = dev_get_priv(dev);
630 struct udevice *panel, *bridge;
631 struct udevice *dp;
632 int ret;
633
634 debug("%s: start\n", __func__);
Donghwa Lee0112fed2012-04-05 19:36:17 +0000635 set_system_display_ctrl();
636 set_lcd_clk();
637
Piotr Wilczek386fd022014-03-07 14:59:40 +0100638#ifdef CONFIG_EXYNOS_MIPI_DSIM
639 exynos_init_dsim_platform_data(&panel_info);
640#endif
Simon Glassa1015ad2016-02-21 21:09:01 -0700641 exynos_fimd_lcd_init(dev);
Piotr Wilczek386fd022014-03-07 14:59:40 +0100642
Simon Glassa1015ad2016-02-21 21:09:01 -0700643 ret = uclass_first_device(UCLASS_PANEL, &panel);
644 if (ret) {
645 printf("LCD panel failed to probe\n");
646 return ret;
647 }
648 if (!panel) {
649 printf("LCD panel not found\n");
650 return -ENODEV;
651 }
Donghwa Lee0112fed2012-04-05 19:36:17 +0000652
Simon Glassa1015ad2016-02-21 21:09:01 -0700653 ret = uclass_first_device(UCLASS_DISPLAY, &dp);
654 if (ret) {
655 debug("%s: Display device error %d\n", __func__, ret);
656 return ret;
657 }
658 if (!dev) {
659 debug("%s: Display device missing\n", __func__);
660 return -ENODEV;
661 }
662 ret = display_enable(dp, 18, NULL);
663 if (ret) {
664 debug("%s: Display enable error %d\n", __func__, ret);
665 return ret;
666 }
667
668 /* backlight / pwm */
669 ret = panel_enable_backlight(panel);
670 if (ret) {
671 debug("%s: backlight error: %d\n", __func__, ret);
672 return ret;
673 }
674
675 ret = uclass_get_device(UCLASS_VIDEO_BRIDGE, 0, &bridge);
676 if (!ret)
677 ret = video_bridge_set_backlight(bridge, 80);
678 if (ret) {
679 debug("%s: No video bridge, or no backlight on bridge\n",
680 __func__);
681 exynos_pinmux_config(PERIPH_ID_PWM0, 0);
Donghwa Lee37980dd2012-05-09 19:23:46 +0000682 }
683
Simon Glassa1015ad2016-02-21 21:09:01 -0700684 uc_priv->xsize = priv->vl_col;
685 uc_priv->ysize = priv->vl_row;
686 uc_priv->bpix = priv->vl_bpix;
687
688 /* Enable flushing after LCD writes if requested */
689 video_set_flush_dcache(dev, true);
690
691 return 0;
Donghwa Lee0112fed2012-04-05 19:36:17 +0000692}
693
Simon Glassa1015ad2016-02-21 21:09:01 -0700694static int exynos_fb_bind(struct udevice *dev)
Donghwa Lee0112fed2012-04-05 19:36:17 +0000695{
Simon Glassb75b15b2020-12-03 16:55:23 -0700696 struct video_uc_plat *plat = dev_get_uclass_plat(dev);
Simon Glassa1015ad2016-02-21 21:09:01 -0700697
698 /* This is the maximum panel size we expect to see */
699 plat->size = 1920 * 1080 * 2;
700
701 return 0;
Donghwa Lee0112fed2012-04-05 19:36:17 +0000702}
Simon Glassa1015ad2016-02-21 21:09:01 -0700703
704static const struct video_ops exynos_fb_ops = {
705};
706
707static const struct udevice_id exynos_fb_ids[] = {
708 { .compatible = "samsung,exynos-fimd" },
709 { }
710};
711
712U_BOOT_DRIVER(exynos_fb) = {
713 .name = "exynos_fb",
714 .id = UCLASS_VIDEO,
715 .of_match = exynos_fb_ids,
716 .ops = &exynos_fb_ops,
717 .bind = exynos_fb_bind,
718 .probe = exynos_fb_probe,
Simon Glassaad29ae2020-12-03 16:55:21 -0700719 .of_to_plat = exynos_fb_of_to_plat,
Simon Glass8a2b47f2020-12-03 16:55:17 -0700720 .priv_auto = sizeof(struct exynos_fb_priv),
Simon Glassa1015ad2016-02-21 21:09:01 -0700721};