From patchwork Tue Oct 24 21:39:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 157704 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp2217988vqx; Tue, 24 Oct 2023 14:41:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGXtMm6BM0yL58xLnMp2fifkqpAQUs1RuOVB48vLto88F2qErDWVwbc+68YYugu48N3+bTI X-Received: by 2002:a05:6a00:14ce:b0:691:2d4:23a2 with SMTP id w14-20020a056a0014ce00b0069102d423a2mr13026240pfu.31.1698183699222; Tue, 24 Oct 2023 14:41:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698183699; cv=none; d=google.com; s=arc-20160816; b=KQi41mDy1IEo3po89iYDBkrzIbbDXOCmxKI92bXf2LIMneOa8ygWQ2c6noJz0CfVte 4IxTSHwCfph2vA9wwXdoplH4v16KjCl1Cw6VayTRIVKL94iHrWC1yC0loeI8hpG/e35r UtHXeMTlPKhuLj6ETBGSVkWduiHMKDoYhyBdrtFxvV8b2bi7louEv/m9ssN3pM441cSS YvG+iEIGK9jhPf+cLaWKqO6gt7fYkPnc+1pbur5aO4Zjgc7ugOtHDVkf2RjOXlekxc/E cy2iJO76n2B+o/6uMeNqBWOA0+UAcfFGyQkKXOjC92jYvwgfKMAgQX+f3m2PhDY1M90u vstw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=G+PJMUDgFS0mbnTyh5WsQidRx6hFK5cmXyxRNKDFwO8=; fh=pRJTaRfAMbjmn3Dnig+Saoyssf9cPy0Zf2XeyVHCFC4=; b=d9Wremr9WSzpNWacFQ0h3VionoFUn9xvYftIwPqspslzOZ2ZMIswbdxxJiSCLXRgK2 H+u2X0WMU6axCs1T8mI9nWEb+5DzFOpbQTh7SMohHcZ4z5uAoZSz3onZhDebGaSS/WE4 JYfQ/zesc70so+JZvAAuZkaX4FKzX+dxelzyP96xJpm+Srfe1cfsuuV84PqNscPjHtyG e2Dof2qUN7/W8xlO7mIPHh6PZvAyuHebzF1sb5ae95eFAvRUtF2nSGcYpopR1E7njUvG N1LyrRvjCU0m9OiXgIFmiQlYuaNNVXTf0z9k4OaMxkEGjKRHrNHaH8KO5Da9wI/+gII1 Rc5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JM1FghlT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id a1-20020aa794a1000000b006bd9ff6dab2si8771200pfl.377.2023.10.24.14.41.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 14:41:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JM1FghlT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id BD5A48061369; Tue, 24 Oct 2023 14:41:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344455AbjJXVlR (ORCPT + 27 others); Tue, 24 Oct 2023 17:41:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344393AbjJXVlO (ORCPT ); Tue, 24 Oct 2023 17:41:14 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18C38186 for ; Tue, 24 Oct 2023 14:41:12 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1cacde97002so29765565ad.2 for ; Tue, 24 Oct 2023 14:41:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1698183671; x=1698788471; 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=G+PJMUDgFS0mbnTyh5WsQidRx6hFK5cmXyxRNKDFwO8=; b=JM1FghlTZIwKQRB3L1Wl3W03bl1JKoC1X2UTARXuc+rfgtDMsi1t0aeB9U7YDHJmLF fm1AJXtCzWpzjvjY3J5OK/2r7RldQSwGY3xJunIKA9LLGX6GxoEpSDQ4vfJzX5m19j6a +wFPUQEcY35nonJJwWED2woquExZUxEPCoC5M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698183671; x=1698788471; 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=G+PJMUDgFS0mbnTyh5WsQidRx6hFK5cmXyxRNKDFwO8=; b=vzI1wNGd5HredBulpBjCi91Ou7YhM6l1g/w2qFGudu9HelSSlLDXgGuZKOqVQBpMIz E/vyfewza9e1u/d3dkYaw9JH5IgpX9vP9yb8myD95TZzXz0LFe7BW9WrA2EnEE2+npiv roBaI0eTKGyxD/A30XSrRR4oQ1z/yYUj+qKZj1YWYH0WjpwxUc6Zcf1pM3BKgAGYPuDQ w0MNzfbWP7ahKL4h3S0N0I/6zhdoME1V91L1bhBqLIjcSEX8zDCVr0ow2ugZqnrAKF74 ZIBEcJtslCVJaVFA3rpwkuHlro0SQJG1Bc00U42PHT9aN6K7mkqHe84FdhWeD4cbHZMO HxlQ== X-Gm-Message-State: AOJu0Yw0i73+z4wTdLfDUGZ21ERndH+hvb7+1HP+ppyVfd6osa9DHZYY Cx+BGG1QYdRwJe2xxZvNiCodAA== X-Received: by 2002:a17:902:f7cd:b0:1ca:86a9:cace with SMTP id h13-20020a170902f7cd00b001ca86a9cacemr10914915plw.2.1698183671410; Tue, 24 Oct 2023 14:41:11 -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.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 14:41:11 -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 , Dhruva Gole , Krzysztof Kozlowski , Pratyush Yadav , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , Richard Weinberger , Rob Herring , Vignesh Raghavendra , linux-kernel@vger.kernel.org Subject: [PATCH v5 1/3] dt-bindings: mtd: partitions: Add binman compatible Date: Wed, 25 Oct 2023 10:39:16 +1300 Message-ID: <20231024213940.3590507-1-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.758.gaed0368e0e-goog MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Tue, 24 Oct 2023 14:41:33 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780674670639406648 X-GMAIL-MSGID: 1780674670639406648 Add a compatible string for binman, so we can extend fixed-partitions in various ways. Signed-off-by: Simon Glass --- Changes in v5: - Add #address/size-cells and parternProperties - Drop $ref to fixed-partitions.yaml - Drop 'select: false' Changes in v4: - Change subject line Changes in v3: - Drop fixed-partition additional compatible string - Drop fixed-partitions from the example - Mention use of compatible instead of label Changes in v2: - Drop mention of 'enhanced features' in fixed-partitions.yaml - Mention Binman input and output properties - Use plain partition@xxx for the node name .../bindings/mtd/partitions/binman.yaml | 68 +++++++++++++++++++ .../bindings/mtd/partitions/partitions.yaml | 1 + MAINTAINERS | 5 ++ 3 files changed, 74 insertions(+) create mode 100644 Documentation/devicetree/bindings/mtd/partitions/binman.yaml diff --git a/Documentation/devicetree/bindings/mtd/partitions/binman.yaml b/Documentation/devicetree/bindings/mtd/partitions/binman.yaml new file mode 100644 index 00000000000000..329217550a98cc --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/partitions/binman.yaml @@ -0,0 +1,68 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright 2023 Google LLC + +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mtd/partitions/binman.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Binman firmware layout + +maintainers: + - Simon Glass + +description: | + The binman node provides a layout for firmware, used when packaging firmware + from multiple projects. It is based on fixed-partitions, with some + extensions, but uses 'compatible' to indicate the contents of the node, to + avoid perturbing or confusing existing installations which use 'label' for a + particular purpose. + + Binman supports properties used as inputs to the firmware-packaging process, + such as those which control alignment of partitions. This binding addresses + these 'input' properties. For example, it is common for the 'reg' property + (an 'output' property) to be set by Binman, based on the alignment requested + in the input. + + Once processing is complete, input properties have mostly served their + purpose, at least until the firmware is repacked later, e.g. due to a + firmware update. The 'fixed-partitions' binding should provide enough + information to read the firmware at runtime, including decompression if + needed. + + Documentation for Binman is available at: + + https://u-boot.readthedocs.io/en/latest/develop/package/binman.html + + with the current image-description format at: + + https://u-boot.readthedocs.io/en/latest/develop/package/binman.html#image-description-format + +properties: + compatible: + const: binman + + "#address-cells": + const: 1 + + "#size-cells": + const: 1 + +patternProperties: + "^partition(-.+|@[0-9a-f]+)$": + $ref: partition.yaml + +additionalProperties: false + +examples: + - | + partitions { + compatible = "binman"; + #address-cells = <1>; + #size-cells = <1>; + + partition@100000 { + label = "u-boot"; + reg = <0x100000 0xf00000>; + }; + }; diff --git a/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml index 1dda2c80747bd7..849fd15d085ccc 100644 --- a/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml +++ b/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml @@ -15,6 +15,7 @@ maintainers: oneOf: - $ref: arm,arm-firmware-suite.yaml + - $ref: binman.yaml - $ref: brcm,bcm4908-partitions.yaml - $ref: brcm,bcm947xx-cfe-partitions.yaml - $ref: fixed-partitions.yaml diff --git a/MAINTAINERS b/MAINTAINERS index 2d13bbd69adbc1..b9441eec979a42 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3542,6 +3542,11 @@ F: Documentation/filesystems/bfs.rst F: fs/bfs/ F: include/uapi/linux/bfs_fs.h +BINMAN +M: Simon Glass +S: Supported +F: Documentation/devicetree/bindings/mtd/partitions/binman* + BITMAP API M: Yury Norov R: Andy Shevchenko From patchwork Tue Oct 24 21:39:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 157706 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp2218102vqx; Tue, 24 Oct 2023 14:41:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGW7ehPk1Szo6We0PBVB+zLZusE8nOzgxlwEzv2auHcrS9iacuGW1sKhKbFPAdZkDmFA90i X-Received: by 2002:a05:6a21:7983:b0:171:a2df:4e68 with SMTP id bh3-20020a056a21798300b00171a2df4e68mr3082669pzc.36.1698183715076; Tue, 24 Oct 2023 14:41:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698183715; cv=none; d=google.com; s=arc-20160816; b=X0c5w2M4/nPp5JobBaE8DHHiFR1XLrjlt3wtBprHF2dWD9xYz8DR1wOEzV7pSI1bfQ vyxkldUUsr83NQ9Sh3MC+W45Zg7no/aXgCO8v9lv7pUXGj1gi86gsKXhjDqpcvXf9Mp0 sxTrHrRe9Xj3g41hJ9xP8VsKBv51JII6N29VDf9rMB+nzx99kJy2DBb73c4UXXApgtij 5d/jQsv93WmpJbq3/4HFdiNWJuFr1D4XeD7zBEWOQHBXtKzjygIvHCY+wcvkGecZnSvx KeKidCN/2cPFKL6WlAU9O8mDoyOCbn8A3YhQdp0zRct3i/e6RLheQCykBw2LYxqIcMRu LbYw== 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=Qlj3Zfises7r0D8qFU0FTbLuXsSPwTC7ghoEI6cXzzE=; fh=qBDRXPXB77hfwevTJt1fh486lYG1EJG5Xw2+Mlz0s4Q=; b=bXZRsquIshqgVWtKrgt75W+RldB4RkdstwQF2KDobP9W8lBoVBnd9E7hXgCL66/QAz U7Zu0TGwkjSo3i3Gq6NimhxCP37ISei/oPTb5uzi8PjNLGCDqtcJKugSQD5K40/ONjtE nBh9Ak2aMs4XsnsE8gXyEWo4AYQyp8a1YINy7F6Qk6UfCzv7lnLX7sPMA8TSkCpUxn3N A7QllEj8v0d3dQiPjz5tV0gedRz8q48EOdLHRjAOCBv2ly9RyggogLgLiquV/ANg8heB RQqFERi4J/Y56A4QNEQcbpBmXtkaRJplgFGCgg9ZLKqu/CZosD3SnM1PKqOWhJcjKmzl wCTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lBeixISw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id t11-20020a63dd0b000000b00578b9fb24f6si8684997pgg.616.2023.10.24.14.41.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 14:41:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lBeixISw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id B57DB8020A04; Tue, 24 Oct 2023 14:41:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344398AbjJXVlX (ORCPT + 27 others); Tue, 24 Oct 2023 17:41:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344460AbjJXVlU (ORCPT ); Tue, 24 Oct 2023 17:41:20 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 987ADD7F for ; Tue, 24 Oct 2023 14:41:17 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1ca6809fb8aso34942135ad.1 for ; Tue, 24 Oct 2023 14:41:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1698183677; x=1698788477; 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=Qlj3Zfises7r0D8qFU0FTbLuXsSPwTC7ghoEI6cXzzE=; b=lBeixISwFVwDkdi/qQ9H2Trq3Uj9yzWAPbG7fIN1b8/CFlNBQXI4tv8BGqu3GIxMd7 acFTNdSuWPN/x/5hsiyTOvwrNXCYSIq+R0lxCN/HjyuDIhF7uMxh8PD8r9wsQ23EX7qu JCjg0odMGrwkrMHMVg9x4f5mFDRofZYS85cxA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698183677; x=1698788477; 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=Qlj3Zfises7r0D8qFU0FTbLuXsSPwTC7ghoEI6cXzzE=; b=adOZjajCTf9MFYuMA1jgF772R1eeL8Afqz0V5G7cfQQdU5LbPqMfiFt5YyV2sYEtr8 0+j8AGvUZWvm9HoJdYXHNCyrlvZcPMFRxJKqcbrTcNp999F37iMr5QNZf3elSopXmtNX FAEOdFCenT//pKXLU7QOiAL7wbmT6SpxrIBHCwzFAYAirtTYg56YhutQZ4ZUmK99gRBk RWvIEjAi+vRLIRY63xopsDht/nOdbLqh8hWpHu8/iYjBEhgdozy71bDRoM3JfOiYKTje Jlo5dfbz4/QeNqTzRgFUE5hf6KMmB1IONO1oY7wCcnFifjWQAuSSO7JedW4thWk8J6mO LbCw== X-Gm-Message-State: AOJu0Yw1+Mgls7GNh23lb7SSpoTosEZp9SV82jR4NarC5FuTDF+7nHJl ioy7Wv/lslVNtPECZuegFrzfDQ== X-Received: by 2002:a17:902:c215:b0:1c7:3558:721a with SMTP id 21-20020a170902c21500b001c73558721amr10294915pll.58.1698183677103; Tue, 24 Oct 2023 14:41:17 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 14:41:16 -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 2/3] dt-bindings: mtd: binman-partition: Add binman compatibles Date: Wed, 25 Oct 2023 10:39:17 +1300 Message-ID: <20231024213940.3590507-2-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 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 fry.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 (fry.vger.email [0.0.0.0]); Tue, 24 Oct 2023 14:41:51 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780674687273672320 X-GMAIL-MSGID: 1780674687273672320 Add two compatible for binman entries, as a starting point for the schema. Note that, after discussion on v2, we decided to keep the existing meaning of label so as not to require changes to existing userspace software when moving to use binman nodes to specify the firmware layout. Signed-off-by: Simon Glass --- Changes in v5: - Add mention of why 'binman' is the vendor - Drop 'select: false' - Tidy up the compatible setings - Use 'tfa-bl31' instead of 'atf-bl31' Changes in v4: - Correct selection of multiple compatible strings Changes in v3: - Drop fixed-partitions from the example - Use compatible instead of label Changes in v2: - Use plain partition@xxx for the node name .../mtd/partitions/binman-partition.yaml | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Documentation/devicetree/bindings/mtd/partitions/binman-partition.yaml diff --git a/Documentation/devicetree/bindings/mtd/partitions/binman-partition.yaml b/Documentation/devicetree/bindings/mtd/partitions/binman-partition.yaml new file mode 100644 index 00000000000000..37a413464b0ce5 --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/partitions/binman-partition.yaml @@ -0,0 +1,50 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright 2023 Google LLC + +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mtd/partitions/binman-partition.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Binman partition + +maintainers: + - Simon Glass + +description: | + This corresponds to a binman 'entry'. It is a single partition which holds + data of a defined type. + + The vendor is specified as binman since there are quite a number + of binman-specific entry types, such as section, fill and files, + to be added later. + +allOf: + - $ref: /schemas/mtd/partitions/partition.yaml# + +properties: + compatible: + - enum: + - binman,entry # generic binman entry + - u-boot # u-boot.bin from U-Boot project + - tfa-bl31 # bl31.bin or bl31.elf from TF-A project + +additionalProperties: false + +examples: + - | + partitions { + compatible = "binman"; + #address-cells = <1>; + #size-cells = <1>; + + partition@100000 { + compatible = "u-boot"; + reg = <0x100000 0xf00000>; + }; + + partition@200000 { + compatible = "tfa-bl31"; + reg = <0x200000 0x100000>; + }; + }; From patchwork Tue Oct 24 21:39:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 157705 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp2218103vqx; Tue, 24 Oct 2023 14:41:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG8xcz1MPMo7+31lldvD5nE8Fo+MUk28fV8LSffsKV3KwnpPk3KGwBVO9l2ax+zFgiCmggS X-Received: by 2002:a25:6b01:0:b0:da0:4aaa:b480 with SMTP id g1-20020a256b01000000b00da04aaab480mr2827442ybc.19.1698183715085; Tue, 24 Oct 2023 14:41:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698183715; cv=none; d=google.com; s=arc-20160816; b=pjR0iWIPXLTnQDSIJWsV4IH2a0xgO5UyRIxA7XHQOGBWa5soMmbib3qnliJQGpMZBJ 1GkEJ3OKUSSAvSArkeNrKbKGG7lcuavd7gXwTUr7ZYdgJT0sikPG5iGCGB1t11u6zxwI Grsddo7ohP9pWl28Hm2PjUUFNy3HGytLoualNnPvcsd3KAWrZW3saAUHhpyyPruNLkpL /6maVBY6fZJqpAsdDU/5hLDcTJIYz4Fz+qjhCMO9FaOYLXZ6qkYQEIWmxN5SfeCxV+3B anYy1ZKSo1WGAVn5OXmafQ5M17sxrehuG6z3ge1x0L2Dnc+n6vwPvATdRtFKZ6tcsb/1 FXyQ== 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 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id h66-20020a25d045000000b00d9cb21e8397si9115379ybg.353.2023.10.24.14.41.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 14:41:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; 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 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 5A3DF80859B2; Tue, 24 Oct 2023 14:41:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344461AbjJXVlg (ORCPT + 27 others); Tue, 24 Oct 2023 17:41:36 -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 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 pete.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 (pete.vger.email [0.0.0.0]); Tue, 24 Oct 2023 14:41:52 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780674687393842213 X-GMAIL-MSGID: 1780674687393842213 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>; }; };