From patchwork Tue Jul 9 22:36:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 1130053 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.b="neZBqhwN"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45jyF217ljz9sNF for ; Wed, 10 Jul 2019 08:49:41 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id CB4E984524; Tue, 9 Jul 2019 22:49:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0KfR3lcnvtce; Tue, 9 Jul 2019 22:49:39 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 36C17843FA; Tue, 9 Jul 2019 22:49:39 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id F3B801BF30A for ; Tue, 9 Jul 2019 22:49:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id F1356834ED for ; Tue, 9 Jul 2019 22:49:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Qg8tLhog4WWP for ; Tue, 9 Jul 2019 22:49:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by fraxinus.osuosl.org (Postfix) with ESMTPS id DA9F48363E for ; Tue, 9 Jul 2019 22:49:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1562712607; x=1594248607; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=z+tPGa3PXNsgS4PYsQpefWDoltIPhMXzDyNCOyRhM4M=; b=neZBqhwN9UBkvVJaLxuQhqzxtBy7XahsSO9TdTJgFXMv6h1w9DEMD2Bo N1pPLUHvxrLVFcOkavdIOirzylJKguKZHsyjaUUfMgMbP9rbog5RvdqeU KjbkzhunNS/2iVhC60EzZErVGA6bjDGfwzk+2zeRW3Xgy1amN3WernHKV +oZ80IC/uhkfLDOPN2Ff3EKVMVBV9nLqs2YxVCZcwqILOQK7sIpu5BRdJ bxqlda5Maugeyw5S4lWhnO3y/z3vBnqzciAgTurLZiAYd923wu5cKYmus egdto1f08fXdDAewfA3lK5KjkjO3HGzk/sOD5cH5t4dXqOHNG8aqxLscc g==; IronPort-SDR: VE93dWCaDorIRlxgzIK7g36cuop4R2YcKbdID3zovdACjfactC+NmmRIaRC3rQfynqYfr8mqP0 ImktDfuKqtDBYe04EKauSgZh+wYEu6KayFGKnB/Z1V0wtYwP6RQBo1+lILlPPTpOh4/IxKMX+g 7W1KiDs3pfbMooVEpyjvtbmm4PXoWd8SlAI6Fm2s0YVTdH8GxPedPzZkOaOnvnZQSV/yvVLucJ qJ3gjpo85F1yycj6pijKhYIIGCKCc8kfXdj8QUSc8oZLerwpX1XB9UU//lXyHt3qJEhhX6REJ3 d88= X-IronPort-AV: E=Sophos;i="5.63,472,1557158400"; d="scan'208";a="212495251" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 10 Jul 2019 06:39:43 +0800 IronPort-SDR: gA0zJ+TeTHHamdLffBYQszXNlv6adM1SdyHHbKocY8rt1QoES31u1gnqp8lC2Tf8eBmIOiuiMB xRiUc+6CieyRG164jWc2CIVGkRifG+J8JXRf0IQfE8wye/ONUFw/KmHhNGFWEwKtpZg9qjeXz1 ndNwUgNp/NgUkBCrv+BhLGU0wefst5F+Wi0D/2+r+xmkzXQteVrJWzax3LXJidAmlxZLxIrfU2 RFQur5kmQAgCR8/Nan8G3VyG1mlnbegJiBKkPEWAwwsV1kL5XwVg6yOnqvW+nXd8SVwGQDfDgD T9NX0O53mt8BfTStMJA150f1 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP; 09 Jul 2019 15:38:21 -0700 IronPort-SDR: OXkQKVFP+UeCTC6p3wpejpXzbShNnOqygiTHTO87wYMjsI01mERbknGrozLSEwm/2HdrwfN+4Z athQ95TeKNhO0Rwn+RuEFB9LpcTNPL+VCdjj/O9dyDChCY+pd8taIRqsTrvWcnWixDpdp8qRIi 4SHZMurzEpdPrYDe35zyb7DyR/deckbnPsRD7RKxtG+URsc9+KO6jXLQs8bHsWG1wcZMbpCHIz rFAERUqQLpgERtL+oAO6irUpPFzd7IATicVB0OEL9s83689s1IxHveR2l5sCVLcmDIwk/Oqqw8 13A= Received: from risc6-mainframe.sdcorp.global.sandisk.com (HELO risc6-mainframe.int.fusionio.com) ([10.196.157.140]) by uls-op-cesaip01.wdc.com with ESMTP; 09 Jul 2019 15:39:34 -0700 From: Alistair Francis To: buildroot@buildroot.org Date: Tue, 9 Jul 2019 15:36:49 -0700 Message-Id: <20190709223649.25630-2-alistair.francis@wdc.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190709223649.25630-1-alistair.francis@wdc.com> References: <20190709223649.25630-1-alistair.francis@wdc.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 2/2] boot/opensbi: Implement a choice for the OpenSBI Platform X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.corbin@embecosm.com, Alistair Francis Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Instead of requiring users to look at the OpenSBI source code and determine the platform string let's use a choice option to allow them to specify the platform they would like to target. We still allow them to specify a custom string if they want to. Signed-off-by: Alistair Francis --- boot/opensbi/Config.in | 25 ++++++++++++++++++++++--- boot/opensbi/opensbi.mk | 11 ++++++++++- configs/qemu_riscv32_virt_defconfig | 2 +- configs/qemu_riscv64_virt_defconfig | 2 +- 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/boot/opensbi/Config.in b/boot/opensbi/Config.in index 5f3cc13312..997c79f9b0 100644 --- a/boot/opensbi/Config.in +++ b/boot/opensbi/Config.in @@ -13,13 +13,32 @@ config BR2_TARGET_OPENSBI https://github.com/riscv/opensbi.git if BR2_TARGET_OPENSBI -config BR2_TARGET_OPENSBI_PLAT - string "OpenSBI Platform" - default "" + +choice + prompt "OpenSBI Platform" help Specifies the OpenSBI platform to build. If no platform is specified only the OpenSBI platform independent static library libsbi.a is built. If a platform is specified then the platform specific static library libplatsbi.a and firmware examples are built. + +config BR2_TARGET_OPENSBI_LIBRARY_ONLY + bool "Library Only" + +config BR2_TARGET_OPENSBI_QEMU_VIRT + bool "QEMU Virt" + +config BR2_TARGET_OPENSBI_QEMU_SIFIVE_U + bool "QEMU SiFive U" + +config BR2_TARGET_OPENSBI_CUSTOM_PLATFORM + bool "Custom Platform" + +endchoice + +config BR2_TARGET_OPENSBI_CUSTOM_PLATFORM_VALUE + string "OpenSBI Platform String" + depends on BR2_TARGET_OPENSBI_CUSTOM_PLATFORM + endif diff --git a/boot/opensbi/opensbi.mk b/boot/opensbi/opensbi.mk index 83552a5442..78da22aa1f 100644 --- a/boot/opensbi/opensbi.mk +++ b/boot/opensbi/opensbi.mk @@ -14,7 +14,16 @@ OPENSBI_INSTALL_STAGING = YES OPENSBI_MAKE_ENV = \ CROSS_COMPILE=$(TARGET_CROSS) -OPENSBI_PLAT = $(call qstrip,$(BR2_TARGET_OPENSBI_PLAT)) +ifeq ($(BR2_TARGET_OPENSBI_QEMU_VIRT),y) +OPENSBI_PLAT = qemu/virt +else ifeq ($(BR2_TARGET_OPENSBI_QEMU_SIFIVE_U),y) +OPENSBI_PLAT = qemu/sifive_u +else ifeq ($(BR2_TARGET_OPENSBI_SIFIVE_FU540),y) +OPENSBI_PLAT = sifive/fu540 +else ifeq ($(BR2_TARGET_OPENSBI_CUSTOM_PLATFORM),y) +OPENSBI_PLAT = $(call qstrip,$(BR2_TARGET_OPENSBI_CUSTOM_PLATFORM_VALUE)) +endif + ifneq ($(OPENSBI_PLAT),) OPENSBI_MAKE_ENV += PLATFORM=$(OPENSBI_PLAT) endif diff --git a/configs/qemu_riscv32_virt_defconfig b/configs/qemu_riscv32_virt_defconfig index a1a8c5fd20..ebe3e72135 100644 --- a/configs/qemu_riscv32_virt_defconfig +++ b/configs/qemu_riscv32_virt_defconfig @@ -24,4 +24,4 @@ BR2_LINUX_KERNEL_IMAGE=y # Bootloader BR2_TARGET_OPENSBI=y BR2_TARGET_OPENSBI_USE_PLAT=y -BR2_TARGET_OPENSBI_PLAT="qemu/virt" +BR2_TARGET_OPENSBI_QEMU_VIRT=y diff --git a/configs/qemu_riscv64_virt_defconfig b/configs/qemu_riscv64_virt_defconfig index c0b1a43925..16e0e332f7 100644 --- a/configs/qemu_riscv64_virt_defconfig +++ b/configs/qemu_riscv64_virt_defconfig @@ -23,4 +23,4 @@ BR2_LINUX_KERNEL_IMAGE=y # Bootloader BR2_TARGET_OPENSBI=y BR2_TARGET_OPENSBI_USE_PLAT=y -BR2_TARGET_OPENSBI_PLAT="qemu/virt" +BR2_TARGET_OPENSBI_QEMU_VIRT=y