Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp366366lqb; Tue, 28 May 2024 19:29:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVefrFkJxdkKEHlxD4BIKeMn4sQRvEl2tREAaDjAYufXjd4V4lglkQOCJE3+DNF/VoGNopYGmcd+vb6oG7uqXaQXtWcW4NrXceIZBx05g== X-Google-Smtp-Source: AGHT+IFh4HgY2+SXRyznA0HXqjh8DlLe1CZ9Acpmdf+8EZkjy2SdCkCbKj2v50djfeTbr+CaPqfV X-Received: by 2002:a05:6102:3186:b0:47c:2a81:a98 with SMTP id ada2fe7eead31-48a385f189amr12740388137.20.1716949743426; Tue, 28 May 2024 19:29:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716949743; cv=pass; d=google.com; s=arc-20160816; b=KwiifeViZ1zquBVnq0VxzDWYVdnSyAwmA7mFn0Q3rQBXl/MatkAyW4QLJqbeevdi2C WCg6q5hh3q+VVCY2BinbVDD8Y4wnkJCtEdbqOq8QU1qos83VHiWzyoR2RYnYZil5v5yk dKEJ6/5Dih8HSc7WI8XwSUhYkVVXol3KJ9jbqvg7aHGTWW533+YqKRZpD8WsZNdC0aAX yX46wCh6enrQa98cnOTVcyajY2waAQSzOLHbWuhevl5gc+l446agGmEne9IEJuQqQ6YA FdU1DRRRZGfBdLvVmK13Wr+M94N6Txic9hK3PJLx6emSoY+sl08WSGTheSEy4JoNqfd0 kJIQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=zUt5Unmsn7ynMrLXHfg7mqpLsSIzARxsa4WPEr+rUkI=; fh=2gArIIoLplwDO9Na8k/H4ARTxjNqbDBGcxOandotMfA=; b=eDIM1hxc92wu/jHQd9lTcweIXNjMDIOeMCCyNMEtAFNHZXp3ig9G3xU7CyqNXWuQ6+ ECEhcRMlPVaMXVYiKFA15JsdgiyYCSecivO1pPseupOuroZE+1+MMLcJF7XN5r0Ta1Vr NFtZnUqLUix50gQ+5bCQusGAgiKIGJ3Ztl/UFH56dv+8RouTLcKyV3mR+5xqbrbTCLfK nlm3s/O2SeAWvbwtKH8Q60Mu4fU3CEhNDZPakuaLc1KcbYvn+eA8mR3c0doUOAXXkTpa LRP3jsMc2hwNWipGhPN2b6ClQMnD5+2sMXTUkCgP8xv++mVmwJ15+ZrKzBZgT8HnzMoD Oo2g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KoOiWnAR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-8244-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8244-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43fb18a637fsi120833741cf.284.2024.05.28.19.29.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 19:29:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8244-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KoOiWnAR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-8244-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8244-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 01EDB1C20F1B for ; Wed, 29 May 2024 02:29:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F25E615B0E0; Wed, 29 May 2024 02:28:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KoOiWnAR" 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 B6D842AEFD; Wed, 29 May 2024 02:28:57 +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=1716949737; cv=none; b=WSoFdYdCfAnIKN+SuXgwJ6yaUVNZblEr9xBnKRGbg0uT5W7qWQkISRxXcsVUMyyEG2pRCnCttWtr6Bfq4BbcTswqY5lEibTYWcC+Kgdsz7roejCSjymjmmYreduzgd14nanU6ZLiyHXKRjwt7nAcdkDcp7tezZYpxmzKo1nx/0g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716949737; c=relaxed/simple; bh=ZwvUORaxzc0vrGFqCdwHpqmj4IP8E9GxhkTzYLGO4/w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EKFcxhP+LKrwcowqqH3mdQiF6MqOmVm7swi/3UKGrWQYm+j7AoCAi5QN/qG0KQFuDPYl9/VRW6WDoSGFjmQKjG6dIKu2CvLwkHpRF+cKYfO0YPZJe8K41uX6Vca4S0iNM0wosk/VH7Qro5xY2HhvZ6LGTYn5ucZlziilP/2SAiE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KoOiWnAR; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD459C3277B; Wed, 29 May 2024 02:28:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716949737; bh=ZwvUORaxzc0vrGFqCdwHpqmj4IP8E9GxhkTzYLGO4/w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KoOiWnARhGc9ZaTdHga34C//fejSGA1/f5faW0EmsorMft6hRkhydRTmN/aHLoMb+ igEjT3Zo5OXCK8ab8I41PJXqG2UGKzdQXOrHSV/hDEmuSzey92Nfu2dQnGpk9hw2Ox eHLiVveiY8oS4XULy8Q2gH0gby1KpqtcDsD+dzJol2jeBuHv4gH7dQQ9MniEmxY49E KxCL/HSqe3xbuU/B1wgi/7BtrQYL3or3DwxZw5g5AYtyXavyz8NSt7VcoMRy4NPhCG yJ31hRi0SYVuR/ZKhYhyuJ58vc3Cg2yvse7wUcU3mOtkrcBleCdu86PNrMl4Clizrj MSag0j0ZzHLLA== Date: Tue, 28 May 2024 21:28:54 -0500 From: Bjorn Andersson To: Dmitry Baryshkov Cc: Bjorn Andersson , Kalle Valo , 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 Message-ID: References: <20240521-qcom-firmware-name-v1-0-99a6d32b1e5e@linaro.org> <20240521-qcom-firmware-name-v1-1-99a6d32b1e5e@linaro.org> <878r03csxn.fsf@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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, but I think I'm less keen on having a big lookup table in the kernel... Regards, Bjorn