From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Thu, 09 Dec 2021 07:11:54 +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 1mvCeo-000lre-Lv for lore@lore.pengutronix.de; Thu, 09 Dec 2021 07:11:54 +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 1mvCen-0000Th-Qa; Thu, 09 Dec 2021 07:11:53 +0100 Received: from mail-am6eur05on2087.outbound.protection.outlook.com ([40.107.22.87] helo=EUR05-AM6-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 1mvCeF-00005c-JG; Thu, 09 Dec 2021 07:11:20 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dCXB6c1/MqexKeYPQOlSqj0l3oUsggeiWKsJPXYOEhLnQwRAJ3h0iR3QvlLazWEbctOFoik4Lt/rLaHwciXobdxNjq8DYyP3mNSUU23CPRRoVyCjDXRnQGJnbLUsuj1GUV8biRn0jEuwfDHNLWMXH8+3BQywVKYu9ymmENfsnbIUjPdULORkWJil3HDWerGk9zarh3A6/C+a2QN7tIbI642cryURn5ArKNgHCMTIWq1DTg+USJSz6bhb668w9oqWn0HmeA57laYjs1uWePiSvaTTln7WXyDElPY01MzBGVO34rOaNjsbBokev0F0IiS47XwTNZoJvnBsM39pWQsO0w== 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=541RDcoMW/9IbTY3gM99s8alR9N7cXQ9MH2kAf+k4K8=; b=lbuT4DMk460qd1pIeAfQdepNV+FzPVwdy3ZeinLXH/wM4HvxJS9yok/GNCT9S/sQ7XaN8M5ApO2nFRE4bZh+euJvUN21jriD0sXiMM25yuAZlo9e7VXpEMyIjtNKK94iccGqiOBKBpyQIEnfpASX0c5MGqFABcqE0XKussHgBWosJhHP3gk9+rkgi/8XqsSL3yA4IrcLfMx5Q7m0K9eCDhMBHc09dYlP2V33YoRYQ2UQGG96dg4xKu6UMLZ7lmT7LIoyWdZPWYmRyU6fKS1vancz5n6X3HeSoA45uiYjwpqA0NXhLDuFW/s5G+C5qCTowI6p1anxZusmtUZad1C7bA== 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=541RDcoMW/9IbTY3gM99s8alR9N7cXQ9MH2kAf+k4K8=; b=qJpfp4OKesEiUTkcqwzXKI+1C+kuUfmeIraqNlB3YangMGmhyJ+5/xl5Jg7WndeJ1N539l01W9JWjBBI1pZa/WGAymqYVd6E6TqTeiT2uKy1r2DkLTzj1LHoeHIrt8SthuFP00Usxm8dsWFmU0M8bwoY/RcoEeMsUjhzjVoZRN0= 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 DBAPR08MB5688.eurprd08.prod.outlook.com (2603:10a6:10:1a0::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.16; Thu, 9 Dec 2021 06:11:06 +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; Thu, 9 Dec 2021 06:11:06 +0000 From: Michael Riesch To: ptxdist@pengutronix.de Date: Thu, 9 Dec 2021 07:10:49 +0100 Message-Id: <20211209061049.2975739-4-michael.riesch@wolfvision.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211209061049.2975739-1-michael.riesch@wolfvision.net> References: <20211209061049.2975739-1-michael.riesch@wolfvision.net> X-ClientProxiedBy: ZR0P278CA0140.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:40::19) To DBBPR08MB4523.eurprd08.prod.outlook.com (2603:10a6:10:c8::19) MIME-Version: 1.0 Received: from charlie.fritz.box (2a05:1141:1c9:7c00:2971:328c:3026:3149) by ZR0P278CA0140.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:40::19) with Microsoft SMTP Server (version=TLS1_2, cipher=) via Frontend Transport; Thu, 9 Dec 2021 06:11:05 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fb99cd08-8201-4bf4-96c0-08d9badaaf7a X-MS-TrafficTypeDiagnostic: DBAPR08MB5688:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1332; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pbkX+vzlp8DAN3HxZl7G8hCz6ihOB/lfR3Nix/Q8gvcHSFjVHfGqyUzSQURaQgz8Pa2N/bE5kG81ZVsd8xAfcflftC+gJJZq4OqXfl8Jls4JbRdRVPr07Ufiv9+b8pqjsPC9DRQO1SCn6Wl1dyKqyBIRTylYnsQeWIx8b39ciEqCSVffOHi0teNTfoYo2BUF5bzMHel6f6snU9a6nTrgVhqTxv7Kz1/Io6hfk4fp81GdfOKXWakPO3NprPiiQtkfAGnGaJ4km1nM3PVDMwDYACilcLcSIYGzxmi2xFdzDI/xkHgvZDm2/Vi4OGLRmZANPNaak8VB8qv2BIHyFLl5zqP9cqqYo8ZD+cS8Qe+o9BYslX0y5KySX4Rad+lVVxBlS6Zsa9gz3ybplvfgBXbyMW2R/FACks3yPjQ7xWX1ejrtZAQ1IkAW7PDyYegTLXG2/SYG8pujaISkDH45ZIvxRZrLRfvYjxkhCoQYHeE6GKJTKop+h5okQXQZYRcUxEC1KmGE/BONbYC8Pu2WT95LBdj1Dk+fyTgayl5rOWwoj1acNR5beUJZVSEOQc763ErlPzhEFxRIp/cF6Ljpio9yyS6JzLos4u0xUXjmfWWeBPIrSuU5nrdiWXnHHblAq6qglUk8i/7Nl3+pjOP3W5Hz5w== 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)(44832011)(66476007)(66556008)(8936002)(2616005)(52116002)(66946007)(6506007)(450100002)(508600001)(4326008)(6486002)(6916009)(38100700002)(6666004)(8676002)(36756003)(2906002)(107886003)(186003)(86362001)(6512007)(1076003)(316002)(5660300002)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?xeWOTjuFfAy5usO0tOWmIug5fnAu7aTEHk785xGoL0Dr0j0xPLYZ8rzOZavd?= =?us-ascii?Q?ePOGE2DZ6N1Ke6y64WnM8+XLZYGIQ2xYCMSOfW+bsyz8Wi189uqFSSI654LM?= =?us-ascii?Q?ZQ1xxFgS/bQ5EqYYqYbktahsC4WdRhR0r9DNYoT/cTnZPFaJsZhlggbcbq/h?= =?us-ascii?Q?1h84XBkwO8Y6is1Q9RkB20XlmaVbs1ETt2jAXIlySj0ffc5GybJpSvGRc35W?= =?us-ascii?Q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Aqh9Oii+TbCnED?= =?us-ascii?Q?gv2FA4fKI+U8s6TfAwBzzK/86u8OfgKS2NRj7s4qprxxixN85yZMTTgRKxCA?= =?us-ascii?Q?AhcUVNc7pemucagH6xVv7es4J6tWHQV8xP2lU9HBEICBECpK9SPvNLVCnI3z?= =?us-ascii?Q?qrPPDzQAprY+D23cgkriIfXqiq0KLz6y/ggDLLEoZvzQ/jyyZ8BV2kRKPAqG?= =?us-ascii?Q?tT9vrSPk7zQwnXE4LFwnz36iON/tGDaDhfan8EPtwSDIGcxgVq6nCjvIUwCQ?= =?us-ascii?Q?/yPl3fmS8P5ZN0o2UPPljlugRIPwYUg6TyZiX9kpzFc8G2iGPRVRITsLBAD/?= =?us-ascii?Q?rvN9Ces6KAHMVWb+oZrsYk8ZK9oNT79sYS6umAW0365d5MZP0bO/X/vGt5d9?= =?us-ascii?Q?LnWd8MXheQFz5tXYkmxUkOqwkKmjz/HVrOQFeOfpwopUrcEtf3rbuWrnvuTy?= =?us-ascii?Q?J3KN+xjOo1jGs0W14YAf1W622NXQfljaLhvfytYNk8WhId9IRQslEuocq+E0?= =?us-ascii?Q?kF6AR3prsE0ggYXyfP9EvBGdw73gmxXK7GLoBF58foZS5Q/TiwP6XU/IJTdY?= =?us-ascii?Q?tEuJHXv49LGUpXV4Nf13OCDVUkydOhwF2ThoKwdOg1HSm4ovOddgAR3cVhQP?= =?us-ascii?Q?QoAWBgi1Nw=3D=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: fb99cd08-8201-4bf4-96c0-08d9badaaf7a X-MS-Exchange-CrossTenant-AuthSource: DBBPR08MB4523.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2021 06:11:06.0658 (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: BzyhPcSw/a61cA1giV0vdrUi5ycb/Lk5MYGSnHa2e1T+a/3ot519L/s8HPPfVNlvc3Gcw/E/FKAhaVxsJjq6//p8jqbQ/Gu84Fh5nXtkHfk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5688 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.2 required=4.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Subject: [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, Michael Riesch 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 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. 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. + +config BAREBOX_FIRMWARE_FILES + string "firmware blob file(s)" + default ".bin:firmware" + 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. + 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