Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2166083rda; Tue, 24 Oct 2023 14:41:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFwEmkQIoAi3m4hBGIuu6Vhj057ZzXdaF0EBxAGQdasgFI9V1yEu27tbIuUUY5bJOrNGFgS X-Received: by 2002:a17:903:11cd:b0:1c7:29fd:33b6 with SMTP id q13-20020a17090311cd00b001c729fd33b6mr12324631plh.40.1698183719490; Tue, 24 Oct 2023 14:41:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698183719; cv=none; d=google.com; s=arc-20160816; b=IPROrdhDWL7YLUhL3NlACjT144rFW9pw0Jj01njF+JGRtnJf6eB7SijSdXhESvSoBc tOz8cr9UjHZr3xl64nDb6J7TwYCWXrwlQrIJuOvaNuyTNj6wOQHLkYHiJszXuIDIaB+D kuyroEwfsaY0VlNvKOeTfiKAhREIrVWL2kGEAbwUxP9+I6YZaGkf1T0ONKWaZsR1Lc1j Ge4WhibWTsA/YA2AvGytc/czUNIq30juuc6qJ+c04XfhG57Ph8HIH69T7QzmCAQwBigH KsLJBvcmxr5kBzqUV/yaJsXDbhK/iAU9T49cPrdL+ymdTVzuofNVbTxpMEMcDjZtsOKU k+hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aochEXBDpOVdwQRDyloN4dJAYsQ0xcQP5GM4jBPJ4+0=; fh=qBDRXPXB77hfwevTJt1fh486lYG1EJG5Xw2+Mlz0s4Q=; b=1DiFCoXSezalsVVy2y649NnFZHjkSLYDQbdTrPTeQMd9WbKlUUuEsM9RWF+rD/+dYL GbK49QAjeG6es5RMkALIeWac2r+tobfYGR8pccy/0kaRRkej6a9NxK+EQdiklXQWzc99 dnyD9IwiyrmVBuktubPQw0bd5fsdukWmheIa+I3j37yAp2vkwSmqJZXcmrTPGRHJRnc4 2lH3S7/aOQj6/PSIMUE8UO3QTB9WT41fJlTrfagrUP2SaWhRt/PQ4tvL6PhO9c3v0wy5 LtNUaqsUZTBLpyCThdGnzwB56KzxQlDK21poI7ix6ca7mfyF6+SUPG8ui8qjd2Fx3mNu wKEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=d7tvpKYr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id j4-20020a170903028400b001c7545405b5si9289046plr.519.2023.10.24.14.41.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 14:41:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=d7tvpKYr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 14F4B8050034; Tue, 24 Oct 2023 14:41:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344488AbjJXVlf (ORCPT + 99 others); Tue, 24 Oct 2023 17:41:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344483AbjJXVlb (ORCPT ); Tue, 24 Oct 2023 17:41:31 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B31910F6 for ; Tue, 24 Oct 2023 14:41:23 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6b36e1fcee9so4246827b3a.3 for ; Tue, 24 Oct 2023 14:41:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1698183683; x=1698788483; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aochEXBDpOVdwQRDyloN4dJAYsQ0xcQP5GM4jBPJ4+0=; b=d7tvpKYrzBtxtmlN0ix4M4txemIB0fozRONjstLOx6DOVdbYDjiL/ne12vpgExvIrO YW7Gpr/tqqLL5tRTD0zLkhjyk6N1t/TjgOjpHhw5gTGDzDeomhjWPV1rwhbReCNIFsWL fNvAlCnRviE3FLpQFpTrlXRTvlAANskf6PoPY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698183683; x=1698788483; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aochEXBDpOVdwQRDyloN4dJAYsQ0xcQP5GM4jBPJ4+0=; b=KOWmvL56hJhrP+jCsVb/jl2biRhdHO4byXjDWWF07+GDU0gP2lYehCWGDs1G2CzbZg ZcoFRz74vW0WqMMrmkeA57oq4g52QS/8UwEIozgaktR7La7SQ1byBIOiA8duYsNmtQ7j 3dZDBeoy1KhS1qCxIOjqgCdCaL6FixfkXEnD/sAwCjw0jXCysOAHkZM5tjBzV94hwdZV Lk8TEuhGzevo2pVsdlsUmXXiHblW8gANl62PBBmIaG6u0zGKCv/AwjzhyHgf2Jf8yYEK ZgLW2uv/wyKVbOXs9r08fgQX1FwUwsdOuerCucSbKQsPGNxnLP1uW+3k/Vs5HtWp3f2S 2sxw== X-Gm-Message-State: AOJu0Yy10K9ctcTepUmYX0IwuNI35DgJvUH2Q8+/QZhVtvNX+cdbcveR YX0yhXGoP/f7ce2HJLPXnS6dHw== X-Received: by 2002:a05:6a21:164a:b0:151:7d4c:899c with SMTP id no10-20020a056a21164a00b001517d4c899cmr3632385pzb.25.1698183682801; Tue, 24 Oct 2023 14:41:22 -0700 (PDT) Received: from sjg1.roam.corp.google.com ([202.144.206.130]) by smtp.gmail.com with ESMTPSA id 18-20020a170902c21200b001c5f7e06256sm7861055pll.152.2023.10.24.14.41.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 14:41:22 -0700 (PDT) From: Simon Glass To: devicetree@vger.kernel.org Cc: linux-mtd@lists.infradead.org, U-Boot Mailing List , Michael Walle , Tom Rini , Miquel Raynal , Rob Herring , Simon Glass , Conor Dooley , Krzysztof Kozlowski , Richard Weinberger , Rob Herring , Vignesh Raghavendra , linux-kernel@vger.kernel.org Subject: [PATCH v5 3/3] dt-bindings: mtd: binman-partitions: Add alignment properties Date: Wed, 25 Oct 2023 10:39:18 +1300 Message-ID: <20231024213940.3590507-3-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.758.gaed0368e0e-goog In-Reply-To: <20231024213940.3590507-1-sjg@chromium.org> References: <20231024213940.3590507-1-sjg@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 24 Oct 2023 14:41:57 -0700 (PDT) Add three properties for controlling alignment of partitions, aka 'entries' in binman. For now there is no explicit mention of hierarchy, so a 'section' is just the 'binman' node. These new properties are inputs to the packaging process, but are also needed if the firmware is repacked, to ensure that alignment constraints are not violated. Therefore they are provided as part of the schema. Signed-off-by: Simon Glass --- Changes in v5: - Add value ranges - Consistently mention alignment must be power-of-2 - Mention that alignment refers to bytes Changes in v2: - Fix 'a' typo in commit message .../mtd/partitions/binman-partition.yaml | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/Documentation/devicetree/bindings/mtd/partitions/binman-partition.yaml b/Documentation/devicetree/bindings/mtd/partitions/binman-partition.yaml index 37a413464b0ce5..cb1edd83ed29a9 100644 --- a/Documentation/devicetree/bindings/mtd/partitions/binman-partition.yaml +++ b/Documentation/devicetree/bindings/mtd/partitions/binman-partition.yaml @@ -29,6 +29,57 @@ properties: - u-boot # u-boot.bin from U-Boot project - tfa-bl31 # bl31.bin or bl31.elf from TF-A project + align: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 1 + maximum: 0x80000000 + multipleOf: 2 + description: + This sets the alignment of the entry in bytes. + + The entry offset is adjusted so that the entry starts on an aligned + boundary within the containing section or image. For example ‘align = + <16>’ means that the entry will start on a 16-byte boundary. This may + mean that padding is added before the entry. The padding is part of + the containing section but is not included in the entry, meaning that + an empty space may be created before the entry starts. Alignment + must be a power of 2. If ‘align’ is not provided, no alignment is + performed. + + align-size: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 1 + maximum: 0x80000000 + multipleOf: 2 + description: + This sets the alignment of the entry size in bytes. It must be a power + of 2. + + For example, to ensure that the size of an entry is a multiple of 64 + bytes, set this to 64. While this does not affect the contents of the + entry within binman itself (the padding is performed only when its + parent section is assembled), the end result is that the entry ends + with the padding bytes, so may grow. If ‘align-size’ is not provided, + no alignment is performed. + + align-end: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 1 + maximum: 0x80000000 + multipleOf: 2 + description: + This sets the alignment (in bytes) of the end of an entry with respect + to the containing section. It must be a power of 2. + + Some entries require that they end on an alignment boundary, + regardless of where they start. This does not move the start of the + entry, so the contents of the entry will still start at the beginning. + But there may be padding at the end. While this does not affect the + contents of the entry within binman itself (the padding is performed + only when its parent section is assembled), the end result is that the + entry ends with the padding bytes, so may grow. If ‘align-end’ is not + provided, no alignment is performed. + additionalProperties: false examples: @@ -41,10 +92,13 @@ examples: partition@100000 { compatible = "u-boot"; reg = <0x100000 0xf00000>; + align-size = <0x1000>; + align-end = <0x10000>; }; partition@200000 { compatible = "tfa-bl31"; reg = <0x200000 0x100000>; + align = <0x4000>; }; }; -- 2.42.0.758.gaed0368e0e-goog