From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: Samuel Holland <samuel@sholland.org>
Cc: Kishon Vijay Abraham I <kishon@ti.com>,
Vinod Koul <vkoul@kernel.org>, Chen-Yu Tsai <wens@csie.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Maxime Ripard <mripard@kernel.org>,
Jagan Teki <jagan@amarulasolutions.com>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Maxime Ripard <maxime@cerno.tech>,
Rob Herring <robh+dt@kernel.org>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org,
linux-sunxi@lists.linux.dev
Subject: Re: [PATCH 6/8] phy: allwinner: phy-sun6i-mipi-dphy: Set enable bit last
Date: Thu, 25 Aug 2022 12:26:15 +0200 [thread overview]
Message-ID: <YwdORxO4K8mV5Hc9@aptenodytes> (raw)
In-Reply-To: <b3a2dc61-7384-17f7-2f4f-4b6bb86bcced@sholland.org>
[-- Attachment #1.1: Type: text/plain, Size: 3152 bytes --]
Hi Samuel,
On Fri 12 Aug 22, 17:31, Samuel Holland wrote:
> Hi Paul,
>
> On 8/12/22 7:03 AM, Paul Kocialkowski wrote:
> > On Fri 12 Aug 22, 02:56, Samuel Holland wrote:
> >> The A100 variant of the DPHY requires configuring the analog registers
> >> before setting the global enable bit. Since this order also works on the
> >> other variants, always use it, to minimize the differences between them.
> >
> > Did you get a chance to actually test this with either DSI/CSI-2 hardware?
>
> I have tested DSI output with the Clockwork DevTerm (D1 SoC) and Pine64
> PinePhone (A64 SoC). I do not have any MIPI CSI hardware to test with.
Sounds good to me then!
> > I vaguely remember that the order mattered. Do you have an idea of what the
> > Allwinner BSP does too?
>
> The Allwinner BSP makes the same change as this commit in its "lowlevel_v2x"
> copy of the code, which is used for R40 and T7 (original DPHY) and A100 and D1
> (updated DPHY). It does not make the change in "lowlevel_sun50iw1" (A64 SoC,
> original DPHY), but I tested A64 with this change, and it works fine.
Great, thanks for details.
> > Otherwise I could give it a try, at least with my MIPI CSI-2 setup
> > that uses the driver.
>
> This commit only changes sun6i_dphy_tx_power_on(). The code for RX is unchanged
> -- in fact, it already sets SUN6I_DPHY_GCTL_REG last.
Ah yes you're right, actually I remember being tempted to change this too when
adding the rx path, but didn't have hardware to easily test.
Thanks for the details, this is:
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Cheers,
Paul
> Regards,
> Samuel
>
> >> Signed-off-by: Samuel Holland <samuel@sholland.org>
> >> ---
> >>
> >> drivers/phy/allwinner/phy-sun6i-mipi-dphy.c | 8 ++++----
> >> 1 file changed, 4 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c b/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c
> >> index 625c6e1e9990..9698d68d0db7 100644
> >> --- a/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c
> >> +++ b/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c
> >> @@ -183,10 +183,6 @@ static int sun6i_dphy_tx_power_on(struct sun6i_dphy *dphy)
> >> SUN6I_DPHY_TX_TIME4_HS_TX_ANA0(3) |
> >> SUN6I_DPHY_TX_TIME4_HS_TX_ANA1(3));
> >>
> >> - regmap_write(dphy->regs, SUN6I_DPHY_GCTL_REG,
> >> - SUN6I_DPHY_GCTL_LANE_NUM(dphy->config.lanes) |
> >> - SUN6I_DPHY_GCTL_EN);
> >> -
> >> regmap_write(dphy->regs, SUN6I_DPHY_ANA0_REG,
> >> SUN6I_DPHY_ANA0_REG_PWS |
> >> SUN6I_DPHY_ANA0_REG_DMPC |
> >> @@ -244,6 +240,10 @@ static int sun6i_dphy_tx_power_on(struct sun6i_dphy *dphy)
> >> SUN6I_DPHY_ANA2_EN_P2S_CPU_MASK,
> >> SUN6I_DPHY_ANA2_EN_P2S_CPU(lanes_mask));
> >>
> >> + regmap_write(dphy->regs, SUN6I_DPHY_GCTL_REG,
> >> + SUN6I_DPHY_GCTL_LANE_NUM(dphy->config.lanes) |
> >> + SUN6I_DPHY_GCTL_EN);
> >> +
> >> return 0;
> >> }
> >>
> >> --
> >> 2.35.1
> >>
> >
>
--
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 112 bytes --]
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2022-08-25 10:28 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-12 7:55 [PATCH 0/8] phy: allwinner: phy-sun6i-mipi-dphy: Add the A100 DPHY Samuel Holland
2022-08-12 7:55 ` [PATCH 1/8] dt-bindings: sun6i-a31-mipi-dphy: Add the interrupts property Samuel Holland
2022-08-12 10:45 ` Krzysztof Kozlowski
2022-08-12 22:19 ` Samuel Holland
2022-08-16 10:18 ` Krzysztof Kozlowski
2022-09-26 9:28 ` Paul Kocialkowski
2022-09-27 9:36 ` Paul Kocialkowski
2022-08-12 12:22 ` Paul Kocialkowski
2022-08-12 22:44 ` Samuel Holland
2022-11-08 5:17 ` Samuel Holland
2022-08-12 15:13 ` Rob Herring
2022-08-12 7:55 ` [PATCH 2/8] ARM: dts: sun8i: a33: Add DPHY interrupt Samuel Holland
2022-08-12 7:55 ` [PATCH 3/8] arm64: dts: allwinner: a64: " Samuel Holland
2022-08-12 7:55 ` [PATCH 4/8] dt-bindings: sun6i-a31-mipi-dphy: Add the A100 DPHY variant Samuel Holland
2022-08-12 10:47 ` Krzysztof Kozlowski
2022-08-25 10:41 ` Paul Kocialkowski
2022-08-25 14:37 ` Samuel Holland
2022-08-12 7:56 ` [PATCH 5/8] phy: allwinner: phy-sun6i-mipi-dphy: Make RX support optional Samuel Holland
2022-09-26 9:30 ` Paul Kocialkowski
2022-08-12 7:56 ` [PATCH 6/8] phy: allwinner: phy-sun6i-mipi-dphy: Set enable bit last Samuel Holland
2022-08-12 12:03 ` Paul Kocialkowski
2022-08-12 22:31 ` Samuel Holland
2022-08-25 10:26 ` Paul Kocialkowski [this message]
2022-08-12 7:56 ` [PATCH 7/8] phy: allwinner: phy-sun6i-mipi-dphy: Add a variant power-on hook Samuel Holland
2022-08-12 7:56 ` [PATCH 8/8] phy: allwinner: phy-sun6i-mipi-dphy: Add the A100 DPHY variant Samuel Holland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YwdORxO4K8mV5Hc9@aptenodytes \
--to=paul.kocialkowski@bootlin.com \
--cc=devicetree@vger.kernel.org \
--cc=jagan@amarulasolutions.com \
--cc=jernej.skrabec@gmail.com \
--cc=kishon@ti.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=maxime@cerno.tech \
--cc=mripard@kernel.org \
--cc=robh+dt@kernel.org \
--cc=samuel@sholland.org \
--cc=vkoul@kernel.org \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).