Lines Matching +full:exynos +full:- +full:sysmmu

1 // SPDX-License-Identifier: GPL-2.0+
104 struct exynos_fb *reg = priv->reg; in exynos_fimd_set_dualrgb()
112 cfg |= EXYNOS_DUALRGB_SUB_CNT(priv->vl_col / 2) | in exynos_fimd_set_dualrgb()
116 writel(cfg, &reg->dualrgb); in exynos_fimd_set_dualrgb()
122 struct exynos_fb *reg = priv->reg; in exynos_fimd_set_dp_clkcon()
128 writel(cfg, &reg->dp_mie_clkcon); in exynos_fimd_set_dp_clkcon()
134 struct exynos_fb *reg = priv->reg; in exynos_fimd_set_par()
138 cfg = readl((unsigned int)&reg->wincon0 + in exynos_fimd_set_par()
154 switch (priv->vl_bpix) { in exynos_fimd_set_par()
163 writel(cfg, (unsigned int)&reg->wincon0 + in exynos_fimd_set_par()
168 writel(cfg, (unsigned int)&reg->vidosd0a + in exynos_fimd_set_par()
171 cfg = EXYNOS_VIDOSD_RIGHT_X(priv->vl_col - 1) | in exynos_fimd_set_par()
172 EXYNOS_VIDOSD_BOTTOM_Y(priv->vl_row - 1) | in exynos_fimd_set_par()
176 writel(cfg, (unsigned int)&reg->vidosd0b + in exynos_fimd_set_par()
180 cfg = EXYNOS_VIDOSD_SIZE(priv->vl_col * priv->vl_row); in exynos_fimd_set_par()
181 writel(cfg, (unsigned int)&reg->vidosd0c + in exynos_fimd_set_par()
189 struct exynos_fb *reg = priv->reg; in exynos_fimd_set_buffer_address()
193 end_addr = start_addr + ((priv->vl_col * (VNBITS(priv->vl_bpix) / 8)) * in exynos_fimd_set_buffer_address()
194 priv->vl_row); in exynos_fimd_set_buffer_address()
196 writel(start_addr, (unsigned int)&reg->vidw00add0b0 + in exynos_fimd_set_buffer_address()
198 writel(end_addr, (unsigned int)&reg->vidw00add1b0 + in exynos_fimd_set_buffer_address()
204 struct exynos_fb *reg = priv->reg; in exynos_fimd_set_clock()
209 if (priv->dual_lcd_enabled) { in exynos_fimd_set_clock()
210 pixel_clock = priv->vl_freq * in exynos_fimd_set_clock()
211 (priv->vl_hspw + priv->vl_hfpd + in exynos_fimd_set_clock()
212 priv->vl_hbpd + priv->vl_col / 2) * in exynos_fimd_set_clock()
213 (priv->vl_vspw + priv->vl_vfpd + in exynos_fimd_set_clock()
214 priv->vl_vbpd + priv->vl_row); in exynos_fimd_set_clock()
215 } else if (priv->interface_mode == FIMD_CPU_INTERFACE) { in exynos_fimd_set_clock()
216 pixel_clock = priv->vl_freq * in exynos_fimd_set_clock()
217 priv->vl_width * priv->vl_height * in exynos_fimd_set_clock()
218 (priv->cs_setup + priv->wr_setup + in exynos_fimd_set_clock()
219 priv->wr_act + priv->wr_hold + 1); in exynos_fimd_set_clock()
221 pixel_clock = priv->vl_freq * in exynos_fimd_set_clock()
222 (priv->vl_hspw + priv->vl_hfpd + in exynos_fimd_set_clock()
223 priv->vl_hbpd + priv->vl_col) * in exynos_fimd_set_clock()
224 (priv->vl_vspw + priv->vl_vfpd + in exynos_fimd_set_clock()
225 priv->vl_vbpd + priv->vl_row); in exynos_fimd_set_clock()
228 cfg = readl(&reg->vidcon0); in exynos_fimd_set_clock()
249 if (priv->dual_lcd_enabled) in exynos_fimd_set_clock()
250 div--; in exynos_fimd_set_clock()
252 cfg |= EXYNOS_VIDCON0_CLKVAL_F(div - 1); in exynos_fimd_set_clock()
253 writel(cfg, &reg->vidcon0); in exynos_fimd_set_clock()
258 struct exynos_fb *reg = priv->reg; in exynos_set_trigger()
261 cfg = readl(&reg->trigcon); in exynos_set_trigger()
265 writel(cfg, &reg->trigcon); in exynos_set_trigger()
270 struct exynos_fb *reg = priv->reg; in exynos_is_i80_frame_done()
274 cfg = readl(&reg->trigcon); in exynos_is_i80_frame_done()
285 struct exynos_fb *reg = priv->reg; in exynos_fimd_lcd_on()
289 cfg = readl(&reg->vidcon0); in exynos_fimd_lcd_on()
291 writel(cfg, &reg->vidcon0); in exynos_fimd_lcd_on()
297 struct exynos_fb *reg = priv->reg; in exynos_fimd_window_on()
301 cfg = readl((unsigned int)&reg->wincon0 + in exynos_fimd_window_on()
304 writel(cfg, (unsigned int)&reg->wincon0 + in exynos_fimd_window_on()
307 cfg = readl(&reg->winshmap); in exynos_fimd_window_on()
309 writel(cfg, &reg->winshmap); in exynos_fimd_window_on()
314 struct exynos_fb *reg = priv->reg; in exynos_fimd_lcd_off()
317 cfg = readl(&reg->vidcon0); in exynos_fimd_lcd_off()
319 writel(cfg, &reg->vidcon0); in exynos_fimd_lcd_off()
324 struct exynos_fb *reg = priv->reg; in exynos_fimd_window_off()
327 cfg = readl((unsigned int)&reg->wincon0 + in exynos_fimd_window_off()
330 writel(cfg, (unsigned int)&reg->wincon0 + in exynos_fimd_window_off()
333 cfg = readl(&reg->winshmap); in exynos_fimd_window_off()
335 writel(cfg, &reg->winshmap); in exynos_fimd_window_off()
339 * The reset value for FIMD SYSMMU register MMU_CTRL is 3
341 * This means FIMD SYSMMU is on by default on Exynos5420
343 * Since in u-boot we don't use SYSMMU, we should disable
344 * those FIMD SYSMMU.
345 * Note that there are 2 SYSMMU for FIMD: m0 and m1.
357 count = fdtdec_find_aliases_for_id(gd->fdt_blob, "fimd", in exynos_fimd_disable_sysmmu()
362 debug("Can't get device node for fimd sysmmu\n"); in exynos_fimd_disable_sysmmu()
366 sysmmufimd = (u32 *)fdtdec_get_addr(gd->fdt_blob, node, "reg"); in exynos_fimd_disable_sysmmu()
368 debug("Can't get base address for sysmmu fimdm0"); in exynos_fimd_disable_sysmmu()
380 struct exynos_fb *reg = priv->reg; in exynos_fimd_lcd_init()
386 if (fdtdec_get_bool(gd->fdt_blob, node, "samsung,disable-sysmmu")) in exynos_fimd_lcd_init()
391 rgb_mode = priv->rgb_mode; in exynos_fimd_lcd_init()
393 if (priv->interface_mode == FIMD_RGB_INTERFACE) { in exynos_fimd_lcd_init()
395 writel(cfg, &reg->vidcon0); in exynos_fimd_lcd_init()
397 cfg = readl(&reg->vidcon2); in exynos_fimd_lcd_init()
402 writel(cfg, &reg->vidcon2); in exynos_fimd_lcd_init()
406 if (!priv->vl_clkp) in exynos_fimd_lcd_init()
408 if (!priv->vl_hsp) in exynos_fimd_lcd_init()
410 if (!priv->vl_vsp) in exynos_fimd_lcd_init()
412 if (!priv->vl_dp) in exynos_fimd_lcd_init()
415 writel(cfg, (unsigned int)&reg->vidcon1 + offset); in exynos_fimd_lcd_init()
418 cfg = EXYNOS_VIDTCON0_VFPD(priv->vl_vfpd - 1); in exynos_fimd_lcd_init()
419 cfg |= EXYNOS_VIDTCON0_VBPD(priv->vl_vbpd - 1); in exynos_fimd_lcd_init()
420 cfg |= EXYNOS_VIDTCON0_VSPW(priv->vl_vspw - 1); in exynos_fimd_lcd_init()
421 writel(cfg, (unsigned int)&reg->vidtcon0 + offset); in exynos_fimd_lcd_init()
423 cfg = EXYNOS_VIDTCON1_HFPD(priv->vl_hfpd - 1); in exynos_fimd_lcd_init()
424 cfg |= EXYNOS_VIDTCON1_HBPD(priv->vl_hbpd - 1); in exynos_fimd_lcd_init()
425 cfg |= EXYNOS_VIDTCON1_HSPW(priv->vl_hspw - 1); in exynos_fimd_lcd_init()
427 writel(cfg, (unsigned int)&reg->vidtcon1 + offset); in exynos_fimd_lcd_init()
430 cfg = EXYNOS_VIDTCON2_HOZVAL(priv->vl_col - 1) | in exynos_fimd_lcd_init()
431 EXYNOS_VIDTCON2_LINEVAL(priv->vl_row - 1) | in exynos_fimd_lcd_init()
432 EXYNOS_VIDTCON2_HOZVAL_E(priv->vl_col - 1) | in exynos_fimd_lcd_init()
433 EXYNOS_VIDTCON2_LINEVAL_E(priv->vl_row - 1); in exynos_fimd_lcd_init()
435 writel(cfg, (unsigned int)&reg->vidtcon2 + offset); in exynos_fimd_lcd_init()
439 cfg = readl(&reg->vidcon0); in exynos_fimd_lcd_init()
442 writel(cfg, &reg->vidcon0); in exynos_fimd_lcd_init()
445 exynos_fimd_set_par(priv, priv->win_id); in exynos_fimd_lcd_init()
448 exynos_fimd_set_buffer_address(priv, priv->win_id, plat->base); in exynos_fimd_lcd_init()
451 cfg = EXYNOS_VIDADDR_PAGEWIDTH(priv->vl_col * in exynos_fimd_lcd_init()
452 VNBITS(priv->vl_bpix) / 8) | in exynos_fimd_lcd_init()
453 EXYNOS_VIDADDR_PAGEWIDTH_E(priv->vl_col * in exynos_fimd_lcd_init()
454 VNBITS(priv->vl_bpix) / 8) | in exynos_fimd_lcd_init()
458 writel(cfg, (unsigned int)&reg->vidw00add2 + in exynos_fimd_lcd_init()
459 EXYNOS_BUFFER_SIZE(priv->win_id)); in exynos_fimd_lcd_init()
465 exynos_fimd_set_dualrgb(priv, priv->dual_lcd_enabled); in exynos_fimd_lcd_init()
471 exynos_fimd_window_on(priv, priv->win_id); in exynos_fimd_lcd_init()
473 exynos_fimd_set_dp_clkcon(priv, priv->dp_enabled); in exynos_fimd_lcd_init()
478 return priv->vl_col * priv->vl_row * (VNBITS(priv->vl_bpix) / 8); in exynos_fimd_calc_fbsize()
485 const void *blob = gd->fdt_blob; in exynos_fb_ofdata_to_platdata()
491 return -EINVAL; in exynos_fb_ofdata_to_platdata()
493 priv->reg = (struct exynos_fb *)addr; in exynos_fb_ofdata_to_platdata()
495 priv->vl_col = fdtdec_get_int(blob, node, "samsung,vl-col", 0); in exynos_fb_ofdata_to_platdata()
496 if (priv->vl_col == 0) { in exynos_fb_ofdata_to_platdata()
498 return -ENXIO; in exynos_fb_ofdata_to_platdata()
501 priv->vl_row = fdtdec_get_int(blob, node, "samsung,vl-row", 0); in exynos_fb_ofdata_to_platdata()
502 if (priv->vl_row == 0) { in exynos_fb_ofdata_to_platdata()
504 return -ENXIO; in exynos_fb_ofdata_to_platdata()
507 priv->vl_width = fdtdec_get_int(blob, node, in exynos_fb_ofdata_to_platdata()
508 "samsung,vl-width", 0); in exynos_fb_ofdata_to_platdata()
510 priv->vl_height = fdtdec_get_int(blob, node, in exynos_fb_ofdata_to_platdata()
511 "samsung,vl-height", 0); in exynos_fb_ofdata_to_platdata()
513 priv->vl_freq = fdtdec_get_int(blob, node, "samsung,vl-freq", 0); in exynos_fb_ofdata_to_platdata()
514 if (priv->vl_freq == 0) { in exynos_fb_ofdata_to_platdata()
516 return -ENXIO; in exynos_fb_ofdata_to_platdata()
519 if (fdtdec_get_bool(blob, node, "samsung,vl-clkp")) in exynos_fb_ofdata_to_platdata()
520 priv->vl_clkp = VIDEO_ACTIVE_LOW; in exynos_fb_ofdata_to_platdata()
522 if (fdtdec_get_bool(blob, node, "samsung,vl-oep")) in exynos_fb_ofdata_to_platdata()
523 priv->vl_oep = VIDEO_ACTIVE_LOW; in exynos_fb_ofdata_to_platdata()
525 if (fdtdec_get_bool(blob, node, "samsung,vl-hsp")) in exynos_fb_ofdata_to_platdata()
526 priv->vl_hsp = VIDEO_ACTIVE_LOW; in exynos_fb_ofdata_to_platdata()
528 if (fdtdec_get_bool(blob, node, "samsung,vl-vsp")) in exynos_fb_ofdata_to_platdata()
529 priv->vl_vsp = VIDEO_ACTIVE_LOW; in exynos_fb_ofdata_to_platdata()
531 if (fdtdec_get_bool(blob, node, "samsung,vl-dp")) in exynos_fb_ofdata_to_platdata()
532 priv->vl_dp = VIDEO_ACTIVE_LOW; in exynos_fb_ofdata_to_platdata()
534 priv->vl_bpix = fdtdec_get_int(blob, node, "samsung,vl-bpix", 0); in exynos_fb_ofdata_to_platdata()
535 if (priv->vl_bpix == 0) { in exynos_fb_ofdata_to_platdata()
537 return -ENXIO; in exynos_fb_ofdata_to_platdata()
540 priv->vl_hspw = fdtdec_get_int(blob, node, "samsung,vl-hspw", 0); in exynos_fb_ofdata_to_platdata()
541 if (priv->vl_hspw == 0) { in exynos_fb_ofdata_to_platdata()
543 return -ENXIO; in exynos_fb_ofdata_to_platdata()
546 priv->vl_hfpd = fdtdec_get_int(blob, node, "samsung,vl-hfpd", 0); in exynos_fb_ofdata_to_platdata()
547 if (priv->vl_hfpd == 0) { in exynos_fb_ofdata_to_platdata()
549 return -ENXIO; in exynos_fb_ofdata_to_platdata()
552 priv->vl_hbpd = (u_char)fdtdec_get_int(blob, node, in exynos_fb_ofdata_to_platdata()
553 "samsung,vl-hbpd", 0); in exynos_fb_ofdata_to_platdata()
554 if (priv->vl_hbpd == 0) { in exynos_fb_ofdata_to_platdata()
556 return -ENXIO; in exynos_fb_ofdata_to_platdata()
559 priv->vl_vspw = (u_char)fdtdec_get_int(blob, node, in exynos_fb_ofdata_to_platdata()
560 "samsung,vl-vspw", 0); in exynos_fb_ofdata_to_platdata()
561 if (priv->vl_vspw == 0) { in exynos_fb_ofdata_to_platdata()
563 return -ENXIO; in exynos_fb_ofdata_to_platdata()
566 priv->vl_vfpd = fdtdec_get_int(blob, node, in exynos_fb_ofdata_to_platdata()
567 "samsung,vl-vfpd", 0); in exynos_fb_ofdata_to_platdata()
568 if (priv->vl_vfpd == 0) { in exynos_fb_ofdata_to_platdata()
570 return -ENXIO; in exynos_fb_ofdata_to_platdata()
573 priv->vl_vbpd = fdtdec_get_int(blob, node, "samsung,vl-vbpd", 0); in exynos_fb_ofdata_to_platdata()
574 if (priv->vl_vbpd == 0) { in exynos_fb_ofdata_to_platdata()
576 return -ENXIO; in exynos_fb_ofdata_to_platdata()
579 priv->vl_cmd_allow_len = fdtdec_get_int(blob, node, in exynos_fb_ofdata_to_platdata()
580 "samsung,vl-cmd-allow-len", 0); in exynos_fb_ofdata_to_platdata()
582 priv->win_id = fdtdec_get_int(blob, node, "samsung,winid", 0); in exynos_fb_ofdata_to_platdata()
583 priv->init_delay = fdtdec_get_int(blob, node, in exynos_fb_ofdata_to_platdata()
584 "samsung,init-delay", 0); in exynos_fb_ofdata_to_platdata()
585 priv->power_on_delay = fdtdec_get_int(blob, node, in exynos_fb_ofdata_to_platdata()
586 "samsung,power-on-delay", 0); in exynos_fb_ofdata_to_platdata()
587 priv->reset_delay = fdtdec_get_int(blob, node, in exynos_fb_ofdata_to_platdata()
588 "samsung,reset-delay", 0); in exynos_fb_ofdata_to_platdata()
589 priv->interface_mode = fdtdec_get_int(blob, node, in exynos_fb_ofdata_to_platdata()
590 "samsung,interface-mode", 0); in exynos_fb_ofdata_to_platdata()
591 priv->mipi_enabled = fdtdec_get_int(blob, node, in exynos_fb_ofdata_to_platdata()
592 "samsung,mipi-enabled", 0); in exynos_fb_ofdata_to_platdata()
593 priv->dp_enabled = fdtdec_get_int(blob, node, in exynos_fb_ofdata_to_platdata()
594 "samsung,dp-enabled", 0); in exynos_fb_ofdata_to_platdata()
595 priv->cs_setup = fdtdec_get_int(blob, node, in exynos_fb_ofdata_to_platdata()
596 "samsung,cs-setup", 0); in exynos_fb_ofdata_to_platdata()
597 priv->wr_setup = fdtdec_get_int(blob, node, in exynos_fb_ofdata_to_platdata()
598 "samsung,wr-setup", 0); in exynos_fb_ofdata_to_platdata()
599 priv->wr_act = fdtdec_get_int(blob, node, "samsung,wr-act", 0); in exynos_fb_ofdata_to_platdata()
600 priv->wr_hold = fdtdec_get_int(blob, node, "samsung,wr-hold", 0); in exynos_fb_ofdata_to_platdata()
602 priv->logo_on = fdtdec_get_int(blob, node, "samsung,logo-on", 0); in exynos_fb_ofdata_to_platdata()
603 if (priv->logo_on) { in exynos_fb_ofdata_to_platdata()
604 priv->logo_width = fdtdec_get_int(blob, node, in exynos_fb_ofdata_to_platdata()
605 "samsung,logo-width", 0); in exynos_fb_ofdata_to_platdata()
606 priv->logo_height = fdtdec_get_int(blob, node, in exynos_fb_ofdata_to_platdata()
607 "samsung,logo-height", 0); in exynos_fb_ofdata_to_platdata()
608 priv->logo_addr = fdtdec_get_int(blob, node, in exynos_fb_ofdata_to_platdata()
609 "samsung,logo-addr", 0); in exynos_fb_ofdata_to_platdata()
612 priv->rgb_mode = fdtdec_get_int(blob, node, in exynos_fb_ofdata_to_platdata()
613 "samsung,rgb-mode", 0); in exynos_fb_ofdata_to_platdata()
614 priv->pclk_name = fdtdec_get_int(blob, node, in exynos_fb_ofdata_to_platdata()
615 "samsung,pclk-name", 0); in exynos_fb_ofdata_to_platdata()
616 priv->sclk_div = fdtdec_get_int(blob, node, in exynos_fb_ofdata_to_platdata()
617 "samsung,sclk-div", 0); in exynos_fb_ofdata_to_platdata()
618 priv->dual_lcd_enabled = fdtdec_get_int(blob, node, in exynos_fb_ofdata_to_platdata()
619 "samsung,dual-lcd-enabled", 0); in exynos_fb_ofdata_to_platdata()
648 return -ENODEV; in exynos_fb_probe()
658 return -ENODEV; in exynos_fb_probe()
682 uc_priv->xsize = priv->vl_col; in exynos_fb_probe()
683 uc_priv->ysize = priv->vl_row; in exynos_fb_probe()
684 uc_priv->bpix = priv->vl_bpix; in exynos_fb_probe()
697 plat->size = 1920 * 1080 * 2; in exynos_fb_bind()
706 { .compatible = "samsung,exynos-fimd" },