From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: James Hartley <james.hartley@imgtec.com>,
Ralf Baechle <ralf@linux-mips.org>,
Andrew Bresticker <abrestic@chromium.org>,
Jonas Gorski <jogo@openwrt.org>,
James Hogan <james.hogan@imgtec.com>
Cc: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org,
Ionela Voinescu <ionela.voinescu@imgtec.com>
Subject: Re: [PATCH] mips: pistachio: Determine SoC revision during boot
Date: Mon, 18 Apr 2016 19:59:12 +0300 [thread overview]
Message-ID: <57151260.1060300@cogentembedded.com> (raw)
In-Reply-To: <1460989489-30469-1-git-send-email-james.hartley@imgtec.com>
Hello.
On 04/18/2016 05:24 PM, James Hartley wrote:
> Now that there are different revisions of the Pistachio SoC
> in circulation, add this information to the boot log to make
> it easier for users to determine which hardware they have.
>
> Signed-off-by: James Hartley <james.hartley@imgtec.com>
> Signed-off-by: Ionela Voinescu <ionela.voinescu@imgtec.com>
>
> diff --git a/arch/mips/pistachio/init.c b/arch/mips/pistachio/init.c
> index 96ba2cc..48f8755 100644
> --- a/arch/mips/pistachio/init.c
> +++ b/arch/mips/pistachio/init.c
[...]
> @@ -24,9 +26,28 @@
> #include <asm/smp-ops.h>
> #include <asm/traps.h>
>
> +/*
> + * Core revision register decoding
> + * Bits 23 to 20: Major rev
> + * Bits 15 to 8: Minor rev
> + * Bits 7 to 0: Maintenance rev
> + */
> +#define PISTACHIO_CORE_REV_REG 0xB81483D0
> +#define PISTACHIO_CORE_REV_A1 0x00100006
> +#define PISTACHIO_CORE_REV_B0 0x00100106
> +
> const char *get_system_type(void)
> {
> - return "IMG Pistachio SoC";
> + u32 core_rev;
> +
> + core_rev = __raw_readl((const void *)PISTACHIO_CORE_REV_REG);
> +
> + if (core_rev == PISTACHIO_CORE_REV_B0)
> + return "IMG Pistachio SoC (B0)";
> + else if (core_rev == PISTACHIO_CORE_REV_A1)
> + return "IMG_Pistachio SoC (A1)";
> + else
> + return "IMG_Pistachio SoC";
How about the *switch* instead?
[...]
MBR, Sergei
next prev parent reply other threads:[~2016-04-18 16:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-18 14:24 [PATCH] mips: pistachio: Determine SoC revision during boot James Hartley
2016-04-18 16:59 ` Sergei Shtylyov [this message]
2016-04-19 10:27 ` James Hartley
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=57151260.1060300@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=abrestic@chromium.org \
--cc=ionela.voinescu@imgtec.com \
--cc=james.hartley@imgtec.com \
--cc=james.hogan@imgtec.com \
--cc=jogo@openwrt.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.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