From patchwork Mon Apr 10 23:21:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jassi Brar X-Patchwork-Id: 672046 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:184:0:0:0:0 with SMTP id p4csp501557wrx; Mon, 10 Apr 2023 16:21:31 -0700 (PDT) X-Google-Smtp-Source: AKy350ZXcH8qGe/O/S2TmrcdciKiaHnBHPo0J9b8HiAdY/98VNqmY46bMDPnqvw5pP7us9C983EN X-Received: by 2002:ac8:594e:0:b0:3e6:9486:ec0e with SMTP id 14-20020ac8594e000000b003e69486ec0emr1089522qtz.58.1681168891445; Mon, 10 Apr 2023 16:21:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681168891; cv=none; d=google.com; s=arc-20160816; b=DrwPt0AQug079bkEkLQITuostTdO60wrXeAJKXTCd2oZB0oDLW9YqdZn2H8LCo1kKe ksmxGTNORBLC4u6AiWGyYszscmgvix9ZLg8z5Ylgu45581MDUc2zd01fPsosCIplBoED yqejtgX3lVDpqgg6/Rgoqgun6atcjLbdk7e4KMjJFq8UTPhvVPHjg+vTuGu+y2mBN1rO 3i3LxLk3I4gaf9wGA9p+lSXDLaDAISnQIXGO43hW1Htccs3WRvNX8bSUy+xHvMMikrcE Vq//fmTlcXiF5aJkC/aRoawX/RPaFb1RjpyCPwYLu+rMsDUEYtl1/VKzDS0hyBsjkZGT lKjw== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=f2kWi45bZk4o3c4dfoGd7i6kH44vAE6UPPhfz1CUsQE=; b=R7f2qXXYUSMvzLjNISaby54QI9fqMvYNNGzfgcxH+Le6wi44reiTmdvgWPFKryNCE9 PECfKZvUv4KV3rnhQaSDbSxxkYh30Lzby/EzRC9tx1JerdY3aHTGnS90w3JmkGROW/KU +GHUISuBDGjARZxhTE+0dozBDd9S80VlqhWJuJkvQTu6xULa+ew8ZcFdsPoM7Q3Qm6W2 t3G4APCU36Hfz4R8KjV2cQsapuXf42me66TPdopwKok3lNcXFzFt4GbFNlmujRf+pyaJ AwkVpSbnI1okW950g28CZ4Bh59YmcfiEdAskmvXoQr3K9L2tfPDvaIX8IdIGNCAX4CaS 0geg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tdu5tIHz; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id a69-20020ae9e848000000b0074692d752c5si7923986qkg.584.2023.04.10.16.21.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 16:21:31 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tdu5tIHz; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 97751850DB; Tue, 11 Apr 2023 01:21:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="tdu5tIHz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8557D850DB; Tue, 11 Apr 2023 01:21:22 +0200 (CEST) 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,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-yb1-xb2f.google.com (mail-yb1-xb2f.google.com [IPv6:2607:f8b0:4864:20::b2f]) (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 04A2A815D4 for ; Tue, 11 Apr 2023 01:21:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jaswinder.singh@linaro.org Received: by mail-yb1-xb2f.google.com with SMTP id ch3so7361021ybb.4 for ; Mon, 10 Apr 2023 16:21:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681168876; x=1683760876; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=f2kWi45bZk4o3c4dfoGd7i6kH44vAE6UPPhfz1CUsQE=; b=tdu5tIHzuvnTH5BFQjlzbAscONwyLcAc09LjKG2WM7noQYcQy2gq7FQtP4Wggo8TEq e7Ovoui6EWQXKj/BmOXu+xExlweK3HGbrRLA0zyX9f4ffjYPx4bdP/cA0c0khqezIqY8 tV6gVvGWlZ7j0fReV9Z6KHHtHOr78OMqpmqzx+46IuHbayOTvQZQHC164pQ9hfjyb2OH JX2pwDyd31cduxV1fkBZNFppMwDHa46OmV7zh0da8PXTST0f3//pRsso1VhUoVmvIzFM ZKacChbk7YrMgOZBdj+UXHiKeSFLC1d8zIYNev5iYnHQ2o0i/f1AgwwPC/3HwENEjWLN UpgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681168876; x=1683760876; 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=f2kWi45bZk4o3c4dfoGd7i6kH44vAE6UPPhfz1CUsQE=; b=xitzxv/lPts99JdsvneSyf39fbhHh5Y1dPh+4kYYvbVK15Nri7CTFtZVufdHYCTDxc ADjFM4f66pGv9HaDLF3zRCruDadlH/v0eIblYdM8IB79AddZ+9DGYu4QxhvRsgi6BsHj mJDjG2NGG0Z4V6KD/ghm8o4WLbSZ57blZVpG1sPLhl0tkl1AuRFQ2/hUInxeItt6x5B2 abGiimopJ3+DfYzBJNJHvavBCGhd+gaiUTo3YXzTus2BBOiLjnLrzNRKHgxSjp+jrr6R syRZcE1+j1+4wOjQqMdQg/D0YyJWN8WnRffhItECk9ONBLRDjTEFiJZxvvbwjMDFszGK d/ng== X-Gm-Message-State: AAQBX9fesiXsSrom76GFtvr4DCM+yPZMr4FLph6e7dY87sMykpFpB3EE 0DHtTyqO8HndF1mhlcIZnUrLgWBKjAOCnc5cOi4= X-Received: by 2002:a25:240c:0:b0:afe:a814:fd6b with SMTP id k12-20020a25240c000000b00afea814fd6bmr407676ybk.9.1681168876599; Mon, 10 Apr 2023 16:21:16 -0700 (PDT) Received: from jassi-desktop.. (wnpgmb0311w-ds01-45-177-228.dynamic.bellmts.net. [206.45.177.228]) by smtp.gmail.com with ESMTPSA id u8-20020a25f808000000b00b8c31377e1bsm2623220ybd.54.2023.04.10.16.21.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 16:21:16 -0700 (PDT) From: jaswinder.singh@linaro.org To: u-boot@lists.denx.de, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Cc: ilias.apalodimas@linaro.org, etienne.carriere@linaro.org, trini@konsulko.com, sjg@chromium.org, sughosh.ganu@linaro.org, xypron.glpk@gmx.de, takahiro.akashi@linaro.org, michal.simek@amd.com, Jassi Brar Subject: [PATCH] dt/bindings: fwu-mdata-mtd: drop changes outside FWU Date: Mon, 10 Apr 2023 18:21:12 -0500 Message-Id: <20230410232112.72778-1-jaswinder.singh@linaro.org> X-Mailer: git-send-email 2.34.1 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.8 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 --- Hi Rob, Hi Krzysztof, I was suggested, and I agree, it would be a good idea to get your blessings for the location and meta-data (fwu-mdata) bindings for the FWU. The FWU images can be located in GPT partitions or MTD backed storage. The basic bindings for fwu-mdata has already been merged in uboot (ideally they too should have had your review). Now I am trying to fully support MTD backed storage and hence looking for your review. The proposed bindings are totally self-contained and don't require changes to any other subsystem. Thanks. .../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..6a22aeea30 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-bank0 { + id = <0>; + label = "FIP-Bank0"; + fwu-image0 { + id = <0>; + offset = <0x0>; + size = <0x400000>; + uuid = "5a66a702-99fd-4fef-a392-c26e261a2828"; + }; + }; + fwu-bank1 { + id = <1>; + label = "FIP-Bank1"; + fwu-image0 { + id = <0>; + offset = <0x0>; + size = <0x400000>; + uuid = "a8f868a1-6e5c-4757-878d-ce63375ef2c0"; + }; + }; + }; +...