aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartyn Welch <martyn.welch@gefanuc.com>2008-10-13 11:16:45 -0400
committerKumar Gala <galak@kernel.crashing.org>2008-10-13 12:10:00 -0400
commit6675847ea42d5acfaa644ac24eb0d87df5769cd5 (patch)
treedfbcd3b2e541f10d656ad27b7d19149d50bff016
parentd6c3db83c5567b3a4d8d0bf33dc5687abdf65274 (diff)
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>
-rw-r--r--arch/powerpc/boot/dts/gef_sbc610.dts4
-rw-r--r--arch/powerpc/platforms/86xx/gef_sbc610.c40
2 files changed, 44 insertions, 0 deletions
diff --git a/arch/powerpc/boot/dts/gef_sbc610.dts b/arch/powerpc/boot/dts/gef_sbc610.dts
index 771a776d610..6ed608322dd 100644
--- a/arch/powerpc/boot/dts/gef_sbc610.dts
+++ b/arch/powerpc/boot/dts/gef_sbc610.dts
@@ -84,6 +84,10 @@
84 6 0 0xfd000000 0x00800000 // IO FPGA (8-bit) 84 6 0 0xfd000000 0x00800000 // IO FPGA (8-bit)
85 7 0 0xfd800000 0x00800000>; // IO FPGA (32-bit) 85 7 0 0xfd800000 0x00800000>; // IO FPGA (32-bit)
86 86
87 fpga@4,0 {
88 compatible = "gef,fpga-regs";
89 reg = <0x4 0x0 0x40>;
90 };
87 gef_pic: pic@4,4000 { 91 gef_pic: pic@4,4000 {
88 #interrupt-cells = <1>; 92 #interrupt-cells = <1>;
89 interrupt-controller; 93 interrupt-controller;
diff --git a/arch/powerpc/platforms/86xx/gef_sbc610.c b/arch/powerpc/platforms/86xx/gef_sbc610.c
index 3873c2018cc..821c45fac18 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)
73 73
74static void __init gef_sbc610_setup_arch(void) 74static void __init gef_sbc610_setup_arch(void)
75{ 75{
76 struct device_node *regs;
76#ifdef CONFIG_PCI 77#ifdef CONFIG_PCI
77 struct device_node *np; 78 struct device_node *np;
78 79
@@ -86,8 +87,43 @@ static void __init gef_sbc610_setup_arch(void)
86#ifdef CONFIG_SMP 87#ifdef CONFIG_SMP
87 mpc86xx_smp_init(); 88 mpc86xx_smp_init();
88#endif 89#endif
90
91 /* Remap basic board registers */
92 regs = of_find_compatible_node(NULL, NULL, "gef,fpga-regs");
93 if (regs) {
94 sbc610_regs = of_iomap(regs, 0);
95 if (sbc610_regs == NULL)
96 printk(KERN_WARNING "Unable to map board registers\n");
97 of_node_put(regs);
98 }
99}
100
101/* Return the PCB revision */
102static unsigned int gef_sbc610_get_pcb_rev(void)
103{
104 unsigned int reg;
105
106 reg = ioread32(sbc610_regs);
107 return (reg >> 8) & 0xff;
108}
109
110/* Return the board (software) revision */
111static unsigned int gef_sbc610_get_board_rev(void)
112{
113 unsigned int reg;
114
115 reg = ioread32(sbc610_regs);
116 return (reg >> 16) & 0xff;
89} 117}
90 118
119/* Return the FPGA revision */
120static unsigned int gef_sbc610_get_fpga_rev(void)
121{
122 unsigned int reg;
123
124 reg = ioread32(sbc610_regs);
125 return (reg >> 24) & 0xf;
126}
91 127
92static void gef_sbc610_show_cpuinfo(struct seq_file *m) 128static void gef_sbc610_show_cpuinfo(struct seq_file *m)
93{ 129{
@@ -96,6 +132,10 @@ static void gef_sbc610_show_cpuinfo(struct seq_file *m)
96 132
97 seq_printf(m, "Vendor\t\t: GE Fanuc Intelligent Platforms\n"); 133 seq_printf(m, "Vendor\t\t: GE Fanuc Intelligent Platforms\n");
98 134
135 seq_printf(m, "Revision\t: %u%c\n", gef_sbc610_get_pcb_rev(),
136 ('A' + gef_sbc610_get_board_rev() - 1));
137 seq_printf(m, "FPGA Revision\t: %u\n", gef_sbc610_get_fpga_rev());
138
99 seq_printf(m, "SVR\t\t: 0x%x\n", svid); 139 seq_printf(m, "SVR\t\t: 0x%x\n", svid);
100 seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024)); 140 seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
101} 141}