From patchwork Thu Aug 30 19:05:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 145582 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp256953ljw; Thu, 30 Aug 2018 12:05:29 -0700 (PDT) X-Google-Smtp-Source: ANB0VdanzaPzB9Rf0/o/v38m5gpLcfFmen8wwsR8wHiR3T/Tbg8ikCXMeimOmeNWe1dONehpOrTn X-Received: by 2002:a65:5b48:: with SMTP id y8-v6mr11110139pgr.125.1535655929214; Thu, 30 Aug 2018 12:05:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535655929; cv=none; d=google.com; s=arc-20160816; b=HcicEkKLU46LzVyOhTlZvp+CU7SDpM5QZhCldAuBz2xjoNvyPDQPdABImiikmhduHi zssTU7D9NliDuwJvEQQ6Q+njFqkwOWJZhU/v2yALDVGPb/ZsMXryLTaHRX+jqRCFqb5B jNy365xaZQWszMcDQumn6W48Nbf59T1j7+I7RpXyUSE6gMGcCglNV2IkMVpLd6PfubX5 /3KLah9QVH0ptQFa9oijkLpPKcGx9bTRwX0zkg4MUeVRX4Mt3TTYDVy8iGnOsYzpxElx sBMQ//WwmDP7q1TygEkY1xJQOjhJXy+DNmK0kb0TotO2wlD4QEi5+s4xqHv9av3oUjD8 XvAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=fBMJ862XEEIahgbuSdVZDN7DTE3GVasP4unDCjvFxdc=; b=DR2Vq4pVy+x7Xo42yplhiS5RcCOV4ClvUFKCYWgIuB+Qh9Jt7Nos/XasqvFcJ7Nmky DHOHKfitq2sKTEFTKpJ9TwrJiLO1BJnjkmFQD5S/Pf34je7Q2Za8bHSkBJF0OgaR2bf2 34fj7DRqKrzBBAjL09i0SVPAbo8IaWf2kIYDrR26sbydb45CjXWhQi5EfODgkahMH5Hn eLT8M+/169YolBFzAhC6uEhg5Cy2UQAxytcS3MVm8pGvtN6+n4bYxo0bnx+P/UwoIXc/ TJFilUxBjtSHtee4EXQoKugh0oKgwkGY5rLGgSdTAis8RwmC6zSzoIK9rjMVedmckbZE 066w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r16-v6si7397711pgg.254.2018.08.30.12.05.28; Thu, 30 Aug 2018 12:05:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727544AbeH3XJD (ORCPT + 32 others); Thu, 30 Aug 2018 19:09:03 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:39816 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727426AbeH3XJC (ORCPT ); Thu, 30 Aug 2018 19:09:02 -0400 Received: by mail-oi0-f66.google.com with SMTP id c190-v6so17378691oig.6; Thu, 30 Aug 2018 12:05:25 -0700 (PDT) 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:in-reply-to :references; bh=fBMJ862XEEIahgbuSdVZDN7DTE3GVasP4unDCjvFxdc=; b=KuPp9/ijSlclldTTh2zLqZwViGGXIkLzmMbqpj2hZywx7801NocSlNB7IaZhlMvy5R GV9y7u6t5dHU+u+/mq6kujDU4MtjtO89jDLM/+dSRuBFx70WWkQJmwYfSuubvZYPdBXC W0ilOhV8ZsJOutgZCKlbLWAZFGwlS5mrOvKZvyASnBK993KTpwjp/zCRWxpk8FTOyRbz MAfaYhKgyXFQ02yitTAuaOw6pf7p9s/u7+HQPd3kRxKGN1v9HuofJ519cis3Tvi5nGQV 9IXH6R++vA00vtCZkJeU4JoyMF1Uew/W1kRCOPOsrZQeCrPrJPhDuTyTDXuwfrAXZ+Xf JpfQ== X-Gm-Message-State: APzg51ChGGFSxnX7hAc+1CXO/tJlDV1FjzXYyf0s/+Td0BoNKfPfb55P ZzPANGRIy+9FnRdaYpw02LporK4= X-Received: by 2002:aca:c141:: with SMTP id r62-v6mr4048910oif.179.1535655925249; Thu, 30 Aug 2018 12:05:25 -0700 (PDT) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id 22-v6sm4200423oix.58.2018.08.30.12.05.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 12:05:24 -0700 (PDT) From: Rob Herring To: Frank Rowand , devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 1/3] of/fdt: Scan the root node properties earlier Date: Thu, 30 Aug 2018 14:05:21 -0500 Message-Id: <20180830190523.31474-2-robh@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180830190523.31474-1-robh@kernel.org> References: <20180830190523.31474-1-robh@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Scan the root node properties (#{size,address}-cells) earlier, so that the dt_root_addr_cells and dt_root_size_cells variables are initialized and can be used. Cc: Frank Rowand Signed-off-by: Rob Herring --- drivers/of/fdt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 800ad252cf9c..49abe18f1bde 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -1215,6 +1215,10 @@ bool __init early_init_dt_verify(void *params) initial_boot_params = params; of_fdt_crc32 = crc32_be(~0, initial_boot_params, fdt_totalsize(initial_boot_params)); + + /* Initialize {size,address}-cells info */ + of_scan_flat_dt(early_init_dt_scan_root, NULL); + return true; } @@ -1224,9 +1228,6 @@ void __init early_init_dt_scan_nodes(void) /* Retrieve various information from the /chosen node */ of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line); - /* Initialize {size,address}-cells info */ - of_scan_flat_dt(early_init_dt_scan_root, NULL); - /* Setup memory, calling early_init_dt_add_memory_arch */ of_scan_flat_dt(early_init_dt_scan_memory, NULL); } From patchwork Thu Aug 30 19:05:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 145584 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp257101ljw; Thu, 30 Aug 2018 12:05:37 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbYBKavKsstMwdzhYZuiwSud+Gz2dZEta4UfNcNqD+LL9iXtTnZxDYo2a5ESjvw7yJ3e1DL X-Received: by 2002:a62:1391:: with SMTP id 17-v6mr11709292pft.34.1535655937261; Thu, 30 Aug 2018 12:05:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535655937; cv=none; d=google.com; s=arc-20160816; b=E350aIRZxFeKbExLGbG2bxQYT0lHXrEVc18olyIDsA1YeCFtGOoz5mZiaQ2GEGG8iq d4fHGBJQVMTcjs+RMmhqIHzrjnQlIS3upGgusSdRHmcwvJ+u3rqN7/Kep/auHxeMLCGW XDB12/n+GhqUyP9h9Z4rGQkjh6TSUESHC4RwgNlApR3eVJ9FD3+vZVJhisJfA1h33pIm IVZrunZD8GeAN88SpVjUSc1dzL65MzUtGeob2sAWaUYLOZUTzAF67rP8svsB+lWGCGP+ iNQGPIjdmQxDPimoKASIIcxYmh8x80nF5C2Ix9ObVc9BvTFWVbYUBOp8KqOA+7vTEFe1 JuSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=gT6Td7yY5tXHBprHnqiX0q1IaJ6j1fqehgRBLMkuZ2g=; b=Csnzx3WyJz8TPRyl9BNtRB96WXnmKXZs3RysbrFSJB7DJBv6xB1NDwdCzKdJ10Sv+6 o8g2o3byPo/9sZcGFlzmYeXviboVKhj+Ez4SDlB+v3ptHzl6GWGdZdZkgirdTY2JH3kd BP8CJNZtGbmjDg5HR1M8F3OLFAy7dvJAhm/Zea20W+oe/0hYaVLxpx/tpaKUE9+WeMNe rQan00BXF/beurDoqplNqNBqo67PA3p8KqufMmSBOm0bbAkf08CDq1GNB3hWja5YAFz5 LZHQwQzb7UmkUlhEfJSBTg2F3SS/fATbSXYW7QrzqxfCYllQP7Krh8/T3UrOTtien4S5 VhFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v84-v6si7560212pfd.71.2018.08.30.12.05.36; Thu, 30 Aug 2018 12:05:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727618AbeH3XJM (ORCPT + 32 others); Thu, 30 Aug 2018 19:09:12 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:33554 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727555AbeH3XJE (ORCPT ); Thu, 30 Aug 2018 19:09:04 -0400 Received: by mail-oi0-f68.google.com with SMTP id 8-v6so17426828oip.0; Thu, 30 Aug 2018 12:05:27 -0700 (PDT) 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:in-reply-to :references; bh=gT6Td7yY5tXHBprHnqiX0q1IaJ6j1fqehgRBLMkuZ2g=; b=N1Gzo9X7auVZ58M84Rar/dWKNQDFUj26T+a9PnrGmpQOEvFBcOqYL4/9l0Xvxyrdeh c9m/QIFDAYK8mAo360Swdg+ZVHBTjP0Tc/wBQ/hzk4j7KCNoSKyy6mKC/XTMnIC9ZcJd kjc54O9otaHr6hGLjyW+9XIFBE/ioIQHwLmooj+B6ppgqeoB6aym1BHutGRlKv10rT0t 6s2uR8t3FealiNfEQaVZu7yF7qG/yFhZuuuHnZjjvW/odnxQhryxcQP5XWza4vCBxV+f xwo3yNzTu456GanTVJHP3Vaeh0pYWbJaij1njbnaKcbY27ZqLtehpp3+wk55BgZ0vs4+ LPvw== X-Gm-Message-State: APzg51CmI+2i7fOTe5GlQu3Bh8GCIdz0VCxJzsKM4yJwru8SVECeBMmk oBevbyHf5HjTCPpc+riG9w== X-Received: by 2002:aca:f58f:: with SMTP id t137-v6mr3767451oih.244.1535655927378; Thu, 30 Aug 2018 12:05:27 -0700 (PDT) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id 22-v6sm4200423oix.58.2018.08.30.12.05.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 12:05:26 -0700 (PDT) From: Rob Herring To: Frank Rowand , devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "David S. Miller" , sparclinux@vger.kernel.org Subject: [PATCH 3/3] of: make default address and size cells sizes private Date: Thu, 30 Aug 2018 14:05:23 -0500 Message-Id: <20180830190523.31474-4-robh@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180830190523.31474-1-robh@kernel.org> References: <20180830190523.31474-1-robh@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Only some old OpenFirmware implementations rely on default sizes. Any FDT and modern implementation should have explicit properties. Make the OF_ROOT_NODE_*_CELLS_DEFAULT defines private so we don't get any outside users. This also gets us one step closer to removing the asm/prom.h dependency on Sparc. Cc: "David S. Miller" Cc: Frank Rowand Cc: sparclinux@vger.kernel.org Signed-off-by: Rob Herring --- arch/sparc/include/asm/prom.h | 3 --- drivers/of/of_private.h | 8 ++++++++ include/linux/of.h | 6 ------ 3 files changed, 8 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/arch/sparc/include/asm/prom.h b/arch/sparc/include/asm/prom.h index d955c8df62d6..1902db27ff4b 100644 --- a/arch/sparc/include/asm/prom.h +++ b/arch/sparc/include/asm/prom.h @@ -24,9 +24,6 @@ #include #include -#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 2 -#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1 - #define of_compat_cmp(s1, s2, l) strncmp((s1), (s2), (l)) #define of_prop_cmp(s1, s2) strcasecmp((s1), (s2)) #define of_node_cmp(s1, s2) strcmp((s1), (s2)) diff --git a/drivers/of/of_private.h b/drivers/of/of_private.h index 216175d11d3d..5d1567025358 100644 --- a/drivers/of/of_private.h +++ b/drivers/of/of_private.h @@ -27,6 +27,14 @@ struct alias_prop { char stem[0]; }; +#if defined(CONFIG_SPARC) +#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 2 +#else +#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1 +#endif + +#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1 + extern struct mutex of_mutex; extern struct list_head aliases_lookup; extern struct kset *of_kset; diff --git a/include/linux/of.h b/include/linux/of.h index 506beca9588d..49d85f670c75 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -247,12 +247,6 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size) #include #endif -/* Default #address and #size cells. Allow arch asm/prom.h to override */ -#if !defined(OF_ROOT_NODE_ADDR_CELLS_DEFAULT) -#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1 -#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1 -#endif - #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)