Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp3603368rwe; Mon, 17 Apr 2023 00:08:56 -0700 (PDT) X-Google-Smtp-Source: AKy350bhII5i1mUd81jGLkQ1/eMirqDegHsE8YDuGvsXBZ971HGC8J0A6Tng2QUpYRm3+dgubogB X-Received: by 2002:a17:90a:9c05:b0:23f:6830:568e with SMTP id h5-20020a17090a9c0500b0023f6830568emr14134322pjp.8.1681715336587; Mon, 17 Apr 2023 00:08:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681715336; cv=none; d=google.com; s=arc-20160816; b=MxDzn9GdbBtToLQ31D8jXDly8w5kfW9JvCC3OIMrlLGXCNzE4Lm6XEW5KIAvQ4gPk+ tGLLmSgEO2+mDVGXBrdhNzE+MjYdAZHI0RAbtkMBqqsATCiEMlk44LANgYiwiRyc12xo dij06zH9do5y4GaDLf/c5Ra6EkQmCz2ZH2R1or51YAVV6jOdQYltpRAwTHlozuDaRebt Lk69f1hUnv8sQyb42U4RBelP3HSydF3ZKKkPLzsSgkcUAM1ar1QrOMkNFu4tV2HhMQ6y DIdav4YDVidbnSXT3XTxyh8ulLteH2WuVdWJKgUgef0sk/DqIcmDMj7NKnN3M/ku63m2 VARw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:organization:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=NNWz/l3oDZnpTc0Gl/qtMRqwydt/1fHPp3ooI4fBNHk=; b=Ze7hhmN3n34lfu43OOFF7XPKC/l06Vu5drL3bxDkaIRb3M5ki78aRRVGljZ1hivFvI UyrrXCar4dwNMi8srekfiQjYtcSbuA1QOiswaz7Wlb8QXyMgShgm9SNocMKzHIGCLCwR my8pm3aY61mDCZBF2Uf+bEBr0eE6fx5MF7/Mp9ZDZv9bQ1eEYWWJMd2C6YVOEZ1/sRsd H67s6h0fNRsI48qoBCm8DgT4PcJDBRaf1U1umCnN4zTpPfHbNPwSJDOHm3Uu7FneL9cr OsWhImwKsnznCybA8mZ1QgBLgTCrkE4m9M7jSvajPsErwiWtfsqZaucxm1TAIy+4uj0l dWgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b=aSxUaYNl; dkim=pass header.i=@tq-group.com header.s=key1 header.b=R5e84Mjy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tq-group.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v5-20020a17090a898500b0024785ccbc3csi2857847pjn.131.2023.04.17.00.08.43; Mon, 17 Apr 2023 00:08:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b=aSxUaYNl; dkim=pass header.i=@tq-group.com header.s=key1 header.b=R5e84Mjy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tq-group.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229690AbjDQHAo (ORCPT + 99 others); Mon, 17 Apr 2023 03:00:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230013AbjDQHAj (ORCPT ); Mon, 17 Apr 2023 03:00:39 -0400 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E4443C01; Mon, 17 Apr 2023 00:00:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1681714837; x=1713250837; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NNWz/l3oDZnpTc0Gl/qtMRqwydt/1fHPp3ooI4fBNHk=; b=aSxUaYNlzdVEimhoj1IUpnLX4sBQnJVVd3U0o0AGHn65CTN/uxUDV0i3 W3uSFOiuOYNE8QhgizTki9RRTrFOKBoyzoytH9WAqTYbe8VHciCZ0NUIT Eo7DEsLO6IKGs/0+RWSkFHbvINOLU7esWAWFrgA/0MxGdma9qeIUNj8M8 9c1ujMjfaLA4EyvQPehgSI1SPKP4aled2xGtYWwX7mVCWkMzG03h/766J grQ5V80sd0DIKq+70ud2s9ozYZtbxwS9QQpa7BCaDyf1KDy/nCIMLQHQh gDTqA6V4bMSw4QID4wpwDvSQJNFAmas6JZrf4gBMPtU8GskbCPd50VBQD Q==; X-IronPort-AV: E=Sophos;i="5.99,203,1677538800"; d="scan'208";a="30355382" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 17 Apr 2023 09:00:35 +0200 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Mon, 17 Apr 2023 09:00:35 +0200 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Mon, 17 Apr 2023 09:00:35 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1681714835; x=1713250835; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NNWz/l3oDZnpTc0Gl/qtMRqwydt/1fHPp3ooI4fBNHk=; b=R5e84MjyrDoniy+dfBQOQWtqr6KaZDALr70l6mryZjVE4FER04Wctpuw FkycPeUJXvPIXAXKnj84kradEe0y0jxatVdwC0Fyi36GsIENjF1Sc3P+P TNST8pMg5NyaZhnKWwHUawNrCeAVna75bVW5jGW9kUiXt15fd6EMRfmtU 8PuYEEiJm4gIpAy2Y77jk0yGH1nbXXYxexPlIw/VudMmnPD+5ZnGiqXZm 1cXfVVVRnRUldEG4Srb7BZIgfGtI5rLtRjp0ccB6YkRh90uFt0rDVyF3x Aj3Sj9oaIHfk4Q9eiTVyFj3ig+IIJJnsmPAzEpExIQkXF1F+NF21uhe1F w==; X-IronPort-AV: E=Sophos;i="5.99,203,1677538800"; d="scan'208";a="30355381" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 17 Apr 2023 09:00:35 +0200 Received: from steina-w.localnet (unknown [10.123.53.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id 009EB280056; Mon, 17 Apr 2023 09:00:34 +0200 (CEST) From: Alexander Stein To: Marek Vasut , dri-devel@lists.freedesktop.org Cc: Krzysztof Kozlowski , aford@beaconembedded.com, dri-devel@lists.freedesktop.org, Frieder Schrempf , Laurent Pinchart , Andrzej Hajda , m.szyprowski@samsung.com, Robert Foss , Jernej Skrabec , Jagan Teki , NXP Linux Team , devicetree@vger.kernel.org, Jonas Karlman , Sascha Hauer , Rob Herring , linux-arm-kernel@lists.infradead.org, Neil Armstrong , linux-kernel@vger.kernel.org, Pengutronix Kernel Team , Shawn Guo , Adam Ford Subject: Re: [PATCH 2/6] drm: bridge: samsung-dsim: Fix PMS Calculator on imx8m[mnp] Date: Mon, 17 Apr 2023 09:00:33 +0200 Message-ID: <5667233.DvuYhMxLoT@steina-w> Organization: TQ-Systems GmbH In-Reply-To: References: <20230415104104.5537-1-aford173@gmail.com> <414febc4-aab1-95ec-ac2e-e82a3f881d01@denx.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Am Montag, 17. April 2023, 00:31:24 CEST schrieb Adam Ford: > On Sun, Apr 16, 2023 at 5:07=E2=80=AFPM Marek Vasut 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. > > >=20 > > > 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. > >=20 > > [...] > >=20 > > > static const struct samsung_dsim_driver_data imx8mm_dsi_driver_data= =3D > > > { > > >=20 > > > @@ -470,6 +485,9 @@ static const struct samsung_dsim_driver_data > > > imx8mm_dsi_driver_data =3D {> >=20 > > > */ > > > =20 > > > .pll_p_offset =3D 14, > > > .reg_values =3D imx8mm_dsim_reg_values, > > >=20 > > > + .m_min =3D 64, > > > + .m_max =3D 1023, > > > + .vco_min =3D 1050, > >=20 > > You might want to call this 'min_freq' since there is a 'max_freq' which > > seems to indicate what VCO max frequency is. > >=20 > > Note that the same datasheet contains the following information: > > " > > MIPI_DPHY_M_PLLPMS field descriptions > >=20 > > 12=E2=80=934 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. >=20 > 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. >=20 > > 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. >=20 > 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. >=20 > 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=20 Nano, VCO_out and Fout has a maximum of 1500MHz only. Although the note abo= ve=20 mentions a range of 1050-2100MHz... Best regards, Alexander =2D-=20 TQ-Systems GmbH | M=C3=BChlstra=C3=9Fe 2, Gut Delling | 82229 Seefeld, Germ= any Amtsgericht M=C3=BCnchen, HRB 105018 Gesch=C3=A4ftsf=C3=BChrer: Detlef Schneider, R=C3=BCdiger Stahl, Stefan Sch= neider http://www.tq-group.com/