Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp367475ybg; Wed, 3 Jun 2020 02:54:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTnamrVGhl5EkzNyRrq3MT3RJYczua5770w9k8PE6yvZ7Dn1AboL4CxRuOsoglKaLtq6JA X-Received: by 2002:a17:906:1088:: with SMTP id u8mr28458731eju.428.1591178055863; Wed, 03 Jun 2020 02:54:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591178055; cv=none; d=google.com; s=arc-20160816; b=GfX+nC6dexaKQxAeAtButuXvByMGfIaxe5wfB2wm61rgB5Woew8Z9gi/VKxqrTYtF2 BdxUIU88nKAfTqt4AmfDHPNbC2RE3cPw9piN+Uv5JqtsY/hjdo/DLWuMR88lOSpjlUVI odq5PgjBWO/g+HeJtMm5cPH1x8XU5T2XrWFjU//JYruQlThw2WC2f9oEOor691/2wLgz XB/mh5Xpm2U6t5jXgzOZelI1KTau4l1KxqrN1BUq5gNfcQJTHGfL/Jp67rwqab2EvnoV v+iFDjojbK57wnU+eTKZ5oZOWStGvcs6ybhTMOZ/MyyvIjJQZ6f77CHCWCkJxMLy/AYt E84g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=bPky9NQxIO4B2B2JTXUYn1ToSCtvznuBMqKTn1kix5g=; b=kfkvy+ox7VNw3YkLMNj2ZQeLpP2yHUfVaFJ8tBk97It0uh50cSLXGdguvhgcfoDJMA 7NEnBrCr6YExFBACzEogNFM5NhWpAlHw85Xx9Mwp7PgG8igBiwZ4pq+y6/k7gzmJ4vTI IjhDIxAale0b2FIOjt9gM9qGuIanPHv37BLvO1zQzcPHRLsFQOLFiyB87bM9omAhrgEk VVlvJgI4yVyGblFkn8J2XxXMiT2uikoK5PIjfvt5Gp7fBf1H4WAi9pSeDCljICWE+C4Y 3rcONZQNJq70HGJ6UKC58c90Cy8SY+4bZzNRXPOmljMs9uOfAAp4tgXRSt1+Ew9OPvYf jkmA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ch5si633178edb.567.2020.06.03.02.53.53; Wed, 03 Jun 2020 02:54:15 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726769AbgFCJtC convert rfc822-to-8bit (ORCPT + 99 others); Wed, 3 Jun 2020 05:49:02 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:34297 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726099AbgFCJtB (ORCPT ); Wed, 3 Jun 2020 05:49:01 -0400 Received: by mail-lf1-f66.google.com with SMTP id e125so923673lfd.1; Wed, 03 Jun 2020 02:48:59 -0700 (PDT) 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:content-transfer-encoding; bh=PMOVHnGEcXL7cxNnZJH62mImVMlDJ7z1JOGvnBRid68=; b=Cx7zxwU/XozHp29LQsWwlrR022t3k0/nEIMwP/y+msZSnQSvfFfPQQgoBiKlkdDehC e+T2ITdho5p2bxpH8zvbWRCNh4gRMxqYgL9ooOpM0Cio2B0sog0Oro4lcvLM8mrMuvrr c5KVL55I+lFL19w5YnT2wlnZBNYC7Q32yNHusu2ocO3YiEHulcTLIAyVt/dKi0Y4Wjg7 hw2aNGm9Tiv9zA2Lkv0sTOyn7VMYKrXsSYkHknDORLNNX/k3c9tDhh6l6xvQwpedGpxG jXeIADnJSMid+PPhnLsOLqRxyAREW40zG2jXlNTJi8ootzh4NenajJs7Kx78DuXyGLA7 dIng== X-Gm-Message-State: AOAM533qS9GAtx/twYWxsZW/Jc6chjNpandsbS++5fsbTtlxZ9G1Ya0h 1laBCK2bOjEy3wQdcDXbuklaC0PuxAk= X-Received: by 2002:ac2:5f82:: with SMTP id r2mr1952220lfe.119.1591177738122; Wed, 03 Jun 2020 02:48:58 -0700 (PDT) Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com. [209.85.208.175]) by smtp.gmail.com with ESMTPSA id l16sm331057lji.138.2020.06.03.02.48.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Jun 2020 02:48:57 -0700 (PDT) Received: by mail-lj1-f175.google.com with SMTP id s1so1931460ljo.0; Wed, 03 Jun 2020 02:48:56 -0700 (PDT) X-Received: by 2002:a2e:8047:: with SMTP id p7mr1551215ljg.190.1591177736679; Wed, 03 Jun 2020 02:48:56 -0700 (PDT) MIME-Version: 1.0 References: <20200522030743.10204-1-frank@allwinnertech.com> <20200522030743.10204-2-frank@allwinnertech.com> <20200522151403.7ovbdza2o3cjrb7a@gilmour.lan> In-Reply-To: From: Chen-Yu Tsai Date: Wed, 3 Jun 2020 17:48:44 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/4] clk: sunxi-ng: add support for the Allwinner A100 CCU To: =?UTF-8?B?5p2O5oms6Z+s?= Cc: Maxime Ripard , "robh+dt" , mturquette , sboyd , "linus.walleij" , "p.zabel" , =?UTF-8?B?6buE54OB55Sf?= , "tiny.windzz" , linux-arm-kernel , devicetree , linux-kernel , linux-clk , linux-gpio Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 3, 2020 at 5:42 PM 李扬韬 wrote: > > >> + /* Enable the lock bits on all PLLs */ > >> + for (i = 0; i < ARRAY_SIZE(pll_regs); i++) { > >> + val = readl(reg + pll_regs[i]); > >> + val |= BIT(29); > > > >Having a define for that would be nice here > > > >> + writel(val, reg + pll_regs[i]); > >> + } > >> + > >> + /* > >> + * In order to pass the EMI certification, the SDM function of > >> + * the peripheral 1 bus is enabled, and the frequency is still > >> + * calculated using the previous division factor. > >> + */ > >> + writel(0xd1303333, reg + SUN50I_A100_PLL_PERIPH1_PATTERN0_REG); > > > >Same here > > Having a define? I don’t quite understand what you mean, > can you give me an example? What Maxime means is that 0xd1303333 is a magic number. It is better to make a properly named macro, or many macros that you then bitwise-OR together. So you should make macros for each bitfield in that register, which would likely include the SDM calculation factors, the enable bit, and any other fields. ChenYu > MBR, > Yangtao