From patchwork Sun Nov 6 15:41:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Bj=C3=B8rn_Mork?= X-Patchwork-Id: 1700297 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=mork.no header.i=@mork.no header.a=rsa-sha256 header.s=b header.b=XiH7RhKp; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N52jP73T9z23ls for ; Mon, 7 Nov 2022 05:20:40 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4A47184374; Sun, 6 Nov 2022 19:20:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=mork.no Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=mork.no header.i=@mork.no header.b="XiH7RhKp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7285084567; Sun, 6 Nov 2022 16:41:22 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from louie.mork.no (louie.mork.no [IPv6:2001:41c8:51:8a:feff:ff:fe00:e5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 41B3B83F5C for ; Sun, 6 Nov 2022 16:41:20 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=mork.no Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=bjorn@miraculix.mork.no Received: from canardo.dyn.mork.no ([IPv6:2a01:799:c9c:2c00:0:0:0:1]) (authenticated bits=0) by louie.mork.no (8.15.2/8.15.2) with ESMTPSA id 2A6FfIxv766552 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK) for ; Sun, 6 Nov 2022 15:41:19 GMT Received: from miraculix.mork.no ([IPv6:2a01:799:c9c:2c02:34cc:c78d:869d:3d9d]) (authenticated bits=0) by canardo.dyn.mork.no (8.15.2/8.15.2) with ESMTPSA id 2A6FfCAZ3699845 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK); Sun, 6 Nov 2022 16:41:12 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mork.no; s=b; t=1667749272; bh=0FN1BMGoWIuloy3rkVTHCvsCKLCQ1UosrN7cV0Bzkvs=; h=From:To:Cc:Subject:Date:Message-Id:From; b=XiH7RhKpvkOZeNGnXTDV0py8K5/KqEUXjQ5DeVcppSbMIcoJVN7KTiS4PqcSSws3e DZ3fdlFukBX3BWmTl0S6kXxa3W+hwafyz2NIXxVS3AAuaMce105BUYsXtarAtN1X1y Fewv/bdW89pIJs7NqDDnRIX9+mSRe4BL0XUasKOs= Received: (nullmailer pid 872259 invoked by uid 1000); Sun, 06 Nov 2022 15:41:12 -0000 From: =?utf-8?q?Bj=C3=B8rn_Mork?= To: u-boot@lists.denx.de Cc: =?utf-8?q?Bj=C3=B8rn_Mork?= Subject: [RFC v2 0/2] Prevent alignment issues with "in place" FIT configurations Date: Sun, 6 Nov 2022 16:41:09 +0100 Message-Id: <20221106154111.872209-1-bjorn@mork.no> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 06 Nov 2022 19:20:30 +0100 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 Looking for some feedback on whether this is a problem wanting to be solved, and if so, whether this solution would be acceptible (after some polishing). I recently hit alignment issues on a device where U-Boot has been modified to force "in place" fdt loading regardless of the fdt_high environment variable. I realize that this is not a U-Boot problem, but I still think that it would be worthwile to make mkimage produce FIT images suitable for such devices. This is only one of many possible solutions. The libfdt changes will obviously have to be accepted by the dtc community. I'v posted a similar request to the devicetree-compiler list with those changes. The libfdt patch is included here for convenience. The expected impact for U-Boot is only the tools/fit_image.c patch. Bjørn Changes v2: - actually use the new fdt_alignprop() instead of an earlier PoC hack Bjørn Mork (2): libfdt: add fdt_alignprop mkimage: Align fdt images in FIT to 8 bytes scripts/dtc/libfdt/fdt_rw.c | 26 +++++++++++++++++++ scripts/dtc/libfdt/fdt_wip.c | 2 +- scripts/dtc/libfdt/libfdt.h | 30 +++++++++++++++++++++ scripts/dtc/libfdt/libfdt_internal.h | 1 + tools/fit_image.c | 39 ++++++++++++++++++++++++++++ 5 files changed, 97 insertions(+), 1 deletion(-)