From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Sat, 11 Dec 2021 08:04:26 +0100 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mvwQk-002wDZ-Bm for lore@lore.pengutronix.de; Sat, 11 Dec 2021 08:04:26 +0100 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1mvwQj-0004uD-Q3; Sat, 11 Dec 2021 08:04:25 +0100 Received: from mail-eopbgr80075.outbound.protection.outlook.com ([40.107.8.75] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mvwQ6-0004tu-PB; Sat, 11 Dec 2021 08:03:48 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gz6JtgbZwMTEfqpgwj/+0XY75CdYC84gnqc7Mx+EuT/XjfBAGDD3B8dsr8QDeU13uNJyh/S7bHXk9P7+IeVgq8W5XFdaywNk+wAT/m8MtciCT5Zx0hTcoCjIo53xeMykhFSaBtVEWyJpyPYwADOhqvfeSGXyLLTwSBV4U135QjUrgwoQKQwAAy8iT9w9a5ntU9DLJ5zeoczHO1UKq/Zc7hGiTUTsUIsEqdMJ+0YMg/us5hLqI78DSDFjcqz/wG1nL72MZeDZLsQtviB8j8ZnG9KChGqCVS9TdUM+ggaeeNvlSJQB3NfH7/BaQBuQWXO2OXAqUSD+ydgQgUexyDph5w== 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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Xv5PlmmVpBunjo+K75s6Wuc3aheK9FBByx1sNdOG7X8=; b=CMf2sPuq/Qn+fTZCcrWgNItkoOmglXpPlHP7Ai+97pt4AOlX6aU2NiM+xgFHMTIAxb18257pa6AmtfabmJyb/rqUtZKspVATqFFnuDc3QGn78myxsOvTg6eT/mDcZfCm65j6sHJ9KzmtT1P1j32/3pEqgWuEy8uDK/9rp1FK86RCgEDqXgHuooa7Hq3Oy/7ipROypoJi14RRAkfhuwHrb7K4t+IoFbQP6TL/O3orXlaTS22yJLWMLtlCksHN4tnNN71RaKRpRqjVwTtbsguejLPzRSevbukTf73IdB0/Kpw14gqwzqidpwDHo74zYmuC9B4cc1QObW1jRh+V+WOrzQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wolfvision.net; dmarc=pass action=none header.from=wolfvision.net; dkim=pass header.d=wolfvision.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfvision.net; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Xv5PlmmVpBunjo+K75s6Wuc3aheK9FBByx1sNdOG7X8=; b=xg1UT36PUHNzduLT6wS/1h5FLR/gV0KPrjUNXtvPFwDUIUQQiaRNZ3xMeSiOJicc7q00y6016BTZNjwtYWr9wrIbnf8mxGRN7PShMsRsX7vnRlVpSJqP55ejCZz2YRMlNcmTYHDv9RFGer/edoAqYdKjve2CXiqTZn24mXmgpyc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from DBBPR08MB4523.eurprd08.prod.outlook.com (2603:10a6:10:c8::19) by DB7PR08MB3324.eurprd08.prod.outlook.com (2603:10a6:5:22::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.13; Sat, 11 Dec 2021 07:03:43 +0000 Received: from DBBPR08MB4523.eurprd08.prod.outlook.com ([fe80::81d1:d448:4016:1956]) by DBBPR08MB4523.eurprd08.prod.outlook.com ([fe80::81d1:d448:4016:1956%4]) with mapi id 15.20.4755.022; Sat, 11 Dec 2021 07:03:42 +0000 To: ptxdist@pengutronix.de, m.olbrich@pengutronix.de References: <20211209061049.2975739-1-michael.riesch@wolfvision.net> <20211209061049.2975739-4-michael.riesch@wolfvision.net> <20211210150228.GY15196@pengutronix.de> From: Michael Riesch Message-ID: <7d8ddd07-4bd4-e75b-a59a-3b098c073864@wolfvision.net> Date: Sat, 11 Dec 2021 08:03:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <20211210150228.GY15196@pengutronix.de> Content-Language: en-US X-ClientProxiedBy: ZR0P278CA0124.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:20::21) To DBBPR08MB4523.eurprd08.prod.outlook.com (2603:10a6:10:c8::19) MIME-Version: 1.0 Received: from [IPv6:2a05:1141:1c9:7c00:2971:328c:3026:3149] (2a05:1141:1c9:7c00:2971:328c:3026:3149) by ZR0P278CA0124.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:20::21) with Microsoft SMTP Server (version=TLS1_2, cipher=) via Frontend Transport; Sat, 11 Dec 2021 07:03:42 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8616dd4e-6d47-4ad2-9c1b-08d9bc745dbb X-MS-TrafficTypeDiagnostic: DB7PR08MB3324:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:820; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QPKaAydZpH7h17MQTGIncqyDKIjJPOR6OjfXLOC3+nKwSFkVSew9bVMsuQY9Jn/aBv5m7JsXC2COwGL3RH8dvJ+JBRSlY5G5ROTtjeH1wsGiG2+kC7Ui1TAJhNM3VTAs2YWRJ2d5uuEQj8wlbtWrQqec3vbFM9UdtrM/GY/8Uo95dAkVZMTF8gfYamQB1lpnb2Qu57FFL8PrgwPqtHsO4xosFdcWGJ0lRq91NBZkqof3+HjXcKrpq9o0Swaf6EGYw0n1ExCzPz5Lt/fYv+Sl0JFb1QUTujl0k7wgQwjQZJJutTUeQVpcygEu93DC3JvMnd9QsnaQfQZK1RQ+wp7kfpfnb/uoxA+jd8A+ra1/TkNf67NhRybTEBrqAZeeVjCAzORpWQdryZ1MfeKecflKmjeiq7zD47mJq14/4t1kDQSMGekV7mZhs0qlLuljY2h6REmjfm3zi36t3FmEdBAIagVLwbqJUL7Vnz7WuBDlBNNuuSo6kdKgobLF7CNYJw0bAcYKzmeoTrlLjt5axThqHAMjgAUqa9R2DD+M448tIvcyB7yk/c91q5L565CYkJVRMAlN+jHcV6LTGKIPE3GyTKnSSCEDaJrhhXqE6TqpYn7aqRfIjnXpb7gMDtQ25kkwzTSK+pqQy1JBYJfrNjTrpYS2hSuWlfQVeZwDnEFnydJOJzfqRcQKak4f4EfougOv5r5VWRp6gXdHejcR7wVhx3mIYxni5JozONFz41XQFHqtVBtWkaqReOPuY8SgjVi8 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBBPR08MB4523.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(396003)(346002)(376002)(39850400004)(136003)(31686004)(44832011)(450100002)(316002)(52116002)(38100700002)(66556008)(66476007)(83380400001)(4326008)(31696002)(66946007)(36756003)(2906002)(186003)(8936002)(6486002)(53546011)(8676002)(86362001)(508600001)(5660300002)(2616005)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?R0V0RlJhb2tiVHNiWD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JGVE84?= =?utf-8?B?Nk1UdFpaNmlQemRBVk5QTGsyL1JzUUFFSzdyeE0xdUxiZUtMQ2g2TVplMkJL?= =?utf-8?B?YkRYNUJKM081SUZRR1ZEMWlTUkdxdlVRTkhZWUY3UUE2RXJOdVFLck84aktk?= =?utf-8?B?eUkxR1ZSMS9EZGpPSXVsdncxajl5d3B6aldTNUlGUU15V2dsYWozYnp3L1Rk?= =?utf-8?B?dlVlY0Rxc1BXWjhqdE1DVXRuRDI5WkUrQ09DbXpwWWU0L1lJVHBYQU9PaEcz?= =?utf-8?B?QVNLRUhkTTJoYjJHQTd6UFBVZXlVU0Y2M2RFVTIzTk1IY2E5bW9wVisxbGow?= =?utf-8?B?VFc1YXZOMEtHQi9pNUxOWmQwS1F0Uy9HclhRUG13KzFxTEJObHZOM2d4QVNn?= =?utf-8?B?elc4QjZsMUdrYXdveDB6SlpwcWNRcCs2b0JWbzN5aW96NEJoeWduYmRQU0Y3?= =?utf-8?B?a3V4Mi85WmJ5UjB0UzB4ZHJJYkhqK0sveklhNWVlUnZnbUNvaFR4NDNaRkRi?= =?utf-8?B?WEhnM0dvZ05YZUhRdkRheTJ2aVZiUG52QzVJS0pFc3VsWHlDUUdkeFBHR3M5?= =?utf-8?Q?YXOE2Qt3QR9tqnxM=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 8616dd4e-6d47-4ad2-9c1b-08d9bc745dbb X-MS-Exchange-CrossTenant-AuthSource: DBBPR08MB4523.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2021 07:03:42.8707 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e94ec9da-9183-471e-83b3-51baa8eb804f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: m9RsnCp/ETrry0COrG/uqJXvMF40bNPsHkAkPN3JfRZJx5E1/OqPb7aAlSNd90G74H8m5dVuQwWnfeNhVl6M8FhxIICNF4OSPSwoCRwk8wQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3324 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.ext.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-3.3 required=4.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MSGID_FROM_MTA_HEADER, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [ptxdist] [PATCH v3 3/3] barebox: add integration of firmware blobs X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: m.tretter@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false Hello Michael, On 12/10/21 4:03 PM, Michael Olbrich wrote: > On Thu, Dec 09, 2021 at 07:10:49AM +0100, Michael Riesch wrote: >> In some cases barebox requires firmware blobs, which may be >> provided in binary form by the vendor or compiled in a >> preceding step. Add the possibility to specify files which >> are injected in the barebox source directory during >> preparation. > > So, I've been thinking about this some more. And I think this needs a > different approach. > > With SDRAM calibration and TF-A and stuff like that, there will be a lot of > blobs that need to be integrated into barebox. > And it will be different for each vendor and possibly SOC family. And maybe > a upstream and a downstream version. > > Modifying barebox.in for each of them will not scale. Especially because in > most cases we'll carry a modified version until it's merged into ptxdist > master and the BSP is updated to the new version. > > And from what I've seen with TF-A, it's not uncommon to start with some > ugly downstream stuff and switch to upstream later. > > So I'd like this to be more flexible. More below. Agreed. While I don't fully understand yet your alternative approach (questions below), it seems way more elegant. It seems to me that the first two patches are not affected, though. Provided there are no other objections, could they be merged so we can focus on the third patch under discussion? > >> Signed-off-by: Michael Riesch >> --- >> platforms/barebox.in | 35 +++++++++++++++++++++ >> rules/barebox.make | 6 ++++ >> rules/post/ptxd_make_world_inject.make | 19 ++++++++++++ >> scripts/lib/ptxd_make_world_inject.sh | 42 ++++++++++++++++++++++++++ >> 4 files changed, 102 insertions(+) >> create mode 100644 rules/post/ptxd_make_world_inject.make >> create mode 100644 scripts/lib/ptxd_make_world_inject.sh >> >> diff --git a/platforms/barebox.in b/platforms/barebox.in >> index d35d16501..63e9929e5 100644 >> --- a/platforms/barebox.in >> +++ b/platforms/barebox.in >> @@ -15,6 +15,7 @@ menuconfig BAREBOX >> select HOST_IMX_CST if BAREBOX_NEEDS_HOST_IMX_CST >> select HOST_LZOP if BAREBOX_NEEDS_HOST_LZOP >> select CODE_SIGNING if BAREBOX_NEEDS_KEYS >> + select FIRMWARE_ROCKCHIP if BAREBOX_NEEDS_FIRMWARE_ROCKCHIP >> prompt "barebox " >> bool >> help >> @@ -55,6 +56,32 @@ config BAREBOX_CONFIG >> This entry specifies the .config file used to compile >> barebox. >> >> +menuconfig BAREBOX_FIRMWARE >> + bool >> + prompt "integrate firmware blobs " >> + >> +if BAREBOX_FIRMWARE >> +config BAREBOX_FIRMWARE_PATH >> + string "path(s) to firmware blobs" >> + default "${PTXDIST_SYSROOT_TARGET}/usr/lib/firmware" >> + help >> + Define path to the firmware blob(s). Multiple directories can >> + be specified separated by ':'. A relative path will be expanded relative >> + to the workspace and all other layers. Only one of the specified paths >> + can be a relative path. > > I think we can just define a fixed directory for this. For exceptions, and > absolute file path will work as well. > >> +config BAREBOX_FIRMWARE_FILES >> + string "firmware blob file(s)" >> + default ".bin:firmware" > > I don't like having this in the config. The problem ist, that the user will > need to know, which files to copy and where to. > >> + help >> + Select the firmware blob(s) to be integrated into the barebox >> + source before compilation. Each entry consists of :, >> + where is an optional path relative to the barebox source >> + directory. Multiple entries can be specified, separated by spaces. >> + >> +endif >> + >> config BAREBOX_EXTRA_ENV >> prompt "extend the builtin barebox environment" >> bool >> @@ -146,4 +173,12 @@ config BAREBOX_NEEDS_HOST_LZOP >> lzop is used in order to compile lzop for your development >> host. >> >> +config BAREBOX_NEEDS_FIRMWARE_ROCKCHIP >> + prompt "barebox needs firmware-rockchip" >> + bool >> + depends on ARCH_ARM64 >> + help >> + Select this if barebox needs the non-free Rockchip firmware >> + blobs. > > As I said, I don't want to modify barebox.in for each vendor / SOC family. > > So how about something like this: > > ------------------------------------ > menu "firmware blobs" > > source barebox_firmware.in > > endmenu > ------------------------------------ Right, this enters barebox.in and provides a slot to plug one or more barebox-firmware-xyz.in into the config. The @$(call world/inject, BAREBOX) is added to the barebox.make rule file and considers BAREBOX_INJECT_FILES. > And the firmware package will have an extra menu file, e.g. > barebox-firmware-rockchip.in: > > ------------------------------------ > ## SECTION=barebox_firmware > > config BAREBOX > select FIRMWARE_ROCKCHIP if BAREBOX_NEEDS_FIRMWARE_ROCKCHIP > > config BAREBOX_NEEDS_FIRMWARE_ROCKCHIP > prompt "barebox needs firmware-rockchip" > ... > > ------------------------------------ > Maybe some suboptions for individual SoCs / boards. The barebox-firmware-rockchip.in as example of such a config plugin. > And an extra rule file, e.g. barebox.rockchip.make: > ------------------------------------ > > BAREBOX_INJECT_FILES += source-file:target-file > > ------------------------------------ Finally, we need a rule file that adjusts the BAREBOX_INJECT_FILES. So far I get it. In ptxdist there is a lot of implicit magic going on behind the scenes. So what guarantees that the barebox.rockchip.make is considered before barebox.make (or the barebox prepare stage, to be precise)? Is the naming "barebox.rockchip.make" relevant (it resembles a custom stage of the barebox rule)? It seems that usually the rule files have a corresponding *.in file. Would it make sense to align the names barebox-firmware-rockchip.in and barebox.rockchip.make in some way? Do we need some explicit dependencies in the barebox-firmware-rockchip.in? Best regards, Michael > Maybe with some conditions depending on the suboptions. > And if absolutely necessary, the source-file could expand to an absolute > path here. > > Once the core support is upstream in ptxdist. These small drop-ins can be > easily maintained in a BSP but are also easier to upstream because there > are no conflicting changes to barebox.in. > > And with the latest ptxdist version, ..make can be > overwritten in the BSP just like the regular rule file. So if the upstream > version of such a drop-in has a bug, fixing that in the BSP is possible. > > Michael > >> + >> endif >> diff --git a/rules/barebox.make b/rules/barebox.make >> index bea9f3adc..a81fc86b3 100644 >> --- a/rules/barebox.make >> +++ b/rules/barebox.make >> @@ -26,6 +26,8 @@ BAREBOX_BUILD_DIR := $(BAREBOX_DIR)-build >> BAREBOX_LICENSE := GPL-2.0-only >> BAREBOX_DEVPKG := NO >> BAREBOX_BUILD_OOT := KEEP >> +BAREBOX_INJECT_PATH :=$(call remove_quotes,$(PTXCONF_BAREBOX_FIRMWARE_PATH)) >> +BAREBOX_INJECT_FILES :=$(call remove_quotes,$(PTXCONF_BAREBOX_FIRMWARE_FILES)) >> >> BAREBOX_CONFIG := $(call ptx/in-platformconfigdir, \ >> $(call remove_quotes, $(PTXCONF_BAREBOX_CONFIG))) >> @@ -94,6 +96,10 @@ ifdef PTXCONF_BAREBOX_EXTRA_ENV >> @rm -rf $(BAREBOX_BUILD_DIR)/defaultenv/barebox_default_env >> endif >> >> +ifdef PTXCONF_BAREBOX_FIRMWARE >> + @$(call world/inject, BAREBOX) >> +endif >> + >> @$(call touch) >> >> # ---------------------------------------------------------------------------- >> diff --git a/rules/post/ptxd_make_world_inject.make b/rules/post/ptxd_make_world_inject.make >> new file mode 100644 >> index 000000000..b7d28e92f >> --- /dev/null >> +++ b/rules/post/ptxd_make_world_inject.make >> @@ -0,0 +1,19 @@ >> +# -*-makefile-*- >> +# >> +# Copyright (C) 2021 by Michael Riesch >> +# >> +# For further information about the PTXdist project and license conditions >> +# see the README file. >> +# >> + >> +world/inject/env = \ >> + $(call world/env, $(1)) \ >> + pkg_inject_path="$($(1)_INJECT_PATH)" \ >> + pkg_inject_files="$($(1)_INJECT_FILES)" \ >> + pkg_source="$($(1)_DIR)" >> + >> +world/inject = \ >> + $(call world/inject/env,$(strip $(1))) \ >> + ptxd_make_world_inject >> + >> +# vim: syntax=make >> diff --git a/scripts/lib/ptxd_make_world_inject.sh b/scripts/lib/ptxd_make_world_inject.sh >> new file mode 100644 >> index 000000000..c2e45ad42 >> --- /dev/null >> +++ b/scripts/lib/ptxd_make_world_inject.sh >> @@ -0,0 +1,42 @@ >> +#!/bin/bash >> +# >> +# Copyright (C) 2021 by Michael Riesch >> +# >> +# For further information about the PTXdist project and license conditions >> +# see the README file. >> +# >> + >> +ptxd_make_inject() { >> + local source target >> + >> + source="$(echo ${inject_file} | cut -d ":" -f 1)" >> + target="${pkg_source}/$(echo ${inject_file} | cut -d ":" -f 2)" >> + if [ -z "${target}" ]; then >> + target="${source}" >> + fi >> + >> + if [[ "${source}" =~ ^/.* ]]; then >> + ptxd_bailout "'${source}' must not be an absolute path!" \ >> + "Use _INJECT_PATH to specify the search path." >> + fi >> + >> + if ! ptxd_in_path pkg_inject_path "${source}"; then >> + ptxd_bailout "Blob '${source}' not found in '${pkg_inject_path}'." >> + fi >> + source="${ptxd_reply}" >> + >> + echo -e "\nInject file $(ptxd_print_path ${source}) into" \ >> + "$(ptxd_print_path ${target})..." >> + cp ${source} ${target} >> +} >> +export -f ptxd_make_inject >> + >> + >> +ptxd_make_world_inject() { >> + ptxd_make_world_init || break >> + >> + for inject_file in ${pkg_inject_files}; do >> + ptxd_make_inject || break >> + done >> +} >> +export -f ptxd_make_world_inject >> -- >> 2.30.2 >> >> >> _______________________________________________ >> ptxdist mailing list >> ptxdist@pengutronix.de >> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de >> > _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de