Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp224787lql; Fri, 12 Apr 2024 08:33:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXLOVmXZffk7/cvmWiGW5VLRHNO2K4nbzTm2RxwfrdNWcqYk9allH1hKGFcOmAzoArlc+gqmK07WR5hnXBMRHEWAdokDNbRSBXaZWkuug== X-Google-Smtp-Source: AGHT+IGYYtHVkU/Mr8wRUm9+VgQJTuQzpNJFMQiQ8LHRzRk5UnMQtfz3vXwN71cDhrOtcUzOnjO2 X-Received: by 2002:a05:6a21:78a7:b0:1a7:6918:9e96 with SMTP id bf39-20020a056a2178a700b001a769189e96mr3831077pzc.3.1712936006745; Fri, 12 Apr 2024 08:33:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712936006; cv=pass; d=google.com; s=arc-20160816; b=UigbItyNkPXQJmpn0elrvT6RgCjLHwG1A2UCkMhIYk1uBHQIwkX9d1vZyi7V/eyB/G yK3qkXRlyqj3WbxzTNJojnDngRN8cQLxPGBN0ZnX1yETxl5bLFQtAtYh62DRnNr1pPCb arvG6YO/f16oC5ox1p4578idY/VUf9rlWxNBwox6rfuUT56b2JTMM8REjUxXM+5NA/Gp 4Gus3Xf3iBkXRdmMFz2fj+ym+5bUxw+HJS2YjTgHJX6AuI+L6VqUUIdepr3geX4u2WT7 FxjxUjpTcmjgN5tmaTqvxjV+DAsFCUmo7rumsqYvC2+fs7m1Fy/Tj58bbYIXkb7nQlBn 1Zfw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=uqDcmcdfEAxpSmSYIoRjoyegxjm8YY6DAayxwa7eB28=; fh=f782yJELPpnGi9mdAaa7wsIcE3GSaopGaIKeoqLH26M=; b=oOqBMTGw2f0x+gAji2zrL5OYrodjKLHEwd4Es2YU35mkFOSweBwXOnEpPBr4LDF0Rv ywkWMU08lV3FmSLTvJIG9fDNVeaYFZkdjYCzcgZPN01iaeczg+QzhZtxU/iHL9oXZx5U PRLQYqxhOOEh9sGsVDojzR54hN7dWtlU7pDbFL0t4TmFKm9hejPNKt5noHIhXTXe9WoB ocKw/NqCcDx/OSVgsbo5AIGg4z1vedxC86/6iyL7Ayg0zkTV1nNqEL+l1MhRxqVvnWgv +2NbOgep5Om9RQAOWRRp+ReqRlc9jQH8dVf/W968rUAtEo0LoG9oBQw7vv9wJJZ0fhDT HVKw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="k/FmKeKw"; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-142958-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142958-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id lo19-20020a056a003d1300b006ea8952e51asi3597004pfb.165.2024.04.12.08.33.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 08:33:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142958-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="k/FmKeKw"; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-142958-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142958-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id CC6C32845D1 for ; Fri, 12 Apr 2024 15:32:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AC87814830A; Fri, 12 Apr 2024 15:32:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="k/FmKeKw" Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A4795914E for ; Fri, 12 Apr 2024 15:32:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712935974; cv=none; b=toRQVJrT2VGRt+zyPAB2ljnzQAeIIJeK1ndvdocit079qlhZQIEcDZTrYR44A1H5KjT3MC2qXfQQELaQRMkLAVt8vcbvIXGzJjwV6mgGljeGqQM+KAYxjg+l3i+DEe/7cRd1PSKbBLP9SrDD/PhSIZyjh+Z9+dfaC7bEEGc9wp0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712935974; c=relaxed/simple; bh=UFaq0ZdoaAokHjBDmb2GnGSnjteDkN3nqKEA8qMhodI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=aORCWECf+21+z+d34LbIjSJSrr0KAk4KqYTkBijWcmrZTf2BFANH1VHpujcCeab0bjnoxxmGMNLTbZDs7Qla4orJ4+Vz1Db1ETRUz6kqjP2KhrUN8iTMKOEUFZkj5kzsT2+hAVQA5+56zz7PLLKzTyeCJhRwxdPsMMfoEdxQaIQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=k/FmKeKw; arc=none smtp.client-ip=209.85.166.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-7d5facf3161so36504039f.1 for ; Fri, 12 Apr 2024 08:32:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1712935972; x=1713540772; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=uqDcmcdfEAxpSmSYIoRjoyegxjm8YY6DAayxwa7eB28=; b=k/FmKeKwkP109g4z22eKPhum0evxOdrXuh9WFFgd+YiKVZ9ijk2zaNhsMi2h/PkW+7 XYz/dICCp3j/KkBA9s4OwfVSL6iuabF2bSOHdpkP1BYFCeq2s3DiD4XHD4NQK0Z7Jeth KjXpZup5YyTan0IxPjF5+6A3meWnVe3hrbeqg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712935972; x=1713540772; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=uqDcmcdfEAxpSmSYIoRjoyegxjm8YY6DAayxwa7eB28=; b=IwZyFlJSSK10tmMybgmXqtX3EucZZxYkVUUjmyInj5VJvQHV04EudYlCzeOmVTFMkI AWbu38UeLT4p/frFg0pTtsM/F3zgE2E406wQRLMEo4QwV7ew1+RNx+tjjzV/bYBNkT3E 4hak3wlr53cfyOiTExvqNQxe+5tEAgqLfeb6fKYYApwZIRTDbhODZDr/XeRUeAK/mTwo nmqqMgdVB4wwEffWwi22aPuUHo+1004obL7yNDCrpyzMRMdMNNNSY5CTn8cLYqOZPDsI NSecXJRKKzNP7y7e8r15anElcB5e5zkQQYvLHgFQGEozit4ZblPp7SrosAgTsar4nsNa PvOQ== X-Forwarded-Encrypted: i=1; AJvYcCVYEvcbWClOr5/1rVYl++zKUXjrdf9o3ctouRafL9QjRK4rQizQYEx1w/AS5Q10DtWtswIghp7L8lkcRBWITHthvsQu4aTFi59j4BM8 X-Gm-Message-State: AOJu0Yx3zB/OwXCRD1By31N0Z1V5T91x0uikbqc5jJ/ZUweU5GZ9UlTl t3vPrODwxSYu5u2d+MFSw8k8vuv9M1Zt5eQ86jfOBU8XoAxd5txGFVibocSTdA== X-Received: by 2002:a05:6602:1a98:b0:7d6:3f52:2f27 with SMTP id bn24-20020a0566021a9800b007d63f522f27mr3223842iob.0.1712935972439; Fri, 12 Apr 2024 08:32:52 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id ik14-20020a0566026c0e00b007d65a95d95csm1093828iob.42.2024.04.12.08.32.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 08:32:52 -0700 (PDT) From: Simon Glass To: devicetree@vger.kernel.org Cc: U-Boot Mailing List , Michael Walle , Tom Rini , linux-mtd@lists.infradead.org, Miquel Raynal , Rob Herring , Simon Glass , Conor Dooley , Krzysztof Kozlowski , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Richard Weinberger , Vignesh Raghavendra , linux-kernel@vger.kernel.org Subject: [PATCH v11 1/2] dt-bindings: mtd: fixed-partitions: Add alignment properties Date: Fri, 12 Apr 2024 09:32:48 -0600 Message-Id: <20240412153249.100787-1-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add three properties for controlling alignment of partitions, aka 'entries' in fixed-partition. For now there is no explicit mention of hierarchy, so a 'section' is just the 'fixed-partitions' node. These new properties are inputs to the Binman 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 Reviewed-by: Rob Herring --- Changes in v11: - Drop mention of Binman - Use 'content' instead of 'contents' Changes in v10: - Update the minimum to 2 Changes in v9: - Move binding example to next batch to avoid build error Changes in v7: - Drop patch 'Add binman compatible' - Put the alignment properties into the fixed-partition binding Changes in v6: - Correct schema-validation errors missed due to older dt-schema (enum fix and reg addition) 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 .../bindings/mtd/partitions/partition.yaml | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/Documentation/devicetree/bindings/mtd/partitions/partition.yaml b/Documentation/devicetree/bindings/mtd/partitions/partition.yaml index 1ebe9e2347ea..31bbeb161396 100644 --- a/Documentation/devicetree/bindings/mtd/partitions/partition.yaml +++ b/Documentation/devicetree/bindings/mtd/partitions/partition.yaml @@ -57,6 +57,57 @@ properties: user space from type: boolean + align: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 2 + 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: 2 + 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 content of the + entry 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: 2 + 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 content of the entry will still start at the beginning. + But there may be padding at the end. While this does not affect the + content of the entry 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. + if: not: required: [ reg ] -- 2.34.1