Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp903795ybl; Sat, 18 Jan 2020 13:59:17 -0800 (PST) X-Google-Smtp-Source: APXvYqx4yY4r5MbcOq2+tpatYGRoNdHVAhCMRLJSEZo9wwjH6vv43v+9oZfTmeQFiRAhfQXtR3mS X-Received: by 2002:a9d:6251:: with SMTP id i17mr11145132otk.14.1579384757270; Sat, 18 Jan 2020 13:59:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579384757; cv=none; d=google.com; s=arc-20160816; b=GQLLoSp1UPLHzHIoLEMPUDSVZONelJXby8N+zpgEXrBv4yJoeuWWFpdxs+JvSo9guD DZpkMXubzYvai/52NuBQpr+bsMbB4etkg4sZSQXMWoA0ItL/wX8HtRoDD+KC6yDUeE1g 9yOYsFFDKrVSNIb1fjY3dHVNw4JY9Wj9r2FvHn6lwiLhI1wAaKv6f28TequJr6lWr2pD GU4EJIEvQDOsBg3FGuYDl9k1c37DdGqImqcxtKkUOyiYkliEBrU5i6FsgvcC4zrp/Ezt uoTj/QV2wxTzyRnYVoc8E1RYJWj18QjnADrC0tovptkA1EZWLLCYApaRYZSYRWlsK3Ml k7YA== 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=xhEeNJG6Xe03fAdCWoX8L2PNC8Ts9rcXxVowinyH7Jk=; b=RTYXq/RYZw7fzKEysUZYYqILyp16i4CyttAixyBX8CjRi+OkNSpaQtPHE8r7/Niyhl QDLXBiv8YZb7Oo2IzPlvXawA1GLU+zi4ch0QErU6N5CP8AI0bsSWzCCtJ37cxqWWiWsy hoNYjdn4Lw4Z6sc9apXzHbrdmi4oa6sQLeUUY9wiowSy+Cl2R3fq2UZR5mNsssyRZTy4 PXEMDK6bk4Z2HbXR77+5cWFptkfhfD3Z/0vwSNYf6AadwQsReDURq2hs/1m6ym/L1ovQ ahXhMOg45vqcydRJHw1tpsBGU+i3k4mtnnL0iS9bsIzX5zk5ac1ZFSx22bVH8yEfuScv 79GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=sWCNj0ZQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id w23si17104169otp.109.2020.01.18.13.58.54; Sat, 18 Jan 2020 13:59:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=sWCNj0ZQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727043AbgARV5O (ORCPT + 99 others); Sat, 18 Jan 2020 16:57:14 -0500 Received: from mail-ed1-f68.google.com ([209.85.208.68]:43846 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726910AbgARV5O (ORCPT ); Sat, 18 Jan 2020 16:57:14 -0500 Received: by mail-ed1-f68.google.com with SMTP id dc19so25865846edb.10; Sat, 18 Jan 2020 13:57:13 -0800 (PST) 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=xhEeNJG6Xe03fAdCWoX8L2PNC8Ts9rcXxVowinyH7Jk=; b=sWCNj0ZQnbgArqLuw0XgK3tLKDpG6In0kiTRu4lFsb3+62AuuZEdDNrhrHEkXU2ZjV +NrFKwt20CkDMRpye3isHNQcsRe4mFxsOjdn7Gp4QbGCaPHjbubuf4xMV4m850btYfaU TH81GKDtQnnthH05MnOsT+EYtj9H+Mq8IYH5JvMpfk5DC5lpx1gJUk04CLiNe0kou6CR CxjhEulvlHdjr/a8LTvPVSqxb22EoK7D09WKmiSuVPsSpOEI306HLTEK9GmVQdhZeXrk nqo7nRAKokRDqaXotijdhTP9Q8nwucOa4JcN2DR+I55VtM5D4dpSNez7Cw7SNzYTZsas v3Ng== 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=xhEeNJG6Xe03fAdCWoX8L2PNC8Ts9rcXxVowinyH7Jk=; b=m5qydpr/y7Z/kyd//Xmhcem7usvxMcm3DRA7gmoLFTEL6S5sHduAbCou/UAXm067vA 9EZUtROY/SPU9uRCxoLFJkgbF609+yvaiT39sqXz+MhSuCzAcOIrVo06/ofRQhWv/NVe 21ydFh7wPHMfWkLMo77zNqxerkw0+7gvoZdfWbkGFb/oih8sgSSPX0sIA/tpJVgY91m4 jU1kw6VUgi0KyH5kUGJwKbf2FzYDLz7jdlRt5Y6dt0B9TT1mXI34ykDbOQW6WAlNT9Zo GxcBzGA8E75mAGF7OmSTA6OjyodUMshdGRPvzgzrKeWH5zKaiNHVxDzCrxSiaOuXzcUL wiaw== X-Gm-Message-State: APjAAAU8gG7ewlrFuepsXt7BS0o9q6f2ajuqUIojQm6djp/OO0NoOIj/ SeWAntXdgUoYI6+axvaOsBYS4kygkZh+RjzFjxMwACcq X-Received: by 2002:a05:6402:2037:: with SMTP id ay23mr10507644edb.146.1579384632180; Sat, 18 Jan 2020 13:57:12 -0800 (PST) MIME-Version: 1.0 References: <20200116080440.118679-1-jian.hu@amlogic.com> <20200116080440.118679-3-jian.hu@amlogic.com> In-Reply-To: <20200116080440.118679-3-jian.hu@amlogic.com> From: Martin Blumenstingl Date: Sat, 18 Jan 2020 22:57:01 +0100 Message-ID: Subject: Re: [PATCH v6 2/5] clk: meson: add support for A1 PLL clock ops To: Jian Hu Cc: Jerome Brunet , Neil Armstrong , Kevin Hilman , Rob Herring , Michael Turquette , Stephen Boyd , Qiufang Dai , Jianxin Pan , Victor Wan , Chandle Zou , linux-clk@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@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 Jian, thank you for the update! On Thu, Jan 16, 2020 at 9:04 AM Jian Hu wrote: > > Compared with the previous SoCs, self-adaption current module > is newly added for A1, and there is no reset parm except the > fixed pll. In A1 PLL, the PLL enable sequence is different, using > the new power-on sequence to enable the PLL. > > Signed-off-by: Jian Hu Acked-by: Martin Blumenstingl [...] > @@ -323,13 +330,34 @@ static int meson_clk_pll_enable(struct clk_hw *hw) > return 0; > > /* Make sure the pll is in reset */ > - meson_parm_write(clk->map, &pll->rst, 1); > + if (MESON_PARM_APPLICABLE(&pll->rst)) > + meson_parm_write(clk->map, &pll->rst, 1); > > /* Enable the pll */ > meson_parm_write(clk->map, &pll->en, 1); > > /* Take the pll out reset */ > - meson_parm_write(clk->map, &pll->rst, 0); > + if (MESON_PARM_APPLICABLE(&pll->rst)) > + meson_parm_write(clk->map, &pll->rst, 0); > + > + /* > + * Compared with the previous SoCs, self-adaption current module > + * is newly added for A1, keep the new power-on sequence to enable the > + * PLL. The sequence is: > + * 1. enable the pll, delay for 10us > + * 2. enable the pll self-adaption current module, delay for 40us > + * 3. enable the lock detect module > + */ > + if (MESON_PARM_APPLICABLE(&pll->current_en)) { > + udelay(10); > + meson_parm_write(clk->map, &pll->current_en, 1); > + udelay(40); note to myself: first I thought that these have to be converted to ulseep_range BUT: clk_enable can be called from atomic context, so the atomic versions (udelay instead of usleep/usleep_range) are perfectly fine in Jian's patch Martin