Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2251625rdb; Thu, 21 Sep 2023 12:56:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFosZqwVAAE25ZpNQ2hVrJDIvmfTv9wX9CS9ciOd3J4OAlqW+w8dwfuSb01VXUbPFkMIzTB X-Received: by 2002:a17:902:f68c:b0:1c4:c5d:d7fa with SMTP id l12-20020a170902f68c00b001c40c5dd7famr7917685plg.45.1695326189648; Thu, 21 Sep 2023 12:56:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695326189; cv=none; d=google.com; s=arc-20160816; b=U4zpp5ryCCbD1syUUYXfuWAIg1gIWL5jfGgw9s/win7ralqSr5ACTCsLgPeSiJYzl4 wZrpom7uDwO/NfqbeRV4lQk+XzmMJgOfST7Ibjn4KodZfjVO5oNWdwjMdGdsUIDqerJZ GjztLBA/cQjFWAgODFqdi2TLmhItCJXfaM/Tu7mzDH3yp/GLDGEa9rhg9BbXod6rjIEv h3oYGSFU1rsOzo8OQFacPiRDRHD6z3hHAahtoq3lOqAX2vdZrVcRqvWw67WmhBi6ucj+ MpQIeVyP2mBLN9sKslVyTgTEzMQ4JcMPseY2x1Ylx5xUQ4xCJO+80uiXvQAWt/ajeNTs D/0Q== 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=DnKiy3ihwgd/VOoqSanohGN5ffhK+cZ/VpjdYKJUjf8=; fh=JnsmjlD/FcSYsHgBK8refLs3zAMa/ZR7tji2slskdY0=; b=sBEpWMURUycTdNae41K2p785hIPTs/rzjFwx9O5BQc0pNdEq9jrm5iHS9MX6dJtH/8 pwawfmzjwIX8CmQ+vCdKRyTpG6Tm1rZzd5cnEtweXtP/hedtF6XMGCy99V50Bzj23+Wn IxZM2zQx7aTtupi74uhsReF70CD/l3rv8PinvSeDcvhDvwL2Ph4gCZWQ/hmYbJ8YZnSW KriN/vYvFqk/D5DcGp1CYUE3W5w2CsiuhACudCO/tVOWdR4YOwforU3SIgcmIpNHE0Br RWukc1mvENftV7r4bCcMMQeJzkdxGPDJ/IPJ7P24o/+c0h8Fd0r31Bh3hcZH9C13txMQ 13iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=U6AnxTaZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id u6-20020a170902714600b001c3a6902ff1si1973092plm.288.2023.09.21.12.56.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 12:56:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=U6AnxTaZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 938DB801F497; Thu, 21 Sep 2023 12:05:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230472AbjIUTFS (ORCPT + 99 others); Thu, 21 Sep 2023 15:05:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231236AbjIUTE3 (ORCPT ); Thu, 21 Sep 2023 15:04:29 -0400 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C89EEE5A1 for ; Thu, 21 Sep 2023 11:45:25 -0700 (PDT) Received: by mail-io1-xd2c.google.com with SMTP id ca18e2360f4ac-76c64da0e46so53268839f.0 for ; Thu, 21 Sep 2023 11:45:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695321925; x=1695926725; 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=DnKiy3ihwgd/VOoqSanohGN5ffhK+cZ/VpjdYKJUjf8=; b=U6AnxTaZN69Yg5XxdFZLDPrDlurYvQFWsLRVzWczhSGkzBjE+vR12yzRRlUc1skcb4 eTOdHdLPXX+vyRtm959mPZgXaiVu2cdXlZQ5aAdj5i11oiQp8U5S63W/HQj3iL+xs+V9 P7ntzZ08MRJXVe0+P+zII1R4/a9aXzGHPQ40I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695321925; x=1695926725; 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=DnKiy3ihwgd/VOoqSanohGN5ffhK+cZ/VpjdYKJUjf8=; b=J4Ao/QsXHEEslVyszZre4xG7e+SuMjgZO8ZI1arRVjAKdWwXL4JQwZaSaiVdpCgk7m 2j7quzFQGixaYl4X7O/ah5D2yLJPt/V6jzJWWT33X0CKif5yTfBhE4L+dBvJ5EH6h8OI k5eJccyTpOXGjFhjbNNdiKPODAb6TRDaYR4dCS/xs0GM8c4Qiek+EAN0WwzZv0BzURIq N6XUEfp7nkfUkOZsAGIsx70XE+wFJaKlIQ55iHd0NuWD8nHK5luUqKmLWiq48PAGX5To u+VreI5cWQgfeAOLPl44kaCS9zW3iwYNKOUdVqiGEMuFnSnWinC3BF48l9SwH2xSR5XL 9Trg== X-Gm-Message-State: AOJu0YzFF/JFqIZNZcnrp+gDdcIYu9lk65Y+Gb1un8ZFqUFSqZDprQMP niC3zY6FtgHPXJQ2V+/VfZCMG6ilGYUvgykw4zI= X-Received: by 2002:a6b:7303:0:b0:787:34d:f223 with SMTP id e3-20020a6b7303000000b00787034df223mr7074088ioh.11.1695321924839; Thu, 21 Sep 2023 11:45:24 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:a636:e615:ea83:bc42]) by smtp.gmail.com with ESMTPSA id d26-20020a02a49a000000b004290fd3a68dsm511017jam.1.2023.09.21.11.45.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 11:45:24 -0700 (PDT) From: Simon Glass To: devicetree@vger.kernel.org Cc: U-Boot Mailing List , linux-mtd@lists.infradead.org, Tom Rini , Rob Herring , Simon Glass , Conor Dooley , Dhruva Gole , Krzysztof Kozlowski , Miquel Raynal , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Richard Weinberger , Rob Herring , Vignesh Raghavendra , linux-kernel@vger.kernel.org Subject: [PATCH] dt-bindings: mtd: Add a schema for binman Date: Thu, 21 Sep 2023 12:45:14 -0600 Message-ID: <20230921124459.1.I91ddcfacf9b234af5cc3eabea4b62edb31153317@changeid> X-Mailer: git-send-email 2.42.0.515.g380fc7ccd1-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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,URIBL_BLOCKED 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 (howler.vger.email [0.0.0.0]); Thu, 21 Sep 2023 12:05:35 -0700 (PDT) Binman[1] is a tool for creating firmware images. It allows you to combine various binaries and place them in an output file. Binman uses a DT schema to describe an image, in enough detail that it can be automatically built from component parts, disassembled, replaced, listed, etc. Images are typically stored in flash, which is why this binding is targeted at mtd. Previous discussion is at [2] [3]. [1] https://u-boot.readthedocs.io/en/stable/develop/package/binman.html [2] https://lore.kernel.org/u-boot/20230821180220.2724080-3-sjg@chromium.org/ [3] https://www.spinics.net/lists/devicetree/msg626149.html Signed-off-by: Simon Glass --- .../bindings/mtd/partitions/binman.yaml | 50 +++++++++++++++ .../bindings/mtd/partitions/binman/entry.yaml | 61 +++++++++++++++++++ .../bindings/mtd/partitions/partitions.yaml | 1 + MAINTAINERS | 5 ++ 4 files changed, 117 insertions(+) create mode 100644 Documentation/devicetree/bindings/mtd/partitions/binman.yaml create mode 100644 Documentation/devicetree/bindings/mtd/partitions/binman/entry.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..c792d5a37b700a --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/partitions/binman.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.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. For now it just supports a very simple set of + features, as a starting point for discussion. + + 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: u-boot,binman + +required: + - compatible + +additionalProperties: false + +examples: + - | + firmware { + binman { + compatible = "u-boot,binman"; + + u-boot { + size = <0xa0000>; + }; + + atf-bl31 { + offset = <0x100000>; + }; + }; + }; diff --git a/Documentation/devicetree/bindings/mtd/partitions/binman/entry.yaml b/Documentation/devicetree/bindings/mtd/partitions/binman/entry.yaml new file mode 100644 index 00000000000000..8003eb4f1a994f --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/partitions/binman/entry.yaml @@ -0,0 +1,61 @@ +# 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/entry.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Binman entry + +maintainers: + - Simon Glass + +description: | + The entry node specifies a single entry in the firmware. + + Entries have a specific type, such as "u-boot" or "atf-bl31". If the type + is missing, the name is used as the type. + + Note: This definition is intended to be hierarchical, so that entries can + appear in other entries. Schema for that is TBD. + +properties: + $nodename: + pattern: "^[-a-z]+(-[0-9]+)?$" + + type: + $ref: /schemas/types.yaml#/definitions/string + + offset: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + Provides the offset of this entry from the start of its parent section. + If this is omitted, Binman will determine this by packing the enclosing + section according to alignment rules, etc. + + size: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + Provides the size of this entry in bytes. If this is omitted, Binman will + use the content size, along with any alignment information, to determine + the size of the entry. + +additionalProperties: false + +examples: + - | + firmware { + binman { + compatible = "u-boot,binman"; + + u-boot { + size = <0xa0000>; + }; + + second-area { + type = "atf-bl31"; + offset = <0x100000>; + }; + }; + }; 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 a4c30221eb305d..ebcbfb4292e8dc 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3505,6 +3505,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 -- 2.42.0.515.g380fc7ccd1-goog