From patchwork Mon Mar 30 18:16:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1057 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ot1-f69.google.com (mail-ot1-f69.google.com [209.85.210.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 6A2AE3F03F for ; Mon, 30 Mar 2020 20:16:34 +0200 (CEST) Received: by mail-ot1-f69.google.com with SMTP id a10sf3669159otq.17 for ; Mon, 30 Mar 2020 11:16:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1585592193; cv=pass; d=google.com; s=arc-20160816; b=fUw4h6s7DiYJ08phjZZSgt01PUE5xQDYIAb1ZJYBSKw/hCx5Mt9r/eBAajnAoqPdZb ppHCDmrjN9+utQNgCc5FC1ZGlPW3Sl0S+Q7YD35+bbF0jYxT0kwAD+TMzgXAujbQGFJw u7hUhvsxgjw8ug5YdFPpFBK+4zCt7HrQGzPwK7CeR04CnLw520SWLRG9q1URlQDIHLl7 S88GgVLhTg0vibQqWfwadKiuJ2wyqLWeEmnCWZIOGfrswf9fy6G8OpCkFDHS3d8EUfUw q0Ie2Pf3SnxQwJOqGsqq8z8zAJSh2Tp6oC1IdE3QRttwuD7octiLsjbfZrYmNB433N0a Cuzw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:references:in-reply-to:message-id:date :subject:cc:to:from:mime-version:dkim-signature; bh=T6sWe0vKSyDQ3jUj21oPcStJFbyxS0q1BwNEh6YzYlI=; b=v3xQ4wF5EHUeQjZ2Gys95cnN1Ydd4Rw3LBp3w4+j9epmm34x0OsxgGXldKhSLKY8gI yZ682sarxDul8dLwR4dBeNTb1YD7lOVLbt2xMLOrM9wMyaC5QoIqVxCfup0trcySXiUJ NFrLtjM3IMW8gIhL8pvDSKTBv2K/HNsexblksRsbgqsOIUABkJVzZMigiwkD6kHboHmA O17YgglGQ3+qHGrcyJqnJkoYxxaad4zPn8N0rBAeQZy+34HsYBkZUpLwBNdtQtw1Z5RQ xjQfEqEpcltpJdPGOHYgWZ0+xhNOUc6rfsdo0KIRZHoXAl2a/TmgZEUaF0vrJvgyWjrc sb+A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Jpdl8vLX; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=mime-version:from:to:cc:subject:date:message-id:in-reply-to :references:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=T6sWe0vKSyDQ3jUj21oPcStJFbyxS0q1BwNEh6YzYlI=; b=MDO8hz650aWP+HBxA0Cc1fTQYXnEecuZXJjhjJrEPaywpOfct65ygzlJ5bkV4Pfodp F0JIdBVDVwGdI0BzbxNqsHRpb9w4Xo0X2s0WnmeuOcZDTZdorh7wjzMhv1l1XDKpRQJV /c1oH1KoYMrrFRbSyqolamVozte3OsHUcVd/M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:to:cc:subject:date:message-id :in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=T6sWe0vKSyDQ3jUj21oPcStJFbyxS0q1BwNEh6YzYlI=; b=X4zcGzM/CQviFHO5GxSQY4l09pvQlltJhWYV8V0yg868IaMvUJo01bo/MbM605QVBV QEyPOlCysVXcVathGDi9STGH63txjTiHYrU2Na/EsBRh5t1Pzy1/QatGwX4r9MgXgvMU htdPLN81BfuvDlnMiRDpSwb4hBvGhjhAL9C9uLE2zBl/UHPIXzLhuBUflnIpsEfrg+Sb PZDCHbYIiEXsKaHZLz8HqEWTGHQw1jdwEUTQyTe7nBYQw3UvjtAl/WYhDfofOiTogJGh ls1c6F0nxO6Cy+z9LMQUChwmxh5GI7l9zed/+Mou4lrFE+qH7K3MsgHAVYy0B7dqd15R SokA== X-Gm-Message-State: ANhLgQ2a9VayWNP+75+x6bKV/vO4+QcIWPQlzwQHvzHZn2x0mf7Wno4Y 9hbdp+D6j4TLnFfmyS0X+w5jQqFJ X-Google-Smtp-Source: ADFU+vtFnx953tPfx+vpsfWvMINSRv8ktCrEUOzrOFxDHTkeUIkZos2t+26+JE5tEo5xoAcqthWvVQ== X-Received: by 2002:aca:de42:: with SMTP id v63mr403571oig.99.1585592193168; Mon, 30 Mar 2020 11:16:33 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a9d:30c4:: with SMTP id r4ls6905956otg.9.gmail; Mon, 30 Mar 2020 11:16:32 -0700 (PDT) X-Received: by 2002:a9d:3a62:: with SMTP id j89mr9359031otc.45.1585592192670; Mon, 30 Mar 2020 11:16:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585592192; cv=none; d=google.com; s=arc-20160816; b=qUK7SyZCYD8GK8zE882JuTmTU6Wljo7HR/jFwhwCaAGg0VxHeGz4WoHx66u+eTrghH BaCKD+WFyFPPGr+p0ZawLmGeI/kDpG7uJs0xxuI8wFtzCYuqPx5MTqz0uFAYUU1Z4KrR VKVIn3UVonHwFZjJFkSyylu9Vc5jdqzlfJ177XnO/hezRE9EmgHSsMRF5pvwqn/WkaJF lJXjaU1iDG7j1eGDM+9lETcBmWjzBKFdGCxw80es77QBmUav9HM1jFgBT9pTvuwL2CXN 9ZcF6w419cPgXBXycYfKYt5sceas2g6qDrffb5IaDAEnlRItIdjSZcuB2xrPxPn5dAFm nKmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OoGn8QBGSdBeVcx7ww2exfrAU8/niS0AWwlQNFH0BPE=; b=E2C3wCEASU9CTlbzrgMxhOQXLo9QzdEVXA6jppjQ8HWpvhni5wiqDHgWdj4C7AdEDS WzFfNy8qCROnULfMOm9yYqkjHYr6v4XbQXgiaUDowu0bsOqY9hc3vQoxZZkHyCj+8kBR h/7C3MWP4XR91LJCU3Ev4xCrKmh0k5UJXFZy/J8LfABTE+vm8YZVefmqFxHfR/4la4DV 9alRkEJZwhg5L6nOo5MMasYnQ4HsqN2o6TWPtyABMNJXFI0+zuO8HSl2yjdHv9Mm5sJ+ R2BT1o6Z9og4aRXw13kO4kNgt5Ne2ln0DSJkaNGnMDfW6S73RPsmoF6Yu5/XuTRj7MAc /CxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Jpdl8vLX; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id o82sor13921953oig.65.2020.03.30.11.16.32 for (Google Transport Security); Mon, 30 Mar 2020 11:16:32 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:90a:faa:: with SMTP id 39mr441309pjz.190.1585592192279; Mon, 30 Mar 2020 11:16:32 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:b95e:3742:c972:389e]) by smtp.gmail.com with ESMTPSA id p7sm207452pjp.1.2020.03.30.11.16.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 11:16:31 -0700 (PDT) From: Jagan Teki To: Kever Yang , Simon Glass , Philipp Tomsich , Anatolij Gustschin Cc: sunil@amarulasolutions.com, u-boot@lists.denx.de, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v2 2/4] video: rockchip: Fix vop modes for rk3399 Date: Mon, 30 Mar 2020 23:46:11 +0530 Message-Id: <20200330181613.29462-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200330181613.29462-1-jagan@amarulasolutions.com> References: <20200330181613.29462-1-jagan@amarulasolutions.com> X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Jpdl8vLX; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , VOP display endpoint pipeline configuration is differs between rk3288 vs rk3399. These VOP pipeline configuration depends on how the different display interfaces connected in sequence to IN and OUT ports like for, RK3288: vopb_out: port { #address-cells = <1>; #size-cells = <0>; vopb_out_edp: endpoint@0 { reg = <0>; remote-endpoint = <&edp_in_vopb>; }; vopb_out_hdmi: endpoint@1 { reg = <1>; remote-endpoint = <&hdmi_in_vopb>; }; vopb_out_lvds: endpoint@2 { reg = <2>; remote-endpoint = <&lvds_in_vopb>; }; vopb_out_mipi: endpoint@3 { reg = <3>; remote-endpoint = <&mipi_in_vopb>; }; }; RK3399: vopb_out: port { #address-cells = <1>; #size-cells = <0>; vopb_out_edp: endpoint@0 { reg = <0>; remote-endpoint = <&edp_in_vopb>; }; vopb_out_mipi: endpoint@1 { reg = <1>; remote-endpoint = <&mipi_in_vopb>; }; vopb_out_hdmi: endpoint@2 { reg = <2>; remote-endpoint = <&hdmi_in_vopb>; }; vopb_out_mipi1: endpoint@3 { reg = <3>; remote-endpoint = <&mipi1_in_vopb>; }; vopb_out_dp: endpoint@4 { reg = <4>; remote-endpoint = <&dp_in_vopb>; }; }; here, HDMI interface has endpoint 1 in rk3288 and 2 in rk3399. The rockchip vop driver often depends on this determined endpoint number and stored in vop_mode. So based on this vop_mode the bpp and pin polarity would configure on detected display interface. Since, the existing driver using rk3288 vop mode settings enabling the same will result wrong display interface configuration for rk3399. Add the patch for fixing these vop modes for rk3399. Signed-off-by: Jagan Teki --- Changes for v2: - none arch/arm/include/asm/arch-rockchip/vop_rk3288.h | 11 +++++++++++ drivers/video/rockchip/rk3399_vop.c | 2 -- drivers/video/rockchip/rk_vop.c | 4 ++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/arch-rockchip/vop_rk3288.h b/arch/arm/include/asm/arch-rockchip/vop_rk3288.h index 8398249509..872a158b71 100644 --- a/arch/arm/include/asm/arch-rockchip/vop_rk3288.h +++ b/arch/arm/include/asm/arch-rockchip/vop_rk3288.h @@ -85,6 +85,16 @@ enum { LB_RGB_1280X8 = 0x5 }; +#if defined(CONFIG_ROCKCHIP_RK3399) +enum vop_modes { + VOP_MODE_EDP = 0, + VOP_MODE_MIPI, + VOP_MODE_HDMI, + VOP_MODE_MIPI1, + VOP_MODE_DP, + VOP_MODE_NONE, +}; +#else enum vop_modes { VOP_MODE_EDP = 0, VOP_MODE_HDMI, @@ -94,6 +104,7 @@ enum vop_modes { VOP_MODE_AUTO_DETECT, VOP_MODE_UNKNOWN, }; +#endif /* VOP_VERSION_INFO */ #define M_FPGA_VERSION (0xffff << 16) diff --git a/drivers/video/rockchip/rk3399_vop.c b/drivers/video/rockchip/rk3399_vop.c index 81c122d7a9..1d5b3931a6 100644 --- a/drivers/video/rockchip/rk3399_vop.c +++ b/drivers/video/rockchip/rk3399_vop.c @@ -45,8 +45,6 @@ static void rk3399_set_pin_polarity(struct udevice *dev, V_RK3399_DSP_MIPI_POL(polarity)); break; - case VOP_MODE_LVDS: - /* The RK3399 has neither parallel RGB nor LVDS output. */ default: debug("%s: unsupported output mode %x\n", __func__, mode); } diff --git a/drivers/video/rockchip/rk_vop.c b/drivers/video/rockchip/rk_vop.c index e91d4dfa7f..e1bd656bee 100644 --- a/drivers/video/rockchip/rk_vop.c +++ b/drivers/video/rockchip/rk_vop.c @@ -118,10 +118,12 @@ static void rkvop_enable_output(struct udevice *dev, enum vop_modes mode) V_EDP_OUT_EN(1)); break; +#if defined(CONFIG_ROCKCHIP_RK3288) case VOP_MODE_LVDS: clrsetbits_le32(®s->sys_ctrl, M_ALL_OUT_EN, V_RGB_OUT_EN(1)); break; +#endif case VOP_MODE_MIPI: clrsetbits_le32(®s->sys_ctrl, M_ALL_OUT_EN, @@ -313,7 +315,9 @@ static int rk_display_init(struct udevice *dev, ulong fbbase, ofnode ep_node) /* Set bitwidth for vop display according to vop mode */ switch (vop_id) { case VOP_MODE_EDP: +#if defined(CONFIG_ROCKCHIP_RK3288) case VOP_MODE_LVDS: +#endif l2bpp = VIDEO_BPP16; break; case VOP_MODE_HDMI: