From patchwork Mon Aug 21 19:48:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 715515 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 C1FE8EE49A8 for ; Mon, 21 Aug 2023 19:48:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229595AbjHUTsf (ORCPT ); Mon, 21 Aug 2023 15:48:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229576AbjHUTsf (ORCPT ); Mon, 21 Aug 2023 15:48:35 -0400 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33FBAEE for ; Mon, 21 Aug 2023 12:48:33 -0700 (PDT) Received: by mail-io1-xd2d.google.com with SMTP id ca18e2360f4ac-7921b70c1a5so77929239f.3 for ; Mon, 21 Aug 2023 12:48:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1692647312; x=1693252112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=3N7X/HZKiODl+6+MNX6JndqNW1xPMfJ5KlQEIhhEp20=; b=donK6i774XrVXYP+eFrBY/Un4gIoAVwXckSA4zoLb4QBZYzF5hY1hU1F0BosScRQZ7 l8eJtPP5cxDUF78dsofEIp4j0EcKrNglBt9oSms17GThKXCDrYdb5byaw/WwyU/nlFex UW6rQKBjf9lgmZW8uJ/Z05szJXngqVckaTEWQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692647312; x=1693252112; 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=3N7X/HZKiODl+6+MNX6JndqNW1xPMfJ5KlQEIhhEp20=; b=VsLUtBVlBx5K4QxB1wOuwWdzrjLQajkryuEWjlyp0TSmEsVMEzllJgsTfO0uO0lcQr oRuejMnolukS+FqfLzVuzqEp38BXz32LM/59nSDCrP2TCFFCxJAqEIluJh+Ly6/0/8Z0 yIGTuNLsvYWdJ59EXudCYQ6XM/tzzKWPxq9eHsXyjFZ5daCFAOsHjpUZA2V9aPZXilNs 4mrMUEU13xA/Y88viFBJOCTdWKOdsJb9nJBZcvNH/QBy7g3XPhvVO1Yjp4iNr3rfTvOE Ip5BtjIXZgZPnCoABjCL2UUMwdquZNB6RSxFmjL/Oclk6P0OseVxZs2wx9QMHSRHxjEN s9KQ== X-Gm-Message-State: AOJu0YxoBZjvQT0yWz9/EQHdEGY3UIkhSoDkcPz1wbd4cYp+O9ZgVgT4 HFOrhs3IljnXxjcKk+/Tmv0ibFuNfjztHe7eFGg= X-Google-Smtp-Source: AGHT+IFcu3IPYhGGuLvsyVJO8RzW3hUh7Hrcr3zrfVG6DkyEQPecWurr30tfPYr4FOJh+8GUA9xkMA== X-Received: by 2002:a05:6602:690:b0:785:5917:a35f with SMTP id dp16-20020a056602069000b007855917a35fmr10766390iob.8.1692647312413; Mon, 21 Aug 2023 12:48:32 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:9102:8976:7620:5093]) by smtp.gmail.com with ESMTPSA id o21-20020a02c6b5000000b0042b0ce92dddsm2552076jan.161.2023.08.21.12.48.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 12:48:32 -0700 (PDT) From: Simon Glass To: devicetree@vger.kernel.org Cc: Lean Sheng Tan , Tom Rini , lkml , linux-acpi@vger.kernel.org, Rob Herring , Chiu Chasel , U-Boot Mailing List , Gua Guo , Simon Glass Subject: [PATCH v2] schemas: Add a schema for memory map Date: Mon, 21 Aug 2023 13:48:19 -0600 Message-ID: <20230821194821.2961213-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: devicetree@vger.kernel.org The Devicespec 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, although it could be used to signal which area of memory has ECC. For now, no attempt is made to create an exhaustive binding, so there are some example types lists. This can be completed once this has passed initial review. Signed-off-by: Simon Glass --- Changes in v2: - Reword commit message dtschema/schemas/memory-map.yaml | 51 ++++++++++++++++++++++++++++++++ 1 file changed, 51 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..97e531e --- /dev/null +++ b/dtschema/schemas/memory-map.yaml @@ -0,0 +1,51 @@ +# 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: '/' + 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" + 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 + +patternProperties: + "^([a-z][a-z0-9\\-]+@[0-9a-f]+)?$": + type: object + additionalProperties: false + + properties: + reg: + minItems: 1 + maxItems: 1024 + + required: + - reg + +additionalProperties: true + +...