* [PATCH] powerpc/86xx: Correct reading of information presented in cpuinfo
@ 2009-06-30 14:32 Martyn Welch
2009-08-07 2:44 ` Kumar Gala
0 siblings, 1 reply; 2+ messages in thread
From: Martyn Welch @ 2009-06-30 14:32 UTC (permalink / raw)
To: galak; +Cc: linuxppc-dev
/proc/cpuinfo should be showing the boards revision and the revision of the FPGA fitted. The functions currently used to access this information as incorrect.
Additionally the VME geographical address of the PPC9A and it's status as system contoller are available in the board registers. Show these in cpuinfo.
Signed-off-by: Martyn Welch <martyn.welch@gefanuc.com>
---
arch/powerpc/platforms/86xx/gef_ppc9a.c | 37 +++++++++++++++++++++++++------
1 files changed, 30 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/platforms/86xx/gef_ppc9a.c b/arch/powerpc/platforms/86xx/gef_ppc9a.c
index 2efa052..287f7bd 100644
--- a/arch/powerpc/platforms/86xx/gef_ppc9a.c
+++ b/arch/powerpc/platforms/86xx/gef_ppc9a.c
@@ -102,8 +102,8 @@ static unsigned int gef_ppc9a_get_pcb_rev(void)
{
unsigned int reg;
- reg = ioread32(ppc9a_regs);
- return (reg >> 8) & 0xff;
+ reg = ioread32be(ppc9a_regs);
+ return (reg >> 16) & 0xff;
}
/* Return the board (software) revision */
@@ -111,8 +111,8 @@ static unsigned int gef_ppc9a_get_board_rev(void)
{
unsigned int reg;
- reg = ioread32(ppc9a_regs);
- return (reg >> 16) & 0xff;
+ reg = ioread32be(ppc9a_regs);
+ return (reg >> 8) & 0xff;
}
/* Return the FPGA revision */
@@ -120,8 +120,26 @@ static unsigned int gef_ppc9a_get_fpga_rev(void)
{
unsigned int reg;
- reg = ioread32(ppc9a_regs);
- return (reg >> 24) & 0xf;
+ reg = ioread32be(ppc9a_regs);
+ return reg & 0xf;
+}
+
+/* Return VME Geographical Address */
+static unsigned int gef_ppc9a_get_vme_geo_addr(void)
+{
+ unsigned int reg;
+
+ reg = ioread32be(ppc9a_regs + 0x4);
+ return reg & 0x1f;
+}
+
+/* Return VME System Controller Status */
+static unsigned int gef_ppc9a_get_vme_is_syscon(void)
+{
+ unsigned int reg;
+
+ reg = ioread32be(ppc9a_regs + 0x4);
+ return (reg >> 9) & 0x1;
}
static void gef_ppc9a_show_cpuinfo(struct seq_file *m)
@@ -131,10 +149,15 @@ static void gef_ppc9a_show_cpuinfo(struct seq_file *m)
seq_printf(m, "Vendor\t\t: GE Fanuc Intelligent Platforms\n");
seq_printf(m, "Revision\t: %u%c\n", gef_ppc9a_get_pcb_rev(),
- ('A' + gef_ppc9a_get_board_rev() - 1));
+ ('A' + gef_ppc9a_get_board_rev()));
seq_printf(m, "FPGA Revision\t: %u\n", gef_ppc9a_get_fpga_rev());
seq_printf(m, "SVR\t\t: 0x%x\n", svid);
+
+ seq_printf(m, "VME geo. addr\t: %u\n", gef_ppc9a_get_vme_geo_addr());
+
+ seq_printf(m, "VME syscon\t: %s\n",
+ gef_ppc9a_get_vme_is_syscon() ? "yes" : "no");
}
static void __init gef_ppc9a_nec_fixup(struct pci_dev *pdev)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] powerpc/86xx: Correct reading of information presented in cpuinfo
2009-06-30 14:32 [PATCH] powerpc/86xx: Correct reading of information presented in cpuinfo Martyn Welch
@ 2009-08-07 2:44 ` Kumar Gala
0 siblings, 0 replies; 2+ messages in thread
From: Kumar Gala @ 2009-08-07 2:44 UTC (permalink / raw)
To: Martyn Welch; +Cc: linuxppc-dev
On Jun 30, 2009, at 9:32 AM, Martyn Welch wrote:
> /proc/cpuinfo should be showing the boards revision and the revision
> of the FPGA fitted. The functions currently used to access this
> information as incorrect.
>
> Additionally the VME geographical address of the PPC9A and it's
> status as system contoller are available in the board registers.
> Show these in cpuinfo.
>
> Signed-off-by: Martyn Welch <martyn.welch@gefanuc.com>
> ---
>
> arch/powerpc/platforms/86xx/gef_ppc9a.c | 37 ++++++++++++++++++++++
> +++------
> 1 files changed, 30 insertions(+), 7 deletions(-)
applied to next.
(Fixed the comment formatting to wrap properly)
- k
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-08-07 2:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-30 14:32 [PATCH] powerpc/86xx: Correct reading of information presented in cpuinfo Martyn Welch
2009-08-07 2:44 ` Kumar Gala
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).