From patchwork Wed Mar 20 23:05:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 1059600 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="mWTSsXJH"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="mM+mh+bC"; 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 44PlrW1MqXz9sR4 for ; Thu, 21 Mar 2019 10:05:31 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 1C6BF85E03; Wed, 20 Mar 2019 23:05:29 +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 UjqHY7AeZQdB; Wed, 20 Mar 2019 23:05:28 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 20BAB85C5C; Wed, 20 Mar 2019 23:05:28 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 5FF0F1BF40F for ; Wed, 20 Mar 2019 23:05:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 5BCB0853B9 for ; Wed, 20 Mar 2019 23:05:25 +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 jSi4TEdDIHya for ; Wed, 20 Mar 2019 23:05:24 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by whitealder.osuosl.org (Postfix) with ESMTPS id 8B948857A4 for ; Wed, 20 Mar 2019 23:05:24 +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=1553123124; x=1584659124; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=n1Qb+1PNL7pntW+p1kxnSDcxND7YsF1sKPMRfydAS3M=; b=mWTSsXJHls5R8vEQQh4vAFeHxG9c/OznOh1dh5MTZWciGJnzN13X9HKQ pr0VwPexNT7mm6vgRdZvMf2/asnatw8mS9b10JJUcmH8ahdQeL9H2lcup 5EQbguWI6V9ul59TthORRmK/46K+XYe3jwICCaEydKGdQeVdI/wWvqWtn m5Rhe7wNewjJ9bwAxN9WZug+5K+Zr5pXmAUWge8Pzx1cDxXYHElV114uK mO9lZRqwcM+RiXlAesbDyUgnPvPLKc41IU3gKEsI8XUzdhVQJhC3HMxuy YXrVPVw3xDXnNkhSti7Lfia/BxdH/NHPu/h2xAUYkNDrNA+qKzL/n07qW Q==; X-IronPort-AV: E=Sophos;i="5.60,250,1549900800"; d="scan'208";a="105615341" Received: from mail-bn3nam04lp2059.outbound.protection.outlook.com (HELO NAM04-BN3-obe.outbound.protection.outlook.com) ([104.47.46.59]) by ob1.hgst.iphmx.com with ESMTP; 21 Mar 2019 07:05:23 +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=ybY5yj/0KMBQcTJHGZKelEzcZ5FnmVFtMvNloYz2Ygk=; b=mM+mh+bCRn/D3EHc0ESGsfaQ0SC2yunci99k7DU0Cl2hLKWTEYHN/KHUjv/LJSg05XLjFy697Z8s8vDCOm378I68i2GsZvwTRPfshEb9ueLjBrKu5b9K5SeXwkiSInt9P6wQpy/78B6Z6UB06xWa48AlLnGtZ5Np+cvbwe7QV5Y= Received: from BYAPR04MB4901.namprd04.prod.outlook.com (52.135.232.206) by BYAPR04MB4951.namprd04.prod.outlook.com (52.135.232.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.15; Wed, 20 Mar 2019 23:05:22 +0000 Received: from BYAPR04MB4901.namprd04.prod.outlook.com ([fe80::44e8:bd21:17b:348c]) by BYAPR04MB4901.namprd04.prod.outlook.com ([fe80::44e8:bd21:17b:348c%4]) with mapi id 15.20.1730.013; Wed, 20 Mar 2019 23:05:22 +0000 From: Alistair Francis To: "mark.corbin@embecosm.com" , "buildroot@buildroot.org" Thread-Topic: [PATCH v6 3/5] boot/opensbi: new package Thread-Index: AQHU33FkIdhGJEf+F0ilksgvNN0AbQ== Date: Wed, 20 Mar 2019 23:05:21 +0000 Message-ID: <20190320230422.13592-3-alistair.francis@wdc.com> References: <20190320230422.13592-1-alistair.francis@wdc.com> In-Reply-To: <20190320230422.13592-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: BYAPR07CA0057.namprd07.prod.outlook.com (2603:10b6:a03:60::34) 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.44.250] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d1bc844e-b464-443b-7b16-08d6ad888721 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:BYAPR04MB4951; x-ms-traffictypediagnostic: BYAPR04MB4951: x-ms-exchange-purlcount: 1 wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-forefront-prvs: 098291215C x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(136003)(346002)(366004)(396003)(39860400002)(189003)(199004)(6506007)(76176011)(386003)(50226002)(68736007)(106356001)(11346002)(476003)(53936002)(2616005)(45080400002)(6486002)(8936002)(446003)(6436002)(6512007)(4326008)(6306002)(97736004)(52116002)(99286004)(14454004)(105586002)(3846002)(6116002)(66066001)(7736002)(256004)(102836004)(5660300002)(110136005)(2501003)(26005)(25786009)(305945005)(54906003)(36756003)(1076003)(71190400001)(72206003)(44832011)(2906002)(966005)(478600001)(71200400001)(486006)(81156014)(81166006)(316002)(186003)(86362001)(8676002); DIR:OUT; SFP:1102; SCL:1; SRVR:BYAPR04MB4951; 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: OM7ouLgRbcWx1KyY/KWdPQrF4jLImav2DFR86RDJ7a6j1AnyHKQnd1n8x0EncZkIVIl2lb+ePqe0TIW3zGN6Vco+mZQW3WV2AIwvBv59x9v2f9lxqostrIoN9TE3OVllpWuZZI9Nm6taZfO6Uxj0eAFDjLceFC9HSNhaD68+v+0QZTyNsYee5xJNBH4f/YbNSp9x5gbM4Qlk2/+0VG+IAeh3zTMPnO5pjuWh6XEIV/fo6toZ4bPYIwD1R7rlZ662EFsYxoO5NABnkNsPPlMMKNDbvNYmaEpAp3yuI+yYndWlhBvS6bk3Vror/hV3kTHQGjIkqzjMH/UV4Eo3pkLnCwDC46vgUtdcSXRwmBJorWj1Qcd8elfx8moW2HbRuRz+v4BARz2I+URLZxAt1IjClUseVZe4QeXo6GweBScEQS0= MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: d1bc844e-b464-443b-7b16-08d6ad888721 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Mar 2019 23:05:21.5601 (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: BYAPR04MB4951 Subject: [Buildroot] [PATCH v6 3/5] boot/opensbi: new package 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 | 37 +++++++++++++++++++++++++++++++++++++ 4 files changed, 64 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..ba4ff06c28 --- /dev/null +++ b/boot/opensbi/opensbi.mk @@ -0,0 +1,37 @@ +################################################################################ +# +# opensbi +# +################################################################################ + +OPENSBI_VERSION = v0.3 +OPENSBI_SITE = $(call github,riscv,opensbi,$(OPENSBI_VERSION)) +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 + +# Install libsbi.a in the host lib dir so it can be linked in the future. +define OPENSBI_INSTALL_STAGING_CMDS + $(INSTALL) -m 0644 -D $(@D)/build/lib/libsbi.a $(STAGING_DIR)/usr/share/opensbi/libsbi.a +endef + +$(eval $(generic-package))