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.7 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 ACC3FC4338F for ; Tue, 24 Aug 2021 09:47:01 +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 022C561374 for ; Tue, 24 Aug 2021 09:47:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 022C561374 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de 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 D645B82DB0; Tue, 24 Aug 2021 11:46:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1629798419; bh=NLpbBXboBJlvR6KkgBRIMZ4wWanO+hGFxgLMe1hlaXE=; h=To:cc:From:Subject:In-reply-to:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=W+ADXp/Cic7nRlK1aQeAFJnUhvuCNtnifljdqi6RDDw7Dqzwq+dxBWRckNH/NX+67 2gH/HxGPgk+EJDFVy8L7+V6e9rUdBneM81hUHuDDxdEXVnoaK10deIlh7jEQSuRGfw J7Cv+78WHKypYgbH7URVSeMhmMv3d48XD6ehotwDqjfYYlxWNcEOK5+QvdQejrS+3Y ID13mHBaV1T1qXs8c3iSTgsJZGyCpqfha/ZLaeWWcj+54RlYVMQLDlSNCJwGylQuaB 5SzzVi6VGFns03K3QeS2WgQ3r2SHXiS/UDCmrhxhwaBZv2WyO//z4s2JuYpF7FD1f9 6pY63z/n6AKRw== Received: from janitor.denx.de (unknown [62.91.23.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: noc@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id A2A2782E05 for ; Tue, 24 Aug 2021 11:46:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1629798416; bh=NLpbBXboBJlvR6KkgBRIMZ4wWanO+hGFxgLMe1hlaXE=; h=To:cc:From:Subject:In-reply-to:References:Date:From; b=h8/JdSEznp22zRNyrutnVn+GZcjfAyVHqxyxPi+9m3mj3mJYAqOj7zaXvbJ51/zbP Dh6t/tdjTAVqFu0KbJsE4gy7pvUfeA+SpuugYGyC3dfJHVIxuC8vfYTaRp+pSZJu3k BobgLQcINihX6Ffu/GmGg0r17dmnSTR/8wg7PLYS4Ii6Jm6JCRMqLtK3IM/EglsAnL aibrdhDB5gJPHYBurMdqexWr1htmAUTfAINKGH6cCr5q0UfDPfeGMPJONKn9U5em22 tk6auU4zv6TbuHqDGpROtTTmNJzgb/CDpVCSeSx6QA9AwyQxJz+Qv0sLoCKHq2gBb6 KXxBlGHFNAtog== Received: by janitor.denx.de (Postfix, from userid 108) id 56E2CA0227; Tue, 24 Aug 2021 11:46:56 +0200 (CEST) Received: from gemini.denx.de (gemini.denx.de [10.4.0.2]) by janitor.denx.de (Postfix) with ESMTPS id 4C783A00A1; Tue, 24 Aug 2021 11:46:41 +0200 (CEST) Received: from gemini.denx.de (localhost [IPv6:::1]) by gemini.denx.de (Postfix) with ESMTP id EAE311E1E46; Tue, 24 Aug 2021 11:46:40 +0200 (CEST) To: Christophe Leroy cc: =?UTF-8?Q?Pali_Roh=c3=a1r?= , Christophe Leroy , Simon Glass , Heinrich Schuchardt , Alexander Graf , Huan Wang , Angelo Dureghello , Priyanka Jain , Bin Meng , =?UTF-8?Q?Marek_Beh=c3=ban?= , Tom Rini , u-boot@lists.denx.de From: Wolfgang Denk Subject: Re: [PATCH v2] powerpc: mpc: Put U-Boot version string at correct place by linker script MIME-Version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 8bit In-reply-to: <75ae39aa-3762-6b90-c39a-7595fc417870@csgroup.eu> References: <20210802131838.21097-8-pali@kernel.org> <20210808112038.7942-1-pali@kernel.org> <20210808113651.tatdo2zm24clrmxk@pali> <75ae39aa-3762-6b90-c39a-7595fc417870@csgroup.eu> Comments: In-reply-to Christophe Leroy message dated "Tue, 24 Aug 2021 07:03:22 +0200." Date: Tue, 24 Aug 2021 11:46:40 +0200 Message-ID: <96716.1629798400@gemini.denx.de> 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 Dear Christophe, In message <75ae39aa-3762-6b90-c39a-7595fc417870@csgroup.eu> you wrote: > > > Also, could you look at this, why version string is at specific location > > of u-boot.bin header? > > I have no idea. AFAIKS it's been like that since the first version > in git in 2002. Maybe Wolfgang has the answer ? The Power Architecture was the very first where PPCBoot / U-Boot were running, more than 20 years ago. At that time, resources were tight. Systems would typically boot from a small NOR flash. Typical configurations came with 4 MB NOR / 16 MB RAM or such. One problem was that you needed always at least one (or better two, with redundancy) full sectors of the flash for the environment, even though this was typically only a few hundred bytes long. Many NOR flash chips of that time did not have uniform sector sizes; instead, they would come with mixed sector sizes. For example, there were NOR flash chips which came with sector sizes of 8, 4, 4, 16, 32, 32, 32, 32, ... kB. Here you would naturally want to use the two small 4 kB sectors for the environment, but this results in the need to have the environment storage "embedded" within the U-Boot image. This resulted in the need to come up with special linker scripts. And of course you would try to use the first 8 kB sector as good as possible, which was achieved by used manually optimized linker scripts, collecting functions or other objects such that the wasted gap at the end of the first sector was minimal - usually less than 100 bytes were wasted. As part of such optimizations, it might have made sense to put the version string there, too - it has a fixed size of a few ten bytes, so it is a good candidate to fill the gap. Today, such boot sector NOR flashes are no longer found in new designs, nor does anybody care to keep U-Boot small and tidy. As a result, knowledge about such optimizations is disappearing. Hope this helps. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de "If you want to eat hippopotamus, you've got to pay the freight." - attributed to an IBM guy, about why IBM software uses so much memory