Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1687358ybz; Thu, 16 Apr 2020 13:42:32 -0700 (PDT) X-Google-Smtp-Source: APiQypIGPylt+CPd2nTldTgExp0FqzTqhZIGMycvP4r0JCWVWSKLqN0GdQ64Y0OglK41c5nI51pf X-Received: by 2002:a17:906:d9cf:: with SMTP id qk15mr11670106ejb.55.1587069752022; Thu, 16 Apr 2020 13:42:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587069752; cv=none; d=google.com; s=arc-20160816; b=jZp+dCbHlfhXwiwreb7oCEtx4h8SQKUmehsylYuZOXkrHY3+xpU9p1V9/YnJ2LJCzx nvhDCMxjCLFLpRY6/9OdcjIBCtOh95/ToZ8iK0kvJ7W/npy4576vHarACoSDVarE0VK3 4CHP8znhX9hT7UtAMplbntZr4QZl/tghFcSrIPQUM/UB3XuH9fnD0xZb1tH2vW1lPpYs OtFvT+v7CjTOGtCV1871ROY93BObixtwFuZK0FV1Hqvlztpspbmn0K3j40UtiMzc4EVa SIAmsFrSMpQW9d3f4irWahvrfjqrqq2Ul10AE3PxmUPr/Wqa7g2HtY320Ca8icu+kdjk 4U+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=O9vqKvQJSosI2zy51g44Ony9xOnUOUnQzLKmbPYbXLs=; b=KjTvqp6cJXbRR3IsBiBqPDkeGVdmE+fjRgRfzfPqQvSujn3plP13jV6QVuF3SD8148 PqZxVU86VBHpM167jh7aBehUI2q0Ga+S1/fCBS8QMxxtE1xG9mJAwU1iy4LOV4LN/td7 RPr6zhP84Ijh5xTV0URGXoESoF87/oV7b1ncwY368un9bRBF3Mi/Q94dheAQ0UTHA7fT i1DXf2/NkUcztfVBEysFGobnRBWReoiprHIp1z0eTPgzAJ0wQIHD8mWRDJYMTQBHlTc+ ZpB8cDnUQeSs6JhhIE8Uq9LZgpVc1bi5vc6fQPm4XUzEEr6F8Bh2kpnyIR3+VCP8AmXY X1ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=rfmBJsjW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m12si12220061ejj.176.2020.04.16.13.42.08; Thu, 16 Apr 2020 13:42:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=rfmBJsjW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728027AbgDPRt4 (ORCPT + 99 others); Thu, 16 Apr 2020 13:49:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727816AbgDPRtz (ORCPT ); Thu, 16 Apr 2020 13:49:55 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D0B7C061A0C; Thu, 16 Apr 2020 10:49:55 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id rh22so1929194ejb.12; Thu, 16 Apr 2020 10:49:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=O9vqKvQJSosI2zy51g44Ony9xOnUOUnQzLKmbPYbXLs=; b=rfmBJsjW7+iTxonwOCa9eCjK/EmzWmpsGcOogRYhp8EKYhNyd9HpF5Ix//iAy7xSf2 Mzq9b7MumB9KO/PUheOIa/m+S6RHDonRpqTFDuMG15bAWrFdQJea/fVK3pL4tIiv25YI E1u5q1/jCMFhdUA1jQ8jvzX0mzbNXFLEAys1Gju0aZITfFrNkM7TqdgdFzNvw2UjwIZN POeYLUtBG+z/YvS9AI46Ddr8gt5atrXRUib1JNxz4OiBBWl7ijjeVA/eTLQ97eAlrJO3 8Df88AU9SeyWCF+ufDJ9hXne0Ahwgg1njLoo0yg25cXkPYpsQyn8i6sY1jhOVX2Au0mO A3jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=O9vqKvQJSosI2zy51g44Ony9xOnUOUnQzLKmbPYbXLs=; b=oEdweKjHBgCiDTZuh6InganaKFrpR/pnQFZZc2OCyMFFpOpSgCU5oGfq4HB3MphC4C fyVyaizhLYw3Am85DONAh6YIWEv4epnUy69B/wrrEBJW+f8cV99bb492hhDe2TRyI23L EewEboFoS9rTFSgZ9I15Q6KvQJWKUAP3xCKyy5LrGCaStURKJaHi7zdfruhJFCtz/klU GgkvpPMGFiRZQtnxCJzjcBES/nY0uiu62Ayy6gT/9i0WEDnBynPZNEc60OjwVejIo64L FWc5fkQDH5gd4qHSs88QQ1z9BJepmhj35fUIe0gQLtwat1HW0/6wyj0lALndSgkMl542 na5g== X-Gm-Message-State: AGi0PuYzV03J43r0PhqZMCUmP00F/xPLixsO8ppxBRgaSZPGwp7N7+fI aQT+6D+/Tp0leWz0d0YvHp5JKIf8W0Ka/g5q4R4= X-Received: by 2002:a17:906:2962:: with SMTP id x2mr10033635ejd.233.1587059393912; Thu, 16 Apr 2020 10:49:53 -0700 (PDT) MIME-Version: 1.0 References: <20200414200017.226136-1-martin.blumenstingl@googlemail.com> <20200414200017.226136-2-martin.blumenstingl@googlemail.com> <1jblnrbu16.fsf@starbuckisacylon.baylibre.com> In-Reply-To: <1jblnrbu16.fsf@starbuckisacylon.baylibre.com> From: Martin Blumenstingl Date: Thu, 16 Apr 2020 19:49:42 +0200 Message-ID: Subject: Re: [PATCH 1/4] clk: meson: meson8b: Fix the first parent of vid_pll_in_sel To: Jerome Brunet Cc: linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, Neil Armstrong , mturquette@baylibre.com, sboyd@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jerome, On Thu, Apr 16, 2020 at 12:32 PM Jerome Brunet wrote: > > > On Tue 14 Apr 2020 at 22:00, Martin Blumenstingl wrote: > > > Use hdmi_pll_lvds_out as parent of the vid_pll_in_sel clock. It's not > > easy to see that the vendor kernel does the same, but it actually does. > > meson_clk_pll_ops in mainline still cannot fully recalculate all rates > > from the HDMI PLL registers because some register bits (at the time of > > writing it's unknown which bits are used for this) double the HDMI PLL > > output rate (compared to simply considering M, N and FRAC). > > Have you considered adding a fixed_factor pre-multiplier, like in the > gxbb driver ? > > Seems to be the same thing it seems like I haven't been clear enough here: the doubling only happens for some - but not all - PLL settings. Let me give you two examples with values from the 3.10 vendor kernel: 1. the CVBS modes use a hdmi_pll_dco freq of 1296MHz it uses: M = 54, N = 1 and FRAC = 0 with our existing clock tree this works out perfectly: 24MHz * 54 / 1 = 1296MHz 2. HDMI 1080P mode uses hdmi_pll_dco freq of 2970MHz it uses M = 61, N = 1 and FRAC = 3584 with our existing clock tree this doesn't end up right: (24MHz * 61 / 1) + (24MHz * 3584 / 4095) = 1485MHz I did play with the registers and our clock-measurer. it *seems* that the HHI_VID_PLL_CNTL3 and/or HHI_VID_PLL_CNTL4 are related to this doubling, but I don't know for sure my assumption is that there's either a fixed pre-multiplier like you suggested and then a configurable "divide by 2" somewhere or there's simply a configurable "multiply by 2" somewhere Either way, I want to fix that at some point but since I don't know the related bits I want to do that later on (in separate patches once I have figured it out) Regards Martin