From patchwork Wed Oct 25 21:06:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 158300 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp238687vqb; Wed, 25 Oct 2023 14:07:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEBERZPofwj4yz30K7LjjyYKOX5Nsw/A/CNajpqHI1U47qXnPbZlQ1TGSuEMlH7foLGMqWQ X-Received: by 2002:a25:ccd4:0:b0:da0:7106:a159 with SMTP id l203-20020a25ccd4000000b00da07106a159mr3149877ybf.8.1698268026321; Wed, 25 Oct 2023 14:07:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698268026; cv=none; d=google.com; s=arc-20160816; b=ODPDEXIVS5RGhwUQLbF38NPOttRR64krg2gWCy3CiSNrDnQgdkEtxoFwhK7WTX0qCL ga2rlCiUOqzxF1YmzcTqmHiHKmuHijDY/faq39FcXODb4bdLarPX+w5DCND/MRvcu1pD EQ1KFdqES27t5RJ/a1ixLwOX0wiebQzueQYp+VlcZRCzsyjA3fZaMipvwCpF/qiv6zKQ yXgYCGj3LOrKbRZLuIe2X/pzx0qWiuopFyuKY0X24cSRsqaJWYIRHSz62kj/4g6AxzIP HPrWoaCLYYllTQmyEV/KRWONN7QSYtnskW/fSs2PVofFLWMO67sIx+sza9uDZZT0d+Kc TOnQ== 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=WnXMZq3u2P4hkyafsQIarDOhM2i0PYXnQvhdzNae9NQ=; fh=KN5G/YHBtL6M7DUiEQkRcCI+I9IUnWQinFHQVKXCjxE=; b=CvMD7drW973mCHuYxP7NDUyJ1p5+eIxommkOPLwPS/g6fdFp+px/Iwe4f9CvFAe0g4 JMthmFepe5LbZeEnsX01GbkLpoxUnL3iy7I8YdhwM0f0wDue9lCIsNLwJOcyjv+aX4pK XcazEHeojceNWjg6xPrcfD20LZ6FKO9l9uDO2qJwKk/YCxG+ghSSdfQhSCqq/eFWlcxt KOU1HdeiUJQ3o8WDgNauhrJkeNO3Mvvfxue3Dmqw9aYC83nva8MXVHgVt4JqhuamfGw+ +0FY2c3u3ftIyKi3xs62hEwScY/6Kh/mi6wbL0+2ieFfgGK+iWDT7MytgbM1Hr8C8exC 3ZsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LES5SJL3; 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 e65-20020a251e44000000b00d9ca992162esi11433601ybe.727.2023.10.25.14.07.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 14:07:06 -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=LES5SJL3; 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 7493D81A3355; Wed, 25 Oct 2023 14:06:59 -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 S230049AbjJYVGx (ORCPT + 25 others); Wed, 25 Oct 2023 17:06:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230037AbjJYVGv (ORCPT ); Wed, 25 Oct 2023 17:06:51 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76B03182 for ; Wed, 25 Oct 2023 14:06:48 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1ca215cc713so979175ad.3 for ; Wed, 25 Oct 2023 14:06:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1698268008; x=1698872808; 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=WnXMZq3u2P4hkyafsQIarDOhM2i0PYXnQvhdzNae9NQ=; b=LES5SJL3G9mPesbDOETZb/4ZH+A56/X31ajPTrjx5g/OD5W4HBbgk0Z4CZFLfplc7X 492KMD1UjIvxu8aypCqpA8uCODZPfaz+RBttrdN+lLQBAfPJ/Dkucy06QrlUVy3L5/k2 zowk3iacBegxLCF7WDprC6GHxJLt9YBQN2gtQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698268008; x=1698872808; 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=WnXMZq3u2P4hkyafsQIarDOhM2i0PYXnQvhdzNae9NQ=; b=vsWPXgbYkjmiKFpsNWll9qo+hFRn7g44qDVB4Od5IhXEf4g5VZ1296aVIFNM0O46Br GshlU351aYMwNxzHCTi+FD9O/JRe4TWPjR2UVlgWZMw34q4rPavU0V13kwncDyTRteJN fPLaGHVeuDr+oJgFGDZHBYglR9vtBUYmXvJ/vdV0iYG7tosE30SdpwAfVLbO8MwN5i7H Kr7ig79JnPSRd2lD7K8C0xtLKzIWfLpCZC1oTPfwfzS0Ffkmvpi0tCyrTkTkFlXF2Wcm O7nyTRhZS0t994UDXPa1jklfCxCzb6hwU4KKjLngT7++t5CpaKsHMJ+FpgNKhIdSKKwY cdcg== X-Gm-Message-State: AOJu0YzSjeapL5WKiv3TliCzScza+AxsCiXKaYCuymx4j7BId1Nrq9Rq XiW+u/3ZcfxGtcSYjLlgI3bZgA== X-Received: by 2002:a17:902:ce91:b0:1ca:3d53:2867 with SMTP id f17-20020a170902ce9100b001ca3d532867mr15084532plg.15.1698268007804; Wed, 25 Oct 2023 14:06:47 -0700 (PDT) Received: from sjg1.roam.corp.google.com ([202.144.206.130]) by smtp.gmail.com with ESMTPSA id ix4-20020a170902f80400b001bc5dc0cd75sm9689447plb.180.2023.10.25.14.06.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 14:06:47 -0700 (PDT) From: Simon Glass To: devicetree@vger.kernel.org Cc: Michael Walle , U-Boot Mailing List , Tom Rini , Rob Herring , linux-mtd@lists.infradead.org, Miquel Raynal , 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 v6 1/3] dt-bindings: mtd: partitions: Add binman compatible Date: Thu, 26 Oct 2023 10:06:10 +1300 Message-ID: <20231025210616.3201502-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_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham 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]); Wed, 25 Oct 2023 14:06:59 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780763093624578072 X-GMAIL-MSGID: 1780763093624578072 Add a compatible string for binman, so we can extend fixed-partitions in various ways. Signed-off-by: Simon Glass --- (no changes since v5) 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 000000000000..329217550a98 --- /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 1dda2c80747b..849fd15d085c 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 2d13bbd69adb..b9441eec979a 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 Wed Oct 25 21:06:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 158301 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp238701vqb; Wed, 25 Oct 2023 14:07:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEoXbbSeBJJNaxMSkoGgnnhqwPCHp8Kguq93Do08WB26VatEGy7W0+Ye+zCG70GwK7SSdT4 X-Received: by 2002:a25:d30e:0:b0:d9a:ce05:37b with SMTP id e14-20020a25d30e000000b00d9ace05037bmr16205381ybf.56.1698268027157; Wed, 25 Oct 2023 14:07:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698268027; cv=none; d=google.com; s=arc-20160816; b=rG8dqeQxNd/hCy4pB4ZrPedlvg+FHjAZL8vNu/xfuyOBrxCpJMPLTVJBePYGmPnZXK RfAWSDswtIl36nOgrV52Rg+w0WyWfWY3XY0ksaJln4YbAWBsYHjuEOOf21NbioXExM0b xI44CD55gkx+8pMz83hAOISJ65cidriaWYw2+wDaGWH61jhBappILC0EGpnBArIY+eYG hoL4YFTUKE15LtO++HQsdPtPZerxIvXKSGjbIFu0Ry+YtnOPDVR/BetwB1goWlcN9hZw 3UCeqPYv4JjiX8+aVUVCW3iSfGUOtDQB0J9ZYO2gbiDbqO5wSc63i2hx2Zez3noMJyuq Md0Q== 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=pF/ordmyMYgWe1Uu/l3iCAlozeYeU+RXukpZaUtD30Y=; fh=EE9G7yTU9fmnBslOkyu4jIX5ZdJt76O0kpIuimnBg80=; b=KJzyTYejDetfE0d4BqsvSd5HmVSAhb6uC47OhCBF8nIxmJFgcAc9uLIGcgI0LsSe5Q 3JSH8gVREyShko41Mzp+DroUYP0u0X4G0pMF+160boYyWLyiVMQgnoQ/U2xQBFjYotpE dky1Bfb9AsU38YbyR8tKxGqYEjr5scwQV//Jf956BvzDePVzMN77JEkgfY7977jsTrVx pT/Y10FVNOGcNy3AW2VQQ2Tsk6dXsFyKVNX8IrkyTaSmevKO6ct76JJxB1WrQ6ahyXKV vO4OLxXvCsm6XuUl9IDWnWnth+GKNScVgpRfgCD/DQPsMm4uYC3odWMriTFa9gabJDnu uMRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=acVpp8kY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id v131-20020a252f89000000b00da04e945ab2si4962406ybv.378.2023.10.25.14.07.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 14:07:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=acVpp8kY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 0C49481A3367; Wed, 25 Oct 2023 14:07:05 -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 S230106AbjJYVHC (ORCPT + 25 others); Wed, 25 Oct 2023 17:07:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230046AbjJYVG4 (ORCPT ); Wed, 25 Oct 2023 17:06:56 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13DE513D for ; Wed, 25 Oct 2023 14:06:54 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1cacde97002so988455ad.2 for ; Wed, 25 Oct 2023 14:06:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1698268013; x=1698872813; 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=pF/ordmyMYgWe1Uu/l3iCAlozeYeU+RXukpZaUtD30Y=; b=acVpp8kYwUMLCAZN7hRnOvpNvz85M3O4Ea+8dpWsqmFFe3Xyy581p9UbqzcsMl980K nR8udgeSMdxPBrZ4pD1rxXCesSy6RobyPHnLkdz++hAdcAjy+OC+gD+G7LDVKEwO7qD7 uFqoXZf8Wi2+7qWXT9wkA1SmYQlVtW3JGFFiU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698268013; x=1698872813; 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=pF/ordmyMYgWe1Uu/l3iCAlozeYeU+RXukpZaUtD30Y=; b=Fd1aFP6C2Aqf/t1LDoLUgYEa4FGfAcyts3u04o70n/+OuUaWY0wcV5tNWrMHv9Boxh 2X44C26lNJlTJljhxORQzIqQQITE6zCssgjVP5SHQJM9nuDPeKE+yv0qPqLN82sptJo8 EcM1fHwuAChZJsxZ0lv20L4VeKN8TLeorhtMqtvXphL1tQYtjAJnnJRqnGly3SFCoPVJ gcXjSzD9RZKlEywMqTCJfkb5NiX9ZZIJ4JM3/MloJQVhn4MQz81IbLwHR+p287sjgHnJ AeL7nS3WPXBRhAp4A2vLNIPeg6ZG9lhzL1mQCfDafZpGaDVT5iG7PpZeej+HX+BTPHLn v1pA== X-Gm-Message-State: AOJu0YxaSPxWLtyNd/Sa5Ccn2CWc2BL5v3ROBC561wycmBjLZXXkrbXV GPY4GQqfrr7ft5Bt4rHcKn4++Q== X-Received: by 2002:a17:903:2342:b0:1c9:dff6:58f2 with SMTP id c2-20020a170903234200b001c9dff658f2mr16108624plh.59.1698268013528; Wed, 25 Oct 2023 14:06:53 -0700 (PDT) Received: from sjg1.roam.corp.google.com ([202.144.206.130]) by smtp.gmail.com with ESMTPSA id ix4-20020a170902f80400b001bc5dc0cd75sm9689447plb.180.2023.10.25.14.06.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 14:06:53 -0700 (PDT) From: Simon Glass To: devicetree@vger.kernel.org Cc: Michael Walle , U-Boot Mailing List , Tom Rini , Rob Herring , linux-mtd@lists.infradead.org, Miquel Raynal , Simon Glass , Conor Dooley , Krzysztof Kozlowski , Richard Weinberger , Rob Herring , Vignesh Raghavendra , linux-kernel@vger.kernel.org Subject: [PATCH v6 2/3] dt-bindings: mtd: binman-partition: Add binman compatibles Date: Thu, 26 Oct 2023 10:06:11 +1300 Message-ID: <20231025210616.3201502-2-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.758.gaed0368e0e-goog In-Reply-To: <20231025210616.3201502-1-sjg@chromium.org> References: <20231025210616.3201502-1-sjg@chromium.org> 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=ham 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]); Wed, 25 Oct 2023 14:07:05 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780763094745074650 X-GMAIL-MSGID: 1780763094745074650 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 --- (no changes since v5) 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 | 54 +++++++++++++++++++ 1 file changed, 54 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 000000000000..83222ac9aa78 --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/partitions/binman-partition.yaml @@ -0,0 +1,54 @@ +# 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 + + reg: + minItems: 1 + maxItems: 2 + +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 Wed Oct 25 21:06:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 158302 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp238756vqb; Wed, 25 Oct 2023 14:07:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDR3nxm0AgCt8n3J2dJCSrUfDKPt4At9Xy/B9xnCgXTdwE/brxDwNK/osw9wPl7DMfo8yx X-Received: by 2002:a0d:cc8a:0:b0:5a7:e726:13f7 with SMTP id o132-20020a0dcc8a000000b005a7e72613f7mr17478678ywd.8.1698268033509; Wed, 25 Oct 2023 14:07:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698268033; cv=none; d=google.com; s=arc-20160816; b=tgdT5/ifD3DeRj5aHARrky2vzeiR/UlYYRmJaL3WSyUm1dohg0hDdsAQpvrqYIenJq mLOU0ZLwSoykTejMD33LRolVXq0XuPc+2Z/Hz9TuhMXdSr/fsbNYJhBt+69FJPsF7R0L 4BUx9JPBHVhmN16RD6EbOzpl7cYI3DRuyEo+mQKqSlNWn4HsQ8lQisRr+5LYUMwypF2p wz3kjko6d4UtNIaFivlY8l+I+Q6OpXZMZzV9SxyC9fffnBOdhvk0i0zYyQbb7nmyzgIb E+sWgCNKV+Y+vWKTtxXwGovQQmNzEv10vuLjYJeNgDkaVIx6qxrRw15T+M6BGd6Butjz dYuw== 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=+IdohqfpG/gdF3wirCpdcxePGouLjdXX9N31xMFKe2w=; fh=EE9G7yTU9fmnBslOkyu4jIX5ZdJt76O0kpIuimnBg80=; b=xYZpXKYGcSJCoXyqsBh3kg1JhEts6HZA6+tIqiB9gHKhQKPuFQ2wg6eol37w//TEAI nX+4rm/1H5wafsTVFjQqdUV6NDhE4KusguWhWaXjtlcMFUoVnXZzDVnPaXhXkFkVqNhm DoM4pRqOGyrT8Ozj7PeSjVV3JbteIGj1M6/xmDMz6u3OmYVnmvHHE3P2gou4FqOBe3vq /YKF1KVgWRT72YkBsqGujwr32hKZaL/JTtQ48joAQ8XN0PhZhRwa3HbH1uLe269OBPJ8 llwRVqjMGLZTUqVbeqEHfd3V4igoL8xNeJ/7gt/pAGM1aa1CLBDAndSkW0EPn7aSnj0J 3LlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Cxrl5Wom; 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 b63-20020a0df242000000b005958b2c7d93si13019577ywf.297.2023.10.25.14.07.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 14:07:13 -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=Cxrl5Wom; 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 1F19281A3361; Wed, 25 Oct 2023 14:07:12 -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 S230091AbjJYVHF (ORCPT + 25 others); Wed, 25 Oct 2023 17:07:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230162AbjJYVHC (ORCPT ); Wed, 25 Oct 2023 17:07:02 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEA90185 for ; Wed, 25 Oct 2023 14:06:59 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1ca72f8ff3aso1195215ad.0 for ; Wed, 25 Oct 2023 14:06:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1698268019; x=1698872819; 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=+IdohqfpG/gdF3wirCpdcxePGouLjdXX9N31xMFKe2w=; b=Cxrl5WomlT0YHCrxWtMnpWW98T9vagBhfjWbFE/o/MfO/yH5O/qhPMEG0k+AFwAr6h paCPGXiPn0HE3cwhXd265qaXgK2yrQSkWFA/NUBKJ1x/KeRBcRxIObjoqqkTcBvnQeAr HIgx3BtvaNGwwcVx0i6KjErTWm90Sqlv7slaw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698268019; x=1698872819; 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=+IdohqfpG/gdF3wirCpdcxePGouLjdXX9N31xMFKe2w=; b=JSSeObRouH8aX30dfvBE3uug9yzNKi39/eSIkd0IYirj5mMNF7nrycGioiNJd/XPWP vM6Xtl21SqaTrR1YYb63x1EcT9Zu+TRNHUle2qu8ZdyAJ4oUGLqWdiIx0wEfiGbzThTf tvTFGIWSxwJ6CkWhnqjGRL+Nbdwrt2mWU51idJ2MWOeLMDU1y7Z30mHRqLCo4lsHHKag r619apvuezpWtDCWLRQFQkps2/Glgm6svEqjzsR8TvlCmBv33pRB40zT1jfaVo3h48nj d8CjJOJu7hUd+h6ufmsMUG869f3zyQ9mjkaOgXaT+AnYj/7+9Bd44Yjzju2nBp9sIM5Y l6cw== X-Gm-Message-State: AOJu0YyKasrXFLHTwTQS3GJzOq+BWyFzsSl/KnZb4blVrLfRWz6/yCqt bIjNBSBRIWgsjLpvwFHtpYWMsw== X-Received: by 2002:a17:903:110d:b0:1c9:e508:ad43 with SMTP id n13-20020a170903110d00b001c9e508ad43mr15865350plh.8.1698268019179; Wed, 25 Oct 2023 14:06:59 -0700 (PDT) Received: from sjg1.roam.corp.google.com ([202.144.206.130]) by smtp.gmail.com with ESMTPSA id ix4-20020a170902f80400b001bc5dc0cd75sm9689447plb.180.2023.10.25.14.06.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 14:06:58 -0700 (PDT) From: Simon Glass To: devicetree@vger.kernel.org Cc: Michael Walle , U-Boot Mailing List , Tom Rini , Rob Herring , linux-mtd@lists.infradead.org, Miquel Raynal , Simon Glass , Conor Dooley , Krzysztof Kozlowski , Richard Weinberger , Rob Herring , Vignesh Raghavendra , linux-kernel@vger.kernel.org Subject: [PATCH v6 3/3] dt-bindings: mtd: binman-partitions: Add alignment properties Date: Thu, 26 Oct 2023 10:06:12 +1300 Message-ID: <20231025210616.3201502-3-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.758.gaed0368e0e-goog In-Reply-To: <20231025210616.3201502-1-sjg@chromium.org> References: <20231025210616.3201502-1-sjg@chromium.org> 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]); Wed, 25 Oct 2023 14:07:12 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780763101147755395 X-GMAIL-MSGID: 1780763101147755395 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 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 .../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 83222ac9aa78..2bc80c24bb9b 100644 --- a/Documentation/devicetree/bindings/mtd/partitions/binman-partition.yaml +++ b/Documentation/devicetree/bindings/mtd/partitions/binman-partition.yaml @@ -33,6 +33,57 @@ properties: minItems: 1 maxItems: 2 + 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: @@ -45,10 +96,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>; }; };