From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5128C433EF for ; Wed, 13 Oct 2021 12:42:21 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 204C160C41 for ; Wed, 13 Oct 2021 12:42:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 204C160C41 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:54788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1madaL-0008Ri-91 for qemu-devel@archiver.kernel.org; Wed, 13 Oct 2021 08:42:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47126) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1madXo-0006MO-S2 for qemu-devel@nongnu.org; Wed, 13 Oct 2021 08:39:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:52659) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1madXk-000558-LA for qemu-devel@nongnu.org; Wed, 13 Oct 2021 08:39:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634128775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QF+y/fDxPqS/AOzvc0b8v3SefDrXA3/3cyWRve1RPWw=; b=H0sv97CjTFYps4H3no3q25kODBmpUwKPKjyLHVca6egEs6cKRqvjbttfFdu03Ah4zh9SLx DLiTyZ9wH1cAXpgwt/t/k8TjzCu0Q9adQm9D9bZXMVtCQTHizJivbKL0ikpzFAuND6eHZO sCcQrFRE+Mjobv0rYl0xquHBPo18DnE= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-83-YXSEzUPVNpuwUOGZMw7rGA-1; Wed, 13 Oct 2021 08:39:32 -0400 X-MC-Unique: YXSEzUPVNpuwUOGZMw7rGA-1 Received: by mail-wr1-f72.google.com with SMTP id k2-20020adfc702000000b0016006b2da9bso1890329wrg.1 for ; Wed, 13 Oct 2021 05:39:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=QF+y/fDxPqS/AOzvc0b8v3SefDrXA3/3cyWRve1RPWw=; b=g6ZyUQXpnzmbMnd1pWtbTb60NdlTxgdpO94ZFbLExPWYZKyMyFOG4x6IAlKmpMqIvG e73hSL2dRO+YPquEKyCRlx3po7bmpWYLqgpev6pOzSybVOkI1UUWEL2MMf18kPbvgPzf S2XCC3GyG7GgCAtM7oKVKVBUaYXLNgKA7Z9OCpNenfoowyAOG9b5Mj552shcLLw82MEU RnP7lW8XV0FnLZKRYceqYMxRyFVLPwRgDmLHZY+Vk/VkN/jE6gFUsHiGO06SwsPUZaeF kMUDWBuQOnzIsxn728qSjx4Zkvc4EUBDG4yHDwA4YyPbQVc47cwp/wkXi9Mp5Ph6CKgg hmBQ== X-Gm-Message-State: AOAM532DCnbpemgW5JnkNepl/q8DqKU1HwK9L6G8j9iEPRvhbzHVcGV6 GQ5Ur2O6+XFZ8NbQGROl2sg6401YtNOMs1K8VmRxECZ6B+pi7DBiHEiS37wNhqzyN4xuojyb1Jw yRP3icPw2t5KCWs8= X-Received: by 2002:a5d:43c3:: with SMTP id v3mr29875666wrr.22.1634128770864; Wed, 13 Oct 2021 05:39:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3ZWW14NwZTsHWBQJx1ml5ww8tbyKWkeYQZZPpyMMeG+tt30Mp5aslYJCTMAwQJUMHpt/LZA== X-Received: by 2002:a5d:43c3:: with SMTP id v3mr29875596wrr.22.1634128770598; Wed, 13 Oct 2021 05:39:30 -0700 (PDT) Received: from [192.168.1.36] (213.red-81-36-146.dynamicip.rima-tde.net. [81.36.146.213]) by smtp.gmail.com with ESMTPSA id r205sm5380159wma.3.2021.10.13.05.39.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 Oct 2021 05:39:29 -0700 (PDT) Message-ID: <1c51724b-7789-f402-818f-1044053ee0fa@redhat.com> Date: Wed, 13 Oct 2021 14:39:26 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [PATCH 00/16] fdt: Make OF_BOARD a boolean option To: Bin Meng , Simon Glass , qemu-arm References: <20211013010120.96851-1-sjg@chromium.org> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=170.10.129.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.049, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liviu Dudau , Neil Armstrong , Rick Chen , Vladimir Oltean , Linus Walleij , Bin Meng , Kever Yang , Sean Anderson , U-Boot Mailing List , Zong Li , Stefan Roese , Fabio Estevam , Rainer Boschung , Tom Rini , Stephen Warren , Oleksandr Andrushchenko , Green Wan , Heinrich Schuchardt , Niel Fourie , Michal Simek , =?UTF-8?Q?Marek_Beh=c3=ban?= , Jerry Van Baren , Ramon Fried , Jagan Teki , Heiko Schocher , Peter Robinson , Anastasiia Lukianenko , Thomas Fitzsimmons , Wolfgang Denk , Stephen Warren , Andre Przywara , Tim Harvey , Ashok Reddy Soma , "qemu-devel@nongnu.org Developers" , Alexander Graf , Valentin Longchamp , T Karthik Reddy , Sinan Akman , Albert Aribaud , Michal Simek , Matthias Brugger , Leo , Tero Kristo , Atish Patra , David Abdurachmanov , Priyanka Jain , Ilias Apalodimas , Christian Hewitt , Aaron Williams , Tuomas Tynkkynen , Heinrich Schuchardt , Tianrui Wei , =?UTF-8?Q?Pali_Roh=c3=a1r?= , Dimitri John Ledkov , Padmarao Begari Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Hi Simon, On 10/13/21 03:29, Bin Meng wrote: > On Wed, Oct 13, 2021 at 9:01 AM Simon Glass wrote: >> >> With Ilias' efforts we have dropped OF_PRIOR_STAGE and OF_HOSTFILE so >> there are only three ways to obtain a devicetree: >> >> - OF_SEPARATE - the normal way, where the devicetree is built and >> appended to U-Boot >> - OF_EMBED - for development purposes, the devicetree is embedded in >> the ELF file (also used for EFI) >> - OF_BOARD - the board figures it out on its own >> >> The last one is currently set up so that no devicetree is needed at all >> in the U-Boot tree. Most boards do provide one, but some don't. Some >> don't even provide instructions on how to boot on the board. >> >> The problems with this approach are documented at [1]. >> >> In practice, OF_BOARD is not really distinct from OF_SEPARATE. Any board >> can obtain its devicetree at runtime, even it is has a devicetree built >> in U-Boot. This is because U-Boot may be a second-stage bootloader and its >> caller may have a better idea about the hardware available in the machine. >> This is the case with a few QEMU boards, for example. >> >> So it makes no sense to have OF_BOARD as a 'choice'. It should be an >> option, available with either OF_SEPARATE or OF_EMBED. >> >> This series makes this change, adding various missing devicetree files >> (and placeholders) to make the build work. > > Adding device trees that are never used sounds like a hack to me. > > For QEMU, device tree is dynamically generated on the fly based on > command line parameters, and the device tree you put in this series > has various hardcoded values which normally do not show up > in hand-written dts files. Besides, QEMU generates these dtb at runtime on purpose: it gives emulated machines the freedom to evolve by adding new devices, mapping/wiring peripherals differently. By adding static dtb this gives QEMU users false expectations the machine hardware is stable, or force QEMU to have this interface become a stable API. >From QEMU perspective this seems counter-productive. Digging a bit I see this has already been discussed on qemu-devel@ mailing list recently: https://lore.kernel.org/qemu-devel/CAFEAcA_QNcAHtdxUPLpmyzMYgb9YzhcE0-zyh=N8rqm4vOcGZA@mail.gmail.com/ > I am not sure I understand the whole point of this. > >> >> It also provides a few qemu clean-ups discovered along the way. >> >> This series is based on Ilias' two series for OF_HOSTFILE and >> OF_PRIOR_STAGE removal. >> >> It is available at u-boot-dm/ofb-working >> >> [1] https://patchwork.ozlabs.org/project/uboot/patch/20210919215111.3830278-3-sjg@chromium.org/ >> > > Regards, > Bin >