From patchwork Mon Jul 22 20:44:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 1135269 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.136; helo=silver.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="jajVkMK2"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45styz5lftz9sBZ for ; Tue, 23 Jul 2019 06:50:03 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id C1418203C5; Mon, 22 Jul 2019 20:49:59 +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 R6cclW0g6gQ5; Mon, 22 Jul 2019 20:49:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 9E71D2042A; Mon, 22 Jul 2019 20:49:56 +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 905DA1BF36E for ; Mon, 22 Jul 2019 20:49:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 8D97520455 for ; Mon, 22 Jul 2019 20:49:54 +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 E7SBoV3DO+IR for ; Mon, 22 Jul 2019 20:49:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) by silver.osuosl.org (Postfix) with ESMTPS id 8FF08203C5 for ; Mon, 22 Jul 2019 20:49:53 +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=1563828593; x=1595364593; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=DLIdzsi6DHHy8FVueJeqGqtu6ltmYiRd+mDvE7RQu/g=; b=jajVkMK2uQLTiOUWKG3g37xvLb5E34AQKrCBxtnfnssszVbjIpAg63xB IwnSu12Gr6g4AORQojcHX9kKTJt1BILXy5e3y7gf5DGxGxnvjjde2x2M0 eCmMvZKuSs26KPu/7fFsSxj0X8y+18Qa/lksshOKWWmW+Z64xpGwhoHxi knJPA63KuUy+mzGVzVCRL8OausBpzEKbINaw2N5isSqQ6afgWZvwhlQLZ jJ6+nd6dCP1dV67VsqvxK87Dc0D+SjWPz7P0a4LK7kJTzWojxfBbopDZX 17BvPYE9JbbyoeZFXwWC6Mvk8Z64JsEqS/GR0MFP4hN/bhHjOxjkkjK0k g==; IronPort-SDR: BxVFWX3SoMVObGlWgTuwGeblqrPcF7EjUHPCqGBAspljfxaZfhTtDdHWRSWstAwWqGpkLLJSNp CFyK2PWRRPUksSf+GsewDZM9efI1KQU63Nxfha2xVqUXGABw9HYATI6u4Squlg/yWdny4kaRNX 4A0InaVmlJFTX00Q4WFCW/JOwKbLY+P/4xXNTdNIQcNc3RImfW7J1sOZ0U2O9OQJblINfLus5A mb6nbzQdt5Ikvi8K7ZxSeyY3fyrDVzduG0IQ6maVhq9nENaniNsFWsOv9XL1J7DhI8Tc9qcdS/ bq4= X-IronPort-AV: E=Sophos;i="5.64,296,1559491200"; d="scan'208";a="220161630" 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; 23 Jul 2019 04:47:51 +0800 IronPort-SDR: 2uCNhEKOs1VlIV4/WmXbcB9d+x7lwcsoeufuaPGTkFwuwKT9MB47IsvF8BvtHSfNylkd3KyinH VahtKDUg6k/3uq6n2/zvr9/2FPQGRxSK2TnvaOa1Xxyph+NbBxrXe2+UTsLuN7Bx/4VDWucqGk 9zj02lhV3YI2pMF1VB+Tw6ogTxWg4/LDicP/C5tALimxbADwUFuF0xMoxWBrQxO7adk3rexKD5 mehwvXlB7NfkCtYuLzbFV7F9dZUA3QvrLagqx3Wsvak/r5GbFtTerenXultKKC4L2RHdzeUtNm 7uzA8KOyJfC3kefd5q/CWH0Q Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 22 Jul 2019 13:46:07 -0700 IronPort-SDR: 4rTg1jkYEPPiZRQ3RVUL0V0bgQvDQjszEcL823SUxWtfqUnsVz0XmFPA+r6OA7cwBT0YQoNtWW T2tmCJrAWor7G0Ywcnn/SqSA6/OXFS3tbzRyuSwaA0TUJgqM1e+k61z57r56HosbfAfrzmCWTv EwE8+sWSWKA1JSB/kdlCIdLmdcjoggwSWYKjNZwzo4vVHbBXXBSHv4lAf1wZhe+77a7InwUCfu tg3ZZf1/NaHdVITQFSczcoIJGvT/DG9cCDrQBRDXBwoiIVjXddXJM9DwHL3EpLgZ0suL1UlXd7 vKc= Received: from risc6-mainframe.sdcorp.global.sandisk.com (HELO risc6-mainframe.int.fusionio.com) ([10.196.157.140]) by uls-op-cesaip01.wdc.com with ESMTP; 22 Jul 2019 13:47:52 -0700 From: Alistair Francis To: mark.corbin@embecosm.com, buildroot@buildroot.org Date: Mon, 22 Jul 2019 13:44:46 -0700 Message-Id: <20190722204447.7935-1-alistair.francis@wdc.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 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 | 10 ++++++++++ boot/opensbi/opensbi.mk | 26 +++++++++++++++++++++----- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/boot/opensbi/Config.in b/boot/opensbi/Config.in index 5f3cc13312..686aac8798 100644 --- a/boot/opensbi/Config.in +++ b/boot/opensbi/Config.in @@ -22,4 +22,14 @@ 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 + depends on !BR2_TARGET_OPENSBI_LIBRARY_ONLY + 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 83552a5442..14657cac06 100644 --- a/boot/opensbi/opensbi.mk +++ b/boot/opensbi/opensbi.mk @@ -19,19 +19,35 @@ 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 +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; \ + $(INSTALL) -m 0644 -D $(@D)/build/platform/$(OPENSBI_PLAT)/firmware/fw_dynamic.bin $(BINARIES_DIR)/fw_dynamic.bin; \ + $(INSTALL) -m 0644 -D $(@D)/build/platform/$(OPENSBI_PLAT)/firmware/fw_dynamic.elf $(BINARIES_DIR)/fw_dynamic.elf; +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 - $(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 - $(INSTALL) -m 0644 -D $(@D)/build/platform/$(OPENSBI_PLAT)/firmware/fw_dynamic.bin $(BINARIES_DIR)/fw_dynamic.bin - $(INSTALL) -m 0644 -D $(@D)/build/platform/$(OPENSBI_PLAT)/firmware/fw_dynamic.elf $(BINARIES_DIR)/fw_dynamic.elf + $(OPENSBI_INSTALL_IMAGES_CMDS_PLAT) + $(OPENSBI_INSTALL_IMAGES_CMDS_PAYLOAD) endef -endif # 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