From patchwork Tue Jun 18 23:02: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: 1118382 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="mXWEYayA"; 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 45T3l66Z5Dz9s4Y for ; Wed, 19 Jun 2019 09:12:34 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E2C7785B4D; Tue, 18 Jun 2019 23:12:31 +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 Ptqw20miJRda; Tue, 18 Jun 2019 23:12:29 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id D537485A7D; Tue, 18 Jun 2019 23:12:29 +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 0EF771BF2CA for ; Tue, 18 Jun 2019 23:12:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0A7DB86614 for ; Tue, 18 Jun 2019 23:12:29 +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 BqInvAfyLQnA for ; Tue, 18 Jun 2019 23:12:28 +0000 (UTC) X-Greylist: delayed 00:07:05 by SQLgrey-1.7.6 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by whitealder.osuosl.org (Postfix) with ESMTPS id 2BEDF865D6 for ; Tue, 18 Jun 2019 23:12:27 +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=1560899548; x=1592435548; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=XbUmBpnW2DmkPq9Tzp24fTwWyis4Oh7qZLIETuuvhd4=; b=mXWEYayA803cwFr7i3TGzn2ZGf923/mAW1ObBfof+T2a9pmPpGhRZQjM R8XlEEnN1riKtEeL8k2H8cVofUpRuk4Vdfj13NftnrinpuoktgUzf0t/g prKcyPi7SkyynSTK/tgbfJOdB674oucnJc+QQ1kimfUcKQ2XH3ZrBWpg1 GsK9dRoUo76pJAIlNENJZr06XDGnOzLfU6IguGZ196b2f+HGt3bPoIlA+ EtNQoEk397OafSWy1hFtw85YdLkT1CoKd1oB6HLjZ3n/HQfVioeMHUCq7 s/WeZrlzcc+3pM6GEvh7LHX4reoAxXK7Q46JDpg4CQ1pf5tnLLca6BBGz w==; X-IronPort-AV: E=Sophos;i="5.63,390,1557158400"; d="scan'208";a="110896463" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 19 Jun 2019 07:05:22 +0800 IronPort-SDR: VES5n/DMl9Yg9yg1cO6pxHczPkGWvNy9ppTP2xhsf29ZvWhWprMRr4ktkeCObYdUwlJey8uWqJ kiqFDjhgtwPlq9uOmv3Qm11pt+0Mh3YFYHUMeZ36ikFvOu6DBmjAWrR59/5q/R0Ne5SogGVHNI NPM+6yDx1FoDeuNcMfsKCLB3HLmvONCqYQGf3J2gp+ZFwGvjWgvQzW6dRi2psejv6XK/8UrxGU EPRYmFDSMkpbQvi0akeiJu4dRw4lCCRqXVl12QvqiSLTt4iZVri6uJ36Z8mSJBqKND8f1NFALh kLHdRHECh4e1TchEeCcNfMd6 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 18 Jun 2019 16:04:50 -0700 IronPort-SDR: ARmfKGEg8suLraPsY+tp24D+HToXxesOlValop9DCSkc3ZDOnWRDLJqhu3SXxS87aNabUu9jB8 1hIo7r/JYs//3F3jHWxlqXn82a3TormwhzhBVAG42HcECjyLKCW1vDHQmmBjzxxq+QQtUGrSYL K8k07TAG+s7+JRRIbHsl+4hj6xlJpFW1X8OnmIAETI2ddE6Qqn1dpgMtxmOZWPnnYPcuWEkSJV YL+ZqRu2ho6Twtd27raEuMJpio37UbepVWYYv65tlhTGZLAUeRkTDxECM4ePiMHVevxaNXC7pC iUE= Received: from risc6-mainframe.sdcorp.global.sandisk.com (HELO risc6-mainframe.int.fusionio.com) ([10.196.157.140]) by uls-op-cesaip02.wdc.com with ESMTP; 18 Jun 2019 16:05:22 -0700 From: Alistair Francis To: buildroot@buildroot.org Date: Tue, 18 Jun 2019 16:02:49 -0700 Message-Id: <20190618230250.12539-1-alistair.francis@wdc.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/2] boot/opensbi: Add support for including Linux payload 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: alistair23@gmail.com, Alistair Francis Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Alistair Francis --- boot/opensbi/Config.in | 9 +++++++++ boot/opensbi/opensbi.mk | 22 +++++++++++++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/boot/opensbi/Config.in b/boot/opensbi/Config.in index 5f3cc13312..5cb8aace3e 100644 --- a/boot/opensbi/Config.in +++ b/boot/opensbi/Config.in @@ -22,4 +22,13 @@ config BR2_TARGET_OPENSBI_PLAT library libsbi.a is built. If a platform is specified then the platform specific static library libplatsbi.a and firmware examples are built. + +if BR2_TARGET_OPENSBI_PLAT != "" +config BR2_TARGET_OPENSBI_LINUX_PAYLOAD + bool "Include Linux as OpenSBI Payload" + depends on BR2_LINUX_KERNEL + depends on BR2_LINUX_KERNEL_IMAGE + help + Build OpenSBI with the Linux kernel as a Payload. +endif endif diff --git a/boot/opensbi/opensbi.mk b/boot/opensbi/opensbi.mk index b0b413abf9..e34dd69739 100644 --- a/boot/opensbi/opensbi.mk +++ b/boot/opensbi/opensbi.mk @@ -19,18 +19,34 @@ ifneq ($(OPENSBI_PLAT),) OPENSBI_MAKE_ENV += PLATFORM=$(OPENSBI_PLAT) endif +OPENSBI_LINUX_PAYLOAD = $(call qstrip,$(BR2_TARGET_OPENSBI_LINUX_PAYLOAD)) +ifeq ($(OPENSBI_LINUX_PAYLOAD), y) +OPENSBI_DEPENDENCIES = linux +OPENSBI_MAKE_ENV += FW_PAYLOAD_PATH="$(BINARIES_DIR)/Image" +endif + define OPENSBI_BUILD_CMDS $(TARGET_MAKE_ENV) $(OPENSBI_MAKE_ENV) $(MAKE) -C $(@D) endef ifneq ($(OPENSBI_PLAT),) OPENSBI_INSTALL_IMAGES = YES -define OPENSBI_INSTALL_IMAGES_CMDS - $(INSTALL) -m 0644 -D $(@D)/build/platform/$(OPENSBI_PLAT)/firmware/fw_jump.bin $(BINARIES_DIR)/fw_jump.bin +OPENSBI_INSTALL_IMAGES_CMDS_PLAT = \ + $(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 +ifeq ($(OPENSBI_LINUX_PAYLOAD), y) +OPENSBI_INSTALL_IMAGES_CMDS_PAYLOAD = \ + $(INSTALL) -m 0644 -D $(@D)/build/platform/$(OPENSBI_PLAT)/firmware/fw_payload.bin $(BINARIES_DIR)/fw_payload.bin; \ + $(INSTALL) -m 0644 -D $(@D)/build/platform/$(OPENSBI_PLAT)/firmware/fw_payload.elf $(BINARIES_DIR)/fw_payload.elf +endif + +define OPENSBI_INSTALL_IMAGES_CMDS + $(OPENSBI_INSTALL_IMAGES_CMDS_PLAT) + $(OPENSBI_INSTALL_IMAGES_CMDS_PAYLOAD) +endef + # libsbi.a is not a library meant to be linked in user-space code, but # with bare metal code, which is why we don't install it in # $(STAGING_DIR)/usr/lib