From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
To: Linux PPC Development <linuxppc-dev@lists.ozlabs.org>
Cc: Paul Mackerras <paulus@samba.org>
Subject: [PATCH 09/14] 85xx/sbc8548: read hardware revision when it's required for first time
Date: Tue, 19 Jul 2011 12:53:46 +0400 [thread overview]
Message-ID: <1311065631-3429-10-git-send-email-dbaryshkov@gmail.com> (raw)
In-Reply-To: <1311065631-3429-1-git-send-email-dbaryshkov@gmail.com>
Currently sbc8548 reads hardware revision during bootup. To simplify
things read it when it's first required when the kernel is up and
running.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/platforms/85xx/sbc8548.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/sbc8548.c b/arch/powerpc/platforms/85xx/sbc8548.c
index ecdd8c0..2eeb376 100644
--- a/arch/powerpc/platforms/85xx/sbc8548.c
+++ b/arch/powerpc/platforms/85xx/sbc8548.c
@@ -49,7 +49,7 @@
#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
-static int sbc_rev;
+static int sbc_rev = -EINVAL;
static void __init sbc8548_pic_init(void)
{
@@ -82,7 +82,7 @@ static void __init sbc8548_pic_init(void)
}
/* Extract the HW Rev from the EPLD on the board */
-static int __init sbc8548_hw_rev(void)
+static int sbc8548_hw_rev(void)
{
struct device_node *np;
struct resource res;
@@ -130,7 +130,6 @@ static void __init sbc8548_setup_arch(void)
}
}
#endif
- sbc_rev = sbc8548_hw_rev();
}
static void sbc8548_show_cpuinfo(struct seq_file *m)
@@ -140,6 +139,9 @@ static void sbc8548_show_cpuinfo(struct seq_file *m)
pvid = mfspr(SPRN_PVR);
svid = mfspr(SPRN_SVR);
+ if (sbc_rev == -EINVAL)
+ sbc_rev = sbc8548_hw_rev();
+
seq_printf(m, "Vendor\t\t: Wind River\n");
seq_printf(m, "Machine\t\t: SBC8548 v%d\n", sbc_rev);
seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
--
1.7.2.5
next prev parent reply other threads:[~2011-07-19 8:55 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-19 8:53 [PATCH 00/14] Consolidation of 83xx/85xx board files Dmitry Eremin-Solenikov
2011-07-19 8:53 ` [PATCH 01/14] 83xx: consolidate init_IRQ functions Dmitry Eremin-Solenikov
2011-07-19 14:21 ` Kumar Gala
2011-07-19 8:53 ` [PATCH 02/14] 83xx: consolidate of_platform_bus_probe calls Dmitry Eremin-Solenikov
2011-07-19 8:53 ` [PATCH 03/14] mpc8349emitx: mark localbus as compatible with simple-bus Dmitry Eremin-Solenikov
2011-07-19 14:23 ` Kumar Gala
2011-07-19 8:53 ` [PATCH 04/14] 83xx/mpc834x_itx: drop pq2pro-localbus-specific code Dmitry Eremin-Solenikov
2011-07-19 16:55 ` Scott Wood
2011-07-22 19:41 ` Dmitry Eremin-Solenikov
2011-07-19 8:53 ` [PATCH 05/14] 83xx: headers cleanup Dmitry Eremin-Solenikov
2011-07-19 8:53 ` [PATCH 06/14] 85xx/sbc8560: correct compilation if CONFIG_PHYS_ADDR_T_64BIT is set Dmitry Eremin-Solenikov
2011-07-19 14:18 ` Kumar Gala
2011-07-19 8:53 ` [PATCH 07/14] 85xx/ksi8560: declare that localbus is compatbile with simple-bus Dmitry Eremin-Solenikov
2011-07-19 14:19 ` Kumar Gala
2011-07-19 8:53 ` [PATCH 08/14] 85xx/sbc8560: " Dmitry Eremin-Solenikov
2011-07-19 14:19 ` Kumar Gala
2011-07-22 1:53 ` Paul Gortmaker
2011-07-19 8:53 ` Dmitry Eremin-Solenikov [this message]
2011-07-19 14:12 ` [PATCH 09/14] 85xx/sbc8548: read hardware revision when it's required for first time Kumar Gala
2011-07-22 1:59 ` Paul Gortmaker
2011-07-19 8:53 ` [PATCH 10/14] 85xx/mpc85xx_rdb: merge p1020_rdb and p2020_rdb machine entries Dmitry Eremin-Solenikov
2011-07-19 14:00 ` Kumar Gala
2011-07-22 19:47 ` Dmitry Eremin-Solenikov
2011-07-22 20:11 ` Dmitry Eremin-Solenikov
2011-07-19 8:53 ` [PATCH 11/14] 85xx: merge 32-bit QorIQ with DPA boards support Dmitry Eremin-Solenikov
2011-07-19 14:12 ` Kumar Gala
2011-07-19 8:53 ` [PATCH 12/14] 85xx/mpc85xx_ds, ads, cds: move .pci_exclude_device setting to machine definitions Dmitry Eremin-Solenikov
2011-07-19 13:59 ` Kumar Gala
2011-07-22 20:08 ` [PATCH 12/14] 85xx/mpc85xx_ds,ads,cds: " Dmitry Eremin-Solenikov
2011-07-19 8:53 ` [PATCH 13/14] 85xx: consolidate of_platform_bus_probe calls Dmitry Eremin-Solenikov
2011-07-19 14:15 ` Kumar Gala
2011-07-19 17:54 ` Scott Wood
2011-07-22 19:44 ` Dmitry Eremin-Solenikov
2011-07-22 20:29 ` Scott Wood
2011-07-22 21:45 ` Dmitry Eremin-Solenikov
2011-07-25 15:40 ` Scott Wood
2011-07-19 8:53 ` [PATCH 14/14] 85xx: separate cpm2 pic init Dmitry Eremin-Solenikov
2011-07-19 14:18 ` Kumar Gala
2011-07-19 14:20 ` [PATCH 00/14] Consolidation of 83xx/85xx board files Kumar Gala
2011-07-19 14:29 ` Kumar Gala
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=1311065631-3429-10-git-send-email-dbaryshkov@gmail.com \
--to=dbaryshkov@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.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).