From patchwork Mon Jul 8 21:53:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 1129374 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="IY57yJXj"; 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 45jK6R0h19z9sMr for ; Tue, 9 Jul 2019 07:56:46 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 9A670865D6; Mon, 8 Jul 2019 21:56:41 +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 357jzuZMsK1H; Mon, 8 Jul 2019 21:56:39 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 3A8D985784; Mon, 8 Jul 2019 21:56:39 +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 73EFB1BF313 for ; Mon, 8 Jul 2019 21:56:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 70CCE86519 for ; Mon, 8 Jul 2019 21:56:38 +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 TLSyDdf8hCsb for ; Mon, 8 Jul 2019 21:56:37 +0000 (UTC) X-Greylist: domain 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 84D17855D8 for ; Mon, 8 Jul 2019 21:56:37 +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=1562622998; x=1594158998; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=cKy7tfVJ6aRCql0uXVMO74+AiJV4zW/4KD9h6eV5y4M=; b=IY57yJXjE1TFwJRrtj5Ym+M/SmIfQ8Nout4DIFP1zmu+ZpWDwz4w9Vv1 hlmTacsONdBeFEPrZyxq+TBPxsKDuiuOCPbyvq8+MjcaMZ0SDebj9qPvf IrztNphal0pNMGpVg+PRQZX5cAyiQUyz8g2eEEmLUq2jxgffrjlE1pzUH vNtk/eAE7k6+bKa6+lWB07QqhGmXQg8a6zugYkMP+H12zW7NyC0R2XM3h AmxQfl/7B7h4cC/oonKODRtCos5QpMxk6X8/CwxAFrSuKsZFMszwI1rN8 pZVuLofLCeZGccSrR07O52GUZGDwtb4MeL1mUkPelSaE0dOOwWT1HjxLW Q==; IronPort-SDR: yvXsjcwJt+zJFIH23tHVY/lM5Ogz6tczgRxuBaSn05UdLvCaHZCwFSlerWRBQUR6iunW6Eatf5 H3JJ6828NZ2PvBBUUKF0xFBpoNlvkAb1LYX+JEMK3SrYMmy8zLN8GJmlQ5+2IbC/im8UOhZuEf hjOeJ0N05RROjVw6UyA2Wj4Dfgj6KsbpYhDGX61YMgPSSQaTfyw7A/BndU2gLcPe/+Em8AlX4S cSzyz2TKKfsNAUS+6wdtPzEErMtvuIrSRKkbnVt7WU8JkLbfFV48Nv/U2FhRpCnbfVUN1p5Jpk eok= X-IronPort-AV: E=Sophos;i="5.63,468,1557158400"; d="scan'208";a="114105404" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 09 Jul 2019 05:56:37 +0800 IronPort-SDR: NISLSf0iKnNMidIe7HPL9bdZx/f7pUOC/D1/aKMLPhnryt7kvwtJQe9CYuLCkcByCAqpi6U+cX 6xZjnaRlcb6FG+lo7kXG8nG0WO60k+ZjjNNfBlZ2XsGKBpR8vfw6EWIwShRkiokLBLoAcr/n3x Y7pl0aROHkXRe1UFyPBuEeqsOpP3w71OAQhUO6DFm+7e7Uw2JifpCwh9auvEY7oAJ2Xvurwd2c pLxIeblX2GZBBbgFt448htcfU6SJ+y5rfJiZDaTO+3P6M9lcnVVLx+JMUDEsOoz5Q4F1WPt18b PSL2KaGZy5fmA8I+U3EDL0xV Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 08 Jul 2019 14:55:25 -0700 IronPort-SDR: CYMT2Hnly0Q2lG+TxMFx1ANiVL3k+mlLSVJX1n9ln3VEKonEtguHBUYF0kNlPPYQaSwGHWhmOX 4JFSCb6sA0JgC1tDCkLdrUghBC5R9yzXlBGfyzPMYyTPayclmo+F0aR3bWz6igYjJVOO8foqp0 TJH9F9R4MqMxNSyMy3uXGpK9hX+Aha2nThkUJKG4vHnZFMJjkW2NB2ppyRHIq5Paz41dqLk8l8 25TQ6a8Lkr7vl8wsxj+yQxyi8Nik5BZslh0bYFpUYBoPmTZVl+8wvYElEDca4S0BUmpTL95t0s Lo0= 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; 08 Jul 2019 14:56:36 -0700 From: Alistair Francis To: buildroot@buildroot.org Date: Mon, 8 Jul 2019 14:53:51 -0700 Message-Id: <20190708215353.9107-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: mark.corbin@embecosm.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 45a3fc4859..2179d846e3 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