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 0EBB2C433F5 for ; Wed, 29 Sep 2021 05:39:29 +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 6169D6139D for ; Wed, 29 Sep 2021 05:39:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6169D6139D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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 027B5831D3; Wed, 29 Sep 2021 07:39:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="Dl3eMpmZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 90282831D3; Wed, 29 Sep 2021 07:39:23 +0200 (CEST) Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) (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 1912480C58 for ; Wed, 29 Sep 2021 07:39:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-ed1-x52e.google.com with SMTP id g7so4113129edv.1 for ; Tue, 28 Sep 2021 22:39:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=RY3TPcWTqILaLs0/4B+M8fhTbjQpYmCjkt5O7fnZGBg=; b=Dl3eMpmZLU8WPvn+C2ym5/+inbeqx7beJ/a7WWcTB0JX6MCLBu12Jdj9AJnNcsZqbw TWfaFmaW31mZHRExrns70mKR8mvnxRgYPPEloqqgrwvG39EsG/RV53knnYDGCnMgbJm1 c5JvgFsVSYCQL6HbW0OyY0JcRz6vRg/94QBog+2XzSHGWbo2qQZ3cfQ0yZcZu6VYrkms cSoNIJZql9NrsaQM7mjLbFi4Iim/q2VQ7JGzouCT77gDTyMi9CVfJ0G0iFFUP72+nDqi aUrdVRTmRxGzyyoQR39PaQe+n/ZRRFNyO/q5azg4eiTuefXh9HlZQkGBuSJFWI/sZ0I6 CA9w== 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:in-reply-to; bh=RY3TPcWTqILaLs0/4B+M8fhTbjQpYmCjkt5O7fnZGBg=; b=s2hP1hFHmKw1zE5zJABbBYNIlYy7zz5BGJ1bVemhP85I4GPwI7QRo86I8r32fbR2Iy GZf/Dr2f0LPht7Ifpn9HMaetX5RUU9ynbpjx9rLkjL/VmogpcZNcvI0VxT7Xerru5irc dMju6LkE3g8qvFCgrQu460FT+YAif9hpscd2Xkxy8cSMwMTY5BkJUCOFWGnuYENAhu46 d2ZfGkInjjBd+csv6vVKOgV+m1kc9VP27sKrcocLwK13g4UADWbZp9P2BDx6TE7+gyzu r6R7ovqpI/japw3TXcNppg0u3ljpg/z03TDdNgBb0NRJOjP9flv9F8lLUZK7jO2Iz5+A EQdA== X-Gm-Message-State: AOAM533mQdM42ualdcDxsq3/i4rlSqsXdxVXuum2RoLupHPukbRHBKKN zqBvs494VARqX7O1pduQ7zUoWA== X-Google-Smtp-Source: ABdhPJzPs7YtURHWnz91QooGUmtCTIVJDxGUgHFfUeA1YINBnCCX4t8EPxO6m3T4AdIbJOXKjri3RA== X-Received: by 2002:a05:6402:288f:: with SMTP id eg15mr12758475edb.356.1632893959540; Tue, 28 Sep 2021 22:39:19 -0700 (PDT) Received: from apalos.home (ppp-94-66-220-209.home.otenet.gr. [94.66.220.209]) by smtp.gmail.com with ESMTPSA id u19sm739366edv.40.2021.09.28.22.39.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Sep 2021 22:39:19 -0700 (PDT) Date: Wed, 29 Sep 2021 08:39:15 +0300 From: Ilias Apalodimas To: Simon Glass Cc: Tom Rini , Pali =?iso-8859-1?Q?Roh=E1r?= , Marek =?iso-8859-1?Q?Beh=FAn?= , Bin Meng , Chee Hong Ang , Heinrich Schuchardt , Sean Anderson , Patrick Delaunay , Joe Hershberger , Nicolas Saenz Julienne , Wasim Khan , AKASHI Takahiro , Etienne Carriere , Alexandru Gagniuc , Nandor Han , Steffen Jaeckel , Heiko Schocher , Asherah Connor , Andre Przywara , U-Boot Mailing List Subject: Re: [PATCH] sandbox: Remove OF_HOSTFILE Message-ID: References: <20210928090544.186489-1-ilias.apalodimas@linaro.org> <20210928090544.186489-2-ilias.apalodimas@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Hi Simon, [...] > > -INPUTS-$(CONFIG_OF_HOSTFILE) += u-boot.dtb > > +INPUTS-$(CONFIG_SANDBOX) += u-boot.dtb > > ifneq ($(CONFIG_SPL_TARGET),) > > INPUTS-$(CONFIG_SPL) += $(CONFIG_SPL_TARGET:"%"=%) > > endif > > @@ -1423,7 +1423,7 @@ u-boot-lzma.img: u-boot.bin.lzma FORCE > > > > u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl u-boot-ivt.img: \ > > $(if $(CONFIG_SPL_LOAD_FIT),u-boot-nodtb.bin \ > > - $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_OF_HOSTFILE)$(CONFIG_BINMAN_STANDALONE_FDT),dts/dt.dtb) \ > > + $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_SANDBOX)$(CONFIG_BINMAN_STANDALONE_FDT),dts/dt.dtb) \ > > ,$(UBOOT_BIN)) FORCE > > $(call if_changed,mkimage) > > $(BOARD_SIZE_CHECK) > > @@ -1437,7 +1437,7 @@ MKIMAGEFLAGS_u-boot.itb += -B 0x8 > > > > ifdef U_BOOT_ITS > > u-boot.itb: u-boot-nodtb.bin \ > > - $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_OF_HOSTFILE),dts/dt.dtb) \ > > + $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_SANDBOX),dts/dt.dtb) \ > > $(U_BOOT_ITS) FORCE > > $(call if_changed,mkfitimage) > > $(BOARD_SIZE_CHECK) > > diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandbox/cpu/cpu.c > > index 48636ab63919..bc67a5a5a10b 100644 > > --- a/arch/sandbox/cpu/cpu.c > > +++ b/arch/sandbox/cpu/cpu.c > > @@ -291,44 +291,47 @@ void invalidate_dcache_range(unsigned long start, unsigned long stop) > > { > > } > > > > -int sandbox_read_fdt_from_file(void) > > +void *board_fdt_blob_setup(void) > > Can you instead keep the function and call it from your new > board_fdt_blob_setup() function? That way the error path goes through > one place and we don't need to add goto. Not without changing board_fdt_blob_setup() itself. The function returns a ptr and not an int. We had a different #ifdef up to now, so the existing function was returning an int and was setting the gd->fdt_blob internally. In any case the goto either remains of gets converted to 'return NULL'. > > The other problem is that we need to know whether a DT is required > (i.e. -d, -D or -T). So it must fail (and exit) if it is required but > cannot be loaded. So there's two things we could do here. Either explicitly check for NULL if sandbox is enabled or change board_fdt_blob_setup and put an error return code in an argument. I'll go with the return code in v2 [...] > > - * > > - * Read a device tree file from a host file and set it up for use as the > > - * control FDT. > > - */ > > -int sandbox_read_fdt_from_file(void); > > - > > /** > > * sandbox_reset() - reset sandbox > > * > > diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig > > index f7098b496983..358a6c168259 100644 > > --- a/configs/sandbox64_defconfig > > +++ b/configs/sandbox64_defconfig > > @@ -86,7 +86,7 @@ CONFIG_MAC_PARTITION=y > > CONFIG_AMIGA_PARTITION=y > > CONFIG_OF_CONTROL=y > > CONFIG_OF_LIVE=y > > -CONFIG_OF_HOSTFILE=y > > +CONFIG_OF_BOARD=y > > Can we put this in Kconfig instead, so it is enabled for all sandbox boards? Sure [...] > > --- a/scripts/Makefile.spl > > +++ b/scripts/Makefile.spl > > @@ -298,11 +298,11 @@ endif > > # Build the .dtb file if: > > # - we are not using OF_PLATDATA > > # - we are using OF_CONTROL > > -# - we have either OF_SEPARATE or OF_HOSTFILE > > +# - we have either OF_SEPARATE or we are compiling for sandbox > > build_dtb := > > ifeq ($(CONFIG_$(SPL_TPL_)OF_PLATDATA),) > > ifneq ($(CONFIG_$(SPL_TPL_)OF_CONTROL),) > > -ifeq ($(CONFIG_OF_SEPARATE)$(CONFIG_OF_HOSTFILE),y) > > +ifeq ($(CONFIG_OF_SEPARATE)$(CONFIG_SANDBOX_SPL),y) > > Do you mean CONFIG_SANDBOX ? I thought we could use either. I assumed since this is an SPL makefile CONFIG_SANDBOX_SPL would be defined. If it's not I can switch to CONFIG_SANDBOX > > > build_dtb := y > > endif > > endif > > -- > > 2.33.0 > > > > Regards, > Simon Thanks /Ilias