From patchwork Mon Jul 18 12:41:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1657442 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=C7Ko3Flp; 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=WT4+OFij; 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 4LmhTP5Vrlz9sFs for ; Mon, 18 Jul 2022 22:43:21 +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=sMNIEmLE4rqa+Vm4LDUx/Q3LjfSZJTbrrgR65hEsRC8=; b=C7Ko3Flpiwx/hh ackLE7XqoMlrav3/0P9GShZVxf5plwadbvtABVQX3qSA5KrLfAs2b9fvkBp/s9SDhMgCd8HJKEUBc dI9cDgIRLv3VaDL9oLSqdTcKOk2gcNpqszra9Ki2+0bgxCnuq2sTgnEgfpIVedBISUyBboLvCffyk 4MzVhYp/7bCxOYiSQu35zarphamntHcMUDlc59B3m3ePD6iSNV6mOcOL0O9t/8W3ymfEmB5+ARefy AS/36vGYGLgPQteQpXui75bHSGBWiee5nZryXHYCQZvWa0RDxXrAtGjPZGOw0DhUD6aj2pzwcgOqx vJxG+Y2RWIIdu26MUp/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ5W-00DOK4-J7; Mon, 18 Jul 2022 12:43:02 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ5T-00DOHU-Rg for opensbi@lists.infradead.org; Mon, 18 Jul 2022 12:43:01 +0000 Received: by mail-pj1-x1034.google.com with SMTP id x18-20020a17090a8a9200b001ef83b332f5so18140312pjn.0 for ; Mon, 18 Jul 2022 05:42:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=81DXdHZxWoBm59K11ywKs+lRHQjfu+qT3dTl0lOGLfs=; b=WT4+OFijFjo4i7XHzdEmIoJ27rcDx/SFb/2LN4gPkYwfxoOFyvnmbNJ6EITLvb6OFx WnR2bVMIy2YlMAASD9LiOQaEh0Jyb3WXkCzdN+wX2Z1nBBJsLs4pl5umZnhHiqVf2ZlU +Cpjh74Pk5C3SeU7iBZr0JkZ6Qk9xaClnRF8fT1hksIbWnzllqQX08uc9eP9Tld82Bc9 H8THGGTueUZEXdLkn8ZjCHTtxwE3dKtEjLtdyLyWl4EZimRgsT/aCt7uUiF3mG30zDcE a0VoE6drqBgqySFeFYfrjN7QLHN9cVH+3fALKR4U0jSnlJCq/nebFyNrE3Vbg2mHXWzf nTaQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=81DXdHZxWoBm59K11ywKs+lRHQjfu+qT3dTl0lOGLfs=; b=4S8qlQko5052S3iZ695ae0bmBZ+RVsmEq9/boRgQsrzdfifxs0bte54lLJ6heaBbkF B2dldLlPBpe56JUaJ+Xy8LRaxDzbv4Tv9S50+cWBYJz8kJ80q/ehaToqF66IkSPrdK+i vyT+Y1YV5h2xRfMk4yUgr1Fk7SkgYhvUTDpi388yONRvBIwcmVvCfo0dfrxIcY9XSuwM zUoM0/aKRIRCuDMgAwakohn1DZmPPi5HjTt0ZXX1wxoVYT4URR3k9+l40GRJ4xCXYyTl C1lN+mysxLtmTKHz8y4TYtnL64B4S22jHy0o+jJ72bemySVC1jIPYX89qp2CB3FKzC+B SF8w== X-Gm-Message-State: AJIora/ukcq5va7UdLYgFkhPmS1uhsA5502PryBsxhv0qsXGZOmGJsX5 4yooa1PWDwV6BWC0vXoSGrTAGw== X-Google-Smtp-Source: AGRyM1v48660XxWS9HRCRgoYo/3q7iZBbY5ce9eKfCNdWxelq90gKM/cddTrG3U475FGpq39ci0Cwg== X-Received: by 2002:a17:902:d54e:b0:16c:8fd0:5308 with SMTP id z14-20020a170902d54e00b0016c8fd05308mr25796935plf.159.1658148176897; Mon, 18 Jul 2022 05:42:56 -0700 (PDT) Received: from anup-ubuntu64-vm.. ([122.171.37.148]) by smtp.gmail.com with ESMTPSA id v7-20020a622f07000000b0052ac2e23295sm9174158pfv.44.2022.07.18.05.42.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 05:42:56 -0700 (PDT) From: Anup Patel To: Atish Patra , Alistair Francis Cc: Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 01/14] Makefile: Add initial kconfig support for each platform Date: Mon, 18 Jul 2022 18:11:57 +0530 Message-Id: <20220718124210.2177576-2-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220718124210.2177576-1-apatel@ventanamicro.com> References: <20220718124210.2177576-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220718_054259_935022_8CAB523A X-CRM114-Status: GOOD ( 15.09 ) 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 extend the top-level makefile to allow kconfig based configuration for each platform where each platform has it's own set of configs with "defconfig" being the default config. Signed-off-by: Anup Patel --- Kconfig | 23 ++++++++++ Makefile | 54 +++++++++++++++++++++-- firmware/Kconfig | 1 + lib/utils/Kconfig | 1 + platform/andes/ae350/Kconfig | 5 ++ [...] 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:1034 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 extend the top-level makefile to allow kconfig based configuration for each platform where each platform has it's own set of configs with "defconfig" being the default config. Signed-off-by: Anup Patel --- Kconfig | 23 ++++++++++ Makefile | 54 +++++++++++++++++++++-- firmware/Kconfig | 1 + lib/utils/Kconfig | 1 + platform/andes/ae350/Kconfig | 5 +++ platform/andes/ae350/configs/defconfig | 0 platform/fpga/ariane/Kconfig | 5 +++ platform/fpga/ariane/configs/defconfig | 0 platform/fpga/openpiton/Kconfig | 5 +++ platform/fpga/openpiton/configs/defconfig | 0 platform/generic/Kconfig | 5 +++ platform/generic/configs/defconfig | 0 platform/kendryte/k210/Kconfig | 5 +++ platform/kendryte/k210/configs/defconfig | 0 platform/nuclei/ux600/Kconfig | 5 +++ platform/nuclei/ux600/configs/defconfig | 0 platform/template/Kconfig | 5 +++ platform/template/configs/defconfig | 0 18 files changed, 111 insertions(+), 3 deletions(-) create mode 100644 Kconfig create mode 100644 firmware/Kconfig create mode 100644 lib/utils/Kconfig create mode 100644 platform/andes/ae350/Kconfig create mode 100644 platform/andes/ae350/configs/defconfig create mode 100644 platform/fpga/ariane/Kconfig create mode 100644 platform/fpga/ariane/configs/defconfig create mode 100644 platform/fpga/openpiton/Kconfig create mode 100644 platform/fpga/openpiton/configs/defconfig create mode 100644 platform/generic/Kconfig create mode 100644 platform/generic/configs/defconfig create mode 100644 platform/kendryte/k210/Kconfig create mode 100644 platform/kendryte/k210/configs/defconfig create mode 100644 platform/nuclei/ux600/Kconfig create mode 100644 platform/nuclei/ux600/configs/defconfig create mode 100644 platform/template/Kconfig create mode 100644 platform/template/configs/defconfig diff --git a/Kconfig b/Kconfig new file mode 100644 index 0000000..b8615d2 --- /dev/null +++ b/Kconfig @@ -0,0 +1,23 @@ +# SPDX-License-Identifier: GPL-2.0 + +mainmenu "OpenSBI $OPENSBI_PLATFORM Configuration" + +config OPENSBI_SRC_DIR + string + option env="OPENSBI_SRC_DIR" + +config OPENSBI_PLATFORM + string + option env="OPENSBI_PLATFORM" + +config OPENSBI_PLATFORM_SRC_DIR + string + option env="OPENSBI_PLATFORM_SRC_DIR" + +menu "Platform Options" +source "$OPENSBI_PLATFORM_SRC_DIR/Kconfig" +endmenu + +source "$OPENSBI_SRC_DIR/lib/utils/Kconfig" + +source "$OPENSBI_SRC_DIR/firmware/Kconfig" diff --git a/Makefile b/Makefile index f619ef7..46c7c1c 100644 --- a/Makefile +++ b/Makefile @@ -52,6 +52,9 @@ ifdef PLATFORM_DIR else platform_parent_dir=$(src_dir)/platform endif +ifndef PLATFORM_DEFCONFIG +PLATFORM_DEFCONFIG=defconfig +endif # Check if verbosity is ON for build process CMD_PREFIX_DEFAULT := @ @@ -70,6 +73,19 @@ export libsbi_dir=$(CURDIR)/lib/sbi export libsbiutils_dir=$(CURDIR)/lib/utils export firmware_dir=$(CURDIR)/firmware +# Setup variables for kconfig-frontends +ifdef PLATFORM +export KCONFIG_CONFIG=$(platform_build_dir)/.config +export KCONFIG_AUTOCONFIG=$(platform_build_dir)/auto.conf +export KCONFIG_TRISTATE=$(platform_build_dir)/tristate.conf +export KCONFIG_AUTOHEADER=$(platform_build_dir)/autoconf.h +export KCONFIG_AUTOCONF_CMD=$(platform_build_dir)/include/config/auto.conf.cmd +# Additional exports for include paths in Kconfig files +export OPENSBI_SRC_DIR=$(src_dir) +export OPENSBI_PLATFORM=$(PLATFORM) +export OPENSBI_PLATFORM_SRC_DIR=$(platform_src_dir) +endif + # Find library version OPENSBI_VERSION_MAJOR=`grep "define OPENSBI_VERSION_MAJOR" $(include_dir)/sbi/sbi_version.h | sed 's/.*MAJOR.*\([0-9][0-9]*\)/\1/'` OPENSBI_VERSION_MINOR=`grep "define OPENSBI_VERSION_MINOR" $(include_dir)/sbi/sbi_version.h | sed 's/.*MINOR.*\([0-9][0-9]*\)/\1/'` @@ -183,8 +199,34 @@ libsbi-object-mks=$(shell if [ -d $(libsbi_dir) ]; then find $(libsbi_dir) -inam libsbiutils-object-mks=$(shell if [ -d $(libsbiutils_dir) ]; then find $(libsbiutils_dir) -iname "objects.mk" | sort -r; fi) firmware-object-mks=$(shell if [ -d $(firmware_dir) ]; then find $(firmware_dir) -iname "objects.mk" | sort -r; fi) -# Include platform specifig config.mk +# The "make all" rule should always be first rule +.PHONY: all +all: + +# Include platform specific .config and config.mk ifdef PLATFORM +.PHONY: menuconfig +menuconfig: $(platform_src_dir)/Kconfig $(src_dir)/Kconfig + $(CMD_PREFIX)mkdir -p `dirname $(KCONFIG_CONFIG)` + $(CMD_PREFIX)mkdir -p `dirname $(KCONFIG_AUTOCONF_CMD)` + $(CMD_PREFIX)kconfig-mconf $(src_dir)/Kconfig + $(CMD_PREFIX)cd $(platform_build_dir) && kconfig-conf --silentoldconfig $(src_dir)/Kconfig + +.PHONY: savedefconfig +savedefconfig: $(platform_src_dir)/Kconfig $(src_dir)/Kconfig + $(CMD_PREFIX)mkdir -p `dirname $(KCONFIG_CONFIG)` + $(CMD_PREFIX)mkdir -p `dirname $(KCONFIG_AUTOCONF_CMD)` + $(CMD_PREFIX)kconfig-conf --savedefconfig `dirname $(KCONFIG_CONFIG)`/defconfig $(src_dir)/Kconfig + +$(KCONFIG_CONFIG): $(platform_src_dir)/configs/$(PLATFORM_DEFCONFIG) $(platform_src_dir)/Kconfig $(src_dir)/Kconfig + $(CMD_PREFIX)mkdir -p `dirname $(KCONFIG_CONFIG)` + $(CMD_PREFIX)mkdir -p `dirname $(KCONFIG_AUTOCONF_CMD)` + $(CMD_PREFIX)cp -f $(platform_src_dir)/configs/$(PLATFORM_DEFCONFIG) $(KCONFIG_CONFIG) + $(CMD_PREFIX)cd $(platform_build_dir) && kconfig-conf --silentoldconfig --olddefconfig $(src_dir)/Kconfig +$(KCONFIG_AUTOCONF_CMD): $(KCONFIG_CONFIG) +include $(KCONFIG_CONFIG) +include $(KCONFIG_AUTOCONF_CMD) + include $(platform_src_dir)/config.mk endif @@ -280,6 +322,9 @@ ifeq ($(BUILD_INFO),y) GENFLAGS += -DOPENSBI_BUILD_TIME_STAMP="\"$(OPENSBI_BUILD_TIME_STAMP)\"" GENFLAGS += -DOPENSBI_BUILD_COMPILER_VERSION="\"$(OPENSBI_BUILD_COMPILER_VERSION)\"" endif +ifdef PLATFORM +GENFLAGS += -include $(KCONFIG_AUTOHEADER) +endif GENFLAGS += $(libsbiutils-genflags-y) GENFLAGS += $(platform-genflags-y) GENFLAGS += $(firmware-genflags-y) @@ -419,7 +464,7 @@ targets-y += $(platform_build_dir)/lib/libplatsbi.a endif targets-y += $(firmware-bins-path-y) -# Default rule "make" should always be first rule +# The default "make all" rule .PHONY: all all: $(targets-y) @@ -456,7 +501,7 @@ $(build_dir)/%.o: $(src_dir)/%.S $(call compile_as,$@,$<) $(build_dir)/%.dep: $(src_dir)/%.carray - $(call compile_gen_dep,$@,.c,$<) + $(call compile_gen_dep,$@,.c,$< $(KCONFIG_CONFIG)) $(call compile_gen_dep,$@,.o,$(@:.dep=.c)) $(build_dir)/%.c: $(src_dir)/%.carray @@ -523,6 +568,9 @@ docs: $(build_dir)/docs/latex/refman.pdf # They should not be included for any "xxxconfig" or "xxxclean" rule all-deps-1 = $(if $(findstring config,$(MAKECMDGOALS)),,$(deps-y)) all-deps-2 = $(if $(findstring clean,$(MAKECMDGOALS)),,$(all-deps-1)) +ifdef PLATFORM +$(all-deps-2): | $(KCONFIG_CONFIG) +endif -include $(all-deps-2) # Include external dependency of firmwares after default Makefile rules diff --git a/firmware/Kconfig b/firmware/Kconfig new file mode 100644 index 0000000..f66554c --- /dev/null +++ b/firmware/Kconfig @@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0 diff --git a/lib/utils/Kconfig b/lib/utils/Kconfig new file mode 100644 index 0000000..f66554c --- /dev/null +++ b/lib/utils/Kconfig @@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0 diff --git a/platform/andes/ae350/Kconfig b/platform/andes/ae350/Kconfig new file mode 100644 index 0000000..349c1d3 --- /dev/null +++ b/platform/andes/ae350/Kconfig @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0 + +config PLATFORM_ANDES_AE350 + bool + default y diff --git a/platform/andes/ae350/configs/defconfig b/platform/andes/ae350/configs/defconfig new file mode 100644 index 0000000..e69de29 diff --git a/platform/fpga/ariane/Kconfig b/platform/fpga/ariane/Kconfig new file mode 100644 index 0000000..26f9beb --- /dev/null +++ b/platform/fpga/ariane/Kconfig @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0 + +config PLATFORM_ARIANE_FPGA + bool + default y diff --git a/platform/fpga/ariane/configs/defconfig b/platform/fpga/ariane/configs/defconfig new file mode 100644 index 0000000..e69de29 diff --git a/platform/fpga/openpiton/Kconfig b/platform/fpga/openpiton/Kconfig new file mode 100644 index 0000000..8bfa85a --- /dev/null +++ b/platform/fpga/openpiton/Kconfig @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0 + +config PLATFORM_OPENPITON_FPGA + bool + default y diff --git a/platform/fpga/openpiton/configs/defconfig b/platform/fpga/openpiton/configs/defconfig new file mode 100644 index 0000000..e69de29 diff --git a/platform/generic/Kconfig b/platform/generic/Kconfig new file mode 100644 index 0000000..a811a05 --- /dev/null +++ b/platform/generic/Kconfig @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0 + +config PLATFORM_GENERIC + bool + default y diff --git a/platform/generic/configs/defconfig b/platform/generic/configs/defconfig new file mode 100644 index 0000000..e69de29 diff --git a/platform/kendryte/k210/Kconfig b/platform/kendryte/k210/Kconfig new file mode 100644 index 0000000..726423a --- /dev/null +++ b/platform/kendryte/k210/Kconfig @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0 + +config PLATFORM_KENDRYTE_K210 + bool + default y diff --git a/platform/kendryte/k210/configs/defconfig b/platform/kendryte/k210/configs/defconfig new file mode 100644 index 0000000..e69de29 diff --git a/platform/nuclei/ux600/Kconfig b/platform/nuclei/ux600/Kconfig new file mode 100644 index 0000000..bb8410f --- /dev/null +++ b/platform/nuclei/ux600/Kconfig @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0 + +config PLATFORM_NUCLEI_UX600 + bool + default y diff --git a/platform/nuclei/ux600/configs/defconfig b/platform/nuclei/ux600/configs/defconfig new file mode 100644 index 0000000..e69de29 diff --git a/platform/template/Kconfig b/platform/template/Kconfig new file mode 100644 index 0000000..bd95ea0 --- /dev/null +++ b/platform/template/Kconfig @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0 + +config PLATFORM_TEMPLATE + bool + default y diff --git a/platform/template/configs/defconfig b/platform/template/configs/defconfig new file mode 100644 index 0000000..e69de29 From patchwork Mon Jul 18 12:41:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1657444 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=121WfUaq; 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=nNhMi1Pi; 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 4LmhTR0fKvz9sFw for ; Mon, 18 Jul 2022 22:43:22 +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=yHeYxyHH4h249UP0Iuq+VIziN1Hv5F2FVH5g5BSvR2E=; b=121WfUaqydFseR k0J/jnXAmJwPQy1X8XzFuHT8N5eDSjWAxmygR/gNE2tQN+0s83FhqMQYXsIh4BkH0euhOwGXz6qcO R2IipWvwnEK0u3MY61VJ9QFEKDncIGalXDLbhO/lMyWe2FgU2N4omB60l9stXvYT/K/R4pscfTcmY qMiRlo0WT9SiB/0BsyrjTKuHyIIkkvAM+FLOEib1YZYjI0AtNkYIv5ZlXGwkb7xfjH0KOxCnPV/UA uoakDq8avCQZ+xs85Y3FjdcW09UaPLcjNPi0m0c0bjxnW8FuUComrqhLHqXY31/EHTBs/Ixjt22Ie 0knUGgJxTima17gXojnQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ5c-00DOND-Cl; Mon, 18 Jul 2022 12:43:08 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ5Y-00DOJ7-Sl for opensbi@lists.infradead.org; Mon, 18 Jul 2022 12:43:06 +0000 Received: by mail-pj1-x102a.google.com with SMTP id q5-20020a17090a304500b001efcc885cc4so12453906pjl.4 for ; Mon, 18 Jul 2022 05:43:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XlrvOE/untThchspMImXmuQaNNfgvbQSQl0dTghG510=; b=nNhMi1PisTk7W+qZTU9hP5g4c78a1D10js8sR0A5IKhCF3QdkuU7uAjrNiOidZz3AX tM6JnPPfnIM0SrrnSTBqDujDWiXfDmrRlYMdfMe70GYahg7zYaFxLQC07RTJhl4q0FBa 50+AFvUqiSybWuSniOfgTC58c/cajYxIgcznY+Mp+6PHD94JsqlOVR5nLksY+B61TavM YVm2ns5H//wbrCYFWlE6X42lum7nlY8UZDxK/Mu5EhimfI1mvIhdaiLuCyvpyjqijDqa arg86rKnCABl+dlOHnc5sdxU7+510VTabu20WuJFV0vRZC5XP+WIuRcJ+q5WcGhb8Jf2 Vlzw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=XlrvOE/untThchspMImXmuQaNNfgvbQSQl0dTghG510=; b=osftKwjG+YYz6XLc52BeOISZKtVavaB+Zqlal1K1PFZitzlckdRcSUolFGdEiER40H O+O5uFgvjm/stIPDWzkJvreSEefbw575oTs7C7QKrNt07RQKwjDEuoWYtjaq7+6fY22e FWKeYMXNSJMlftu3fDlpYTELHcbjZRSuhgKiXSJhNa/MT5PzpO8NOT5x/WyqRScgEE52 DXoCOtLMybSVgQrGT5S1S7Fnxj+YiEITUDY8Hanh9NqmJDmpX9gi9w4w8q78samD7tqf 62RDKG+cJPN02otqFZfW1JCevkGEUzNvGtgc8O2pN7Hq9th9tuLD/S084v1OoK8mwCNg BEfA== X-Gm-Message-State: AJIora/lcvkFnzcWjIFWI8VjdDGQdXOkgDAy2HKANiBYsm1Jqyhh7MEy FSPZ4SJTv9qkfUoaDfH0wuMZ2Q== X-Google-Smtp-Source: AGRyM1uFtY+OFB5dodTdURnYC1HHlv/pSmOj1yptYAPLjAwp1tGmimkKm8xi2X5UldZfZmVt101gXA== X-Received: by 2002:a17:902:ecca:b0:16c:569:47d8 with SMTP id a10-20020a170902ecca00b0016c056947d8mr28747638plh.97.1658148180311; Mon, 18 Jul 2022 05:43:00 -0700 (PDT) Received: from anup-ubuntu64-vm.. ([122.171.37.148]) by smtp.gmail.com with ESMTPSA id v7-20020a622f07000000b0052ac2e23295sm9174158pfv.44.2022.07.18.05.42.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 05:42:59 -0700 (PDT) From: Anup Patel To: Atish Patra , Alistair Francis Cc: Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 02/14] Makefile: Compile lib/utils sources separately for each platform Date: Mon, 18 Jul 2022 18:11:58 +0530 Message-Id: <20220718124210.2177576-3-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220718124210.2177576-1-apatel@ventanamicro.com> References: <20220718124210.2177576-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220718_054304_961294_607CB2EB X-CRM114-Status: GOOD ( 12.80 ) 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: Currently, if same build directory is used to compile two different platforms then lib/utils objects are shared for these platforms. We will be having platform specific configs to enable/disable drivers in lib/utils and select compile time options for lib/utils sources. This means lib/utils sources will now be compiled in a platfor [...] 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:102a 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 Currently, if same build directory is used to compile two different platforms then lib/utils objects are shared for these platforms. We will be having platform specific configs to enable/disable drivers in lib/utils and select compile time options for lib/utils sources. This means lib/utils sources will now be compiled in a platform specific way. To tackle above, we update top-level Makefile as follows: 1) Don't create libsbiutils.a anymore because this can't be shared between platforms. 2) Compile lib/utils sources separately for each platform. 3) Add comments showing which make rules are for lib/sbi, lib/utils, firmware, and platform sources. Signed-off-by: Anup Patel --- Makefile | 48 ++++++++++++++++---------------- docs/library_usage.md | 6 +--- scripts/create-binary-archive.sh | 2 +- 3 files changed, 26 insertions(+), 30 deletions(-) diff --git a/Makefile b/Makefile index 46c7c1c..5fc67db 100644 --- a/Makefile +++ b/Makefile @@ -240,8 +240,8 @@ include $(firmware-object-mks) # Setup list of objects libsbi-objs-path-y=$(foreach obj,$(libsbi-objs-y),$(build_dir)/lib/sbi/$(obj)) -libsbiutils-objs-path-y=$(foreach obj,$(libsbiutils-objs-y),$(build_dir)/lib/utils/$(obj)) ifdef PLATFORM +libsbiutils-objs-path-y=$(foreach obj,$(libsbiutils-objs-y),$(platform_build_dir)/lib/utils/$(obj)) platform-objs-path-y=$(foreach obj,$(platform-objs-y),$(platform_build_dir)/$(obj)) firmware-bins-path-y=$(foreach bin,$(firmware-bins-y),$(platform_build_dir)/firmware/$(bin)) endif @@ -458,7 +458,6 @@ compile_gen_dep = $(CMD_PREFIX)mkdir -p `dirname $(1)`; \ echo "$(1:.dep=$(2)): $(3)" >> $(1) targets-y = $(build_dir)/lib/libsbi.a -targets-y += $(build_dir)/lib/libsbiutils.a ifdef PLATFORM targets-y += $(platform_build_dir)/lib/libplatsbi.a endif @@ -471,12 +470,10 @@ all: $(targets-y) # Preserve all intermediate files .SECONDARY: +# Rules for lib/sbi sources $(build_dir)/lib/libsbi.a: $(libsbi-objs-path-y) $(call compile_ar,$@,$^) -$(build_dir)/lib/libsbiutils.a: $(libsbi-objs-path-y) $(libsbiutils-objs-path-y) - $(call compile_ar,$@,$^) - $(platform_build_dir)/lib/libplatsbi.a: $(libsbi-objs-path-y) $(libsbiutils-objs-path-y) $(platform-objs-path-y) $(call compile_ar,$@,$^) @@ -500,22 +497,14 @@ $(build_dir)/%.dep: $(src_dir)/%.S $(build_dir)/%.o: $(src_dir)/%.S $(call compile_as,$@,$<) -$(build_dir)/%.dep: $(src_dir)/%.carray +# Rules for platform sources +$(platform_build_dir)/%.dep: $(platform_src_dir)/%.carray $(call compile_gen_dep,$@,.c,$< $(KCONFIG_CONFIG)) $(call compile_gen_dep,$@,.o,$(@:.dep=.c)) -$(build_dir)/%.c: $(src_dir)/%.carray +$(platform_build_dir)/%.c: $(platform_src_dir)/%.carray $(call compile_carray,$@,$<) -$(platform_build_dir)/%.bin: $(platform_build_dir)/%.elf - $(call compile_objcopy,$@,$<) - -$(platform_build_dir)/%.elf: $(platform_build_dir)/%.o $(platform_build_dir)/%.elf.ld $(platform_build_dir)/lib/libplatsbi.a - $(call compile_elf,$@,$@.ld,$< $(platform_build_dir)/lib/libplatsbi.a) - -$(platform_build_dir)/%.ld: $(src_dir)/%.ldS - $(call compile_cpp,$@,$<) - $(platform_build_dir)/%.dep: $(platform_src_dir)/%.c $(call compile_cc_dep,$@,$<) @@ -539,6 +528,23 @@ $(platform_build_dir)/%.c: $(platform_build_dir)/%.dtb $(platform_build_dir)/%.dtb: $(platform_src_dir)/%.dts $(call compile_dts,$@,$<) +# Rules for lib/utils and firmware sources +$(platform_build_dir)/%.bin: $(platform_build_dir)/%.elf + $(call compile_objcopy,$@,$<) + +$(platform_build_dir)/%.elf: $(platform_build_dir)/%.o $(platform_build_dir)/%.elf.ld $(platform_build_dir)/lib/libplatsbi.a + $(call compile_elf,$@,$@.ld,$< $(platform_build_dir)/lib/libplatsbi.a) + +$(platform_build_dir)/%.ld: $(src_dir)/%.ldS + $(call compile_cpp,$@,$<) + +$(platform_build_dir)/%.dep: $(src_dir)/%.carray + $(call compile_gen_dep,$@,.c,$< $(KCONFIG_CONFIG)) + $(call compile_gen_dep,$@,.o,$(@:.dep=.c)) + +$(platform_build_dir)/%.c: $(src_dir)/%.carray + $(call compile_carray,$@,$<) + $(platform_build_dir)/%.dep: $(src_dir)/%.c $(call compile_cc_dep,$@,$<) @@ -592,7 +598,6 @@ endif endif install_targets-y = install_libsbi -install_targets-y += install_libsbiutils ifdef PLATFORM install_targets-y += install_libplatsbi install_targets-y += install_firmwares @@ -607,17 +612,12 @@ install_libsbi: $(build_dir)/lib/libsbi.a $(call inst_header_dir,$(install_root_dir)/$(install_include_path),$(include_dir)/sbi) $(call inst_file,$(install_root_dir)/$(install_lib_path)/libsbi.a,$(build_dir)/lib/libsbi.a) -.PHONY: install_libsbiutils -install_libsbiutils: $(build_dir)/lib/libsbiutils.a - $(call inst_header_dir,$(install_root_dir)/$(install_include_path),$(include_dir)/sbi_utils) - $(call inst_file,$(install_root_dir)/$(install_lib_path)/libsbiutils.a,$(build_dir)/lib/libsbiutils.a) - .PHONY: install_libplatsbi -install_libplatsbi: $(platform_build_dir)/lib/libplatsbi.a $(build_dir)/lib/libsbi.a $(build_dir)/lib/libsbiutils.a +install_libplatsbi: $(platform_build_dir)/lib/libplatsbi.a $(build_dir)/lib/libsbi.a $(call inst_file,$(install_root_dir)/$(install_lib_path)/opensbi/$(platform_subdir)/lib/libplatsbi.a,$(platform_build_dir)/lib/libplatsbi.a) .PHONY: install_firmwares -install_firmwares: $(platform_build_dir)/lib/libplatsbi.a $(build_dir)/lib/libsbi.a $(build_dir)/lib/libsbiutils.a $(firmware-bins-path-y) +install_firmwares: $(platform_build_dir)/lib/libplatsbi.a $(build_dir)/lib/libsbi.a $(firmware-bins-path-y) $(call inst_file_list,$(install_root_dir),$(build_dir),$(install_firmware_path)/$(platform_subdir)/firmware,$(firmware-elfs-path-y)) $(call inst_file_list,$(install_root_dir),$(build_dir),$(install_firmware_path)/$(platform_subdir)/firmware,$(firmware-bins-path-y)) diff --git a/docs/library_usage.md b/docs/library_usage.md index ff99801..d5d2ba9 100644 --- a/docs/library_usage.md +++ b/docs/library_usage.md @@ -8,11 +8,7 @@ OpenSBI provides two types of static libraries: hooks for the execution of this interface must be provided by the firmware or bootloader linking with this library. This library is installed as */lib/libsbi.a* -2. *libsbiutils.a* - A static library that will contain all common code required - by any platform supported in OpenSBI. It will be built by default and included - in libplatsbi.a. This library is installed as - */lib/libsbiutils.a*. -3. *libplatsbi.a* - An example platform-specific static library integrating +2. *libplatsbi.a* - An example platform-specific static library integrating *libsbi.a* with platform-specific hooks. This library is available only for the platforms supported by OpenSBI. This library is installed as */platform//lib/libplatsbi.a* diff --git a/scripts/create-binary-archive.sh b/scripts/create-binary-archive.sh index 43c5452..261a45a 100755 --- a/scripts/create-binary-archive.sh +++ b/scripts/create-binary-archive.sh @@ -118,7 +118,7 @@ build_opensbi() { # Build and install generic library echo "Build and install generic library XLEN=${BUILD_RISCV_XLEN}" echo "" - make -C "${BUILD_OPENSBI_SOURCE_PATH}" O="${BUILD_OUTPUT_PATH}/${BUILD_NAME}" I="${BUILD_OUTPUT_PATH}/${BUILD_ARCHIVE_NAME}" PLATFORM_RISCV_XLEN="${BUILD_RISCV_XLEN}" install_libsbi install_libsbiutils -j "${BUILD_NUM_THREADS}" + make -C "${BUILD_OPENSBI_SOURCE_PATH}" O="${BUILD_OUTPUT_PATH}/${BUILD_NAME}" I="${BUILD_OUTPUT_PATH}/${BUILD_ARCHIVE_NAME}" PLATFORM_RISCV_XLEN="${BUILD_RISCV_XLEN}" install_libsbi -j "${BUILD_NUM_THREADS}" echo "" # Build and install relevant platforms From patchwork Mon Jul 18 12:41:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1657445 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=j+BsCXI8; 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=ViCHAfCB; 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 4LmhTR2VNxz9sGD for ; Mon, 18 Jul 2022 22:43:23 +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=9XEtUcRA1+ZfKeRoMsnJwo+4WG6y816z5a79cW40emg=; b=j+BsCXI8iNXTRh clkw8REfKM8spvERS4uvxBI1E0bRQDjkY0tFc2lg4NzLv4Z3zB8A5Py9WYhqASMXJgJ5UmVtQNaTv Zv0VR0bWOr1RiZXcBwSBTwTB9QytArsJZJm69Cr/QIKBfhQVuKz3e4mZpYsn5MMoD3EB6wxQXhm31 q/Q8IO8iZXvJ8Uh+5eMwzm/MUDDY2TM3PWa4hWd9fqyVnQN5qVJodlj0SyC50tiynkAcQ+MDxPMzI 95o9cMbd4DTzakhHBB0cBh7cx8C9ob0QfoIpiMBhw51D4JKzT2QuAD7p531KZsJjsBy64ZTAS5FeP mEmNABkMc9dfHPRI+qKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ5d-00DOOU-Ld; Mon, 18 Jul 2022 12:43:09 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ5a-00DOKV-Az for opensbi@lists.infradead.org; Mon, 18 Jul 2022 12:43:08 +0000 Received: by mail-pl1-x634.google.com with SMTP id b2so8887672plx.7 for ; Mon, 18 Jul 2022 05:43:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6tPTmvKtNqsaqSFuicgqsfRV6/6OzDf4ylU2GVsKH04=; b=ViCHAfCBM9N9VtdVpYdeSBzXC3X0q+NS81meu/GgsatWP51QfXi+NZDvYJY0l6cB9p Pejs482NTnujTu2PKiXnX8GnNUt+gQcDt19+pRRgJ1LKUMtv/2VBenQ264n0j9/pt+Wd Yhfc6XCNtdcezOcqry/QBwj7wXJ+vy1YBqdqPAqyOk/2LQ5FVfRVjdYNIAdyhxRZah2C SGDbqz2qkXZrDg1behYS+Zep/yURlHZsxRpbUybV0/YsBIQJwb2yi1XDwJGplqw9KnF0 hWyHFQcdnL/ZAgNwlBIriOeW23y/quJhOtojdqN0kAH3WEd0hp8wRZmKZUq3UzvRHceZ Vmmw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=6tPTmvKtNqsaqSFuicgqsfRV6/6OzDf4ylU2GVsKH04=; b=2PSl7cUhcN7p6mMzS4zr2uMc2lpExNwwlaJL1Lsycksc6dopH3C6W5u4m9K93m8B69 GQRbFI4wFb1duYkHn3rUBQQ0a7ytLlfbfmWWDO/Rg/kXPKbzNo8IBKHBKkjRP0hXkKrF tpTWw2FwfKKACETss79FgKQYUHBoD2T1href3DswyfpztxmkuAY/OZZWY6ujXOoEpBDP BwAgOthnPkxawrc3jugFEVgobMM59SK1HJ1fRFJE92WL7opQg27VT/H4zq4sobgFsgVP 7GuoHmW3inqBuwq7HTsCzRf3yF5BC0Kzsw+Nd2Md6n8aEI12DzPdP/56qg5Wno7hl0WL Yy/g== X-Gm-Message-State: AJIora9Tw4Qj6+KVAUF+w7NBb0FllaE3ra9MZRngNMc6fYR+LAIBlyAc 9B7ahaduJQFf+HTy9fU1ipvj3Q== X-Google-Smtp-Source: AGRyM1uF4GhSI4qUMj3oBbo30Xq5osPl2+GZLMB5uwmNHdtfOe/j1e5IX5sk6LE1ciu55gaW8OGv2g== X-Received: by 2002:a17:903:1316:b0:16b:ea27:1002 with SMTP id iy22-20020a170903131600b0016bea271002mr28550069plb.67.1658148183291; Mon, 18 Jul 2022 05:43:03 -0700 (PDT) Received: from anup-ubuntu64-vm.. ([122.171.37.148]) by smtp.gmail.com with ESMTPSA id v7-20020a622f07000000b0052ac2e23295sm9174158pfv.44.2022.07.18.05.43.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 05:43:02 -0700 (PDT) From: Anup Patel To: Atish Patra , Alistair Francis Cc: Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 03/14] lib: utils/serial: Use kconfig for enabling/disabling drivers Date: Mon, 18 Jul 2022 18:11:59 +0530 Message-Id: <20220718124210.2177576-4-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220718124210.2177576-1-apatel@ventanamicro.com> References: <20220718124210.2177576-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220718_054306_403069_0B796AB3 X-CRM114-Status: GOOD ( 13.13 ) 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 serial drivers makefile to use kconfig for enabling/disabling drivers. To avoid compile errors, we also enable appropriate serial drivers for each platform. Signed-off-by: Anup Patel --- include/sbi_utils/serial/fdt_serial.h | 8 +++ lib/utils/Kconfig | 6 +++ lib/utils/serial/Kconfig | 71 +++++++++++++++++++++++++++ lib/utils/seri [...] 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:634 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 serial drivers makefile to use kconfig for enabling/disabling drivers. To avoid compile errors, we also enable appropriate serial drivers for each platform. Signed-off-by: Anup Patel --- include/sbi_utils/serial/fdt_serial.h | 8 +++ lib/utils/Kconfig | 6 +++ lib/utils/serial/Kconfig | 71 +++++++++++++++++++++++++++ lib/utils/serial/objects.mk | 44 ++++++++--------- platform/andes/ae350/Kconfig | 1 + platform/fpga/ariane/Kconfig | 1 + platform/fpga/openpiton/Kconfig | 1 + platform/generic/configs/defconfig | 8 +++ platform/kendryte/k210/Kconfig | 1 + platform/nuclei/ux600/Kconfig | 1 + platform/template/Kconfig | 1 + 11 files changed, 121 insertions(+), 22 deletions(-) create mode 100644 lib/utils/serial/Kconfig diff --git a/include/sbi_utils/serial/fdt_serial.h b/include/sbi_utils/serial/fdt_serial.h index 6451c23..daa2e4f 100644 --- a/include/sbi_utils/serial/fdt_serial.h +++ b/include/sbi_utils/serial/fdt_serial.h @@ -12,6 +12,8 @@ #include +#ifdef CONFIG_FDT_SERIAL + struct fdt_serial { const struct fdt_match *match_table; int (*init)(void *fdt, int nodeoff, const struct fdt_match *match); @@ -19,4 +21,10 @@ struct fdt_serial { int fdt_serial_init(void); +#else + +static inline int fdt_serial_init(void) { return 0; } + +#endif + #endif diff --git a/lib/utils/Kconfig b/lib/utils/Kconfig index f66554c..464bd03 100644 --- a/lib/utils/Kconfig +++ b/lib/utils/Kconfig @@ -1 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 + +menu "Utils and Drivers Support" + +source "$OPENSBI_SRC_DIR/lib/utils/serial/Kconfig" + +endmenu diff --git a/lib/utils/serial/Kconfig b/lib/utils/serial/Kconfig new file mode 100644 index 0000000..9e6b6fc --- /dev/null +++ b/lib/utils/serial/Kconfig @@ -0,0 +1,71 @@ +# SPDX-License-Identifier: GPL-2.0 + +menu "Serial Device Support" + +config FDT_SERIAL + bool "FDT based serial drivers" + default n + +if FDT_SERIAL + +config FDT_SERIAL_GAISLER + bool "Gaisler UART FDT driver" + select SERIAL_GAISLER + default n + +config FDT_SERIAL_HTIF + bool "Host transfer interface (HTIF) UART FDT driver" + default n + +config FDT_SERIAL_SHAKTI + bool "Shakti UART FDT driver" + select SERIAL_SHAKTI + default n + +config FDT_SERIAL_SIFIVE + bool "SiFive UART FDT driver" + select SERIAL_SIFIVE + default n + +config FDT_SERIAL_LITEX + bool "LiteX UART FDT driver" + select SERIAL_LITEX + default n + +config FDT_SERIAL_UART8250 + bool "8250 UART FDT driver" + select SERIAL_UART8250 + default n + +config FDT_SERIAL_XILINX_UARTLITE + bool "Xilinx UART Lite FDT driver" + select SERIAL_XILINX_UARTLITE + default n + +endif + +config SERIAL_GAISLER + bool "Gaisler UART support" + default n + +config SERIAL_SHAKTI + bool "Shakti UART support" + default n + +config SERIAL_SIFIVE + bool "SiFive UART support" + default n + +config SERIAL_LITEX + bool "LiteX UART support" + default n + +config SERIAL_UART8250 + bool "8250 UART support" + default n + +config SERIAL_XILINX_UARTLITE + bool "Xilinx UART Lite support" + default n + +endmenu diff --git a/lib/utils/serial/objects.mk b/lib/utils/serial/objects.mk index d26a74e..fa9f5a3 100644 --- a/lib/utils/serial/objects.mk +++ b/lib/utils/serial/objects.mk @@ -7,33 +7,33 @@ # Anup Patel # -libsbiutils-objs-y += serial/fdt_serial.o -libsbiutils-objs-y += serial/fdt_serial_drivers.o +libsbiutils-objs-$(CONFIG_FDT_SERIAL) += serial/fdt_serial.o +libsbiutils-objs-$(CONFIG_FDT_SERIAL) += serial/fdt_serial_drivers.o -carray-fdt_serial_drivers-y += fdt_serial_gaisler -libsbiutils-objs-y += serial/fdt_serial_gaisler.o +carray-fdt_serial_drivers-$(CONFIG_FDT_SERIAL_GAISLER) += fdt_serial_gaisler +libsbiutils-objs-$(CONFIG_FDT_SERIAL_GAISLER) += serial/fdt_serial_gaisler.o -carray-fdt_serial_drivers-y += fdt_serial_htif -libsbiutils-objs-y += serial/fdt_serial_htif.o +carray-fdt_serial_drivers-$(CONFIG_FDT_SERIAL_HTIF) += fdt_serial_htif +libsbiutils-objs-$(CONFIG_FDT_SERIAL_HTIF) += serial/fdt_serial_htif.o -carray-fdt_serial_drivers-y += fdt_serial_shakti -libsbiutils-objs-y += serial/fdt_serial_shakti.o +carray-fdt_serial_drivers-$(CONFIG_FDT_SERIAL_SHAKTI) += fdt_serial_shakti +libsbiutils-objs-$(CONFIG_FDT_SERIAL_SHAKTI) += serial/fdt_serial_shakti.o -carray-fdt_serial_drivers-y += fdt_serial_sifive -libsbiutils-objs-y += serial/fdt_serial_sifive.o +carray-fdt_serial_drivers-$(CONFIG_FDT_SERIAL_SIFIVE) += fdt_serial_sifive +libsbiutils-objs-$(CONFIG_FDT_SERIAL_SIFIVE) += serial/fdt_serial_sifive.o -carray-fdt_serial_drivers-y += fdt_serial_litex -libsbiutils-objs-y += serial/fdt_serial_litex.o +carray-fdt_serial_drivers-$(CONFIG_FDT_SERIAL_LITEX) += fdt_serial_litex +libsbiutils-objs-$(CONFIG_FDT_SERIAL_LITEX) += serial/fdt_serial_litex.o -carray-fdt_serial_drivers-y += fdt_serial_uart8250 -libsbiutils-objs-y += serial/fdt_serial_uart8250.o +carray-fdt_serial_drivers-$(CONFIG_FDT_SERIAL_UART8250) += fdt_serial_uart8250 +libsbiutils-objs-$(CONFIG_FDT_SERIAL_UART8250) += serial/fdt_serial_uart8250.o -carray-fdt_serial_drivers-y += fdt_serial_xlnx_uartlite -libsbiutils-objs-y += serial/fdt_serial_xlnx_uartlite.o +carray-fdt_serial_drivers-$(CONFIG_FDT_SERIAL_XILINX_UARTLITE) += fdt_serial_xlnx_uartlite +libsbiutils-objs-$(CONFIG_FDT_SERIAL_XILINX_UARTLITE) += serial/fdt_serial_xlnx_uartlite.o -libsbiutils-objs-y += serial/gaisler-uart.o -libsbiutils-objs-y += serial/shakti-uart.o -libsbiutils-objs-y += serial/sifive-uart.o -libsbiutils-objs-y += serial/litex-uart.o -libsbiutils-objs-y += serial/uart8250.o -libsbiutils-objs-y += serial/xlnx-uartlite.o +libsbiutils-objs-$(CONFIG_SERIAL_GAISLER) += serial/gaisler-uart.o +libsbiutils-objs-$(CONFIG_SERIAL_SHAKTI) += serial/shakti-uart.o +libsbiutils-objs-$(CONFIG_SERIAL_SIFIVE) += serial/sifive-uart.o +libsbiutils-objs-$(CONFIG_SERIAL_LITEX) += serial/litex-uart.o +libsbiutils-objs-$(CONFIG_SERIAL_UART8250) += serial/uart8250.o +libsbiutils-objs-$(CONFIG_SERIAL_XILINX_UARTLITE) += serial/xlnx-uartlite.o diff --git a/platform/andes/ae350/Kconfig b/platform/andes/ae350/Kconfig index 349c1d3..0048c1b 100644 --- a/platform/andes/ae350/Kconfig +++ b/platform/andes/ae350/Kconfig @@ -2,4 +2,5 @@ config PLATFORM_ANDES_AE350 bool + select SERIAL_UART8250 default y diff --git a/platform/fpga/ariane/Kconfig b/platform/fpga/ariane/Kconfig index 26f9beb..797af74 100644 --- a/platform/fpga/ariane/Kconfig +++ b/platform/fpga/ariane/Kconfig @@ -2,4 +2,5 @@ config PLATFORM_ARIANE_FPGA bool + select SERIAL_UART8250 default y diff --git a/platform/fpga/openpiton/Kconfig b/platform/fpga/openpiton/Kconfig index 8bfa85a..09b658a 100644 --- a/platform/fpga/openpiton/Kconfig +++ b/platform/fpga/openpiton/Kconfig @@ -2,4 +2,5 @@ config PLATFORM_OPENPITON_FPGA bool + select SERIAL_UART8250 default y diff --git a/platform/generic/configs/defconfig b/platform/generic/configs/defconfig index e69de29..ce70c59 100644 --- a/platform/generic/configs/defconfig +++ b/platform/generic/configs/defconfig @@ -0,0 +1,8 @@ +CONFIG_FDT_SERIAL=y +CONFIG_FDT_SERIAL_GAISLER=y +CONFIG_FDT_SERIAL_HTIF=y +CONFIG_FDT_SERIAL_SHAKTI=y +CONFIG_FDT_SERIAL_SIFIVE=y +CONFIG_FDT_SERIAL_LITEX=y +CONFIG_FDT_SERIAL_UART8250=y +CONFIG_FDT_SERIAL_XILINX_UARTLITE=y diff --git a/platform/kendryte/k210/Kconfig b/platform/kendryte/k210/Kconfig index 726423a..bc921c8 100644 --- a/platform/kendryte/k210/Kconfig +++ b/platform/kendryte/k210/Kconfig @@ -2,4 +2,5 @@ config PLATFORM_KENDRYTE_K210 bool + select SERIAL_SIFIVE default y diff --git a/platform/nuclei/ux600/Kconfig b/platform/nuclei/ux600/Kconfig index bb8410f..c4da266 100644 --- a/platform/nuclei/ux600/Kconfig +++ b/platform/nuclei/ux600/Kconfig @@ -2,4 +2,5 @@ config PLATFORM_NUCLEI_UX600 bool + select SERIAL_SIFIVE default y diff --git a/platform/template/Kconfig b/platform/template/Kconfig index bd95ea0..e01fb31 100644 --- a/platform/template/Kconfig +++ b/platform/template/Kconfig @@ -2,4 +2,5 @@ config PLATFORM_TEMPLATE bool + select SERIAL_UART8250 default y From patchwork Mon Jul 18 12:42:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1657446 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=u151NZ18; 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=JMUIwUnV; 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 4LmhTV3hMTz9s2R for ; Mon, 18 Jul 2022 22:43:26 +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=Wf64mh/woDnRzBWinGT0RIL+Kbk4q9LlfLJf20ixD2w=; b=u151NZ18vj8aH0 RCnH95E2xVJoUDL5Lq6hbScBL2ty15lME8QvU7pNG+FgFiIpBrkB8oQiV4RJazBlmCFNkb5GDDvwl NBUDyCFXFcHyYh9/Y7klv5+y4yv6/JdQGiLqkPZYnW53vHKGeTnw+h0tdb/uvWsBPWFnD6yWSvbmh iNxbbY0Y1a902M82Clai275/wZdUOd8UjklfcUwBZcIUW+RHNmtSH2Kq1tNqwQCt1pnpUuItUoIFa 7WhF63GRo2ijlIF0LMVTp5Yyonxyfkf3YPaUwfo5e9w1Z6cQMaUMREA+HC0SkfwXha8qlaOFV9Jtn rKa3uPwJz5iHuto4xQkQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ5g-00DOQw-HR; Mon, 18 Jul 2022 12:43:12 +0000 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ5c-00DOMm-H4 for opensbi@lists.infradead.org; Mon, 18 Jul 2022 12:43:10 +0000 Received: by mail-pg1-x533.google.com with SMTP id g4so10468816pgc.1 for ; Mon, 18 Jul 2022 05:43:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=h2Aq3AUAqUR/q20tGbE+2dN7Cd+7mapPVG1M4WhmNoc=; b=JMUIwUnV1ocFmz5SQSwmzvlJ+r8yQTa8E3JdkN4Zmfyw7VYbtL9kgHx7XED2qz6L/6 vIAjQ9tv6tsKNaG5lI/rPxzLzYeb0SP+QTOMfcOeZ93GBJh4D4lL8NnXj6cXaB/FK8X4 7FrS8TpJpLwAaEQHwfvsExhqWOp4WKlOXkahggDl423yKr0Ey9QhaFFSX3hsvCgQUL5F iMlcXWmqT295s0rUWgI0oioprHHSEM+gXyOLaaPEDmrNwlciU7qpT6Abhdybodk+kPfF uO5eMbaVugnskHXaybZT2kuHZNTrapK6bavNB2KD0FbWaiBCj5nKBf6DIm3LL+mv/IG0 I1Ow== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=h2Aq3AUAqUR/q20tGbE+2dN7Cd+7mapPVG1M4WhmNoc=; b=4PvpZAuFwOF84iWYbuIBUtn0YzFWOL9MSTmlLDl6mKcDSzWs3J5M624PcIhTZHOy1p CKjUTh0C4QsMBXAgg1tn4RbQGFITzOlN53AcrBTKDHFZKbSXELrNx1+f7aTIFmHKmHMW 4Fayi7Ff5iqLu7RO1dz8K1CM9Ihomm8pVBUHeo1l7H1GHOiI3blw4GEXlGiZJxpQiH56 xR5OTox1UX5h07giNxLIW+5Yb/49vuFNXuqiKcZ7fabE6C4TCMtrLNO3Ox3V/LtNa78W aL41Cn/9k68jXl6RyTOzFqn5SI65I+X5Hv5ybXZLUUA01yxdvsNYrfoGf165J59szuze oDKg== X-Gm-Message-State: AJIora+oIa9KUGhwv0ZL+IZCEPCanpW7tdMLLnrpio8WCTqPtdC+vWzZ pvOXSvhCX7GOnGMz36840vh8YdQMVN/SLg== X-Google-Smtp-Source: AGRyM1tN81GGenuM4eLz426LYbpHY9SlCADS22EmNdBma/UU8pp6VuSYxCBl4LVgqLixz6shoN2iNQ== X-Received: by 2002:a05:6a00:e12:b0:52b:83e4:905f with SMTP id bq18-20020a056a000e1200b0052b83e4905fmr520133pfb.45.1658148186397; Mon, 18 Jul 2022 05:43:06 -0700 (PDT) Received: from anup-ubuntu64-vm.. ([122.171.37.148]) by smtp.gmail.com with ESMTPSA id v7-20020a622f07000000b0052ac2e23295sm9174158pfv.44.2022.07.18.05.43.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 05:43:05 -0700 (PDT) From: Anup Patel To: Atish Patra , Alistair Francis Cc: Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 04/14] lib: utils/reset: Use kconfig for enabling/disabling drivers Date: Mon, 18 Jul 2022 18:12:00 +0530 Message-Id: <20220718124210.2177576-5-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220718124210.2177576-1-apatel@ventanamicro.com> References: <20220718124210.2177576-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220718_054308_619735_DA2442DF 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 --- include/sbi_utils/reset/fdt_reset.h | 12 +++++++++++ lib/utils/Kconfig | 2 ++ lib/utils/reset/Kconfig | 33 +++++++++++++++++++++++++++++ lib/uti [...] 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:533 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 --- 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 464bd03..5330e87 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..d4a32a0 --- /dev/null +++ b/lib/utils/reset/Kconfig @@ -0,0 +1,33 @@ +# SPDX-License-Identifier: GPL-2.0 + +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 From patchwork Mon Jul 18 12:42:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1657447 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=ySREL7cO; 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=Tk/HkGgp; 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 4LmhTX1mdjz9s2R for ; Mon, 18 Jul 2022 22:43:28 +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=j6lqY5KqOb3ZYdxCTxm6slg9Bzgtq2Z8RfbBRD3/eAE=; b=ySREL7cOyOoc8v xWz58BinZJk8OggF9ApENUAOyW5VAlLqt1eoXsWxaRgDwbaCkA43TAzsu0COv2IUlvtDy96Bh2V1g RhQp5CNAWLqah/5aOU2sN6m1GnfBC6h/QHfFjZXd+Eqy0Ml1ixEOJRCTW8v6njjrYq7r0o89zxbJU FL8Wm6sbfg8UqX21XBix3JiEr5SrN9k8dtc1UudOhParpBEH0MQU17U/HN626Wp4bjMYnH92F0Cnc v0LuZoDwnDnXHmWXHL39MXfJuSN58/dAg7uTlI8d6lgN6wJACNCXZ1ldlRnIYDNbBb8srRJYDH+27 6yi+FDNgQsG8WjnP4e4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ5i-00DOSg-BQ; Mon, 18 Jul 2022 12:43:14 +0000 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ5f-00DOPG-Lu for opensbi@lists.infradead.org; Mon, 18 Jul 2022 12:43:13 +0000 Received: by mail-pg1-x52f.google.com with SMTP id s27so10421166pga.13 for ; Mon, 18 Jul 2022 05:43:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+tvYCqlXjihwcBGN3zBA7MbY6mDcYgfehliXOxoNy7g=; b=Tk/HkGgpektt3ohhe/0i5xMH6c4dvtbdYLwjuwuqlpS2NT6GLGd75gzD+KXhkj3hyM IwoQyDPkLZzdN6ipYUaJGiWuqXXIC4mssleZj2H92XUpQY3xvnKAIxZEo9nUrTBEq1pT W7DPB8Oxge7Uwixpj/rkdYUmWVBRC72V5POWEaTAKGVitBm16yk9xcLaUlUnl45uhDhn cvP4p+FetNb7IH7SIIPWdJet+zuUCGyyChrilaY0VowSAkdmishoxvk/0iEY7d4SlpCY 9WIZ4hRj5ALjJEsUtEVueg7RUAvH3ZG9eJwSE0M1epb0m/7cTijXZ7RfYoCATEedNEzS 0t6g== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=+tvYCqlXjihwcBGN3zBA7MbY6mDcYgfehliXOxoNy7g=; b=MPGaO1HzfFEz+dtY60WiPQotCsCLYajpelBAXRmH3WFP38XjoEEViBFHwxUluuf4Gw C5pV+Qf8YYSpchJqzPAjDaftQIJbSYXFI14T/dq0zhHEwV3qBCYMBF27MieBhTXLL/8C Ah/gCA3os0XfTIR/XUr6RBtTRva/I71Z2w6+VT6Cz+CFAT6R3Z/HLuJDYOl6mFZviDrd uWvSAqJdQw2sIqowFgv87tUYExmC30Hk3m2SxMiWyGaSgSJjkfbVpw7Yyg9D3vksbNqP 2UEd1bD3o1ZgGxlv2DXnVzh/qkoF68Dt3gmUYAtBsZ+l7kQ/pgfZmqzgiGloidBcpGIa v28A== X-Gm-Message-State: AJIora+NeUbLPo0xYFOHCoiQfKs59iXNEgX9ZyM8k1fIbBuH7Rvn/S41 X+ULLgZcvnVswg7f8qanlvPc2ho3vlwmcg== X-Google-Smtp-Source: AGRyM1vZwPPz6TS6qicfYgs4hdxoWAlm8VGaOaV0CJHcYvW8bHH0ygTaBWV1Ks9pxQzu1DDEExPJiQ== X-Received: by 2002:a62:ea18:0:b0:52a:c12b:9313 with SMTP id t24-20020a62ea18000000b0052ac12b9313mr27715243pfh.49.1658148189801; Mon, 18 Jul 2022 05:43:09 -0700 (PDT) Received: from anup-ubuntu64-vm.. ([122.171.37.148]) by smtp.gmail.com with ESMTPSA id v7-20020a622f07000000b0052ac2e23295sm9174158pfv.44.2022.07.18.05.43.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 05:43:09 -0700 (PDT) From: Anup Patel To: Atish Patra , Alistair Francis Cc: Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 05/14] lib: utils/sys: Use kconfig for enabling/disabling drivers Date: Mon, 18 Jul 2022 18:12:01 +0530 Message-Id: <20220718124210.2177576-6-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220718124210.2177576-1-apatel@ventanamicro.com> References: <20220718124210.2177576-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220718_054311_734519_FBDF4477 X-CRM114-Status: GOOD ( 12.23 ) 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 system drivers makefile to use kconfig for enabling/disabling drivers. To avoid compile errors, we also enable appropriate system drivers for each platform. Signed-off-by: Anup Patel --- lib/utils/Kconfig | 2 ++ lib/utils/reset/Kconfig | 2 ++ lib/utils/serial/Kconfig | 1 + lib/utils/sys/Kconfig | 13 +++++++++++++ lib/utils/sys/ob [...] 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:52f 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 system drivers makefile to use kconfig for enabling/disabling drivers. To avoid compile errors, we also enable appropriate system drivers for each platform. Signed-off-by: Anup Patel --- lib/utils/Kconfig | 2 ++ lib/utils/reset/Kconfig | 2 ++ lib/utils/serial/Kconfig | 1 + lib/utils/sys/Kconfig | 13 +++++++++++++ lib/utils/sys/objects.mk | 4 ++-- 5 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 lib/utils/sys/Kconfig diff --git a/lib/utils/Kconfig b/lib/utils/Kconfig index 5330e87..6442b75 100644 --- a/lib/utils/Kconfig +++ b/lib/utils/Kconfig @@ -6,4 +6,6 @@ source "$OPENSBI_SRC_DIR/lib/utils/reset/Kconfig" source "$OPENSBI_SRC_DIR/lib/utils/serial/Kconfig" +source "$OPENSBI_SRC_DIR/lib/utils/sys/Kconfig" + endmenu diff --git a/lib/utils/reset/Kconfig b/lib/utils/reset/Kconfig index d4a32a0..4f04d8c 100644 --- a/lib/utils/reset/Kconfig +++ b/lib/utils/reset/Kconfig @@ -14,10 +14,12 @@ config FDT_RESET_GPIO config FDT_RESET_HTIF bool "Host transfer interface (HTIF) FDT reset driver" + select SYS_HTIF default n config FDT_RESET_SIFIVE_TEST bool "SiFive Test FDT reset driver" + select SYS_SIFIVE_TEST default n config FDT_RESET_SUNXI_WDT diff --git a/lib/utils/serial/Kconfig b/lib/utils/serial/Kconfig index 9e6b6fc..a425b13 100644 --- a/lib/utils/serial/Kconfig +++ b/lib/utils/serial/Kconfig @@ -15,6 +15,7 @@ config FDT_SERIAL_GAISLER config FDT_SERIAL_HTIF bool "Host transfer interface (HTIF) UART FDT driver" + select SYS_HTIF default n config FDT_SERIAL_SHAKTI diff --git a/lib/utils/sys/Kconfig b/lib/utils/sys/Kconfig new file mode 100644 index 0000000..0fa6b6d --- /dev/null +++ b/lib/utils/sys/Kconfig @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: GPL-2.0 + +menu "System Device Support" + +config SYS_HTIF + bool "Host transfere interface (HTIF) support" + default n + +config SYS_SIFIVE_TEST + bool "SiFive test support" + default n + +endmenu diff --git a/lib/utils/sys/objects.mk b/lib/utils/sys/objects.mk index 06be322..9f67aee 100644 --- a/lib/utils/sys/objects.mk +++ b/lib/utils/sys/objects.mk @@ -7,5 +7,5 @@ # Anup Patel # -libsbiutils-objs-y += sys/htif.o -libsbiutils-objs-y += sys/sifive_test.o +libsbiutils-objs-$(CONFIG_SYS_HTIF) += sys/htif.o +libsbiutils-objs-$(CONFIG_SYS_SIFIVE_TEST) += sys/sifive_test.o From patchwork Mon Jul 18 12:42:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1657448 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=oEuh5CQH; 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=LOVRRmrX; 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 4LmhTc1BPmz9s2R for ; Mon, 18 Jul 2022 22:43:32 +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=aL3AO2BM46uXEYcTSOa5XUfGliRsoTpJ5CRTOiDQ9Xo=; b=oEuh5CQHp9gdtt iJjpT5XJB0PtbPAVSDvBVAaqnmwbxcf4wm1lhLdvFTH9mk7njXRJR6IOfkC9z5GwkNr56A5x0sRPY 04c5bLtnB6/hukkTZ3FYlP1dqjR/uV2vx2j7BJULaA50lf2VP7zRPJJUnXLpooZAk0QbCTv60BMxM eRb0G69LdwciAbIK/u9ZH5I3HJ8slXmf1aTvdZB5JOEcsJ+d/ZMDySdxOXUi272FCCkyuyAw/Jw7a 5R5NZd5sO5lwrnONdPUT0akPec01uGob7AQf4sza6M8dIZR+7jwaRYhSrpM7qWo9tEryvUpDSpmiz 7OpjVAQyNAW85O4/3a5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ5l-00DOV7-84; Mon, 18 Jul 2022 12:43:17 +0000 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ5h-00DOS7-Ra for opensbi@lists.infradead.org; Mon, 18 Jul 2022 12:43:15 +0000 Received: by mail-pg1-x533.google.com with SMTP id s206so10457980pgs.3 for ; Mon, 18 Jul 2022 05:43:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aBiuY7oy71kEESHYAa+otR1U2UBNwe0pI7J7C0rVfGI=; b=LOVRRmrXdImj3JA+9FKLBBo4usUkDvUD2g4DsQXQZgLFZGW+2ey3JObV5vKWusokkk q5BmRGmIDGmEo7lflLTgXvxwd1Gund+20dKIc7F6rcLgQH6bUG0WBz2iMvZQRy50ozlN Gklm7yNZVABNCUTJB9pChGxa6pK8JCKODNDkyAoen2wTlRDKsok4fjJEhCNzSxt+p7/6 R99GBqE5gh694hbYciHZtCi0FngZX2+ZDYKPtIBI4+vFULSpFnxWaXJTfcUWqpPfPlQZ XkFxflmdes2Ji8PwZsAQrsm3tSafQ1+I3rkjfJNm58K+KjIVaGE1HFiG3/nZm7KS+eRu 2UUA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=aBiuY7oy71kEESHYAa+otR1U2UBNwe0pI7J7C0rVfGI=; b=XHaYuIjFoCOTWnaJ2cnZI5V2McvDVxt+cJWWZAxVi+MjEb2muupfttxdP4PxdAlZe3 WA4doF4xoD+4OutFix6zA+CFbHafd2USib8GeBKGgKeMeq7p8M1isZqGYp30qAR1Inoa 2JxIDMm0LG7ld5lmDB9Hpq0uiCJ7Ide21drxl7jzKQW6nKityjdZ85r5dHpKB7a5muHW HG68NuaiPS3Pe5KdAAlKG7G58kPOww+6msQ5SePusCm0fZA5SLuoHbdteSBZ+LwNkWjq p/O9WPngyccDzEzl+bE+eWWVsI9CeZfXxvw9p94DcrMhOAye2NAWSLl2x+BCBOReVGZO DdUQ== X-Gm-Message-State: AJIora83cYfy0fYDMorH5nfAXSd8AFyX1rKLOiAFl1HypYgt3CN1JO5r /QU9fBtI48UF0loLFqfnfvIT0w== X-Google-Smtp-Source: AGRyM1uTb07rPQtQj0q3L1XZU6thM2a98oHnK4W1wEs9mLDelyz8/eAX47nOZ3rRbWTLLxFFkO8Wug== X-Received: by 2002:a05:6a00:2445:b0:528:5a5b:67d3 with SMTP id d5-20020a056a00244500b005285a5b67d3mr28020949pfj.32.1658148193300; Mon, 18 Jul 2022 05:43:13 -0700 (PDT) Received: from anup-ubuntu64-vm.. ([122.171.37.148]) by smtp.gmail.com with ESMTPSA id v7-20020a622f07000000b0052ac2e23295sm9174158pfv.44.2022.07.18.05.43.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 05:43:12 -0700 (PDT) From: Anup Patel To: Atish Patra , Alistair Francis Cc: Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 06/14] lib: utils/timer: Use kconfig for enabling/disabling drivers Date: Mon, 18 Jul 2022 18:12:02 +0530 Message-Id: <20220718124210.2177576-7-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220718124210.2177576-1-apatel@ventanamicro.com> References: <20220718124210.2177576-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220718_054313_912602_6D2E5981 X-CRM114-Status: GOOD ( 13.68 ) 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 timer drivers makefile to use kconfig for enabling/disabling drivers. To avoid compile errors, we also enable appropriate timer drivers for each platform. Signed-off-by: Anup Patel --- include/sbi_utils/timer/fdt_timer.h | 9 +++++++++ lib/utils/Kconfig | 2 ++ lib/utils/timer/Kconfig | 22 ++++++++++++++++++++++ lib/utils/timer/o [...] 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:533 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 timer drivers makefile to use kconfig for enabling/disabling drivers. To avoid compile errors, we also enable appropriate timer drivers for each platform. Signed-off-by: Anup Patel --- include/sbi_utils/timer/fdt_timer.h | 9 +++++++++ lib/utils/Kconfig | 2 ++ lib/utils/timer/Kconfig | 22 ++++++++++++++++++++++ lib/utils/timer/objects.mk | 10 +++++----- platform/fpga/ariane/Kconfig | 1 + platform/fpga/openpiton/Kconfig | 1 + platform/generic/configs/defconfig | 2 ++ platform/kendryte/k210/Kconfig | 1 + platform/nuclei/ux600/Kconfig | 1 + platform/template/Kconfig | 1 + 10 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 lib/utils/timer/Kconfig diff --git a/include/sbi_utils/timer/fdt_timer.h b/include/sbi_utils/timer/fdt_timer.h index 36202a4..cf105fe 100644 --- a/include/sbi_utils/timer/fdt_timer.h +++ b/include/sbi_utils/timer/fdt_timer.h @@ -12,6 +12,8 @@ #include +#ifdef CONFIG_FDT_TIMER + struct fdt_timer { const struct fdt_match *match_table; int (*cold_init)(void *fdt, int nodeoff, const struct fdt_match *match); @@ -23,4 +25,11 @@ void fdt_timer_exit(void); int fdt_timer_init(bool cold_boot); +#else + +static inline void fdt_timer_exit(void) { } +static inline int fdt_timer_init(bool cold_boot) { return 0; } + +#endif + #endif diff --git a/lib/utils/Kconfig b/lib/utils/Kconfig index 6442b75..e169ed4 100644 --- a/lib/utils/Kconfig +++ b/lib/utils/Kconfig @@ -8,4 +8,6 @@ source "$OPENSBI_SRC_DIR/lib/utils/serial/Kconfig" source "$OPENSBI_SRC_DIR/lib/utils/sys/Kconfig" +source "$OPENSBI_SRC_DIR/lib/utils/timer/Kconfig" + endmenu diff --git a/lib/utils/timer/Kconfig b/lib/utils/timer/Kconfig new file mode 100644 index 0000000..3b1221a --- /dev/null +++ b/lib/utils/timer/Kconfig @@ -0,0 +1,22 @@ +# SPDX-License-Identifier: GPL-2.0 + +menu "Timer Device Support" + +config FDT_TIMER + bool "FDT based timer drivers" + default n + +if FDT_TIMER + +config FDT_TIMER_MTIMER + bool "ACLINT MTIMER FDT driver" + select TIMER_MTIMER + default n + +endif + +config TIMER_MTIMER + bool "ACLINT MTIMER support" + default n + +endmenu diff --git a/lib/utils/timer/objects.mk b/lib/utils/timer/objects.mk index bc4073d..7f5f3ce 100644 --- a/lib/utils/timer/objects.mk +++ b/lib/utils/timer/objects.mk @@ -7,10 +7,10 @@ # Anup Patel # -libsbiutils-objs-y += timer/aclint_mtimer.o +libsbiutils-objs-$(CONFIG_TIMER_MTIMER) += timer/aclint_mtimer.o -libsbiutils-objs-y += timer/fdt_timer.o -libsbiutils-objs-y += timer/fdt_timer_drivers.o +libsbiutils-objs-$(CONFIG_FDT_TIMER) += timer/fdt_timer.o +libsbiutils-objs-$(CONFIG_FDT_TIMER) += timer/fdt_timer_drivers.o -carray-fdt_timer_drivers-y += fdt_timer_mtimer -libsbiutils-objs-y += timer/fdt_timer_mtimer.o +carray-fdt_timer_drivers-$(CONFIG_FDT_TIMER_MTIMER) += fdt_timer_mtimer +libsbiutils-objs-$(CONFIG_FDT_TIMER_MTIMER) += timer/fdt_timer_mtimer.o diff --git a/platform/fpga/ariane/Kconfig b/platform/fpga/ariane/Kconfig index 797af74..cf60f99 100644 --- a/platform/fpga/ariane/Kconfig +++ b/platform/fpga/ariane/Kconfig @@ -3,4 +3,5 @@ config PLATFORM_ARIANE_FPGA bool select SERIAL_UART8250 + select TIMER_MTIMER default y diff --git a/platform/fpga/openpiton/Kconfig b/platform/fpga/openpiton/Kconfig index 09b658a..b0e1321 100644 --- a/platform/fpga/openpiton/Kconfig +++ b/platform/fpga/openpiton/Kconfig @@ -3,4 +3,5 @@ config PLATFORM_OPENPITON_FPGA bool select SERIAL_UART8250 + select TIMER_MTIMER default y diff --git a/platform/generic/configs/defconfig b/platform/generic/configs/defconfig index 9778665..9b96a4f 100644 --- a/platform/generic/configs/defconfig +++ b/platform/generic/configs/defconfig @@ -12,3 +12,5 @@ CONFIG_FDT_SERIAL_SIFIVE=y CONFIG_FDT_SERIAL_LITEX=y CONFIG_FDT_SERIAL_UART8250=y CONFIG_FDT_SERIAL_XILINX_UARTLITE=y +CONFIG_FDT_TIMER=y +CONFIG_FDT_TIMER_MTIMER=y diff --git a/platform/kendryte/k210/Kconfig b/platform/kendryte/k210/Kconfig index bc921c8..a0e6116 100644 --- a/platform/kendryte/k210/Kconfig +++ b/platform/kendryte/k210/Kconfig @@ -3,4 +3,5 @@ config PLATFORM_KENDRYTE_K210 bool select SERIAL_SIFIVE + select TIMER_MTIMER default y diff --git a/platform/nuclei/ux600/Kconfig b/platform/nuclei/ux600/Kconfig index c4da266..b05c6a9 100644 --- a/platform/nuclei/ux600/Kconfig +++ b/platform/nuclei/ux600/Kconfig @@ -3,4 +3,5 @@ config PLATFORM_NUCLEI_UX600 bool select SERIAL_SIFIVE + select TIMER_MTIMER default y diff --git a/platform/template/Kconfig b/platform/template/Kconfig index e01fb31..933b9e7 100644 --- a/platform/template/Kconfig +++ b/platform/template/Kconfig @@ -3,4 +3,5 @@ config PLATFORM_TEMPLATE bool select SERIAL_UART8250 + select TIMER_MTIMER default y From patchwork Mon Jul 18 12:42:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1657449 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=LGIHRjJ9; 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=QLnaNWp2; 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 4LmhTk4kYtz9s2R for ; Mon, 18 Jul 2022 22:43:38 +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=86OkiwBe8QKRWTOwbNmtYFjmp5YBbRLZ2Nqizx4XTV0=; b=LGIHRjJ9mDPWxP 0zQmBa46EcwlIBzQRL7GKJFor1EUq+Mbt2JUDC6QhteUNUMBSyGRjTQiYi1MQ/46N9GmMqvEa1B9s wqQJDB0QJxu4rSk7ClhWR0fmcPRAJv8yObcKI1WjeoxA5paJSDYMgJgeUO8hnA6br5XFwthL0BbqS mtiBB9Cy6Kyes8DN27UhsdTljTrACeVYEwg4zCmFPA01MWKZAXtYDL1zLSbA+2kEfg+g81OOjNE/o ShacB6xmLunLVOKCR0dwKkaobtHYrfV556Huj2QcpSXaissB95G7xyuw2EN0OOWyboACnP3iRvhhx VDljdO/inwrcmcwRmFoA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ5q-00DOZN-2T; Mon, 18 Jul 2022 12:43:22 +0000 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ5n-00DOUx-CM for opensbi@lists.infradead.org; Mon, 18 Jul 2022 12:43:20 +0000 Received: by mail-pj1-x1030.google.com with SMTP id p9so11601278pjd.3 for ; Mon, 18 Jul 2022 05:43:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iUj/yGccHuN+YOSW7Hs9BrDhQmKphyZCJhpgFHAR7rs=; b=QLnaNWp2kvpXUTC1fKjfIYysFR0vn0bjb2jvClQVfn+VJaXPPoxBz7f5B8TCicbQMJ B9xwVRYp7vAeCZVZD58NjSgtHRMXkATVnug9t+YmSOo64O2gK/ObbpBqnUXG5P5P7nRp xug7p3Ehxz5cYE8TWwZ2NjRNoqDdKyLPTTp/JOZZCUW0/xnoRIxwTQABR1s6EemceTcY Cmyp8PhEEgzD5ekxFqdtSMU20VYekWfnaJvNVLKVlMvQJeB2I9fOt3BPG+iOVYE62bzr N6x2YxXbTMJ94HCIwEEEpvd1SJn3SJtmWknpyQTQ4u2Biz9DXpjjVsePDAdWzcDMsAwR 1eXA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=iUj/yGccHuN+YOSW7Hs9BrDhQmKphyZCJhpgFHAR7rs=; b=VIzQpUUdrgBR/3P7xinGymbCkfF1ZMglk+px4p6S05XSIkPCvDcrwHw7ROz2nqyNxc uJc5ztHbfVP5pcUmfET/93g8ta/+uDwTsHpgAhzWI5n49oH8U8jWNlikcJKtRYL05EzN YjHhV/mJojNULcRFn76fskuHTAsD+3jaqm3zzdu/nZjgpdbvpXoznrSK8UtZqIyR6JaV Pb7qoNiZAKvg9NdTR+g9CAzOl99Fa9im9laIiR2hnQJGDRCotk2rzXS3pYLOcBa6s9Bs 63hOM2ApbSmQe0f3WMj3ARBhG5XT6DLG3P9m91koGUmhEi09lqTPewZTVgxFB0qzgFJ3 yy3w== X-Gm-Message-State: AJIora9h9nVx2q1Fee0wWqBLB9OmfIzqRu8XZbe3xZzHmOnG49OCx2Sk tPuPtEhO5H78nattvCdJS/lEkw== X-Google-Smtp-Source: AGRyM1ujvzoEQyv9/kKTowqbQkVTz3f0/9YXKup+ROJ/kp6FiLyqNgyzcGlrGiW9SlDK+To7u4e5nA== X-Received: by 2002:a17:90b:4d92:b0:1f1:be59:a60f with SMTP id oj18-20020a17090b4d9200b001f1be59a60fmr7816502pjb.152.1658148196388; Mon, 18 Jul 2022 05:43:16 -0700 (PDT) Received: from anup-ubuntu64-vm.. ([122.171.37.148]) by smtp.gmail.com with ESMTPSA id v7-20020a622f07000000b0052ac2e23295sm9174158pfv.44.2022.07.18.05.43.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 05:43:15 -0700 (PDT) From: Anup Patel To: Atish Patra , Alistair Francis Cc: Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 07/14] lib: utils/ipi: Use kconfig for enabling/disabling drivers Date: Mon, 18 Jul 2022 18:12:03 +0530 Message-Id: <20220718124210.2177576-8-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220718124210.2177576-1-apatel@ventanamicro.com> References: <20220718124210.2177576-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220718_054319_448658_36550307 X-CRM114-Status: GOOD ( 14.04 ) 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 ipi drivers makefile to use kconfig for enabling/disabling drivers. To avoid compile errors, we also enable appropriate ipi drivers for each platform. Signed-off-by: Anup Patel --- include/sbi_utils/ipi/fdt_ipi.h | 9 +++++++++ lib/utils/Kconfig | 2 ++ lib/utils/ipi/Kconfig | 22 ++++++++++++++++++++++ lib/utils/ipi/objects.m [...] 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:1030 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 ipi drivers makefile to use kconfig for enabling/disabling drivers. To avoid compile errors, we also enable appropriate ipi drivers for each platform. Signed-off-by: Anup Patel --- include/sbi_utils/ipi/fdt_ipi.h | 9 +++++++++ lib/utils/Kconfig | 2 ++ lib/utils/ipi/Kconfig | 22 ++++++++++++++++++++++ lib/utils/ipi/objects.mk | 10 +++++----- platform/fpga/ariane/Kconfig | 1 + platform/fpga/openpiton/Kconfig | 1 + platform/generic/configs/defconfig | 2 ++ platform/kendryte/k210/Kconfig | 1 + platform/nuclei/ux600/Kconfig | 1 + platform/template/Kconfig | 1 + 10 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 lib/utils/ipi/Kconfig diff --git a/include/sbi_utils/ipi/fdt_ipi.h b/include/sbi_utils/ipi/fdt_ipi.h index 9337353..1dd9062 100644 --- a/include/sbi_utils/ipi/fdt_ipi.h +++ b/include/sbi_utils/ipi/fdt_ipi.h @@ -12,6 +12,8 @@ #include +#ifdef CONFIG_FDT_IPI + struct fdt_ipi { const struct fdt_match *match_table; int (*cold_init)(void *fdt, int nodeoff, const struct fdt_match *match); @@ -23,4 +25,11 @@ void fdt_ipi_exit(void); int fdt_ipi_init(bool cold_boot); +#else + +static inline void fdt_ipi_exit(void) { } +static inline int fdt_ipi_init(bool cold_boot) { return 0; } + +#endif + #endif diff --git a/lib/utils/Kconfig b/lib/utils/Kconfig index e169ed4..4daeb1d 100644 --- a/lib/utils/Kconfig +++ b/lib/utils/Kconfig @@ -2,6 +2,8 @@ menu "Utils and Drivers Support" +source "$OPENSBI_SRC_DIR/lib/utils/ipi/Kconfig" + source "$OPENSBI_SRC_DIR/lib/utils/reset/Kconfig" source "$OPENSBI_SRC_DIR/lib/utils/serial/Kconfig" diff --git a/lib/utils/ipi/Kconfig b/lib/utils/ipi/Kconfig new file mode 100644 index 0000000..e8b1446 --- /dev/null +++ b/lib/utils/ipi/Kconfig @@ -0,0 +1,22 @@ +# SPDX-License-Identifier: GPL-2.0 + +menu "IPI Device Support" + +config FDT_IPI + bool "FDT based ipi drivers" + default n + +if FDT_IPI + +config FDT_IPI_MSWI + bool "ACLINT MSWI FDT driver" + select IPI_MSWI + default n + +endif + +config IPI_MSWI + bool "ACLINT MSWI support" + default n + +endmenu diff --git a/lib/utils/ipi/objects.mk b/lib/utils/ipi/objects.mk index 0b0bc2d..0600cac 100644 --- a/lib/utils/ipi/objects.mk +++ b/lib/utils/ipi/objects.mk @@ -7,10 +7,10 @@ # Anup Patel # -libsbiutils-objs-y += ipi/aclint_mswi.o +libsbiutils-objs-$(CONFIG_IPI_MSWI) += ipi/aclint_mswi.o -libsbiutils-objs-y += ipi/fdt_ipi.o -libsbiutils-objs-y += ipi/fdt_ipi_drivers.o +libsbiutils-objs-$(CONFIG_FDT_IPI) += ipi/fdt_ipi.o +libsbiutils-objs-$(CONFIG_FDT_IPI) += ipi/fdt_ipi_drivers.o -carray-fdt_ipi_drivers-y += fdt_ipi_mswi -libsbiutils-objs-y += ipi/fdt_ipi_mswi.o +carray-fdt_ipi_drivers-$(CONFIG_FDT_IPI_MSWI) += fdt_ipi_mswi +libsbiutils-objs-$(CONFIG_FDT_IPI_MSWI) += ipi/fdt_ipi_mswi.o diff --git a/platform/fpga/ariane/Kconfig b/platform/fpga/ariane/Kconfig index cf60f99..c9601f0 100644 --- a/platform/fpga/ariane/Kconfig +++ b/platform/fpga/ariane/Kconfig @@ -2,6 +2,7 @@ config PLATFORM_ARIANE_FPGA bool + select IPI_MSWI select SERIAL_UART8250 select TIMER_MTIMER default y diff --git a/platform/fpga/openpiton/Kconfig b/platform/fpga/openpiton/Kconfig index b0e1321..aefd2e0 100644 --- a/platform/fpga/openpiton/Kconfig +++ b/platform/fpga/openpiton/Kconfig @@ -2,6 +2,7 @@ config PLATFORM_OPENPITON_FPGA bool + select IPI_MSWI select SERIAL_UART8250 select TIMER_MTIMER default y diff --git a/platform/generic/configs/defconfig b/platform/generic/configs/defconfig index 9b96a4f..e218c32 100644 --- a/platform/generic/configs/defconfig +++ b/platform/generic/configs/defconfig @@ -1,3 +1,5 @@ +CONFIG_FDT_IPI=y +CONFIG_FDT_IPI_MSWI=y CONFIG_FDT_RESET=y CONFIG_FDT_RESET_GPIO=y CONFIG_FDT_RESET_HTIF=y diff --git a/platform/kendryte/k210/Kconfig b/platform/kendryte/k210/Kconfig index a0e6116..da675dc 100644 --- a/platform/kendryte/k210/Kconfig +++ b/platform/kendryte/k210/Kconfig @@ -2,6 +2,7 @@ config PLATFORM_KENDRYTE_K210 bool + select IPI_MSWI select SERIAL_SIFIVE select TIMER_MTIMER default y diff --git a/platform/nuclei/ux600/Kconfig b/platform/nuclei/ux600/Kconfig index b05c6a9..44b3425 100644 --- a/platform/nuclei/ux600/Kconfig +++ b/platform/nuclei/ux600/Kconfig @@ -2,6 +2,7 @@ config PLATFORM_NUCLEI_UX600 bool + select IPI_MSWI select SERIAL_SIFIVE select TIMER_MTIMER default y diff --git a/platform/template/Kconfig b/platform/template/Kconfig index 933b9e7..2f97871 100644 --- a/platform/template/Kconfig +++ b/platform/template/Kconfig @@ -2,6 +2,7 @@ config PLATFORM_TEMPLATE bool + select IPI_MSWI select SERIAL_UART8250 select TIMER_MTIMER default y From patchwork Mon Jul 18 12:42:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1657479 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=pUFnnxs8; 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=NBbmCJB/; 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 4Lmjs51wl8z9sFs for ; Mon, 18 Jul 2022 23:45:28 +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=eiCscJ54isf7B5xbr0iSjqb/DU3dw/PmF01VDlmYBxo=; b=pUFnnxs8J5Cufb 6MuoHY7iX2BlQLg+ycD+GZ3OAfYPvj9UI7ZJshrA0EUesXi+cljWJ5zO2GnoZVTcXKMhtsqA7lqYQ YkqqBmwvs6dsJpWIUTlVzHip7zwC7KwIx+WHpipc79568Mk+FTjhcWMMW8vfKwKqFUo3QgNOVXYkE bYzPJ9Ee1vKnGaC+1Djd39ke8BNTn50LIacu7wAslF/pHpM99Ku94GIiOSoQmBUW2lLSKoUcXC0Ok BaC9f8ro43LX1iezFUy+LHmK4mjIfGqTE0hyjXpLvOGf8GU25lRI2etkVKv03Q0lVyPwt0Fw6tuOd vpmtvCDQO9WPAE1AcsDg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDR3k-00Dsm3-VX; Mon, 18 Jul 2022 13:45:16 +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 1oDQ5v-00DOXo-2U for opensbi@lists.infradead.org; Mon, 18 Jul 2022 12:43:29 +0000 Received: by mail-pl1-x633.google.com with SMTP id z1so8889742plb.1 for ; Mon, 18 Jul 2022 05:43:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sUweUEHIEdv3EpbM0YpLak630kJt0fqF9003POVmVE4=; b=NBbmCJB/0meAFBCxVb/+CausvZmXkoMZX1MNysfBWHKP3RLmROOsmNo4Su53lQI2yL h45B6ZeN91Zkka4SAta+U0cg3toe/noLLgbK//oExZfanTcw+KePQEqCBdbAZB6lKSIN zV1YM9Ozg8QgTAh9L9DIEeOi/HB+plPGeddxGk+Gs0y+wVuL3x2JDPE+BPBFxPoNie1H pVn5q5OaRKcOvyxbJg8bLBX/Zz+q+H6VEtJgzeHmPPZHDfxvIIITHUZbT7XOHu4ZtlNv rRegOjJwEuJks45on5aLaesNbOBLhrIxZQUFJ+sJ1VNDPme1oIHI+hb1Tf7aP3By//D1 kB/A== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=sUweUEHIEdv3EpbM0YpLak630kJt0fqF9003POVmVE4=; b=od0+vZmSO5VhL1QQeKwKpmSWJ/t/Gg2+yKVXU0te9NxAuU6VchitS0BrPvTgQ25OMt BHul3/DTPQYxlPtQqqyEI5QjRALYGEvnXrJO9e6LMkD4zlszh042GUdk7OI5RZJ0h1px k4HnXVnxMm2+xkjMc4LB91vqeKRpmZvVRl3Z7Q8ruHr5Y7aYBY73/KD9zaDB3coLcDLl q6Rij5nkeSYFrNpebDjMwm3zf61FxO5V2PH/STYU8KM0o9OCrz7ues6Ty/5IFjv/WmN3 R3hTIrAupNRuzOwdwQUNvEH6H6XvQpB4fgCWsbAPfhG2r0q+PAVmDWqp2eN1ONM17tQy e7xg== X-Gm-Message-State: AJIora/m5kKbmathBt92PDHa1ZdwwX3+2AOnGlIc65DQrOVgnYck5A6q g49JeCvwLJIzhSPJOUa1oLcLsy/bPOK6qA== X-Google-Smtp-Source: AGRyM1u7x2M7IRbCh0YXwF91XKKY+qghiYS1HNt8NF3LCEWB56PPKv3qj9H5Q5Tih8rvFPDzbHJ6LQ== X-Received: by 2002:a17:90b:1e0b:b0:1f0:c53:8df1 with SMTP id pg11-20020a17090b1e0b00b001f00c538df1mr33292047pjb.63.1658148199492; Mon, 18 Jul 2022 05:43:19 -0700 (PDT) Received: from anup-ubuntu64-vm.. ([122.171.37.148]) by smtp.gmail.com with ESMTPSA id v7-20020a622f07000000b0052ac2e23295sm9174158pfv.44.2022.07.18.05.43.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 05:43:18 -0700 (PDT) From: Anup Patel To: Atish Patra , Alistair Francis Cc: Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 08/14] lib: utils/irqchip: Use kconfig for enabling/disabling drivers Date: Mon, 18 Jul 2022 18:12:04 +0530 Message-Id: <20220718124210.2177576-9-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220718124210.2177576-1-apatel@ventanamicro.com> References: <20220718124210.2177576-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220718_054327_170593_7B468148 X-CRM114-Status: GOOD ( 15.04 ) 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 irqchip drivers makefile to use kconfig for enabling/disabling drivers. To avoid compile errors, we also enable appropriate irqchip drivers for each platform. Signed-off-by: Anup Patel --- include/sbi_utils/irqchip/fdt_irqchip.h | 10 +++++++ include/sbi_utils/irqchip/imsic.h | 10 +++++++ lib/utils/Kconfig | 2 ++ lib/utils/irqchip/K [...] 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:633 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 irqchip drivers makefile to use kconfig for enabling/disabling drivers. To avoid compile errors, we also enable appropriate irqchip drivers for each platform. Signed-off-by: Anup Patel --- include/sbi_utils/irqchip/fdt_irqchip.h | 10 +++++++ include/sbi_utils/irqchip/imsic.h | 10 +++++++ lib/utils/Kconfig | 2 ++ lib/utils/irqchip/Kconfig | 40 +++++++++++++++++++++++++ lib/utils/irqchip/objects.mk | 22 +++++++------- platform/andes/ae350/Kconfig | 1 + platform/fpga/ariane/Kconfig | 1 + platform/fpga/openpiton/Kconfig | 1 + platform/generic/configs/defconfig | 4 +++ platform/kendryte/k210/Kconfig | 1 + platform/nuclei/ux600/Kconfig | 1 + platform/template/Kconfig | 1 + 12 files changed, 83 insertions(+), 11 deletions(-) create mode 100644 lib/utils/irqchip/Kconfig diff --git a/include/sbi_utils/irqchip/fdt_irqchip.h b/include/sbi_utils/irqchip/fdt_irqchip.h index 13ef6f7..63e9fd9 100644 --- a/include/sbi_utils/irqchip/fdt_irqchip.h +++ b/include/sbi_utils/irqchip/fdt_irqchip.h @@ -12,6 +12,8 @@ #include +#ifdef CONFIG_FDT_IRQCHIP + struct fdt_irqchip { const struct fdt_match *match_table; int (*cold_init)(void *fdt, int nodeoff, const struct fdt_match *match); @@ -23,4 +25,12 @@ void fdt_irqchip_exit(void); int fdt_irqchip_init(bool cold_boot); +#else + +static inline void fdt_irqchip_exit(void) { } + +static inline int fdt_irqchip_init(bool cold_boot) { return 0; } + +#endif + #endif diff --git a/include/sbi_utils/irqchip/imsic.h b/include/sbi_utils/irqchip/imsic.h index cffcb5a..e295771 100644 --- a/include/sbi_utils/irqchip/imsic.h +++ b/include/sbi_utils/irqchip/imsic.h @@ -33,6 +33,8 @@ struct imsic_data { struct imsic_regs regs[IMSIC_MAX_REGS]; }; +#ifdef CONFIG_IRQCHIP_IMSIC + int imsic_map_hartid_to_data(u32 hartid, struct imsic_data *imsic, int file); struct imsic_data *imsic_get_data(u32 hartid); @@ -47,4 +49,12 @@ int imsic_data_check(struct imsic_data *imsic); int imsic_cold_irqchip_init(struct imsic_data *imsic); +#else + +static inline void imsic_local_irqchip_init(void) { } + +static inline int imsic_data_check(struct imsic_data *imsic) { return 0; } + +#endif + #endif diff --git a/lib/utils/Kconfig b/lib/utils/Kconfig index 4daeb1d..e384cb8 100644 --- a/lib/utils/Kconfig +++ b/lib/utils/Kconfig @@ -4,6 +4,8 @@ menu "Utils and Drivers Support" source "$OPENSBI_SRC_DIR/lib/utils/ipi/Kconfig" +source "$OPENSBI_SRC_DIR/lib/utils/irqchip/Kconfig" + source "$OPENSBI_SRC_DIR/lib/utils/reset/Kconfig" source "$OPENSBI_SRC_DIR/lib/utils/serial/Kconfig" diff --git a/lib/utils/irqchip/Kconfig b/lib/utils/irqchip/Kconfig new file mode 100644 index 0000000..cc07c8e --- /dev/null +++ b/lib/utils/irqchip/Kconfig @@ -0,0 +1,40 @@ +# SPDX-License-Identifier: GPL-2.0 + +menu "Interrupt Controller Support" + +config FDT_IRQCHIP + bool "FDT based interrupt controller drivers" + default n + +if FDT_IRQCHIP + +config FDT_IRQCHIP_APLIC + bool "Advanced Platform Level Interrupt Controller (APLIC) FDT driver" + select IRQCHIP_APLIC + default n + +config FDT_IRQCHIP_IMSIC + bool "Incoming Message Signalled Interrupt Controller (IMSIC) FDT driver" + select IRQCHIP_IMSIC + default n + +config FDT_IRQCHIP_PLIC + bool "Platform Level Interrupt Controller (PLIC) FDT driver" + select IRQCHIP_PLIC + default n + +endif + +config IRQCHIP_APLIC + bool "Advanced Platform Level Interrupt Controller (APLIC) support" + default n + +config IRQCHIP_IMSIC + bool "Incoming Message Signalled Interrupt Controller (IMSIC) support" + default n + +config IRQCHIP_PLIC + bool "Platform Level Interrupt Controller (PLIC) support" + default n + +endmenu diff --git a/lib/utils/irqchip/objects.mk b/lib/utils/irqchip/objects.mk index 7775bc4..e458891 100644 --- a/lib/utils/irqchip/objects.mk +++ b/lib/utils/irqchip/objects.mk @@ -7,18 +7,18 @@ # Anup Patel # -libsbiutils-objs-y += irqchip/fdt_irqchip.o -libsbiutils-objs-y += irqchip/fdt_irqchip_drivers.o +libsbiutils-objs-$(CONFIG_FDT_IRQCHIP) += irqchip/fdt_irqchip.o +libsbiutils-objs-$(CONFIG_FDT_IRQCHIP) += irqchip/fdt_irqchip_drivers.o -carray-fdt_irqchip_drivers-y += fdt_irqchip_aplic -libsbiutils-objs-y += irqchip/fdt_irqchip_aplic.o +carray-fdt_irqchip_drivers-$(CONFIG_FDT_IRQCHIP_APLIC) += fdt_irqchip_aplic +libsbiutils-objs-$(CONFIG_FDT_IRQCHIP_APLIC) += irqchip/fdt_irqchip_aplic.o -carray-fdt_irqchip_drivers-y += fdt_irqchip_imsic -libsbiutils-objs-y += irqchip/fdt_irqchip_imsic.o +carray-fdt_irqchip_drivers-$(CONFIG_FDT_IRQCHIP_IMSIC) += fdt_irqchip_imsic +libsbiutils-objs-$(CONFIG_FDT_IRQCHIP_IMSIC) += irqchip/fdt_irqchip_imsic.o -carray-fdt_irqchip_drivers-y += fdt_irqchip_plic -libsbiutils-objs-y += irqchip/fdt_irqchip_plic.o +carray-fdt_irqchip_drivers-$(CONFIG_FDT_IRQCHIP_PLIC) += fdt_irqchip_plic +libsbiutils-objs-$(CONFIG_FDT_IRQCHIP_PLIC) += irqchip/fdt_irqchip_plic.o -libsbiutils-objs-y += irqchip/aplic.o -libsbiutils-objs-y += irqchip/imsic.o -libsbiutils-objs-y += irqchip/plic.o +libsbiutils-objs-$(CONFIG_IRQCHIP_APLIC) += irqchip/aplic.o +libsbiutils-objs-$(CONFIG_IRQCHIP_IMSIC) += irqchip/imsic.o +libsbiutils-objs-$(CONFIG_IRQCHIP_PLIC) += irqchip/plic.o diff --git a/platform/andes/ae350/Kconfig b/platform/andes/ae350/Kconfig index 0048c1b..69cb65e 100644 --- a/platform/andes/ae350/Kconfig +++ b/platform/andes/ae350/Kconfig @@ -2,5 +2,6 @@ config PLATFORM_ANDES_AE350 bool + select IRQCHIP_PLIC select SERIAL_UART8250 default y diff --git a/platform/fpga/ariane/Kconfig b/platform/fpga/ariane/Kconfig index c9601f0..3303689 100644 --- a/platform/fpga/ariane/Kconfig +++ b/platform/fpga/ariane/Kconfig @@ -3,6 +3,7 @@ config PLATFORM_ARIANE_FPGA bool select IPI_MSWI + select IRQCHIP_PLIC select SERIAL_UART8250 select TIMER_MTIMER default y diff --git a/platform/fpga/openpiton/Kconfig b/platform/fpga/openpiton/Kconfig index aefd2e0..5bf77ae 100644 --- a/platform/fpga/openpiton/Kconfig +++ b/platform/fpga/openpiton/Kconfig @@ -3,6 +3,7 @@ config PLATFORM_OPENPITON_FPGA bool select IPI_MSWI + select IRQCHIP_PLIC select SERIAL_UART8250 select TIMER_MTIMER default y diff --git a/platform/generic/configs/defconfig b/platform/generic/configs/defconfig index e218c32..ad66a63 100644 --- a/platform/generic/configs/defconfig +++ b/platform/generic/configs/defconfig @@ -1,5 +1,9 @@ CONFIG_FDT_IPI=y CONFIG_FDT_IPI_MSWI=y +CONFIG_FDT_IRQCHIP=y +CONFIG_FDT_IRQCHIP_APLIC=y +CONFIG_FDT_IRQCHIP_IMSIC=y +CONFIG_FDT_IRQCHIP_PLIC=y CONFIG_FDT_RESET=y CONFIG_FDT_RESET_GPIO=y CONFIG_FDT_RESET_HTIF=y diff --git a/platform/kendryte/k210/Kconfig b/platform/kendryte/k210/Kconfig index da675dc..80b5ae9 100644 --- a/platform/kendryte/k210/Kconfig +++ b/platform/kendryte/k210/Kconfig @@ -3,6 +3,7 @@ config PLATFORM_KENDRYTE_K210 bool select IPI_MSWI + select IRQCHIP_PLIC select SERIAL_SIFIVE select TIMER_MTIMER default y diff --git a/platform/nuclei/ux600/Kconfig b/platform/nuclei/ux600/Kconfig index 44b3425..02766a6 100644 --- a/platform/nuclei/ux600/Kconfig +++ b/platform/nuclei/ux600/Kconfig @@ -3,6 +3,7 @@ config PLATFORM_NUCLEI_UX600 bool select IPI_MSWI + select IRQCHIP_PLIC select SERIAL_SIFIVE select TIMER_MTIMER default y diff --git a/platform/template/Kconfig b/platform/template/Kconfig index 2f97871..5c59915 100644 --- a/platform/template/Kconfig +++ b/platform/template/Kconfig @@ -3,6 +3,7 @@ config PLATFORM_TEMPLATE bool select IPI_MSWI + select IRQCHIP_PLIC select SERIAL_UART8250 select TIMER_MTIMER default y From patchwork Mon Jul 18 12:42:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1657481 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=L08qN5n9; 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=h3ypTDDb; 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 4Lmjs60s9Gz9sFw for ; Mon, 18 Jul 2022 23:45:29 +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=wS6GvlYW5X6AqRL6uIMaekoSlYVrtVue4bpUuISH5hU=; b=L08qN5n9xsJo4F 74z5g5iL4neCYPxX019ZYpw4euTiYBu4yHq7IWtlvakaw/EzAxF+88FVc3Bl67eN8lbMaQ811eHhQ 1W5nO8OVtQ/huScv682FttNn+x3QoQjroHNgSMF6P65faXaifEnV00IHxq/L3tuVYQjzPHAfx7D4r Iz09NGdMAKLL5SmmYUP3xVQ5K0PBTZsY2Cf6zMyYnVNgiga98Qr96FqAeSbCDy31NSf2XiwZQUhkn bP5m1tFiiBGK5IZ9TB4TUrAfb2mTj6xFNsJk23Flxe8ZyPXQ+ROd4yIwDSC7EUQKfS/OLFFEB1j55 OAH3NdSUTe8DDdm003Ww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDR3l-00DsmZ-KJ; Mon, 18 Jul 2022 13:45:17 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ5v-00DOaG-LN for opensbi@lists.infradead.org; Mon, 18 Jul 2022 12:43:29 +0000 Received: by mail-pf1-x433.google.com with SMTP id o12so10496465pfp.5 for ; Mon, 18 Jul 2022 05:43:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=I0LA8LJtmywWBOhIE97ImyWwb/1dCAh7bvLE+Yhxbpc=; b=h3ypTDDbEWip12TLNp+UibuqGHD2DjA8uUfUDdsNJTa1DOsKbSzjd47eqsLyAdzY/E RqK02jS1WIlDUpiJnYPQVuwi0OXO2MfZSNl2vRVDuk7eXXryT4pWyHe7pYfMbi7BgvEg WeJYPFTj8P5WpclPNxTstVmJYvzfjZbjJEXOty+jOIGB5kB1o/P/MMEBN3f694eHo95A v4HQ1IhP2sPmQQ3DWf/5LQm0GSutOnCLnwHF7u6csCRccFI+O3NMf5xfy0Hq5g/2OgI1 PkBxmHlDjizQg9hAbhWgt/o13VtTQeRldg3P6e/SUnItUq2x+6AQKv3/rf1I2N8l451G NpJA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=I0LA8LJtmywWBOhIE97ImyWwb/1dCAh7bvLE+Yhxbpc=; b=g9p/wzpFJMD2cykCOUVGx+N4GKW5NVOxzoE1uJVccQ2OSmFLjSOlvlevm4QDB18mJB UM8YVDRTAnnqAChIBSSIgp4Zx8TzDOlcPap+PxxsM1EZdMbdw134jer11W8adElt+83G xGlWmBcsG/V6E3YSu/TC763kmxoSAyXkPeHsV9EUOEFZhgmQkYGBcn2OseZRqx6Ah8RD /rIfG3mWyFvXzVRA7WTOccIOXG129saW8UA3Z9vdO0hMFeFAwIT6k6TsVbN3bHFKCeds Za6ZRSD5rX7yicSUTD3Qp+NfkgTUhPWeLmab/GWwiZJEB/3pD+OCfKuXkM07G0jrY8Kp q9xQ== X-Gm-Message-State: AJIora+fbQdbxswOjoPeI2NYhU2YUQaZFBmXdwuen42Z0YWUDzzZcGbu nZDv7VhBcplKa+qrXSoUHqPqGQ== X-Google-Smtp-Source: AGRyM1uLvdUdAeWP/x+tRU8RXvYwtRu0BCuh15Gb2RVbb1Zs3UAUUkOopCfaXNn2hNE66C7Ggc7LkQ== X-Received: by 2002:a63:e109:0:b0:419:c3bc:b89 with SMTP id z9-20020a63e109000000b00419c3bc0b89mr18368712pgh.176.1658148202582; Mon, 18 Jul 2022 05:43:22 -0700 (PDT) Received: from anup-ubuntu64-vm.. ([122.171.37.148]) by smtp.gmail.com with ESMTPSA id v7-20020a622f07000000b0052ac2e23295sm9174158pfv.44.2022.07.18.05.43.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 05:43:21 -0700 (PDT) From: Anup Patel To: Atish Patra , Alistair Francis Cc: Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 09/14] lib: utils/i2c: Use kconfig for enabling/disabling drivers Date: Mon, 18 Jul 2022 18:12:05 +0530 Message-Id: <20220718124210.2177576-10-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220718124210.2177576-1-apatel@ventanamicro.com> References: <20220718124210.2177576-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220718_054327_755288_F2E688F2 X-CRM114-Status: GOOD ( 11.95 ) 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 i2c drivers makefile to use kconfig for enabling/disabling drivers. To avoid compile errors, we also enable appropriate i2c drivers for each platform. Signed-off-by: Anup Patel --- lib/utils/Kconfig | 2 ++ lib/utils/i2c/Kconfig | 22 ++++++++++++++++++++++ lib/utils/i2c/objects.mk | 10 +++++----- platform/generic/configs/def [...] 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:433 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 i2c drivers makefile to use kconfig for enabling/disabling drivers. To avoid compile errors, we also enable appropriate i2c drivers for each platform. Signed-off-by: Anup Patel --- lib/utils/Kconfig | 2 ++ lib/utils/i2c/Kconfig | 22 ++++++++++++++++++++++ lib/utils/i2c/objects.mk | 10 +++++----- platform/generic/configs/defconfig | 2 ++ 4 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 lib/utils/i2c/Kconfig diff --git a/lib/utils/Kconfig b/lib/utils/Kconfig index e384cb8..9477ec7 100644 --- a/lib/utils/Kconfig +++ b/lib/utils/Kconfig @@ -2,6 +2,8 @@ menu "Utils and Drivers Support" +source "$OPENSBI_SRC_DIR/lib/utils/i2c/Kconfig" + source "$OPENSBI_SRC_DIR/lib/utils/ipi/Kconfig" source "$OPENSBI_SRC_DIR/lib/utils/irqchip/Kconfig" diff --git a/lib/utils/i2c/Kconfig b/lib/utils/i2c/Kconfig new file mode 100644 index 0000000..bb29cd8 --- /dev/null +++ b/lib/utils/i2c/Kconfig @@ -0,0 +1,22 @@ +# SPDX-License-Identifier: GPL-2.0 + +menu "I2C Support" + +config FDT_I2C + bool "FDT based I2C drivers" + select I2C + default n + +if FDT_I2C + +config FDT_I2C_SIFIVE + bool "SiFive I2C FDT driver" + default n + +endif + +config I2C + bool "I2C support" + default n + +endmenu diff --git a/lib/utils/i2c/objects.mk b/lib/utils/i2c/objects.mk index bb0d6d5..a0fbbb5 100644 --- a/lib/utils/i2c/objects.mk +++ b/lib/utils/i2c/objects.mk @@ -7,10 +7,10 @@ # Nikita Shubin # -libsbiutils-objs-y += i2c/i2c.o +libsbiutils-objs-$(CONFIG_I2C) += i2c/i2c.o -libsbiutils-objs-y += i2c/fdt_i2c.o -libsbiutils-objs-y += i2c/fdt_i2c_adapter_drivers.o +libsbiutils-objs-$(CONFIG_FDT_I2C) += i2c/fdt_i2c.o +libsbiutils-objs-$(CONFIG_FDT_I2C) += i2c/fdt_i2c_adapter_drivers.o -carray-fdt_i2c_adapter_drivers-y += fdt_i2c_adapter_sifive -libsbiutils-objs-y += i2c/fdt_i2c_sifive.o +carray-fdt_i2c_adapter_drivers-$(CONFIG_FDT_I2C_SIFIVE) += fdt_i2c_adapter_sifive +libsbiutils-objs-$(CONFIG_FDT_I2C_SIFIVE) += i2c/fdt_i2c_sifive.o diff --git a/platform/generic/configs/defconfig b/platform/generic/configs/defconfig index ad66a63..c9c221e 100644 --- a/platform/generic/configs/defconfig +++ b/platform/generic/configs/defconfig @@ -1,3 +1,5 @@ +CONFIG_FDT_I2C=y +CONFIG_FDT_I2C_SIFIVE=y CONFIG_FDT_IPI=y CONFIG_FDT_IPI_MSWI=y CONFIG_FDT_IRQCHIP=y From patchwork Mon Jul 18 12:42:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1657480 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=aTjoY3tf; 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=ElPBL/VG; 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 4Lmjs44fT8z9sFk for ; Mon, 18 Jul 2022 23:45:28 +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=At0Yd46AP3V8zlsEu6e8X91SaNtBFp2j+cKIaULBq4s=; b=aTjoY3tfa5kDHk bvLHrcO1LLn5goeMsNPF+jkg5ApKAFJ/QQJxNTszXZX2sjsdotdyQ2+FfYvsc+Ynx5vyX0dK3bFc7 qrr/ae7hSFV2ObzQT12SheY2GVpGX/d4df7mO+JnPHvU4RxFANwVWdo9LDuNCDX3Ex0YI5FbLMHTU hmsdb63ubGsGvR6K9bE8gNdllxH5jsvEDgl/EVi8A8pN16nyTgQtdEOyOlUWvoO0Ljzdxt1OsAVQ7 37ZWsxC+347Y6v8vaIhepiC8ehuUn2kC78F8np9bcTiJHuKslrXpFx/Ki3lbRBeybg16N9ODC6+uo //BTYU0165Mag4z5xNaQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDR3m-00DsnD-Ae; Mon, 18 Jul 2022 13:45:18 +0000 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ5x-00DOcz-Ao for opensbi@lists.infradead.org; Mon, 18 Jul 2022 12:43:32 +0000 Received: by mail-pf1-x42c.google.com with SMTP id w185so10502571pfb.4 for ; Mon, 18 Jul 2022 05:43:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9JDbGpswgRLEVAKMa4D8s5aANsRZv6GJmpsyVaNUMHU=; b=ElPBL/VGCmepsY21bj5GAq0nfEkn6TTczSgfF4pTzaC1Nf3abjbN8KdQ5IsZo+Ux9H 1Kv+CQtW2XxnToxJ2pEm4v85+9xlDO2fHvkjxx/yN+EVOX4Gcu3Ar3Xri4oJTTct/he/ k/GHlTmYIDFssM2IA+J9U7rjHNLiChsZmIT2Tm1Kljm0WeIWhlM/J0GidSVQtRQMXsRI QkYo/LxNBg1W2IaMMDXNSNFZ3nDUMC++m3nVtE97g64ZyWL/JnIM8SIpff4E0MaN4Kdd M+5/vFyHf/ck4xUq0o9vMN4gIsgcTt/u9/qblmbvNtjEcNNX7fAjgOndBqU/fwdYeMWJ nmcA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=9JDbGpswgRLEVAKMa4D8s5aANsRZv6GJmpsyVaNUMHU=; b=ksS8MEzgsVM/O9XPJNuZdpBAt37km+YB6cGShmGGN/fEBI7UPL7aP5fKyIpOvyYRPz bqZlJmuuorYuEkvJmvVHn5a092apv4632yqBkB2JUyopx25TzhjzyyyF1g4E7OiyWCA/ cAzMbUezmJehTA1ueKEP0X3vWjb9Je/k0spfiCJHQwzchmvPnKLtLrT9FTvpzTlkEWH3 psEWASw9HJvd7dW7d2+zKFDukK3i2JQuZwMtuZ9JeGvEEmYDIj/eiQGyWGucX2X9ZPaN bl5XK89nKFf0ACrbAmW8Y9u4mOeR9B1jeWws8xevod6cbBpofK9oROHtuNxeuVM+QiqX u7gg== X-Gm-Message-State: AJIora+BeLg+GooGCHgjXg60FT4gZhyKA3hPHj0+MRrMaTIdqbAHxB1B /HlYgzfb2PuPSRMd0n0jcAPkuQ== X-Google-Smtp-Source: AGRyM1uAOtW2ahwT4ZuKuw7+QBCNBzRMBMNY0b24BqjrNazceZG98T/DDeakX8OHmpntjcd51HZVUA== X-Received: by 2002:a63:6c87:0:b0:419:b667:6622 with SMTP id h129-20020a636c87000000b00419b6676622mr18728729pgc.495.1658148205483; Mon, 18 Jul 2022 05:43:25 -0700 (PDT) Received: from anup-ubuntu64-vm.. ([122.171.37.148]) by smtp.gmail.com with ESMTPSA id v7-20020a622f07000000b0052ac2e23295sm9174158pfv.44.2022.07.18.05.43.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 05:43:24 -0700 (PDT) From: Anup Patel To: Atish Patra , Alistair Francis Cc: Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 10/14] lib: utils/gpio: Use kconfig for enabling/disabling drivers Date: Mon, 18 Jul 2022 18:12:06 +0530 Message-Id: <20220718124210.2177576-11-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220718124210.2177576-1-apatel@ventanamicro.com> References: <20220718124210.2177576-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220718_054329_403579_E790142F X-CRM114-Status: GOOD ( 12.82 ) 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 --- lib/utils/Kconfig | 2 ++ lib/utils/gpio/Kconfig | 22 ++++++++++++++++++++++ lib/utils/gpio/objects.mk | 10 +++++----- lib/utils/reset/Kconfig | [...] 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:42c 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 --- 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 9477ec7..57a6509 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..73673a3 --- /dev/null +++ b/lib/utils/gpio/Kconfig @@ -0,0 +1,22 @@ +# SPDX-License-Identifier: GPL-2.0 + +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 4f04d8c..ead9e2a 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 From patchwork Mon Jul 18 12:42:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1657450 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=P5L5WCH6; 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=TOdSIQQI; 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 4LmhTx40zsz9s2R for ; Mon, 18 Jul 2022 22:43:49 +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=sV9hy0rx4/QinmCwiotqJI4yG6VcL0SEJLlcoPptZ9M=; b=P5L5WCH6+ETLde bCwIVpZor26HyW1drl0Df7DT3wjJUbI/fgxBM+zNNzYM2ELmDVVKpKtqJP2uIPy8HFsuMdK4QKGmO D3WE0OvhBG8gm9XpFa5U4IaOqzi14EiGTv02MQbWL/ZG55mPoGcpFiqrWtskaR6jyyoRgPMN1Vpic o5/hyYvyvf2P1801FydyrU1v672DgnuWkvS8klREcnbc1dr9ffCPTMW9UPn44vbhq1AYKsriEr5BS k1zE3DiI8BC8/E6ph/u/RIYMow0ZCQ3OJGHExoLFR8xyQM8WriAM1rClwI2jfdzoyrkcuCGLg+ISU 5aRETJXF06jBRfQoFULg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ63-00DOmz-DG; Mon, 18 Jul 2022 12:43:35 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ5y-00DOgd-LQ for opensbi@lists.infradead.org; Mon, 18 Jul 2022 12:43:33 +0000 Received: by mail-pj1-x1036.google.com with SMTP id s21so11595115pjq.4 for ; Mon, 18 Jul 2022 05:43:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BN+bSFE0V02KTpUMXZoADq93xuD+1MmzmNDNQ1oMQLQ=; b=TOdSIQQI/0uovjWMY+DmhanKcxfIj23+mpvSSZ/df2DmZXu5Vvl25WwJo8sl6BZChh D8q8DwRVNWIAg5M/jLIWa63JTuRxIxcdtfpi/+pwTdSylfuQQZUJszIhamidke5Z1ecA XZvtzhaEwx4XoraeHPbc1gIDVzanoOnySpbM/oY/yCiSqHFze7rubgGRkESJSCHN7YLJ XHU2gGTW11TchI/Uj4GrH51WOwDu+nvovNmOe4L8f7ymoXGNlwWuWZua4cesCdPenyGy g2sjgSK66jDywsOCvfr27yu8ghF+ld5YazwSkgBC4p47gzVtZGKSXyGsN7JreSRQJHQy nTVg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=BN+bSFE0V02KTpUMXZoADq93xuD+1MmzmNDNQ1oMQLQ=; b=TR+2jke3O8LT72i/k92Q3apHljUIMAJu7HHWX7PGP/IN1SNdC9ffq6zIGZRbqVGQDg hokPPSoV7XMFiHTosNKF5/tMIYd8etg0dvh75wOAiJqKrmZ/CX931A4J2q1xq/Xbmu9Y 2ei0acHvq9akGc4cPe1zpCb+LrlgJNAMcOSY7E/4amFJXLN724m8OA9PiUftkbdwQEVt 72UfgYK8eaw6i5Zz6WU6mLK8VsreA+0qD9Rl2yGiV1sgcmu3TimO17EDBgXcM22Jdmd5 C+BQpJpLeAPsKm+IO0HvgN7W/jERMhijJD64AT9K8waB1oFFnw5seVlSzRJ0kBj0FkF4 blgw== X-Gm-Message-State: AJIora9qDiVBdwLWZwd0MN7ZB4H+EJHGPDSDq9hfhQ1COpyxHnPJvuD9 4RmlYxF/V+X4kj5ALN2Ij417HQ== X-Google-Smtp-Source: AGRyM1vTI0ivhV479TVjGHfYJi8IzFsqtaVNxNpWTgRWeI04hvBjnDPbR0lRw0D3YVmnylpDXqksGg== X-Received: by 2002:a17:902:778a:b0:16c:a1c9:7b14 with SMTP id o10-20020a170902778a00b0016ca1c97b14mr24619366pll.116.1658148208435; Mon, 18 Jul 2022 05:43:28 -0700 (PDT) Received: from anup-ubuntu64-vm.. ([122.171.37.148]) by smtp.gmail.com with ESMTPSA id v7-20020a622f07000000b0052ac2e23295sm9174158pfv.44.2022.07.18.05.43.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 05:43:27 -0700 (PDT) From: Anup Patel To: Atish Patra , Alistair Francis Cc: Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 11/14] lib: utils/fdt: Use kconfig for enabling/disabling Date: Mon, 18 Jul 2022 18:12:07 +0530 Message-Id: <20220718124210.2177576-12-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220718124210.2177576-1-apatel@ventanamicro.com> References: <20220718124210.2177576-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220718_054330_766973_E072B7FC X-CRM114-Status: GOOD ( 16.84 ) 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 FDT support makefile to use kconfig for enabling/disabling. To avoid compilation errors, we also enable FDT for each platform. Signed-off-by: Anup Patel --- include/sbi_utils/fdt/fdt_domain.h | 9 +++++++++ include/sbi_utils/fdt/fdt_pmu.h | 10 ++++++++++ lib/utils/Kconfig | 4 ++++ lib/utils/fdt/Kconfi [...] 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:1036 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 FDT support makefile to use kconfig for enabling/disabling. To avoid compilation errors, we also enable FDT for each platform. Signed-off-by: Anup Patel --- include/sbi_utils/fdt/fdt_domain.h | 9 +++++++++ include/sbi_utils/fdt/fdt_pmu.h | 10 ++++++++++ lib/utils/Kconfig | 4 ++++ lib/utils/fdt/Kconfig | 18 ++++++++++++++++++ lib/utils/fdt/objects.mk | 8 ++++---- lib/utils/gpio/Kconfig | 1 + lib/utils/i2c/Kconfig | 1 + lib/utils/ipi/Kconfig | 1 + lib/utils/irqchip/Kconfig | 1 + {platform/generic => lib/utils/libfdt}/Kconfig | 4 ++-- lib/utils/libfdt/objects.mk | 4 ++-- lib/utils/reset/Kconfig | 1 + lib/utils/serial/Kconfig | 1 + lib/utils/timer/Kconfig | 1 + platform/andes/ae350/Kconfig | 1 + platform/fpga/ariane/Kconfig | 1 + platform/fpga/openpiton/Kconfig | 1 + platform/generic/Kconfig | 3 +++ platform/kendryte/k210/Kconfig | 1 + platform/nuclei/ux600/Kconfig | 1 + platform/nuclei/ux600/platform.c | 1 - 21 files changed, 64 insertions(+), 9 deletions(-) create mode 100644 lib/utils/fdt/Kconfig copy {platform/generic => lib/utils/libfdt}/Kconfig (54%) diff --git a/include/sbi_utils/fdt/fdt_domain.h b/include/sbi_utils/fdt/fdt_domain.h index 5448eb4..ee09d1b 100644 --- a/include/sbi_utils/fdt/fdt_domain.h +++ b/include/sbi_utils/fdt/fdt_domain.h @@ -13,6 +13,8 @@ #include +#ifdef CONFIG_FDT_DOMAIN + struct sbi_domain; /** @@ -70,4 +72,11 @@ void fdt_domain_fixup(void *fdt); */ int fdt_domains_populate(void *fdt); +#else + +static inline void fdt_domain_fixup(void *fdt) { } +static inline int fdt_domains_populate(void *fdt) { return 0; } + +#endif + #endif /* __FDT_DOMAIN_H__ */ diff --git a/include/sbi_utils/fdt/fdt_pmu.h b/include/sbi_utils/fdt/fdt_pmu.h index 2fa01ed..c65cad7 100644 --- a/include/sbi_utils/fdt/fdt_pmu.h +++ b/include/sbi_utils/fdt/fdt_pmu.h @@ -13,6 +13,8 @@ #include +#ifdef CONFIG_FDT_PMU + /** * Fix up the PMU node in the device tree * @@ -43,4 +45,12 @@ int fdt_pmu_setup(void *fdt); */ uint64_t fdt_pmu_get_select_value(uint32_t event_idx); +#else + +static inline void fdt_pmu_fixup(void *fdt) { } +static inline int fdt_pmu_setup(void *fdt) { return 0; } +static inline uint64_t fdt_pmu_get_select_value(uint32_t event_idx) { return 0; } + +#endif + #endif diff --git a/lib/utils/Kconfig b/lib/utils/Kconfig index 57a6509..97f97b5 100644 --- a/lib/utils/Kconfig +++ b/lib/utils/Kconfig @@ -2,6 +2,8 @@ menu "Utils and Drivers Support" +source "$OPENSBI_SRC_DIR/lib/utils/fdt/Kconfig" + source "$OPENSBI_SRC_DIR/lib/utils/gpio/Kconfig" source "$OPENSBI_SRC_DIR/lib/utils/i2c/Kconfig" @@ -10,6 +12,8 @@ source "$OPENSBI_SRC_DIR/lib/utils/ipi/Kconfig" source "$OPENSBI_SRC_DIR/lib/utils/irqchip/Kconfig" +source "$OPENSBI_SRC_DIR/lib/utils/libfdt/Kconfig" + source "$OPENSBI_SRC_DIR/lib/utils/reset/Kconfig" source "$OPENSBI_SRC_DIR/lib/utils/serial/Kconfig" diff --git a/lib/utils/fdt/Kconfig b/lib/utils/fdt/Kconfig new file mode 100644 index 0000000..a8022a0 --- /dev/null +++ b/lib/utils/fdt/Kconfig @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: GPL-2.0 + +menuconfig FDT + bool "Flattened Device Tree (FDT) support" + select LIBFDT + default n + +if FDT + +config FDT_DOMAIN + bool "FDT domain support" + default n + +config FDT_PMU + bool "FDT performance monitoring unit (PMU) support" + default n + +endif diff --git a/lib/utils/fdt/objects.mk b/lib/utils/fdt/objects.mk index 03800f9..5cede81 100644 --- a/lib/utils/fdt/objects.mk +++ b/lib/utils/fdt/objects.mk @@ -4,7 +4,7 @@ # Copyright (C) 2020 Bin Meng # -libsbiutils-objs-y += fdt/fdt_domain.o -libsbiutils-objs-y += fdt/fdt_pmu.o -libsbiutils-objs-y += fdt/fdt_helper.o -libsbiutils-objs-y += fdt/fdt_fixup.o +libsbiutils-objs-$(CONFIG_FDT_DOMAIN) += fdt/fdt_domain.o +libsbiutils-objs-$(CONFIG_FDT_PMU) += fdt/fdt_pmu.o +libsbiutils-objs-$(CONFIG_FDT) += fdt/fdt_helper.o +libsbiutils-objs-$(CONFIG_FDT) += fdt/fdt_fixup.o diff --git a/lib/utils/gpio/Kconfig b/lib/utils/gpio/Kconfig index 73673a3..ebf1b2c 100644 --- a/lib/utils/gpio/Kconfig +++ b/lib/utils/gpio/Kconfig @@ -4,6 +4,7 @@ menu "GPIO Support" config FDT_GPIO bool "FDT based GPIO drivers" + depends on FDT select GPIO default n diff --git a/lib/utils/i2c/Kconfig b/lib/utils/i2c/Kconfig index bb29cd8..0313588 100644 --- a/lib/utils/i2c/Kconfig +++ b/lib/utils/i2c/Kconfig @@ -4,6 +4,7 @@ menu "I2C Support" config FDT_I2C bool "FDT based I2C drivers" + depends on FDT select I2C default n diff --git a/lib/utils/ipi/Kconfig b/lib/utils/ipi/Kconfig index e8b1446..2a84ecd 100644 --- a/lib/utils/ipi/Kconfig +++ b/lib/utils/ipi/Kconfig @@ -4,6 +4,7 @@ menu "IPI Device Support" config FDT_IPI bool "FDT based ipi drivers" + depends on FDT default n if FDT_IPI diff --git a/lib/utils/irqchip/Kconfig b/lib/utils/irqchip/Kconfig index cc07c8e..9090b18 100644 --- a/lib/utils/irqchip/Kconfig +++ b/lib/utils/irqchip/Kconfig @@ -4,6 +4,7 @@ menu "Interrupt Controller Support" config FDT_IRQCHIP bool "FDT based interrupt controller drivers" + depends on FDT default n if FDT_IRQCHIP diff --git a/platform/generic/Kconfig b/lib/utils/libfdt/Kconfig similarity index 54% copy from platform/generic/Kconfig copy to lib/utils/libfdt/Kconfig index a811a05..096345b 100644 --- a/platform/generic/Kconfig +++ b/lib/utils/libfdt/Kconfig @@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -config PLATFORM_GENERIC +config LIBFDT bool - default y + default n diff --git a/lib/utils/libfdt/objects.mk b/lib/utils/libfdt/objects.mk index 8c060df..a5b4001 100644 --- a/lib/utils/libfdt/objects.mk +++ b/lib/utils/libfdt/objects.mk @@ -12,5 +12,5 @@ libfdt_files = fdt.o fdt_addresses.o fdt_check.o fdt_empty_tree.o fdt_ro.o fdt_r $(foreach file, $(libfdt_files), \ $(eval CFLAGS_$(file) = -I$(src)/../../utils/libfdt)) -libsbiutils-objs-y += $(addprefix libfdt/,$(libfdt_files)) -libsbiutils-genflags-y += -I$(libsbiutils_dir)/libfdt/ +libsbiutils-objs-$(CONFIG_LIBFDT) += $(addprefix libfdt/,$(libfdt_files)) +libsbiutils-genflags-$(CONFIG_LIBFDT) += -I$(libsbiutils_dir)/libfdt/ diff --git a/lib/utils/reset/Kconfig b/lib/utils/reset/Kconfig index ead9e2a..bcfb419 100644 --- a/lib/utils/reset/Kconfig +++ b/lib/utils/reset/Kconfig @@ -4,6 +4,7 @@ menu "System Reset Support" config FDT_RESET bool "FDT based reset drivers" + depends on FDT default n if FDT_RESET diff --git a/lib/utils/serial/Kconfig b/lib/utils/serial/Kconfig index a425b13..34d72ff 100644 --- a/lib/utils/serial/Kconfig +++ b/lib/utils/serial/Kconfig @@ -4,6 +4,7 @@ menu "Serial Device Support" config FDT_SERIAL bool "FDT based serial drivers" + depends on FDT default n if FDT_SERIAL diff --git a/lib/utils/timer/Kconfig b/lib/utils/timer/Kconfig index 3b1221a..5266f1d 100644 --- a/lib/utils/timer/Kconfig +++ b/lib/utils/timer/Kconfig @@ -4,6 +4,7 @@ menu "Timer Device Support" config FDT_TIMER bool "FDT based timer drivers" + depends on FDT default n if FDT_TIMER diff --git a/platform/andes/ae350/Kconfig b/platform/andes/ae350/Kconfig index 69cb65e..a9bbf46 100644 --- a/platform/andes/ae350/Kconfig +++ b/platform/andes/ae350/Kconfig @@ -2,6 +2,7 @@ config PLATFORM_ANDES_AE350 bool + select FDT select IRQCHIP_PLIC select SERIAL_UART8250 default y diff --git a/platform/fpga/ariane/Kconfig b/platform/fpga/ariane/Kconfig index 3303689..40d6ad6 100644 --- a/platform/fpga/ariane/Kconfig +++ b/platform/fpga/ariane/Kconfig @@ -2,6 +2,7 @@ config PLATFORM_ARIANE_FPGA bool + select FDT select IPI_MSWI select IRQCHIP_PLIC select SERIAL_UART8250 diff --git a/platform/fpga/openpiton/Kconfig b/platform/fpga/openpiton/Kconfig index 5bf77ae..08087fb 100644 --- a/platform/fpga/openpiton/Kconfig +++ b/platform/fpga/openpiton/Kconfig @@ -2,6 +2,7 @@ config PLATFORM_OPENPITON_FPGA bool + select FDT select IPI_MSWI select IRQCHIP_PLIC select SERIAL_UART8250 diff --git a/platform/generic/Kconfig b/platform/generic/Kconfig index a811a05..21ebd6a 100644 --- a/platform/generic/Kconfig +++ b/platform/generic/Kconfig @@ -2,4 +2,7 @@ config PLATFORM_GENERIC bool + select FDT + select FDT_DOMAIN + select FDT_PMU default y diff --git a/platform/kendryte/k210/Kconfig b/platform/kendryte/k210/Kconfig index 80b5ae9..58b893e 100644 --- a/platform/kendryte/k210/Kconfig +++ b/platform/kendryte/k210/Kconfig @@ -2,6 +2,7 @@ config PLATFORM_KENDRYTE_K210 bool + select FDT select IPI_MSWI select IRQCHIP_PLIC select SERIAL_SIFIVE diff --git a/platform/nuclei/ux600/Kconfig b/platform/nuclei/ux600/Kconfig index 02766a6..11fabb1 100644 --- a/platform/nuclei/ux600/Kconfig +++ b/platform/nuclei/ux600/Kconfig @@ -2,6 +2,7 @@ config PLATFORM_NUCLEI_UX600 bool + select FDT select IPI_MSWI select IRQCHIP_PLIC select SERIAL_SIFIVE diff --git a/platform/nuclei/ux600/platform.c b/platform/nuclei/ux600/platform.c index 5498a1f..2b02734 100644 --- a/platform/nuclei/ux600/platform.c +++ b/platform/nuclei/ux600/platform.c @@ -8,7 +8,6 @@ * hqfang <578567190@qq.com> */ -#include #include #include #include From patchwork Mon Jul 18 12:42:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1657451 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=McJUEv1u; 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=Q0EJc4oN; 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 4LmhTx4j7Bz9sFs for ; Mon, 18 Jul 2022 22:43:49 +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=nirOpLGGnrKUmMzM4Of9Udtj0i0McKHFPy+hu1au/cs=; b=McJUEv1uDbFgPp bcXjvUURj3lpS6kEBPNDq3oMM8fN0PRDLuBfU3E9WlV5CBOrtcSF5HdECEI7mcgmtXgXolLJn3Vtk O+OW652d5O4hpbo+faWapbhiB83foSmxzD9s7VipmSdO16Gvf2ApyfOHOVA+l1Nr2PKITkrD3MPAe 3uF9AOgRsynWi4H51jGtTGH/QjpIfy1my6+D+o+Hkoae4fI0c/j0WrMHDh0RRCAsVF5nWnpeiMAX2 WecfSya7qIDeDJuwk4q7eR6AL5PVBmz8fgAmFOl28WtgNIeuBlnhRJP0IVDM8YXz9YjgPiJhonI7o COujdgEuVnYH82iukNCw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ64-00DOnp-8H; Mon, 18 Jul 2022 12:43:36 +0000 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ60-00DOS7-2s for opensbi@lists.infradead.org; Mon, 18 Jul 2022 12:43:33 +0000 Received: by mail-pg1-x533.google.com with SMTP id s206so10458609pgs.3 for ; Mon, 18 Jul 2022 05:43:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rTzyfW3kPnmn5xBKsv7DS/iINdZS/UD0+gA6HQ9lVuQ=; b=Q0EJc4oN4bmDg2dVP0Sh9ytzT3nlNNiXGBb6W83n1WpNsgMvG8/dHyHZBnuEGUtMu5 xXOF4qNYP8onZPDa+kg9JlnOapgc2T4M/Bs0rvBRUmmevvvOrSym3JNgnKSdwFrgoxhD 0PKPWOZYpc04deL1/CvCPeu3JlVBdgFnnbuvT08QlOJwqNvvbfXdH2uIhtmpdwW+Edvr CLAJRa2IO/9y3IRsLnK0sk9YMwol8qZDjwntS3iWNPOIfZh7BjKtSh0hz0m75axPrY6P mr8QtgsA8LA2CkuJ5kFypLFUSiTqiH7gJn5Aa1VH+JocNtIXh2AKhOuRASJYtU0/LzKj S3Aw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=rTzyfW3kPnmn5xBKsv7DS/iINdZS/UD0+gA6HQ9lVuQ=; b=doav3ODTeVWKVQCbYzALA+tAUQm8OXB67Z0fcHCER+Qu7OWCaTUmzzclb7pjkocLQZ 9trzHazjJNt5Uh/BbzYY52k5mDpoCLpNrSSeQyXSeHz3TCZE8ohhj25mqZVurjPL0ncE aPemk/osUBVXhJDAiiLA+RM0Xx4rA0OQQsm44ez1BRT8UI4zsfsxDXphuboFEw/Fs25j SLKpZgGAvQ/rZh0fnCJ7ekwangBWEEilZfbPljI95XoGnMtTclPck+9suNbi+HIhwA7J k4hHpHb7bYDIRL18j8AYSPJqA7UwlkBiTN9oiNTOMsDDOwGBsYD4MUDlez8LSp/EEG3Z bE6Q== X-Gm-Message-State: AJIora/SzKEolRGRbwygKnUaISKu/hyvJjbv7ygUewDkIaPxoLE3EFwX WFIyw7BkTV3yOl3zI9nP0TbwdvHnvOMVRw== X-Google-Smtp-Source: AGRyM1uVwtmVDYzYjb37beAWoETuBIJmZ0a+0uDwMyikCJkStlXgeCUkR8mfoFs2c0zRiTVVgXtKOw== X-Received: by 2002:a63:85c6:0:b0:412:a94c:16d0 with SMTP id u189-20020a6385c6000000b00412a94c16d0mr24882118pgd.253.1658148211541; Mon, 18 Jul 2022 05:43:31 -0700 (PDT) Received: from anup-ubuntu64-vm.. ([122.171.37.148]) by smtp.gmail.com with ESMTPSA id v7-20020a622f07000000b0052ac2e23295sm9174158pfv.44.2022.07.18.05.43.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 05:43:30 -0700 (PDT) From: Anup Patel To: Atish Patra , Alistair Francis Cc: Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 12/14] platform: generic: Use kconfig for enabling/disabling overrides Date: Mon, 18 Jul 2022 18:12:08 +0530 Message-Id: <20220718124210.2177576-13-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220718124210.2177576-1-apatel@ventanamicro.com> References: <20220718124210.2177576-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220718_054332_161399_0ADD5311 X-CRM114-Status: UNSURE ( 9.55 ) X-CRM114-Notice: Please train this message. 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 generic platform to use kconfig for enabling/disabling platform overrides. We also enable all platform overrides in generic platform defconfig. Signed-off-by: Anup Patel --- platform/generic/Kconfig | 18 ++++++++++++++++++ platform/generic/allwinner/objects.mk | 4 ++-- platform/generic/configs/defconfig | 3 +++ platf [...] 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:533 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 generic platform to use kconfig for enabling/disabling platform overrides. We also enable all platform overrides in generic platform defconfig. Signed-off-by: Anup Patel --- platform/generic/Kconfig | 18 ++++++++++++++++++ platform/generic/allwinner/objects.mk | 4 ++-- platform/generic/configs/defconfig | 3 +++ platform/generic/sifive/objects.mk | 8 ++++---- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/platform/generic/Kconfig b/platform/generic/Kconfig index 21ebd6a..8b00772 100644 --- a/platform/generic/Kconfig +++ b/platform/generic/Kconfig @@ -6,3 +6,21 @@ config PLATFORM_GENERIC select FDT_DOMAIN select FDT_PMU default y + +if PLATFORM_GENERIC + +config PLATFORM_ALLWINNER_D1 + bool "Allwinner D1 support" + depends on FDT_IRQCHIP_PLIC + default n + +config PLATFORM_SIFIVE_FU540 + bool "SiFive FU540 support" + default n + +config PLATFORM_SIFIVE_FU740 + bool "SiFive FU740 support" + depends on FDT_RESET && FDT_I2C + default n + +endif diff --git a/platform/generic/allwinner/objects.mk b/platform/generic/allwinner/objects.mk index 9e36ab6..447cdf1 100644 --- a/platform/generic/allwinner/objects.mk +++ b/platform/generic/allwinner/objects.mk @@ -2,5 +2,5 @@ # SPDX-License-Identifier: BSD-2-Clause # -carray-platform_override_modules-y += sun20i_d1 -platform-objs-y += allwinner/sun20i-d1.o +carray-platform_override_modules-$(CONFIG_PLATFORM_ALLWINNER_D1) += sun20i_d1 +platform-objs-$(CONFIG_PLATFORM_ALLWINNER_D1) += allwinner/sun20i-d1.o diff --git a/platform/generic/configs/defconfig b/platform/generic/configs/defconfig index d56cef2..2a75394 100644 --- a/platform/generic/configs/defconfig +++ b/platform/generic/configs/defconfig @@ -1,3 +1,6 @@ +CONFIG_PLATFORM_ALLWINNER_D1=y +CONFIG_PLATFORM_SIFIVE_FU540=y +CONFIG_PLATFORM_SIFIVE_FU740=y CONFIG_FDT_GPIO=y CONFIG_FDT_GPIO_SIFIVE=y CONFIG_FDT_I2C=y diff --git a/platform/generic/sifive/objects.mk b/platform/generic/sifive/objects.mk index c17e2df..d75e444 100644 --- a/platform/generic/sifive/objects.mk +++ b/platform/generic/sifive/objects.mk @@ -2,8 +2,8 @@ # SPDX-License-Identifier: BSD-2-Clause # -carray-platform_override_modules-y += sifive_fu540 -platform-objs-y += sifive/fu540.o +carray-platform_override_modules-$(CONFIG_PLATFORM_SIFIVE_FU540) += sifive_fu540 +platform-objs-$(CONFIG_PLATFORM_SIFIVE_FU540) += sifive/fu540.o -carray-platform_override_modules-y += sifive_fu740 -platform-objs-y += sifive/fu740.o +carray-platform_override_modules-$(CONFIG_PLATFORM_SIFIVE_FU740) += sifive_fu740 +platform-objs-$(CONFIG_PLATFORM_SIFIVE_FU740) += sifive/fu740.o From patchwork Mon Jul 18 12:42:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1657453 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=zf2IyxXZ; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=Qu6BQGZG; 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=XVM6fdz1; 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 4LmhVB05nXz9s2R for ; Mon, 18 Jul 2022 22:44:02 +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=t7aiOTiUYIPAr4oXS8qEGdvtEZap6y+NUrJUftrBzhI=; b=zf2IyxXZXHjotm 2XD/tW+Crkv17YDivUfgxCm6hrZ0D6D3nHrcPhyDvvCUmU04kLf8nuLwYeoumHQY8rb8ck2t/RmWD wSfQnlNyFatA2S5vlPnqAHvyL/Blu0W+Sv50RefekyoGxMmrlP5o2Jl+kOAyL/JfKJnTrsdBTzy0p xfpZOuPs0sdCNEwV3B7FrYbLgwy0KeYuxUzfXQw7gOW37Sxtl40GpDfxOnoV09V4+Nr+41jh5W0ZS FJ8nhmzusJFcQIXy6zti1527WpCz1SY3vqy0Fb0d0VceWVNsZCzkhjs/0/BNw/08YMJqcvwBZH+Y1 ywTkemzBHRYuEygr3/FA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ6D-00DOwy-LO; Mon, 18 Jul 2022 12:43:45 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ6B-00DOtY-3q for opensbi@bombadil.infradead.org; Mon, 18 Jul 2022 12:43:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=e9BL4TLSJ/VHwB8D/7gQnLvS1swgL5gOXrTAVdG4bWU=; b=Qu6BQGZG8qaNubLpNcDzvQi1dL 9cyDPPhenLDGrPsPsZP/RlbnNG7jXg/Sj9Jv7JbPmCQUY7Sbyd3523fL1AkSZKnJRtIOq8QcvzuFz oaKWPJTp0f51hv6k/LylRq75AvkVIMqx48eQ5Tl0wcyt/2tmZ/CY7AcIpBpX8cAzD9KafTpV0F1gn tb8bRHqVewahZlW4I6qp9bEyRYrDrtXwdCx3vxnmgewTncSlUef2DN77vQfFsCBz6l53Nf1GapoQc o0hTFCJtEarkecXFQmdz+3JxwltJS/k3u9EUcAOVvzy+2mDwWqddK6mvgqCrA7gJxzq9/AaHpQN7Y uQSk4auQ==; Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ65-004p3c-PB for opensbi@lists.infradead.org; Mon, 18 Jul 2022 12:43:41 +0000 Received: by mail-pg1-x52d.google.com with SMTP id 23so10441281pgc.8 for ; Mon, 18 Jul 2022 05:43:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=e9BL4TLSJ/VHwB8D/7gQnLvS1swgL5gOXrTAVdG4bWU=; b=XVM6fdz1MriK/SJsTPyst0Zgc/rYE9P/E6FIdUGPxbwRSgl/Wkb/ZYTFT90PqhnK2n kajj66aXcw21qKb+fekWYRRI7dKO3ONk6YwoiATlKNXiztlwxevrfENkm1W7eqfQTMZe cLYLmTRkwwiucSf6X3dt2neDj21Na6rRnK4Fi9hLw2xMryMoBbeVpGC7Nf60I3qB8njn vfNNpLuatAlspAx2hYyZRnsY/V2tteQLXtj1bKfh1xP6AJl4jGKnNVJxzQGmIyOFJ5r9 +WLd2RHrkCpL79QEDuPIxYnsHesqMUykKuCSGXaZjFrouPAoz4X9I+eSxknOhgCxoi1r Hu2Q== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=e9BL4TLSJ/VHwB8D/7gQnLvS1swgL5gOXrTAVdG4bWU=; b=3W3fej91+h6cO51zNRAGrwx9LCLLmuXknkxrDF0YyaIKyZzYgR7yVuzOi4qvgMpeJS r00MVwL9ml/Hajhz8hlm4lqsjl97fxXCjdtWcZGykZ422LNKnaLwL+UmWQFQQn0cTDFb cwtkRo1M+X8Wt5rTV0bx+wrlmXi8aUbz60szsCDpemLBnMN9vKmnq7sZ4mn6hjEBj40O 7k1FhEJKMEWfJbxqEjtfxgZHOGqqomwbA/6n5ArLnWOjFXXOEncfHSRczDL1E36wGRXd lMYKmf9/SN22P567/PTRCE0bhRYgYoBlex4ciYAQ97MOrYjfj4sPpLwyVVGUAdblEWv6 W/qg== X-Gm-Message-State: AJIora/EwQ9fCKhrVpkeCLOu3Lqos6BVFDarggv5S6Bl8auEuxVF6Xk5 pJvbDWhO938m04jNftnTGe0hhw== X-Google-Smtp-Source: AGRyM1tWOjKoYS6gn5v//SJvsf2VT1wwpLf6NL5bgWMJ3n3N+uOyvB6lxmJv8b8UbNpawCS7gczRog== X-Received: by 2002:a63:4a06:0:b0:419:f141:888b with SMTP id x6-20020a634a06000000b00419f141888bmr13485054pga.55.1658148214762; Mon, 18 Jul 2022 05:43:34 -0700 (PDT) Received: from anup-ubuntu64-vm.. ([122.171.37.148]) by smtp.gmail.com with ESMTPSA id v7-20020a622f07000000b0052ac2e23295sm9174158pfv.44.2022.07.18.05.43.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 05:43:33 -0700 (PDT) From: Anup Patel To: Atish Patra , Alistair Francis Cc: Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 13/14] platform: Remove redundant config.mk from all platforms Date: Mon, 18 Jul 2022 18:12:09 +0530 Message-Id: <20220718124210.2177576-14-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220718124210.2177576-1-apatel@ventanamicro.com> References: <20220718124210.2177576-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220718_134338_264249_7EA5961B X-CRM114-Status: GOOD ( 14.68 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.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: The options defined in config.mk can be specified in objects.mk of each platform so let us remove config.mk from all platforms. Signed-off-by: Anup Patel --- Makefile | 4 +- platform/andes/ae350/config.mk | 36 platform/andes/ae350/objects.mk | 29 +++++++++++ platform/fpga/ariane/config. [...] 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:52d listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. 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 The options defined in config.mk can be specified in objects.mk of each platform so let us remove config.mk from all platforms. Signed-off-by: Anup Patel --- Makefile | 4 +- platform/andes/ae350/config.mk | 36 -------------- platform/andes/ae350/objects.mk | 29 +++++++++++ platform/fpga/ariane/config.mk | 36 -------------- platform/fpga/ariane/objects.mk | 35 ++++++++++++++ platform/fpga/openpiton/config.mk | 35 -------------- platform/fpga/openpiton/objects.mk | 35 ++++++++++++++ platform/generic/config.mk | 40 ---------------- platform/generic/objects.mk | 33 +++++++++++++ platform/kendryte/k210/config.mk | 19 -------- platform/kendryte/k210/objects.mk | 12 +++++ platform/nuclei/ux600/config.mk | 30 ------------ platform/nuclei/ux600/objects.mk | 22 +++++++++ platform/template/config.mk | 77 ------------------------------ platform/template/objects.mk | 72 ++++++++++++++++++++++++++++ platform/template/platform.c | 2 +- 16 files changed, 240 insertions(+), 277 deletions(-) delete mode 100644 platform/andes/ae350/config.mk delete mode 100644 platform/fpga/ariane/config.mk delete mode 100644 platform/fpga/openpiton/config.mk delete mode 100644 platform/generic/config.mk delete mode 100644 platform/kendryte/k210/config.mk delete mode 100644 platform/nuclei/ux600/config.mk delete mode 100644 platform/template/config.mk diff --git a/Makefile b/Makefile index 5fc67db..a6475a7 100644 --- a/Makefile +++ b/Makefile @@ -203,7 +203,7 @@ firmware-object-mks=$(shell if [ -d $(firmware_dir) ]; then find $(firmware_dir) .PHONY: all all: -# Include platform specific .config and config.mk +# Include platform specific .config ifdef PLATFORM .PHONY: menuconfig menuconfig: $(platform_src_dir)/Kconfig $(src_dir)/Kconfig @@ -226,8 +226,6 @@ $(KCONFIG_CONFIG): $(platform_src_dir)/configs/$(PLATFORM_DEFCONFIG) $(platform_ $(KCONFIG_AUTOCONF_CMD): $(KCONFIG_CONFIG) include $(KCONFIG_CONFIG) include $(KCONFIG_AUTOCONF_CMD) - -include $(platform_src_dir)/config.mk endif # Include all object.mk files diff --git a/platform/andes/ae350/config.mk b/platform/andes/ae350/config.mk deleted file mode 100644 index f555ef5..0000000 --- a/platform/andes/ae350/config.mk +++ /dev/null @@ -1,36 +0,0 @@ -# -# SPDX-License-Identifier: BSD-2-Clause -# -# Copyright (c) 2019 Andes Technology Corporation -# -# Authors: -# Zong Li -# Nylon Chen - -# Compiler flags -platform-cppflags-y = -platform-cflags-y = -platform-asflags-y = -platform-ldflags-y = - -# Blobs to build -FW_TEXT_START=0x00000000 - -FW_DYNAMIC=y - -FW_JUMP=y -ifeq ($(PLATFORM_RISCV_XLEN), 32) - FW_JUMP_ADDR=0x400000 -else - FW_JUMP_ADDR=0x200000 -endif -FW_JUMP_FDT_ADDR=0x2000000 - -FW_PAYLOAD=y -ifeq ($(PLATFORM_RISCV_XLEN), 32) - FW_PAYLOAD_OFFSET=0x400000 -else - FW_PAYLOAD_OFFSET=0x200000 -endif - -FW_PAYLOAD_FDT_ADDR=0x2000000 diff --git a/platform/andes/ae350/objects.mk b/platform/andes/ae350/objects.mk index 5369677..80f0737 100644 --- a/platform/andes/ae350/objects.mk +++ b/platform/andes/ae350/objects.mk @@ -8,4 +8,33 @@ # Nylon Chen # +# Compiler flags +platform-cppflags-y = +platform-cflags-y = +platform-asflags-y = +platform-ldflags-y = + +# Objects to build platform-objs-y += cache.o platform.o plicsw.o plmt.o + +# Blobs to build +FW_TEXT_START=0x00000000 + +FW_DYNAMIC=y + +FW_JUMP=y +ifeq ($(PLATFORM_RISCV_XLEN), 32) + FW_JUMP_ADDR=0x400000 +else + FW_JUMP_ADDR=0x200000 +endif +FW_JUMP_FDT_ADDR=0x2000000 + +FW_PAYLOAD=y +ifeq ($(PLATFORM_RISCV_XLEN), 32) + FW_PAYLOAD_OFFSET=0x400000 +else + FW_PAYLOAD_OFFSET=0x200000 +endif + +FW_PAYLOAD_FDT_ADDR=0x2000000 diff --git a/platform/fpga/ariane/config.mk b/platform/fpga/ariane/config.mk deleted file mode 100644 index 3556461..0000000 --- a/platform/fpga/ariane/config.mk +++ /dev/null @@ -1,36 +0,0 @@ -# -# SPDX-License-Identifier: BSD-2-Clause -# -# Copyright (C) 2019 FORTH-ICS/CARV -# Panagiotis Peristerakis -# - -#for more infos, check out /platform/template/config.mk - -PLATFORM_RISCV_XLEN = 64 - -# Blobs to build -FW_TEXT_START=0x80000000 -FW_JUMP=n - -ifeq ($(PLATFORM_RISCV_XLEN), 32) - # This needs to be 4MB aligned for 32-bit support - FW_JUMP_ADDR=0x80400000 - else - # This needs to be 2MB aligned for 64-bit support - FW_JUMP_ADDR=0x80200000 - endif -FW_JUMP_FDT_ADDR=0x82200000 - -# Firmware with payload configuration. -FW_PAYLOAD=y - -ifeq ($(PLATFORM_RISCV_XLEN), 32) -# This needs to be 4MB aligned for 32-bit support - FW_PAYLOAD_OFFSET=0x400000 -else -# This needs to be 2MB aligned for 64-bit support - FW_PAYLOAD_OFFSET=0x200000 -endif -FW_PAYLOAD_FDT_ADDR=0x82200000 -FW_PAYLOAD_ALIGN=0x1000 diff --git a/platform/fpga/ariane/objects.mk b/platform/fpga/ariane/objects.mk index 814e6da..83581ac 100644 --- a/platform/fpga/ariane/objects.mk +++ b/platform/fpga/ariane/objects.mk @@ -5,4 +5,39 @@ # Panagiotis Peristerakis # +# Compiler flags +platform-cppflags-y = +platform-cflags-y = +platform-asflags-y = +platform-ldflags-y = + +# Object to build platform-objs-y += platform.o + +PLATFORM_RISCV_XLEN = 64 + +# Blobs to build +FW_TEXT_START=0x80000000 +FW_JUMP=n + +ifeq ($(PLATFORM_RISCV_XLEN), 32) + # This needs to be 4MB aligned for 32-bit support + FW_JUMP_ADDR=0x80400000 + else + # This needs to be 2MB aligned for 64-bit support + FW_JUMP_ADDR=0x80200000 + endif +FW_JUMP_FDT_ADDR=0x82200000 + +# Firmware with payload configuration. +FW_PAYLOAD=y + +ifeq ($(PLATFORM_RISCV_XLEN), 32) +# This needs to be 4MB aligned for 32-bit support + FW_PAYLOAD_OFFSET=0x400000 +else +# This needs to be 2MB aligned for 64-bit support + FW_PAYLOAD_OFFSET=0x200000 +endif +FW_PAYLOAD_FDT_ADDR=0x82200000 +FW_PAYLOAD_ALIGN=0x1000 diff --git a/platform/fpga/openpiton/config.mk b/platform/fpga/openpiton/config.mk deleted file mode 100644 index a969b25..0000000 --- a/platform/fpga/openpiton/config.mk +++ /dev/null @@ -1,35 +0,0 @@ -# -# SPDX-License-Identifier: BSD-2-Clause -# -# Copyright (c) 2020 Western Digital Corporation or its affiliates. -# - -#for more infos, check out /platform/template/config.mk - -PLATFORM_RISCV_XLEN = 64 - -# Blobs to build -FW_TEXT_START=0x80000000 -FW_JUMP=n - -ifeq ($(PLATFORM_RISCV_XLEN), 32) - # This needs to be 4MB aligned for 32-bit support - FW_JUMP_ADDR=0x80400000 - else - # This needs to be 2MB aligned for 64-bit support - FW_JUMP_ADDR=0x80200000 - endif -FW_JUMP_FDT_ADDR=0x82200000 - -# Firmware with payload configuration. -FW_PAYLOAD=y - -ifeq ($(PLATFORM_RISCV_XLEN), 32) -# This needs to be 4MB aligned for 32-bit support - FW_PAYLOAD_OFFSET=0x400000 -else -# This needs to be 2MB aligned for 64-bit support - FW_PAYLOAD_OFFSET=0x200000 -endif -FW_PAYLOAD_FDT_ADDR=0x82200000 -FW_PAYLOAD_ALIGN=0x1000 diff --git a/platform/fpga/openpiton/objects.mk b/platform/fpga/openpiton/objects.mk index 30a3c4f..c8c345a 100644 --- a/platform/fpga/openpiton/objects.mk +++ b/platform/fpga/openpiton/objects.mk @@ -4,4 +4,39 @@ # Copyright (c) 2020 Western Digital Corporation or its affiliates. # +# Compiler flags +platform-cppflags-y = +platform-cflags-y = +platform-asflags-y = +platform-ldflags-y = + +# Objects to build platform-objs-y += platform.o + +PLATFORM_RISCV_XLEN = 64 + +# Blobs to build +FW_TEXT_START=0x80000000 +FW_JUMP=n + +ifeq ($(PLATFORM_RISCV_XLEN), 32) + # This needs to be 4MB aligned for 32-bit support + FW_JUMP_ADDR=0x80400000 + else + # This needs to be 2MB aligned for 64-bit support + FW_JUMP_ADDR=0x80200000 + endif +FW_JUMP_FDT_ADDR=0x82200000 + +# Firmware with payload configuration. +FW_PAYLOAD=y + +ifeq ($(PLATFORM_RISCV_XLEN), 32) +# This needs to be 4MB aligned for 32-bit support + FW_PAYLOAD_OFFSET=0x400000 +else +# This needs to be 2MB aligned for 64-bit support + FW_PAYLOAD_OFFSET=0x200000 +endif +FW_PAYLOAD_FDT_ADDR=0x82200000 +FW_PAYLOAD_ALIGN=0x1000 diff --git a/platform/generic/config.mk b/platform/generic/config.mk deleted file mode 100644 index 8151974..0000000 --- a/platform/generic/config.mk +++ /dev/null @@ -1,40 +0,0 @@ -# -# SPDX-License-Identifier: BSD-2-Clause -# -# Copyright (c) 2020 Western Digital Corporation or its affiliates. -# -# Authors: -# Anup Patel -# - -# Compiler flags -platform-cppflags-y = -platform-cflags-y = -platform-asflags-y = -platform-ldflags-y = - -# Command for platform specific "make run" -platform-runcmd = qemu-system-riscv$(PLATFORM_RISCV_XLEN) -M virt -m 256M \ - -nographic -bios $(build_dir)/platform/generic/firmware/fw_payload.elf - -# Blobs to build -FW_TEXT_START=0x80000000 -FW_DYNAMIC=y -FW_JUMP=y -ifeq ($(PLATFORM_RISCV_XLEN), 32) - # This needs to be 4MB aligned for 32-bit system - FW_JUMP_ADDR=$(shell printf "0x%X" $$(($(FW_TEXT_START) + 0x400000))) -else - # This needs to be 2MB aligned for 64-bit system - FW_JUMP_ADDR=$(shell printf "0x%X" $$(($(FW_TEXT_START) + 0x200000))) -endif -FW_JUMP_FDT_ADDR=$(shell printf "0x%X" $$(($(FW_TEXT_START) + 0x2200000))) -FW_PAYLOAD=y -ifeq ($(PLATFORM_RISCV_XLEN), 32) - # This needs to be 4MB aligned for 32-bit system - FW_PAYLOAD_OFFSET=0x400000 -else - # This needs to be 2MB aligned for 64-bit system - FW_PAYLOAD_OFFSET=0x200000 -endif -FW_PAYLOAD_FDT_ADDR=$(FW_JUMP_FDT_ADDR) diff --git a/platform/generic/objects.mk b/platform/generic/objects.mk index 4907754..136853e 100644 --- a/platform/generic/objects.mk +++ b/platform/generic/objects.mk @@ -7,5 +7,38 @@ # Anup Patel # +# Compiler flags +platform-cppflags-y = +platform-cflags-y = +platform-asflags-y = +platform-ldflags-y = + +# Command for platform specific "make run" +platform-runcmd = qemu-system-riscv$(PLATFORM_RISCV_XLEN) -M virt -m 256M \ + -nographic -bios $(build_dir)/platform/generic/firmware/fw_payload.elf + +# Objects to build platform-objs-y += platform.o platform-objs-y += platform_override_modules.o + +# Blobs to build +FW_TEXT_START=0x80000000 +FW_DYNAMIC=y +FW_JUMP=y +ifeq ($(PLATFORM_RISCV_XLEN), 32) + # This needs to be 4MB aligned for 32-bit system + FW_JUMP_ADDR=$(shell printf "0x%X" $$(($(FW_TEXT_START) + 0x400000))) +else + # This needs to be 2MB aligned for 64-bit system + FW_JUMP_ADDR=$(shell printf "0x%X" $$(($(FW_TEXT_START) + 0x200000))) +endif +FW_JUMP_FDT_ADDR=$(shell printf "0x%X" $$(($(FW_TEXT_START) + 0x2200000))) +FW_PAYLOAD=y +ifeq ($(PLATFORM_RISCV_XLEN), 32) + # This needs to be 4MB aligned for 32-bit system + FW_PAYLOAD_OFFSET=0x400000 +else + # This needs to be 2MB aligned for 64-bit system + FW_PAYLOAD_OFFSET=0x200000 +endif +FW_PAYLOAD_FDT_ADDR=$(FW_JUMP_FDT_ADDR) diff --git a/platform/kendryte/k210/config.mk b/platform/kendryte/k210/config.mk deleted file mode 100644 index 8a9b814..0000000 --- a/platform/kendryte/k210/config.mk +++ /dev/null @@ -1,19 +0,0 @@ -# -# SPDX-License-Identifier: BSD-2-Clause -# -# Copyright (c) 2019 Western Digital Corporation or its affiliates. -# -# Authors: -# Damien Le Moal -# - -# Compiler flags -platform-cppflags-y = -platform-cflags-y = -platform-asflags-y = -platform-ldflags-y = - -# Blobs to build -FW_TEXT_START=0x80000000 -FW_PAYLOAD=y -FW_PAYLOAD_ALIGN=0x1000 diff --git a/platform/kendryte/k210/objects.mk b/platform/kendryte/k210/objects.mk index b74da74..1bfb898 100644 --- a/platform/kendryte/k210/objects.mk +++ b/platform/kendryte/k210/objects.mk @@ -7,8 +7,20 @@ # Damien Le Moal # +# Compiler flags +platform-cppflags-y = +platform-cflags-y = +platform-asflags-y = +platform-ldflags-y = + +# Objects to build platform-objs-y += platform.o platform-objs-y += k210.o platform-varprefix-k210.o = dt_k210 platform-padding-k210.o = 2048 + +# Blobs to build +FW_TEXT_START=0x80000000 +FW_PAYLOAD=y +FW_PAYLOAD_ALIGN=0x1000 diff --git a/platform/nuclei/ux600/config.mk b/platform/nuclei/ux600/config.mk deleted file mode 100644 index dddcc4e..0000000 --- a/platform/nuclei/ux600/config.mk +++ /dev/null @@ -1,30 +0,0 @@ -# -# SPDX-License-Identifier: BSD-2-Clause -# -# Copyright (c) 2020 Nuclei Corporation or its affiliates. -# -# Authors: -# lujun -# hqfang <578567190@qq.com> -# - -# Compiler flags -platform-cppflags-y = -platform-cflags-y = -platform-asflags-y = -platform-ldflags-y = - -# Command for platform specific "make run" -platform-runcmd = xl_spike \ - $(build_dir)/platform/nuclei/ux600/firmware/fw_payload.elf - -# Blobs to build -FW_TEXT_START=0xA0000000 -FW_DYNAMIC=y -FW_JUMP=y - -FW_JUMP_ADDR=0xA0200000 -FW_JUMP_FDT_ADDR=0xA8000000 -FW_PAYLOAD=y -FW_PAYLOAD_OFFSET=0x200000 -FW_PAYLOAD_FDT_ADDR=0xA8000000 diff --git a/platform/nuclei/ux600/objects.mk b/platform/nuclei/ux600/objects.mk index 8c36c90..7c429e0 100644 --- a/platform/nuclei/ux600/objects.mk +++ b/platform/nuclei/ux600/objects.mk @@ -8,4 +8,26 @@ # hqfang <578567190@qq.com> # +# Compiler flags +platform-cppflags-y = +platform-cflags-y = +platform-asflags-y = +platform-ldflags-y = + +# Command for platform specific "make run" +platform-runcmd = xl_spike \ + $(build_dir)/platform/nuclei/ux600/firmware/fw_payload.elf + +# Objects to build platform-objs-y += platform.o + +# Blobs to build +FW_TEXT_START=0xA0000000 +FW_DYNAMIC=y +FW_JUMP=y + +FW_JUMP_ADDR=0xA0200000 +FW_JUMP_FDT_ADDR=0xA8000000 +FW_PAYLOAD=y +FW_PAYLOAD_OFFSET=0x200000 +FW_PAYLOAD_FDT_ADDR=0xA8000000 diff --git a/platform/template/config.mk b/platform/template/config.mk deleted file mode 100644 index f817342..0000000 --- a/platform/template/config.mk +++ /dev/null @@ -1,77 +0,0 @@ -# -# SPDX-License-Identifier: BSD-2-Clause -# -# Copyright (c) 2019 Western Digital Corporation or its affiliates. -# - -# Compiler pre-processor flags -platform-cppflags-y = - -# C Compiler and assembler flags. -platform-cflags-y = -platform-asflags-y = - -# Linker flags: additional libraries and object files that the platform -# code needs can be added here -platform-ldflags-y = - -# -# Command for platform specific "make run" -# Useful for development and debugging on plaftform simulator (such as QEMU) -# -# platform-runcmd = your_platform_run.sh - -# -# Platform RISC-V XLEN, ABI, ISA and Code Model configuration. -# These are optional parameters but platforms can optionaly provide it. -# Some of these are guessed based on GCC compiler capabilities -# -# PLATFORM_RISCV_XLEN = 64 -# PLATFORM_RISCV_ABI = lp64 -# PLATFORM_RISCV_ISA = rv64imafdc -# PLATFORM_RISCV_CODE_MODEL = medany - -# Firmware load address configuration. This is mandatory. -FW_TEXT_START=0x80000000 - -# Optional parameter for path to external FDT -# FW_FDT_PATH="path to platform flattened device tree file" - -# -# Dynamic firmware configuration. -# Optional parameters are commented out. Uncomment and define these parameters -# as needed. -# -FW_DYNAMIC= - -# -# Jump firmware configuration. -# Optional parameters are commented out. Uncomment and define these parameters -# as needed. -# -FW_JUMP= -# This needs to be 4MB aligned for 32-bit support -# This needs to be 2MB aligned for 64-bit support -# ifeq ($(PLATFORM_RISCV_XLEN), 32) -# FW_JUMP_ADDR=0x80400000 -# else -# FW_JUMP_ADDR=0x80200000 -# endif -# FW_JUMP_FDT_ADDR=0x82200000 - -# -# Firmware with payload configuration. -# Optional parameters are commented out. Uncomment and define these parameters -# as needed. -# -FW_PAYLOAD= -# This needs to be 4MB aligned for 32-bit support -# This needs to be 2MB aligned for 64-bit support -ifeq ($(PLATFORM_RISCV_XLEN), 32) -FW_PAYLOAD_OFFSET=0x400000 -else -FW_PAYLOAD_OFFSET=0x200000 -endif -# FW_PAYLOAD_ALIGN=0x1000 -# FW_PAYLOAD_PATH="path to next boot stage binary image file" -# FW_PAYLOAD_FDT_ADDR=0x82200000 diff --git a/platform/template/objects.mk b/platform/template/objects.mk index caaec2b..0025928 100644 --- a/platform/template/objects.mk +++ b/platform/template/objects.mk @@ -4,6 +4,33 @@ # Copyright (c) 2019 Western Digital Corporation or its affiliates. # +# Compiler pre-processor flags +platform-cppflags-y = + +# C Compiler and assembler flags. +platform-cflags-y = +platform-asflags-y = + +# Linker flags: additional libraries and object files that the platform +# code needs can be added here +platform-ldflags-y = + +# +# Command for platform specific "make run" +# Useful for development and debugging on plaftform simulator (such as QEMU) +# +# platform-runcmd = your_platform_run.sh + +# +# Platform RISC-V XLEN, ABI, ISA and Code Model configuration. +# These are optional parameters but platforms can optionaly provide it. +# Some of these are guessed based on GCC compiler capabilities +# +# PLATFORM_RISCV_XLEN = 64 +# PLATFORM_RISCV_ABI = lp64 +# PLATFORM_RISCV_ISA = rv64imafdc +# PLATFORM_RISCV_CODE_MODEL = medany + # Space separated list of object file names to be compiled for the platform platform-objs-y += platform.o @@ -13,3 +40,48 @@ platform-objs-y += platform.o # source file be in the form
.dts # # platform-objs-y +=
.o + +# Firmware load address configuration. This is mandatory. +FW_TEXT_START=0x80000000 + +# Optional parameter for path to external FDT +# FW_FDT_PATH="path to platform flattened device tree file" + +# +# Dynamic firmware configuration. +# Optional parameters are commented out. Uncomment and define these parameters +# as needed. +# +FW_DYNAMIC= + +# +# Jump firmware configuration. +# Optional parameters are commented out. Uncomment and define these parameters +# as needed. +# +FW_JUMP= +# This needs to be 4MB aligned for 32-bit support +# This needs to be 2MB aligned for 64-bit support +# ifeq ($(PLATFORM_RISCV_XLEN), 32) +# FW_JUMP_ADDR=0x80400000 +# else +# FW_JUMP_ADDR=0x80200000 +# endif +# FW_JUMP_FDT_ADDR=0x82200000 + +# +# Firmware with payload configuration. +# Optional parameters are commented out. Uncomment and define these parameters +# as needed. +# +FW_PAYLOAD= +# This needs to be 4MB aligned for 32-bit support +# This needs to be 2MB aligned for 64-bit support +ifeq ($(PLATFORM_RISCV_XLEN), 32) +FW_PAYLOAD_OFFSET=0x400000 +else +FW_PAYLOAD_OFFSET=0x200000 +endif +# FW_PAYLOAD_ALIGN=0x1000 +# FW_PAYLOAD_PATH="path to next boot stage binary image file" +# FW_PAYLOAD_FDT_ADDR=0x82200000 diff --git a/platform/template/platform.c b/platform/template/platform.c index 5524847..f3802da 100644 --- a/platform/template/platform.c +++ b/platform/template/platform.c @@ -11,7 +11,7 @@ /* * Include these files as needed. - * See config.mk PLATFORM_xxx configuration parameters. + * See objects.mk PLATFORM_xxx configuration parameters. */ #include #include From patchwork Mon Jul 18 12:42:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1657452 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=JUCoWAu2; 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=SoyYOMc2; 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 4LmhV543zSz9s2R for ; Mon, 18 Jul 2022 22:43:57 +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=5pK46lISVbk6GKeZNMvQqWnKT37FhrK+S0DfrSI9Fnw=; b=JUCoWAu23h8cP7 SPMVfUMDrtl0jw+jAbUIrZIj1aDrfZ2nXTOFUjy9X5PbOFo/mF2fNMZ2QaVanmbAQ9FtALCAPmvpF 2MfntJ7reCC3Mv/rSaCl7vFRB8zokIQKMCqm2N62mvs6I5IlXkmwvdANbFUCxBT97P/0bUeIvMWSY LZNnuLC6NeKwYFM/JU2OpndlU/OcLxgRhenxXlzofV5JcPGvuS+3cZAXRmhxfWEXC0Xt5Mu9dVRZ+ YvT5Y9roXOugtmHPKzS4kp8kvPp4KDEoBiM8xme7VqSX18Q6b5kj5kTdFSrTPbJeiBTuky4NKbOCv LGhSgHS14VYwewAZBR/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ6B-00DOuw-Qb; Mon, 18 Jul 2022 12:43:43 +0000 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDQ67-00DOpp-PW for opensbi@lists.infradead.org; Mon, 18 Jul 2022 12:43:41 +0000 Received: by mail-pg1-x52a.google.com with SMTP id h132so10431481pgc.10 for ; Mon, 18 Jul 2022 05:43:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HgiwoV20oHIcE1HS71luZXUIEDnHZMHhzRLbi4megW4=; b=SoyYOMc2OIR+nv3kNyh+fduMv+dLVC9HMllgr2cEm5JDeLf6JqXGh20kDL4FchDTqp D4QYKr69PZPk47szcqLVivmCRmCrwNMDi3WMfONWHWfn2enzxrqZXVLlNBI4XboE7xUD 0wNcDM6socnRTFqoPDWig3a2Ua0loGBsn64ghCdXi0uYfZhMA2uJj8oW1au4sUAH/tfJ zcBkmiD9okQMpcSfD2vZwxZcNOCo23nODhreLbjrRpHtURS4i+ldP5vxpMKDnmBJmGFe MGq75+ILXwFF2JiXemzNa0opuKRPlQHaTbt5SLxIvygXE+QoHv/qcTKyMrtWPfm9X+9V 5/4A== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=HgiwoV20oHIcE1HS71luZXUIEDnHZMHhzRLbi4megW4=; b=wdBPGdvqYa3G8+GRaK6dx4BcwrAMh742fWBJxVWUU5ymJMX3xJbUQocM3xGVVyDT8i nmNCuh6aB7N+CyOEhXci+rgeBTkA10jwOo7PO3x3vLa84j4+N1QXtCu/dn7uDQ5Jpa6U HQRznnir9irfdIfe5NyQ9pDRlWHk10AxZ9H9AKeDPJaOSMYV8LRDaXQqJWLHStl7p9rt mmTEI4VPBhJDZEl4NRgwQ5PnC58uCEqcE51Yqzav++Yc5TiBszFMYP43Z4eFjzRVd5TC ZldIPwwZJWFCdp4q4TCGW05W+t7HIk+uKv9V9Du9qyK1uAyp4Z39WCv9mrMHuNZTftQ7 Pxyg== X-Gm-Message-State: AJIora+4WnW5pZLRQHUQfJgWwmsnSMY7xeEAYVJjG1f9+CoG9BpT0hLu +rDKXvesqmwM4qssmaHrOrYuRw== X-Google-Smtp-Source: AGRyM1sDnBwH2wg/e5OvErfkATvYnuhKie1nqdABndkpYwNkzel6q5m8P2alyjKKcs1JfGspnpQWow== X-Received: by 2002:a63:560d:0:b0:419:759a:6653 with SMTP id k13-20020a63560d000000b00419759a6653mr24849834pgb.219.1658148217753; Mon, 18 Jul 2022 05:43:37 -0700 (PDT) Received: from anup-ubuntu64-vm.. ([122.171.37.148]) by smtp.gmail.com with ESMTPSA id v7-20020a622f07000000b0052ac2e23295sm9174158pfv.44.2022.07.18.05.43.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 05:43:37 -0700 (PDT) From: Anup Patel To: Atish Patra , Alistair Francis Cc: Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 14/14] docs: Update documentation for kconfig support Date: Mon, 18 Jul 2022 18:12:10 +0530 Message-Id: <20220718124210.2177576-15-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220718124210.2177576-1-apatel@ventanamicro.com> References: <20220718124210.2177576-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220718_054339_860517_EF505E3F X-CRM114-Status: GOOD ( 26.39 ) 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 all documentation files to: 1) Remove references to platform specific config.mk file since it is has been removed. 2) Add details about platform specific configs/defconfig and Kconfig files [...] 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:52a 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 all documentation files to: 1) Remove references to platform specific config.mk file since it is has been removed. 2) Add details about platform specific configs/defconfig and Kconfig files mandatory for each platform. 3) Add required packages in top-level README.md Signed-off-by: Anup Patel --- README.md | 25 +++++++++++++++++++++++-- docs/firmware/fw_dynamic.md | 2 +- docs/firmware/fw_jump.md | 4 ++-- docs/firmware/fw_payload.md | 4 ++-- docs/platform/platform.md | 4 ++-- docs/platform_guide.md | 9 +++++---- 6 files changed, 35 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 54fabe4..cd852cb 100644 --- a/README.md +++ b/README.md @@ -92,8 +92,8 @@ N.B. Any S-mode boot loader (i.e. U-Boot) doesn't need to support HSM extension, as it doesn't need to boot all the harts. The operating system should be capable enough to bring up all other non-booting harts using HSM extension. -Required Toolchain ------------------- +Required Toolchain and Packages +------------------------------- OpenSBI can be compiled natively or cross-compiled on a x86 host. For cross-compilation, you can build your own toolchain, download a prebuilt one @@ -115,6 +115,14 @@ triple is used (e.g. *-target riscv64-unknown-elf*). Please note that only a 64-bit version of the toolchain is available in the Bootlin toolchain repository for now. +In addition to a toolchain, OpenSBI also requires following packages on +the host: + +1. device-tree-compiler: The device tree compiler for compiling device + tree sources (DTS files). +2. kconfig-frontends: A standalone implementation of the Linux Kconfig + parser and frontends for OpenSBI platform configuration management. + Building and Installing the OpenSBI Platform-Independent Library ---------------------------------------------------------------- @@ -196,6 +204,19 @@ top-level make command line. These options, such as *PLATFORM_* or *docs/platform/.md* files and *docs/firmware/.md* files. +All OpenSBI platforms support Kconfig style build-time configuration. Users +can change the build-time configuration of a platform using a graphical +interface as follows: +``` +make PLATFORM= menuconfig +``` + +Alternately, an OpenSBI platform can have multiple default configurations +and users can select a custom default configuration as follows: +``` +make PLATFORM= PLATFORM_DEFCONFIG= +``` + Building 32-bit / 64-bit OpenSBI Images --------------------------------------- By default, building OpenSBI generates 32-bit or 64-bit images based on the diff --git a/docs/firmware/fw_dynamic.md b/docs/firmware/fw_dynamic.md index 7b9b192..e251488 100644 --- a/docs/firmware/fw_dynamic.md +++ b/docs/firmware/fw_dynamic.md @@ -20,7 +20,7 @@ the booting stage binary to follow OpenSBI firmware. A platform can enable *FW_DYNAMIC* firmware using any of the following methods. 1. Specifying `FW_DYNAMIC=y` on the top level `make` command line. -2. Specifying `FW_DYNAMIC=y` in the target platform *config.mk* configuration +2. Specifying `FW_DYNAMIC=y` in the target platform *objects.mk* configuration file. The compiled *FW_DYNAMIC* firmware ELF file is named *fw_dynamic.elf*. It's diff --git a/docs/firmware/fw_jump.md b/docs/firmware/fw_jump.md index eea3013..35a4301 100644 --- a/docs/firmware/fw_jump.md +++ b/docs/firmware/fw_jump.md @@ -15,7 +15,7 @@ and the booting stage binary to follow the OpenSBI firmware. A platform *FW_JUMP* firmware can be enabled by any of the following methods: 1. Specifying `FW_JUMP=y` on the top level `make` command line. -2. Specifying `FW_JUMP=y` in the target platform *config.mk* configuration file. +2. Specifying `FW_JUMP=y` in the target platform *objects.mk* configuration file. The compiled *FW_JUMP* firmware ELF file is named *fw_jump.elf*. Its expanded image file is *fw_jump.bin*. Both files are created in the platform-specific @@ -26,7 +26,7 @@ build directory under the *build/platform//firmware* directory. To operate correctly, a *FW_JUMP* firmware requires some configuration parameters to be defined using either the top level `make` command line or the -target platform *config.mk* configuration file. The possible parameters are as +target platform *objects.mk* configuration file. The possible parameters are as follows: * **FW_JUMP_ADDR** - Address of the entry point of the booting stage to be diff --git a/docs/firmware/fw_payload.md b/docs/firmware/fw_payload.md index 0947448..3bb918f 100644 --- a/docs/firmware/fw_payload.md +++ b/docs/firmware/fw_payload.md @@ -20,7 +20,7 @@ Enabling *FW_PAYLOAD* compilation The *FW_PAYLOAD* firmware can be enabled by any of the following methods: 1. Specifying `FW_PAYLOAD=y` on the top level `make` command line. -2. Specifying `FW_PAYLOAD=y` in the target platform *config.mk* configuration +2. Specifying `FW_PAYLOAD=y` in the target platform *objects.mk* configuration file. The compiled *FW_PAYLOAD* firmware ELF file is named *fw_jump.elf*. Its @@ -33,7 +33,7 @@ Configuration Options A *FW_PAYLOAD* firmware is built according to configuration parameters and options. These configuration parameters can be defined using either the top -level `make` command line or the target platform *config.mk* configuration +level `make` command line or the target platform *objects.mk* configuration file. The parameters currently defined are as follows: * **FW_PAYLOAD_OFFSET** - Offset from *FW_TEXT_BASE* where the payload binary diff --git a/docs/platform/platform.md b/docs/platform/platform.md index cb4bec6..b726e1d 100644 --- a/docs/platform/platform.md +++ b/docs/platform/platform.md @@ -42,8 +42,8 @@ OpenSBI currently supports the following virtual and hardware platforms: The code for these supported platforms can be used as example to implement support for other platforms. The *platform/template* directory also provides template files for implementing support for a new platform. The *object.mk*, -*config.mk* and *platform.c* template files provides enough comments to -facilitate the implementation. +*Kconfig*, *configs/defconfig* and *platform.c* template files provides enough +comments to facilitate the implementation. [generic.md]: generic.md [qemu_virt.md]: qemu_virt.md diff --git a/docs/platform_guide.md b/docs/platform_guide.md index b6c2c2e..8ac5aa0 100644 --- a/docs/platform_guide.md +++ b/docs/platform_guide.md @@ -28,11 +28,12 @@ Adding support for a new platform Support for a new platform named *<xyz>* can be added as follows: 1. Create a directory named *<xyz>* under the *platform/* directory. -2. Create a platform configuration file named *config.mk* under the - *platform/<xyz>/* directory. This configuration file will provide +2. Create a platform configuration files named *Kconfig* and *configs/defconfig* + under the *platform/<xyz>/* directory. This configuration files will + provide the build time configuration for the sources to be compiled. +3. Create a *platform/<xyz>/objects.mk* file for listing the platform + object files to be compiled. This file also provides platform-specific compiler flags, and select firmware options. -3. Create a *platform/<xyz>/objects.mk* file for listing the - platform-specific object files to be compiled. 4. Create a *platform/<xyz>/platform.c* file providing a *struct sbi_platform* instance.