From patchwork Mon Aug 8 03:57:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1664411 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=DD5Nfypl; 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=HrgiqPwF; 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 4M1Ms014zxz9s2R for ; Mon, 8 Aug 2022 13:59:16 +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=rxpXvKkbUod6j4DPA1VFSBb69kSJsPh/6h/f5AlHlLk=; b=DD5NfyplTxvMuV Swxn0MAEDmDqlKnY3Za9cfjOzuVaj0l8NZQsFxV3vIt3UjI6kUuh7sTusmgRiPjYNh2HDSnKg1I8x H8MYt5AHm8q6D1n+cgXGiYJQ4XrcOoMYzy4BKh0kcDddlw7FUMMnz3zecrOAC5VChxQuQ+z8JiJ9t Y4atliz6Xhb4089zoPoQxQsSPezomonP6tcmFCXiMCZqKuZvX6dpW5kXGDWrsoQGUkn+ku27NfDUW 48JBUEEJg8H5RotSGvJliGBsgbSSB67I/6x732Yll1eSZj0xG2LqohT/+0jn6/2y4oYbX93rebbEp xZdX8t52nsy3rZNg5wLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oKtuu-008xQO-Rf; Mon, 08 Aug 2022 03:59:00 +0000 Received: from mail-oa1-x2f.google.com ([2001:4860:4864:20::2f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oKtur-008xI4-96 for opensbi@lists.infradead.org; Mon, 08 Aug 2022 03:58:59 +0000 Received: by mail-oa1-x2f.google.com with SMTP id 586e51a60fabf-10ec41637b3so9300093fac.4 for ; Sun, 07 Aug 2022 20:58:56 -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=ivV16fdUY045eb7qHFfdA8u+LRUCkSHdYO5cE1CcADo=; b=HrgiqPwFVA0NbgrM8Qamw1Cm8L32ABWGsfCgfO2JKduSFtbvnmf3LE106mFV8vZU3v VwK06N+HAQwRG+FBE2QvP1ggXU5iOHSGH3T9de3pB3hf7QC4Kl6tvWcKknBSYQBjBKa4 p6Qbe++kNzBA30iwdv6KqvVKk5Q9wgJfClniYeWKwhfDAESkzu0oXwDiSHmQBfxb8g1I EOOCsdFSdq+uRtso5Sh3nPxJAcZpDhsAbZfu7nVdwWgJKZuCesUfoxHKt9bgLE/dl1n/ uKvNVJiHOqnNNl2kAJ/ocuLpbCWqLwKTRv9O9MjYW3Q2wndm7ovpAeiKxFT8xp7/181f mALA== 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=ivV16fdUY045eb7qHFfdA8u+LRUCkSHdYO5cE1CcADo=; b=KkRFEPrebWHrcgmQY0w/AYVSBK7v866qtCfGJG1pbBzdZHnOWKh7ljYC1ABtpXHF83 9ccuCBON/anS0JVmMC7JyIuIoFhokX0/3rrVbCycEO4G2ItY8SsBdvD6KNs3FjX/F/qY ddZU8fjq+rAlNm14P7Tf0H8cW4e+8tajYTPipc3SrY9Kv6GEVnUp6xQtpsr0AARGDVc0 BHMjHPlRnThnj6MovcZPzXcLKXBt1FNEr+0X2I8Ww3DIW+tV5jc5AyhPEa6YETWJFuRm rTL+1p06N+qA/6Us8MdYpmRZJIjv/fy8BXxMBMQ6WVTWVZWddNmwNJZ3Fw4w9ClFyg0Z P7+A== X-Gm-Message-State: ACgBeo3nwvXfz459HnhbZgUs/gW6Jz8dxmEH7CgdxHWhcGvM5vuwf86h Ic+g5g8DFZ34XryYMm1nzKL45w== X-Google-Smtp-Source: AA6agR6zpfY+akoRaOuhs7g5oZbbaeZEKjz1p9oAqcSdz3xsDVZSAor7WoMpS2W8nXGBw7YFzrtxxg== X-Received: by 2002:a05:6870:f149:b0:de:e873:4a46 with SMTP id l9-20020a056870f14900b000dee8734a46mr7084980oac.286.1659931135794; Sun, 07 Aug 2022 20:58:55 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Aug 2022 20:58:55 -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 11/17] lib: utils/gpio: Use kconfig for enabling/disabling drivers Date: Mon, 8 Aug 2022 09:27:34 +0530 Message-Id: <20220808035740.69335-12-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_205857_351397_672063A6 X-CRM114-Status: GOOD ( 12.71 ) 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 gpio drivers makefile to use kconfig for enabling/disabling drivers. To avoid compile errors, we also enable appropriate gpio drivers for each platform. Signed-off-by: Anup Patel Tested-by: Andrew Jones Acked-by: Atish Patra Tested-by: Atish Patra --- lib/u [...] 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 [2001:4860:4864:20:0:0:0:2f 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 gpio drivers makefile to use kconfig for enabling/disabling drivers. To avoid compile errors, we also enable appropriate gpio drivers for each platform. Signed-off-by: Anup Patel Tested-by: Andrew Jones Acked-by: Atish Patra Tested-by: Atish Patra --- lib/utils/Kconfig | 2 ++ lib/utils/gpio/Kconfig | 22 ++++++++++++++++++++++ lib/utils/gpio/objects.mk | 10 +++++----- lib/utils/reset/Kconfig | 1 + platform/generic/configs/defconfig | 2 ++ 5 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 lib/utils/gpio/Kconfig diff --git a/lib/utils/Kconfig b/lib/utils/Kconfig index 39452d5..673b02b 100644 --- a/lib/utils/Kconfig +++ b/lib/utils/Kconfig @@ -2,6 +2,8 @@ menu "Utils and Drivers Support" +source "$(OPENSBI_SRC_DIR)/lib/utils/gpio/Kconfig" + source "$(OPENSBI_SRC_DIR)/lib/utils/i2c/Kconfig" source "$(OPENSBI_SRC_DIR)/lib/utils/ipi/Kconfig" diff --git a/lib/utils/gpio/Kconfig b/lib/utils/gpio/Kconfig new file mode 100644 index 0000000..daf7f91 --- /dev/null +++ b/lib/utils/gpio/Kconfig @@ -0,0 +1,22 @@ +# SPDX-License-Identifier: BSD-2-Clause + +menu "GPIO Support" + +config FDT_GPIO + bool "FDT based GPIO drivers" + select GPIO + default n + +if FDT_GPIO + +config FDT_GPIO_SIFIVE + bool "SiFive GPIO FDT driver" + default n + +endif + +config GPIO + bool "GPIO support" + default n + +endmenu diff --git a/lib/utils/gpio/objects.mk b/lib/utils/gpio/objects.mk index a5e131b..eedd699 100644 --- a/lib/utils/gpio/objects.mk +++ b/lib/utils/gpio/objects.mk @@ -7,10 +7,10 @@ # Anup Patel # -libsbiutils-objs-y += gpio/fdt_gpio.o -libsbiutils-objs-y += gpio/fdt_gpio_drivers.o +libsbiutils-objs-$(CONFIG_FDT_GPIO) += gpio/fdt_gpio.o +libsbiutils-objs-$(CONFIG_FDT_GPIO) += gpio/fdt_gpio_drivers.o -carray-fdt_gpio_drivers-y += fdt_gpio_sifive -libsbiutils-objs-y += gpio/fdt_gpio_sifive.o +carray-fdt_gpio_drivers-$(CONFIG_FDT_GPIO_SIFIVE) += fdt_gpio_sifive +libsbiutils-objs-$(CONFIG_FDT_GPIO_SIFIVE) += gpio/fdt_gpio_sifive.o -libsbiutils-objs-y += gpio/gpio.o +libsbiutils-objs-$(CONFIG_GPIO) += gpio/gpio.o diff --git a/lib/utils/reset/Kconfig b/lib/utils/reset/Kconfig index e7a71e3..71996cb 100644 --- a/lib/utils/reset/Kconfig +++ b/lib/utils/reset/Kconfig @@ -10,6 +10,7 @@ if FDT_RESET config FDT_RESET_GPIO bool "GPIO FDT reset driver" + depends on FDT_GPIO default n config FDT_RESET_HTIF diff --git a/platform/generic/configs/defconfig b/platform/generic/configs/defconfig index c9c221e..d56cef2 100644 --- a/platform/generic/configs/defconfig +++ b/platform/generic/configs/defconfig @@ -1,3 +1,5 @@ +CONFIG_FDT_GPIO=y +CONFIG_FDT_GPIO_SIFIVE=y CONFIG_FDT_I2C=y CONFIG_FDT_I2C_SIFIVE=y CONFIG_FDT_IPI=y