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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 53864C433EF for ; Fri, 3 Dec 2021 10:04:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A40C8805F9; Fri, 3 Dec 2021 11:04:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.b="umq5rsiV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2405780F6E; Fri, 3 Dec 2021 11:04:13 +0100 (CET) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 92E918022E for ; Fri, 3 Dec 2021 11:04:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 0DA0E4003B for ; Fri, 3 Dec 2021 10:04:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638525849; bh=1TGVf79ZoOU1rLaLG+SkCHdKK+0e0TdTSY23mH6B4DA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=umq5rsiVGZ19+s6ESFpIMUaXIaMnTNK36eFcD6i7Y9uk4+l3JryCSXz/HaocbZEgi Rso2Az3wLTdr/VMAztF1xayo/M5mk2WWfpXwJqkGh7PUJwBZNFNld7QjAEqJ0siikZ PvJDA+J03KIxoeu/58a02d9/VlOC524TscIQ5XaXgwwBbZvcmKBN7JgAAWkAEnpEqp 2LGAs7BjhhvAZT0jHcirnLB9fUMT5u647O3s/SfdAn6pODFCRKm8TFzWaqeSzTjpeD Vd1/6lDmpuJwxFO294ttA8Syt8AxDbbB2SRvEo4wKp1pKiojqiz7WyCAVVz7x+KkII sm7qbHzhs1JHA== Received: by mail-ed1-f69.google.com with SMTP id m17-20020aa7d351000000b003e7c0bc8523so2167200edr.1 for ; Fri, 03 Dec 2021 02:04:09 -0800 (PST) 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=1TGVf79ZoOU1rLaLG+SkCHdKK+0e0TdTSY23mH6B4DA=; b=z1TrssWLAxbM2OSbSG3QPmYVhfbYZoRUCtaIbVD+UAwIRy0s5TnzoWScY2wxjBz5ow PkgR5dm4vuERVOqcHVjacMtguEn61OttEf1TBh+cIHpJzQ1hq07xoaeg2Gxmh+Ps1LsL wNq/8G6LHF35AmHLkC2KpuRvzfIw+OYk/w4Cyj7+rUJcg7zJ9rDYBhcazMZdze0Z1OAE RYiJoVD/nv+dccQp3st02+AyHZnz+1ts1OHZ4llIf+JcHzJmdGynmSWZ+zrSlBpKLKjg Gs8pnPLWKlSEEWc65dIhKkd7z1HnzNnoT8ZbGWNALdLX8YjkX8+aYtFNq1C8uImUaBxF XP0Q== X-Gm-Message-State: AOAM533Noz0RFBrUvGwF0PdnPXSpCTrYj/gAV2V3v+ZbL8vwVpwRhb2z CAsrv1FcLnB2X6yA/aUk7jprzdVVZBI8reb2E/t3U2wsTSk04meBRtEBLxnVx+tbgunzADG+R6C WmmyE3igJTiCiN43z85wbWtTRb84V1G8= X-Received: by 2002:adf:f551:: with SMTP id j17mr21186702wrp.392.1638525838036; Fri, 03 Dec 2021 02:03:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJy8y8cmkpwm//k5bVfJ0SfCKal1AkQCe+gL6sPSbEcruOXoVDyhDNqdfypd2DNxlfFVkEpslA== X-Received: by 2002:adf:f551:: with SMTP id j17mr21186630wrp.392.1638525837389; Fri, 03 Dec 2021 02:03:57 -0800 (PST) Received: from [192.168.123.55] (ip-88-152-144-157.hsi03.unitymediagroup.de. [88.152.144.157]) by smtp.gmail.com with ESMTPSA id s63sm2313084wme.22.2021.12.03.02.03.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Dec 2021 02:03:56 -0800 (PST) Message-ID: <93913911-4d20-d28f-ee04-739985184c5e@canonical.com> Date: Fri, 3 Dec 2021 11:03:55 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: [PATCH v6 00/25] fdt: Make OF_BOARD a boolean option Content-Language: en-US To: Simon Glass Cc: Mark Kettenis , Sean Anderson , Ilias Apalodimas , Tom Rini , =?UTF-8?Q?Fran=c3=a7ois_Ozog?= , Aaron Williams , Albert Aribaud , Alexander Graf , Anastasiia Lukianenko , Andre Przywara , Bin Meng , Jerry Van Baren , Linus Walleij , Matthias Brugger , Michal Simek , Oleksandr Andrushchenko , Peter Maydell , Stephen Warren , Stephen Warren , Thomas Fitzsimmons , Tuomas Tynkkynen , U-Boot Mailing List , Heinrich Schuchardt References: <20211202155919.2429190-1-sjg@chromium.org> From: Heinrich Schuchardt In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On 12/2/21 17:50, Simon Glass wrote: > Hi Heinrich, > > On Thu, 2 Dec 2021 at 09:47, Heinrich Schuchardt > wrote: >> >> On 12/2/21 16:58, 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 in another patch in this >>> series: "doc: Add documentation about devicetree usage" >>> >>> 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. >>> >>> Note: If board maintainers are able to add their own patch to add the >>> files, some patches in this series can be dropped. >>> >>> It also provides a few qemu clean-ups discovered along the way. The >>> qemu-riscv64_spl problem is fixed. >> >> Distros like Ubuntu are provided as preinstalled images using U-Boot to >> launch Linux for usage with QEMU. A single image must be able to be >> usable in the future irrespective of the QEMU command line device >> configuration. >> >> This means that the devicetree coming from QEMU must be accurately >> parsed in U-Boot to setup the UEFI memory map. The number and type of >> CPUs and the NUMA configuration must be accurate. All devices enabled >> via the QEMU command line must be visible in the device-tree of Linux. >> >> Please, observe that information like number of CPU cores, number and >> type of block devices, namespace IDs used for NVMe drives, etc. cannot >> be available at build time. >> >> It this all guaranteed with this series? If not, this would >> unfortunately imply a NAK. > > Yes, it is guaranteed and there is no change there. Compiling qemu_arm64_defconfig yields dtbdump.efi. I used this to dump the devicetree exposed to UEFI binaries. The number of CPUs and the memory size matches the call parameters of QEMU. Emulated devices like SCSI and NVMe drives and TPMv2 work inside U-Boot. I also tested: * qemu-riscv64_smode_defconfig as fw_jump payload for OpenSBI * qemu-riscv64_spl_defconfig and found no issues. Tested-by: Heinrich Schuchardt