devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adam Ford <aford173@gmail.com>
To: Alexander Stein <alexander.stein@ew.tq-group.com>
Cc: Marek Vasut <marex@denx.de>,
	dri-devel@lists.freedesktop.org,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	aford@beaconembedded.com,
	Frieder Schrempf <frieder.schrempf@kontron.de>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	m.szyprowski@samsung.com, Robert Foss <rfoss@kernel.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Jagan Teki <jagan@amarulasolutions.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	devicetree@vger.kernel.org, Jonas Karlman <jonas@kwiboo.se>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Rob Herring <robh+dt@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	Neil Armstrong <neil.armstrong@linaro.org>,
	linux-kernel@vger.kernel.org,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Shawn Guo <shawnguo@kernel.org>
Subject: Re: [PATCH 2/6] drm: bridge: samsung-dsim: Fix PMS Calculator on imx8m[mnp]
Date: Thu, 20 Apr 2023 14:15:00 -0500	[thread overview]
Message-ID: <CAHCN7xJx46zSOt5KLvJCo3NomFmjEzcirTnB9YdLWdR0aqOWew@mail.gmail.com> (raw)
In-Reply-To: <CAHCN7xK0Dban7ueB_ASrTOjqWK0++ujOoQ_RZpz=FR2Fktzy0g@mail.gmail.com>

