From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 10 Jan 2022 07:39:59 +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 1n6oLX-00FsWk-Fo for lore@lore.pengutronix.de; Mon, 10 Jan 2022 07:39:59 +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 1n6oLW-0007Rm-IK; Mon, 10 Jan 2022 07:39:58 +0100 Received: from mail-eopbgr20087.outbound.protection.outlook.com ([40.107.2.87] helo=EUR02-VE1-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 1n6oL0-0007RT-S7; Mon, 10 Jan 2022 07:39:27 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JwLZGYPjLhK0mH+7ikPO0AAiWV4hQAvIJBIfSJQlHLJMSs5J9xq754IPZjnGloeYlYsVnW4YChIOddbOjwmy+DLW53i3DurNHeliqlz24uBpT3mUUKJyOJVCNTJyGOImZzFHxE3MY+HRAb2fR/XjgSyUBaBzhZYl1lnhsjNx7fjLg0j3VZNNxqWswMxCxFhqqh7/dSNWXI4wWVu+GHXKeFWWA2lY3qWnSBzi9XDRgaf9E+RDulrh3kDXJ5b3Rvu7Ajc4rHrU6U7UvF5IKe6NUJvQMDvgoSsLb9msgMjfbh6fCuNBEc9ReLwkUA8yczCiO8G4AAyViRXnIC/PNn4IaQ== 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=aSuFmgsiYLYmwLnhpJ8m7z/2tJaXVZx/yl6jMBNOXFE=; b=PgX9Iq0RCdms1jNQk6UsmWIeQ5KnwForUbIHnwXiHbTdHvL6ngCPZhGcj+7D2OwLYLBnEhG4KRswrREmdPGhobU+dK4N2kHj8ohopWnzaLYSCcu81fnibgFoiEYVwgmz3T9vXzTwKnN1eFFwCydNRM54KmU9PDh+VmEFTYPr/30uksSyduncJzssaTAyu4NVfLsTU5DOZGa/b0r/f/g5RJxF+0mTVKB8bmqqf4f5jtwriUu0cYDbGkuvmbTeFHcZjKcjt0ovfgWFaipnJXlDNO14Kld/rVnXtb/ugY80cnabrSTbKLiKnZtiTp9mwBL2UnbA1NdHORK+RUPEfPsT7g== 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=aSuFmgsiYLYmwLnhpJ8m7z/2tJaXVZx/yl6jMBNOXFE=; b=1ofoq1cSHMuCkuv27jacaDncpjTahKRM29BUeqaaGwRqA/NeO+ahzCbA0YoWtpervAuE7B9zL9X9zA2dXeI92vQopd+8kMXotIYYcJCE86PZt0w34f9wuXbf+SSLrzfrsj6MzJvQD+z9VBx88o6j8+T/9Q0yPR5iKFlvYEsDl5I= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from HE1PR0802MB2426.eurprd08.prod.outlook.com (2603:10a6:3:e1::23) by HE1PR08MB2636.eurprd08.prod.outlook.com (2603:10a6:7:39::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.7; Mon, 10 Jan 2022 06:39:22 +0000 Received: from HE1PR0802MB2426.eurprd08.prod.outlook.com ([fe80::809:72af:1fb6:1294]) by HE1PR0802MB2426.eurprd08.prod.outlook.com ([fe80::809:72af:1fb6:1294%4]) with mapi id 15.20.4867.011; Mon, 10 Jan 2022 06:39:22 +0000 To: ptxdist@pengutronix.de, m.olbrich@pengutronix.de References: <20211220120857.3672237-1-michael.riesch@wolfvision.net> <20211220120857.3672237-5-michael.riesch@wolfvision.net> From: Michael Riesch Message-ID: <707201be-88c0-8c7f-a2a6-518ddc5eb2f8@wolfvision.net> Date: Mon, 10 Jan 2022 07:39:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: Content-Language: en-US X-ClientProxiedBy: ZR0P278CA0042.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1d::11) To HE1PR0802MB2426.eurprd08.prod.outlook.com (2603:10a6:3:e1::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fce4effc-d2b7-4193-0a9d-08d9d403efa6 X-MS-TrafficTypeDiagnostic: HE1PR08MB2636:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QEAhHsK8Yu7nPL54t3g0Vs4YzCR3SvKJg01209f85T9v4KsW07R8SMcufRWhEWMU4d2lvnPsUMlofrroA7OTDMu/3I/49w3OjX7kRkcGWgtJh//8keBIt/93Ywz6Wz2pv0a8zYj3DnXNzQDmPIKMZJzoo/3LxNQXV+iHa9cDassOjPDSuVEhiQb6V0zKopUIJVcRJcenTqORILUVw1O9G4jbnQ02lsSF/tw8suH2PxHgVJTIg0K1zCKLFO6kqTTNKFvO9fUO21Kre5Z02l98GgMiNAub5dwRsJ8qO1KntotKMRYVwohW+JEL4v/T8v/hLneKxpvqg6ZrdSpkvgoVF3U82ZuQUisxKSDymaxehgLYF6Opn8sTHyZqT66n3Ix0sLt/oE9PS2Fp/tykzlkqgvIXmAxKqpHjjtqYcpKbzkjlcROZS1PpveKX8vcZz2AhPAX1gajmeEAXQnIc62MeEgKqL/hQP3d9V1m9KnCIZNYMcTBfHFZRsciMc2o63J1HC7CQOsVJo/bjYkiaqjdMKHaYNxNpaN67B4G2UWxPxM37T+5UhQpGOEJ9Z/oOzwaBbh5Dx97V4Kj0DQlGxfBcwLCEs/AuECRhfHdI4pyi0WzYQC14xqRUiC1RKZ1WBbS5c7kVRp9/rve0wcDa5yr2bTc1ou9Us3rpR400Y/9r7etLaWrWrutPXaXgueME/0U6qUo+tTkH6Aoc/shb+HLREOzVbm5xNy6BcPJdhrehqeQ= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:HE1PR0802MB2426.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(366004)(136003)(396003)(376002)(39830400003)(2906002)(38100700002)(6512007)(316002)(186003)(6486002)(8676002)(83380400001)(6506007)(8936002)(5660300002)(508600001)(52116002)(53546011)(86362001)(44832011)(2616005)(31686004)(450100002)(36756003)(66946007)(66476007)(66556008)(4326008)(31696002)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZzdDS0R2eG03eWozeXR5N2NzajBTV3VacDB1NTdRdExLemZqVUx1bDMrVFpD?= =?utf-8?B?RjlkSnpjUkU3dURERVhVb1pOSEFsMTJsRWJRN0ZBYVUzVE1WMUNkOTRaNDdZ?= =?utf-8?B?akVvNzVjTVVXN3pkVFJzT0l3NkRSZGtvTzUxYzRTbDdLNUZSMmJ2ZGduNFl4?= =?utf-8?B?bHdpUzNHczR0bndvV040NHdX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?a3E1aHk3TzdJR0lFd29Ubng4ZlZpLzBQbDF4QmtZRzEwNkRZZDBPUjY1cGFs?= =?utf-8?B?MDJMK2JQcHhzVjVLWi9rdkV1ek4zcFpKY0Ywcy9mdEFRb0dQeS9XNksvbVBY?= =?utf-8?B?SllzZGhaeHJINFpOcUpHQUR6bEdoeTJjOVNNR3UvdnJMT2xORUhzRi8ydzRj?= =?utf-8?B?SWswOG1aNzRPMGtEYjlNUFN6VFc2SDdVOS9kZGdPenRlOEtTWmE1OWlBWmJ6?= =?utf-8?B?ZUsxZG9kbGlaejBCdGRHUDZJemkrWnVrOE9QQTNvRmVMeVR2aGR6YWJzRjUx?= =?utf-8?B?dEJNbVc4RXdSem1EZDZMTXlnR1JFQ1NGalIyOVpVTTBjZWNicGlwQT09?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: fce4effc-d2b7-4193-0a9d-08d9d403efa6 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0802MB2426.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2022 06:39:22.2137 (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: 6lsGormYgmExopa3zUA3IoRvzsGcaU91Ll6+SSWc+uL5DtyEPgab3+yi9UqBNhTnU2mXSaL4Jvq7fcAlLS0sD3YpTiTZyhlR2ugujR+fjoI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR08MB2636 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.ext.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-1.6 required=4.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 v4 4/4] 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 1/7/22 3:09 PM, Michael Olbrich wrote: > On Mon, Dec 20, 2021 at 01:08:57PM +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 (in >> separate rule files) which are injected in the barebox source >> directory during preparation. >> >> Signed-off-by: Michael Riesch >> --- >> platforms/barebox.in | 8 ++++++++ >> platforms/barebox.rockchip.in | 10 ++++++++++ >> rules/barebox.make | 4 ++++ >> rules/barebox.rockchip.make | 16 ++++++++++++++++ >> 4 files changed, 38 insertions(+) >> create mode 100644 platforms/barebox.rockchip.in >> create mode 100644 rules/barebox.rockchip.make >> >> diff --git a/platforms/barebox.in b/platforms/barebox.in >> index d35d16501..8a81be40f 100644 >> --- a/platforms/barebox.in >> +++ b/platforms/barebox.in >> @@ -55,6 +55,14 @@ config BAREBOX_CONFIG >> This entry specifies the .config file used to compile >> barebox. >> >> +menuconfig BAREBOX_FIRMWARE >> + bool >> + prompt "integrate firmware blobs " >> + >> +if BAREBOX_FIRMWARE >> +source "generated/barebox_firmware.in" >> +endif > > If you split out the generic parts and add empty files with just the > "## SECTION=" header (for both new sections) then we could maybe get that > merged while we figure out how to handle the rockchip part. OK, I'll consider this in v5. >> + >> config BAREBOX_EXTRA_ENV >> prompt "extend the builtin barebox environment" >> bool >> diff --git a/platforms/barebox.rockchip.in b/platforms/barebox.rockchip.in >> new file mode 100644 >> index 000000000..238798ce1 >> --- /dev/null >> +++ b/platforms/barebox.rockchip.in >> @@ -0,0 +1,10 @@ >> +## SECTION=barebox_firmware >> + >> +config BAREBOX_NEEDS_FIRMWARE_ROCKCHIP >> + prompt "barebox needs firmware-rockchip" >> + bool >> + depends on ARCH_ARM64 >> + select FIRMWARE_ROCKCHIP if BAREBOX_NEEDS_FIRMWARE_ROCKCHIP >> + help >> + Select this if barebox needs the non-free Rockchip firmware >> + blobs. >> diff --git a/rules/barebox.make b/rules/barebox.make >> index bea9f3adc..cc70a6ff5 100644 >> --- a/rules/barebox.make >> +++ b/rules/barebox.make >> @@ -94,6 +94,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/barebox.rockchip.make b/rules/barebox.rockchip.make >> new file mode 100644 >> index 000000000..33795bee4 >> --- /dev/null >> +++ b/rules/barebox.rockchip.make >> @@ -0,0 +1,16 @@ >> +# -*-makefile-*- >> +# >> +# Copyright (C) 2021 by Michael Riesch >> +# >> +# For further information about the PTXdist project and license conditions >> +# see the README file. >> +# >> + >> +ifdef PTXCONF_BAREBOX_NEEDS_FIRMWARE_ROCKCHIP >> + >> +BAREBOX_INJECT_PATH += ${PTXDIST_SYSROOT_TARGET}/usr/lib/firmware > > This should be in barebox.make. BAREBOX_INJECT_PATH is a ':' separated > path, so expanding it like this doesn't work anyways. Will fix this in v5! > So in general I've been thinking which parts make sense in PTXdist upstream > and which parts should be in the BSPs. I mean it doesn't really scale, if > we add firmware files for all boards into PTXdist upstream. So I had the > vague idea that we could add files that are SoC specific to PTXdist and > leave the board specific files in the BSP. Not sure whether this is a SoC-specific/board-specific issue, but I agree that there are a manifold of possibilities here and naturally we cannot cover everything. I would say the aim here is to provide some generic means to integrate binary blobs into packages and (optionally) provide some reasonable defaults. As you stated previously, the defaults can be overwritten if desired. > Then I saw this: > >> +BAREBOX_INJECT_FILES += rk3568_ddr_1560MHz_v1.08.bin:arch/arm/boards/rockchip-rk3568-evb/sdram-init.bin > > My understanding was that this file is the code that does the SDRAM timing > calibration. So I expected it to be SoC specific and therefore in a more > generic path, not the board directory. > Am I missing something here? As far as I understand, the binary contains the SDRAM setup (rows, cols, etc.) which may be board specific. But you may want to talk to Sascha for more details. >> +BAREBOX_INJECT_FILES += rk3568_bl31_v1.24.elf:firmware/rk3568-bl31.bin > > That's TF-A right? Yes. >> +BAREBOX_INJECT_FILES += rk3568_bl32_v1.05.bin:firmware/rk3568-op-tee.bin > > I expected these files to be board specific, but they are in a generic > directory? Also, I would expect those to be built from source. Again, Sascha is the expert here. For all I know those are SoC-specific and barebox expects them to reside at this particular location. Indeed one may want to generate these binaries from the mainline sources. However, at the moment those sources are not available for RK356x. Rockchip tends to provide only a binary blob when a new SoC is released, the sources follow about 1-2 years later. So what do you think? Are there any things in particular that can be improved in a v5? Or should we leave out the barebox.rockchip.make altogether (and maybe add it to DistroKit)? > And about the suboptions: Do we actually need them? I mean, if we copy a > few extra files, then barebox will just ignore them, right? The intention was to provide a switch to e.g., disable copying the binary TF-A blob in case TF-A is build from the mainline sources. I think it is cleaner that way, but I am not going to insist on that this is absolutely required. What do you prefer? Best regards, Michael > > Regards, > Michael > >> + >> +endif >> -- >> 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