| Message ID | 20190613185241.22800-6-jagan@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-amarula+bncBD7MFH7A7EEBBUVXRLUAKGQEXPXDMNA@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 91DDF3F033 for <linux-amarula@patchwork.amarulasolutions.com>; Thu, 13 Jun 2019 20:54:12 +0200 (CEST) Received: by mail-pl1-f198.google.com with SMTP id a5sf95791pla.3 for <linux-amarula@patchwork.amarulasolutions.com>; Thu, 13 Jun 2019 11:54:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560452051; cv=pass; d=google.com; s=arc-20160816; b=E8/v5ysjapEeYLkey+zqFgc381md9aEMoY22jU54mO+8HzQuVNhlOfllnHWVtIQPtB kHcgS/ciS3kw3+lo3HHqOYVsBSvCINBq6mMhNUBc7C8pK94362NGuyPuMqi8+TGwuiqd q/vvsZMmiJ0lloRC+6T9UL7QlXpp3aDUXOPup2BEt1kZkv1e3V6urkYnjqOZxEXtt4pj RxRYmqo4pb+cnEng/d9Kx9segftlxQLcv8Usvh0u0k/NfEcQ+/JoMyLM/d5KRa+19eJs POzSosvtgMpbYOPIIsglZXwKMW9XRBz6Gqg3vuEHED+SAcxwxDIwdC38Zdlv1bwtYb5N afQQ== 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:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Tn/7D0xvKERLBhvc8fFC3D8Baliq8+dXIlOivZGpZMQ=; b=PX9aMYqlRKEFLTvoxeGdmlJFu1Oc2aDSRHVjptneuhuhBVudy7GZQS0R+2Xr5WAnbR CN/r9fSk19l9zl0O+BcGSvnQHGvcAqGIbhje6nUMLgLra1H6paISVT0MVVE67UwDZcO4 zrm95QUQJNEt6iXkQfSGVHNUL3AYSnScciIBG7zz2VZNtEPKrFk7W/jgdN2g3b6UygBN SM9dEBtisNK+qH4o+DvLihPqlbAn3ElYi+p3bABzMLanVqCY36MptAAcWa12KbSqjtqw 9RHeocqnLJcYZzjXGaOtfC//nuoBm7WoJYCFhkHuxCNLT9xQi6Fo7yEdBsdwDwebzEX7 3Ewg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=X69ZulaE; 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=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=Tn/7D0xvKERLBhvc8fFC3D8Baliq8+dXIlOivZGpZMQ=; b=QjNpgqo4adpGbSobhflzLrxgGru/HF+6aK5yezI/ygnh/9qFcfUYc3EL0tG1h/0aPv jph7Fq9kn2WRfYBs/ZbmQ0Ek61iLxCkAGy2Er92wjHK4ukM1okP8fAMV4MDbFjKF5X/K vbr1qpfvG+Whk7Z4WPJCIqdiKWWf5L5DuDYyU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version: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=Tn/7D0xvKERLBhvc8fFC3D8Baliq8+dXIlOivZGpZMQ=; b=Fv5ImRGeqG0LTFZiTDxW7Hn+7M9r77WzuHHGc57EgRfy2sBBPF6G2in+zuihUSZS4B acEdLKTE3EwA9psc3UvDUam0TcwFKfLIfm427Rms9FqxEixY+KWESnNl+23OQSUD2fS6 /b/Wni2sWCopcn3MFNXz/7W4Kwo8VeWbrwIqpomp42mw43/TrXWcJ3uON2EJhQ8AGFBS mk5EJrasNLBfR1sv7EZJ2+swXKYSFypA6E1QWMALpKtYaHuW1f/qePTiOuz60WewFQrl cml15kp0IpG5YKUBm9BQmd3dIXAhRgBjNoqd9Qa3cb9g3JF8dEb9CX1s48GIRpVjNoO4 KW3g== X-Gm-Message-State: APjAAAUWzqSY0tb7JGC+dU9LCHiCMZiENvp4katgbyJcTiPx6W4jWHvX y9RxVPiFWma2ZtsV/Axt1g6mATDX X-Google-Smtp-Source: APXvYqy4QAods9BMFPcYkOksQ1SdqfkUbuxETwW5V7TzVuo6sz8zCpjXcoViG5qiUK9/GWV5zNB0kQ== X-Received: by 2002:a17:902:61:: with SMTP id 88mr11822003pla.50.1560452050647; Thu, 13 Jun 2019 11:54:10 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:1e8:: with SMTP id b95ls1602916plb.10.gmail; Thu, 13 Jun 2019 11:54:10 -0700 (PDT) X-Received: by 2002:a17:902:6902:: with SMTP id j2mr16968324plk.321.1560452050305; Thu, 13 Jun 2019 11:54:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560452050; cv=none; d=google.com; s=arc-20160816; b=ATuB160XGJXtvvPHMz4PGDTtlWZIR6OuOnUl24PqUkWsmhRwKZI6WJCSMiC0ze/AZf RkHpeSg3syPjrpSSQg/3gJChCwOE7A+a9UUsSYXd1SNfwt4kNLH6XKg9us6rPIb4JYNE lvZXXq+z/+P6zYlnMFLx4jMEYAQ9lntH4FCkVK2TeVqMCSp0uJwOiqF5kOVQy4BKt/Vq wk/DT1I/nk44+gSa0LBDmOHxrNTqhnGKgb9H88CgQuX+jHEfA9lB76GdmsY9+1MJVzLH sfkutrmgxZbXv+jh2b7a5tHMRhdMepUAzOHI1eYE1b0TGcYlE/vMzlxl0yzifQNQur+K HIjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Q8S69BX3xpHZr2uy2odezTDXnVK0j/vxrp4XQpnzj94=; b=wPqmQrI6rzuKlWuG/QgyPnyxQL2H3Og8FM8oKAGybNww440mBhPm8YOlscB1OmJzRB BuMEqeXUZ1KS+QIgCdfL5Lpz8RJqpaeHw50ElQmD7Mz+DQpfRtfe5izSUzCJyoKvaeZV GMCb1N15fbO+B8GLANzDm9kkK+7JZ0JPhhKb+tngZRwKWFfWRFjAwE4Rp+598l9IPQqY eyGOgOXAhz/Z/pybPMwH3I8nlR6Pe6kOsDKF0BiQY7iCCRzlQETQWy1tMSk6y1FL+4kE djFc7l0xZX0EzZ7TeWLvABYvH6C3kSS9alUunWXIY4I6tvX+n8QOM/ShuEy8sX3SvwXC mBIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=X69ZulaE; 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 x9sor952316plv.3.2019.06.13.11.54.10 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Thu, 13 Jun 2019 11:54:10 -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:902:7793:: with SMTP id o19mr28815033pll.110.1560452049961; Thu, 13 Jun 2019 11:54:09 -0700 (PDT) Received: from localhost.localdomain ([115.97.180.18]) by smtp.gmail.com with ESMTPSA id p43sm946314pjp.4.2019.06.13.11.54.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jun 2019 11:54:09 -0700 (PDT) From: Jagan Teki <jagan@amarulasolutions.com> To: Maxime Ripard <maxime.ripard@bootlin.com>, David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>, Chen-Yu Tsai <wens@csie.org>, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Jernej Skrabec <jernej.skrabec@siol.net> Cc: Michael Trimarchi <michael@amarulasolutions.com>, linux-sunxi@googlegroups.com, linux-amarula@amarulasolutions.com, Jagan Teki <jagan@amarulasolutions.com> Subject: [PATCH 5/9] ARM: dts: sun8i: r40: Add TCON TOP LCD clocking Date: Fri, 14 Jun 2019 00:22:37 +0530 Message-Id: <20190613185241.22800-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190613185241.22800-1-jagan@amarulasolutions.com> References: <20190613185241.22800-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=X69ZulaE; 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: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
| Series |
drm/sun4i: Allwinner R40 MIPI-DSI support
|
|
Commit Message
Jagan Teki
June 13, 2019, 6:52 p.m. UTC
According to Fig 7-2. TCON Top Block Diagram in User manual.
TCON TOP can have an hierarchy for TCON_LCD0, LCD1 like
TCON_TV0, TV1 so, the tcon top would handle the clocks of
TCON_LCD0, LCD1 similar like TV0, TV1.
But, the current tcon_top node is using dsi clock name with
CLK_DSI_DPHY which is ideally handle via dphy which indeed
a separate interface block.
So, use tcon-lcd0 instead of dsi which would refer the
CLK_TCON_LCD0 similar like CLK_TCON_TV0 with tcon-tv0.
This way we can refer CLK_TCON_LCD0 from tcon_top clock in
tcon_lcd0 node and the actual DSI_DPHY clock node would
refer in dphy node.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
arch/arm/boot/dts/sun8i-r40.dtsi | 6 +++---
drivers/gpu/drm/sun4i/sun8i_tcon_top.c | 6 +++---
include/dt-bindings/clock/sun8i-tcon-top.h | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
Comments
On Fri, Jun 14, 2019 at 2:54 AM Jagan Teki <jagan@amarulasolutions.com> wrote: > > According to Fig 7-2. TCON Top Block Diagram in User manual. > > TCON TOP can have an hierarchy for TCON_LCD0, LCD1 like > TCON_TV0, TV1 so, the tcon top would handle the clocks of > TCON_LCD0, LCD1 similar like TV0, TV1. That is not guaranteed. The diagram shows the pixel data path, not necessarily the clocks. In addition, the LCD TCONs have an internal clock gate for the dot-clock output, which the TV variants do not. That might explain the need for the gates in TCON TOP. > But, the current tcon_top node is using dsi clock name with > CLK_DSI_DPHY which is ideally handle via dphy which indeed > a separate interface block. > > So, use tcon-lcd0 instead of dsi which would refer the > CLK_TCON_LCD0 similar like CLK_TCON_TV0 with tcon-tv0. > > This way we can refer CLK_TCON_LCD0 from tcon_top clock in > tcon_lcd0 node and the actual DSI_DPHY clock node would > refer in dphy node. That doesn't make sense. What about TCON_LCD1? The CCU already has CLK_TCON_LCD0 and CLK_TCON_LCD1. What makes you think that the TCONs don't use them directly? Or maybe they do go through TCON_TOP, but there's no gate, so we don't know about it. You need to rethink this. What are you trying to deal with? > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > --- > arch/arm/boot/dts/sun8i-r40.dtsi | 6 +++--- > drivers/gpu/drm/sun4i/sun8i_tcon_top.c | 6 +++--- > include/dt-bindings/clock/sun8i-tcon-top.h | 2 +- This is going to be a pain to merge. First, you need to split the driver parts from the DT parts. Second, you might need to revert CLK_DSI_DPHY back to a raw number for now, so that when the patches get merged through different trees, nothing breaks. Third, you'll come back after everything is merged, and change the raw number to the new macro. ChenYu
On Fri, Jun 14, 2019 at 9:16 AM Chen-Yu Tsai <wens@csie.org> wrote: > > On Fri, Jun 14, 2019 at 2:54 AM Jagan Teki <jagan@amarulasolutions.com> wrote: > > > > According to Fig 7-2. TCON Top Block Diagram in User manual. > > > > TCON TOP can have an hierarchy for TCON_LCD0, LCD1 like > > TCON_TV0, TV1 so, the tcon top would handle the clocks of > > TCON_LCD0, LCD1 similar like TV0, TV1. > > That is not guaranteed. The diagram shows the pixel data path, > not necessarily the clocks. In addition, the LCD TCONs have an > internal clock gate for the dot-clock output, which the TV variants > do not. That might explain the need for the gates in TCON TOP. Correct, the actual idea about explanation here is to mention the clocks definition in tcon top level and internal tv and lcd can handle as you explained. > > > But, the current tcon_top node is using dsi clock name with > > CLK_DSI_DPHY which is ideally handle via dphy which indeed > > a separate interface block. > > > > So, use tcon-lcd0 instead of dsi which would refer the > > CLK_TCON_LCD0 similar like CLK_TCON_TV0 with tcon-tv0. > > > > This way we can refer CLK_TCON_LCD0 from tcon_top clock in > > tcon_lcd0 node and the actual DSI_DPHY clock node would > > refer in dphy node. > > That doesn't make sense. What about TCON_LCD1? > > The CCU already has CLK_TCON_LCD0 and CLK_TCON_LCD1. What makes > you think that the TCONs don't use them directly? > > Or maybe they do go through TCON_TOP, but there's no gate, > so we don't know about it. > > You need to rethink this. What are you trying to deal with? Yes, I understand what your asking for and indeed this is where I get confused and tried this way initially and attach the dsi reference in dphy something like tcon_lcd0 { clocks = <&ccu CLK_BUS_TCON_LCD0>, <&ccu CLK_TCON_LCD0>; clock-names = "ahb", "tcon-ch0"; }; dphy { clocks = <&ccu CLK_BUS_MIPI_DSI>, <&tcon_top CLK_TCON_TOP_DSI>; clock-names = "bus", "mod"; }; This would ended-up, phy wont getting the mod clock keep probing for -EPROBE-DEFER since tcon top driver might not be loaded at the time mipi driver. This way we have tv0, tv1 and dsi gates supported as existed. Does it make sense?
On Fri, Jun 14, 2019 at 5:48 PM Jagan Teki <jagan@amarulasolutions.com> wrote: > > On Fri, Jun 14, 2019 at 9:16 AM Chen-Yu Tsai <wens@csie.org> wrote: > > > > On Fri, Jun 14, 2019 at 2:54 AM Jagan Teki <jagan@amarulasolutions.com> wrote: > > > > > > According to Fig 7-2. TCON Top Block Diagram in User manual. > > > > > > TCON TOP can have an hierarchy for TCON_LCD0, LCD1 like > > > TCON_TV0, TV1 so, the tcon top would handle the clocks of > > > TCON_LCD0, LCD1 similar like TV0, TV1. > > > > That is not guaranteed. The diagram shows the pixel data path, > > not necessarily the clocks. In addition, the LCD TCONs have an > > internal clock gate for the dot-clock output, which the TV variants > > do not. That might explain the need for the gates in TCON TOP. > > Correct, the actual idea about explanation here is to mention the > clocks definition in tcon top level and internal tv and lcd can handle > as you explained. > > > > > > But, the current tcon_top node is using dsi clock name with > > > CLK_DSI_DPHY which is ideally handle via dphy which indeed > > > a separate interface block. > > > > > > So, use tcon-lcd0 instead of dsi which would refer the > > > CLK_TCON_LCD0 similar like CLK_TCON_TV0 with tcon-tv0. > > > > > > This way we can refer CLK_TCON_LCD0 from tcon_top clock in > > > tcon_lcd0 node and the actual DSI_DPHY clock node would > > > refer in dphy node. > > > > That doesn't make sense. What about TCON_LCD1? > > > > The CCU already has CLK_TCON_LCD0 and CLK_TCON_LCD1. What makes > > you think that the TCONs don't use them directly? > > > > Or maybe they do go through TCON_TOP, but there's no gate, > > so we don't know about it. > > > > You need to rethink this. What are you trying to deal with? > > Yes, I understand what your asking for and indeed this is where I get > confused and tried this way initially and attach the dsi reference in > dphy something like > > tcon_lcd0 { > clocks = <&ccu CLK_BUS_TCON_LCD0>, <&ccu CLK_TCON_LCD0>; > clock-names = "ahb", "tcon-ch0"; > }; > > dphy { > clocks = <&ccu CLK_BUS_MIPI_DSI>, > <&tcon_top CLK_TCON_TOP_DSI>; > clock-names = "bus", "mod"; > }; > > This would ended-up, phy wont getting the mod clock keep probing for > -EPROBE-DEFER since tcon top driver might not be loaded at the time > mipi driver. This way we have tv0, tv1 and dsi gates supported as > existed. Does it make sense? Looks like that happens because the clocks are only registered at the component bind phase, rather than the probe phase. And to bind all the components, the DSI controller wants the DPHY available, which isn't because it's still waiting for the clock. So you could try moving the bits that register the clocks in the TCON TOP driver to the probe function, and see if that solves the circular dependency issue. ChenYu
diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi index 219d2dca16b3..12576536df4a 100644 --- a/arch/arm/boot/dts/sun8i-r40.dtsi +++ b/arch/arm/boot/dts/sun8i-r40.dtsi @@ -591,16 +591,16 @@ <&ccu CLK_TVE0>, <&ccu CLK_TCON_TV1>, <&ccu CLK_TVE1>, - <&ccu CLK_DSI_DPHY>; + <&ccu CLK_TCON_LCD0>; clock-names = "bus", "tcon-tv0", "tve0", "tcon-tv1", "tve1", - "dsi"; + "tcon-lcd0"; clock-output-names = "tcon-top-tv0", "tcon-top-tv1", - "tcon-top-dsi"; + "tcon-top-lcd0"; resets = <&ccu RST_BUS_TCON_TOP>; #clock-cells = <1>; diff --git a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c index 465e9b0cdfee..e23c19f18986 100644 --- a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c +++ b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c @@ -205,11 +205,11 @@ static int sun8i_tcon_top_bind(struct device *dev, struct device *master, CLK_TCON_TOP_TV1); if (quirks->has_dsi) - clk_data->hws[CLK_TCON_TOP_DSI] = - sun8i_tcon_top_register_gate(dev, "dsi", regs, + clk_data->hws[CLK_TCON_TOP_LCD0] = + sun8i_tcon_top_register_gate(dev, "tcon-lcd0", regs, &tcon_top->reg_lock, TCON_TOP_TCON_DSI_GATE, - CLK_TCON_TOP_DSI); + CLK_TCON_TOP_LCD0); for (i = 0; i < CLK_NUM; i++) if (IS_ERR(clk_data->hws[i])) { diff --git a/include/dt-bindings/clock/sun8i-tcon-top.h b/include/dt-bindings/clock/sun8i-tcon-top.h index 25164d767835..88de3f2ba335 100644 --- a/include/dt-bindings/clock/sun8i-tcon-top.h +++ b/include/dt-bindings/clock/sun8i-tcon-top.h @@ -6,6 +6,6 @@ #define CLK_TCON_TOP_TV0 0 #define CLK_TCON_TOP_TV1 1 -#define CLK_TCON_TOP_DSI 2 +#define CLK_TCON_TOP_LCD0 2 #endif /* _DT_BINDINGS_CLOCK_SUN8I_TCON_TOP_H_ */