On Tue, Apr 18, 2023 at 6:53 AM Adam Ford <aford173@gmail.com> wrote:
>
> On Mon, Apr 17, 2023 at 2:00 AM Alexander Stein
> <alexander.stein@ew.tq-group.com> wrote:
> >
> > Hi,
> >
> > Am Montag, 17. April 2023, 00:31:24 CEST schrieb Adam Ford:
> > > On Sun, Apr 16, 2023 at 5:07 PM Marek Vasut <marex@denx.de> wrote:
> > > > On 4/15/23 12:40, Adam Ford wrote:
> > > > > According to Table 13-45 of the i.MX8M Mini Reference Manual, the min
> > > > > and max values for M and  the frequency range for the VCO_out
> > > > > calculator were incorrect.  This also appears to be the case for the
> > > > > imx8mn and imx8mp.
> > > > >
> > > > > To fix this, make new variables to hold the min and max values of m
> > > > > and the minimum value of VCO_out, and update the PMS calculator to
> > > > > use these new variables instead of using hard-coded values to keep
> > > > > the backwards compatibility with other parts using this driver.
> > > >
> > > > [...]
> > > >
> > > > >   static const struct samsung_dsim_driver_data imx8mm_dsi_driver_data =
> > > > >   {
> > > > >
> > > > > @@ -470,6 +485,9 @@ static const struct samsung_dsim_driver_data
> > > > > imx8mm_dsi_driver_data = {> >
> > > > >        */
> > > > >
> > > > >       .pll_p_offset = 14,
> > > > >       .reg_values = imx8mm_dsim_reg_values,
> > > > >
> > > > > +     .m_min = 64,
> > > > > +     .m_max = 1023,
> > > > > +     .vco_min = 1050,
> > > >
> > > > You might want to call this 'min_freq' since there is a 'max_freq' which
> > > > seems to indicate what VCO max frequency is.
> > > >
> > > > Note that the same datasheet contains the following information:
> > > > "
> > > > MIPI_DPHY_M_PLLPMS field descriptions
> > > >
> > > > 12–4 PMS_M
> > > > Specifies the PLL PMS value for the M divider
> > > > NOTE: The programmable divider range should be within 25 to 125 to
> > > > ensure PLL stability.
> > >
> > > I was confused by this because this statement is not consistent with
> > > the link they reference jumps me to the table where it reads M is
> > > between 64 and 1023.
> > >
> > > > NOTE: The M and P divider values should be considered together to ensure
> > > > VCO ouput frequency
> > > > (VCO_out) range is between 350 MHz to 750 MHz.
> > > > Please refer to the topic DPHY PLL for more information.
> > >
> > > I was confused by this too, because the NXP documentation reads the
> > > 350 - 750MHz that you state, but  "Table 13-45: DPHY PLL Parameters"
> > > which immediately follows that sentence  on page 4158 shows VCO_out is
> > > between 1050-2100 MHz.

I reached out to my NXP rep asking if the VCO_out is 350-750 or if it
should be 1050-2100, and received the following statement:

" Yes it is definitely wrong, the one that is part of the NOTE in
MIPI_DPHY_M_PLLPMS register table against PMS_P, PMS_M and PMS_S is
not correct. I will report this to Doc team, the one customer should
be take into account is the Table 13-40 DPHY PLL Parameters and the
Note above."

Table 13-40 (for the Nano) reads the VCO_out is 1050-2100, despite
other text stating 350-750MHz, so I believe this patch is appropriate.
I'll add the above statement to the commit message as confirmation
when I submit a V2 of this series.

adam
> > >
> > > I compared the PMS values for a variety of frequencies to those that
> > > were set in the downstream NXP code, and the PMS values matched.
> > > Maybe someone from NXP can explain the discrepancy.
> >
> > Also note that, according to Table 13-28 in RM (Rev 2 07/2022) for i.MX8M
> > Nano, VCO_out and Fout has a maximum of 1500MHz only. Although the note above
> > mentions a range  of 1050-2100MHz...
>
> I looked up the limits in NXP's downstream kernel [1] , and I believe
> these values match the table in the reference manual instead of the
> conflicting sentence.  I am guessing this is why the PMS values I get
> match those of the NXP downstream kernel.
>
> adam
>
> [1] - https://github.com/nxp-imx/linux-imx/blob/lf-6.1.y/drivers/gpu/drm/imx/sec_mipi_pll_1432x.h#L38
>
> >
> > Best regards,
> > Alexander
> > --
> > TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
> > Amtsgericht München, HRB 105018
> > Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
> > http://www.tq-group.com/
> >
> >

  reply	other threads:[~2023-04-20 19:15 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-15 10:40 [PATCH 1/6] drm: bridge: samsung-dsim: Support multi-lane calculations Adam Ford
2023-04-15 10:40 ` [PATCH 2/6] drm: bridge: samsung-dsim: Fix PMS Calculator on imx8m[mnp] Adam Ford
2023-04-16 22:07   ` Marek Vasut
2023-04-16 22:31     ` Adam Ford
2023-04-17  7:00       ` Alexander Stein
2023-04-18 11:53         ` Adam Ford
2023-04-20 19:15           ` Adam Ford [this message]
2023-04-15 10:41 ` [PATCH 3/6] drm: bridge: samsung-dsim: Fetch pll-clock-frequency automatically Adam Ford
2023-04-16 22:08   ` Marek Vasut
2023-04-18  2:29     ` Adam Ford
2023-04-18  8:30       ` Marek Vasut
2023-04-18  8:47         ` Lucas Stach
2023-04-19 10:41           ` Adam Ford
2023-04-21 11:25   ` Marek Szyprowski
2023-04-21 11:44     ` Adam Ford
2023-04-15 10:41 ` [PATCH 4/6] drm: bridge: samsung-dsim: Dynamically configure DPHY timing Adam Ford
2023-04-16 22:12   ` Marek Vasut
2023-04-17  8:37   ` Lucas Stach
2023-04-17 11:53     ` Adam Ford
2023-04-18  2:43       ` Adam Ford
2023-04-15 10:41 ` [PATCH 5/6] drm: bridge: samsung-dsim: Support non-burst mode Adam Ford
2023-04-16 22:13   ` Marek Vasut
2023-04-17 11:57     ` Adam Ford
2023-04-17 20:07       ` Marek Vasut
2023-04-17 22:24         ` Adam Ford
2023-04-17 23:23           ` Marek Vasut
2023-04-20  2:24             ` Adam Ford
2023-04-15 10:41 ` [PATCH 6/6] arm64: dts: imx8mn: Fix video clock parents Adam Ford
2023-04-16 22:02 ` [PATCH 1/6] drm: bridge: samsung-dsim: Support multi-lane calculations Marek Vasut
2023-04-17  8:43 ` Lucas Stach
2023-04-17 11:55   ` Adam Ford
2023-04-19 10:47     ` Adam Ford
2023-04-20 13:06       ` Lucas Stach
2023-04-20 13:24         ` Adam Ford
2023-04-20 13:42           ` Lucas Stach
2023-04-20 21:51             ` Adam Ford
2023-04-21  8:40               ` Lucas Stach
2023-04-21 11:28                 ` Marek Szyprowski
2023-04-21 11:41                   ` Adam Ford

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=CAHCN7xJx46zSOt5KLvJCo3NomFmjEzcirTnB9YdLWdR0aqOWew@mail.gmail.com \
    --to=aford173@gmail.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=aford@beaconembedded.com \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=andrzej.hajda@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=frieder.schrempf@kontron.de \
    --cc=jagan@amarulasolutions.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=kernel@pengutronix.de \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=marex@denx.de \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.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).