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 77A4DC19F2B for ; Wed, 3 Aug 2022 11:25:12 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0BA3D841C2; Wed, 3 Aug 2022 13:25:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.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=kernel.org header.i=@kernel.org header.b="Ez1fbECO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9307E84109; Wed, 3 Aug 2022 13:25:08 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 810DD841C2 for ; Wed, 3 Aug 2022 13:25:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6169A61008; Wed, 3 Aug 2022 11:25:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9AF6EC433C1; Wed, 3 Aug 2022 11:25:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659525903; bh=L1/L/6/dnDmKPrcQW1Cl7s3Jlzmyat6mH5ZM9lWCbuE=; h=From:To:Cc:Subject:Date:From; b=Ez1fbECOaeOSG1Y+7irsp8JcXoQtL7VPrfui4LHkOdLGcM0+ADWuSAID6wEF/emAd Md7uoH2ZLzBwKSLZOgvNCw9B7fUY2EnEVcyzVStAJPnr2VDmLTJanVBucI+qwDLyrK rFMRRZzDeZy3Eii/FTQ7HKAW5j20HR8FLvIHC1oxaq4CllmeFqZAxg2VoCU/C12evK q2hnAG4FHmAXzhfYft5z2dS7d23XAxSq7MxLaCVp9Z6OIZzsZqBZ3bhKLUYQWcmf79 R5dT25z00upGw0P5SQBqhUaKY65wch/i8mkaid37MlQTwfizFZabHu6SsepBSDbO6w zVab8kkBGTzNQ== Received: by pali.im (Postfix) id 1333F82E; Wed, 3 Aug 2022 13:25:01 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Wolfgang Denk , Simon Glass , Heinrich Schuchardt Cc: u-boot@lists.denx.de Subject: [PATCH] Makefile: Reduce usage of custom mpc85xx u-boot.bin target Date: Wed, 3 Aug 2022 13:24:42 +0200 Message-Id: <20220803112442.4735-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean Building of final u-boot.bin binary for mpc85xx via binman is needed only when inserting DTB binary in the middle of the u-boot ELF binary (before .bootpg and .resetvec ELF sections). These requirements are met when CONFIG_MPC85XX_HAVE_RESET_VECTOR is enabled (= generating .bootpg/.resetvec sections) and CONFIG_OF_SEPARATE is enabled (= inserting DTB binary). So in all other cases use standard build procedure instead of custom mpc85xx u-boot.bin Makefile target via binman. Signed-off-by: Pali Rohár --- This patch depends on patch series: https://patchwork.ozlabs.org/project/uboot/list/?series=312130 --- Makefile | 11 ++++------- arch/powerpc/Kconfig | 2 +- arch/powerpc/dts/u-boot.dtsi | 8 ++++---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index b1b08695cc47..d659c8118cba 100644 --- a/Makefile +++ b/Makefile @@ -1214,12 +1214,12 @@ else ifeq ($(CONFIG_OF_SEPARATE).$(CONFIG_OF_OMIT_DTB),y.) u-boot-dtb.bin: u-boot-nodtb.bin dts/dt.dtb FORCE $(call if_changed,cat) -ifneq ($(CONFIG_MPC85xx)$(CONFIG_OF_SEPARATE),yy) +ifneq ($(CONFIG_MPC85XX_HAVE_RESET_VECTOR)$(CONFIG_OF_SEPARATE),yy) u-boot.bin: u-boot-dtb.bin FORCE $(call if_changed,copy) endif -else ifneq ($(CONFIG_MPC85xx)$(CONFIG_OF_SEPARATE),yy) +else ifneq ($(CONFIG_MPC85XX_HAVE_RESET_VECTOR)$(CONFIG_OF_SEPARATE),yy) u-boot.bin: u-boot-nodtb.bin FORCE $(call if_changed,copy) endif @@ -1622,17 +1622,14 @@ u-boot-with-nand-spl.sfp: u-boot-spl-padx4.sfp u-boot.img FORCE endif -ifeq ($(CONFIG_MPC85xx)$(CONFIG_OF_SEPARATE),yy) -u-boot.bin: u-boot-nodtb.bin u-boot.dtb \ - $(if $(CONFIG_MPC85XX_HAVE_RESET_VECTOR), u-boot-br.bin) FORCE +ifeq ($(CONFIG_MPC85XX_HAVE_RESET_VECTOR)$(CONFIG_OF_SEPARATE),yy) +u-boot.bin: u-boot-nodtb.bin u-boot.dtb u-boot-br.bin FORCE $(call if_changed,binman) -ifeq ($(CONFIG_MPC85XX_HAVE_RESET_VECTOR),y) OBJCOPYFLAGS_u-boot-br.bin := -O binary -j .bootpg -j .resetvec u-boot-br.bin: u-boot FORCE $(call if_changed,objcopy) endif -endif quiet_cmd_ldr = LD $@ cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \ diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 737bdd8edb41..e0e2662f4c84 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -20,7 +20,7 @@ config MPC85xx select CREATE_ARCH_SYMLINK select SYS_FSL_DDR select SYS_FSL_DDR_BE - select BINMAN if OF_SEPARATE + select BINMAN if MPC85XX_HAVE_RESET_VECTOR && OF_SEPARATE imply CMD_HASH imply CMD_IRQ imply USB_EHCI_HCD if USB diff --git a/arch/powerpc/dts/u-boot.dtsi b/arch/powerpc/dts/u-boot.dtsi index 0251afddca82..6588bb7fa5e2 100644 --- a/arch/powerpc/dts/u-boot.dtsi +++ b/arch/powerpc/dts/u-boot.dtsi @@ -5,6 +5,8 @@ #include +#if defined(CONFIG_MPC85XX_HAVE_RESET_VECTOR) && defined(CONFIG_OF_SEPARATE) + / { binman { filename = "u-boot.bin"; @@ -19,17 +21,15 @@ }; u-boot-dtb-with-ucode { -#ifdef CONFIG_MPC85xx align = <4>; -#endif }; -#ifdef CONFIG_MPC85XX_HAVE_RESET_VECTOR #ifndef CONFIG_RESET_VECTOR_ADDRESS #define CONFIG_RESET_VECTOR_ADDRESS 0xfffffffc #endif powerpc-mpc85xx-bootpg-resetvec { offset = <(CONFIG_RESET_VECTOR_ADDRESS - 0xffc)>; }; -#endif }; }; + +#endif -- 2.20.1