linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: dt: Use the 'model' field for printing the hardware revision
Date: Tue, 28 May 2013 14:15:07 +0200	[thread overview]
Message-ID: <20130528121506.GL11166@pengutronix.de> (raw)
In-Reply-To: <1369742670-16305-1-git-send-email-fabio.estevam@freescale.com>

On Tue, May 28, 2013 at 09:04:30AM -0300, Fabio Estevam wrote:
> When booting a device tree kernel, we get the following output from 
> 'cat /proc/cpuinfo': 
> 
> $ cat /proc/cpuinfo 
> processor       : 0
> model name      : ARMv7 Processor rev 5 (v7l)
> BogoMIPS        : 531.66
> Features        : swp half thumb fastmult vfp edsp neon vfpv3 tls 
> CPU implementer : 0x41
> CPU architecture: 7
> CPU variant     : 0x2
> CPU part        : 0xc08
> CPU revision    : 5
> 
> Hardware        : Freescale i.MX51 (Device Tree Support)
> Revision        : 0000
> Serial          : 0000000000000000
> 
> The Hardware line does not really describe the hardware type, as it is reading
> the information from the dt 'machine' field.
> 
> In the dt case, read the 'model' field instead, so that we can have a better
> description output as follows:
> 
> Hardware        : Freescale i.MX51 Babbage Board
> 
> The hardware output string is unchanged for the non-dt kernel case.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  arch/arm/include/asm/mach/arch.h |  1 +
>  arch/arm/kernel/devtree.c        | 15 ++++++++-------
>  arch/arm/kernel/setup.c          |  7 ++++++-
>  3 files changed, 15 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
> index 308ad7d..113d4af 100644
> --- a/arch/arm/include/asm/mach/arch.h
> +++ b/arch/arm/include/asm/mach/arch.h
> @@ -23,6 +23,7 @@ struct smp_operations;
>  struct machine_desc {
>  	unsigned int		nr;		/* architecture number	*/
>  	const char		*name;		/* architecture name	*/
> +	const char		*model;		/* architectute model */
s/architectute/architecture/

Is it really needed to add a new field here? Alternatively overwrite
name or do something like:

	if (this_is_a_device_tree_machine)
		seq_printf(m, "Hardware\t: %s\n", get_model_from_dt());
	else
		seq_printf(m, "Hardware\t: %s\n", machine_name);
		
Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

  reply	other threads:[~2013-05-28 12:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-28 12:04 [PATCH] ARM: dt: Use the 'model' field for printing the hardware revision Fabio Estevam
2013-05-28 12:15 ` Uwe Kleine-König [this message]
2013-05-28 12:57   ` Fabio Estevam
2013-05-28 13:01     ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-28 13:08       ` Fabio Estevam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130528121506.GL11166@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).