Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1767556pxb; Wed, 20 Oct 2021 11:18:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlJ/pujv8HlZK6LUxMbNdKvFwMSDU3JlbIHRD0ZPhcMu1ykkTAw8KYau2ia32vxE8hDlz2 X-Received: by 2002:a17:902:9a43:b0:13f:8f31:101c with SMTP id x3-20020a1709029a4300b0013f8f31101cmr658339plv.76.1634753936880; Wed, 20 Oct 2021 11:18:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634753936; cv=none; d=google.com; s=arc-20160816; b=a3ONgsJUoecoBSGzkk23ESQufDHiYUfSXLlmMzblUsTcS+US1CCxI52Nm3fjWH4uLB 35KschBC2XFnuSqSF26jEgQoSAbVdiXQESHsyITjjwv9rOY72LjJ3z/j1kHb/z4w9xYi GrmkCjwFlUte51w5xpcOuSKer45I+hQmJidTUzd4oxF18gQAnbs/9/tg3+PFUW5B6fbR HaGCciY+FRpxTZtHOn7QxmajfuwHMYNQrlKWrDGzCvwmQyBsoCWq2aIfLkDbZUu2vjGD 78yVaCBa+ajqGCygSePx8v1CtSDr3AuTmyndwjU8MieY82P085BkptSYyePRzVJZBh9t IHWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=2Jn7WfTLu8jwkYeAj+iAPqeRaBH+HlGXHIsBLIJGA0w=; b=rfYbHu/FkzLRQbhEt1IbQCu/mkB6FYHt5yrJwGkcQ193S4kwwste9DXGjDTIvgF5Ij nY368nfv/JT46S3BG1QWvzdj/kOXiWYZ0OwRieB8qTH2+LLYQXYV/59XfEIG6h/+fuO2 /gMJcCl8/ptRtR6B3NGJhcUcVdBgw2oFIyhUea6mCPK5kdUjIitKqeEUg8qeJznniqCu hbvGuKjzZB68fymMHPGsZYEOmG++rX0a5gvt2zshKPP2nQdOy0cQ73bHZJ+zTLfsp5CB jgRNpxDT4YTjngJaL7xnL+i+CUc448halsrD/uCvgIIuHxWXptPcyRwesRXsspp7o0D2 keAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20210112 header.b=l5Yp4jOV; 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 b14si3815162pff.297.2021.10.20.11.18.35; Wed, 20 Oct 2021 11:18:56 -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=20210112 header.b=l5Yp4jOV; 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 S231203AbhJTSTA (ORCPT + 99 others); Wed, 20 Oct 2021 14:19:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230381AbhJTSS6 (ORCPT ); Wed, 20 Oct 2021 14:18:58 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8B0CC06161C; Wed, 20 Oct 2021 11:16:43 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id y30so295877edi.0; Wed, 20 Oct 2021 11:16:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2Jn7WfTLu8jwkYeAj+iAPqeRaBH+HlGXHIsBLIJGA0w=; b=l5Yp4jOV8szTGfylg2ypOzkihdNd0JdPDwuRrgRvQ0UeaaqS+v699603BDGKO04VpU 54pyLP19VJL8QATcdVqcQrIb8veUCHvxIaUQpTyv6rM3jys8kvaaUADch1PMcXXFlAP/ vzZL4/vqsidX45IZn4mhpGae11IxaphvXsBKdlEs0WUybA+2HDL/iwCg7gcvQFWcrBIn xq0TExqOLZoQizipb86+q/50cQTDEPRQFI7Yss+qWPDrC88aeIDS74uA2gQIdjYUAjiS oW3Ux2/Y/F3LvJ8gUqRQ7CnxOggbgk/nrYnbyqX3lusPCZN25TGi8ev6D2HfNBwbRBls nNwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2Jn7WfTLu8jwkYeAj+iAPqeRaBH+HlGXHIsBLIJGA0w=; b=PXpVAIbToG0hOGgAnBrVOaTlMvOB9ojiJ1lAVImJFDSG1aAOY81/odm3slZiyIZopx 7sPedpPflQDr02l1xK8tsPzDUWvZHONRoDoKjfKvfgqwBZXapqHYWRbQ9r6mFMBce2L2 ABvw791k3x7bJJBzhKf2jrItyybHiaxDHD4Or2TGv1TpxF67KwtcpQpcKFaMbSzwztBK MFcduCHZLJUaBqygeTJ3bJAo+pBMZuB2K6oeHuAJQvOkEW3xYMuH1FxBLqT6fO4ZxCvg xhjiF3pYIlrRHZ3MnsawwrGhlWIYb1unSqGK63uvXyU/sfKAAsMcHcndo0419r+eYzYu lBKw== X-Gm-Message-State: AOAM530rS5k7+mzVF2BzHoFpxeTclShrFqSQzATsZmYW/tDnsVfXvC/5 DEydHbAnrHekRPMrmGuu86iNFblNIgZdM2GKeN1kdugwekc= X-Received: by 2002:a17:906:f2cd:: with SMTP id gz13mr1093501ejb.278.1634753800493; Wed, 20 Oct 2021 11:16:40 -0700 (PDT) MIME-Version: 1.0 References: <20211016145939.15643-1-martin.blumenstingl@googlemail.com> <1j5ytuvdmw.fsf@starbuckisacylon.baylibre.com> <1jmtn6tu99.fsf@starbuckisacylon.baylibre.com> In-Reply-To: <1jmtn6tu99.fsf@starbuckisacylon.baylibre.com> From: Martin Blumenstingl Date: Wed, 20 Oct 2021 20:16:29 +0200 Message-ID: Subject: Re: [PATCH] clk: meson: gxbb: Add the spread spectrum bit for MPLL0 on GXBB To: Jerome Brunet Cc: linux-amlogic@lists.infradead.org, Neil Armstrong , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Christian Hewitt Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jerome, On Mon, Oct 18, 2021 at 2:03 PM Jerome Brunet wrote: [...] > > The difference here is BIT(14). un-setting BIT(14) (documented as > > EN_DDS0) did not change anything according to Christian's test. > > That also means that SDM, SDM_EN and N2 have the expected values. > > I manually did the maths: > > (2000000000Hz * 16384) / ((16384 * 6) + 12808) = 294909640.7Hz > > which matches what clk_summary sees: > > 294909641Hz > > ... and (2000000000Hz * 16384) / ((16384 * 6) = 333MHz which is fairly close > to what you get w/o flipping the bit This is actually a great hint. So far MPLL clocks have "just worked" for me and I didn't have to work with this. With your explanation it makes sense that SDM_EN makes the hardware use or ignore the SDM value. [...] > For example yes. I am asking check a bit more what this bit does and > what it does not: > - I need confirmation whether or not it does spread spectrum. Yes this > needs to be observed on a SoC pin, like MCLK with a fairly low divider > to the averaging effect which could partially mask spread spectrum. I did some more tests with Christian. It turns out that on GXBB HHI_MPLL_CNTL7[15] has no impact on the rate seen by meson-clk-msr. On the other hand, HHI_MPLL_CNTL[25] makes MPLL0 use or ignore the SDM value (again, verified through meson-clk-msr). > - Get an idea what it actually does. The 2 calculations above are an > hint. (Spread spectrum does not change the rate mean value) Indeed! My conclusion is that on GXBB: 1) HHI_MPLL_CNTL[25] doesn't control the spread spectrum setting of MPLL0 - just like you thought 2) HHI_MPLL_CNTL[25] is actually SDM_EN (and HHI_MPLL_CNTL7[15] doesn't seem to have any impact on MPLL0's output rate) Please let me know if there's anything else we can test. Else I'll send a patch for making HHI_MPLL_CNTL[25] the SDM_EN bit of MPLL0 on GXBB. Best regards, Martin