Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1381910
| From | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] mips: pistachio: Determine SoC revision during boot |
| Date | 2016-04-18 19:00 +0200 |
| Message-ID | <rpkGK-q2-3@gated-at.bofh.it> (permalink) |
| References | <rpilz-75e-11@gated-at.bofh.it> |
| Organization | Cogent Embedded |
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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] mips: pistachio: Determine SoC revision during boot James Hartley <james.hartley@imgtec.com> - 2016-04-18 16:30 +0200
Re: [PATCH] mips: pistachio: Determine SoC revision during boot Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-04-18 19:00 +0200
Re: [PATCH] mips: pistachio: Determine SoC revision during boot James Hartley <james.hartley@imgtec.com> - 2016-04-19 12:30 +0200
csiph-web