From patchwork Fri Mar 15 23:06:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 1057274 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="U8wuakNM"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="KbRcHWJx"; 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 44Lh6N1JHBz9s7h for ; Sat, 16 Mar 2019 10:06:52 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 76B5586C3E; Fri, 15 Mar 2019 23:06:47 +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 sh--VBHwrCin; Fri, 15 Mar 2019 23:06:45 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7411686D04; Fri, 15 Mar 2019 23:06:44 +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 0111B1BF380 for ; Fri, 15 Mar 2019 23:06:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id F2A9E2077C for ; Fri, 15 Mar 2019 23:06:42 +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 AjTmgIs8xHZp for ; Fri, 15 Mar 2019 23:06:41 +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 CF9CD207A9 for ; Fri, 15 Mar 2019 23:06:41 +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=1552691202; x=1584227202; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=NeQ8Jts+JicnVoiPEVSUy+AvNbbMzZZRsr0nSJ39T+k=; b=U8wuakNMEemwrMkMdI8NTb9c3LRMdzS7IpMPGVYmdXDfKbK/u82fdsEu u7cVsHmIYD0oIYBNe+45q906j7gl4xJGUAYKIGQbDkIz81Yf0rmVF4yTn q+YA6/J2zii1mFszb9AXokMF3OHylsAumWAmgLUwlNBkVo+t/N9McYAu8 NmGUjaelW59PMAO6DgavRligKgSjZL8F4tqiPQAuBnvYJp9H8CMRoun83 iCFYyr7ZgLFECm1FskGIChp6pKp3NUT4U+vv1Cxytwk+nvusYbTAfN3mJ vQC7AgaRTKZQRAUPykEcHKwml4RY9V+0UzuVr1RmWB4jme/gzjbF4xIg0 Q==; X-IronPort-AV: E=Sophos;i="5.58,483,1544457600"; d="scan'208";a="104892219" Received: from mail-bn3nam01lp2055.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) ([104.47.33.55]) by ob1.hgst.iphmx.com with ESMTP; 16 Mar 2019 07:06:40 +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=0xUc7XJs+yNBu+6TneM9zxygbs0nJ48m5uj7JnJnJpc=; b=KbRcHWJx7pl7GLJCExd6HZAe/llEQUPUTMrzWBpg1GoRdKLEL6YO9R+ffm4/M7rKK+3y8/ESgc6E/UbcYqiaBFL6ck56zstPiAe9woWTugNLJ2H9+KCiF04ttMyLqM++eCZlM7535nJL4ITqrFHkM4WZ8cBqnT9kvGKOoZKvRCA= Received: from BYAPR04MB4901.namprd04.prod.outlook.com (52.135.232.206) by BYAPR04MB5960.namprd04.prod.outlook.com (20.178.232.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.13; Fri, 15 Mar 2019 23:06:38 +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.011; Fri, 15 Mar 2019 23:06:38 +0000 From: Alistair Francis To: "mark.corbin@embecosm.com" , "buildroot@buildroot.org" Thread-Topic: [PATCH 2/3] boot: riscv: Initial commit of OpenSBI Thread-Index: AQHU24O+kjVFHtc1LUKWLLcQ3L1kAQ== Date: Fri, 15 Mar 2019 23:06:38 +0000 Message-ID: <20190315230540.4311-2-alistair.francis@wdc.com> References: <20190315230540.4311-1-alistair.francis@wdc.com> In-Reply-To: <20190315230540.4311-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: BYAPR02CA0045.namprd02.prod.outlook.com (2603:10b6:a03:54::22) 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: 8b6597b4-8e53-4b50-0ddf-08d6a99ae0fc 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:BYAPR04MB5960; x-ms-traffictypediagnostic: BYAPR04MB5960: x-ms-exchange-purlcount: 1 wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-forefront-prvs: 09778E995A x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(366004)(376002)(39860400002)(136003)(346002)(189003)(199004)(966005)(71190400001)(52116002)(72206003)(7736002)(5660300002)(478600001)(36756003)(99286004)(14454004)(6116002)(106356001)(1076003)(105586002)(76176011)(86362001)(6436002)(2906002)(316002)(50226002)(54906003)(386003)(110136005)(6306002)(53936002)(3846002)(6512007)(6486002)(25786009)(68736007)(71200400001)(6506007)(8676002)(26005)(4326008)(476003)(2616005)(11346002)(81156014)(81166006)(305945005)(8936002)(446003)(186003)(256004)(486006)(44832011)(102836004)(2501003)(66066001)(97736004); DIR:OUT; SFP:1102; SCL:1; SRVR:BYAPR04MB5960; 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: 1FSGKeuDjRvKN1VEqIc1ji/2VQ/mHWTnXzjdfV7ctXhhVUxHhpH46MxSkNQav49WV7gkIyoEFyxIULsQPgxt1Qfl4PeKjTYbV5JAwJZFgrI2OJfZaREkUYKTqGeujbSugmGng2wHuZtUTEL7g2ybvK5CM6d+PuWteAX8pwaxDupHS8KjMi0n3asWmtnCm92r92TsSNApxfWnyHYBsmz+ODo/p8fjkN8Gu7YEEseIyuTZwjRcQbmQSUUbaWMGRMWm0cArJUpe/fc1bKr0+RgeY3upYdaym7kuCplRll48dDIWUnZLqYwxXmjnU1XUPNALnbD/2oMAnwXLrsjgEpdqNgFStOKM7rhGeAdZrqKl9KBMSBNvVWWL+O97Efue8AFP7aUB3dRQEe3dDDi9fj79trqomt2UourDQYLvWZFYKN8= MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8b6597b4-8e53-4b50-0ddf-08d6a99ae0fc X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Mar 2019 23:06:38.6768 (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: BYAPR04MB5960 Subject: [Buildroot] [PATCH 2/3] boot: riscv: Initial commit of OpenSBI 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 BLL (riscv-pk). Add OpenSBI support to buildroot. OpenSBI support uses the new RISC-V "Target Platform" config to build the specified platform. 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 8a57cb2e23..a8978856ad 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1383,6 +1383,7 @@ F: arch/arch.mk.riscv F: arch/Config.in.riscv F: board/qemu/riscv32-virt/ F: board/qemu/riscv64-virt/ +F: boot/opensbi/ F: boot/riscv-pk/ F: configs/qemu_riscv32_virt_defconfig F: configs/qemu_riscv64_virt_defconfig 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..01ee342215 --- /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_USE_PLAT + bool "Build OpenSBI for Platform" + depends on BR2_TARGET_OPENSBI + +config BR2_TARGET_OPENSBI_PLAT + string "OpenSBI Platform" + depends on BR2_TARGET_OPENSBI_USE_PLAT + default "qemu/virt" if BR2_RISCV_QEMU_VIRT + default "qemu/sifive_u" if BR2_RISCV_QEMU_SIFIVE_U + default "" +endif diff --git a/boot/opensbi/opensbi.mk b/boot/opensbi/opensbi.mk new file mode 100644 index 0000000000..9da4e7f44e --- /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) + +ifeq ($(BR2_TARGET_OPENSBI_USE_PLAT),y) + OPENSBI_PLAT = $(call qstrip,$(BR2_TARGET_UBOOT_BOARD_DEFCONFIG)) + OPENSBI_MAKE_ENV += PLATFORM=$(OPENSBI_PLAT) +endif + +define OPENSBI_BUILD_CMDS + $(TARGET_MAKE_ENV) $(OPENSBI_MAKE_ENV) $(MAKE) -C $(@D) +endef + +ifeq ($(BR2_TARGET_OPENSBI_USE_PLAT),y) +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))