Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1155561ybb; Wed, 25 Mar 2020 17:08:45 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsQuWWDZsQRq0iAFAlIu7KQE3A7XaOq9xefIAn6Us4PhO4ATsSHTag9QLJ9Oe83jqr4eEls X-Received: by 2002:aca:4c57:: with SMTP id z84mr94836oia.53.1585181325234; Wed, 25 Mar 2020 17:08:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585181325; cv=none; d=google.com; s=arc-20160816; b=zn9+rUl2BhOFarwZ3rYkqmO9/0MRfpcD9rQkQ76iTFAms+C3zOkf0n8F+Cvk3RzM/P Oe1VQYp/9KO8PtnYylnJOCOwlx2okXNS/++Bx8sL+I9IlSMEtRK3ZbknmlkH4Cso4H0Q bFUdgP39pmtbi4FZZmSdgcicdq/cAYYoo55/kGWf409WcBqD9OnY+fhAG9mFxkFs8/Cu FvpoD/RC4yK+swQtGAfEnpCTBP6JO7q4esLj9ZHUGhOR2Xu5DqSjru4n+dDgD1fMTOfU QJ/QPa2PLgrNGaXN/O6TVZKXI1gRHEMtVJm690dI2yKbZF5OMQ2tlaN/Cvfxe3aysb/e bZiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=D0CV0Uku18oFuW+TPNfaEyxgPkTMYFP8ObQ3tAgtOsc=; b=CKSANz5AG1m5reG44uff2FAtJ5EA9UCWfImp1m1BwFT6MKugMW8B+Q2fYhRy/LNdkS l1nZy/eedGHufx3pm1oR88Kz/aqJgMNxY/2rETXNG9+BSTWhMxhnIBYBmCI36/xOCcVg PRJB50S6bnXjgecsTvEXtmCdVANcZHwJ5TPXKS2SVeyxpYy5zXVytBfCdROb8fOg/F0K /yZ2ueZrzMS8zq//dmAzk0siuww3T76V3fCKXcafecl+QQqZ5F8sJvX67x0LxB1LRVMn g2X1IAiJ7Yzr1Ru2w9jEmfjCyXbsaY4e7cTIbfNR2AVCCv05G1zg6n3ybyHmvZi/l7C6 l13A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="SBVg/zWs"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a21si371155otk.277.2020.03.25.17.08.32; Wed, 25 Mar 2020 17:08:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="SBVg/zWs"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727607AbgCZAIC (ORCPT + 99 others); Wed, 25 Mar 2020 20:08:02 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:38144 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727498AbgCZAIC (ORCPT ); Wed, 25 Mar 2020 20:08:02 -0400 Received: by mail-pf1-f196.google.com with SMTP id c21so1228793pfo.5 for ; Wed, 25 Mar 2020 17:08:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=D0CV0Uku18oFuW+TPNfaEyxgPkTMYFP8ObQ3tAgtOsc=; b=SBVg/zWsk52JKcc+nEzqXNzg7w+HdPM+lrL+HI2UtDuTis6PRGJW94M/+n13O7YFJ6 MkyiHnm+qz/wx068nDs7rRLD8Mxv0/d1wvd4ydeatxtcR8oeIo1jgdzPJWoBiWLOMy5D Sr7aD48oUo1BGco1e4RkKs/cV4d8PChb5tGcmIVWLw4+gCx6zjSNiIkgcushvn7efvzG 2NB35CZPdE1L9jj/4rXITMdF2rI03jjFSk5pQtNPgT9t6zFYfBB69DlnPNvdf0FaIVyh RdJT+9KPjhHtw68UyMFICMBQNtihr9TcRKOx34/0Fr0tHKLMzLfslUmpoZ/zH8vX9jx/ Av0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=D0CV0Uku18oFuW+TPNfaEyxgPkTMYFP8ObQ3tAgtOsc=; b=tPrDqs+Pds6UznKJL8ojCtsCwFzxwLb9ViwQaShBaOkXgFLxYz5xzK160fiQbWuA8U SD8v0pfs74Hn0y1lTHglId6ED2Y5pjo+jX1U/vj9H9HjDTzNG2te6eyKi7AxdXryrT0V 802thM/1zA2ZVmXjynbEJwgrjss47xfJJtdJrDm269LQVfveuEiOQM16ZP1aMNC+qgtj OV/+ABGBb2RT3FqYHnmWc6GPPO9QCMsOokrqei3tDDFSwLdjHoKKlTWluOdiIyFYODpo wmMkvUERarR59jQZ0Fg9XnvhI+DTwpHvYgY9i1rvUlGNQXkCri1zK8NyKInlcRZuohVb Qu0A== X-Gm-Message-State: ANhLgQ2C3wVkzKE8eBkqsqFG8q9C4ennaW5TwqxQQF3E3n+nqNve+Tuj xMDpfvnzoaTAT8VlzYfZHSkhCQ== X-Received: by 2002:a62:2e42:: with SMTP id u63mr6197087pfu.69.1585181280449; Wed, 25 Mar 2020 17:08:00 -0700 (PDT) Received: from minitux (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id u12sm227537pfm.165.2020.03.25.17.07.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Mar 2020 17:07:59 -0700 (PDT) Date: Wed, 25 Mar 2020 17:07:57 -0700 From: Bjorn Andersson To: Arnd Bergmann Cc: Andy Gross , Rob Herring , linux-arm-msm , DTML , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] arm64: dts: qcom: sdm845-mtp: Relocate remoteproc firmware Message-ID: <20200326000757.GF119913@minitux> References: <20200302020757.551483-1-bjorn.andersson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 25 Mar 14:13 PDT 2020, Arnd Bergmann wrote: > On Mon, Mar 2, 2020 at 3:09 AM Bjorn Andersson > wrote: > > > > Update the firmware-name of the remoteproc nodes to mimic the firmware > > structure on other 845 devices. > > > > Signed-off-by: Bjorn Andersson > > --- > > arch/arm64/boot/dts/qcom/sdm845-mtp.dts | 7 +++++++ > > 1 file changed, 7 insertions(+) > > Hi Bjorn, > > Sorry for the late reply, I only came across this one while going > through the pull requests > that we had failed to pick up earlier. > > I really dislike the idea of hardcoding a firmware name in the > devicetree, we had long > discussions about this a few years ago and basically concluded that the firmware > name needs to be generated by the driver after identifying the hardware itself. > I remember this discussion and generally I share your view, but after postponing this problem for years we've not managed to come up with a solution for our problem. > The problem is that the firmware generally needs to match both the device driver > and the hardware, so when there is a firmware update that changes the behavior > (intentionally or not) in a way the driver needs to know about, then > the driver should > be able to request a particular firmware file based on information > that the owner > of the dtb may not have. > There are three variables in play here: 1) Large feature differences, e.g. does your modem Hexagon have associated RF hardware, or is it WiFi only. Or other similar things, which does affect DeviceTree anyways (memory maps, audio routing etc) 2) Purely software versions of the firmware. Generally no impact on remoteproc level or the immediate layers above, bug fixes etc. 3) Vendor specific signatures. All these files are signed with vendor specific private keys. None of these affects how we describe the hardware, so we did choose to use a compatible per platform and remoteproc, e.g. qcom,sdm845-mss-pil will handle the modem core on all SDM845 devices, regardless of the firmware implementing WiFi only or it's a devboard or a product with strict signature validation. We could add another property in the DT node to denote if the modem RF hardware is present and have the sdm845-mss-pil compatible result in a selection of qcom/sdm845/modem.mbn vs qcom/sdm845/modem_nm.mbn. This would handle 1) above. But this doesn't solve 3) and my Lenovo Yoga C630 will refuse to load these files, as they are not signed by Lenovo. For years we've toyed with the idea of building the necessary firmware path based on e.g. information from DMI (which not all boards has) or somehow tokenizing the machine compatible. But nothing sane has come out of these attempts/ideas. So after years of not being able to send these files to linux-firmware, without breaking some other board we decided to just describe these variations using firmware-name. So this solves 1) and 3) in a straight forward way, and so far in all cases we've handled 2) by upgrading (until now, our fork of) linux-firmware. But I don't have any suggestions for how to solve the case where kernel version X and X+1 _needs_ different versions of the firmware. Lastly, most variations in firmware features are discoverable by the higher layers, but for the cases where the remoteproc driver itself is affected we're looking at changes to the memory map, clocks, regulators, power domains - problems that has to be resolved in DT anyways. Which is the reason why several companies are looking at passing dynamically loaded DT snippets with their remoteproc firmware. > I'm holding off on the pull request for today, maybe there is something we can > still do about it before the merge window. > The binding addition was merged in 5.1, with Rob's r-b, in 5.5 we used these properties for the Lenovo Yoga C630 and in 5.6 we merged the equivalent change for the Dragonboard 845c. If there is a solution that allow us to move away from firmware-name in DT I'm interested and would like to see us migrate towards it, but the only thing this particular change does is to make the SDM845 MTP find the right files in linux-firmware, using the already existing binding and implementation. Regards, Bjorn