From patchwork Wed Jan 19 09:28:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zong Li X-Patchwork-Id: 12717328 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EE96EC433FE for ; Wed, 19 Jan 2022 09:28:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=JB4Qbs2tfYOfUXE3Js8EZI0bfxHbOqAId144yECr8KI=; b=DmjGqlvPIpgC12 IHhy2ywzWKgZ3VXQPvlpWlyfr+uRngl9kJzNNmjLn0oF1QbwpVD9X614mTbYvkem4wK2nlmF8XeQD E73xoZbLjEPWaj+YjPJg2wmSSAvZNvm6FK+lvE3s9G3yDbNRLjz6i2zqitMOo/3ozDAI6P2XkVKxF a6yqUV5hVpMz3n0pDq6q7xVf9Moplas1RheDiEqhl6ASR1NB1Du+2fRawOt0xep8ErUxwMQRyGP0v J0yPOG2g3DWSTCeNERpzoLobRSBuXE8yafVQMYMh8SQ1VsHhoy9MgzD6YTOYpZl2FuusOqK1MySob 4MtAXob7dv73C6lch+4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nA7Gs-004ZTC-N2; Wed, 19 Jan 2022 09:28:50 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nA7Gq-004ZSM-9f for linux-riscv@lists.infradead.org; Wed, 19 Jan 2022 09:28:49 +0000 Received: by mail-pl1-x633.google.com with SMTP id e8so1590552plh.8 for ; Wed, 19 Jan 2022 01:28:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xYaHkfldf5uPCSUjnhPt95Y5AOgvL7MhuAVKFyO9WEo=; b=OTdKJak1FstRf5XNWu2Zq++mjOF6p3G5dnhOMDp7RxYJNjsgkUkThbfiUANBPfz4ll VJIzg/Cg/RUDMeZ7+VOqxVYgpyMY2zvdEpfLLj3nexZmRt74SYzzvbDnSA9TagJfe2Ej JbahF9nEWUT8EFZ7xDjSmLo9i3vQjPtA6sthRtQIDN4PRmv5DhGOv3C72HmPMAcXkIZQ jxOOoEonJjCYQXyQIy8COMnLDzd8kD05t3iglE4c8TUXdyucPo57fbD0SKMwU6GIsOo1 aA8yLB5EBcbfpW1sZZiF72uJeQXVXddrUObiSgY6drodLgQ8hxteuBtFJUr1zMuo/t52 nZUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xYaHkfldf5uPCSUjnhPt95Y5AOgvL7MhuAVKFyO9WEo=; b=3P/N5Hq3twwZAhR0m1FDaB1vOofMlhKiwbaWY3rW4+AbydMFx+Od880caXpblvNRAJ nvoq3+l///X31F02K1+eY584YtkUuNI9GitvUb4VkG+AE/7fAleAybPqnBR8fVIA1H68 9RskI7wT5WQibxzZiiZ3vxL+HHXJiogh43D6kiiGxd2cL4ssqGc54XS3zSQDaapL9nM0 7HLOQk0Swwohzs8lmjwIwW12ZhgCSTnCuVFOOf7rns/NQX+xyCz9V4rLr3aHxQymE46A yZy4hGwQaw3UlUUnnhSiZ7ZkpW/jUu68vyjXBrlihhe++NkxRUHKjpXzc26yJAF+zB2z Qcng== X-Gm-Message-State: AOAM530ZbWcRcIRDzAZDqdpwH5ikFiYzI8FH9brgIvwp6HAf+qQQZQq6 ZFgaXIj0vEkUNm7TiXzO34iHNQ== X-Google-Smtp-Source: ABdhPJzsxtRCTepH1juuMMGcQnZffvU8vYhmzkIPrcY8DDRbnCRTHcZeVOEhrIIu4iJbV01YYewpwg== X-Received: by 2002:a17:902:e80f:b0:14a:43d9:c91 with SMTP id u15-20020a170902e80f00b0014a43d90c91mr31950005plg.160.1642584526507; Wed, 19 Jan 2022 01:28:46 -0800 (PST) Received: from hsinchu16.internal.sifive.com (59-124-168-89.hinet-ip.hinet.net. [59.124.168.89]) by smtp.gmail.com with ESMTPSA id y8sm1415894pfl.207.2022.01.19.01.28.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jan 2022 01:28:45 -0800 (PST) From: Zong Li To: mturquette@baylibre.com, sboyd@kernel.org, palmer@dabbelt.com, paul.walmsley@sifive.com, lee.jones@linaro.org, robh+dt@kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Zong Li Subject: [PATCH 0/4] Refactor the PRCI driver to reduce the complexity Date: Wed, 19 Jan 2022 17:28:37 +0800 Message-Id: X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220119_012848_390274_458CA28D X-CRM114-Status: GOOD ( 11.56 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This patch set tries to improve the PRCI driver to reduce the complexity, we remove the SoCs C files by putting putting all stuff in each SoCs header file, and include these SoCs-specific header files in core of PRCI. It can also avoid the W=1 kernel build warnings about variable defined but not used [-Wunused-const-variable=], like 'commit 487dc7bb6a0c ("clk: sifive:fu540-prci: Declare static const variable 'prci_clk_fu540' where it's used")' does. This patch set also contains the dt-bindings and dts change, because we change the macro name for fu540 and fu740 by adding the prefix respectively. Thanks all for your review and suggestions. Zong Li (4): dt-bindings: change the macro name of prci in header files and example riscv: dts: Change the macro name of prci in each device node clk: sifive: Add SoCs prefix in each SoCs-dependent data clk: sifive: Move all stuff into SoCs header files from C files .../devicetree/bindings/gpio/sifive,gpio.yaml | 2 +- .../bindings/pci/sifive,fu740-pcie.yaml | 2 +- .../bindings/serial/sifive-serial.yaml | 2 +- arch/riscv/boot/dts/sifive/fu540-c000.dtsi | 22 +-- arch/riscv/boot/dts/sifive/fu740-c000.dtsi | 26 ++-- drivers/clk/sifive/Makefile | 2 +- drivers/clk/sifive/fu540-prci.c | 89 ------------ drivers/clk/sifive/fu540-prci.h | 91 +++++++++++- drivers/clk/sifive/fu740-prci.c | 134 ------------------ drivers/clk/sifive/fu740-prci.h | 130 ++++++++++++++++- drivers/clk/sifive/sifive-prci.c | 5 - include/dt-bindings/clock/sifive-fu540-prci.h | 8 +- include/dt-bindings/clock/sifive-fu740-prci.h | 18 +-- 13 files changed, 254 insertions(+), 277 deletions(-) delete mode 100644 drivers/clk/sifive/fu540-prci.c delete mode 100644 drivers/clk/sifive/fu740-prci.c Acked-by: Palmer Dabbelt # aside from breaking bisect