Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 077CFC433FE for ; Thu, 30 Sep 2021 15:00:25 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 53B5161994 for ; Thu, 30 Sep 2021 15:00:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 53B5161994 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BA71082F1D; Thu, 30 Sep 2021 17:00:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="TDAlDwFk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8BD6982F08; Thu, 30 Sep 2021 17:00:17 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on20609.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e89::609]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A994C8314C for ; Thu, 30 Sep 2021 17:00:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=michals@xilinx.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TW8/7P9cXgMwm9UQeYjy8uIJanfvDTOnbjdpdiXkAOu0kMGPYcZuDVOaUPt6FoOd8yajWujGanXl2so8FGf/LbATk72NfW96+5BzK3i1994LFaB8xXLJJbyIESTvilI1uzMNKEQxp/dZTGHBru3q51Ah0MmOge47HTWUFgF9fRg7XQb9ffhw8YmTGneSPA7AkILjAsIEvK2hpc6AKChCbzsDk30hjp0E4Exn7pGpYhCwPyugJwKuI3ozlOIZdOuByHhyC7PyhQeOIeSeyjh+5na/gX9PUw6afKDBFNmXe2VKN7Ff6WbqbMS5e8pNq0VGTOSDG2aTgCzK61wnzkQdVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Q4aLoA+t9Q9hwHAOZ1s63+5PZqob9luO9Sge/czoFK4=; b=T3NDlM9ijQYLE7twwzZPa4LJVfFSfhbCongk/0eI/RM+em78KZOi2+W4yc/+rY3TkIh4z3tEmjbHvL8cFjXEf/KGvcL7LkQA4kLXZjDxEMhvLxtTwmVz3nyEPq2hbGotfWCVpPraeDlkbkNwYR1h02F86FTwrwxY878d92pUQz8pH0yzQ2LcQftIJuLU7l/3Q2txJ3BqYHYCkzbUrSSd3NFnk6xvmpm5zo1uKssSdytI/5hQvPhqm/6rugfECsc1TUd9Zjn7aEmPCkn5s21g3MKq58RmNVn4WiGEtTnVfqRGtHR5hAQztxP5zcwNDk2DMorypeXYv8gYBBa8NqoqPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=lists.denx.de smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q4aLoA+t9Q9hwHAOZ1s63+5PZqob9luO9Sge/czoFK4=; b=TDAlDwFkEu4k1Y90m36Aqw21kXgS87LHkhpDfDi01SYB7UGQW5tS8SuqahrVKM1HXVPmwbuYKkmalfuQDaORlF52vu/pukFJQhx5+as/XdQJlrJDaL7VFFN95fhHIfVhKUq1Kk73P3oeOfKIC3/gXZTP4SsM2Qynocs7cuvR2/M= Received: from BN9PR03CA0040.namprd03.prod.outlook.com (2603:10b6:408:fb::15) by MN2PR02MB6029.namprd02.prod.outlook.com (2603:10b6:208:180::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.15; Thu, 30 Sep 2021 15:00:00 +0000 Received: from BN1NAM02FT013.eop-nam02.prod.protection.outlook.com (2603:10b6:408:fb:cafe::cc) by BN9PR03CA0040.outlook.office365.com (2603:10b6:408:fb::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15 via Frontend Transport; Thu, 30 Sep 2021 15:00:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; lists.denx.de; dkim=none (message not signed) header.d=none;lists.denx.de; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by BN1NAM02FT013.mail.protection.outlook.com (10.13.2.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4566.14 via Frontend Transport; Thu, 30 Sep 2021 14:59:59 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Thu, 30 Sep 2021 07:59:58 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Thu, 30 Sep 2021 07:59:58 -0700 Envelope-to: u-boot@lists.denx.de, yamada.masahiro@socionext.com Received: from [10.254.241.49] (port=36448) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1mVxXS-00059q-Dv; Thu, 30 Sep 2021 07:59:58 -0700 To: Masahiro Yamada , U-Boot Mailing List From: Michal Simek Subject: How to build additional bin with adding dependency via Makefiles Message-ID: Date: Thu, 30 Sep 2021 16:59:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 09d9f792-2e9a-45d7-4d24-08d98422f991 X-MS-TrafficTypeDiagnostic: MN2PR02MB6029: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nUu1NaT9hJLyWORIRmIUcU0qShLVohrj20QTfIJL5VT3mmJL7694LKd9LwlqEPjdeRWVmJfCcdH0PmWZFruNU3vrLYHY1bw24uu3BxceijrdWwqkoYqc25VTDoi4ItSSQl6S1+DD6zmf6Jfb7j6ESnFe+AHb9YMrOi3m+oyf3sBUoQGK73E2tdyXSBjmcLBQXHk23gzau/XNrmmGxInPrBJNhrXqCzsOAckxUNhy0OzQsKlxv7L3fP2YDPlAxES9yl/rE0yXkCm+tyD3lcLEkoUJdjQKMjPtGBX01frPhVa0/GVXNz9LZBIZ3Zu2KfZiZaMB4gJBfeFwkmcKjjf/uss+R/RMidhJJpWe9qZQ6jf+TGDP0s5n2GFD1SASdZUgfYHdCicrAtySltfcd7+04e0WPlrLWfbolz0tb9CkUYXllHrGnSgwddvw6sDkThBj8cienkxcA/1LFgYbgkk+rEoWhZjW6q91gZ8j6tZY+Yxd8NBhMSZ/0j/l/9PM6tj8tQmA39rev/3uRjxudbWh2mGGkyOKUP1Rx71URfiGawV0sv/Rncn1wg3UYoVcSWiYvi6IZ+bsuk73JPOc+hc/SvR/H1xqNR+xG+96L90eZsyatKBslFkr1V8CAWXyp6HJBTszx7b9J+KRF0OnypW7mQvNaGlsjU6HDmWm0guchSeV8uFu1E2Mj+kkd90xg5hlhbQk0PdemcHNFcQmhjAD0ssCy68Hm5qPHCbi948EPXrOb6/R3awhK6O36XaCbMmSSA1vk//4yJklb7vdWZgVhA== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(8936002)(83380400001)(2616005)(47076005)(426003)(70206006)(70586007)(336012)(356005)(82310400003)(36756003)(8676002)(36860700001)(186003)(9786002)(7636003)(5660300002)(316002)(31686004)(26005)(36906005)(31696002)(110136005)(2906002)(508600001)(44832011)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2021 14:59:59.9030 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 09d9f792-2e9a-45d7-4d24-08d98422f991 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: BN1NAM02FT013.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6029 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Hi, I am trying to build one configuration blob which should be included in SPL. And still I didn't find the right way how to do it. I need to build C file just as object and run objcopy -O binary. I can be done with host gcc or target gcc. Both of them are little endian that's why it shouldn't be a problem. I just created rules in Makefile OBJCOPYFLAGS := -O binary KBUILD_CFLAGS := -nostdlib -nostartfiles -nodefaultlibs $(obj)/%.bin: $(obj)/%.o FORCE $(call if_changed,objcopy) obj-y += pm_obj.bin binary is generated properly but I have a problem to setup dependency. The same file is referenced via CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE and should be included in pm_cfg_obj.o as the part of SPL. This is the rule (a little bit update compare to version upstream) ifneq ($(CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE),"") PM_CFG_OBJ_FILE := $(shell cd $(srctree); readlink -f $(CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE)) obj-$(CONFIG_SPL_BUILD) += pm_cfg_obj.o $(obj)/pm_cfg_obj.o: $(PM_CFG_OBJ_FILE) FORCE endif And there is dependency on binary file but I think my issue is that pm_obj.bin is not listed in targets that's why that dependency is not handled properly. Would be good to get some hints how to do it properly. It is PMU fw configuration blob which PMUFW requires to setup proper permission for IPs that I think it would be good to have generic version of this file in u-boot source code that it doesn't need to be created outside of u-boot. At the end there is new option for applying configuration object overlays which will bring new functionality later in boot process that's why generic configuration could work for the most of boards. And if not additional binary could be applied via existing zynqmp pmufw command. Thanks, Michal