Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2084186ioo; Mon, 23 May 2022 09:43:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw34gHEIC17ZTK9MNoqxkqVTq/AK251+BG+kfLiqm0gDiIxxUAunxAm6+3RE3SRtdeGvtqg X-Received: by 2002:a63:4d3:0:b0:3f5:f19a:a492 with SMTP id 202-20020a6304d3000000b003f5f19aa492mr20488816pge.353.1653324215239; Mon, 23 May 2022 09:43:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653324215; cv=none; d=google.com; s=arc-20160816; b=LWTETGf4NdbcJhjwSZ1r+UESRq6X4amkQ/WTaJ6Uc/QkUHwSUYJ7zHQHdId6g2WoHk E6kwO4F0oLeAi1Y5CB7SbyDtcYPsoOOiZjqE1N2qdITRblFcnLSqsOJ4vVITzSLN/rFA 8QskgybspnbyicuwZU9qPQhTjP+3v52xO2QlkOsA1p8ZiDn6xwdKm/B9ez65L/GBRlTW g9l3wuhwND43bNAIVlj2rpVvl7U7gnIZ7OGnRazHK7gMHt41UO6vg66Q+j1plkNtC6MY r2JZ9EmtL+FkVZ4ZtigJHOjG8eL1dc/ane3C2tIDepcUJATivZvaHfOF6Vr+wwEY1zka NXUQ== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=2+Eqlq+Lez3z65syX1lv+ITX8fTEVdJaf1yC4Vp1bDE=; b=FsAI7eddfcs5GIe1EmvMEiuRZW5Um/KvEY2mCu/0SI+J6H4w0e+QCG81YuFDgflp/6 tC7tH1mD2Kqwi1DpuMp0QMBRoJuhBpdMlMy6QrpyOM4YFmaKDY5tXKjFdAGD8KOaGooh 9w3UfesLyMwkmrRdLF5L9fIq0VbJl5RNjxuBlWLZMWETZdwjiZID8OKiUy/3rPtt6DBa vHmaKMb/1bhLzS0riGQK1evmYJdmrdX85Rsx2nO6xq3tZGM09UdYHOdNlsNl1uu5XE7y AFijUgx43lR7bah20CDXvuCecXb1iLPYP7xCf0zwI8VK/6ju8Yj4dQ39u5dW/6xMs+G3 g9sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=kpOJAVEc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id pi2-20020a17090b1e4200b001d939ffed98si17595306pjb.97.2022.05.23.09.43.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 09:43:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=kpOJAVEc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 13436248C4; Mon, 23 May 2022 09:41:48 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239012AbiEWQll (ORCPT + 99 others); Mon, 23 May 2022 12:41:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238979AbiEWQli (ORCPT ); Mon, 23 May 2022 12:41:38 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F5C5248FA; Mon, 23 May 2022 09:41:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1653324096; x=1684860096; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=2+Eqlq+Lez3z65syX1lv+ITX8fTEVdJaf1yC4Vp1bDE=; b=kpOJAVEcK2HV/2FyzDht75hIR0TtvcVB2ZFdFngzD2UQhQW/MGmfUy++ TOPdo6keEp6t249jzGUDKDpFEMvxU8oiHLGxsDQUuYh8fQ+I/8M4oYAfC 0v3fOpPLdLm7nQKBmAYw8NY0bqIllwGrLftOYkR9Xac5OkHdGhaz+If7c M=; Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-02.qualcomm.com with ESMTP; 23 May 2022 09:41:35 -0700 X-QCInternal: smtphost Received: from unknown (HELO nasanex01a.na.qualcomm.com) ([10.52.223.231]) by ironmsg-SD-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2022 09:41:35 -0700 Received: from [10.110.74.125] (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Mon, 23 May 2022 09:41:34 -0700 Message-ID: <196459ad-704d-020c-c485-842f613ae618@quicinc.com> Date: Mon, 23 May 2022 09:41:34 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: Removal of qcom,board-id and qcom,msm-id Content-Language: en-US To: Krzysztof Kozlowski , Konrad Dybcio CC: , , , , , , , , References: <20220522195138.35943-1-konrad.dybcio@somainline.org> <53d5999b-88ee-24db-fd08-ff9406e2b7b7@linaro.org> <02ab0276-b078-fe66-8596-fcec4378722b@somainline.org> <49a52870-9aab-c4bd-2077-66732f42bbba@linaro.org> From: Trilok Soni In-Reply-To: <49a52870-9aab-c4bd-2077-66732f42bbba@linaro.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01a.na.qualcomm.com (10.52.223.231) X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Krzysztof, On 5/23/2022 5:14 AM, Krzysztof Kozlowski wrote: > On 23/05/2022 14:02, Konrad Dybcio wrote: >> >> On 23/05/2022 09:21, Krzysztof Kozlowski wrote: >>> On 22/05/2022 21:51, Konrad Dybcio wrote: >>>> Hi, >>>> >>>> removing these properties will not bring almost any benefit (other than making >>>> some checks happy any saving some <200 LoC) and will make the lives of almost >>>> all people doing independent development for linux-on-msm harder. There are >>>> almost unironically like 3 people outside Linaro and QUIC who have >>>> non-vendor-fused development boards AND the sources to rebuild the >>>> bootloader on their own. Making it harder to boot is only going to >>>> discourage people from developing on these devices, which is already not >>>> that pleasant, especially with newer platforms where you have to fight with >>>> the oh-so-bright ideas of Android boot chain.. >>>> >>>> This only concerns devices released before sm8350, as the new ones will not >>>> even boot with these properties present (or at least SONY Sagami, but I >>>> doubt it's an isolated case), so other than completing support for older >>>> devices, it won't be an issue going forward, anyway. But there are give >>>> or take 50 locked down devices in mainline right now, and many more waiting >>>> to be upstreamed in various downstream close-to-mainline trees that should >>>> not be disregarded just because Qualcomm is far from the best at making >>>> their BSP software stack clean. >>> I actually wonder why do you need these properties for community work on >>> such boards? You ship kernel with one concatenated DTB and the >>> bootloader does not need the board-id/msm-id fields, doesn't it? >> >> If that were the case, I would have never complained about this! It's >> the bootloader itself that needs it, you can see it in a "Best match >> [blah blah] 258/0x1000/...." log line, where it walks through the >> appended (or otherwise compiled into the boot.img) DTBs and looks for >> matches for the burnt-in msm-, board- and (on newer-older platforms) >> pmic-id. If it cannot find these, it refuses to boot with an Android >> Verified Boot red state and you get a not-so-nice "Your device has been >> unlocked and the boot image is not working" or something like this on >> your screen. >> >> >>> >>> Not mentioning that in the past bootloader was actually not using these >>> properties at all, because it was the dtbTool who was parsing them. >> >> Not sure when that was the case, maybe with very old arm32 bootloaders >> in the times before I did development on Qualcomm devices. >> >> >>> So >>> in any case either your device works fine without these properties or >>> you have to use dtbTool, right? >> >> To the best of my idea, wrong :( Unless the vendor modified the LK/XBL >> code on their own, it looks for a "best match" (but if it's not a >> precise match, it won't even bother trying to boot, just fyi..), meaning >> it tries to go through a list of SoC ID and revision pairs (msm-id), >> board IDs (board-id) and PMIC id+rev pairs (pmic-id) and if no match is >> found, it doesn't even exit the bootloader and says something like "no >> dtbs found". > > This would mean that dtbTool as described in the actual patch [1] is not > used and bootloader ignores the table. If that's the case, the commit > and requirement of such complex board-foundry-pmic-compatibles should be > dropped. So I am getting now to what Dmitry said... > > [1] > https://lore.kernel.org/all/1448062280-15406-2-git-send-email-sboyd@codeaurora.org/ The link above is from 2015. Lot has changed downstream. Most of what was mentioned by Konrad is right. Application bootloader acts on picking on platform DTBO based on the platform ID plus some combinations like PMIC etc; These platform DTBOs gets overlay on top of SOC DTB by the Application bootloader. We have moved to DTBO for all the latest targets, but I can understand that some old targets at upstream could be using the very old approaches. Downstream all of the platforms including the DTBO files will need board-id and msm-id since we also do the compile time stitching of dtb + dtbo and dtbo + dtbo to generate the proper SOC DTB and PLATFORM DTBOs which gets flashed in the DTBO partition and follows the Android boot requirements. Application bootloader then picks the right Platform DTBO as mentioned above w/ the right SOC DTB. It gets more complicated w/ GKI new requirements every year (better for GKI, may not be better for upstream kernel + downstream bootloader combination). ---Trilok Soni