devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Caleb Connolly <caleb.connolly@linaro.org>
To: Tengfei Fan <quic_tengfan@quicinc.com>,
	andersson@kernel.org, konrad.dybcio@linaro.org, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org,
	dmitry.baryshkov@linaro.org
Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel@quicinc.com
Subject: Re: [PATCH v10 2/4] arm64: dts: qcom: qcs8550: introduce qcs8550 dtsi
Date: Thu, 20 Jun 2024 15:49:24 +0200	[thread overview]
Message-ID: <c71e1543-6957-4aa6-98fa-160b3bd29c78@linaro.org> (raw)
In-Reply-To: <c265d22e-c246-4c9f-b6ff-7a350468e28c@quicinc.com>



On 20/06/2024 15:40, Tengfei Fan wrote:
> 
> 
> On 6/18/2024 6:06 PM, Caleb Connolly wrote:
>> HI Tengfei,
>>
>> On 18/06/2024 09:22, Tengfei Fan wrote:
>>> QCS8550 is derived from SM8550. The difference between SM8550 and
>>> QCS8550 is QCS8550 doesn't have modem RF system. QCS8550 is mainly used
>>> in IoT products.
>>> QCS8550 firmware has different memory map compared to SM8550.
>>> The memory map will be runtime added through bootloader.
>>> There are 3 types of reserved memory regions here:
>>> 1. Firmware related regions which aren't shared with kernel.
>>>      The device tree source in kernel doesn't need to have node to 
>>> indicate
>>> the firmware related reserved information. Bootloader converys the
>>> information by updating devicetree at runtime.
>>>      This will be described as: UEFI saves the physical address of the
>>> UEFI System Table to dts file's chosen node. Kernel read this table and
>>> add reserved memory regions to efi config table. Current reserved memory
>>> region may have reserved region which was not yet used, release note of
>>> the firmware have such kind of information.
>>> 2. Firmware related memory regions which are shared with Kernel
>>>      The device tree source in the kernel needs to include nodes that
>>> indicate fimware-related shared information. A label name is suggested
>>> because this type of shared information needs to be referenced by
>>> specific drivers for handling purposes.
>>>      Unlike previous platforms, QCS8550 boots using EFI and describes
>>> most reserved regions in the ESRT memory map. As a result, reserved
>>> memory regions which aren't relevant to the kernel(like the hypervisor
>>> region) don't need to be described in DT.
>>> 3. Remoteproc regions.
>>>      Remoteproc regions will be reserved and then assigned to subsystem
>>> firmware later.
>>> Here is a reserved memory map for this platform:
>>>   0x80000000 +-------------------+
>>>              |                   |
>>>              | Firmware Related  |
>>>              |                   |
>>>   0x8a800000 +-------------------+
>>>              |                   |
>>>              | Remoteproc Region |
>>>              |                   |
>>>   0xa7000000 +-------------------+
>>>              |                   |
>>>              | Kernel Available  |
>>>              |                   |
>>>   0xd4d00000 +-------------------+
>>>              |                   |
>>>              | Firmware Related  |
>>>              |                   |
>>> 0x100000000 +-------------------+
>>>
>>> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>> Signed-off-by: Tengfei Fan <quic_tengfan@quicinc.com>
>>> ---
>>>   arch/arm64/boot/dts/qcom/qcs8550.dtsi | 162 ++++++++++++++++++++++++++
>>>   1 file changed, 162 insertions(+)
>>>   create mode 100644 arch/arm64/boot/dts/qcom/qcs8550.dtsi
>>>
>>> diff --git a/arch/arm64/boot/dts/qcom/qcs8550.dtsi 
>>> b/arch/arm64/boot/dts/qcom/qcs8550.dtsi
>>> new file mode 100644
>>> index 000000000000..07b314834d88
>>> --- /dev/null
>>> +++ b/arch/arm64/boot/dts/qcom/qcs8550.dtsi
>>> @@ -0,0 +1,162 @@
>>> +// SPDX-License-Identifier: BSD-3-Clause
>>> +/*
>>> + * Copyright (c) 2023-2024, Qualcomm Innovation Center, Inc. All 
>>> rights reserved.
>>> + */
>>> +
>>> +#include "sm8550.dtsi"
>>> +
>>> +/delete-node/ &reserved_memory;
>>> +
>>> +/ {
>>> +    reserved_memory: reserved-memory {
>>> +        #address-cells = <2>;
>>> +        #size-cells = <2>;
>>> +        ranges;
>>> +
>>> +
>>> +        /* These are 3 types of reserved memory regions here:
>>> +         * 1. Firmware related regions which aren't shared with kernel.
>>> +         *     The device tree source in kernel doesn't need to have 
>>> node to
>>> +         * indicate the firmware related reserved information. 
>>> Bootloader
>>> +         * conveys the information by updating devicetree at runtime.
>>> +         *     This will be described as: UEFI saves the physical 
>>> address of
>>> +         * the UEFI System Table to dts file's chosen node. Kernel 
>>> read this
>>> +         * table and add reserved memory regions to efi config 
>>> table. Current
>>> +         * reserved memory region may have reserved region which was 
>>> not yet
>>> +         * used, release note of the firmware have such kind of 
>>> information.
>>
>> This is a lot of implementation detail about UEFI, I'd imagine that 
>> anyone curious can go read the relevant docs instead. It's a lot of 
>> words just to say "Firmware regions which the kernel doesn't need to 
>> know about which are not included in the EFI provided memory map."
> 
> 
> The following update will be applied to this point:
> 
> 1. Firmware related regions which aren't shared with kernel.
>       Firmware regions which the kernel doesn't need to know about which 
> are not included in the EFI provided memory map.
> 
> 
>>> +         * 2. Firmware related memory regions which are shared with 
>>> Kernel
>>> +         *     The device tree source in the kernel needs to include 
>>> nodes
>>> +         * that indicate fimware-related shared information. A label 
>>> name
>>> +         * is suggested because this type of shared information 
>>> needs to
>>> +         * be referenced by specific drivers for handling purposes.
>>
>> "Firmware regions the kernel DOES need to know about, which are 
>> described in the reserved-memory node".
> 
> The following update will be applied to this point:
> 
> 2. Firmware related memory regions which are shared with Kernel
> 
> Firmware regions the kernel does need to know about, which are described 
> in the reserved-memory node.
> 
>>> +         *     Unlike previous platforms, QCS8550 boots using EFI 
>>> and describes
>>> +         * most reserved regions in the ESRT memory map. As a 
>>> result, reserved
>>> +         * memory regions which aren't relevant to the kernel(like 
>>> the hypervisor
>>> +         ( region) don't need to be described in DT.
>>
>> These would fall under (1) "firmware the kernel doesn't need to know 
>> about"
> 
> This will be removed from its current position.
> 
>>> +         * 3. Remoteproc regions.
>>> +         *     Remoteproc regions will be reserved and then assigned to
>>> +         * subsystem firmware later.
>>
>> How do these differ from those described in (2)?
> 
> This point will do the following update:
> 
> 3. Remoteproc regions
> 
>     Remoteproc regions will be reserved and then assigned to subsystem 
> firmware later.
> 
>     Remoteproc regions can be loaded either in a fixed form or in a 
> relocatable form, depending on the platform.
> 
>>
>> I think this comment is trying to describe too much at once. You're 
>> trying to describe what the different types of reserved memory are, 
>> how the kernel learns about them, and how this differs from previous 
>> platforms all at once. I think you should tackle these points separately:
>>
>> First describe the types of reserved memory and how the kernel learns 
>> about them (my suggestions above). Then describe the differences with 
>> previous platforms (like the hypervisor example)
>>
>> Thanks and regards,
> 
> Your previous suggestion will be incorporated here as follows:
> 
> Unlike previous platforms, QCS8550 boots using EFI and describes most 
> reserved regions in the ESRT memory map. As a result, reserved memory 
> regions which aren't relevant to the kernel(like the hypervisor region) 
> don't need to be described in DT.
> 
> Is it reasonable to place it here?

Thanks great, thanks a lot :)
> 
> Thanks!
> 
>>> +         * Here is a reserved memory map for this platform:
>>> +         *  0x80000000 +-------------------+
>>> +         *             |                   |
>>> +         *             | Firmware Related  |
>>> +         *             |                   |
>>> +         *  0x8a800000 +-------------------+
>>> +         *             |                   |
>>> +         *             | Remoteproc Region |
>>> +         *             |                   |
>>> +         *  0xa7000000 +-------------------+
>>> +         *             |                   |
>>> +         *             | Kernel Available  |
>>> +         *             |                   |
>>> +         *  0xd4d00000 +-------------------+
>>> +         *             |                   |
>>> +         *             | Firmware Related  |
>>> +         *             |                   |
>>> +         * 0x100000000 +-------------------+
>>> +         */
>>> +
>>> +        aop_image_mem: aop-image-region@81c00000 {
>>> +            reg = <0x0 0x81c00000 0x0 0x60000>;
>>> +            no-map;
>>> +        };
>>> +
>>> +        aop_cmd_db_mem: aop-cmd-db-region@81c60000 {
>>> +            compatible = "qcom,cmd-db";
>>> +            reg = <0x0 0x81c60000 0x0 0x20000>;
>>> +            no-map;
>>> +        };
>>> +
>>> +        aop_config_mem: aop-config-region@81c80000 {
>>> +            no-map;
>>> +            reg = <0x0 0x81c80000 0x0 0x20000>;
>>> +        };
>>> +
>>> +        smem_mem: smem-region@81d00000 {
>>> +            compatible = "qcom,smem";
>>> +            reg = <0x0 0x81d00000 0x0 0x200000>;
>>> +            hwlocks = <&tcsr_mutex 3>;
>>> +            no-map;
>>> +        };
>>> +
>>> +        adsp_mhi_mem: adsp-mhi-region@81f00000 {
>>> +            reg = <0x0 0x81f00000 0x0 0x20000>;
>>> +            no-map;
>>> +        };
>>> +
>>> +        mpss_mem: mpss-region@8a800000 {
>>> +            reg = <0x0 0x8a800000 0x0 0x10800000>;
>>> +            no-map;
>>> +        };
>>> +
>>> +        q6_mpss_dtb_mem: q6-mpss-dtb-region@9b000000 {
>>> +            reg = <0x0 0x9b000000 0x0 0x80000>;
>>> +            no-map;
>>> +        };
>>> +
>>> +        ipa_fw_mem: ipa-fw-region@9b080000 {
>>> +            reg = <0x0 0x9b080000 0x0 0x10000>;
>>> +            no-map;
>>> +        };
>>> +
>>> +        ipa_gsi_mem: ipa-gsi-region@9b090000 {
>>> +            reg = <0x0 0x9b090000 0x0 0xa000>;
>>> +            no-map;
>>> +        };
>>> +
>>> +        gpu_micro_code_mem: gpu-micro-code-region@9b09a000 {
>>> +            reg = <0x0 0x9b09a000 0x0 0x2000>;
>>> +            no-map;
>>> +        };
>>> +
>>> +        spss_region_mem: spss-region@9b100000 {
>>> +            reg = <0x0 0x9b100000 0x0 0x180000>;
>>> +            no-map;
>>> +        };
>>> +
>>> +        spu_secure_shared_memory_mem: 
>>> spu-secure-shared-memory-region@9b280000 {
>>> +            reg = <0x0 0x9b280000 0x0 0x80000>;
>>> +            no-map;
>>> +        };
>>> +
>>> +        camera_mem: camera-region@9b300000 {
>>> +            reg = <0x0 0x9b300000 0x0 0x800000>;
>>> +            no-map;
>>> +        };
>>> +
>>> +        video_mem: video-region@9bb00000 {
>>> +            reg = <0x0 0x9bb00000 0x0 0x700000>;
>>> +            no-map;
>>> +        };
>>> +
>>> +        cvp_mem: cvp-region@9c200000 {
>>> +            reg = <0x0 0x9c200000 0x0 0x700000>;
>>> +            no-map;
>>> +        };
>>> +
>>> +        cdsp_mem: cdsp-region@9c900000 {
>>> +            reg = <0x0 0x9c900000 0x0 0x2000000>;
>>> +            no-map;
>>> +        };
>>> +
>>> +        q6_cdsp_dtb_mem: q6-cdsp-dtb-region@9e900000 {
>>> +            reg = <0x0 0x9e900000 0x0 0x80000>;
>>> +            no-map;
>>> +        };
>>> +
>>> +        q6_adsp_dtb_mem: q6-adsp-dtb-region@9e980000 {
>>> +            reg = <0x0 0x9e980000 0x0 0x80000>;
>>> +            no-map;
>>> +        };
>>> +
>>> +        adspslpi_mem: adspslpi-region@9ea00000 {
>>> +            reg = <0x0 0x9ea00000 0x0 0x4080000>;
>>> +            no-map;
>>> +        };
>>> +
>>> +        mpss_dsm_mem: mpss_dsm_region@d4d00000 {
>>> +            reg = <0x0 0xd4d00000 0x0 0x3300000>;
>>> +            no-map;
>>> +        };
>>> +    };
>>> +};
>>
> 

