From patchwork Tue Feb 28 00:52:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jassi Brar X-Patchwork-Id: 657465 Delivered-To: patch@linaro.org Received: by 2002:a05:6504:1b90:b0:222:2e2e:b2c3 with SMTP id e16csp3401676lty; Mon, 27 Feb 2023 16:52:34 -0800 (PST) X-Google-Smtp-Source: AK7set985WQvbl+BTsxZLVb+75L4PRf4iZ5pBheERe/aMaAoS7yeMSDLcKThQ21gbbo/uu20fhwi X-Received: by 2002:a05:6a21:6d88:b0:c7:6f26:c99 with SMTP id wl8-20020a056a216d8800b000c76f260c99mr1514856pzb.61.1677545554203; Mon, 27 Feb 2023 16:52:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677545554; cv=none; d=google.com; s=arc-20160816; b=inPoUVVdOfkvAeIS2f6pXoTd8LJjXXdzNDZoGWO0pBfjNaJ4OdU/mmGRCVHTzZH8tE ipZ42canS3IyGUxPSY6Y3GMZxEN45hffOVkpUm4tuULOPIafMLCWbOor2pL02OsoP4t3 qjxE+ulIMdMg2v72l0YvJ204Ixh3pvCQKHS03rDPc4Chzrc+o1TYOWjigqBz4fW1Kbja q1zeJYD1UO1zOZcvRloYuiHpvuZeFRbNkq7H4IMPm3JAvhr42j/W8a8bXZ4jRaHQ5vqq wFAc86zRZrcFv7dhm7qi7YpcTh0G1++J6CILVgiOKxbdcFKKqYSe77K73cxx4qxpeCNJ VyEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kpYLE5wBsrJcAgv0NwBjlCG5BlNNXNZ/ePOQxOMoSp8=; b=xCxcts3qsysutc39J+QJ+ZVBRHQYNS9u3/aYLYG1BXcKT83PnliVsQ/mffQdFOE2Ft XBPiz1+OjeC2v7psTfbc2BKYMdP+tjzSGrJSmolu18TOVR/9hZbX2R6bF3LDyZfVxYnI LhX8fXsAtQodh4ztNez37ztdaqL5EeO+2lq6N0sBCib0GpSjS0AfeCR6AFl7wTdOD99J b6HV7Oa2sgMJOnbkid1cZHMUBClVfOU8NEP0KF2wlUKbwjmnMBCbq4k2Rbf5fgUxDQYW VFb5qT6s2Zatq6KK5q2M26s7CqquQPuwk84Zv02L1PU7fpXCPrlRMr08diBWPSEc/8go OUyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dOtEajBE; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id q65-20020a632a44000000b004df18fa49aesi8555150pgq.796.2023.02.27.16.52.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 16:52:34 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dOtEajBE; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 70E2785A92; Tue, 28 Feb 2023 01:52:30 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dOtEajBE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7EB5785A97; Tue, 28 Feb 2023 01:52:28 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9124C8514E for ; Tue, 28 Feb 2023 01:52:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jassisinghbrar@gmail.com Received: by mail-il1-x132.google.com with SMTP id u6so5392102ilk.12 for ; Mon, 27 Feb 2023 16:52:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=kpYLE5wBsrJcAgv0NwBjlCG5BlNNXNZ/ePOQxOMoSp8=; b=dOtEajBEANd3tUql9+XDswePrERLO92S3nmg6AqutvqLdUWCcL7Py6kZgXU3hmSX0v vXGWGfKe6QpWPGXJv26Q52c3w6vNaaMQyHyCrkEhYQFMt+0biStLAuqISfgLgmtroLZr RrlDFuOulqZXMDppuZzUJBNAMLSnhVvadU7A/HT3F79enF4fMfNqVgq0QprHii0A4sNu Nri5XOunCSPB5yfBlICKPX1L81l4dsUJ3Zy0ejEdOSYSCb3OZE8d64fvlxP/uiXHzLiJ CctBoa5Re+NQz66IBYye6VI9/+B6JEJKHFdobAfSE/46LLFuAmwWOCbkYnHYvFYUKIzd IQAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=kpYLE5wBsrJcAgv0NwBjlCG5BlNNXNZ/ePOQxOMoSp8=; b=pjwvrBFgs4s3e6Xtxii8PsRtwCYD7MjCBorJbao5ZUFUYuP0DQfsYEDZmpIKSFBAox /dRb/eADbthZUscLzXBf+KkWH0Toa2UyXiUG0mNryHvhdi/rZfbuOF1/zl1rfEUP+0pQ 5dbxWV3WzLBqBbEkucgZL2+BL1We49uh8omdJrkPcFGW8xpOJxGO/67j/sDWrM3hlqm/ eza8l0D3yC9hdSPxctaLwLZMHT/ufIz8wdvrGFX1PWzTwoN0mwraXkgvIi7u38V5xvCv 9nYwJwBy7ywvfpauhmeboetrax2VdlNITBawQla3vX8oZw6vreHNWEm8TYKXF71uvMqD x0cw== X-Gm-Message-State: AO0yUKVf8GBfb6a0ry66wnsnXFSzLLzebmhC0M0XivVYED9AISPAAoer Kj4VPUQwa+4pFZgLp9FnzFYEMHAcCbI= X-Received: by 2002:a05:6e02:1c0b:b0:315:9452:2822 with SMTP id l11-20020a056e021c0b00b0031594522822mr1487426ilh.0.1677545543944; Mon, 27 Feb 2023 16:52:23 -0800 (PST) Received: from jassi-desktop.. (wnpgmb0311w-ds01-45-177-228.dynamic.bellmts.net. [206.45.177.228]) by smtp.gmail.com with ESMTPSA id x14-20020a02970e000000b003884192cc05sm2566597jai.120.2023.02.27.16.52.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 16:52:23 -0800 (PST) From: jassisinghbrar@gmail.com To: u-boot@lists.denx.de Cc: ilias.apalodimas@linaro.org, etienne.carriere@linaro.org, trini@konsulko.com, sjg@chromium.org, sughosh.ganu@linaro.org, xypron.glpk@gmx.de, patrick.delaunay@foss.st.com, patrice.chotard@foss.st.com, Jassi Brar Subject: [PATCH v5 1/6] dt/bindings: fwu-mdata-mtd: drop changes outside FWU Date: Mon, 27 Feb 2023 18:52:18 -0600 Message-Id: <20230228005218.1635781-1-jassisinghbrar@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230228005135.1635726-1-jassisinghbrar@gmail.com> References: <20230228005135.1635726-1-jassisinghbrar@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean From: Jassi Brar Any requirement of FWU should not require changes to bindings of other subsystems. For example, for mtd-backed storage we can do without requiring 'fixed-partitions' children to also carry 'uuid', a property which is non-standard and not in the bindings. There exists no code yet, so we can change the fwu-mtd bindings to contain all properties within the fwu-mdata node. Signed-off-by: Jassi Brar --- .../firmware/fwu-mdata-mtd.yaml | 105 +++++++++++++++--- 1 file changed, 91 insertions(+), 14 deletions(-) diff --git a/doc/device-tree-bindings/firmware/fwu-mdata-mtd.yaml b/doc/device-tree-bindings/firmware/fwu-mdata-mtd.yaml index 4f5404f999..4b87fb8624 100644 --- a/doc/device-tree-bindings/firmware/fwu-mdata-mtd.yaml +++ b/doc/device-tree-bindings/firmware/fwu-mdata-mtd.yaml @@ -1,13 +1,13 @@ # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) %YAML 1.2 --- -$id: http://devicetree.org/schemas/firmware/u-boot,fwu-mdata-sf.yaml# -$schema: http://devicetree.org/meta-schemas/core.yaml# +$id: http://devicetree.org/schemas/firmware/u-boot,fwu-mdata-mtd.yaml# +$schema: http://devicetree.org/meta-schemas/base.yaml# title: FWU metadata on MTD device without GPT maintainers: - - Masami Hiramatsu + - Jassi Brar properties: compatible: @@ -15,24 +15,101 @@ properties: - const: u-boot,fwu-mdata-mtd fwu-mdata-store: - maxItems: 1 - description: Phandle of the MTD device which contains the FWU medatata. + $ref: /schemas/types.yaml#/definitions/phandle + description: Phandle of the MTD device which contains the FWU MetaData and Banks. - mdata-offsets: + mdata-parts: + $ref: /schemas/types.yaml#/definitions/non-unique-string-array minItems: 2 - description: Offsets of the primary and secondary FWU metadata in the NOR flash. + maxItems: 2 + description: labels of the primary and secondary FWU metadata partitions in the 'fixed-partitions' subnode of the 'jedec,spi-nor' flash device node. + + patternProperties: + "fwu-bank@[0-9]": + type: object + description: List of FWU mtd-backed banks. Typically two banks. + + properties: + id: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Index of the bank. + + label: + $ref: /schemas/types.yaml#/definitions/non-unique-string-array + minItems: 1 + maxItems: 1 + description: label of the partition, in the 'fixed-partitions' subnode of the 'jedec,spi-nor' flash device node, that holds this bank. + + patternProperties: + "fwu-image@[0-9]": + type: object + description: List of images in the FWU mtd-backed bank. + + properties: + id: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Index of the bank. + + offset: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Offset, from start of the bank, where the image is located. + + size: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Size reserved for the image. + + uuid: + $ref: /schemas/types.yaml#/definitions/non-unique-string-array + minItems: 1 + maxItems: 1 + description: UUID of the image. + + required: + - id + - offset + - size + - uuid + additionalProperties: false + + required: + - id + - label + - fwu-images + additionalProperties: false required: - compatible - fwu-mdata-store - - mdata-offsets - + - mdata-parts + - fwu-banks additionalProperties: false examples: - | - fwu-mdata { - compatible = "u-boot,fwu-mdata-mtd"; - fwu-mdata-store = <&spi-flash>; - mdata-offsets = <0x500000 0x530000>; - }; + fwu-mdata { + compatible = "u-boot,fwu-mdata-mtd"; + fwu-mdata-store = <&flash0>; + mdata-parts = "MDATA-Pri", "MDATA-Sec"; + + fwu-bank@0 { + id = <0>; + label = "FIP-Bank0"; + fwu-image@0 { + id = <0>; + offset = <0x0>; + size = <0x400000>; + uuid = "5a66a702-99fd-4fef-a392-c26e261a2828"; + }; + }; + fwu-bank@1 { + id = <1>; + label = "FIP-Bank1"; + fwu-image@0 { + id = <0>; + offset = <0x0>; + size = <0x400000>; + uuid = "a8f868a1-6e5c-4757-878d-ce63375ef2c0"; + }; + }; + }; +...