From patchwork Mon Mar 18 22:44:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 1058128 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.138; helo=whitealder.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="E8tYWJ9b"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="cA1KsPEP"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44NWSy3pdyz9s70 for ; Tue, 19 Mar 2019 09:44:17 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 496F787221; Mon, 18 Mar 2019 22:44:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FeXZmzNmmXEo; Mon, 18 Mar 2019 22:44:12 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 9B11686E3F; Mon, 18 Mar 2019 22:44:12 +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 9728E1BF287 for ; Mon, 18 Mar 2019 22:44:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 94159261B1 for ; Mon, 18 Mar 2019 22:44:10 +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 vq1wuWi78-iY for ; Mon, 18 Mar 2019 22:44:09 +0000 (UTC) X-Greylist: from 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 A62D825F62 for ; Mon, 18 Mar 2019 22:44:09 +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=1552949050; x=1584485050; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=mp/iKIjBN0rAFcpYaMAdLydm+oJcQTvaUlPoXuWt2oQ=; b=E8tYWJ9bfOuk7zMwMsArbiA7pfhyYliPKD7PJssVp6Rg+On9VLT+etoZ SFONf87HG4lruMxM17PaNRN7I+R3KNlK6lcrGfpAuhTPdssJlfk8dQ4Iw alYaWpYZ/mWS3iqdlA2qNBmLsPtF0qZ4BfzLBWTD/FTp6xO+I8ZZNre42 pEIeT7mHapMV2NKFZmyQnzM9R2w9halRrE6FXKacac/OlurRLAyFnzPXH cLATOqfrRFMSNyQJkC7ttDU44PpuKYhzZ0AVI9k/FQXAGtyC0h0rXXJcz LoMytC2iZMgJbFiU8bfoyYbyamYllbavU7aHryuOncjv7GgbIJtEnyPOq A==; X-IronPort-AV: E=Sophos;i="5.58,495,1544457600"; d="scan'208";a="105039375" Received: from mail-sn1nam02lp2053.outbound.protection.outlook.com (HELO NAM02-SN1-obe.outbound.protection.outlook.com) ([104.47.36.53]) by ob1.hgst.iphmx.com with ESMTP; 19 Mar 2019 06:44:10 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QapYkX2fXpb+v5/WDbpfcE9+6Qd4spFbJAL6kV/Ay6A=; b=cA1KsPEPq0elJfIgYM/Ai2u6wN3K+XzoHrZCEddZsSwjPBe/eaVZ+MX3jNVtS4IZR0HoMvF+GolZmDezQ8q/ylsRGTxYznGlximttRknHta5JIDNk5Sn90jlEiJ7wSG0Rncz4rfnfKnBelDOyq/oIHHmYnHrP5aAwlLmSgT3ovI= Received: from BYAPR04MB4901.namprd04.prod.outlook.com (52.135.232.206) by BYAPR04MB5879.namprd04.prod.outlook.com (20.179.59.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.13; Mon, 18 Mar 2019 22:44:08 +0000 Received: from BYAPR04MB4901.namprd04.prod.outlook.com ([fe80::1c45:32d7:98ed:4cd7]) by BYAPR04MB4901.namprd04.prod.outlook.com ([fe80::1c45:32d7:98ed:4cd7%6]) with mapi id 15.20.1709.015; Mon, 18 Mar 2019 22:44:08 +0000 From: Alistair Francis To: "mark.corbin@embecosm.com" , "buildroot@buildroot.org" Thread-Topic: [PATCH v3 2/3] boot/opensbi: Initial commit of OpenSBI for RISC-V Thread-Index: AQHU3dwYhZG0k1x0t0CiFubdrFvX4A== Date: Mon, 18 Mar 2019 22:44:07 +0000 Message-ID: <20190318224309.11805-2-alistair.francis@wdc.com> References: <20190318224309.11805-1-alistair.francis@wdc.com> In-Reply-To: <20190318224309.11805-1-alistair.francis@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.21.0 x-clientproxiedby: BYAPR07CA0027.namprd07.prod.outlook.com (2603:10b6:a02:bc::40) To BYAPR04MB4901.namprd04.prod.outlook.com (2603:10b6:a03:4f::14) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alistair.Francis@wdc.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [199.255.45.64] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9f2340cc-b5dc-46e6-18cd-08d6abf33b18 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:BYAPR04MB5879; x-ms-traffictypediagnostic: BYAPR04MB5879: x-ms-exchange-purlcount: 1 wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-forefront-prvs: 098076C36C x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(376002)(366004)(136003)(346002)(39860400002)(189003)(199004)(6506007)(71190400001)(71200400001)(476003)(99286004)(2906002)(102836004)(8936002)(316002)(50226002)(54906003)(52116002)(3846002)(68736007)(6116002)(486006)(76176011)(66066001)(44832011)(386003)(110136005)(105586002)(305945005)(6436002)(81156014)(81166006)(1076003)(7736002)(6486002)(8676002)(256004)(4326008)(11346002)(186003)(966005)(478600001)(72206003)(2616005)(446003)(5660300002)(26005)(53936002)(97736004)(25786009)(6512007)(36756003)(6306002)(106356001)(2501003)(86362001)(14454004); DIR:OUT; SFP:1102; SCL:1; SRVR:BYAPR04MB5879; H:BYAPR04MB4901.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: AOqs1Y/G/jzkRXdHJOxMF3wzMkH46z0GoIX+IjlIxjtENq219D56POgBpfC7QVW7/ckLDsCCkdXho40xVCN3yrXo8Lp2RmCeWwbqE9vWXEW51vXioQEKa0WK7CeqNrN7ZJn4WTLm3RngmTvB5i6eJPADboIFJ1NPCMKmLOB/+nrkZe9MjytF0ER5UhMdO7T0FXlaYWwHXPz4abZK5vEsJxh9QFhsx0q3nXQTxFO1QOXSHjH292lekCudaBvBf5wCJwlk6Req3T3Lkba53zW14v2W2hke6FN0oNUgf0oNx9ovneVooaqose+H01lTE3ICuVoO5JsHbo5WMrM0ZhVNrpEOBmn8CGm7aTcqzD1UaguV2jCjQjOgcenBHdFg/hQh80p4xLk9WvEFZBrPbdud6SIufoJJjsZdJIo4pu7taI8= MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9f2340cc-b5dc-46e6-18cd-08d6abf33b18 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Mar 2019 22:44:07.8442 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR04MB5879 Subject: [Buildroot] [PATCH v3 2/3] boot/opensbi: Initial commit of OpenSBI for RISC-V 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: Atish Patra , Alistair Francis , "alistair23@gmail.com" Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" OpenSBI is a much improved alternative to BBL (riscv-pk). Add OpenSBI support to buildroot. Signed-off-by: Alistair Francis --- DEVELOPERS | 1 + boot/Config.in | 1 + boot/opensbi/Config.in | 25 +++++++++++++++++++++++++ boot/opensbi/opensbi.mk | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+) create mode 100644 boot/opensbi/Config.in create mode 100644 boot/opensbi/opensbi.mk diff --git a/DEVELOPERS b/DEVELOPERS index 3e0ac08e11..91eda42949 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -122,6 +122,7 @@ F: package/kvazaar/ F: package/v4l2loopback/ N: Alistair Francis +F: boot/opensbi/ F: package/xen/ N: Alvaro G. M diff --git a/boot/Config.in b/boot/Config.in index 74481e7545..97bd3de6e9 100644 --- a/boot/Config.in +++ b/boot/Config.in @@ -14,6 +14,7 @@ source "boot/lpc32xxcdl/Config.in" source "boot/mv-ddr-marvell/Config.in" source "boot/mxs-bootlets/Config.in" source "boot/optee-os/Config.in" +source "boot/opensbi/Config.in" source "boot/riscv-pk/Config.in" source "boot/s500-bootloader/Config.in" source "boot/shim/Config.in" diff --git a/boot/opensbi/Config.in b/boot/opensbi/Config.in new file mode 100644 index 0000000000..5f3cc13312 --- /dev/null +++ b/boot/opensbi/Config.in @@ -0,0 +1,25 @@ +config BR2_TARGET_OPENSBI + bool "opensbi" + depends on BR2_riscv + help + OpenSBI aims to provide an open-source and extensible + implementation of the RISC-V SBI specification for a platform + specific firmware (M-mode) and a general purpose OS, + hypervisor or bootloader (S-mode or HS-mode). OpenSBI + implementation can be easily extended by RISC-V platform or + System-on-Chip vendors to fit a particular hadware + configuration. + + https://github.com/riscv/opensbi.git + +if BR2_TARGET_OPENSBI +config BR2_TARGET_OPENSBI_PLAT + string "OpenSBI Platform" + default "" + 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. +endif diff --git a/boot/opensbi/opensbi.mk b/boot/opensbi/opensbi.mk new file mode 100644 index 0000000000..87e4b5c455 --- /dev/null +++ b/boot/opensbi/opensbi.mk @@ -0,0 +1,32 @@ +################################################################################ +# +# OpenSBI +# +################################################################################ + +OPENSBI_VERSION = ca20ac0cd4c099006d4eea4d9ac7bd7b58e2ae0f +OPENSBI_SITE = git://github.com/riscv/opensbi.git +OPENSBI_LICENSE = BSD-2-Clause +OPENSBI_LICENSE_FILES = COPYING.BSD +OPENSBI_INSTALL_IMAGES = YES + +OPENSBI_MAKE_ENV = \ + CROSS_COMPILE=$(TARGET_CROSS) + +OPENSBI_PLAT = $(call qstrip,$(BR2_TARGET_OPENSBI_PLAT)) +ifneq ($(OPENSBI_PLAT),) +OPENSBI_MAKE_ENV += PLATFORM=$(OPENSBI_PLAT) +endif + +define OPENSBI_BUILD_CMDS + $(TARGET_MAKE_ENV) $(OPENSBI_MAKE_ENV) $(MAKE) -C $(@D) +endef + +ifneq ($(OPENSBI_PLAT),) +define OPENSBI_INSTALL_IMAGES_CMDS + $(INSTALL) -m 0644 -D $(@D)/build/platform/$(OPENSBI_PLAT)/firmware/fw_jump.bin $(BINARIES_DIR)/fw_jump.bin + $(INSTALL) -m 0644 -D $(@D)/build/platform/$(OPENSBI_PLAT)/firmware/fw_jump.elf $(BINARIES_DIR)/fw_jump.elf +endef +endif + +$(eval $(generic-package))