From patchwork Mon Feb 24 02:08:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Delva X-Patchwork-Id: 11399167 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 F1039109A for ; Mon, 24 Feb 2020 02:08:20 +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 926E0206E0 for ; Mon, 24 Feb 2020 02:08:20 +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="kJZgCePM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 926E0206E0 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 5006C10FC33EE; Sun, 23 Feb 2020 18:09:12 -0800 (PST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::649; helo=mail-pl1-x649.google.com; envelope-from=3etbtxgykdlywzahrwckkcha.ykihejqt-jrzeiiheopo.wx.knc@flex--adelva.bounces.google.com; receiver= Received: from mail-pl1-x649.google.com (mail-pl1-x649.google.com [IPv6:2607:f8b0:4864:20::649]) (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 7776710FC33E7 for ; Sun, 23 Feb 2020 18:09:10 -0800 (PST) Received: by mail-pl1-x649.google.com with SMTP id 36so4283279plc.12 for ; Sun, 23 Feb 2020 18:08:18 -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=TTWq2HAMIWzKgBL7Xe45vNa7b1DEMoXXBFSs7M828Vo=; b=kJZgCePMmoxwA2xDEAPwUZmHtat6929L1+S4W8sNm4SjPsz1lNFd5rhvU8L0yzXAP4 rcE6/ANzHRN09BnKZ9+yl1v5Ku5Ihl8A5hZbFNQVCoxh+iX5Y4vDOxxl7C3y0ifWWGME AVgAOmvnqo68lf+lsCTX64xV8O+AvAKhDjxAL/msdLzlmpNdY6HK8y+OvqgWKL6qdKkR 8YoVFcIkWHgF2nltRXaDDfOzN4wAaD4It2dEXMPIGxUuQ/CK/RKWtQ9FIsCBSAcgLCuO yzpHLAWXUwxyFSCa3jOj+4rYUCFJT+H7nKnOoe/v2D1tLLPcn3nJuTq0QEKzvQCy2JBb O5CA== 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=TTWq2HAMIWzKgBL7Xe45vNa7b1DEMoXXBFSs7M828Vo=; b=bJf611sAGOMLEh1uxFRQRT5xi/7TS6PapKZkOYWcuHt75Hod3D+Et2DLDqR68Wz0g3 UAPHo5icVVi2A5yUEbnhKUk21lrNFmLcTCjBfnpFE1218kRuzs1ZxLzCOUprI3k+ZiS+ 24s+V544P846nPUDkbxOHeIyLGwavo7uAImSTcGshHqqm3Mnffn8TPPKEO83UTkHNQlg d5elXuUCxWb2Y1GX9j/m9d622NspLJhx42DEIQFiCpwMoBoPRxB62BqeSnMyveX7xBEw FsXchNnAX7s9oKWMf4jx9ZRwUbsDcLn9EMTD480X9xKuOp3rKwRNOb9XP2QVAJYaBc47 scww== X-Gm-Message-State: APjAAAX5vw3FF63OAWnx8U+MO7f7u8gvfkqTyClqa/FBIR1kYXX4ZHY6 kXVAPM4GmWF7aIFhQ1ZlBRjmxkS7vVA= X-Google-Smtp-Source: APXvYqy3+lHEJgJYcJNPNBHbt3vzQS08gQtp0v+NV+Un3Tbvyi8fw9vGD/+7qqprOjXR7zGnFnF9cUYziBY= X-Received: by 2002:a63:3407:: with SMTP id b7mr23534176pga.163.1582510097904; Sun, 23 Feb 2020 18:08:17 -0800 (PST) Date: Sun, 23 Feb 2020 18:08:13 -0800 Message-Id: <20200224020815.139570-1-adelva@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.25.0.265.gbab2e86ba0-goog Subject: [PATCH v2 1/3] libnvdimm/of_pmem: factor out region registration From: Alistair Delva To: linux-kernel@vger.kernel.org Message-ID-Hash: 4M7OW776GNONSFS7OY27LTWEWU7LP35M X-Message-ID-Hash: 4M7OW776GNONSFS7OY27LTWEWU7LP35M X-MailFrom: 3ETBTXgYKDLYWZahrWckkcha.Ykihejqt-jrZeiiheopo.wx.knc@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 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 Reviewed-by: Ira Weiny --- 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:08:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Delva X-Patchwork-Id: 11399169 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 A0D5A92A for ; Mon, 24 Feb 2020 02:08:23 +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 7F21D206E0 for ; Mon, 24 Feb 2020 02:08:23 +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="YHiXmus/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7F21D206E0 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 6466310FC33F6; Sun, 23 Feb 2020 18:09:15 -0800 (PST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::649; helo=mail-pl1-x649.google.com; envelope-from=3fdbtxgykdlkzcdkuzfnnfkd.bnlkhmtw-muchllkhrsr.z0.nqf@flex--adelva.bounces.google.com; receiver= Received: from mail-pl1-x649.google.com (mail-pl1-x649.google.com [IPv6:2607:f8b0:4864:20::649]) (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 3E76D10FC33F3 for ; Sun, 23 Feb 2020 18:09:13 -0800 (PST) Received: by mail-pl1-x649.google.com with SMTP id q24so4293233pls.6 for ; Sun, 23 Feb 2020 18:08:21 -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=e5neKRQE0Ylu70uQVNqG6CPXmoPxHODfaRvH7F2C0Pw=; b=YHiXmus/EnjFAU6PeaWn5LwpzUc7PCFQI/d8yZl9grAa0B/xUi4r5vcOTDITCKIMoW makG0khPu6K/gEZosHvwYEmmd5qMT4sL+7dMkWgIbSHv/wa0qLv74DkUKsqsYKrbEmFq cz+79KiVOwo1hux6wHBTXNldhNPIpnpM0JKH8Hbaz7ocFT6PA43kqynKv4cGs9BnsHRT 3KjHFvgTMpihahJNCJ4GKPSuHch2mMMIGfseexNT7auHTeecCgYy6TSRwVT0jr0rUP13 8HcCPaDMPQPjZWzW/E6ZqvaP2GHWTPhtfMdx/01vxbjrzu9CsFbz6zPZr/Mps6xv0QQc x+7g== 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=e5neKRQE0Ylu70uQVNqG6CPXmoPxHODfaRvH7F2C0Pw=; b=lE+Z5E6CaJG7MM8/qnNV3MBRh404nLE9uvulxYWa7pqvYkMBff6U2pqxLcmvb4+cau CanwrQU68q3BGQL/XVgvIa6VxEwis6CRuj+tc8SADK9dqx+VkLZVcI9hz4Iflv1SXS1t KbAR1mGxStV6EZzp9k+/uSrRwgtgrMm9gp/tt+XHDp4H5+C2E8qm47VgqaTD7L7DslO3 k0ITH3yHrQO1L0kBj+5eZjYeP8t5jii6zi5JXhEqQi1tkJzuu0dTgZb4jrk7d71FuWYT q/UUGdwu0cKYvrBHibA51yCc1VtZFRvIiYoZMvR7fIQ95GisR1iGa7bfSSV+VTjjNZ7I uczg== X-Gm-Message-State: APjAAAXdTolpLWUGZgRWE+pSg5EmvRFCQnSLZMjHiQ0D9eportmxtuyY 4W2LwTtHQkmkLPtTk2ZB/r6qHOlBJXo= X-Google-Smtp-Source: APXvYqxYYdZX9abJhfwReiJ8C0V/zBLnRqxvKYMmDdPec8/r7k35sA3GrzCBR2B2f8BSFH0cnrJqWNBQpbc= X-Received: by 2002:a63:8b41:: with SMTP id j62mr2267520pge.18.1582510100578; Sun, 23 Feb 2020 18:08:20 -0800 (PST) Date: Sun, 23 Feb 2020 18:08:14 -0800 In-Reply-To: <20200224020815.139570-1-adelva@google.com> Message-Id: <20200224020815.139570-2-adelva@google.com> Mime-Version: 1.0 References: <20200224020815.139570-1-adelva@google.com> X-Mailer: git-send-email 2.25.0.265.gbab2e86ba0-goog Subject: [PATCH v2 2/3] libnvdimm/of_pmem: handle memory-region in DT From: Alistair Delva To: linux-kernel@vger.kernel.org Message-ID-Hash: I5P6AKVK57EUTAOB5TXU7WB2WQEKE4O6 X-Message-ID-Hash: I5P6AKVK57EUTAOB5TXU7WB2WQEKE4O6 X-MailFrom: 3FDBTXgYKDLkZcdkuZfnnfkd.bnlkhmtw-muchllkhrsr.z0.nqf@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 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 --- 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:08:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Delva X-Patchwork-Id: 11399171 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 A9D2D109A for ; Mon, 24 Feb 2020 02:08:27 +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 881582067D for ; Mon, 24 Feb 2020 02:08:27 +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="dl3xLDMm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 881582067D 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 795E210FC33F7; Sun, 23 Feb 2020 18:09:19 -0800 (PST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::a49; helo=mail-vk1-xa49.google.com; envelope-from=3fzbtxgykdlwcfgnxciqqing.eqonkpwz-pxfkoonkuvu.23.qti@flex--adelva.bounces.google.com; receiver= Received: from mail-vk1-xa49.google.com (mail-vk1-xa49.google.com [IPv6:2607:f8b0:4864:20::a49]) (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 D477010FC33F7 for ; Sun, 23 Feb 2020 18:09:16 -0800 (PST) Received: by mail-vk1-xa49.google.com with SMTP id z24so3886273vkn.0 for ; Sun, 23 Feb 2020 18:08:24 -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=tfMKf34rzYmaH8xdI4hD1ENek/gjKmpNdihWWrIkihY=; b=dl3xLDMmDQHWYwGTPecBMrhl8cp1ubi79/y4uC7zvxw13x5kxR0hIrdzcb6mpDjnIR akn7tFOCzC75LJ2U9XJBX1yKrH60zz44P5XPslfmv7fJWnv+CjXCSxIC9H0Qj+eap13U b1797Qo5mdforvpT4UbfBeE3Kwe7zvdlEFiny/xDlpedod7j01y2vCVM9O1Wdm+DQDdY DdqUI16njA1pwpu3TGvZTWuiHMHMU4z/1vto4Gwv59MGXnZwoueBJu8V1lHvMMEwWG63 3p9DXJ3CcgM+sXeYNC/XM9jp86gtz5/p+nNxrhXAKSgazBzSfBhHDwhZwBGiPwrwNWVE ydSQ== 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=tfMKf34rzYmaH8xdI4hD1ENek/gjKmpNdihWWrIkihY=; b=KjiUF+YWjSYngqf3XXu9Jx8wTF4T5Md5IEVe+DKWy5o+Ud4pkR1DODOYMe21a69kIk Dx7OmPiu4ny8zXJ+fkVbgd9ukB693vsgeL0rfx6sJrkjNhC5Z2FB1oCLKaeRA7dz9YXw paQ8OA91Jhe/0U8J9sXcm5mM1WCEWAtzEK79SnsY3Bg4B0PuUSA+QwJHNkXA2Ywo+rKw OMr5MaVNRK8MKDtS79s8YfavE3bg+nlix+k2QjVJqPTl4brQe/Czo2/SNWwQkuGlFun8 R5DWFZwaGl21M0OGFEaM5vHfvM5mjEepMqvltB56SD/Ed/zbDvzjssQQUaQJvIhemSCs mi8A== X-Gm-Message-State: APjAAAUIz4YWKQOVAvKZYOf4tujGgLeeknkBepNgxfDMv3M2Re5/LBL0 jaG/GPkUTPdE4AmIAy9uCIIw3bOeEEo= X-Google-Smtp-Source: APXvYqwTsPEqq0vSJALIwRT24gVR2Zsdll9IQ6yQ0KfZKKmTVDr8mHQmzYKgR5Kxy/Fg4GEAIXU4VmCCVXc= X-Received: by 2002:a67:89c4:: with SMTP id l187mr24451432vsd.31.1582510103411; Sun, 23 Feb 2020 18:08:23 -0800 (PST) Date: Sun, 23 Feb 2020 18:08:15 -0800 In-Reply-To: <20200224020815.139570-1-adelva@google.com> Message-Id: <20200224020815.139570-3-adelva@google.com> Mime-Version: 1.0 References: <20200224020815.139570-1-adelva@google.com> X-Mailer: git-send-email 2.25.0.265.gbab2e86ba0-goog Subject: [PATCH v2 3/3] dt-bindings: pmem-region: Document memory-region From: Alistair Delva To: linux-kernel@vger.kernel.org Message-ID-Hash: EM45V2YENLEYBZUE6MLQ5FFY6COZ4QIQ X-Message-ID-Hash: EM45V2YENLEYBZUE6MLQ5FFY6COZ4QIQ X-MailFrom: 3FzBTXgYKDLwcfgnxciqqing.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 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 --- .../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>; + };