From patchwork Tue Aug 22 20:34:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 13361451 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 AC990EE49A5 for ; Tue, 22 Aug 2023 20:34:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230492AbjHVUfA (ORCPT ); Tue, 22 Aug 2023 16:35:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231133AbjHVUe7 (ORCPT ); Tue, 22 Aug 2023 16:34:59 -0400 Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F84CCEF for ; Tue, 22 Aug 2023 13:34:56 -0700 (PDT) Received: by mail-io1-xd2b.google.com with SMTP id ca18e2360f4ac-7923d27b9f3so66734539f.3 for ; Tue, 22 Aug 2023 13:34:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1692736495; x=1693341295; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=EQi7QRj3DomGJNq77fSPrkeQ/5P45CBX8SOOZ9egyGY=; b=XBVW9o6x4KH2aCFdnr1+cajztmT4qOPkS38+3KWb80IYCTIE/cDT2m7Q1cGzg9b1Vf G6ylQeW1DnqKRObzW2ZE014/yIgDz0TNNYo2juLa948F8fSNiNUUILFzGCIm1/B2lVgJ 7w1aZCUpmGCvqJPGioKkUOs4lrVT4dj2CIHCs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692736495; x=1693341295; 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=EQi7QRj3DomGJNq77fSPrkeQ/5P45CBX8SOOZ9egyGY=; b=VEA8qe76MXNwTR2sNuNYbFomG8yp4iQMIw6CbsRNZ1pSDBEPCLsN0QWxUoicmKvoTo ail2RegpmPZ7MIn6zj1utDEsKd6CJHIT7gBG1K5xlb8l/1z4nEow5cf0Qw0Dj6cmlV1X rXYBsfgVKaLtUtWu5twwJ1DbbYJzH3Aoc5+mO6hPGVX4aE5QSxjgl2Wfz8lGSWKAtdNR koiSg9Y/7NChp5tjcrcpXNWXsKvjUnmFT7zJO3LSYa5g2qFgYWEGAvoZVGiHXvecVwaz yWTNTJDwBOWiZNBhoXOre7f3RoT+sKWzF1JhbFx7AmylncGIEgYgjNNk49m3fR4dnzq3 IlpA== X-Gm-Message-State: AOJu0YzubElxi8PgkfsNyU5pvcUShFAtQjgkq1jMZHOPM8DtyE7ig8l9 hahcGyTP4VDTrYPKhtWYJam8FQ== X-Google-Smtp-Source: AGHT+IG7GwprJP1540358w3OKonK7RTDA7jAtXMa1F0tKSSk5KGEYAodBigGr7WB4czbJykGoyCX8Q== X-Received: by 2002:a5d:930c:0:b0:790:fab3:2052 with SMTP id l12-20020a5d930c000000b00790fab32052mr815521ion.5.1692736495526; Tue, 22 Aug 2023 13:34:55 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:b7f:10f7:eb5:da54]) by smtp.gmail.com with ESMTPSA id s20-20020a5eaa14000000b0078754bed499sm3500745ioe.37.2023.08.22.13.34.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Aug 2023 13:34:54 -0700 (PDT) From: Simon Glass To: devicetree@vger.kernel.org Cc: Rob Herring , Ard Biesheuvel , Chiu Chasel , U-Boot Mailing List , Gua Guo , linux-acpi@vger.kernel.org, lkml , Yunhui Cui , ron minnich , Tom Rini , Lean Sheng Tan , Mark Rutland , Simon Glass Subject: [PATCH v3 1/2] schemas: Add a schema for memory map Date: Tue, 22 Aug 2023 14:34:42 -0600 Message-ID: <20230822203446.4111742-1-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.rc1.204.g551eb34607-goog 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. 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 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 ++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 dtschema/schemas/memory-map.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"; + }; + }; +... From patchwork Tue Aug 22 20:34:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 13361452 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 AD94BEE49A5 for ; Tue, 22 Aug 2023 20:35:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229446AbjHVUfE (ORCPT ); Tue, 22 Aug 2023 16:35:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231140AbjHVUfA (ORCPT ); Tue, 22 Aug 2023 16:35:00 -0400 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DB54CF8 for ; Tue, 22 Aug 2023 13:34:59 -0700 (PDT) Received: by mail-io1-xd29.google.com with SMTP id ca18e2360f4ac-79246bb4131so38497439f.3 for ; Tue, 22 Aug 2023 13:34:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1692736498; x=1693341298; 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=IAoCNyZqfvnfH/0/0Sp/bNbHBZV5FWrs/u1Wpi/L2lY=; b=LT5Eqx/qlnBPzXAqQIgggqVZHv+YCKJ+0iWbylurX1QFNVV18FyFBIyuIoD9FU/0eg 0JUuimV6sFdex20VLm+bcsgHJ+a542gNwqwX/Kwr6lWylmlmK92K8pIIXEi6OlaEv7au a/wps5s1f+rdlw80rXaimfr2ZjQyq39JTggvQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692736498; x=1693341298; 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=IAoCNyZqfvnfH/0/0Sp/bNbHBZV5FWrs/u1Wpi/L2lY=; b=BTgAsRbRUQXlsU2YzO3WA+xs2KpXGU4thaPiHRYSenqIQHfoYq1peop3SJlTQeUaHd vuutmWHcQ/tBB/ganaOvq0rC9VsLzbSIKPKqsaqIHrmwEC6+M2Zd73tGxz+lRFoth6Vn vlWZH+arOZX3ogV9d5yx0a7XgTR1nPhVl1y4XaUg6Mk94IgvKjKpmVc/pAcYuuHTEbAX 9mOEaMH/XyQAcZKge2gQsIDye+EoBr/0TbQcKA6bkI7nEjmIzl4BI5eoRf/Cj3qekZr2 CdpwbrIs4jj83XaO9Qbaiw1652VA2+6HhQ4/2X8qQTWmwC6YpwbLm5SqiQtorxP9cgAc 3zRQ== X-Gm-Message-State: AOJu0YwHDciY2JmJKA3WrBDF9ItPmtGtbln6brOzrd9AayG2MarIaRR2 HkEOUVlmNYpkrGitBRyjGtKYTA== X-Google-Smtp-Source: AGHT+IGrtcKkLUDbfM2/xR8cobFWMcEKBMWgBL9b5Nhq1+ovWu1dKbVkA9ITN/X9uDBnaMJz55KHKg== X-Received: by 2002:a6b:dd08:0:b0:783:3899:e1d0 with SMTP id f8-20020a6bdd08000000b007833899e1d0mr1007976ioc.6.1692736498725; Tue, 22 Aug 2023 13:34:58 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:b7f:10f7:eb5:da54]) by smtp.gmail.com with ESMTPSA id s20-20020a5eaa14000000b0078754bed499sm3500745ioe.37.2023.08.22.13.34.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Aug 2023 13:34:57 -0700 (PDT) From: Simon Glass To: devicetree@vger.kernel.org Cc: Rob Herring , Ard Biesheuvel , Chiu Chasel , U-Boot Mailing List , Gua Guo , linux-acpi@vger.kernel.org, lkml , Yunhui Cui , ron minnich , Tom Rini , Lean Sheng Tan , Mark Rutland , Simon Glass Subject: [PATCH v3 2/2] memory: Add ECC property Date: Tue, 22 Aug 2023 14:34:43 -0600 Message-ID: <20230822203446.4111742-2-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.rc1.204.g551eb34607-goog In-Reply-To: <20230822203446.4111742-1-sjg@chromium.org> References: <20230822203446.4111742-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 --- 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