Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp3237526rwe; Sun, 16 Apr 2023 15:15:46 -0700 (PDT) X-Google-Smtp-Source: AKy350bDc034vZ6knL/Dq/nOHrUvfL6zXKAdWrxMJhWU9JlL3rbLJThsGf022z60Yo2OmO5yIhOo X-Received: by 2002:a17:902:e546:b0:1a1:b656:2149 with SMTP id n6-20020a170902e54600b001a1b6562149mr12234590plf.50.1681683345933; Sun, 16 Apr 2023 15:15:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681683345; cv=none; d=google.com; s=arc-20160816; b=iaG7OLizABJin4ZpSHmC8WXWfD+GYWKOdbEE8RDBnam8v3jbX6M69jGBHpru9NOkcO Wbqj4wx2J8OtqaBAlI2U9K+0+S9ysgvGs2UtRQ5OQXANc9jb9f90RJMOUelAwNYGWY/o bHx24u4nBmqrttUov+wCk6uRRZbkGpCt1K+7EeUWIrKbdKEM1d6iulNA6Uv24SLKoxlp xRj30mW6k1lQIEXNL4NxyAh20wzBWALfmIIcvCGYod8ra5bKNEeCKKpZloqSdKVtObt4 JbNdJan3U6QH0wjwKyHgsGYgwfkmvVJRRGs7I/i5g6oUM+LfvZ5+grO/e+L31Fb/JH2T Se8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=QKvk9+XBBRlUqKsk7bMr4Ef6sOzUUDhjPGcAEetatRM=; b=xuYNJ5MB5QAsFH0nabofMxftvOH+OCykopTxZWIVUo4Cd1/mjrER6FHGDTq7oPbIKS Oj6eb8ckeZlP+HY4gVFkm2cHgny5TamvpQFcYEAuc3bcEYFPjqxxrVlMwlIRApBbbsud T4+fenztlc2Jbagq+VD0rjXVO9NAwEC4C1k2I/14BloGEQY9Esw8HMh2HeuFFoyzifZP Bn4FBa3xoQ0KU8EpB2GrRFmnLCwOMcpButJsBH5bZiYO0Dhhml4JOK8vNlqyxIp5eK7V +JH39cxfbRAeBWKmEhFMzHAGsVnB1HicgK31jGlVFs1nk/IQBIkOA4wSCR5fjo4kIh85 VoxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=UP2ewFEo; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k7-20020a170902c40700b0019a95ab6b66si4207584plk.33.2023.04.16.15.15.34; Sun, 16 Apr 2023 15:15:45 -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=@denx.de header.s=phobos-20191101 header.b=UP2ewFEo; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229915AbjDPWHX (ORCPT + 99 others); Sun, 16 Apr 2023 18:07:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229894AbjDPWHW (ORCPT ); Sun, 16 Apr 2023 18:07:22 -0400 Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B77BC26A8; Sun, 16 Apr 2023 15:07:20 -0700 (PDT) Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 452BF85C9B; Mon, 17 Apr 2023 00:07:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1681682838; bh=QKvk9+XBBRlUqKsk7bMr4Ef6sOzUUDhjPGcAEetatRM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=UP2ewFEoUfz1Yxj8B3hg6QGvA+Tbdz7mVY7qFBYqT2SCIrLfSbPbSRGQCHOqWJWrc ORWUzUa6iPefZDb6K9QPJ47F0588aUJAQqJfqIJDLrCjbFg8mZQyKOdfVVSdugvhlf gj3D72BnNkyEWxlYU7o2ADx3rs+ftCsWsZYjpWZX2rxj4/vjSMHDAVxnhl3NgzCnaK fym/KOdj8BoGIcRYR24bj7QS3pc6jGir33VGXmdOpeLdRRhO1Szaq+qe5Nex0gzHIl IXbDVIOcy07IXnLtFjpNSuOZ3NWTPrR5Goli1tE2C5BFwzljvUCHiki9C6EcLQvg1X VPxHxEsrbigSA== Message-ID: <414febc4-aab1-95ec-ac2e-e82a3f881d01@denx.de> Date: Mon, 17 Apr 2023 00:07:16 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH 2/6] drm: bridge: samsung-dsim: Fix PMS Calculator on imx8m[mnp] Content-Language: en-US To: Adam Ford , dri-devel@lists.freedesktop.org Cc: m.szyprowski@samsung.com, aford@beaconembedded.com, Rob Herring , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Inki Dae , Jagan Teki , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Frieder Schrempf , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20230415104104.5537-1-aford173@gmail.com> <20230415104104.5537-2-aford173@gmail.com> From: Marek Vasut In-Reply-To: <20230415104104.5537-2-aford173@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 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. 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. "