From patchwork Thu Aug 4 12:04:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1663643 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=2b9ZAaiO; 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=bJSpr1Zu; 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 4Lz6qM4Jj0z9sFs for ; Thu, 4 Aug 2022 22:05:03 +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:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=NjtzlBe0ZHaPdj9Mcg+as0uj1NLN9QOKW2Vu/vagzAY=; b=2b9ZAaiONBRk+y GmaEUTskiczQTh3fdSno8sziRuhxLExYP6vW2RLf3oW6cBC0o/D1rxGj4wPE0sTQRhUuurO0leNKj Ejzirirgm/+bE9pYFBulslQByeGrDyj3ago8DqMO+Z0cwj5g3g6KVr9Bnt96cvqJJ3tKjI2W+r+h7 p2c4IXR3jtUiX7GkWYekFsqOopU5HkIMFWLzghqUwNS7UmvAOCCIPvhMXSo7lfVDRxE4taognuqRz +ZmwduUglYF5WgJ9xAA4iy2zBP25vJOCPZ04fCOO22294JxG1Skv1GpBsbJBdKy9VEeNiLHEr+KCH UY2L5bbVCdHtA9BZ4etA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJZaq-005mUq-Jo; Thu, 04 Aug 2022 12:04:48 +0000 Received: from mail-oa1-x33.google.com ([2001:4860:4864:20::33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJZan-005mS5-CF for opensbi@lists.infradead.org; Thu, 04 Aug 2022 12:04:47 +0000 Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-10cf9f5b500so24072746fac.2 for ; Thu, 04 Aug 2022 05:04:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc; bh=axoNyrHRVY8uFUGoVTBlv1Fo7M7iO+w9GZdrQEQKXh4=; b=bJSpr1ZuwHOYquVlu4B0QDkrG+Yf+HfbuohttYX3yuHVuU2gnVi6byLGRvX5NcbRPc ovo9GPz9WJAyO81/2da8f65ObxUS8z185qcdORupltVKCBgxDen/eGncloF6p4hiEYhT 5KMrMhEf2BPO3Iy64VCgH1VHHSfSg/wMrx5eE9jjCnSO2C9FMg+KO1C761usK4+jph0g M/uOvp8+hYB1QdyczTOCPBEdbod776hErz4Q4AI3IDwCfrJvvIwKXrHuBnSexbox6MHT ne74lQw7zxQgXCE6Eav81EOFMlA3AuOcp/CtFH3GOxU8UKlsbb0lV75/FFRK7Wk7h6aL Dn7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=axoNyrHRVY8uFUGoVTBlv1Fo7M7iO+w9GZdrQEQKXh4=; b=mCinB6qpD7X6BPE5PEqheVNdRy8K6sb4j5902YSvbxd1ieNRiaUUMWwoM5crVZD5cR R9wnNiXxb9N415DOnIRHJ2KIejksVHgEQjsKX/tDNNtltcChEC8djpPNosXDOKrNDM1Y A1KmyPsojVOZYOtN3EvFBxoL54w+xSsto8eHKtWAhdQRAJQFrp1kmlHHhppV40twAszL qqvDXGmOywD1v9AHAmKKggC4eGOOuORQ4kHwFk9WVZF6ZbAOPBtRAMEQzkfGT+vKnV6i DShwQ98JMjNOeD7GwF0TYp5SERLP9kch/UT1ZoaehwlUbmsp4HU1qva7gtmgao+AfLnc GH/g== X-Gm-Message-State: ACgBeo2QJHp3bKp6xJU4TGgZLJDby0ribz3ap7YFAULLxzOKjvQ/nEhs TnLmVkxYDWwt7fDjpfH7EMQOVg== X-Google-Smtp-Source: AA6agR6QmKB/fp3ixFBW0HN41dW8YO3Maimij3QARsFcOqE0zRpJhqqYP6txSI7m4K6K5LY+klYUBA== X-Received: by 2002:a05:6870:2041:b0:10d:c70:42c4 with SMTP id l1-20020a056870204100b0010d0c7042c4mr672571oad.150.1659614682888; Thu, 04 Aug 2022 05:04:42 -0700 (PDT) Received: from anup-ubuntu64-vm.. ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id r13-20020a056871088d00b000f5f4ad194bsm93184oaq.25.2022.08.04.05.04.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 05:04:42 -0700 (PDT) From: Anup Patel To: Atish Patra , Alistair Francis Cc: Andrew Jones , David Abdurachmanov , Heinrich Schuchardt , Andreas Schwab , Mark Kettenis , Emmanuel Vadot , Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH v6 00/17] OpenSBI Kconfig Support Date: Thu, 4 Aug 2022 17:34:12 +0530 Message-Id: <20220804120429.59444-1-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220804_050445_449061_89709CAB X-CRM114-Status: GOOD ( 15.71 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: In future, we will see more drivers in OpenSBI for system reset, serial port, power management, etc platform specific devices. We need platform specific compile time configuration to allow users contr [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2001:4860:4864:20:0:0:0:33 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 In future, we will see more drivers in OpenSBI for system reset, serial port, power management, etc platform specific devices. We need platform specific compile time configuration to allow users control the size of OpenSBI generic firmware binaries by only enabling desired drivers. In other words, users should be allowed to restrict the set of RISC-V platforms on which OpenSBI generic firmwares built by them can run. To address above, we add Kconfig support for OpenSBI platforms using the Kconfiglib project which is a standalone kconfig parser. To try OpenSBI Kconfig support with generic platform, here are few example commands: make PLATFORM=generic <-- builds OpenSBI using "defconfig" make PLATFORM=generic menuconfig <-- launches graphical interface for changes These patches can also be found in the kconfig_v6 branch at: https://github.com/avpatel/opensbi.git Changes since v5: - Updated kconfig symbol description in PATCH14 - Included a typo fix for docs/platform/platform.md in PATCH16 - Added separate PATCH17 for typo fix in top-level makefile Changes since v4: - Added separate PATCH14 to allow user change generic platform version and default name. - Fixed libfdt compiler error using LLVM in PATCH12 Changes since v3: - Strip down the Kconfiglib sources added by PATCH1 - Removed extra "." in the top-level Makefile updated by PATCH2 Changes since v2: - Use $(FOO) instead of $FOO to access FOO environment variable in Kconfig files. - Added a new PATCH1 to include Kconfiglib v14.1.0 sources under the scripts directory of OpenSBI. Changes since v1: - Fix SPDX license specifier in new Kconfig files Anup Patel (17): scripts: Add Kconfiglib v14.1.0 under scripts directory Makefile: Add initial kconfig support for each platform Makefile: Compile lib/utils sources separately for each platform lib: utils/serial: Use kconfig for enabling/disabling drivers lib: utils/reset: Use kconfig for enabling/disabling drivers lib: utils/sys: Use kconfig for enabling/disabling drivers lib: utils/timer: Use kconfig for enabling/disabling drivers lib: utils/ipi: Use kconfig for enabling/disabling drivers lib: utils/irqchip: Use kconfig for enabling/disabling drivers lib: utils/i2c: Use kconfig for enabling/disabling drivers lib: utils/gpio: Use kconfig for enabling/disabling drivers lib: utils/fdt: Use kconfig for enabling/disabling platform: generic: Use kconfig for enabling/disabling overrides platform: generic: Use kconfig to set platform version and default name platform: Remove redundant config.mk from all platforms docs: Update documentation for kconfig support Makefile: Fix typo related to object.mk Kconfig | 23 + Makefile | 107 +- README.md | 25 +- docs/firmware/fw_dynamic.md | 2 +- docs/firmware/fw_jump.md | 4 +- docs/firmware/fw_payload.md | 4 +- docs/library_usage.md | 6 +- docs/platform/platform.md | 6 +- docs/platform_guide.md | 9 +- firmware/Kconfig | 1 + include/sbi_utils/fdt/fdt_domain.h | 9 + include/sbi_utils/fdt/fdt_pmu.h | 10 + include/sbi_utils/ipi/fdt_ipi.h | 9 + include/sbi_utils/irqchip/fdt_irqchip.h | 10 + include/sbi_utils/irqchip/imsic.h | 10 + include/sbi_utils/reset/fdt_reset.h | 12 + include/sbi_utils/serial/fdt_serial.h | 8 + include/sbi_utils/timer/fdt_timer.h | 9 + lib/utils/Kconfig | 25 + lib/utils/fdt/Kconfig | 18 + lib/utils/fdt/objects.mk | 8 +- lib/utils/gpio/Kconfig | 23 + lib/utils/gpio/objects.mk | 10 +- lib/utils/i2c/Kconfig | 23 + lib/utils/i2c/objects.mk | 10 +- lib/utils/ipi/Kconfig | 23 + lib/utils/ipi/objects.mk | 10 +- lib/utils/irqchip/Kconfig | 41 + lib/utils/irqchip/objects.mk | 22 +- lib/utils/libfdt/Kconfig | 5 + lib/utils/libfdt/objects.mk | 2 +- lib/utils/reset/Kconfig | 37 + lib/utils/reset/objects.mk | 28 +- lib/utils/serial/Kconfig | 73 + lib/utils/serial/objects.mk | 44 +- lib/utils/sys/Kconfig | 13 + lib/utils/sys/objects.mk | 4 +- lib/utils/timer/Kconfig | 23 + lib/utils/timer/objects.mk | 10 +- platform/andes/ae350/Kconfig | 8 + platform/andes/ae350/config.mk | 36 - platform/andes/ae350/configs/defconfig | 0 platform/andes/ae350/objects.mk | 29 + platform/fpga/ariane/Kconfig | 10 + platform/fpga/ariane/config.mk | 36 - platform/fpga/ariane/configs/defconfig | 0 platform/fpga/ariane/objects.mk | 35 + platform/fpga/openpiton/Kconfig | 10 + platform/fpga/openpiton/config.mk | 35 - platform/fpga/openpiton/configs/defconfig | 0 platform/fpga/openpiton/objects.mk | 35 + platform/generic/Kconfig | 40 + platform/generic/allwinner/objects.mk | 4 +- platform/generic/config.mk | 40 - platform/generic/configs/defconfig | 29 + platform/generic/objects.mk | 33 + platform/generic/platform.c | 6 +- platform/generic/sifive/objects.mk | 8 +- platform/kendryte/k210/Kconfig | 10 + platform/kendryte/k210/config.mk | 19 - platform/kendryte/k210/configs/defconfig | 0 platform/kendryte/k210/objects.mk | 12 + platform/nuclei/ux600/Kconfig | 10 + platform/nuclei/ux600/config.mk | 30 - platform/nuclei/ux600/configs/defconfig | 0 platform/nuclei/ux600/objects.mk | 22 + platform/nuclei/ux600/platform.c | 1 - platform/template/Kconfig | 9 + platform/template/config.mk | 77 - platform/template/configs/defconfig | 0 platform/template/objects.mk | 72 + platform/template/platform.c | 2 +- scripts/Kconfiglib/LICENSE.txt | 5 + scripts/Kconfiglib/allnoconfig.py | 45 + scripts/Kconfiglib/allyesconfig.py | 56 + scripts/Kconfiglib/defconfig.py | 43 + scripts/Kconfiglib/genconfig.py | 154 + scripts/Kconfiglib/kconfiglib.py | 7160 +++++++++++++++++++++ scripts/Kconfiglib/menuconfig.py | 3278 ++++++++++ scripts/Kconfiglib/oldconfig.py | 246 + scripts/Kconfiglib/olddefconfig.py | 28 + scripts/Kconfiglib/savedefconfig.py | 49 + scripts/Kconfiglib/setconfig.py | 92 + scripts/create-binary-archive.sh | 2 +- 84 files changed, 12126 insertions(+), 406 deletions(-) create mode 100644 Kconfig create mode 100644 firmware/Kconfig create mode 100644 lib/utils/Kconfig create mode 100644 lib/utils/fdt/Kconfig create mode 100644 lib/utils/gpio/Kconfig create mode 100644 lib/utils/i2c/Kconfig create mode 100644 lib/utils/ipi/Kconfig create mode 100644 lib/utils/irqchip/Kconfig create mode 100644 lib/utils/libfdt/Kconfig create mode 100644 lib/utils/reset/Kconfig create mode 100644 lib/utils/serial/Kconfig create mode 100644 lib/utils/sys/Kconfig create mode 100644 lib/utils/timer/Kconfig create mode 100644 platform/andes/ae350/Kconfig delete mode 100644 platform/andes/ae350/config.mk create mode 100644 platform/andes/ae350/configs/defconfig create mode 100644 platform/fpga/ariane/Kconfig delete mode 100644 platform/fpga/ariane/config.mk create mode 100644 platform/fpga/ariane/configs/defconfig create mode 100644 platform/fpga/openpiton/Kconfig delete mode 100644 platform/fpga/openpiton/config.mk create mode 100644 platform/fpga/openpiton/configs/defconfig create mode 100644 platform/generic/Kconfig delete mode 100644 platform/generic/config.mk create mode 100644 platform/generic/configs/defconfig create mode 100644 platform/kendryte/k210/Kconfig delete mode 100644 platform/kendryte/k210/config.mk create mode 100644 platform/kendryte/k210/configs/defconfig create mode 100644 platform/nuclei/ux600/Kconfig delete mode 100644 platform/nuclei/ux600/config.mk create mode 100644 platform/nuclei/ux600/configs/defconfig create mode 100644 platform/template/Kconfig delete mode 100644 platform/template/config.mk create mode 100644 platform/template/configs/defconfig create mode 100644 scripts/Kconfiglib/LICENSE.txt create mode 100755 scripts/Kconfiglib/allnoconfig.py create mode 100755 scripts/Kconfiglib/allyesconfig.py create mode 100755 scripts/Kconfiglib/defconfig.py create mode 100755 scripts/Kconfiglib/genconfig.py create mode 100644 scripts/Kconfiglib/kconfiglib.py create mode 100755 scripts/Kconfiglib/menuconfig.py create mode 100755 scripts/Kconfiglib/oldconfig.py create mode 100755 scripts/Kconfiglib/olddefconfig.py create mode 100755 scripts/Kconfiglib/savedefconfig.py create mode 100755 scripts/Kconfiglib/setconfig.py