Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp3069041lqo; Tue, 21 May 2024 06:09:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWoF+BKhBPK2rfoFDkiMNIs/0hCzomqNfZcUQlhBS5cpZt/1A7uc5B8L+Uxu4rIWqa/eENmGpqYAefsWxJhx+i8S5x2c9B4aoFDn0+bKQ== X-Google-Smtp-Source: AGHT+IFqjSl24sE5YTb0wcn6OxgfIVR2YRNpf3g/H3/wMyFXMx1yLDggPL5Hi9jQ4VnvPRiGOIPL X-Received: by 2002:a17:90a:b388:b0:2b9:fc72:547e with SMTP id 98e67ed59e1d1-2bd603e3232mr12834859a91.18.1716296986477; Tue, 21 May 2024 06:09:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716296986; cv=pass; d=google.com; s=arc-20160816; b=a3NolN1x5DYHIHrFLp0Dw19dbqmvVr4UNqi9GOOjrLtK7bT4rZi40oebHwR08RyH43 HZRhCncWBWODDv1D5mhWlCHXwnOR1NlVg3b272EGBxWdr5ms+W+1nLm4gqaQlOpw+6S6 P8gbRIQgEHvYwI4ri0MRZVf/ZdbwA1BJCLXRtmuiOsPjE+3UrN9ogig1XVDpL8LAgBXf wCa7x5VxZkyR32sN3eDgQUEnviukCFBzuRn3kqOU4d1eZqsJKp4de9e48OoiE5xSaZWK FPV20rDtPOX7Bn97KAY7JeN8/27iyEerHFkpcoFwlwEnSvJccAB1H2Jcm6WoZJfUOjN/ 9CYQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=d2PojWB/4MiGFiYJ2E5IG22IJxNV6CKEtX3InCIg1mk=; fh=r6hkGcGjzAS0+c6Rk5LVlpIGxv4iqdN7tN7azPGaHBM=; b=qapphDtA1AdFn5AgPcdJAJ5p8kHd3jH8t8gHezDnsWQ6WepmC89xA/LcViNN/CIvPy AtvuATavyjhNg5M0jPdT4otxfd2jFmt8uVw9QNQ0X2Bi47JG+9+yiRsZ52wIlsyRV1om MEKasXnqM/y2SDa9Zkqh0S9wgdov4Csjxxa7UXQzN3jfwsxc1NUBBxE01VwitQBBxXy1 Ev1fCLN856k+7zyImzhPMPhd83o9o9bdNMecxFSp4scqdiBjV4vqEsigSWL+hYFC8+od 7G4op5CKOvpk4TYFt72ER8p0iQpqE2RTvZaD7cW66PBv8Cn2gxr77lEBJbMEutsX22Cb TIwg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uqoFChUI; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-184995-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184995-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2bd6858d251si5502984a91.45.2024.05.21.06.09.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 06:09:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184995-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uqoFChUI; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-184995-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184995-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5D423283E84 for ; Tue, 21 May 2024 13:09:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B8AE78C65; Tue, 21 May 2024 13:08:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="uqoFChUI" Received: from mail-yw1-f169.google.com (mail-yw1-f169.google.com [209.85.128.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 421F37D3F6 for ; Tue, 21 May 2024 13:08:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716296926; cv=none; b=so17xlFmMNGuWLGmI32Ut2H0BBTZDjMbQWc7Fm7/CZbBjni3h+eLr1TFJhJdKV1jFlmNL5usxmd32qNcZm83iSwTj7fh3NmBIP+qr59PUti0wf+4i6hn5vNO4MZgTtDD9OXxEYL569W04+SNUbkiK2ML2KrDvq7JPQnqV1zmjC4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716296926; c=relaxed/simple; bh=Vo1WEyGGZPhdnMPdwMM9V9kHG3COuto8rHsF1dB412c=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=fR8KxBDlm7U31JWBK0FxsZfFBWxFWmkfWf71n8oAE7yk3HTTnsyQtt+vv0EiqQD6R7CNh15xjfMaRG5u3krXYK36MX7yt4wStCJubRFj3AHX2I71rWHXE9N4Y2vJWED26k6PEEf67Xd/aE5R7x83ZXJrKsOCrEl3wxmOI67xfpg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=uqoFChUI; arc=none smtp.client-ip=209.85.128.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-6277a2bb35fso27970227b3.1 for ; Tue, 21 May 2024 06:08:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716296923; x=1716901723; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=d2PojWB/4MiGFiYJ2E5IG22IJxNV6CKEtX3InCIg1mk=; b=uqoFChUIvUq3OL/O30lMVoHetUHz3LZ1JxQ/2/tiGw9kmQytMElui9oDZX4sY5xvgZ /ke97AQ5pb69SVfOU2B0ih8M0DbEVylS3HULirAwZG75uKaqppFwBRwbzkPQTywAteFy eVWJOmyu/HwZyHBHrwZ3FFGbM0UNHZ3j1pS0kkN/m+o+z84+ODeIV/lJXrNJc9pOJ5UN sWNCPnVxSYN5UnC1YWdNm23lsktSYU6hsifnxqU1s/v7q0mLbvmyWoJPZNU8narSvTum Xpb4AG4VGqFKmSnTD9CKfgP3d5rTSRLj0L0+8mITvOHP+huR3Y/W7a94BAD1VwCCEdux CMBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716296923; x=1716901723; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=d2PojWB/4MiGFiYJ2E5IG22IJxNV6CKEtX3InCIg1mk=; b=lrJ3vk/GkVwFXHiS1kYJGPgCAnYh5sVOuuCPK6ODioZXYJnEy9qM4ZbVO7C8SshlpX /Rt4AAd5yfYj57/wImnJZa2/qM8ivEOotqrYuS4xNLH6owDbPYF3+/tX2D43Volraj6Z 8Dgc6LnyK648mV/Bf99aw3cBzUioZXLpwfcgw/4Q4b3VqUQMsSxoHYWc7z2GQ4oLEqzw q+G/yKaveoc5EYNIUAaFx6IOovEKi3kdgm5sL3rtfjfRT8eWiYssrZIJOZ+qDjaaGiNE eRLs+r8P0nykclN7At3NAAq//XL29S3xXiebGZVJruM55RTFStc5fpOj7A0GtKYLm008 5n1g== X-Forwarded-Encrypted: i=1; AJvYcCWH6wjDaU2Il4EQVZPI/kGPPNPkSe3b9A5elWIx38w3EqhcPp67VuhWxv0KbtwAjrVvDgLE01/aFczOnaqdRdGg6tbc/vKHanO3CERv X-Gm-Message-State: AOJu0YwFlejAAh5YGd2e5IHNqxQR6MC0bVVlYjrNO1VclZE2OHgMN3CU aC3QyWeTmLGRqLflErdtEUPP7Fk7Ina4Ke5HH+0lxHPF0Hn7yGNglkeKI7Y7h6z4ZnBRTnYu+tY prLpRRiPViUU7OfbzM3xWYhehFj7JUX8Dal6zCQ== X-Received: by 2002:a05:690c:7442:b0:622:f7df:aa0a with SMTP id 00721157ae682-627972d3d56mr59212357b3.22.1716296923240; Tue, 21 May 2024 06:08:43 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240521-qcom-firmware-name-v1-0-99a6d32b1e5e@linaro.org> <20240521-qcom-firmware-name-v1-1-99a6d32b1e5e@linaro.org> <878r03csxn.fsf@kernel.org> In-Reply-To: <878r03csxn.fsf@kernel.org> From: Dmitry Baryshkov Date: Tue, 21 May 2024 15:08:31 +0200 Message-ID: Subject: Re: [PATCH 01/12] soc: qcom: add firmware name helper To: Kalle Valo Cc: neil.armstrong@linaro.org, Bjorn Andersson , 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 Content-Type: text/plain; charset="UTF-8" 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 - qcom/sdm845/Google/blueline/adsp.mbn - qcom/sdm845/Google/blueline/cdsp.mbn - qcom/sdm845/Google/blueline/ipa_fws.mbn - qcom/sdm845/Google/blueline/mba.mbn - qcom/sdm845/Google/blueline/modem.mbn - qcom/sdm845/Google/blueline/venus.mbn - qcom/sdm845/Google/blueline/wlanmdsp.mbn - qcom/sdm845/Google/blueline/slpi.mbn The Lenovo Yoga C630 WoS laptop (SDM850 is a variant of SDM845) uses another set of files: - qcom/a630_sqe.fw (the same, non-signed file) - qcom/a630_gmu.bin (the same, non-signed file) - qcom/sdm850/LENOVO/81JL/qcdxkmsuc850.mbn - qcom/sdm850/LENOVO/81JL/qcadsp850.mbn - qcom/sdm850/LENOVO/81JL/qccdsp850.mbn - qcom/sdm850/LENOVO/81JL/ipa_fws.elf - qcom/sdm850/LENOVO/81JL/qcdsp1v2850.mbn - qcom/sdm850/LENOVO/81JL/qcdsp2850.mbn - qcom/sdm850/LENOVO/81JL/qcvss850.mbn - qcom/sdm850/LENOVO/81JL/wlanmdsp.mbn - qcom/sdm850/LENOVO/81JL/qcslpi850.mbn If we look at one of the recent platforms, e.g. SM8650-QRD, this list also grows up: - qcom/gen70900_sqe.fw (generic, non-signed) - qcom/gmu_gen70900.bin (generic, non-signed) - qcom/sm8650/gen70900_zap.mbn - qcom/sm8650/adsp.mbn - qcom/sm8650/adsp_dtb.mbn - qcom/sm8650/cdsp.mbn - qcom/sm8650/cdsp_dtb.mbn - qcom/sm8650/ipa_fws.mbn - qcom/sm8650/modem.mbn - qcom/sm8650/modem_dtb.mbn - qcom/sm8650/vpu33_4v.mbn (or maybe qcom/vpu-33/vpu_4v.mbn) -- With best wishes Dmitry