From patchwork Wed Feb 26 17:15:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giulio Benetti X-Patchwork-Id: 1245203 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=benettiengineering.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aruba.it header.i=@aruba.it header.a=rsa-sha256 header.s=a1 header.b=gunBHH1L; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48SMtQ2hFsz9sP7 for ; Thu, 27 Feb 2020 04:17:18 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 59E048101A; Wed, 26 Feb 2020 18:16:33 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=benettiengineering.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=aruba.it header.i=@aruba.it header.b="gunBHH1L"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AD18780911; Wed, 26 Feb 2020 18:16:11 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, URIBL_BLOCKED, URIBL_RHS_DOB autolearn=no autolearn_force=no version=3.4.2 Received: from smtpcmd11116.aruba.it (smtpcmd11116.aruba.it [62.149.156.116]) by phobos.denx.de (Postfix) with ESMTP id 172DB80369 for ; Wed, 26 Feb 2020 18:16:04 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=benettiengineering.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=giulio.benetti@benettiengineering.com Received: from ubuntu.localdomain ([212.103.203.10]) by smtpcmd11.ad.aruba.it with bizsmtp id 7VG12203j0DySFo01VG3iD; Wed, 26 Feb 2020 18:16:03 +0100 From: Giulio Benetti To: u-boot@lists.denx.de Cc: Stefano Babic , Lukasz Majewski , Fabio Estevam , uboot-imx@nxp.com, Anatolij Gustschin , Simon Glass , Daniel Schwierzeck , Giulio Benetti Subject: [PATCH 03/18] clk: imx: clk-imxrt1050: setup PLL5 for video in non-SPL Date: Wed, 26 Feb 2020 18:15:46 +0100 Message-Id: <20200226171601.31142-4-giulio.benetti@benettiengineering.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200226171601.31142-1-giulio.benetti@benettiengineering.com> References: <20200226171601.31142-1-giulio.benetti@benettiengineering.com> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aruba.it; s=a1; t=1582737363; bh=1nC52sdtUaD6SHI18iNPzKp2jlM3mScd17BexYdmFyo=; h=From:To:Subject:Date:MIME-Version; b=gunBHH1LZHsW2mXzcdMj0lolfL9k6urx9I/ihkjiQYp0KNNLKShBoBjFrwd2Kqqpz CYINjGPvLSZXE8PnLYD7a56uB/fid0tkh7Bd3NWQjjL1OGGXe4bt5Zb/eyuh1Ca7K1 gA1GIYfB5uqmx0AzRMbteWyYjrShVja5auDlE2QhYQz45XVZ3n1ywQaSEPdI2WITZ/ xqgvCie5InOeqg/1RW+tn2FUk24bmSvtCb8W/AR6yZad55Y5yjIKPzr6ZXw9bFcBXL B8NzEStd8VPHrDffgNApv+MvI83ldJ7uZ/Q/9GkWDnNacJ0dqJQ8Z329m2jXE73t0H Y6CRG9bxD5low== X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean mxsfb needs PLL5 as source, so let's setup it and set it as source for mxsfb(lcdif). Signed-off-by: Giulio Benetti Reviewed-by: Lukasz Majewski --- drivers/clk/imx/clk-imxrt1050.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/clk/imx/clk-imxrt1050.c b/drivers/clk/imx/clk-imxrt1050.c index e33d426363..2819ffb9ac 100644 --- a/drivers/clk/imx/clk-imxrt1050.c +++ b/drivers/clk/imx/clk-imxrt1050.c @@ -238,9 +238,9 @@ static int imxrt1050_clk_probe(struct udevice *dev) clk_dm(IMXRT1050_CLK_LCDIF, imx_clk_gate2("lcdif", "lcdif_podf", base + 0x70, 28)); -#ifdef CONFIG_SPL_BUILD struct clk *clk, *clk1; +#ifdef CONFIG_SPL_BUILD /* bypass pll1 before setting its rate */ clk_get_by_id(IMXRT1050_CLK_PLL1_REF_SEL, &clk); clk_get_by_id(IMXRT1050_CLK_PLL1_BYPASS, &clk1); @@ -271,7 +271,18 @@ static int imxrt1050_clk_probe(struct udevice *dev) clk_get_by_id(IMXRT1050_CLK_PLL3_BYPASS, &clk1); clk_set_parent(clk1, clk); +#else + /* Set PLL5 for LCDIF to its default 650Mhz */ + clk_get_by_id(IMXRT1050_CLK_PLL5_VIDEO, &clk); + clk_enable(clk); + clk_set_rate(clk, 650000000UL); + + clk_get_by_id(IMXRT1050_CLK_PLL5_BYPASS, &clk1); + clk_set_parent(clk1, clk); + /* Configure PLL5 as LCDIF source */ + clk_get_by_id(IMXRT1050_CLK_LCDIF_SEL, &clk1); + clk_set_parent(clk1, clk); #endif return 0;