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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 692EEC4320E for ; Wed, 11 Aug 2021 09:58:10 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 76E5260EB9 for ; Wed, 11 Aug 2021 09:58:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 76E5260EB9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=secretlab.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3D2E482D85; Wed, 11 Aug 2021 11:58:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=secretlab.ca 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=secretlab.ca header.i=@secretlab.ca header.b="JnCAqEv6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6FDD082D93; Wed, 11 Aug 2021 11:58:05 +0200 (CEST) Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0688882D85 for ; Wed, 11 Aug 2021 11:57:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=secretlab.ca Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=glikely@secretlab.ca Received: by mail-yb1-xb35.google.com with SMTP id z18so3437132ybg.8 for ; Wed, 11 Aug 2021 02:57:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secretlab.ca; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5At6ufuRoPHkTbUp+XlfjGwQ5V4oBWvQehpf/56lvbU=; b=JnCAqEv6UzpmySyd4eiviFum0HkIvyE+MAZR/lh68pbj7KL0lBCSi1eQYv8uEwIDlc HHnGLjmRXoIn6Jyb+sLsCS1XxEASN0V0AxrhWBaFKNuAPQg+3zFH38+lHttK/tK2JhEw WUHyYkv5IPobfVCu5snz01IW5wgt+WxePhIDLXj604Qv3+e/s5CThvDe4R0zN1doHPYS H+b6ar7gWPe0U4/yTTan0hIihZ9H4bD2/oLJZSP9BWWCBIsA+tk8xkDoAhk7IeEST9KD vqO+Q5LK3gsD25SdR72g+2erhc856YKGVLrFwcQYLRPCEYpjsHLU0BrcHNEEzvbmCCPa R0jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5At6ufuRoPHkTbUp+XlfjGwQ5V4oBWvQehpf/56lvbU=; b=j1geHAJnRetmYM9WVt7vkYlsTB8h7quZPA566/wFg1ISeHeThBM5ZMPUq+NZyzqkEm mRYEOq8igKauaWunJjIF08n0Tgnmw+VphxZueC4fZZAQCUVwAko/EjfSu3jE2sdbyT6f pHAheWHDlOqqujWaUxXwnlR67AlR5nvy/bWEdZzv4fnmKyjyI+l46Epch9bpLqU9c/JQ 4XZ2VzxKEqscBA2IsA3eDxDjkLoankPzQ4+ORrv1e5zRXnyrSeObU3MtI4wzkNCDVsX8 uMsR70NBXrz9jfNsIkAsiCqllx8FLh0qyevbz7JfgsAkkoLv6wqJRchaMRh/uzu38vhv GmKQ== X-Gm-Message-State: AOAM531yJPhwwiozX73EWLy0RJnXdOsCPZagAoqFA/ATzMFKlpvinCYg 1Yb/xBPprEAlkFXbFnkyYAmCYiGWtnAb14eK6ggxTQ== X-Google-Smtp-Source: ABdhPJwUekSsi/qgZzpYQdbAi1G+W5Z1G5nyCPEGEQou6xYqIxXJk+zxAPvBeIekmhks0gbZOl+/h4hIFR/IITjqFw8= X-Received: by 2002:a25:bc0f:: with SMTP id i15mr45661520ybh.233.1628675877659; Wed, 11 Aug 2021 02:57:57 -0700 (PDT) MIME-Version: 1.0 References: <20210809191111.GD858@bill-the-cat> In-Reply-To: <20210809191111.GD858@bill-the-cat> From: Grant Likely Date: Wed, 11 Aug 2021 10:57:45 +0100 Message-ID: Subject: Re: RFC: Support for U-Boot phases in Kconfig To: Tom Rini Cc: Simon Glass , U-Boot Mailing List , Marek Vasut , Masahiro Yamada , Heinrich Schuchardt , Bin Meng , Stefan Roese , =?UTF-8?B?TWFyZWsgQmVow7pu?= , Sean Anderson , Aaron Williams Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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 Mon, Aug 9, 2021 at 8:11 PM Tom Rini wrote: > > On Sat, Aug 07, 2021 at 04:23:36PM -0600, Simon Glass wrote: > > Comments welcome! > > I think what this is really showing is that Yamada-san was right. All > the games we need to do so that "make fooboard_config all" results in > building the N stages needed was the wrong track. Taking > khadas-edge-v-rk3399 as an example, if we had instead of > khadas-edge-v-rk3399_defconfig but khadas-edge-v-rk3399_tpl_defconfig > khadas-edge-v-rk3399_spl_defconfig and khadas-edge-v-rk3399_config, each > of which could set CONFIG_TPL, CONFIG_SPL or neither. Then yes, to > build u-boot-rockchip.bin you would need to pass in the separately build > TPL and SPL stages. But, that's true of so so many other platforms. To > pick another example, imx8mm_evk doesn't function without other > binaries. If in theory to build khadas-edge-v-rk3399 you had to do > something like: > $ export CROSS_COMPILE=aarch64-linux- > $ make O=obj/tpl khadas-edge-v-rk3399_tpl_config all > $ make O=obj/spl khadas-edge-v-rk3399_spl_config all > $ make O=obj/khadas-edge-v-rk3399 TPL=obj/tpl/u-boot.bin \ > SPL=obj/spl/u-boot.bin khadas-edge-v-rk3399_config all > > But it also meant that we didn't need to duplicate so so many Kconfig > options and most of our obj rules would just be: > obj-$(CONFIG_FOO) += foo.o > > would be a win. Oh! I quite like this. Simpler indeed. With all the different components that need to be pulled in to build a bootable image, each of the various U-Boot stages would just be another configuration that needs to be built and included in the result. I've already been playing with a top level build tool that starts with the U-Boot config and chooses the correct configuration of TFA, OPTEE, and any other binaries needed. Basically it is a top level Makefile that includes the U-Boot config and then passes make targets through to the right build directories. This could effectively be the same thing; start with the board config, and then filter it when going into each stages build directory with O= as you have above. If you want to look I've got the repo published here: https://gitlab.arm.com/systemready/u-boot-tfa-build/ g.