linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: FPGA support for GE Fanuc SBC610
@ 2008-10-01 12:46 Martyn Welch
  2008-10-03 21:57 ` Kumar Gala
  0 siblings, 1 reply; 3+ messages in thread
From: Martyn Welch @ 2008-10-01 12:46 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: paulus

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>
---

 arch/powerpc/boot/dts/gef_sbc610.dts     |    4 +++
 arch/powerpc/platforms/86xx/gef_sbc610.c |   38 ++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/dts/gef_sbc610.dts b/arch/powerpc/boot/dts/gef_sbc610.dts
index 771a776..6ed6083 100644
--- a/arch/powerpc/boot/dts/gef_sbc610.dts
+++ b/arch/powerpc/boot/dts/gef_sbc610.dts
@@ -84,6 +84,10 @@
 			  6 0 0xfd000000 0x00800000     // IO FPGA (8-bit)
 			  7 0 0xfd800000 0x00800000>;   // IO FPGA (32-bit)
 
+		fpga@4,0 {
+			compatible = "gef,fpga-regs";
+			reg = <0x4 0x0 0x40>;
+		};
 		gef_pic: pic@4,4000 {
 			#interrupt-cells = <1>;
 			interrupt-controller;
diff --git a/arch/powerpc/platforms/86xx/gef_sbc610.c b/arch/powerpc/platforms/86xx/gef_sbc610.c
index 6bc63a9..9b2ade8 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,42 @@ 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");
+	}
 }
 
+/* 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)
 {
@@ -103,6 +138,9 @@ static void gef_sbc610_show_cpuinfo(struct seq_file *m)
 		model = of_get_property(root, "model", NULL);
 	seq_printf(m, "Machine\t\t: %s\n", model);
 	of_node_put(root);
+	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));

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc: FPGA support for GE Fanuc SBC610
  2008-10-01 12:46 [PATCH] powerpc: FPGA support for GE Fanuc SBC610 Martyn Welch
@ 2008-10-03 21:57 ` Kumar Gala
  2008-10-10 13:27   ` Kumar Gala
  0 siblings, 1 reply; 3+ messages in thread
From: Kumar Gala @ 2008-10-03 21:57 UTC (permalink / raw)
  To: Martyn Welch; +Cc: linuxppc-dev, paulus


On Oct 1, 2008, at 7:46 AM, Martyn Welch wrote:

> 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>
> ---

this doesn't apply for me.

- k

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc: FPGA support for GE Fanuc SBC610
  2008-10-03 21:57 ` Kumar Gala
@ 2008-10-10 13:27   ` Kumar Gala
  0 siblings, 0 replies; 3+ messages in thread
From: Kumar Gala @ 2008-10-10 13:27 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, Martyn Welch, paulus


On Oct 3, 2008, at 4:57 PM, Kumar Gala wrote:

>
> On Oct 1, 2008, at 7:46 AM, Martyn Welch wrote:
>
>> 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>
>> ---
>
> this doesn't apply for me.

any plans for an updated patch?

- k

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-10-10 13:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-01 12:46 [PATCH] powerpc: FPGA support for GE Fanuc SBC610 Martyn Welch
2008-10-03 21:57 ` Kumar Gala
2008-10-10 13:27   ` 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).