From patchwork Tue Aug 29 19:18:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 13369502 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8C35C71153 for ; Tue, 29 Aug 2023 19:19:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230476AbjH2TSq (ORCPT ); Tue, 29 Aug 2023 15:18:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236180AbjH2TST (ORCPT ); Tue, 29 Aug 2023 15:18:19 -0400 Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDA82A8 for ; Tue, 29 Aug 2023 12:18:16 -0700 (PDT) Received: by mail-il1-x132.google.com with SMTP id e9e14a558f8ab-34ca1bcb48fso16682015ab.2 for ; Tue, 29 Aug 2023 12:18:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1693336696; x=1693941496; 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=gSArBmMsswRYjnTU8zyo9/Uft3vc1W7OWIExh4GBVPE=; b=B7cfYHF/Z4FanikXPF7tRvvy9I54DYw4LxJrp7AQuCepRbqxe0amMiyKVdcl5LXVI5 03T06Z17VtAdtYt2r2noduRl6TxjF1PXmOFQ5aetPIYzzLLQ9pnl46nm4yfLbniBTCHk 3G00nZyiLfGhperHwNe8Sz4q/HEc5y90kn4T8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693336696; x=1693941496; 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=gSArBmMsswRYjnTU8zyo9/Uft3vc1W7OWIExh4GBVPE=; b=KXp9RCSzhJHRgsF2IDKnaVuYeG1PGBO4OTC39PFBiWWJNf/uKEqwhPa85458DCPBg5 d5LFQS93Sn93qD/szS/wDYWhlzxmkManvdpqcgVI0VqcS2yTn+2pFaHO84ISxTA16DBc 4rBAQqHmPgBSuVHTm2/9/+L4kUGcYuHQxDcsn7OmkBLiIsVegnaUBOKnRGGcR8/Sguj5 lIISyx+P+PaoU0naG5uzJSPJ2mX6hhkcEQrLb4l4gg2sU5xF8LLKlls5qU8v5AFUG25b se+dcYp5N7k2hV+zUyabUyVUiKN99iS+kkIoTl5xgmPIX6192P4+hK0uoqpu64h4pqcB XtQQ== X-Gm-Message-State: AOJu0YzBo0Jwql3lxb0y5AnX7QiEKlb1qTsqkHBWoLYU0cW6W7QlBUc3 gsjy7jVH81ljk+TgXljM2rHH8w== X-Google-Smtp-Source: AGHT+IG9piH/z3sYhq1WiiMmi+BovOBIGET+WWTVzIQinivR6hkTahyvuUF3tCHVeiUGB1T13g23MQ== X-Received: by 2002:a05:6e02:dca:b0:348:7396:184b with SMTP id l10-20020a056e020dca00b003487396184bmr169828ilj.24.1693336696115; Tue, 29 Aug 2023 12:18:16 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:16d9:c947:1a18:4c10]) by smtp.gmail.com with ESMTPSA id fq8-20020a056638650800b004332f6537e2sm3359798jab.83.2023.08.29.12.18.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 12:18:15 -0700 (PDT) From: Simon Glass To: devicetree@vger.kernel.org Cc: Dhaval Sharma , Mark Rutland , Gua Guo , Tom Rini , Rob Herring , U-Boot Mailing List , ron minnich , Ard Biesheuvel , Lean Sheng Tan , Maximilian Brune , Chiu Chasel , lkml , Yunhui Cui , linux-acpi@vger.kernel.org, Guo Dong , Simon Glass Subject: [PATCH v4 1/4] Add reserved-memory Date: Tue, 29 Aug 2023 13:18:06 -0600 Message-ID: <20230829191812.135759-1-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.rc2.253.gd59a3bf2b4-goog MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Bring in this file from Linux v6.5 Signed-off-by: Simon Glass --- Changes in v4: - New patch .../reserved-memory/reserved-memory.yaml | 181 ++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 dtschema/schemas/reserved-memory/reserved-memory.yaml diff --git a/dtschema/schemas/reserved-memory/reserved-memory.yaml b/dtschema/schemas/reserved-memory/reserved-memory.yaml new file mode 100644 index 0000000..c680e39 --- /dev/null +++ b/dtschema/schemas/reserved-memory/reserved-memory.yaml @@ -0,0 +1,181 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/reserved-memory/reserved-memory.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: /reserved-memory Child Node Common + +maintainers: + - devicetree-spec@vger.kernel.org + +description: > + Reserved memory is specified as a node under the /reserved-memory node. The + operating system shall exclude reserved memory from normal usage one can + create child nodes describing particular reserved (excluded from normal use) + memory regions. Such memory regions are usually designed for the special + usage by various device drivers. + + Each child of the reserved-memory node specifies one or more regions + of reserved memory. Each child node may either use a 'reg' property to + specify a specific range of reserved memory, or a 'size' property with + optional constraints to request a dynamically allocated block of + memory. + + Following the generic-names recommended practice, node names should + reflect the purpose of the node (ie. "framebuffer" or "dma-pool"). + Unit address (@
) should be appended to the name if the node + is a static allocation. + +properties: + reg: true + + size: + oneOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + - $ref: /schemas/types.yaml#/definitions/uint64 + description: > + Length based on parent's \#size-cells. Size in bytes of memory to + reserve. + + alignment: + oneOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + - $ref: /schemas/types.yaml#/definitions/uint64 + description: > + Length based on parent's \#size-cells. Address boundary for + alignment of allocation. + + alloc-ranges: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: > + Address and Length pairs. Specifies regions of memory that are + acceptable to allocate from. + + iommu-addresses: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: > + A list of phandle and specifier pairs that describe static IO virtual + address space mappings and carveouts associated with a given reserved + memory region. The phandle in the first cell refers to the device for + which the mapping or carveout is to be created. + + The specifier consists of an address/size pair and denotes the IO + virtual address range of the region for the given device. The exact + format depends on the values of the "#address-cells" and "#size-cells" + properties of the device referenced via the phandle. + + When used in combination with a "reg" property, an IOVA mapping is to + be established for this memory region. One example where this can be + useful is to create an identity mapping for physical memory that the + firmware has configured some hardware to access (such as a bootsplash + framebuffer). + + If no "reg" property is specified, the "iommu-addresses" property + defines carveout regions in the IOVA space for the given device. This + can be useful if a certain memory region should not be mapped through + the IOMMU. + + no-map: + type: boolean + description: > + Indicates the operating system must not create a virtual mapping + of the region as part of its standard mapping of system memory, + nor permit speculative access to it under any circumstances other + than under the control of the device driver using the region. + + reusable: + type: boolean + description: > + The operating system can use the memory in this region with the + limitation that the device driver(s) owning the region need to be + able to reclaim it back. Typically that means that the operating + system can use that region to store volatile or cached data that + can be otherwise regenerated or migrated elsewhere. + +allOf: + - if: + required: + - no-map + + then: + not: + required: + - reusable + + - if: + required: + - reusable + + then: + not: + required: + - no-map + +oneOf: + - oneOf: + - required: + - reg + + - required: + - size + + - oneOf: + # IOMMU reservations + - required: + - iommu-addresses + + # IOMMU mappings + - required: + - reg + - iommu-addresses + +additionalProperties: true + +examples: + - | + / { + compatible = "foo"; + model = "foo"; + + #address-cells = <2>; + #size-cells = <2>; + + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + adsp_resv: reservation-adsp { + /* + * Restrict IOVA mappings for ADSP buffers to the 512 MiB region + * from 0x40000000 - 0x5fffffff. Anything outside is reserved by + * the ADSP for I/O memory and private memory allocations. + */ + iommu-addresses = <&adsp 0x0 0x00000000 0x00 0x40000000>, + <&adsp 0x0 0x60000000 0xff 0xa0000000>; + }; + + fb: framebuffer@90000000 { + reg = <0x0 0x90000000 0x0 0x00800000>; + iommu-addresses = <&dc0 0x0 0x90000000 0x0 0x00800000>; + }; + }; + + bus@0 { + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x0 0x0 0x40000000>; + + adsp: adsp@2990000 { + reg = <0x2990000 0x2000>; + memory-region = <&adsp_resv>; + }; + + dc0: display@15200000 { + reg = <0x15200000 0x10000>; + memory-region = <&fb>; + }; + }; + }; +... From patchwork Tue Aug 29 19:18:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 13369504 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A8EDC6FA8F for ; Tue, 29 Aug 2023 19:19:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235292AbjH2TSt (ORCPT ); Tue, 29 Aug 2023 15:18:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239055AbjH2TSW (ORCPT ); Tue, 29 Aug 2023 15:18:22 -0400 Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72FD5B0 for ; Tue, 29 Aug 2023 12:18:18 -0700 (PDT) Received: by mail-il1-x135.google.com with SMTP id e9e14a558f8ab-34dee07e676so2588035ab.3 for ; Tue, 29 Aug 2023 12:18:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1693336698; x=1693941498; 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=14UxKbnagyJ+cKoRi1AZAoVSOHI5uNMgHy0vJsUOsMA=; b=LZZqNiIQKjsH++rqUHgwLKjqMoEr69Im0RzMmS7eAGVvQJ8KI+gCFnGpHQhzHzXfH/ mB66avHLhSPisUck+aEOUzZOROcypcaQto1kLXMyhUL53LIMaYryvo+yAc+0JmOBYlgg LvDc5jlW9Fy2ZbcZXN/ICfM6PJnvMSCPt7A2U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693336698; x=1693941498; 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=14UxKbnagyJ+cKoRi1AZAoVSOHI5uNMgHy0vJsUOsMA=; b=En2jKE5mkrksyPbdFxJsWFRjVn0IyzUthk/skwhhCTIyo793SrHZ+g2j6IBPYZFOh/ eo05YrgDjKRKs7GOWDifGC9RCCaBpzu7r+nrJyExwQ6LtOVmiILyBxcC/Anom2rbSev+ TfcLIU3d44wVErW9figb4a3Xdt5o5yIAGqU7Jupr8+o7+91J5t9FK3qHkqR4zBsO1MVH 3Y44FBSWZvu8cjzpXVqLq1NNwwOXbxeKApglGpT1GWF+Su2uV+VLBjx3MmgB1XrHNls/ TbrgW4z53FfEoNr07au+8DkbuKrWbOCkiRkR771NtYMaEwj94iLW0wqTE1W4hbyT9YWT LQOQ== X-Gm-Message-State: AOJu0Yxr6Wuf/Rj15lO70/6yIrc8pF1kKmvei5bv4BLfWq5y4+Qqdefc BdiN6ajAuYsoqLGjF6qOUx/btA== X-Google-Smtp-Source: AGHT+IE1yHxc4xwKVY+xA8BVBZr+iPnWbfnWpXJJgJRBuHtfcpQBPLXqlKibsUJZ5kxX0hMOB+ms6w== X-Received: by 2002:a92:de08:0:b0:34b:b16d:aa38 with SMTP id x8-20020a92de08000000b0034bb16daa38mr287639ilm.29.1693336697691; Tue, 29 Aug 2023 12:18:17 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:16d9:c947:1a18:4c10]) by smtp.gmail.com with ESMTPSA id fq8-20020a056638650800b004332f6537e2sm3359798jab.83.2023.08.29.12.18.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 12:18:17 -0700 (PDT) From: Simon Glass To: devicetree@vger.kernel.org Cc: Dhaval Sharma , Mark Rutland , Gua Guo , Tom Rini , Rob Herring , U-Boot Mailing List , ron minnich , Ard Biesheuvel , Lean Sheng Tan , Maximilian Brune , Chiu Chasel , lkml , Yunhui Cui , linux-acpi@vger.kernel.org, Guo Dong , Simon Glass Subject: [PATCH v4 2/4] Bring in other reserved-memory files Date: Tue, 29 Aug 2023 13:18:07 -0600 Message-ID: <20230829191812.135759-2-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.rc2.253.gd59a3bf2b4-goog In-Reply-To: <20230829191812.135759-1-sjg@chromium.org> References: <20230829191812.135759-1-sjg@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Add those files from v6.5 which are already converted to yaml. Signed-off-by: Simon Glass --- Changes in v4: - New patch .../schemas/reserved-memory/framebuffer.yaml | 52 +++++++ .../reserved-memory/google,open-dice.yaml | 46 ++++++ .../reserved-memory/memory-region.yaml | 40 +++++ .../nvidia,tegra210-emc-table.yaml | 31 ++++ .../nvidia,tegra264-bpmp-shmem.yaml | 47 ++++++ dtschema/schemas/reserved-memory/phram.yaml | 47 ++++++ .../schemas/reserved-memory/qcom,cmd-db.yaml | 46 ++++++ .../reserved-memory/qcom,rmtfs-mem.yaml | 55 +++++++ dtschema/schemas/reserved-memory/ramoops.yaml | 144 ++++++++++++++++++ .../reserved-memory/shared-dma-pool.yaml | 97 ++++++++++++ 10 files changed, 605 insertions(+) create mode 100644 dtschema/schemas/reserved-memory/framebuffer.yaml create mode 100644 dtschema/schemas/reserved-memory/google,open-dice.yaml create mode 100644 dtschema/schemas/reserved-memory/memory-region.yaml create mode 100644 dtschema/schemas/reserved-memory/nvidia,tegra210-emc-table.yaml create mode 100644 dtschema/schemas/reserved-memory/nvidia,tegra264-bpmp-shmem.yaml create mode 100644 dtschema/schemas/reserved-memory/phram.yaml create mode 100644 dtschema/schemas/reserved-memory/qcom,cmd-db.yaml create mode 100644 dtschema/schemas/reserved-memory/qcom,rmtfs-mem.yaml create mode 100644 dtschema/schemas/reserved-memory/ramoops.yaml create mode 100644 dtschema/schemas/reserved-memory/shared-dma-pool.yaml diff --git a/dtschema/schemas/reserved-memory/framebuffer.yaml b/dtschema/schemas/reserved-memory/framebuffer.yaml new file mode 100644 index 0000000..851ec24 --- /dev/null +++ b/dtschema/schemas/reserved-memory/framebuffer.yaml @@ -0,0 +1,52 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/reserved-memory/framebuffer.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: /reserved-memory framebuffer node + +maintainers: + - devicetree-spec@vger.kernel.org + +allOf: + - $ref: reserved-memory.yaml + +properties: + compatible: + const: framebuffer + description: > + This indicates a region of memory meant to be used as a framebuffer for + a set of display devices. It can be used by an operating system to keep + the framebuffer from being overwritten and use it as the backing memory + for a display device (such as simple-framebuffer). + +unevaluatedProperties: false + +examples: + - | + / { + compatible = "foo"; + model = "foo"; + #address-cells = <1>; + #size-cells = <1>; + + chosen { + framebuffer { + compatible = "simple-framebuffer"; + memory-region = <&fb>; + }; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + fb: framebuffer@80000000 { + compatible = "framebuffer"; + reg = <0x80000000 0x007e9000>; + }; + }; + }; +... diff --git a/dtschema/schemas/reserved-memory/google,open-dice.yaml b/dtschema/schemas/reserved-memory/google,open-dice.yaml new file mode 100644 index 0000000..c591ec3 --- /dev/null +++ b/dtschema/schemas/reserved-memory/google,open-dice.yaml @@ -0,0 +1,46 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/reserved-memory/google,open-dice.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Open Profile for DICE + +description: | + This binding represents a reserved memory region containing data + generated by the Open Profile for DICE protocol. + + See https://pigweed.googlesource.com/open-dice/ + +maintainers: + - David Brazdil + +allOf: + - $ref: reserved-memory.yaml + +properties: + compatible: + const: google,open-dice + + reg: + description: page-aligned region of memory containing DICE data + +required: + - compatible + - reg + - no-map + +unevaluatedProperties: false + +examples: + - | + reserved-memory { + #address-cells = <2>; + #size-cells = <1>; + + dice: dice@12340000 { + compatible = "google,open-dice"; + reg = <0x00 0x12340000 0x2000>; + no-map; + }; + }; diff --git a/dtschema/schemas/reserved-memory/memory-region.yaml b/dtschema/schemas/reserved-memory/memory-region.yaml new file mode 100644 index 0000000..592f180 --- /dev/null +++ b/dtschema/schemas/reserved-memory/memory-region.yaml @@ -0,0 +1,40 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/reserved-memory/memory-region.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Reserved Memory Region + +maintainers: + - devicetree-spec@vger.kernel.org + +description: | + Regions in the /reserved-memory node may be referenced by other device + nodes by adding a memory-region property to the device node. + +select: true + +properties: + memory-region: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: > + Phandle to a /reserved-memory child node assigned to the device. + + memory-region-names: + $ref: /schemas/types.yaml#/definitions/string-array + description: > + A list of names, one for each corresponding entry in the + memory-region property + +additionalProperties: true + +examples: + - | + fb0: video@12300000 { + /* ... */ + reg = <0x12300000 0x1000>; + memory-region = <&display_reserved>; + }; + +... diff --git a/dtschema/schemas/reserved-memory/nvidia,tegra210-emc-table.yaml b/dtschema/schemas/reserved-memory/nvidia,tegra210-emc-table.yaml new file mode 100644 index 0000000..e2ace3d --- /dev/null +++ b/dtschema/schemas/reserved-memory/nvidia,tegra210-emc-table.yaml @@ -0,0 +1,31 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra210-emc-table.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NVIDIA Tegra210 EMC Frequency Table + +maintainers: + - Thierry Reding + - Jon Hunter + +description: On Tegra210, firmware passes a binary representation of the + EMC frequency table via a reserved memory region. + +allOf: + - $ref: reserved-memory.yaml + +properties: + compatible: + const: nvidia,tegra210-emc-table + + reg: + description: region of memory reserved by firmware to pass the EMC + frequency table + +unevaluatedProperties: false + +required: + - compatible + - reg diff --git a/dtschema/schemas/reserved-memory/nvidia,tegra264-bpmp-shmem.yaml b/dtschema/schemas/reserved-memory/nvidia,tegra264-bpmp-shmem.yaml new file mode 100644 index 0000000..f9b2f0f --- /dev/null +++ b/dtschema/schemas/reserved-memory/nvidia,tegra264-bpmp-shmem.yaml @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/reserved-memory/nvidia,tegra264-bpmp-shmem.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Tegra CPU-NS - BPMP IPC reserved memory + +maintainers: + - Peter De Schrijver + +description: | + Define a memory region used for communication between CPU-NS and BPMP. + Typically this node is created by the bootloader as the physical address + has to be known to both CPU-NS and BPMP for correct IPC operation. + The memory region is defined using a child node under /reserved-memory. + The sub-node is named shmem@
. + +allOf: + - $ref: reserved-memory.yaml + +properties: + compatible: + const: nvidia,tegra264-bpmp-shmem + + reg: + description: The physical address and size of the shared SDRAM region + +unevaluatedProperties: false + +required: + - compatible + - reg + - no-map + +examples: + - | + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + dram_cpu_bpmp_mail: shmem@f1be0000 { + compatible = "nvidia,tegra264-bpmp-shmem"; + reg = <0x0 0xf1be0000 0x0 0x2000>; + no-map; + }; + }; +... diff --git a/dtschema/schemas/reserved-memory/phram.yaml b/dtschema/schemas/reserved-memory/phram.yaml new file mode 100644 index 0000000..65c7cac --- /dev/null +++ b/dtschema/schemas/reserved-memory/phram.yaml @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/reserved-memory/phram.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MTD/block device in RAM + +description: | + Specifies that the reserved memory region can be used as an MTD or block + device. + + The "phram" node is named after the "MTD in PHysical RAM" driver which + provides an implementation of this functionality in Linux. + +maintainers: + - Vincent Whitchurch + +allOf: + - $ref: reserved-memory.yaml + - $ref: /schemas/mtd/mtd.yaml + +properties: + compatible: + const: phram + + reg: + description: region of memory that can be used as an MTD/block device + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + + phram: flash@12340000 { + compatible = "phram"; + label = "rootfs"; + reg = <0x12340000 0x00800000>; + }; + }; diff --git a/dtschema/schemas/reserved-memory/qcom,cmd-db.yaml b/dtschema/schemas/reserved-memory/qcom,cmd-db.yaml new file mode 100644 index 0000000..610f8ef --- /dev/null +++ b/dtschema/schemas/reserved-memory/qcom,cmd-db.yaml @@ -0,0 +1,46 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/reserved-memory/qcom,cmd-db.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Command DB + +description: | + Command DB is a database that provides a mapping between resource key and the + resource address for a system resource managed by a remote processor. The data + is stored in a shared memory region and is loaded by the remote processor. + + Some of the Qualcomm Technologies Inc SoC's have hardware accelerators for + controlling shared resources. Depending on the board configuration the shared + resource properties may change. These properties are dynamically probed by the + remote processor and made available in the shared memory. + +maintainers: + - Bjorn Andersson + +allOf: + - $ref: reserved-memory.yaml + +properties: + compatible: + const: qcom,cmd-db + +required: + - reg + +unevaluatedProperties: false + +examples: + - | + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + reserved-memory@85fe0000 { + reg = <0x85fe0000 0x20000>; + compatible = "qcom,cmd-db"; + no-map; + }; + }; diff --git a/dtschema/schemas/reserved-memory/qcom,rmtfs-mem.yaml b/dtschema/schemas/reserved-memory/qcom,rmtfs-mem.yaml new file mode 100644 index 0000000..bab982f --- /dev/null +++ b/dtschema/schemas/reserved-memory/qcom,rmtfs-mem.yaml @@ -0,0 +1,55 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/reserved-memory/qcom,rmtfs-mem.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Remote File System Memory + +description: | + This binding describes the Qualcomm remote filesystem memory, which serves the + purpose of describing the shared memory region used for remote processors to + access block device data using the Remote Filesystem protocol. + +maintainers: + - Bjorn Andersson + +allOf: + - $ref: reserved-memory.yaml + +properties: + compatible: + const: qcom,rmtfs-mem + + qcom,client-id: + $ref: /schemas/types.yaml#/definitions/uint32 + description: > + identifier of the client to use this region for buffers + + qcom,vmid: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: > + Array of vmids of the remote processors, to set up memory protection + minItems: 1 + maxItems: 2 + +required: + - qcom,client-id + +unevaluatedProperties: false + +examples: + - | + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + rmtfs@86700000 { + compatible = "qcom,rmtfs-mem"; + reg = <0x86700000 0xe0000>; + no-map; + + qcom,client-id = <1>; + }; + }; diff --git a/dtschema/schemas/reserved-memory/ramoops.yaml b/dtschema/schemas/reserved-memory/ramoops.yaml new file mode 100644 index 0000000..45cc39e --- /dev/null +++ b/dtschema/schemas/reserved-memory/ramoops.yaml @@ -0,0 +1,144 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/reserved-memory/ramoops.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Ramoops oops/panic logger + +description: | + ramoops provides persistent RAM storage for oops and panics, so they can be + recovered after a reboot. This is a child-node of "/reserved-memory", and + is named "ramoops" after the backend, rather than "pstore" which is the + subsystem. + + Parts of this storage may be set aside for other persistent log buffers, such + as kernel log messages, or for optional ECC error-correction data. The total + size of these optional buffers must fit in the reserved region. + + Any remaining space will be used for a circular buffer of oops and panic + records. These records have a configurable size, with a size of 0 indicating + that they should be disabled. + + At least one of "record-size", "console-size", "ftrace-size", or "pmsg-size" + must be set non-zero, but are otherwise optional as listed below. + +maintainers: + - Kees Cook + +allOf: + - $ref: reserved-memory.yaml + +properties: + compatible: + const: ramoops + + reg: + description: region of memory that is preserved between reboots + + ecc-size: + $ref: /schemas/types.yaml#/definitions/uint32 + description: enables ECC support and specifies ECC buffer size in bytes + default: 0 # no ECC + + record-size: + $ref: /schemas/types.yaml#/definitions/uint32 + description: maximum size in bytes of each kmsg dump + default: 0 + + console-size: + $ref: /schemas/types.yaml#/definitions/uint32 + description: size in bytes of log buffer reserved for kernel messages + default: 0 + + ftrace-size: + $ref: /schemas/types.yaml#/definitions/uint32 + description: size in bytes of log buffer reserved for function tracing and profiling + default: 0 + + pmsg-size: + $ref: /schemas/types.yaml#/definitions/uint32 + description: size in bytes of log buffer reserved for userspace messages + default: 0 + + mem-type: + $ref: /schemas/types.yaml#/definitions/uint32 + description: if present, sets the type of mapping is to be used to map the reserved region. + default: 0 + oneOf: + - const: 0 + description: write-combined + - const: 1 + description: unbuffered + - const: 2 + description: cached + + max-reason: + $ref: /schemas/types.yaml#/definitions/uint32 + default: 2 # log oopses and panics + maximum: 0x7fffffff + description: | + If present, sets maximum type of kmsg dump reasons to store. + This can be set to INT_MAX to store all kmsg dumps. + See include/linux/kmsg_dump.h KMSG_DUMP_* for other kmsg dump reason values. + Setting this to 0 (KMSG_DUMP_UNDEF), means the reason filtering will be + controlled by the printk.always_kmsg_dump boot param. + If unset, it will be 2 (KMSG_DUMP_OOPS), otherwise 5 (KMSG_DUMP_MAX). + + flags: + $ref: /schemas/types.yaml#/definitions/uint32 + default: 0 + description: | + If present, pass ramoops behavioral flags + (see include/linux/pstore_ram.h RAMOOPS_FLAG_* for flag values). + + no-dump-oops: + deprecated: true + type: boolean + description: | + Use max_reason instead. If present, and max_reason is not specified, + it is equivalent to max_reason = 1 (KMSG_DUMP_PANIC). + + unbuffered: + deprecated: true + type: boolean + description: | + Use mem_type instead. If present, and mem_type is not specified, + it is equivalent to mem_type = 1 and uses unbuffered mappings to map + the reserved region (defaults to buffered mappings mem_type = 0). + If both are specified -- "mem_type" overrides "unbuffered". + +unevaluatedProperties: false + +required: + - compatible + - reg + +anyOf: + - required: [record-size] + - required: [console-size] + - required: [ftrace-size] + - required: [pmsg-size] + +examples: + - | + / { + compatible = "foo"; + model = "foo"; + #address-cells = <1>; + #size-cells = <1>; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + ramoops@bfdf0000 { + compatible = "ramoops"; + reg = <0xbfdf0000 0x10000>; /* 64kB */ + console-size = <0x8000>; /* 32kB */ + record-size = <0x400>; /* 1kB */ + ecc-size = <16>; + }; + }; + }; diff --git a/dtschema/schemas/reserved-memory/shared-dma-pool.yaml b/dtschema/schemas/reserved-memory/shared-dma-pool.yaml new file mode 100644 index 0000000..457de09 --- /dev/null +++ b/dtschema/schemas/reserved-memory/shared-dma-pool.yaml @@ -0,0 +1,97 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/reserved-memory/shared-dma-pool.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: /reserved-memory DMA pool + +maintainers: + - devicetree-spec@vger.kernel.org + +allOf: + - $ref: reserved-memory.yaml + +properties: + compatible: + oneOf: + - const: shared-dma-pool + description: > + This indicates a region of memory meant to be used as a shared + pool of DMA buffers for a set of devices. It can be used by an + operating system to instantiate the necessary pool management + subsystem if necessary. + + - const: restricted-dma-pool + description: > + This indicates a region of memory meant to be used as a pool + of restricted DMA buffers for a set of devices. The memory + region would be the only region accessible to those devices. + When using this, the no-map and reusable properties must not + be set, so the operating system can create a virtual mapping + that will be used for synchronization. The main purpose for + restricted DMA is to mitigate the lack of DMA access control + on systems without an IOMMU, which could result in the DMA + accessing the system memory at unexpected times and/or + unexpected addresses, possibly leading to data leakage or + corruption. The feature on its own provides a basic level of + protection against the DMA overwriting buffer contents at + unexpected times. However, to protect against general data + leakage and system memory corruption, the system needs to + provide way to lock down the memory access, e.g., MPU. Note + that since coherent allocation needs remapping, one must set + up another device coherent pool by shared-dma-pool and use + dma_alloc_from_dev_coherent instead for atomic coherent + allocation. + + linux,cma-default: + type: boolean + description: > + If this property is present, then Linux will use the region for + the default pool of the contiguous memory allocator. + + linux,dma-default: + type: boolean + description: > + If this property is present, then Linux will use the region for + the default pool of the consistent DMA allocator. + +if: + properties: + compatible: + contains: + const: restricted-dma-pool +then: + properties: + no-map: false + reusable: false + +unevaluatedProperties: false + +examples: + - | + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + /* global autoconfigured region for contiguous allocations */ + linux,cma { + compatible = "shared-dma-pool"; + reusable; + size = <0x4000000>; + alignment = <0x2000>; + linux,cma-default; + }; + + display_reserved: framebuffer@78000000 { + reg = <0x78000000 0x800000>; + }; + + restricted_dma_reserved: restricted-dma-pool@50000000 { + compatible = "restricted-dma-pool"; + reg = <0x50000000 0x4000000>; + }; + }; + +... From patchwork Tue Aug 29 19:18:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 13369503 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77894C83F16 for ; Tue, 29 Aug 2023 19:19:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236285AbjH2TSr (ORCPT ); Tue, 29 Aug 2023 15:18:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239121AbjH2TSX (ORCPT ); Tue, 29 Aug 2023 15:18:23 -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 ABCEBFD for ; Tue, 29 Aug 2023 12:18:19 -0700 (PDT) Received: by mail-io1-xd2c.google.com with SMTP id ca18e2360f4ac-792965813e7so112741739f.2 for ; Tue, 29 Aug 2023 12:18:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1693336699; x=1693941499; 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=asdwWrQgSDUsQBbMFgdwSUCGxAMIv135nq9+k2HMaa0=; b=RDPVP53Na4RjKIWVH4dYAGzx+P4LsBWFkOALAa+gmqqY5yCjmdWpCUpTFmxELphu2N u4XclXHLKT62uF4s7WWpt2ZIHom/6aI9lesxGW2jk1l7yERIEsKbHwUglbAhdF7oCBzl F6/WkjbcJ2idMkWbb3YsaIKzXq8ompF2DDfgA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693336699; x=1693941499; 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=asdwWrQgSDUsQBbMFgdwSUCGxAMIv135nq9+k2HMaa0=; b=EL63zEfsJzZWow3Lq33pMt04Q86SCRhAP+j1XtKF/V9yYrAAFqf9u58yh9ZqiISQ0x 2Dc2xHVNe03MpUMjxSfNVN3MAz7aI0zkzk8n7/KF8xrltR/qX/3TK/AFpPCdTekoqGtE FUlSJ9af4QZmyEDpgMAlBAx4Gj6w7jLaYCujBA5prr1uIZ/uuoWS3PZkjMTcC4gvbevq u4JmoDlFCpw1URdj06poln6gY3RaOEE3lpWXJ4sNB2oqDxsbi93byP9VG6baT/V7pSRU WBlBZzZtYF2ceOQinKaal10CD0+AsWKKr7HMyU3ptI2knpVlZEqHKL7bLEUWZT01+E6o sgig== X-Gm-Message-State: AOJu0YyZL1qweAAl6dYpRDhaWTYvoIccNLjCOhKCAUabuSrnNrIb/5X5 u0Hylm3glvoGtDzLdlo08KicvQ== X-Google-Smtp-Source: AGHT+IGAS+bTigCPmRP0jxu5uZgQG+yMGKUfr6n4pFO5Py5STv9I4dkw/kX8J7iBq5DSVfvEGDSG5w== X-Received: by 2002:a5d:990f:0:b0:790:fc73:6e3c with SMTP id x15-20020a5d990f000000b00790fc736e3cmr332445iol.8.1693336699097; Tue, 29 Aug 2023 12:18:19 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:16d9:c947:1a18:4c10]) by smtp.gmail.com with ESMTPSA id fq8-20020a056638650800b004332f6537e2sm3359798jab.83.2023.08.29.12.18.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 12:18:18 -0700 (PDT) From: Simon Glass To: devicetree@vger.kernel.org Cc: Dhaval Sharma , Mark Rutland , Gua Guo , Tom Rini , Rob Herring , U-Boot Mailing List , ron minnich , Ard Biesheuvel , Lean Sheng Tan , Maximilian Brune , Chiu Chasel , lkml , Yunhui Cui , linux-acpi@vger.kernel.org, Guo Dong , Simon Glass Subject: [PATCH v4 3/4] schemas: Add a schema for memory map Date: Tue, 29 Aug 2023 13:18:08 -0600 Message-ID: <20230829191812.135759-3-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.rc2.253.gd59a3bf2b4-goog In-Reply-To: <20230829191812.135759-1-sjg@chromium.org> References: <20230829191812.135759-1-sjg@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The Devicetree specification skips over handling of a logical view of the memory map, pointing users to the UEFI specification. It is common to split firmware into 'Platform Init', which does the initial hardware setup and a "Payload" which selects the OS to be booted. Thus an handover interface is required between these two pieces. Where UEFI boot-time services are not available, but UEFI firmware is present on either side of this interface, information about memory usage and attributes must be presented to the "Payload" in some form. This aims to provide an initial schema for this mapping. Note that this is separate from the existing /memory and /reserved-memory nodes, since it is mostly concerned with what the memory is used for. It may cover only a small fraction of available memory. For now, no attempt is made to create an exhaustive binding, so there are some example types listed. This can be completed once this has passed initial review. The compatible string is not included, since the node name is enough to indicate the purpose of a node, as per the existing reserved-memory schema. This binding does not include a binding for the memory 'attribute' property, defined by EFI_BOOT_SERVICES.GetMemoryMap(). It may be useful to have that as well, but perhaps not as a bit mask. Signed-off-by: Simon Glass --- Changes in v4: - Make use of the reserved-memory node instead of creating a new one Changes in v3: - Reword commit message again - cc a lot more people, from the FFI patch - Split out the attributes into the /memory nodes Changes in v2: - Reword commit message dtschema/schemas/memory-map.yaml | 61 +++++++++++++++++++ .../reserved-memory/common-reserved.yaml | 53 ++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 dtschema/schemas/memory-map.yaml create mode 100644 dtschema/schemas/reserved-memory/common-reserved.yaml diff --git a/dtschema/schemas/memory-map.yaml b/dtschema/schemas/memory-map.yaml new file mode 100644 index 0000000..4b06583 --- /dev/null +++ b/dtschema/schemas/memory-map.yaml @@ -0,0 +1,61 @@ +# SPDX-License-Identifier: BSD-2-Clause +# Copyright 2023 Google LLC +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/memory-map.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: /memory-map nodes +description: | + Common properties always required in /memory-map nodes. These nodes are + intended to resolve the nonchalant clause 3.4.1 ("/memory node and UEFI") + in the Devicetree Specification. + +maintainers: + - Simon Glass + +properties: + $nodename: + const: 'memory-map' + +patternProperties: + "^([a-z][a-z0-9\\-]+@[0-9a-f]+)?$": + type: object + additionalProperties: false + + properties: + reg: + minItems: 1 + maxItems: 1024 + + usage: + $ref: /schemas/types.yaml#/definitions/string + description: | + Describes the usage of the memory region, e.g.: + + "acpi-reclaim", "acpi-nvs", "bootcode", "bootdata", "bootdata", + "runtime-code", "runtime-data". + + See enum EFI_MEMORY_TYPE in "Unified Extensible Firmware Interface + (UEFI) Specification" for all the types. For now there are not + listed here. + + required: + - reg + +additionalProperties: false + +examples: + - | + memory-map { + acpi@f0000 { + reg = <0xf0000 0x4000>; + usage = "acpi-reclaim"; + }; + + runtime@12300000 { + reg = <0x12300000 0x28000>; + usage = "runtime-code"; + }; + }; +... diff --git a/dtschema/schemas/reserved-memory/common-reserved.yaml b/dtschema/schemas/reserved-memory/common-reserved.yaml new file mode 100644 index 0000000..70cdead --- /dev/null +++ b/dtschema/schemas/reserved-memory/common-reserved.yaml @@ -0,0 +1,53 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/reserved-memory/common-reserved.yaml# +$schema: http://devicetree.org/meta-schemas/base.yaml# + +title: Common memory reservations + +description: | + Specifies that the reserved memory region can be used for the purpose + indicated by its node name. + + Clients may reuse this reserved memory if they understand what it is for. + +maintainers: + - Simon Glass + +# always select the core schema +select: true + +properties: + $nodename: + oneOf: + - acpi-reclaim + - acpi-nvs + - boot-code + - boot-data + - runtime-code + - runtime-data + + reg: + description: region of memory that is reserved for the purpose indicated + by the node name. + +required: + - reg + +unevaluatedProperties: false + +examples: + - | + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + + boot-code@12340000 { + reg = <0x12340000 0x00800000>; + }; + + boot-data@43210000 { + reg = <0x43210000 0x00800000>; + }; + }; From patchwork Tue Aug 29 19:18:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 13369501 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F37BC6FA8F for ; Tue, 29 Aug 2023 19:19:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239855AbjH2TSt (ORCPT ); Tue, 29 Aug 2023 15:18:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239094AbjH2TSX (ORCPT ); Tue, 29 Aug 2023 15:18:23 -0400 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2991194 for ; Tue, 29 Aug 2023 12:18:20 -0700 (PDT) Received: by mail-io1-xd30.google.com with SMTP id ca18e2360f4ac-7927952ca67so140344839f.2 for ; Tue, 29 Aug 2023 12:18:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1693336700; x=1693941500; 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=Q2EOlIsyyalVzQJ+ySIW4EY7rt0WpPcDJsD4cRWVzLc=; b=Y8ndFGXUdPBDqaEMrjCfmJVCjWK3Y+qe25md0YtblEBllgsSd1oPIVru37PO6prVZU 4eqfiJEtZ4He2OXtMXrTkWUKUjXzoKVu1LfH3s94VUxIXZYxKwnpUsQv/egO0yoJp61F SUelLTEiNB1m9OHnbp6uqCRQNu8CQSiYzw6CQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693336700; x=1693941500; 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=Q2EOlIsyyalVzQJ+ySIW4EY7rt0WpPcDJsD4cRWVzLc=; b=Ormus5RS9ZctjoDtWjVoMTtjq3bM27/58O0tOGM+MnMT68RfyV0w6jzV8xPmyykvTM T48S8ZYVP2I/GxgeIipGc8zAWGUbjm2RnfWsSQN4BUfGFjFz596RXGI98R//2bWxa26D IwJX8t23c6TO5VTMyEpEhRBDRHO4K+yyPUIdRrzHkGuOazkfPoqI67fVWB6cx1nEvUbE T9CI/iSkoMbUGqDFHo3qb1dwc4JDgUsRYHbRT9POhy2NVfcVGA2GwTtnWSAypVLrW7dV EHIifsVPWbbNaUWvzezVGo4/5s5/ohi8/YSk7Nc/DpHDOCcHVLAdAV2inNdyYx3HAK+p wzYA== X-Gm-Message-State: AOJu0YzTOiDx15vE0RQDGRmpuxVJYE6yIx4BevwmTGhgkTyi1PZ95Dgx onKy0nVtmB5BysJeSp4iyZHZDg== X-Google-Smtp-Source: AGHT+IHcNTUDqeWuGnguf30MnbXSWVIEQf0YgXYlNufXHWllcBHuQB7tTPrRkRrNldw414bQICnkvA== X-Received: by 2002:a6b:a05:0:b0:795:16b8:85fc with SMTP id z5-20020a6b0a05000000b0079516b885fcmr406492ioi.0.1693336700070; Tue, 29 Aug 2023 12:18:20 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:16d9:c947:1a18:4c10]) by smtp.gmail.com with ESMTPSA id fq8-20020a056638650800b004332f6537e2sm3359798jab.83.2023.08.29.12.18.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 12:18:19 -0700 (PDT) From: Simon Glass To: devicetree@vger.kernel.org Cc: Dhaval Sharma , Mark Rutland , Gua Guo , Tom Rini , Rob Herring , U-Boot Mailing List , ron minnich , Ard Biesheuvel , Lean Sheng Tan , Maximilian Brune , Chiu Chasel , lkml , Yunhui Cui , linux-acpi@vger.kernel.org, Guo Dong , Simon Glass Subject: [PATCH v4 4/4] memory: Add ECC property Date: Tue, 29 Aug 2023 13:18:09 -0600 Message-ID: <20230829191812.135759-4-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.rc2.253.gd59a3bf2b4-goog In-Reply-To: <20230829191812.135759-1-sjg@chromium.org> References: <20230829191812.135759-1-sjg@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Some memories provides ECC correction. For software which wants to check memory, it is helpful to see which regions provide this feature. Add this as a property of the /memory nodes, since it presumably follows the hardware-level memory system. Signed-off-by: Simon Glass --- (no changes since v3) Changes in v3: - Add new patch to update the /memory nodes dtschema/schemas/memory.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dtschema/schemas/memory.yaml b/dtschema/schemas/memory.yaml index 1d74410..981af04 100644 --- a/dtschema/schemas/memory.yaml +++ b/dtschema/schemas/memory.yaml @@ -34,7 +34,14 @@ patternProperties: description: For the purpose of identification, each NUMA node is associated with a unique token known as a node id. - + attr: + $ref: /schemas/types.yaml#/definitions/string-array + description: | + Attributes possessed by this memory region: + + "single-bit-ecc" - supports single-bit ECC + "multi-bit-ecc" - supports multiple-bit ECC + "no-ecc" - non-ECC memory required: - device_type