From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4407EC48BE5 for ; Wed, 16 Jun 2021 01:55:28 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id BF34A61356 for ; Wed, 16 Jun 2021 01:55:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF34A61356 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=andestech.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1A43C82916; Wed, 16 Jun 2021 03:55:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=andestech.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id C27A382927; Wed, 16 Jun 2021 03:55:22 +0200 (CEST) Received: from ATCSQR.andestech.com (exmail.andestech.com [60.248.187.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C207D8164D for ; Wed, 16 Jun 2021 03:55:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=andestech.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ycliang@andestech.com Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id 15G1t2V2095872; Wed, 16 Jun 2021 09:55:02 +0800 (GMT-8) (envelope-from ycliang@andestech.com) Received: from andestech.com (10.0.15.65) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.498.0; Wed, 16 Jun 2021 09:54:59 +0800 Date: Wed, 16 Jun 2021 09:54:59 +0800 From: Leo Liang To: Sean Anderson CC: Subject: Re: [PATCH v3 02/11] clk: k210: Rewrite to remove CCF Message-ID: <20210616015459.GB6791@andestech.com> References: <20210611041617.1665833-1-seanga2@gmail.com> <20210611041617.1665833-3-seanga2@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20210611041617.1665833-3-seanga2@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [10.0.15.65] X-DNSRBL: X-MAIL: ATCSQR.andestech.com 15G1t2V2095872 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Fri, Jun 11, 2021 at 12:16:08PM +0800, Sean Anderson wrote: > This is effectively a complete rewrite to remove all dependency on CCF. > The code is now smaller, and so is the binary. It also takes up less memory > at runtime (since we don't have to create 40 udevices). In general, I am > much happier with this driver as much of the complexity and late binding > has been removed. > > The k210_*_params structs which were previously used to initialize CCF > clocks are now used as the complete configuration. Since we can write our > own division logic, we can now do away with several "half" clocks which > only existed to provide constant factors of two. > > The clock IDs have been renumbered to remove unused clocks. This may not be > the last time they are renumbered, since we have diverged with Linux. There > are also still a few clocks left out which may need to be added back in. > > In general, I have tried to leave out behavioral changes. However, there is > a small bugfix regarding ACLK. According to the technical reference manual, > its mux comes *after* its divider (which is present only for PLL0). This > would have required yet another intermediate clock to fix with CCF, but > with the new driver it is just 2 lines of code :) > > Signed-off-by: Sean Anderson > --- > > (no changes since v1) > > drivers/clk/kendryte/Kconfig | 2 +- > drivers/clk/kendryte/clk.c | 848 +++++++++++------------- > drivers/clk/kendryte/pll.c | 114 ++-- > include/dt-bindings/clock/k210-sysctl.h | 94 ++- > include/kendryte/pll.h | 26 +- > 5 files changed, 499 insertions(+), 585 deletions(-) Reviewed-by: Leo Yu-Chi Liang