Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2325444ioo; Mon, 23 May 2022 16:03:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8p/RPnHUQOSU7Cf7wYMABYBsMK71Dabc4JwXr1iJ5S5k5yaqlOCiK9gjezmWXl2dFVEtJ X-Received: by 2002:a17:906:b053:b0:6fd:d8d5:5cac with SMTP id bj19-20020a170906b05300b006fdd8d55cacmr21142832ejb.370.1653347021333; Mon, 23 May 2022 16:03:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653347021; cv=none; d=google.com; s=arc-20160816; b=AzXWzx3acOK5xAbbPvq9dwbILzL3We44kwstJ2xHfqnTZ4Q3k911Ryhn/BIl+j7QSp HHYGCdRlVV7XsMKKz42iRnTtpYYCkN9OLEq8sjavNasfrxUiNutU9MgBpxN/0dLHSCvx rZHiPXjeHsd/Vekjgy7FJ3m+hF8zH1skDKWOlq1H1omRQkJxbl89LE6GcQoYA+8czI1d 6uL7f6Bva7BiIFLaM52nHYLXy2MiufCvy8K8tasfhH8UQOewsmDUhnu+LMmQvSqgrNoz 0DMOkKKfqlhx9Zmgm6ZQc80CBJVN24xL5wJzfrWJ0Pz4zUXoY5GSttjy8jZ9IA93JpQN Z3Gg== 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=1oLI91BTOI6Eyi1fnPHZpGOYWk4nzzAL6H5DtuhNDG8=; b=KXEWs6/yQHaHO7R0y2COHxkUP/PKVnVYU3Qts9Ak7Tuti3Zf8Smuo00Zyh92BFunyg uC1+YwpDIaJjnCQxWrgFtqysgdBpPCSvqRjHSzCrmSh0E/cyHGRU9w6J3/w86tk9SP56 k2W65u86k2F2ckUB/uz5U9WNvUZgNhNFiiCd8hP88Y34xHZWSNUy6llJmvh97FB8nK+8 4FdMvaK0EpFn6wmG1AO/+22nnjY7SbgB/8bMQeDxXdgaTI2krZoqp/zsoXCW4HbblwDa twS2PqmdD6XJRc4DxxNPGoXA1SqGHIphFUthOYctrp01v5g3Ty8wSA5BsCe1nwqbZcHG bHPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=jLLzooDI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ji18-20020a170907981200b006f3a89ebad4si16968182ejc.18.2022.05.23.16.03.14; Mon, 23 May 2022 16:03:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=jLLzooDI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229584AbiEWWNS (ORCPT + 99 others); Mon, 23 May 2022 18:13:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229543AbiEWWNK (ORCPT ); Mon, 23 May 2022 18:13:10 -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 68BA16D84C; Mon, 23 May 2022 15:13:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1653343989; x=1684879989; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=1oLI91BTOI6Eyi1fnPHZpGOYWk4nzzAL6H5DtuhNDG8=; b=jLLzooDIiEt1GWQVTfEAq2QLddZVDbmONkbOM1xzApgaSmGfPdhHUAJd NcIDDrbuZZ4tgPlXPdXzH2SYHJyeZzMeAwt+vkr75ZO6TCpaJTZ1adtVX eL+pCXrSMpFUssWOWz/YLKTQSds98J0EPHVNVUjcY/EsUYT4mkFNNGN82 4=; 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 15:13:09 -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 15:13:09 -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 15:13:08 -0700 Message-ID: Date: Mon, 23 May 2022 15:13:07 -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: Bjorn Andersson CC: Krzysztof Kozlowski , Konrad Dybcio , , , , , , , , 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> <196459ad-704d-020c-c485-842f613ae618@quicinc.com> From: Trilok Soni In-Reply-To: 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=-7.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Hi Bjorn, On 5/23/2022 2:34 PM, Bjorn Andersson wrote: > On Mon 23 May 11:41 CDT 2022, Trilok Soni wrote: > >> 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). >> > > FWIW, this doesn't fit with the upstream model at all. In particular the > DTBO that comes with the devices are not compatible with any upstream > DTB. > > As such, the first step to run an upstream DTB+kernel is to zero out the > dtbo partitions. > > > With the DTBO cleared, most devices (all Qualcomm reference devices) can > be booted with the dtb appended to the Image.gz, without the > qcom,{board,msm}-id. As such I would say things are working okay > currently. > Thanks. Yup, I know things are working fine right now. May be we can look at changing the downstream bootloader so that you don't need to erase the DTBO partition for reference/unlocked devices. No promise, but it will make easy for anyone do the upstream development on the reference devices. ---Trilok Soni