-- 
// Caleb (they/them)

  reply	other threads:[~2024-06-20 13:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-18  7:21 [PATCH v10 0/4] arm64: dts: qcom: aim300: add AIM300 AIoT Tengfei Fan
2024-06-18  7:21 ` [PATCH v10 1/4] dt-bindings: arm: qcom: Document QCS8550 SoC and the AIM300 AIoT board Tengfei Fan
2024-06-18  7:22 ` [PATCH v10 2/4] arm64: dts: qcom: qcs8550: introduce qcs8550 dtsi Tengfei Fan
2024-06-18 10:06   ` Caleb Connolly
2024-06-20 13:40     ` Tengfei Fan
2024-06-20 13:49       ` Caleb Connolly [this message]
2024-06-21  1:12         ` Tengfei Fan
2024-06-18  7:22 ` [PATCH v10 3/4] arm64: dts: qcom: add base AIM300 dtsi Tengfei Fan
2024-06-18 19:06   ` Konrad Dybcio
2024-06-20  0:46     ` Tengfei Fan
2024-06-22 11:09       ` Konrad Dybcio
2024-06-24  2:22         ` Tengfei Fan
2024-06-18  7:22 ` [PATCH v10 4/4] arm64: dts: qcom: aim300: add AIM300 AIoT Tengfei Fan
2024-06-18  8:48   ` Dmitry Baryshkov
2024-06-18  8:57     ` Tengfei Fan
2024-06-21  6:11 ` [PATCH v10 0/4] " Bjorn Andersson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c71e1543-6957-4aa6-98fa-160b3bd29c78@linaro.org \
    --to=caleb.connolly@linaro.org \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=kernel@quicinc.com \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_tengfan@quicinc.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).