From patchwork Sat Aug 3 21:00:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 1141608 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=none (p=none dis=none) header.from=mind.be Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mind-be.20150623.gappssmtp.com header.i=@mind-be.20150623.gappssmtp.com header.b="btgIAMRj"; 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 461Gf53gqzz9sMr for ; Sun, 4 Aug 2019 07:01:01 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6F392858B6; Sat, 3 Aug 2019 21:00:59 +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 Th8nwMny6srT; Sat, 3 Aug 2019 21:00:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8F208858BA; Sat, 3 Aug 2019 21:00:58 +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 0B8551BF342 for ; Sat, 3 Aug 2019 21:00:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0628C86D78 for ; Sat, 3 Aug 2019 21:00:57 +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 IbDJriYbCHKI for ; Sat, 3 Aug 2019 21:00:55 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by whitealder.osuosl.org (Postfix) with ESMTPS id 79E198462F for ; Sat, 3 Aug 2019 21:00:55 +0000 (UTC) Received: by mail-wr1-f46.google.com with SMTP id z1so80619852wru.13 for ; Sat, 03 Aug 2019 14:00:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mind-be.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eVqy1fq9M7ythWoDZVPPj7ITHQD6uVHmXAFT9YciG3A=; b=btgIAMRj/1qM2wJUBgc2xW5U4YYkCqCUG1+hhcI+dsHl93eQ8CYXANb42V3o4UeE23 YaaI33Uh8hMtSzi1BMD8fzeGTbSzmZMM7tztBzmcHtk8cAAtfEqrhWwwnIMX7kz9pJnx 1dWuv0BnT7ipsdMe2FCL+gNHg1FXbvLBG6gCFJKn31rTMUOMUPKvLQr/JO0P0lzcUAJD quWtsEvGfKgcPnyeSY2jdTi1pqyRiPJt/JuduwbECZC4SIFA3qF8f8xDe4Vg9Ti22zfF yH9fqk9ii8AV3oUjwYD21UDAamkLgD+VZ8kx6qOhNYj9ci1pVBuapLGU6TD9QzhlZwNt 6viA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eVqy1fq9M7ythWoDZVPPj7ITHQD6uVHmXAFT9YciG3A=; b=s/O4sK2E/CAExyOADhGBTSPSdzMXQ/LKcDW8yENT1qoXdVe9WkgTqNpc7gO+J2/D8q jAFLVlyqyc0KL7kmtshrwF/+n3yBFKNk5ImYRm6E33fb9S8FXzc3iTs8ro8rJKU4ajP+ 16y7quxdp6hVC/yuZPxN51tEmDGnl5Hp57BrojlxQzAsu+VBAD8+a6Lo0FCLsd8j9R7c dTuRbYkwLGWNr1BcHzSGce+2XMR/Y1kcgQwGk/q21yFXqu73i2J0b1QgrffD9sUT9OlE WyTP8aOKY+DNFhSr7ZdcFfKuKOBP1UpD7efLh//vVCoUYYP7opm290Zyt/2Lpirvft3F 8vZA== X-Gm-Message-State: APjAAAW8otyDc3DjWciy86wywNAUWDo+H1/4YDg7ueFyAoJ2V7gU2Fvw lBUTgzb4Px0VPqNbDHDBqgt7tQD9u7A= X-Google-Smtp-Source: APXvYqw4QzD+RZMQTby1d9EmveJKvkNX3r1e+M7jwfyJzpBlE47Dw39oqA6Guze4iq+vSy0OjE0yPA== X-Received: by 2002:a05:6000:1043:: with SMTP id c3mr7776142wrx.236.1564866053431; Sat, 03 Aug 2019 14:00:53 -0700 (PDT) Received: from arnoutx1.home (lfbn-1-2159-45.w90-76.abo.wanadoo.fr. [90.76.216.45]) by smtp.gmail.com with ESMTPSA id t140sm8249091wmt.0.2019.08.03.14.00.52 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 03 Aug 2019 14:00:52 -0700 (PDT) From: "Arnout Vandecappelle (Essensium/Mind)" To: buildroot@buildroot.org Date: Sat, 3 Aug 2019 23:00:52 +0200 Message-Id: <20190803210052.6240-1-arnout@mind.be> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3] package/rcw: add option to generate the RCW 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: Jared Bents Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Jared Bents When the rcw tools is built, it is probably to generate the RCW (Reset Configuration Word) of the target. So it makes sense to do this directly in the Buildroot infra and install it in the images directory, just like we do for e.g. device tree blobs. Add an option BR2_PACKAGE_HOST_RCW_CUSTOM_PATH that allows to specify the source for the RCW. And while we're at it, make it possible to specify multiple .rcw and .rcwi files, just like for device trees. Signed-off-by: Jared Bents [Arnout: * Reword help text and commit message * Remove definition of RCW_DELIVERY_FILE * Define and use RCW_FILES * Enclose everything in ifneq($(RCW_FILES),) * Enclose error in ifeq($(BR_BUILDING),y) * Add actual error message * Don't limit to only %.rcwi files * Don't delete *.bin ] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- Note to Jared: if you follow my suggestion of not copying things, then most of my changes become irrelevant, so you can remove the piece between square brackets above. [v2 -> v3](Arnout): * Reword help text and commit message * Remove definition of RCW_DELIVERY_FILE * Define and use RCW_FILES * Enclose everything in ifneq($(RCW_FILES),) * Enclose error in ifeq($(BR_BUILDING),y) * Add actual error message * Don't limit to only %.rcwi files * Don't delete *.bin [v1 -> v2](Jared): * Removed host-python dependency * Updated help for BR2_PACKAGE_HOST_RCW_CUSTOM_PATH * Added error for number of .rcw not equal to 1 * Removed symlinks * Split large install command into different commands * Resolved utils/check-package warnings --- package/rcw/Config.in.host | 16 ++++++++++++++++ package/rcw/rcw.mk | 30 ++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/package/rcw/Config.in.host b/package/rcw/Config.in.host index ba40f76de9..a9253958d9 100644 --- a/package/rcw/Config.in.host +++ b/package/rcw/Config.in.host @@ -10,3 +10,19 @@ config BR2_PACKAGE_HOST_RCW then use this toolset and examples. https://source.codeaurora.org/external/qoriq/qoriq-components/rcw/ + +if BR2_PACKAGE_HOST_RCW + +config BR2_PACKAGE_HOST_RCW_CUSTOM_PATH + string "RCW Source file paths" + help + Space-separated list of .rcw and .rcwi files, that will be + used to generate a RCW binary. The entire list of .rcwi files + used by the .rcw file must be specified. There must be a + single .rcw file in the list. + + This is optional. If left empty, the rcw package will be + included for use in the SDK or with post scripts but no + RCW binary will not be generated. + +endif diff --git a/package/rcw/rcw.mk b/package/rcw/rcw.mk index f4570b9bde..36d2da61b5 100644 --- a/package/rcw/rcw.mk +++ b/package/rcw/rcw.mk @@ -10,11 +10,41 @@ RCW_SITE_METHOD = git RCW_LICENSE = BSD-3-Clause RCW_LICENSE_FILES = LICENSE +RCW_FILES = $(call qstrip,$(BR2_PACKAGE_HOST_RCW_CUSTOM_PATH)) + +ifneq ($(RCW_FILES),) +# Get the name of the custom rcw file from the custom list +RCW_PROJECT = $(notdir $(filter %.rcw,$(RCW_FILES))) + +# Error if there are no or more than one .rcw file +ifeq ($(BR_BUILDING),y) +ifneq ($(words $(RCW_PROJECT)),1) +$(error BR2_PACKAGE_HOST_RCW_CUSTOM_PATH must have exactly one .rcw file) +endif +endif + +define HOST_RCW_ADD_CUSTOM_RCW_FILES + mkdir -p $(@D)/custom_board/rcw + cp -f $(filter-out %.rcw,$(RCW_FILES)) $(@D)/custom_board + cp -f $(filter %.rcw,$(RCW_FILES)) $(@D)/custom_board/rcw +endef +HOST_RCW_POST_PATCH_HOOKS += HOST_RCW_ADD_CUSTOM_RCW_FILES + +define HOST_RCW_BUILD_CMDS + python $(@D)/rcw.py -i $(@D)/custom_board/rcw/$(RCW_PROJECT) -I $(@D)/custom_board -o $(@D)/PBL.bin +endef + +define HOST_RCW_INSTALL_DELIVERY_FILE + $(INSTALL) -D -m 0644 $(@D)/PBL.bin $(BINARIES_DIR)/PBL.bin +endef +endif + # Copy source files and script into $(HOST_DIR)/share/rcw/ so a developer # could use a post image or SDK to build/install PBL files. define HOST_RCW_INSTALL_CMDS mkdir -p $(HOST_DIR)/share/rcw cp -a $(@D)/* $(HOST_DIR)/share/rcw + $(HOST_RCW_INSTALL_DELIVERY_FILE) endef $(eval $(host-generic-package))