From patchwork Thu Jul 20 06:16:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 791418 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xCkF826zGz9t2J for ; Thu, 20 Jul 2017 16:16:44 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="M2t5w4nS"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xCkF810GbzDrF3 for ; Thu, 20 Jul 2017 16:16:44 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="M2t5w4nS"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3xCkF04K83zDrDP for ; Thu, 20 Jul 2017 16:16:35 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="M2t5w4nS"; dkim-atps=neutral Received: by mail-pg0-x241.google.com with SMTP id y129so1894009pgy.3 for ; Wed, 19 Jul 2017 23:16:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=fgfg7gIyZScT1zjz5Y/8rS9hrcahI0i1dwAQf1aiZUg=; b=M2t5w4nSvQs00j1p7Z0sWtecY8WFpHQOirOONCsjP3BQab3n8WVLkH4b5JQymtvIFd GIiyGHhzM6g65jI92n8OidWLILOp23m/lkO3ElnPy54jH1Q8hk+VIhCacOYg1IHP0t3T iJCut4O8OirqmAmdKkyFR696FacDlXUJbOxj//hRLt1GqlIhgvr9P3w+uR4dVuWrMPvS OPUMlQS3cEfeOG21B100TTBTxRl2s/t1shl9NKkxzChQSzSD9jhKaJXsdszhPkXJrUbF uXn1rnKQYMTWSUtIvre0WFbZpWJ8MdtNuxQ/sBNtbboy0mqaIBrb0CZjtLy9qa/Pw14m nwwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=fgfg7gIyZScT1zjz5Y/8rS9hrcahI0i1dwAQf1aiZUg=; b=cUnI0ct0twMvpdXyckV69XJnFcDVAMHBMOyOU8+ObxXvyOc00dblz3piqOhANyOAjP wMKgi5zJGfYhY0j5NrZt7zCuAIoUBLknxRCseAmbfWnsL3pI6r5D11SS3b9bZJ6d6+8I 45+qSXpI7jII27nS1jP6tMrQ7remk/2s7hLOZCDm5nqoZxU9M8q9WrpcAwA7Wmgw2ZbQ Wwi/Bxc5jrfzVd81Hw3R0nWAEywTPKYn51VRWsRLmmioI0RBWRt+4KGjLas3a+KQneas biMbfruJt9KYs99TwEMPVgj8aoaHyCfJHi7KgZ/4b2VATkAbX2G9Q2l7BQQc93rjoHCc H4qw== X-Gm-Message-State: AIVw112WYJevVxweERpLlxA8b4A57Vj4z4+1qKfP8nVRA24EzAwViqe9 4J6Y+crDJcyhgLpb X-Received: by 10.84.241.207 with SMTP id t15mr2993832plm.343.1500531393739; Wed, 19 Jul 2017 23:16:33 -0700 (PDT) Received: from flat-canetoad.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id r3sm2769117pfk.139.2017.07.19.23.16.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Jul 2017 23:16:33 -0700 (PDT) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Thu, 20 Jul 2017 16:16:20 +1000 Message-Id: <20170720061620.2365-1-oohall@gmail.com> X-Mailer: git-send-email 2.9.4 Subject: [Skiboot] [PATCH] mem_region: Check for no-map in reserved nodes X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Regions with the no-map property should be handled seperately to "normal" firmware reservations. When creating mem_region regions from a reserved-memory DT node use the no-map property to select the right reservation type. Signed-off-by: Oliver O'Halloran --- core/mem_region.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/mem_region.c b/core/mem_region.c index 77324d715160..a09868599cec 100644 --- a/core/mem_region.c +++ b/core/mem_region.c @@ -975,6 +975,7 @@ static bool mem_region_parse_reserved_nodes(const char *path) dt_for_each_child(parent, node) { const struct dt_property *reg; struct mem_region *region; + int type; reg = dt_find_property(node, "reg"); if (!reg) { @@ -985,10 +986,15 @@ static bool mem_region_parse_reserved_nodes(const char *path) continue; } + if (dt_has_node_property(node, "no-map", NULL)) + type = REGION_RESERVED; + else + type = REGION_FW_RESERVED; + region = new_region(strdup(node->name), dt_get_number(reg->prop, 2), dt_get_number(reg->prop + sizeof(u64), 2), - node, REGION_FW_RESERVED); + node, type); add_region(region); }