summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/86xx/gef_sbc610.c
diff options
context:
space:
mode:
authorMartyn Welch <martyn.welch@gefanuc.com>2008-10-13 16:16:45 +0100
committerKumar Gala <galak@kernel.crashing.org>2008-10-13 11:10:00 -0500
commit6675847ea42d5acfaa644ac24eb0d87df5769cd5 (patch)
treedfbcd3b2e541f10d656ad27b7d19149d50bff016 /arch/powerpc/platforms/86xx/gef_sbc610.c
parentd6c3db83c5567b3a4d8d0bf33dc5687abdf65274 (diff)
downloadblackbird-op-linux-6675847ea42d5acfaa644ac24eb0d87df5769cd5.tar.gz
blackbird-op-linux-6675847ea42d5acfaa644ac24eb0d87df5769cd5.zip
powerpc: FPGA support for GE Fanuc SBC610
Support for the SBC610 VPX Single Board Computer from GE Fanuc (PowerPC MPC8641D). This patch adds support for the registers held in the devices main FPGA, exposing extra information about the revision of the board through cpuinfo. Signed-off-by: Martyn Welch <martyn.welch@gefanuc.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/86xx/gef_sbc610.c')
-rw-r--r--arch/powerpc/platforms/86xx/gef_sbc610.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/86xx/gef_sbc610.c b/arch/powerpc/platforms/86xx/gef_sbc610.c
index 3873c2018cc3..821c45fac18b 100644
--- a/arch/powerpc/platforms/86xx/gef_sbc610.c
+++ b/arch/powerpc/platforms/86xx/gef_sbc610.c
@@ -73,6 +73,7 @@ static void __init gef_sbc610_init_irq(void)
static void __init gef_sbc610_setup_arch(void)
{
+ struct device_node *regs;
#ifdef CONFIG_PCI
struct device_node *np;
@@ -86,8 +87,43 @@ static void __init gef_sbc610_setup_arch(void)
#ifdef CONFIG_SMP
mpc86xx_smp_init();
#endif
+
+ /* Remap basic board registers */
+ regs = of_find_compatible_node(NULL, NULL, "gef,fpga-regs");
+ if (regs) {
+ sbc610_regs = of_iomap(regs, 0);
+ if (sbc610_regs == NULL)
+ printk(KERN_WARNING "Unable to map board registers\n");
+ of_node_put(regs);
+ }
+}
+
+/* Return the PCB revision */
+static unsigned int gef_sbc610_get_pcb_rev(void)
+{
+ unsigned int reg;
+
+ reg = ioread32(sbc610_regs);
+ return (reg >> 8) & 0xff;
+}
+
+/* Return the board (software) revision */
+static unsigned int gef_sbc610_get_board_rev(void)
+{
+ unsigned int reg;
+
+ reg = ioread32(sbc610_regs);
+ return (reg >> 16) & 0xff;
}
+/* Return the FPGA revision */
+static unsigned int gef_sbc610_get_fpga_rev(void)
+{
+ unsigned int reg;
+
+ reg = ioread32(sbc610_regs);
+ return (reg >> 24) & 0xf;
+}
static void gef_sbc610_show_cpuinfo(struct seq_file *m)
{
@@ -96,6 +132,10 @@ static void gef_sbc610_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_sbc610_get_pcb_rev(),
+ ('A' + gef_sbc610_get_board_rev() - 1));
+ seq_printf(m, "FPGA Revision\t: %u\n", gef_sbc610_get_fpga_rev());
+
seq_printf(m, "SVR\t\t: 0x%x\n", svid);
seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
}
OpenPOWER on IntegriCloud