From patchwork Mon Feb 24 02:10:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Delva X-Patchwork-Id: 11399173 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1C66F109A for ; Mon, 24 Feb 2020 02:10:34 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EFA1120727 for ; Mon, 24 Feb 2020 02:10:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="ewQZZzHb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EFA1120727 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id C1F7210FC33FC; Sun, 23 Feb 2020 18:11:25 -0800 (PST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::104a; helo=mail-pj1-x104a.google.com; envelope-from=3lzbtxgykdd4fijq0flttlqj.htrqnsz2-s0inrrqnxyx.56.twl@flex--adelva.bounces.google.com; receiver= Received: from mail-pj1-x104a.google.com (mail-pj1-x104a.google.com [IPv6:2607:f8b0:4864:20::104a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E3F1010FC33F4 for ; Sun, 23 Feb 2020 18:11:23 -0800 (PST) Received: by mail-pj1-x104a.google.com with SMTP id m61so5445098pjb.1 for ; Sun, 23 Feb 2020 18:10:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=xXnVPSTtq6JKEca5i5uwLN/shdFSGa9fDblOik0nzOE=; b=ewQZZzHbAIm9IaVDu9F0bc2esO1BNMP2dV5Rp45y8mFa8Z0HBz43i3HohNjPmgKnZF iGvAM0Z71h7ZTE66msAdaRCfRpaOSuKti3gKQcx16Iza8AaubCFm30jx7F0Y8VJdz56P p5JifXyJlkxxvdhB0WTwuFfXVQ90hE8ZMGORE/RZCHHPnqei3atfgwfHGcNA3I1FZ18h 0Iuvr5oHofTsZzrJmhJipc5xrmilXc5ctdxC6HQ5QgYDVHvMWu4d5abZXY/KvQjNxha7 Hkur+YO1PRIZeqbJcGRVm8AwuZFnIei1lXZgQF++GRM57usyRdsHLq5QnO0h2KmhgnQA RitA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=xXnVPSTtq6JKEca5i5uwLN/shdFSGa9fDblOik0nzOE=; b=qY8SIoAafp99PnNekUbo6pFu/Q4dHVPoN+mqguyo1My5UXDEVFs1V+6rN6RWb1HRgr 45XihXF7UuZwSmbqF7aNpOoNdoamIz8dGdJb7bVCeRAf4mU3IsQG4EmF00MzdPcw0I8I yzNJaIxuX+jxsMSlPQEzuCPQbxyVYmo/q2jhQzQyW9JutI1NErLJtMayuNzUlzjvH37f fBhxAmbO+wLAegnk1DFtcqExb+JDL4qTnxjmIh/3b2gmQ4RSDHI8wqaDg2dNtn1fAdVm 9GRC0wo3yFWrw9SB2VIeaIv/JMcE8XtqkfaSwdkYU1ex+N9kDuhKVbkUIxvzldslgOwz qQ2w== X-Gm-Message-State: APjAAAXwQXJhJCN2RsKxqv89f4A/d/3ccwXcRVKLf1Hu9df9f2+/1s0+ gJ7TRjyEUVnbj3TlHU3TvgcJZ/QGyRw= X-Google-Smtp-Source: APXvYqzh7LWx5FHfbXoqvdMOKLDRvpI9RTMgE9OYFl93HPIxPAzkWl5IGjaOk/mtBxp40jqIQkZIat3Is54= X-Received: by 2002:a63:8743:: with SMTP id i64mr49147206pge.243.1582510231389; Sun, 23 Feb 2020 18:10:31 -0800 (PST) Date: Sun, 23 Feb 2020 18:10:27 -0800 Message-Id: <20200224021029.142701-1-adelva@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.25.0.265.gbab2e86ba0-goog Subject: [PATCH v3 1/3] libnvdimm/of_pmem: factor out region registration From: Alistair Delva To: linux-kernel@vger.kernel.org Message-ID-Hash: CKC6Z4HDDIMU34TXPAIBUC2PMTOZECKU X-Message-ID-Hash: CKC6Z4HDDIMU34TXPAIBUC2PMTOZECKU X-MailFrom: 3lzBTXgYKDD4fijq0flttlqj.htrqnsz2-s0inrrqnxyx.56.twl@flex--adelva.bounces.google.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation CC: Kenny Root , Rob Herring , devicetree@vger.kernel.org, linux-nvdimm@lists.01.org, kernel-team@android.com X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Kenny Root Factor out region registration for 'reg' node. A follow-up change will use of_pmem_register_region() to handle memory-region nodes too. Signed-off-by: Kenny Root Signed-off-by: Alistair Delva Reviewed-by: "Oliver O'Halloran" Cc: Rob Herring Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Ira Weiny Cc: devicetree@vger.kernel.org Cc: linux-nvdimm@lists.01.org Cc: kernel-team@android.com --- [v3: adelva: remove duplicate "From:"] drivers/nvdimm/of_pmem.c | 60 +++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/drivers/nvdimm/of_pmem.c b/drivers/nvdimm/of_pmem.c index 8224d1431ea9..fdf54494e8c9 100644 --- a/drivers/nvdimm/of_pmem.c +++ b/drivers/nvdimm/of_pmem.c @@ -14,6 +14,39 @@ struct of_pmem_private { struct nvdimm_bus *bus; }; +static void of_pmem_register_region(struct platform_device *pdev, + struct nvdimm_bus *bus, + struct device_node *np, + struct resource *res, bool is_volatile) +{ + struct nd_region_desc ndr_desc; + struct nd_region *region; + + /* + * NB: libnvdimm copies the data from ndr_desc into it's own + * structures so passing a stack pointer is fine. + */ + memset(&ndr_desc, 0, sizeof(ndr_desc)); + ndr_desc.numa_node = dev_to_node(&pdev->dev); + ndr_desc.target_node = ndr_desc.numa_node; + ndr_desc.res = res; + ndr_desc.of_node = np; + set_bit(ND_REGION_PAGEMAP, &ndr_desc.flags); + + if (is_volatile) + region = nvdimm_volatile_region_create(bus, &ndr_desc); + else + region = nvdimm_pmem_region_create(bus, &ndr_desc); + + if (!region) + dev_warn(&pdev->dev, + "Unable to register region %pR from %pOF\n", + ndr_desc.res, np); + else + dev_dbg(&pdev->dev, "Registered region %pR from %pOF\n", + ndr_desc.res, np); +} + static int of_pmem_region_probe(struct platform_device *pdev) { struct of_pmem_private *priv; @@ -46,31 +79,8 @@ static int of_pmem_region_probe(struct platform_device *pdev) is_volatile ? "volatile" : "non-volatile", np); for (i = 0; i < pdev->num_resources; i++) { - struct nd_region_desc ndr_desc; - struct nd_region *region; - - /* - * NB: libnvdimm copies the data from ndr_desc into it's own - * structures so passing a stack pointer is fine. - */ - memset(&ndr_desc, 0, sizeof(ndr_desc)); - ndr_desc.numa_node = dev_to_node(&pdev->dev); - ndr_desc.target_node = ndr_desc.numa_node; - ndr_desc.res = &pdev->resource[i]; - ndr_desc.of_node = np; - set_bit(ND_REGION_PAGEMAP, &ndr_desc.flags); - - if (is_volatile) - region = nvdimm_volatile_region_create(bus, &ndr_desc); - else - region = nvdimm_pmem_region_create(bus, &ndr_desc); - - if (!region) - dev_warn(&pdev->dev, "Unable to register region %pR from %pOF\n", - ndr_desc.res, np); - else - dev_dbg(&pdev->dev, "Registered region %pR from %pOF\n", - ndr_desc.res, np); + of_pmem_register_region(pdev, bus, np, &pdev->resource[i], + is_volatile); } return 0; From patchwork Mon Feb 24 02:10:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Delva X-Patchwork-Id: 11399175 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3254492A for ; Mon, 24 Feb 2020 02:10:37 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 103822067D for ; Mon, 24 Feb 2020 02:10:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="OEZCOSfq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 103822067D Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id DDDBC10FC3405; Sun, 23 Feb 2020 18:11:28 -0800 (PST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::64a; helo=mail-pl1-x64a.google.com; envelope-from=3mtbtxgykdeacfgnxciqqing.eqonkpwz-pxfkoonkuvu.23.qti@flex--adelva.bounces.google.com; receiver= Received: from mail-pl1-x64a.google.com (mail-pl1-x64a.google.com [IPv6:2607:f8b0:4864:20::64a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1BD3910FC33FF for ; Sun, 23 Feb 2020 18:11:26 -0800 (PST) Received: by mail-pl1-x64a.google.com with SMTP id q24so4295632pls.6 for ; Sun, 23 Feb 2020 18:10:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=U9x1EVLhqUbvxZ1MWzxoNmpwHOpemfs+Xxa6i1IJDww=; b=OEZCOSfqHyCH0n82I//mUildBSBEUUWtDcYiq5Oo5rR6qwCUGmKPZzbMBisxmcQAbs TwUoh4G1YcGAerITwUuZ71yplkGbaMvFWpjDhsl44azfyp7P/KC4RBOS12hgxQY8jm8M ldIXaMtQFvHvaRURHKQJFJiIDj0VeJ4hObpDLPxHCrY4fTUWKMlQ2GNmcvZ8TYBqHV9C VILHHGsrHmqLJFAja4WXRD36IvuFwZ9qn2f1/Ybes/BbOLiEuQ7gbF3HMSYDNIZzN2Wl 0+OLRiZL+3uLGxhSCLaFIvMWKj4va4dyktRr9Xz0/bsQkUhkikLjtVzf/ATL1C/LX4K+ hhyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=U9x1EVLhqUbvxZ1MWzxoNmpwHOpemfs+Xxa6i1IJDww=; b=pmZQosJhy603LbyyrwS+CWniv4uACnXYDmCYtw9a0kG6l6NNOmADCYixTZBg89qmpd 4T1LOzW55pmBBGfW30TnOUOcMAMRMAXEHZR0+2BAiwhu4vMnPPgAkeAVl1FkMfvjpikI eQwlDBLuVmyJ97puwufgW2ImXNnqai63kxbEg2S6qjvc41dsocBmH5oGVHbuqSVC37vT pzBUdZmPHl3i/Qkf929p8rsibDzSTCmSA7JiWLWV+hIq75ALITp32F622zORdtFsLTkx A8g5XoSkwPz3acF0B8TTvs7mRU5NSz5NNID3ZQvGnBDLBzQ55IWRD3iInG2Xz92aJPwm 6wog== X-Gm-Message-State: APjAAAVdNmD3kDsEAdv9kx4+M02orLeq7z+PF6/lgCsIeWKV9GIGvgrF uw2fxOklSjyIbvg3T3Wiwrqa0j+sxeg= X-Google-Smtp-Source: APXvYqyTwjxCwbxReORBQcuv6XOeQhdEylhMml37cUwzX0Kd3xXx05FTdjuoUaIZYSsoX4pIMCxjPJwMRp0= X-Received: by 2002:a63:2e42:: with SMTP id u63mr49471649pgu.137.1582510233602; Sun, 23 Feb 2020 18:10:33 -0800 (PST) Date: Sun, 23 Feb 2020 18:10:28 -0800 In-Reply-To: <20200224021029.142701-1-adelva@google.com> Message-Id: <20200224021029.142701-2-adelva@google.com> Mime-Version: 1.0 References: <20200224021029.142701-1-adelva@google.com> X-Mailer: git-send-email 2.25.0.265.gbab2e86ba0-goog Subject: [PATCH v3 2/3] libnvdimm/of_pmem: handle memory-region in DT From: Alistair Delva To: linux-kernel@vger.kernel.org Message-ID-Hash: WQEDQZ6RSQW65BZQ52YAIZUYIWUMN4ZE X-Message-ID-Hash: WQEDQZ6RSQW65BZQ52YAIZUYIWUMN4ZE X-MailFrom: 3mTBTXgYKDEAcfgnxciqqing.eqonkpwz-pxfkoonkuvu.23.qti@flex--adelva.bounces.google.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation CC: Kenny Root , Rob Herring , devicetree@vger.kernel.org, linux-nvdimm@lists.01.org, kernel-team@android.com X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Kenny Root Add support for parsing the 'memory-region' DT property in addition to the 'reg' DT property. This enables use cases where the pmem region is not in I/O address space or dedicated memory (e.g. a bootloader carveout). Signed-off-by: Kenny Root Signed-off-by: Alistair Delva Reviewed-by: "Oliver O'Halloran" Cc: Rob Herring Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Ira Weiny Cc: devicetree@vger.kernel.org Cc: linux-nvdimm@lists.01.org Cc: kernel-team@android.com --- [v3: adelva: remove duplicate "From:"] drivers/nvdimm/of_pmem.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/nvdimm/of_pmem.c b/drivers/nvdimm/of_pmem.c index fdf54494e8c9..cff47cc5fc4a 100644 --- a/drivers/nvdimm/of_pmem.c +++ b/drivers/nvdimm/of_pmem.c @@ -49,11 +49,12 @@ static void of_pmem_register_region(struct platform_device *pdev, static int of_pmem_region_probe(struct platform_device *pdev) { + struct device_node *mr_np, *np; struct of_pmem_private *priv; - struct device_node *np; struct nvdimm_bus *bus; + struct resource res; bool is_volatile; - int i; + int i, ret; np = dev_of_node(&pdev->dev); if (!np) @@ -83,6 +84,21 @@ static int of_pmem_region_probe(struct platform_device *pdev) is_volatile); } + i = 0; + while ((mr_np = of_parse_phandle(np, "memory-region", i++))) { + ret = of_address_to_resource(mr_np, 0, &res); + if (ret) { + dev_warn( + &pdev->dev, + "Unable to acquire memory-region from %pOF: %d\n", + mr_np, ret); + } else { + of_pmem_register_region(pdev, bus, np, &res, + is_volatile); + } + of_node_put(mr_np); + } + return 0; } From patchwork Mon Feb 24 02:10:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Delva X-Patchwork-Id: 11399177 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 35AD292A for ; Mon, 24 Feb 2020 02:10:39 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 140AC2192A for ; Mon, 24 Feb 2020 02:10:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="E+uXnhSN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 140AC2192A Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 0082110FC3408; Sun, 23 Feb 2020 18:11:30 -0800 (PST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::44a; helo=mail-pf1-x44a.google.com; envelope-from=3ndbtxgykdemfijq0flttlqj.htrqnsz2-s0inrrqnxyx.56.twl@flex--adelva.bounces.google.com; receiver= Received: from mail-pf1-x44a.google.com (mail-pf1-x44a.google.com [IPv6:2607:f8b0:4864:20::44a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 10D8A10FC3409 for ; Sun, 23 Feb 2020 18:11:28 -0800 (PST) Received: by mail-pf1-x44a.google.com with SMTP id z19so5651677pfn.18 for ; Sun, 23 Feb 2020 18:10:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=em6XcUN6Sgd77WYEtwG8AuT1olj7PL/gGgbDqoXx92w=; b=E+uXnhSNXf534z3GjUH2lwNEjBXcWXn9RZ44ynGBLyGFBh6B4SCJ3rTdzfHM+o+Bno VxKLCAHwsdkWJHskFoD9Vkuqmf8sv3ORr03b21RmM6sK4B1dNgs7kHUsncaBgQsK20aP fSSiL3sHi6ZuSaLSU/ac+vt4cTkZWsOgFrQbnhYdCv8sXcHJm4YWmse1gk9vJvta74Pz CtGwlNEpDNXJrKiIYC7aOyrG6lp7JHG+ot6FFt32MXr6s5mwt6uR9xa3rNnYf88dZifz 0PMFwNS6V8oJBOtSVNut319Ez0TbFHLd2ElURqTOriDU/ubyPYQu44SBgjdg9OpeV/wF pVDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=em6XcUN6Sgd77WYEtwG8AuT1olj7PL/gGgbDqoXx92w=; b=ZDuToNx6nfvFZZxPzNt5SGsQakhgadR3k5p132Ye3VJGRgQIQVU9Je4bGjCe3PANLk 8MHSG7TFw1rmS5soVNZOjXXsiz4hOkjbDT9p4QUIYfLAe+M0kQdopw4yWPosrzwaJ4j0 bGCsC6SSGe3liZCk4JjnQqgBbwAejDayPyIigaePvSAAvqAsECu0tjEm0ybVowwu5MPs ca69guHC08Rtr12LCeqOvHHisgYUNsjioOL2XorN5x/iT91Bgw924Kn1XnZqEpr8RZH3 LrtZFh3ijrnAL0rymSYLsGj5dq5bmfYyihy9Jk/EPb3UeR3tZmr1FOAo6eOZXDT3X/9O 2Nkg== X-Gm-Message-State: APjAAAXipQ/A2a8AAmQkqUJiOb8suU1j8aP5+kNTwUtV4GwvC6nMVBO+ BzDRfhmQlGNd412VieNOn3zvjcrv0qE= X-Google-Smtp-Source: APXvYqz6s2e3jF7ohEb8JyMCoEHwTugiFEQk/Az/WnyXRnhPy25meta77iWUNz38j1pNY9KX9r6A5JnI984= X-Received: by 2002:a63:3407:: with SMTP id b7mr23541684pga.163.1582510236455; Sun, 23 Feb 2020 18:10:36 -0800 (PST) Date: Sun, 23 Feb 2020 18:10:29 -0800 In-Reply-To: <20200224021029.142701-1-adelva@google.com> Message-Id: <20200224021029.142701-3-adelva@google.com> Mime-Version: 1.0 References: <20200224021029.142701-1-adelva@google.com> X-Mailer: git-send-email 2.25.0.265.gbab2e86ba0-goog Subject: [PATCH v3 3/3] dt-bindings: pmem-region: Document memory-region From: Alistair Delva To: linux-kernel@vger.kernel.org Message-ID-Hash: QFIC3X5H4QDKFIM7NYOUJRHNOWOH3ZSC X-Message-ID-Hash: QFIC3X5H4QDKFIM7NYOUJRHNOWOH3ZSC X-MailFrom: 3nDBTXgYKDEMfijq0flttlqj.htrqnsz2-s0inrrqnxyx.56.twl@flex--adelva.bounces.google.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation CC: Kenny Root , Rob Herring , devicetree@vger.kernel.org, linux-nvdimm@lists.01.org, kernel-team@android.com X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Kenny Root Add documentation and example for memory-region in pmem. Signed-off-by: Kenny Root Signed-off-by: Alistair Delva Cc: "Oliver O'Halloran" Cc: Rob Herring Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Ira Weiny Cc: devicetree@vger.kernel.org Cc: linux-nvdimm@lists.01.org Cc: kernel-team@android.com --- [v3: adelva: remove duplicate "From:"] .../devicetree/bindings/pmem/pmem-region.txt | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Documentation/devicetree/bindings/pmem/pmem-region.txt b/Documentation/devicetree/bindings/pmem/pmem-region.txt index 5cfa4f016a00..0ec87bd034e0 100644 --- a/Documentation/devicetree/bindings/pmem/pmem-region.txt +++ b/Documentation/devicetree/bindings/pmem/pmem-region.txt @@ -29,6 +29,18 @@ Required properties: in a separate device node. Having multiple address ranges in a node implies no special relationship between the two ranges. + This property may be replaced or supplemented with a + memory-region property. Only one of reg or memory-region + properties is required. + + - memory-region: + Reference to the reserved memory node. The reserved memory + node should be defined as per the bindings in + reserved-memory.txt + + This property may be replaced or supplemented with a reg + property. Only one of reg or memory-region is required. + Optional properties: - Any relevant NUMA assocativity properties for the target platform. @@ -63,3 +75,20 @@ Examples: volatile; }; + + /* + * This example uses a reserved-memory entry instead of + * specifying the memory region directly in the node. + */ + + reserved-memory { + pmem_1: pmem@5000 { + no-map; + reg = <0x00005000 0x00001000>; + }; + }; + + pmem@1 { + compatible = "pmem-region"; + memory-region = <&pmem_1>; + };