Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3229351rdb; Wed, 13 Sep 2023 06:14:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHq8+2J87qP/osyErYUxALcoX/HDRvngK0CpYnuC4GHMwVbis32YW0mGA+ZuoY0m3QHFi/e X-Received: by 2002:a05:6a00:4791:b0:68e:2c2a:aa1d with SMTP id dh17-20020a056a00479100b0068e2c2aaa1dmr6625771pfb.11.1694610848855; Wed, 13 Sep 2023 06:14:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694610848; cv=none; d=google.com; s=arc-20160816; b=kIj3tQkl7t7473Hzj46xA0GiowEjhHoEY7uZYiS9Q9T9xOh4d1LS3dFmOi2yPS5Ubr ffdhIQdoiQM8yXahaOTuuQcQfMI4nbmaS1R16e3RdmbKA41rzYVcavr6sPA4qeas1XkO Uw0DhcJXvKcOe7aTaX6RxhYllcKmCJjBv4Kp/hGrL3x4Q0zQVCo8ILrfq5/dFIxuuCab bd7fJ6l3+5wI4sw30daQS5qG3Dgx9qzZqii/6l5CxRFjRbhetRZHTZkx9AxREHSQZIBR kQFp0AGX3H9pCYyQ2Dza2cUk/pD3QXB3Gn4Qbe+sXditNUZ/ux9/1FTfB+aMPJ/9AQXC iBCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=npEEuvyrxe+edVufA31/hnBZZi0ug9NLaKIp4p/ndJU=; fh=btiiBbZHnkMvEYAimwdCkkR9JoXvJrT2qt4owYa6Gjc=; b=MKnMrMRoDWblIfkOuVtzd4xRMrgMFeLkkBMqUbq9dqEYp1aplAEGWeY5+ZglFdiIf2 sCb+u1EkzYtyHsneB2v8dXV5vrRmS0WktAqCxkHIUgwM3W0AJSi9GwmNZYnUUe8J3oY6 9XBP9DgeCGfJeKvLgbzf5jAxlu5rhg1yYw5mOVAr2+UBUhksPW9IZDgAMfo0lxDGOEVp QEWcSc1GKLe2Vp7WsoRIMXRuBDIcdHt+D1+TXFkC4sWv2BvsdQflklYyBHZC/npQZsHa gOZoVq9sPpzt838t+v0r3GnCG7zdG6Q+KqXJBa9C3ODJtFvAALOBbG1lOGfpjD34q8bI uPNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xvn4CJCp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id e12-20020a63db0c000000b0056adccb7f97si10252363pgg.93.2023.09.13.06.14.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 06:14:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xvn4CJCp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id EAF6E80AC478; Wed, 13 Sep 2023 02:07:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239223AbjIMJGu (ORCPT + 99 others); Wed, 13 Sep 2023 05:06:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239220AbjIMJGt (ORCPT ); Wed, 13 Sep 2023 05:06:49 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D69471999 for ; Wed, 13 Sep 2023 02:06:44 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-9ad8bba8125so202496066b.3 for ; Wed, 13 Sep 2023 02:06:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694596003; x=1695200803; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=npEEuvyrxe+edVufA31/hnBZZi0ug9NLaKIp4p/ndJU=; b=Xvn4CJCpxccWWP327LNQr8IDea+UDcYsi8wbMOgppKzVl+7Bb9RAOmVpk71auaQoMN a/fMYZenHYKZWbPrSjHLWNf84Po2md99716Vfm426BsPZbCzvDJOHcD0iGnGG0gEa/hK ISd33SV34lzSw9R4Okz36hWy1PCSXklwsXtL6EAp1Q3A5ktaSFhQTrd6X5kPk+lv7N60 wcbNrksrKNB+OEqzLLUQbs2kT7qnd7WIrrhBqE/jbsoWXwVx5O6f++Wh10PUPBq26L3m DHjShSVNe19x4p5x8ZZx+0FKGTMlqvhIvw7hL525e6q3o/SjBsZWU4uGADXL1vaoZ1fB zoiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694596003; x=1695200803; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=npEEuvyrxe+edVufA31/hnBZZi0ug9NLaKIp4p/ndJU=; b=Svsw0P1IjTlOOCJxhD13k0u7ls68VH8/kG+nURRAOqt/xPp7Ej7X+VtLfRFzMrI0Xo PIxWmES4laQVpx0o1xMrpccexOHPUbJKuHiHdCr3SaDOtgIsqN2C2fWwNRwKCy6ZgI1X ExCoRBMWIRVjzY62wTQjkCYZuGT0qvs8yfkyaPbUBdIemKMDJWVQCJYlDBXHA37IGkDf 00piodZhMwy5a82ZfzfFXh6nUsi3A2ASRFw5JhJ4voyv9yH4jUduha2xJ5aSMFdejQ+N FkNVbt+TNehQZMnhl5ZelT+65962scpEbC/qJF9nvqF1Wgisn2uGXW/qW5UowbUi9d4X rKyQ== X-Gm-Message-State: AOJu0YzBLrRf6skhFCDglJLJpXR6ZcJ8vWfQnNnDoViJGTSNoy1maiNV lpBUTW2gUShnJc2T4Jmvcf4c1Q== X-Received: by 2002:a17:907:761a:b0:9a2:185b:5376 with SMTP id jx26-20020a170907761a00b009a2185b5376mr1302033ejc.49.1694596003287; Wed, 13 Sep 2023 02:06:43 -0700 (PDT) Received: from [192.168.37.232] (178235177106.dynamic-4-waw-k-1-1-0.vectranet.pl. [178.235.177.106]) by smtp.gmail.com with ESMTPSA id c15-20020a170906528f00b00992b2c55c67sm8061434ejm.156.2023.09.13.02.06.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 Sep 2023 02:06:42 -0700 (PDT) Message-ID: <912f90ee-0816-43ae-bc6f-a9a9a3e33d8a@linaro.org> Date: Wed, 13 Sep 2023 11:06:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 4/9] arm64: dts: qcom: msm8916: Reserve firmware memory dynamically Content-Language: en-US To: Stephan Gerhold , Bjorn Andersson Cc: Andy Gross , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Bryan O'Donoghue References: <20230911-msm8916-rmem-v1-0-b7089ec3e3a1@gerhold.net> <20230911-msm8916-rmem-v1-4-b7089ec3e3a1@gerhold.net> From: Konrad Dybcio Autocrypt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mW8v3gIDWyIcgYqb2v8QO2Mqx YMqL7UZxVLul4/JbllsQB8F/fNI8AfttmAQL9cwo6C8yDTXKdho920W4WUR9k8NT/OBqWSyk bGqMHex48FVZhexNPYOd58EY9/7mL5u0sJmo+jTeb4JBgIbFPJCFyng4HwbniWgQJZ1WqaUC nas9J77uICis2WH7N8Bs9jy0wQYezNzqS+FxoNXmDQg2jetX8en4bO2Di7Pmx0jXA4TOb9TM izWDgYvmBE8= In-Reply-To: <20230911-msm8916-rmem-v1-4-b7089ec3e3a1@gerhold.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 13 Sep 2023 02:07:09 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email On 11.09.2023 19:41, Stephan Gerhold wrote: > Most of the reserved firmware memory on MSM8916 can be relocated when > respecting the required alignment. To avoid having to precompute the > reserved memory regions in every board DT, describe the actual > requirements (size, alignment, alloc-ranges) using the dynamic reserved > memory allocation. > > This approach has several advantages: > > 1. We can define "templates" for the reserved memory regions in > msm8916.dtsi and keep only device-specific details in the board DT. > This is useful for the "mpss" region size for example, which varies > from device to device. It is no longer necessary to redefine all > firmware regions to shift their addresses. > > 2. When some of the functionality (e.g. WCNSS, Modem, Venus) is not > enabled or needed for a device, the reserved memory can stay > disabled, freeing up the unused reservation for Linux. > > 3. Devices with special requirements for one of the firmware regions > are handled automatically. For example, msm8916-longcheer-l8150 > has non-relocatable "wcnss" firmware that must be loaded exactly > at address 0x8b600000. When this is defined as a static region, > the other dynamic allocations automatically adjust to a different > place with suitable alignment. > > All in all this approach significantly reduces the boilerplate necessary > to define the different firmware regions, and makes it easier to enable > functionality on the different devices. > > Signed-off-by: Stephan Gerhold > --- [...] > > mpss_mem: mpss@86800000 { > + /* > + * The memory region for the mpss firmware is generally > + * relocatable and could be allocated dynamically. > + * However, many firmware versions tend to fail when > + * loaded to some special addresses, so it is hard to > + * define reliable alloc-ranges. > + * > + * alignment = <0x0 0x400000>; > + * alloc-ranges = <0x0 0x86800000 0x0 0x8000000>; > + */ Do we know of any devices that this would actually work on? Konrad