From patchwork Sun Feb 28 15:27:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesper Schmitz Mouridsen X-Patchwork-Id: 1445264 X-Patchwork-Delegate: ykai007@gmail.com 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=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=schmitz.computer header.i=@schmitz.computer header.a=rsa-sha256 header.s=202102 header.b=CTQ+crAi; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4DpS2t6h0Dz9sR4 for ; Mon, 1 Mar 2021 02:28:22 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E1FDE81FE7; Sun, 28 Feb 2021 16:28:12 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=reject dis=none) header.from=schmitz.computer Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=schmitz.computer header.i=@schmitz.computer header.b="CTQ+crAi"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A98D881015; Sun, 28 Feb 2021 16:28:08 +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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail.northatlanticmusicsupplies.com (mail.northatlanticmusicsupplies.com [212.237.182.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2861081015 for ; Sun, 28 Feb 2021 16:28:05 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=schmitz.computer Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jesper@schmitz.computer Received: by mail.northatlanticmusicsupplies.com (Postfix, from userid 58) id C50BD935319; Sun, 28 Feb 2021 15:28:03 +0000 (UTC) Received: from freebsd2.freebsd.com (unknown [192.168.1.5]) by mail.northatlanticmusicsupplies.com (Postfix) with ESMTPSA id D905D935318; Sun, 28 Feb 2021 15:28:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schmitz.computer; s=202102; t=1614526082; bh=VmUgsxH1GhC+JjqIkg2mpAZHU2fm+i3KPjZ88L/BZZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=CTQ+crAixJNwn3rUebjX7v/i8E4ruDdadHDpu35A+fEoyjbx/f0gIsPiAbRxPPAWZ 0I4OiNQHomrI8xAQ+tK9U7638u9TQzxntd6oY+l+MxbU2u4khOp8WmgCWnNAm6MvMz hlsnNO5gaNhLqxDQk3W5db4hC6szHe0XQVnHh+xs= From: Jesper Schmitz Mouridsen To: u-boot@lists.denx.de Cc: Jesper Schmitz Mouridsen Subject: [PATCH 1/1] rk3399: pinebook-pro enable display Date: Sun, 28 Feb 2021 16:27:47 +0100 Message-Id: <20210228152747.28814-2-jesper@schmitz.computer> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210228152747.28814-1-jesper@schmitz.computer> References: <20210228152747.28814-1-jesper@schmitz.computer> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.4 at phobos.denx.de X-Virus-Status: Clean Signed-off-by: Jesper Schmitz Mouridsen --- arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi | 4 ++++ arch/arm/dts/rk3399.dtsi | 4 ++-- drivers/video/rockchip/rk_edp.c | 24 ++++++++++++++++++-- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi b/arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi index 1eafb40ce3..2d87bea933 100644 --- a/arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi +++ b/arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi @@ -16,6 +16,10 @@ }; }; +&edp { + rockchip,panel = <&edp_panel>; +}; + &i2c0 { u-boot,dm-pre-reloc; }; diff --git a/arch/arm/dts/rk3399.dtsi b/arch/arm/dts/rk3399.dtsi index 74f2c3d490..fad6cea8f9 100644 --- a/arch/arm/dts/rk3399.dtsi +++ b/arch/arm/dts/rk3399.dtsi @@ -1606,12 +1606,12 @@ vopl_out_mipi: endpoint@0 { reg = <0>; - remote-endpoint = <&mipi_in_vopl>; + remote-endpoint = <&edp_in_vopl>; }; vopl_out_edp: endpoint@1 { reg = <1>; - remote-endpoint = <&edp_in_vopl>; + remote-endpoint = <&mipi_in_vopl>; }; vopl_out_hdmi: endpoint@2 { diff --git a/drivers/video/rockchip/rk_edp.c b/drivers/video/rockchip/rk_edp.c index 0be60e169e..424093fa01 100644 --- a/drivers/video/rockchip/rk_edp.c +++ b/drivers/video/rockchip/rk_edp.c @@ -18,9 +18,15 @@ #include #include #include +#if defined(CONFIG_ROCKCHIP_RK3288) #include -#include #include +#endif +#if defined(CONFIG_ROCKCHIP_RK3399) +#include +#include +#endif +#include #include #define MAX_CR_LOOP 5 @@ -39,7 +45,12 @@ static const char * const pre_emph_names[] = { struct rk_edp_priv { struct rk3288_edp *regs; +#if defined(CONFIG_ROCKCHIP_RK3288) struct rk3288_grf *grf; +#endif +#if defined(CONFIG_ROCKCHIP_RK3399) + struct rk3399_grf_regs *grf; +#endif struct udevice *panel; struct link_train link_train; u8 train_set[4]; @@ -1043,6 +1054,7 @@ static int rk_edp_probe(struct udevice *dev) int vop_id = uc_plat->source_id; debug("%s, uc_plat=%p, vop_id=%u\n", __func__, uc_plat, vop_id); +#if defined(CONFIG_ROCKCHIP_RK3288) ret = clk_get_by_index(dev, 1, &clk); if (ret >= 0) { ret = clk_set_rate(&clk, 0); @@ -1052,6 +1064,7 @@ static int rk_edp_probe(struct udevice *dev) debug("%s: Failed to set EDP clock: ret=%d\n", __func__, ret); return ret; } +#endif ret = clk_get_by_index(uc_plat->src_dev, 0, &clk); if (ret >= 0) { @@ -1063,14 +1076,20 @@ static int rk_edp_probe(struct udevice *dev) __func__, uc_plat->src_dev->name, ret); return ret; } - +#if defined(CONFIG_ROCKCHIP_RK3288) /* grf_edp_ref_clk_sel: from internal 24MHz or 27MHz clock */ rk_setreg(&priv->grf->soc_con12, 1 << 4); /* select epd signal from vop0 or vop1 */ rk_clrsetreg(&priv->grf->soc_con6, (1 << 5), (vop_id == 1) ? (1 << 5) : (0 << 5)); +#endif +#if defined(CONFIG_ROCKCHIP_RK3399) + /* select epd signal from vop0 or vop1 */ + rk_clrsetreg(&priv->grf->soc_con20, (1 << 5), + (vop_id == 1) ? (1 << 5) : (0 << 5)); +#endif rockchip_edp_wait_hpd(priv); rk_edp_init_refclk(regs); @@ -1091,6 +1110,7 @@ static const struct dm_display_ops dp_rockchip_ops = { static const struct udevice_id rockchip_dp_ids[] = { { .compatible = "rockchip,rk3288-edp" }, + { .compatible = "rockchip,rk3399-edp" }, { } };