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 687A2C433F5 for ; Tue, 5 Apr 2022 13:16:28 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BC01D83C0E; Tue, 5 Apr 2022 15:15: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="H2+ocJCH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D6B1583BEB; Tue, 5 Apr 2022 15:14:38 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (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 A5EEE83B0E for ; Tue, 5 Apr 2022 15:14:15 +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 A5EAB61867; Tue, 5 Apr 2022 13:14:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3D46C385A2; Tue, 5 Apr 2022 13:14:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649164453; bh=hsWf1K1mnN+Wks8X+bko0BezQsm6Pah8ZbgesKQdnFQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H2+ocJCHjN9lYI2enETryIohoSzoOSjciKcufdmS0EGxr66O4jz7J1VoMIgAkhl3j oxRrlmGGt3Jc+JzDfHoNAortnjWZ+dqqLLQr0itnUkqKosTooszz0hZLNl0PpE+3Lr EKL3UWhrWS6gDa4gbeBSbIjM6G4gbuKFCa9qig4WZo5CpTlS4HeltuQqPTafS+216F KJUwE5KMq5nMCF1bPnuAvajUchaqxcIuBlWHeRt9vBTOfMpCNFHyT4HUQDLi9zvb/u YivfXcOwo1ztoqPv0Vn1cCGiMFFzxGIRqAaiVFZgkcvPTCWXDO9ZDLEOAhJ92wYux+ 0YoTXwpOBjEng== Received: by pali.im (Postfix) id 679804A0B; Tue, 5 Apr 2022 15:14:10 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Priyanka Jain , Qiang Zhao , Shengzhou Liu , Alexander Graf , Bin Meng , Wolfgang Denk , Sinan Akman Cc: u-boot@lists.denx.de Subject: [PATCH 1/8] powerpc: mpc85xx: Fix CONFIG_OF_SEPARATE support Date: Tue, 5 Apr 2022 15:12:30 +0200 Message-Id: <20220405131237.405-2-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220405131237.405-1-pali@kernel.org> References: <20220405131237.405-1-pali@kernel.org> 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.5 at phobos.denx.de X-Virus-Status: Clean Currently CONFIG_OF_SEPARATE is completely broken and U-Boot for some mpc85xx board (e.g. P2020) has to be compiled with CONFIG_OF_EMBED. Otherwise it crashes during early init. When debug console is enabled and all debug logging options are turned on then U-Boot on P2020 with CONFIG_OF_SEPARATE prints following error: No valid device tree binary found at 110dc300 initcall sequence 110d3560 failed at call 1109535c (err=-1) ### ERROR ### Please RESET the board ### Problem is with appended DTB. When CONFIG_SYS_MPC85XX_NO_RESETVEC is set U-Boot binary image without DTB ends immediately after the .u_boot_list section. At this position is defined _end symbol at which U-Boot expects start of the appended DTB. Problem is that after .u_boot_list section are in linker script defined another sections with 256 byte long padding which are completely empty. During conversion of U-Boot ELF binary to RAW binary u-boot-nodtb.bin, objcopy removes trailing zero padding and therefore DTB is appended at wrong position. Changing alignment from 256 bytes to 4 bytes fixes this issue. And appended DTB is finally at he correct position. With this fix U-Boot on P2020 with CONFIG_OF_SEPARATE option starts working again. Signed-off-by: Pali Rohár --- arch/powerpc/cpu/mpc85xx/u-boot.lds | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/cpu/mpc85xx/u-boot.lds b/arch/powerpc/cpu/mpc85xx/u-boot.lds index 17a0e631ca3e..48509dbdae01 100644 --- a/arch/powerpc/cpu/mpc85xx/u-boot.lds +++ b/arch/powerpc/cpu/mpc85xx/u-boot.lds @@ -75,11 +75,11 @@ SECTIONS __ex_table : { *(__ex_table) } __stop___ex_table = .; - . = ALIGN(256); + . = ALIGN(4); __init_begin = .; .text.init : { *(.text.init) } .data.init : { *(.data.init) } - . = ALIGN(256); + . = ALIGN(4); __init_end = .; _end = .; -- 2.20.1