From patchwork Tue Jul 9 20:04:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 1129995 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.136; helo=silver.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="SuFIth6j"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45jtdj3nfBz9sBt for ; Wed, 10 Jul 2019 06:07:20 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id E3EB621F65; Tue, 9 Jul 2019 20:07:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7s-iGitr0loM; Tue, 9 Jul 2019 20:07:08 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 3C2E621F5A; Tue, 9 Jul 2019 20:07:08 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 1FA691BF369 for ; Tue, 9 Jul 2019 20:07:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 1AD612026D for ; Tue, 9 Jul 2019 20:07:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4THtZAL25oCD for ; Tue, 9 Jul 2019 20:07:04 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by silver.osuosl.org (Postfix) with ESMTPS id B351D204B4 for ; Tue, 9 Jul 2019 20:07:04 +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=1562702825; x=1594238825; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rG6gcoB8o2/jKBnUqzaO0WZFn6mNpP+P+asixNO78oo=; b=SuFIth6jbhjBn54/TcXUQG3GX8QpSRxOZ6JSEXjwOSFnFYKLvVyJCIpf djvK05+6y84eYpgOm1+8D4bZVVhoB2DP/AxjNT2Hjov2UKqVnsf6OuN+e LYECD43lvm5aRE/q7Ylsy4Gekd082BMzuLX/JHpTbEG81UKgGhsLuvxDS +u0THyYXrkJ1YAYrf+s/G0UvhvxxdZWpx/bWzbnXD7v3+JPyALSlDHDNG oDlfFZ1+NyoYLorHufyWUlzcnBN7YcndCOBuVm+zHE1/zijCtPpnJ6LdX GoRzHVa6TSMdJccnpkMV37HWq142HWK5G441tNtltSoiVpqiwTWokr1/9 Q==; IronPort-SDR: 5OOMxsVsiEqJMDoyAunfs4YO63Uf5eXZN3id7k2AitCnaGcifwXRGvck9t4wuvWLOyAzgCbBBj BYTSZzdY3blW7PKY5qG519x/qqATSD0utckuYY8Ikmhe7xW8xNNuYfspce1NaNLrNESs09zl2P 7Kf752nQlUST2M31LMO1BoIxZUhKQnDsKOf0FmLQwUh2pa/9JBH3jIwmS6bPGzmgyhzifW7IQu yBG8jiNBfdRAlilGwLVp2hzKnlCSwbsvAs4aqe5loQmjvDk8oUjWPYPah9EYso8O1bPCIBK00x QKg= X-IronPort-AV: E=Sophos;i="5.63,471,1557158400"; d="scan'208";a="113752914" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 10 Jul 2019 04:07:02 +0800 IronPort-SDR: zCSeE2rmCYsf+7KU9TpW3r/6peye6TOVSHbs7BMKO/4uDwsHB+Pp0xOgsvkDdO30bIXEMEq+T1 v5OGvh00VmhcWzpQTArohtNpqz6GYbEYnJ0Z64+UIxOIzxjs36Bf0bKq1licOOfJaNeLfWwQAB 8PKxsIKiKPAPy/lgPRFJWheZMOr/ccGUeV3PZf6/1DAeKd6LvfdqgPy/w0iiJ/1QqrC3zf5uwr IjtvjXf7mInlJfx6xUI9MrJEPLN8nO8ZaUk1Qk0IOmwC2Qxe0p7U56iM7pGx/gcWGpERS8za9V OhU7W0F4K6MQF4a3C+o9S2We Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP; 09 Jul 2019 13:05:49 -0700 IronPort-SDR: XIf5O9EikNsaloDLEhNtpyl8MONbXr/fE1E9ebk6pvUv/HM7+nQVNGQaLyEi4S7gDuhlh88K25 vSYBQF7bMtWB78taSBh3gi4dI4xIOqzqmDnRDhivEnJ+s2BSq4K5nxKjO4WkEiktqfE8SSWm29 FvYKzZiY+TrVZ8eVumtsNS4mxfo+q8unOHHFWrI7XniPG7kZzoIXhQd3Ulr0VD0U3Z92c8uhWs IpX7NaBvbupaESX801vUAJlxUYvZo6l/XbY1MYKqeiHf2atqsca87WUvYBrjzIR3IjFHaJlvl0 UyY= 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 13:07:02 -0700 From: Alistair Francis To: buildroot@buildroot.org Date: Tue, 9 Jul 2019 13:04:17 -0700 Message-Id: <20190709200417.8120-2-alistair.francis@wdc.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190709200417.8120-1-alistair.francis@wdc.com> References: <20190709200417.8120-1-alistair.francis@wdc.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 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 0008155dea..bf00bdf618 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_LIBRARY_ONLY),y) +OPENSBI_PLAT = "" +else 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_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