Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp1738981lqt; Sun, 21 Apr 2024 07:36:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX5foPjkQmAsF+SY0HUGgv3Uh2Q5HfMb1XGFpA9GQ0WlE3RDlU0BORZu04oUU41yRvlps3iuRcoFJORlpovADVsVF/Evj0Mt5zOpAa2Sg== X-Google-Smtp-Source: AGHT+IGqNs3wYLzGj3LqM5ISCL6uRbFpXDJJkhn6QuxftgEf7NRE7J8faITus7QGxnpXdEPCJUEG X-Received: by 2002:a17:902:784f:b0:1e3:d8ae:df39 with SMTP id e15-20020a170902784f00b001e3d8aedf39mr5916544pln.50.1713710205695; Sun, 21 Apr 2024 07:36:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713710205; cv=pass; d=google.com; s=arc-20160816; b=qkJlviNie/eG1duIWZF6AtDA0U37cQsgoCDSximeI4089K6zdG/IcTG2gTGqrDOFta fzuBaQyjVoMPfBItlv3mnaLIuTv7keJyg1R3Yc42hd+GER0J2BraNfcDBs0Umbt7HkPD VtzclMrHvICzNAdIISZ5ZZhIzDYxkS/SxqxT4mpz75U6tOCGTy6czwTyxm2m7gKYUI6a xxAZLT2CDEOa1T4RgpeSz7CYQYHa1ygpQs0LrP2qaDxc36EA7P8WypqPq33FfroykyVt yc6U4VIruVyjqk9DQI1KXEwGpnW/nqtZn2qIxu99NOrLd8nX9m9GkYeiPLgN1HzGYNhd s1vA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=YEoRSHwcuIoV9lvhxBb+yBEtm8sG36y0xSWgwI5ybKs=; fh=7kZSuoyW6TIfq2eXT2PPhcf5eMg/j4NMQvjHxC6BaCs=; b=jFXsa9tTST+xnHs542JZIH5DhX48ljKz6AX6B72urLm7qTwiQyh/sh1Bk5Kl0jLKmF WTxNFariISz+izERwI3STCNL7QCo9qA0T+IFxlTuKjD+AVcHezvsoFM+Vjf2M0Wpmko8 QgeupuJhebVjK6TMLRJol79f4KNvAhOrXS+ueOiAp2Aepqy18o4rFYM0mJu3cMlFR/aS 8e5KmU0vEOT2nS4x97WjpFF5zYDDUrTK5XOM2dTTiuAfqNPy76tu1zAC+Zw9tVO9S+lb EOn8sulJzBshhrqMuQm4z3XZIM2HzstYYNoC1wRqkfGNhIvkXysqej2EbR+vmtJ8FxGa l2Ig==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=ZO+Awh90; arc=pass (i=1 spf=pass spfdomain=denx.de dkim=pass dkdomain=denx.de dmarc=pass fromdomain=denx.de); spf=pass (google.com: domain of linux-kernel+bounces-152515-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152515-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j8-20020a170903024800b001e589a2f9fbsi6305738plh.248.2024.04.21.07.36.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 07:36:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152515-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=ZO+Awh90; arc=pass (i=1 spf=pass spfdomain=denx.de dkim=pass dkdomain=denx.de dmarc=pass fromdomain=denx.de); spf=pass (google.com: domain of linux-kernel+bounces-152515-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152515-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 29808281A21 for ; Sun, 21 Apr 2024 14:36:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D24FA18030; Sun, 21 Apr 2024 14:36:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b="ZO+Awh90" Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4963F205E2F for ; Sun, 21 Apr 2024 14:36:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=85.214.62.61 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713710198; cv=none; b=dMIDiYXSoMzw6geP1dulE5tvAB1QtwW/Bc0c7YLwAh96aublRnREbrbQHqcCpVxG0ujcWQJp6iCQb5W0RSHy8P9t3joBLGXTQbUCiA6hlrcq2qyckLe94P7/tuENyFYbXJtUsHsnOOuogy/5V6M7U40xZ+yiuK8cNZiPR3E2Fr4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713710198; c=relaxed/simple; bh=3WvJKOdCsPG5UFNYGBYlp5E0dE5TaVs+2iBtFC24Grc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=iRW7YYQKwp2a41l0URrHCQs26geXHDioU0L9IxkE6iGIsJFLCwpRR54H8lUTAh8gJqS4x2HKi+EGNXqvqeQSPnSUDtr0Rz3hb8Qp+OUjBNwn/XhkHCfqa0HRaB3O0qLmmILWWCP2eMhzU7+W+64eS/Fp1IrsFyrhuATbSCzg+NE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de; spf=pass smtp.mailfrom=denx.de; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b=ZO+Awh90; arc=none smtp.client-ip=85.214.62.61 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=denx.de 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 1C99588195; Sun, 21 Apr 2024 16:36:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1713710193; bh=YEoRSHwcuIoV9lvhxBb+yBEtm8sG36y0xSWgwI5ybKs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ZO+Awh90Q/wSDpbLO1N3GxzLupRMxc5e9+b8AmpyMuFX9srK4IBdHiwOOSYAF7A7O 1rWPb4Pe2Mi9dkFkQb6Q2oCHgEovzLnnzyeIy5wIaI+k1fKZJXl+JNEbSgC389LVxf 36uHNkpMNjzrO8yT/K98FRFom+DyLmM5nrsoukkiRQdvEv+4MGurQ8jX4bdZ15R88x QSLsuryRul5BdAsnENwUqEiDwkXhK60x3yq8Wiov6s2dw6DDytT5GQcq9hWgU9xbiq dq5sgeW7sjY3k4vCQGJcmjX3+a90IObBF4aFq7HqWlt8Y1ncSQkT8Y46fb2/Rzy4Ox uVSc7Kmxy3DBQ== Message-ID: <9c4a3bdd-fd57-4664-a908-ab1c8020e918@denx.de> Date: Sun, 21 Apr 2024 16:05:08 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V2 1/2] drm/bridge: samsung-dsim: Set P divider based on min/max of fin pll To: Adam Ford , dri-devel@lists.freedesktop.org Cc: aford@beaconembedded.com, Frieder Schrempf , Inki Dae , Jagan Teki , Marek Szyprowski , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Marco Felsch , Michael Tretter , linux-kernel@vger.kernel.org References: <20240211230931.188194-1-aford173@gmail.com> Content-Language: en-US From: Marek Vasut In-Reply-To: <20240211230931.188194-1-aford173@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On 2/12/24 12:09 AM, Adam Ford wrote: > The P divider should be set based on the min and max values of > the fin pll which may vary between different platforms. > These ranges are defined per platform, but hard-coded values > were used instead which resulted in a smaller range available > on the i.MX8M[MNP] than what was possible. > > As noted by Frieder, there are descripencies between the reference > manuals of the Mini, Nano and Plus, so I reached out to my NXP > rep and got the following response regarding the varing notes > in the documentation. > > "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." > > With this patch, the clock rates now match the values used in NXP's > downstream kernel. > > Fixes: 846307185f0f ("drm/bridge: samsung-dsim: update PLL reference clock") > Signed-off-by: Adam Ford > Reviewed-by: Frieder Schrempf > Tested-by: Frieder Schrempf > --- > V2: Only update the commit message to reflect why these values > were chosen. No code change present > > diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c > index 95fedc68b0ae..8476650c477c 100644 > --- a/drivers/gpu/drm/bridge/samsung-dsim.c > +++ b/drivers/gpu/drm/bridge/samsung-dsim.c > @@ -574,8 +574,8 @@ static unsigned long samsung_dsim_pll_find_pms(struct samsung_dsim *dsi, > u16 _m, best_m; > u8 _s, best_s; > > - p_min = DIV_ROUND_UP(fin, (12 * MHZ)); > - p_max = fin / (6 * MHZ); > + p_min = DIV_ROUND_UP(fin, (driver_data->pll_fin_max * MHZ)); The parenthesis around driver_data... are not needed. With that fixed: Reviewed-by: Marek Vasut