Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932948AbbLXTCt (ORCPT ); Thu, 24 Dec 2015 14:02:49 -0500 Received: from mail-wm0-f53.google.com ([74.125.82.53]:36302 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754761AbbLXTCq (ORCPT ); Thu, 24 Dec 2015 14:02:46 -0500 Date: Thu, 24 Dec 2015 20:02:37 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: Russell King , Laura Abbott , Grant Likely , Rob Herring , Will Deacon , Ivaylo Dimitrov , Sebastian Reichel , Pavel Machek , Tony Lindgren , Andreas =?utf-8?Q?F=C3=A4rber?= Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: Re: [PATCH 1/5] arm: devtree: Set system_rev from DT "/revision" Message-ID: <20151224190237.GA17343@pali> References: <1436214373-12969-1-git-send-email-pali.rohar@gmail.com> <1436214373-12969-2-git-send-email-pali.rohar@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1436214373-12969-2-git-send-email-pali.rohar@gmail.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2846 Lines: 85 On Monday 06 July 2015 22:26:09 Pali Rohár wrote: > With this patch "/revision" DT entry is used to set global system_rev > variable. DT "/revision" is expected to be u32 numeric value. > > TODO: add documentation > > Signed-off-by: Pali Rohár > --- > arch/arm/kernel/devtree.c | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c > index 11c54de..7d82749 100644 > --- a/arch/arm/kernel/devtree.c > +++ b/arch/arm/kernel/devtree.c > @@ -19,6 +19,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -26,6 +27,7 @@ > #include > #include > #include > +#include > > > #ifdef CONFIG_SMP > @@ -204,6 +206,8 @@ static const void * __init arch_get_next_mach(const char *const **match) > const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys) > { > const struct machine_desc *mdesc, *mdesc_best = NULL; > + unsigned long dt_root; > + const u32 *rev; > > #ifdef CONFIG_ARCH_MULTIPLATFORM > DT_MACHINE_START(GENERIC_DT, "Generic DT based system") > @@ -215,17 +219,16 @@ const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys) > if (!dt_phys || !early_init_dt_verify(phys_to_virt(dt_phys))) > return NULL; > > + dt_root = of_get_flat_dt_root(); > mdesc = of_flat_dt_match_machine(mdesc_best, arch_get_next_mach); > > if (!mdesc) { > const char *prop; > int size; > - unsigned long dt_root; > > early_print("\nError: unrecognized/unsupported " > "device tree compatible list:\n[ "); > > - dt_root = of_get_flat_dt_root(); > prop = of_get_flat_dt_prop(dt_root, "compatible", &size); > while (size > 0) { > early_print("'%s' ", prop); > @@ -246,5 +249,10 @@ const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys) > /* Change machine number to match the mdesc we're using */ > __machine_arch_type = mdesc->nr; > > + /* Set system revision from DT */ > + rev = of_get_flat_dt_prop(dt_root, "revision", NULL); > + if (rev) > + system_rev = fdt32_to_cpu(*rev); > + > return mdesc; > } This patch and second one (with subject "[PATCH 2/5] arm: boot: convert ATAG_REVISION to DT "/revision" entry") are still needed. Are there any objections for them? If not, I will add missing DT documentation and will resend them. -- Pali Rohár pali.rohar@gmail.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/