1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright 2017 Toradex AG
5 * FSL DCU platform driver
8 #include <asm/arch/crm_regs.h>
11 #include <fsl_dcu_fb.h>
14 unsigned int dcu_set_pixel_clock(unsigned int pixclock)
16 struct ccm_reg *ccm = (struct ccm_reg *)CCM_BASE_ADDR;
17 unsigned long long div;
19 clrbits_le32(&ccm->cscmr1, CCM_CSCMR1_DCU0_CLK_SEL);
20 clrsetbits_le32(&ccm->cscdr3,
21 CCM_CSCDR3_DCU0_DIV_MASK | CCM_CSCDR3_DCU0_EN,
22 CCM_CSCDR3_DCU0_DIV(0) | CCM_CSCDR3_DCU0_EN);
23 div = (unsigned long long)(PLL1_PFD2_FREQ / 1000);
24 do_div(div, pixclock);
29 int platform_dcu_init(struct fb_info *fbinfo,
33 struct fb_videomode *dcu_fb_videomode)
35 fsl_dcu_init(fbinfo, xres, yres, 32);