[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54C6C0FA.10401@suse.de>
Date: Mon, 26 Jan 2015 23:34:34 +0100
From: Andreas Färber <afaerber@...e.de>
To: Pali Rohár <pali.rohar@...il.com>
CC: Rob Herring <robherring2@...il.com>,
Ivaylo Dimitrov <ivo.g.dimitrov.75@...il.com>,
Russell King <linux@....linux.org.uk>,
Tony Lindgren <tony@...mide.com>,
Sebastian Reichel <sre@...ian.org>,
Will Deacon <will.deacon@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Pavel Machek <pavel@....cz>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH] ARM: /proc/cpuinfo: DT: Add support for Revision
Am 26.01.2015 um 20:09 schrieb Pali Rohár:
> diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
> index 11c54de..9946c1b 100644
> --- a/arch/arm/kernel/devtree.c
> +++ b/arch/arm/kernel/devtree.c
[...]
> @@ -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 *prop;
>
> #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;
Probably the use of two differently typed variables of name "prop" in
this function is not intentional?
Regards,
Andreas
> 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 */
> + prop = of_get_flat_dt_prop(dt_root, "revision", NULL);
> + if (prop)
> + system_rev = fdt32_to_cpu(*prop);
> +
> return mdesc;
> }
[snip]
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu,
Graham Norton; HRB 21284 (AG Nürnberg)
Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)
Powered by blists - more mailing lists