From: zajec5@gmail.com (Rafał Miłecki)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: display machine model in cpuinfo
Date: Sun, 14 Dec 2014 15:13:07 +0100 [thread overview]
Message-ID: <1418566387-16468-1-git-send-email-zajec5@gmail.com> (raw)
This may be useful to display hardware model in the /proc/cpuinfo. It
definitely helps to identify the device and there are some archs already
doing that (arm64, m32r, mips).
Use the model from DT and add it to the cpuinfo.
Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
---
arch/arm/kernel/setup.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index c031063..957d9ac 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -145,6 +145,7 @@ EXPORT_SYMBOL(elf_platform);
static const char *cpu_name;
static const char *machine_name;
+static const char *hardware;
static char __initdata cmd_line[COMMAND_LINE_SIZE];
const struct machine_desc *machine_desc __initdata;
@@ -899,7 +900,8 @@ void __init setup_arch(char **cmdline_p)
if (!mdesc)
mdesc = setup_machine_tags(__atags_pointer, __machine_arch_type);
machine_desc = mdesc;
- machine_name = mdesc->name;
+ machine_name = of_flat_dt_get_machine_name();
+ hardware = mdesc->name;
if (mdesc->reboot_mode != REBOOT_HARD)
reboot_mode = mdesc->reboot_mode;
@@ -1077,7 +1079,8 @@ static int c_show(struct seq_file *m, void *v)
seq_printf(m, "CPU revision\t: %d\n\n", cpuid & 15);
}
- seq_printf(m, "Hardware\t: %s\n", machine_name);
+ seq_printf(m, "Machine\t\t: %s\n", machine_name);
+ seq_printf(m, "Hardware\t: %s\n", hardware);
seq_printf(m, "Revision\t: %04x\n", system_rev);
seq_printf(m, "Serial\t\t: %08x%08x\n",
system_serial_high, system_serial_low);
--
1.8.4.5
next reply other threads:[~2014-12-14 14:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-14 14:13 Rafał Miłecki [this message]
2014-12-15 10:45 ` [PATCH] ARM: display machine model in cpuinfo Mark Rutland
2014-12-15 10:50 ` Russell King - ARM Linux
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=1418566387-16468-1-git-send-email-zajec5@gmail.com \
--to=zajec5@gmail.com \
--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).