linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amrit Anand <quic_amrianan@quicinc.com>
To: Elliot Berman <quic_eberman@quicinc.com>,
	Konrad Dybcio <konrad.dybcio@linaro.org>, <robh+dt@kernel.org>,
	<krzysztof.kozlowski+dt@linaro.org>, <conor+dt@kernel.org>,
	<agross@kernel.org>, <andersson@kernel.org>
Cc: <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-msm@vger.kernel.org>, <kernel@quicinc.com>
Subject: Re: [PATCH 2/2] dt-bindings: hwinfo: Add Qualcomm's board-id types
Date: Wed, 24 Jan 2024 18:17:16 +0530	[thread overview]
Message-ID: <3e3e1e03-bb58-a09c-8ce5-4cd5481b059e@quicinc.com> (raw)
In-Reply-To: <065601d3-92e7-46cc-a7aa-116cd02b3c36@quicinc.com>


On 1/22/2024 11:40 PM, Elliot Berman wrote:
>
> On 1/22/2024 2:07 AM, Amrit Anand wrote:
>> On 1/20/2024 7:02 PM, Konrad Dybcio wrote:
>>> On 20.01.2024 12:20, Amrit Anand wrote:
>>>> Qualcomm based DT uses two or three different identifiers. The SoC
>>>> based idenfier which signifies chipset and the revision for those
>>>> chipsets. The board based identifier is used to distinguish different
>>>> boards (e.g. IDP, MTP) along with the different types of same boards.
>>>> The PMIC attached to the board can also be used as a identifier for
>>>> device tree.
>>>>
>>>> Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
>>>> Signed-off-by: Amrit Anand <quic_amrianan@quicinc.com>
>>>> ---
>>>>    .../devicetree/bindings/hwinfo/qcom,board-id.yaml  | 86 ++++++++++++++++++++++
>>>>    include/dt-bindings/arm/qcom,ids.h                 | 68 +++++++++++++++--
>>>>    2 files changed, 146 insertions(+), 8 deletions(-)
>>>>    create mode 100644 Documentation/devicetree/bindings/hwinfo/qcom,board-id.yaml
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/hwinfo/qcom,board-id.yaml b/Documentation/devicetree/bindings/hwinfo/qcom,board-id.yaml
>>>> new file mode 100644
>>>> index 0000000..807f134
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/hwinfo/qcom,board-id.yaml
>>>> @@ -0,0 +1,86 @@
>>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>>> +%YAML 1.2
>>>> +---
>>>> +$id: http://devicetree.org/schemas/hwinfo/qcom,board-id.yaml#
>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>>> +
>>>> +title: QCOM Board Identifier for Devicetree Selection
>>>> +
>>>> +maintainers:
>>>> +  - Amrit Anand <quic_amrianan@quicinc.com>
>>>> +  - Elliot Berman <quic_eberman@quicinc.com>
>>>> +
>>>> +description: |
>>> The '|'s are unnecessary in both commits, IIRC they're used for
>>> preserving formatting which we don't really need for non-styled
>>> plaintext
>> Sure, will do.
>>>> +  Qualcomm uses two and sometimes three hardware identifiers to describe
>>>> +  its boards
>>>> +      - a SoC identifier is used to match chipsets (e.g. sm8550 vs sm8450)
>>>> +      - a board identifier is used to match board form factor (e.g. MTP, QRD,
>>>> +        ADP, CRD)
>>>> +      - a PMIC identifier is occasionally used when different PMICs are used
>>>> +        for a given board/SoC combination.
>>>> +  Each field and helper macros are defined at::
>>>> +      - include/dt-bindings/arm/qcom,ids.h
>>>> +
>>>> +  For example,
>>>> +    / {
>>>> +        #board-id-cells = <2>;
>>>> +        board-id = <456 0>, <457 0>, <10 0>;
>>>> +        board-id-types = "qcom,soc-id", "qcom,soc-id", "qcom,board-id";
>>>> +     }
>>>> +
>>>> +allOf:
>>>> +  - $ref: board-id.yaml#
>>>> +
>>>> +properties:
>>>> +  board-id:
>>>> +    minItems: 2
>>> I believe some older platforms match exclusively based on socid, so
>>> perhaps 1 would be okay as well.
>>>
>>> [...]
>> Ok, considering legacy targets we can make it 1.
>>
>> But i think ideally it should always be recommended to have a board ID associated with a SoC ID, correct me if my understanding is wrong.
>>
> There is no "legacy" support needed here: Qualcomm's bootloaders
> need to be updated to adhere to the new proposed spec. I suppose
> we need to consider whether we have targets that only need SoC to
> differentiate?
>
>>>> +examples:
>>>> +   - |
>>>> +     #include <dt-bindings/arm/qcom,ids.h>
>>>> +     / {
>>>> +         model = "Qualcomm Technologies, Inc. sc7280 IDP SKU1 platform";
>>>> +         compatible = "qcom,sc7280-idp", "google,senor", "qcom,sc7280";
>>>> +
>>>> +         #board-id-cells = <2>;
>>>> +         board-id = <QCOM_SOC_ID(SC7280) QCOM_SOC_REVISION(1)>,
>>>> +                    <QCOM_SOC_ID(SC7280) QCOM_SOC_REVISION(2)>,
>>>> +                    <QCOM_BOARD_ID(IDP, 1, 0) QCOM_BOARD_SUBTYPE(UFS, ANY, 1)>;
>>>> +         board-id-types = "qcom,soc-id",
>>>> +                          "qcom,soc-id",
>>>> +                          "qcom,board-id";
>>> So, would the matching here would be:
>>>
>>> loop over disctinct board-id-types
>>>      check if there's at least 1 match for all of them
>>>          use this dtb if that's the case
>>>
>>> stop booting / "best guess match"
>>>
>>> ?
>>>
>>> [...]
>> Yes, But the "if" checking would have preference in place.
>> The preference logic would look something like this,
>>
>> First will check for SoC-ID, if we have an exact match for SoC-ID then will proceed for board-ID match. Otherwise the DT would be discarded.
>> Once (exact) board-ID found, will proceed for subtype , pmic and so on.
>> Exact match and best match logic is used. Parameters like SoC-ID, board-ID are required to be best matched. Other few fields follow best match logic and best of the DT can be picked.
>>
>>>> +#define QCOM_BOARD_ID_MTP        0x8
>>>> +#define QCOM_BOARD_ID_DRAGONBOARD    0x10
>>>> +#define QCOM_BOARD_ID_QRD        0x11
>>>> +#define QCOM_BOARD_ID_HDK        0x1F
>>>> +#define QCOM_BOARD_ID_ATP        0x21
>>>> +#define QCOM_BOARD_ID_IDP        0x22
>>>> +#define QCOM_BOARD_ID_SBC        0x24
>>>> +#define QCOM_BOARD_ID_QXR        0x26
>>>> +#define QCOM_BOARD_ID_CRD        0x28
>>> Missing ADP/QCP/Ride (if they're separate)
>> Sure, will update. Would need to work with teams.
> There are probably more boards that we aren't aware of.
>
> Amrit, please add board IDs for all the boards that are
> in kernel.org.

Sure, will do that.

Thanks,
Amrit



  parent reply	other threads:[~2024-01-24 12:47 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-20 11:20 [PATCH 0/2] Add board-id support for multiple DT selection Amrit Anand
2024-01-20 11:20 ` [PATCH 1/2] dt-bindings: hwinfo: Introduce board-id Amrit Anand
2024-01-20 12:36   ` Rob Herring
2024-01-20 19:10   ` Trilok Soni
2024-01-22 10:10     ` Amrit Anand
2024-01-23 11:50       ` Krzysztof Kozlowski
2024-01-23 17:18         ` Conor Dooley
2024-01-23 18:51           ` Elliot Berman
2024-01-23 20:05             ` Trilok Soni
2024-01-24 12:44               ` Amrit Anand
2024-01-23 12:09   ` Krzysztof Kozlowski
2024-01-24 12:42     ` Amrit Anand
2024-01-25 10:40       ` Krzysztof Kozlowski
2024-01-24 15:00   ` Rob Herring
2024-01-20 11:20 ` [PATCH 2/2] dt-bindings: hwinfo: Add Qualcomm's board-id types Amrit Anand
2024-01-20 12:36   ` Rob Herring
2024-01-20 13:32   ` Konrad Dybcio
2024-01-22 10:07     ` Amrit Anand
2024-01-22 18:10       ` Elliot Berman
2024-01-22 19:27         ` Dmitry Baryshkov
2024-01-24 12:47         ` Amrit Anand [this message]
2024-01-21  2:05   ` kernel test robot
2024-01-22 18:12   ` Elliot Berman
2024-01-20 13:04 ` [PATCH 0/2] Add board-id support for multiple DT selection Konrad Dybcio
2024-01-22 17:50   ` Elliot Berman
2024-01-24 14:56 ` Rob Herring
2024-02-02  5:00   ` Amrit Anand
2024-02-14 12:56     ` Amrit Anand
2024-02-14 13:12       ` Krzysztof Kozlowski

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=3e3e1e03-bb58-a09c-8ce5-4cd5481b059e@quicinc.com \
    --to=quic_amrianan@quicinc.com \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@quicinc.com \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_eberman@quicinc.com \
    --cc=robh+dt@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).