Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3230506iog; Mon, 27 Jun 2022 11:57:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uk4k+reCZwVZpgC5BZyRF6dz9npARj3pX4h7Q/7i4uqGqazMvqjv8SKC1OF+L5cPxnUDy0 X-Received: by 2002:a63:158:0:b0:40c:f753:d227 with SMTP id 85-20020a630158000000b0040cf753d227mr14076530pgb.550.1656356276487; Mon, 27 Jun 2022 11:57:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656356276; cv=none; d=google.com; s=arc-20160816; b=YKPVtLKKG49hfFsjlQSC+34uEC72O7mIvQh5jQquO85/M2QqwIfWYaIYigrTWFj+f3 x/SMC7sInP5xWmSoTRzFQhaTOvI2RoTsyYZfU9XM+qUvTvII7h2hXRFHkc2MfSps/kpw IAMoCJy+8hhDzs8cBLfiQd+DBYo7O4rAnAlH1QE745b47GPCRo5A6bFo8P1ED+Dckx12 JdVuwMtx+nhewllX7mm+SzlzlGFjY5PELcaPgXMT3EH8Epe9WcTmxZa2TnA5CS/2QSaj ty+7+pSzVtHZe5UvBqOvV/B7DlPAicg887ajt+yVz7Z3PnNdud0Ij6Eh/1/WNOllSrt9 YpgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=XogYVUgT3W3Q8+7OypuWUvQY31VgP/RT9SPk1+m3+FU=; b=w49V4XED+a47F8G+NZtP/MzH5xihSknqA1ah2tSwP5r7KNo/b0+494HlCdNmwPeBs8 A6J/bsEPOzx9CLF18a9Ie1dOZ4Xe5ORuqKnR5XWJg9+TDSZoMspfvHbbdePM2+SPx92V pA786BQdAtDSVFYxwXVLfwZ69cY9vsjUOBV5yRtFzvNjHIxnTfprRpqKeFQ3So5TRvw1 sJSgyp5SW6K862FZ4QLaN8AYmuGCRNAC2hY/95AyQZp7/4T2g0oAsBhNJ1Q/yUGiGGmb yDedS3d8VGsyk3hHCHBr4q5BLDhR4voMW64gf5WSqGtnkKPccyI+JOHOCWAsd2beBXQo /KcA== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x68-20020a626347000000b005180cf5918csi12322426pfb.327.2022.06.27.11.57.42; Mon, 27 Jun 2022 11:57:56 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239746AbiF0R77 (ORCPT + 99 others); Mon, 27 Jun 2022 13:59:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233706AbiF0R76 (ORCPT ); Mon, 27 Jun 2022 13:59:58 -0400 Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39903B7CA; Mon, 27 Jun 2022 10:59:58 -0700 (PDT) Received: by mail-io1-f42.google.com with SMTP id h85so10376528iof.4; Mon, 27 Jun 2022 10:59:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=XogYVUgT3W3Q8+7OypuWUvQY31VgP/RT9SPk1+m3+FU=; b=P1U5WA7glJBrsjBJuLAWdbBpoCGdAbSB/3LokD/2aLtZxdX/tUw6Nb05Q4uVYFSJ+Z gGLUlqB6c4Khwma9dEe9gvHDHfyhT91L2PYLjKQ94bneP0O5PCvNvmoFMggtYQasmMIH y2GxFpn6PrRGiofbD7V6loPG3ccC8Lk22jS8lSm6MIBmRJ+shSF2Y6O/tT88H6jvnSnb 9cV1GCBVW+bREy/Y1syWTOvLJhoL/k5NdDal32SeNhXgIBfR0lO2KNEy0Mbr6zlT6WtX k1yd+QwTTsNfxIyFaV5WKnVkYEU5X4kZBneIR3ySTS2RkBmxgmrMJcFvmElzhedgXIfY Ue/A== X-Gm-Message-State: AJIora8X2HMxP/FsDb8gyrFF0/cIZuQqGsrbnZtNO4nhBktHhmArifQ+ tmxBUlvagW01fEG+lhdvE3F64g0A/A== X-Received: by 2002:a5d:9a84:0:b0:675:51d2:f1cd with SMTP id c4-20020a5d9a84000000b0067551d2f1cdmr1367241iom.173.1656352797431; Mon, 27 Jun 2022 10:59:57 -0700 (PDT) Received: from robh.at.kernel.org ([64.188.179.253]) by smtp.gmail.com with ESMTPSA id x17-20020a056e020f1100b002d943793c68sm4849162ilj.56.2022.06.27.10.59.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 10:59:57 -0700 (PDT) Received: (nullmailer pid 2674770 invoked by uid 1000); Mon, 27 Jun 2022 17:59:55 -0000 Date: Mon, 27 Jun 2022 11:59:55 -0600 From: Rob Herring To: Frank Rowand Cc: =?iso-8859-1?Q?Cl=E9ment_L=E9ger?= , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Lizhi Hou , Allan Nielsen , Horatiu Vultur , Steen Hegelund , Thomas Petazzoni Subject: Re: [PATCH 1/2] of: create of_root if no dtb provided Message-ID: <20220627175955.GA2665611-robh@kernel.org> References: <20220624034327.2542112-1-frowand.list@gmail.com> <20220624034327.2542112-2-frowand.list@gmail.com> <20220624141320.3c473605@fixe.home> <6d40876c-2751-01bb-94ab-7c9ab90e636f@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6d40876c-2751-01bb-94ab-7c9ab90e636f@gmail.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 On Fri, Jun 24, 2022 at 11:44:07AM -0500, Frank Rowand wrote: > On 6/24/22 08:13, Cl?ment L?ger wrote: > > Le Thu, 23 Jun 2022 22:43:26 -0500, > > frowand.list@gmail.com a ?crit : > > > >> > >> +/* > >> + * __dtb_empty_root_begin[] magically created by cmd_dt_S_dtb in > >> + * scripts/Makefile.lib > >> + */ > >> +extern void *__dtb_empty_root_begin; > >> + > >> /* > >> * of_fdt_limit_memory - limit the number of regions in the /memory node > >> * @limit: maximum entries > >> @@ -1332,8 +1338,13 @@ bool __init early_init_dt_scan(void *params) > >> */ > >> void __init unflatten_device_tree(void) > >> { > > > > Hi Frank, > > > > This function is only defined when CONFIG_OF_EARLY_FLATTREE is enabled. > > More precisely, only if CONFIG_OF_FLATTREE is enabled. But that would > most likely be seleved by CONFIG_OF_EARLY_FLATTREE, so in practice the > issue you raise is valid. > > > Which means that on platforms that do not select this, the default > > empty device-tree creation will not be done. > > Yes, so platforms that need this functionality need to select this > option. > > > > > This configuration option is selected by the platform and not by the > > user. On x86, only one config enables this (X86_INTEL_CE) which means > > this won't work on all the other platforms even if CONFIG_OF is > > selected. I would need this to work by only selected CONFIG_OF. > > Maybe this means that CONFIG_OF should be changed to select > CONFIG_OF_FLATTREE. Any opinions on this Rob? I don't think that works in the PDT (Sparc) case. I think either CONFIG_OF_FLATTREE or CONFIG_OF_EARLY_FLATTREE will need to become user selectable. > > > That's why I decided to add the of_root creation in of_core_init() > > using a function (of_fdt_unflatten()) that is provided if CONFIG_OF is > > defined. > > I mentioned this in response to the previous patch series, but will > repeat here for those who might not have read that email thread. > > I do not want the root live tree to be created buy different code in > different places; I want one central place where this occurs. When > the tree can be created in multiple places by different code blocks, > it becomes more difficult to understand the code and more likely that > one of the tree creation code blocks is not updated when another is. +1 Rob