Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp646469lqh; Fri, 31 May 2024 11:49:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVJDYcEGZR/YF7DeCx8C/7vaijdhDGOdKHrELhPlrLceP9QzCZLuv0XAITLYL7pch52tVo8G2sm54DZEBApQaaPleLgS06iPTndh+b4tw== X-Google-Smtp-Source: AGHT+IFefJR9OEtSXmlHohEP1JlTJD1DE3FFUO6jT2fNs37nNcVcfQmvjZa2/Xiy9CbUk0J6lJLR X-Received: by 2002:a05:6a00:138c:b0:702:4a0a:145a with SMTP id d2e1a72fcca58-7024a0a1d43mr2683802b3a.34.1717181344883; Fri, 31 May 2024 11:49:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717181344; cv=pass; d=google.com; s=arc-20160816; b=pHxtRtDvgYpE+jigZs6qG09Y0o4FK1x5lVkzimW/hpMBSbhc+7KT+hIV9NdUPLBC4b mQE7MZgjk9jvoM4wQkKiPZRrjZhMhZVW31/FnaO2gb7brF8Mc87xh0pj3ukvZ75FkuWf nQfGzILQsLHkilqiArCF+dUpkShXHs+zy12cL7G59MbsjA1uFkRSW1B3JcINL99glqS+ Nj2jYzahw1jA+z/UYV0yXyBGFrvU7KP3aHSbkgn6niYjWhyfe0nVbiwnM7SKEs8pozp8 K/vtU12eqXasRoWddqUDtWeTJKvMqq5DPbcT3cj4VPhXmzc9AlrLzS3aDTsFfn384GUE yS0Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=jHfsJjRLJ1FalU+iT+PRPOfmAnGzkkDikY0hzaLb6uY=; fh=TKzriue2GUeeAaeCcsxYhj4rSgLFqd8zVOnfBYEv9yY=; b=Wx7jtW8dxPUIT/7UJcHst9Bw6uwZL9O5CCnZc0w7sqDp/ShV/WcTUWZLP3pGz1pGCy /G27IWOP3KAXKKhfqTqk+GLx+Cme/qVS1+nIEwneY2a/wBrGE5rmBDR4EKQRk8osCSlC HqKNT6/vdYyP8O7vaP1wAt0t9BDieFfMTtqQeTyKVwxLiUaYEKWII90LYMsydi9rKfb0 J7BPDhIl7Gr6g5PyPdLzmrZZpWwe3pAPB0fd/rFEcqFHTxk+JEzeBUmkAcCUrZiuHO9u btN6bXD7BUJ4WxXaxQblFksC7Wqtp+nBGHUK+1tagVfZUGtv5gKv6wsAmAgMFpkPqA6N TJnA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iRXOkkXF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-8361-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8361-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c359e0977fsi1989036a12.318.2024.05.31.11.49.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 11:49:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8361-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iRXOkkXF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-8361-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8361-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 600CEB216DC for ; Fri, 31 May 2024 18:49:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 813F37E774; Fri, 31 May 2024 18:48:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iRXOkkXF" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4BA031CA89; Fri, 31 May 2024 18:48:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717181333; cv=none; b=iu4ymB+wQK/o/T6h7h/MGZtIVRR077LE/3CO9m5Dmgpp9317ECERr+JDoiZkSj/WkBATebWliw6D+ozHLVyHxVF83Mn0fFMyNEDX0LJIsqWqD2V4L16hLABkQ9JyeDXB9bspcDHU4xO22IKPdd/1BOwmIh/5Gm3qLmIu/axxHWQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717181333; c=relaxed/simple; bh=InHs5IlHaGH8QXWp5MZ3tO39zwGHEU52P7U+Epwe+Nk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type; b=mmk2ShhVbQH/ac34lOusYuHhlyqDXwSyT7mjERcAdWLgu5bBqA5l55xg+fkRAicdfED/V9GzHFsUizmNYrCymt3PwSh34dvNDShLiWrGHY3RcYQP017IXD75Q/BNfUpso6G3W0vh7L00lFv9Lz+PZNTcOHPfG4DhUnrGbYqsR6Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iRXOkkXF; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5BC4BC116B1; Fri, 31 May 2024 18:48:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717181333; bh=InHs5IlHaGH8QXWp5MZ3tO39zwGHEU52P7U+Epwe+Nk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=iRXOkkXFwmarXd5Mto/pTf8VHhCebO7MFmwDWoSvgRRF76ubvDqW0E3zq+C/4LiYZ vGY2BuaKzVXJ2nl2lBT0TWYH+ettez0yzrIn3wqQQ7gD04LwAPmj5PXrtxsGMhfRnD BNNaaLSwMqm2+xKVL1S4wm82k3298hgqDehtn7G90wiv+AZhuUeORVeI9g7jnkowSQ MJfP5pQH8VRafBAbO5mLD6gAAo5m+oOq31uTDhNltDxxfEdpOCiGlqy9oG8esdYYRq ikq15qgeLJRKQMXVgFU4NFY492ixFMuan1bl6jsxGR3/Cwtmn6Pf+SxNumdyTybWep pLZ4+oZNXRxlw== From: Kalle Valo To: Bjorn Andersson Cc: Dmitry Baryshkov , Bjorn Andersson , neil.armstrong@linaro.org, Konrad Dybcio , Loic Poulain , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, Arnd Bergmann Subject: Re: [PATCH 01/12] soc: qcom: add firmware name helper References: <20240521-qcom-firmware-name-v1-0-99a6d32b1e5e@linaro.org> <20240521-qcom-firmware-name-v1-1-99a6d32b1e5e@linaro.org> <878r03csxn.fsf@kernel.org> Date: Fri, 31 May 2024 21:48:47 +0300 In-Reply-To: (Bjorn Andersson's message of "Tue, 28 May 2024 21:28:54 -0500") Message-ID: <87ikytvmuo.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Bjorn Andersson writes: > On Mon, May 27, 2024 at 02:42:44PM GMT, Dmitry Baryshkov wrote: > >> On Thu, 23 May 2024 at 01:48, Bjorn Andersson wrote: >> > >> > On Tue, May 21, 2024 at 03:08:31PM +0200, Dmitry Baryshkov wrote: >> > > On Tue, 21 May 2024 at 13:20, Kalle Valo wrote: >> > > > >> > > > Dmitry Baryshkov writes: >> > > > >> > > > > On Tue, 21 May 2024 at 12:52, wrote: >> > > > >> >> > > > >> On 21/05/2024 11:45, Dmitry Baryshkov wrote: >> > > > >> > Qualcomm platforms have different sets of the firmware files, which >> > > > >> > differ from platform to platform (and from board to board, due to the >> > > > >> > embedded signatures). Rather than listing all the firmware files, >> > > > >> > including full paths, in the DT, provide a way to determine firmware >> > > > >> > path based on the root DT node compatible. >> > > > >> >> > > > >> Ok this looks quite over-engineered but necessary to handle the legacy, >> > > > >> but I really think we should add a way to look for a board-specific path >> > > > >> first and fallback to those SoC specific paths. >> > > > > >> > > > > Again, CONFIG_FW_LOADER_USER_HELPER => delays. >> > > > >> > > > To me this also looks like very over-engineered, can you elaborate more >> > > > why this is needed? Concrete examples would help to understand better. >> > > >> > > Sure. During the meeting last week Arnd suggested evaluating if we can >> > > drop firmware-name from the board DT files. Several reasons for that: >> > > - DT should describe the hardware, not the Linux-firmware locations >> > > - having firmware name in DT complicates updating the tree to use >> > > different firmware API (think of mbn vs mdt vs any other format) >> > > - If the DT gets supplied by the vendor (e.g. for >> > > SystemReady-certified devices), there should be a sync between the >> > > vendor's DT, linux kernel and the rootfs. Dropping firmware names from >> > > DT solves that by removing one piece of the equation >> > > >> > > Now for the complexity of the solution. Each SoC family has their own >> > > firmware set. This includes firmware for the DSPs, for modem, WiFi >> > > bits, GPU shader, etc. >> > > For the development boards these devices are signed by the testing key >> > > and the actual signature is not validated against the root of trust >> > > certificate. >> > > For the end-user devices the signature is actually validated against >> > > the bits fused to the SoC during manufacturing process. CA certificate >> > > (and thus the fuses) differ from vendor to vendor (and from the device >> > > to device) >> > > >> > > Not all of the firmware files are a part of the public linux-firmware >> > > tree. However we need to support the rootfs bundled with the firmware >> > > for different platforms (both public and vendor). The non-signed files >> > > come from the Adreno GPU and can be shared between platforms. All >> > > other files are SoC-specific and in some cases device-specific. >> > > >> > > So for example the SDM845 db845c (open device) loads following firmware files: >> > > Not signed: >> > > - qcom/a630_sqe.fw >> > > - qcom/a630_gmu.bin >> > > >> > > Signed, will work for any non-secured sdm845 device: >> > > - qcom/sdm845/a630_zap.mbn >> > > - qcom/sdm845/adsp.mbn >> > > - qcom/sdm845/cdsp.mbn >> > > - qcom/sdm485/mba.mbn >> > > - qcom/sdm845/modem.mbn >> > > - qcom/sdm845/wlanmdsp.mbn (loaded via TQFTP) >> > > - qcom/venus-5.2/venus.mbn >> > > >> > > Signed, works only for DB845c. >> > > - qcom/sdm845/Thundercomm/db845c/slpi.mbn >> > > >> > > In comparison, the SDM845 Pixel-3 phone (aka blueline) should load the >> > > following firmware files: >> > > - qcom/a630_sqe.fw (the same, non-signed file) >> > > - qcom/a630_gmu.bin (the same, non-signed file) >> > > - qcom/sdm845/Google/blueline/a630_zap.mbn >> > >> > How do you get from "a630_zap.mbn" to this? By extending the lookup >> > table for every target, or what am I missing? >> >> More or less so. Matching the root OF node gives us the firmware >> location, then it gets prepended to all firmware targets. Not an ideal >> solution, as there is no fallback support, but at least it gives us >> some points to discuss (and to decide whether to move to some >> particular direction or to abandon the idea completely, making Arnd >> unhappy again). >> > > I understand the desire to not put linux-firmware-specific paths in the > DeviceTree Me too. > but I think I'm less keen on having a big lookup table in the > kernel... Yeah, also for me this feels wrong. But on the other hand I don't have anything better to suggest either... -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches