From patchwork Mon Aug 8 03:57:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1664405 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=mOnHkvHR; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=nXS/5m0c; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4M1MrL6PRHz9s2R for ; Mon, 8 Aug 2022 13:58:42 +1000 (AEST) 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:References:In-Reply-To: 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: List-Owner; bh=1Z5sL5nozrA+EWwVpnqUk1U5mbf7O4/tW21m+oosgiY=; b=mOnHkvHRxhWPpC KRhoGDvCF3MrjavppI9oWET4BAx+cTVaPz9ZaYgCGUxBS/JsoGbDJjnS6jEeRLpSxzYkBoc96pRMj 4chyAE6gCgvwu3UBkFUnMuxmZCHxNZLHsYCBs+WLYsj+j4YaJZ77Xrv3PtZtY+uZFjWq7vL7ryHuP +1kZa1zJpm81pzES0Kscd0cDVCsDT2zzpuHdpX0DoM9idcuj0QXNFxLvFnHWNbaScIxlpYrCRuaSe CAOKCJ5n+VNMkAN+U5yWYlk+L6vI9yS8WPK8GhWK4TmdzdK0LFj/qoD+NOuHwr3038nCOtK9+kZIQ +fV3+C7teTnkFzo7imxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oKtuO-008wR5-Bs; Mon, 08 Aug 2022 03:58:28 +0000 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oKtuL-008wH6-5W for opensbi@lists.infradead.org; Mon, 08 Aug 2022 03:58:27 +0000 Received: by mail-oi1-x22c.google.com with SMTP id s199so3336976oie.3 for ; Sun, 07 Aug 2022 20:58:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=CYojARx43v6eAyCpijh2anlomuJ4X3SgAAFnTfeSqco=; b=nXS/5m0cgXArua22eithg+N6fjuy2F1mp5bFAKSlUJwXyV29PGT6IZKM5a1B8lFJPk CDgTJDH1JmQ4RvS9MiQT4PLGF4mbC0Uu2sXqAOWggHMF/09eutS1/CTW25G9RWD2hSnD jWBBY4SYs8xz6kaCzWrN7i1VXDp6Txu9NkZDPQVq5Ol6+AFe9EQzxxU/YNthkFbfhjyZ LSjWnTZe281AeqqMo9TaNdsEL3woI+nIk1o7VEOUaHBXN0lpOVEx6N9nOLKkJAFGWrRb XoDk1x4jSHlYmVWHUkVjOVO6Rgzg4mgN5r1rgU6vHBF2HKWCzdlZs92oVsuLe1l8orQa upxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=CYojARx43v6eAyCpijh2anlomuJ4X3SgAAFnTfeSqco=; b=gWIBs1VSY0o/USjRmkJk27Zvjdcsj0bAZzYsERFjr2MHIqmzvrqw8BaMycTpSheQuM PfDfC7sIN60l0CybeUoJ8bJIkNH0m7YwVSQsQMwTH759V1lgzhxhsSgbGtgnniR9UXAs VnO19oH5MXP0F17ouf9SErchSRLdQ5v6YW5p7N7+xvGDLufDo9asiqUZcYfPQhJA1SWu 6fa5+e3LiuKCEe5nN8bqvDz33Is7I1f/oC5+nJhUpKkrnfiNjEpyykfH9k696JPjHTRr uJESz3k048cXcs7SQeVAuPsauGlbhl+mJwZ0rxVBEMc9s05g9A1HwoXAKNXepk86mH8S I1VA== X-Gm-Message-State: ACgBeo1nZi719ACysrKYskl+EwLjsqoioDjYPa6j2KiWnmharApg5cNq jZc3Kd8hL9slBMGTyDDUxuA/DQ== X-Google-Smtp-Source: AA6agR6FJ4+gLYj6NcN0dPYQpHPwXTsSCVHKI/gq/KM9Ye+59KkafcW4qM2oOqzsYoe7j8ihvcWU8g== X-Received: by 2002:a05:6808:2187:b0:33a:c507:d4f3 with SMTP id be7-20020a056808218700b0033ac507d4f3mr10545705oib.205.1659931103754; Sun, 07 Aug 2022 20:58:23 -0700 (PDT) Received: from anup-ubuntu64-vm.. ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id r2-20020a9d30c2000000b0061dc5648bf6sm2008382otg.6.2022.08.07.20.58.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Aug 2022 20:58:23 -0700 (PDT) From: Anup Patel To: Atish Patra , Alistair Francis Cc: Andrew Jones , David Abdurachmanov , Heinrich Schuchardt , Andreas Schwab , Mark Kettenis , Emmanuel Vadot , Anup Patel , opensbi@lists.infradead.org, Anup Patel , Atish Patra Subject: [PATCH v8 05/17] lib: utils/reset: Use kconfig for enabling/disabling drivers Date: Mon, 8 Aug 2022 09:27:28 +0530 Message-Id: <20220808035740.69335-6-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220808035740.69335-1-apatel@ventanamicro.com> References: <20220808035740.69335-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220807_205825_264965_F7A73842 X-CRM114-Status: GOOD ( 12.91 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: We update reset drivers makefile to use kconfig for enabling/disabling drivers. To avoid compile errors, we also enable appropriate reset drivers for each platform. Signed-off-by: Anup Patel Tested-by: Andrew Jones Acked-by: Atish Patra Tested-by: Atish Patra --- inclu [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:22c listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org We update reset drivers makefile to use kconfig for enabling/disabling drivers. To avoid compile errors, we also enable appropriate reset drivers for each platform. Signed-off-by: Anup Patel Tested-by: Andrew Jones Acked-by: Atish Patra Tested-by: Atish Patra --- include/sbi_utils/reset/fdt_reset.h | 12 +++++++++++ lib/utils/Kconfig | 2 ++ lib/utils/reset/Kconfig | 33 +++++++++++++++++++++++++++++ lib/utils/reset/objects.mk | 28 ++++++++++++------------ platform/generic/configs/defconfig | 6 ++++++ 5 files changed, 67 insertions(+), 14 deletions(-) create mode 100644 lib/utils/reset/Kconfig diff --git a/include/sbi_utils/reset/fdt_reset.h b/include/sbi_utils/reset/fdt_reset.h index e7f7350..ea8063b 100644 --- a/include/sbi_utils/reset/fdt_reset.h +++ b/include/sbi_utils/reset/fdt_reset.h @@ -17,6 +17,8 @@ struct fdt_reset { int (*init)(void *fdt, int nodeoff, const struct fdt_match *match); }; +#ifdef CONFIG_FDT_RESET + /** * fdt_reset_driver_init() - initialize reset driver based on the device-tree */ @@ -29,4 +31,14 @@ int fdt_reset_driver_init(void *fdt, struct fdt_reset *drv); */ void fdt_reset_init(void); +#else + +static inline int fdt_reset_driver_init(void *fdt, struct fdt_reset *drv) +{ + return 0; +} +static inline void fdt_reset_init(void) { } + +#endif + #endif diff --git a/lib/utils/Kconfig b/lib/utils/Kconfig index 4524a3f..f061b7a 100644 --- a/lib/utils/Kconfig +++ b/lib/utils/Kconfig @@ -2,6 +2,8 @@ menu "Utils and Drivers Support" +source "$(OPENSBI_SRC_DIR)/lib/utils/reset/Kconfig" + source "$(OPENSBI_SRC_DIR)/lib/utils/serial/Kconfig" endmenu diff --git a/lib/utils/reset/Kconfig b/lib/utils/reset/Kconfig new file mode 100644 index 0000000..845a1ae --- /dev/null +++ b/lib/utils/reset/Kconfig @@ -0,0 +1,33 @@ +# SPDX-License-Identifier: BSD-2-Clause + +menu "System Reset Support" + +config FDT_RESET + bool "FDT based reset drivers" + default n + +if FDT_RESET + +config FDT_RESET_GPIO + bool "GPIO FDT reset driver" + default n + +config FDT_RESET_HTIF + bool "Host transfer interface (HTIF) FDT reset driver" + default n + +config FDT_RESET_SIFIVE_TEST + bool "SiFive Test FDT reset driver" + default n + +config FDT_RESET_SUNXI_WDT + bool "Sunxi WDT FDT reset driver" + default n + +config FDT_RESET_THEAD + bool "T-HEAD FDT reset driver" + default n + +endif + +endmenu diff --git a/lib/utils/reset/objects.mk b/lib/utils/reset/objects.mk index 8cddcdf..8a50dd0 100644 --- a/lib/utils/reset/objects.mk +++ b/lib/utils/reset/objects.mk @@ -7,22 +7,22 @@ # Anup Patel # -libsbiutils-objs-y += reset/fdt_reset.o -libsbiutils-objs-y += reset/fdt_reset_drivers.o +libsbiutils-objs-$(CONFIG_FDT_RESET) += reset/fdt_reset.o +libsbiutils-objs-$(CONFIG_FDT_RESET) += reset/fdt_reset_drivers.o -carray-fdt_reset_drivers-y += fdt_poweroff_gpio -carray-fdt_reset_drivers-y += fdt_reset_gpio -libsbiutils-objs-y += reset/fdt_reset_gpio.o +carray-fdt_reset_drivers-$(CONFIG_FDT_RESET_GPIO) += fdt_poweroff_gpio +carray-fdt_reset_drivers-$(CONFIG_FDT_RESET_GPIO) += fdt_reset_gpio +libsbiutils-objs-$(CONFIG_FDT_RESET_GPIO) += reset/fdt_reset_gpio.o -carray-fdt_reset_drivers-y += fdt_reset_htif -libsbiutils-objs-y += reset/fdt_reset_htif.o +carray-fdt_reset_drivers-$(CONFIG_FDT_RESET_HTIF) += fdt_reset_htif +libsbiutils-objs-$(CONFIG_FDT_RESET_HTIF) += reset/fdt_reset_htif.o -carray-fdt_reset_drivers-y += fdt_reset_sifive_test -libsbiutils-objs-y += reset/fdt_reset_sifive_test.o +carray-fdt_reset_drivers-$(CONFIG_FDT_RESET_SIFIVE_TEST) += fdt_reset_sifive_test +libsbiutils-objs-$(CONFIG_FDT_RESET_SIFIVE_TEST) += reset/fdt_reset_sifive_test.o -carray-fdt_reset_drivers-y += fdt_reset_sunxi_wdt -libsbiutils-objs-y += reset/fdt_reset_sunxi_wdt.o +carray-fdt_reset_drivers-$(CONFIG_FDT_RESET_SUNXI_WDT) += fdt_reset_sunxi_wdt +libsbiutils-objs-$(CONFIG_FDT_RESET_SUNXI_WDT) += reset/fdt_reset_sunxi_wdt.o -carray-fdt_reset_drivers-y += fdt_reset_thead -libsbiutils-objs-y += reset/fdt_reset_thead.o -libsbiutils-objs-y += reset/fdt_reset_thead_asm.o +carray-fdt_reset_drivers-$(CONFIG_FDT_RESET_THEAD) += fdt_reset_thead +libsbiutils-objs-$(CONFIG_FDT_RESET_THEAD) += reset/fdt_reset_thead.o +libsbiutils-objs-$(CONFIG_FDT_RESET_THEAD) += reset/fdt_reset_thead_asm.o diff --git a/platform/generic/configs/defconfig b/platform/generic/configs/defconfig index ce70c59..9778665 100644 --- a/platform/generic/configs/defconfig +++ b/platform/generic/configs/defconfig @@ -1,3 +1,9 @@ +CONFIG_FDT_RESET=y +CONFIG_FDT_RESET_GPIO=y +CONFIG_FDT_RESET_HTIF=y +CONFIG_FDT_RESET_SIFIVE_TEST=y +CONFIG_FDT_RESET_SUNXI_WDT=y +CONFIG_FDT_RESET_THEAD=y CONFIG_FDT_SERIAL=y CONFIG_FDT_SERIAL_GAISLER=y CONFIG_FDT_SERIAL_HTIF=y