Skip to contentSkip to conversation

Xilinx Virtex support for arch/powerpc

PATCH Superseded Grant Likely 3 participants 11 messages Sep 30, 2007 – Oct 1, 2007

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover Xilinx Virtex support for arch/powerpc

2nd version of Xilinx Virtex patches. I've addressed all the comments that I've received so far. This series is just the arch/powerpc support code. I'll send the device driver changes in a seperate series for each driver.

Cheers,
g.

 arch/powerpc/boot/Makefile          |    2 +-
 arch/powerpc/boot/ops.h             |    1 +
 arch/powerpc/boot/serial.c          |    2 +
 arch/powerpc/boot/uartlite.c        |   64 +++++++++++++++
 arch/powerpc/platforms/40x/Kconfig  |   38 ++++++---
 arch/powerpc/platforms/40x/Makefile |    1 +
 arch/powerpc/platforms/40x/virtex.c |   50 ++++++++++++
 arch/powerpc/sysdev/Makefile        |    1 +
 arch/powerpc/sysdev/xilinx_intc.c   |  151 +++++++++++++++++++++++++++++++++++
 include/asm-powerpc/xilinx_intc.h   |   20 +++++
 10 files changed, 316 insertions(+), 14 deletions(-)

--
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.

#1 lore raw

PATCH v2 1/4 Virtex: Add uartlite bootwrapper driver

From: Grant Likely <[email protected]>

Allows the bootwrapper to use the uartlite device for console output.

---

 arch/powerpc/boot/Makefile   |    2 +
 arch/powerpc/boot/ops.h      |    1 +
 arch/powerpc/boot/serial.c   |    2 +
 arch/powerpc/boot/uartlite.c |   64 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 68 insertions(+), 1 deletions(-)
arch/powerpc/boot/Makefile +1 -1
index c1582b6..371fbc6 100644
@@ -45,7 +45,7 @@ src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \
 		ns16550.c serial.c simple_alloc.c div64.S util.S \
 		gunzip_util.c elf_util.c $(zlib) devtree.c oflib.c ofconsole.c \
 		4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c \
-		cpm-serial.c stdlib.c
+		cpm-serial.c stdlib.c uartlite.c
 src-plat := of.c cuboot-83xx.c cuboot-85xx.c holly.c \
 		cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
 		ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
arch/powerpc/boot/ops.h +1 -0
index 703255b..4ef30e4 100644
@@ -84,6 +84,7 @@ int serial_console_init(void);
 int ns16550_console_init(void *devp, struct serial_console_data *scdp);
 int mpsc_console_init(void *devp, struct serial_console_data *scdp);
 int cpm_console_init(void *devp, struct serial_console_data *scdp);
+int uartlite_console_init(void *devp, struct serial_console_data *scdp);
 void *simple_alloc_init(char *base, unsigned long heap_size,
 			unsigned long granularity, unsigned long max_allocs);
 extern void flush_cache(void *, unsigned long);
arch/powerpc/boot/serial.c +2 -0
index d47f8e0..70f36bf 100644
@@ -126,6 +126,8 @@ int serial_console_init(void)
 	         dt_is_compatible(devp, "fsl,cpm2-scc-uart") ||
 	         dt_is_compatible(devp, "fsl,cpm2-smc-uart"))
 		rc = cpm_console_init(devp, &serial_cd);
+	else if (dt_is_compatible(devp, "xilinx,uartlite"))
+		rc = uartlite_console_init(devp, &serial_cd);
 
 	/* Add other serial console driver calls here */
 
arch/powerpc/boot/uartlite.c new file +64 -0

64 lines not on this page · raw message

#2 lore raw

PATCH v2 2/4 Virtex: Add Kconfig macros for Xilinx Virtex board support

In reply to Grant Likely

From: Grant Likely <[email protected]>

Add the needed kconfig macros to enable Xilinx Virtex board support

---

 arch/powerpc/platforms/40x/Kconfig |   38 ++++++++++++++++++++++++------------
 1 files changed, 25 insertions(+), 13 deletions(-)
arch/powerpc/platforms/40x/Kconfig +25 -13
index c3dce3b..9d5574a 100644
@@ -61,13 +61,22 @@ config WALNUT
 	help
 	  This option enables support for the IBM PPC405GP evaluation board.
 
-#config XILINX_ML300
-#	bool "Xilinx-ML300"
-#	depends on 40x
-#	default y
-#	select VIRTEX_II_PRO
-#	help
-#	  This option enables support for the Xilinx ML300 evaluation board.
+config XILINX_VIRTEX_GENERIC_BOARD
+	bool "Generic Xilinx Virtex board"
+	depends on 40x
+	default n
+	select VIRTEX_II_PRO
+	select VIRTEX_4_FX
+	help
+	  This option enables generic support for Xilinx Virtex based boards.
+
+	  The generic virtex board support matches any device tree which
+	  specifies 'xilinx,virtex' in its compatible field.  This includes
+	  the Xilinx ML3xx and ML4xx reference designs using the powerpc
+	  core.
+
+	  Most Virtex designs should use this unless it needs to do some
+	  special configuration at board probe time.
 
 # 40x specific CPU modules, selected based on the board above.
 config NP405H
@@ -91,11 +100,19 @@ config 405EP
 config 405GPR
 	bool
 
-config VIRTEX_II_PRO
+config XILINX_VIRTEX
 	bool
+
+config XILINX_VIRTEX_II_PRO
+	bool
+	select XILINX_VIRTEX
 	select IBM405_ERR77
 	select IBM405_ERR51
 
+config XILINX_VIRTEX_4_FX
+	bool
+	select XILINX_VIRTEX
+
 config STB03xxx
 	bool
 	select IBM405_ERR77
@@ -111,11 +128,6 @@ config IBM405_ERR77
 config IBM405_ERR51
 	bool
 
-#config XILINX_OCP
-#	bool
-#	depends on XILINX_ML300
-#	default y
-
 #config BIOS_FIXUP
 #	bool
 #	depends on BUBINGA || EP405 || SYCAMORE || WALNUT
#3 lore raw

PATCH v2 3/4 Virtex: add xilinx interrupt controller driver

In reply to Grant Likely

From: Grant Likely <[email protected]>

Adds support for the Xilinx opb-intc interrupt controller

---

 arch/powerpc/sysdev/Makefile      |    1 
 arch/powerpc/sysdev/xilinx_intc.c |  151 +++++++++++++++++++++++++++++++++++++
 include/asm-powerpc/xilinx_intc.h |   20 +++++
 3 files changed, 172 insertions(+), 0 deletions(-)
arch/powerpc/sysdev/Makefile +1 -0
index 08ce31e..0457117 100644
@@ -30,6 +30,7 @@ obj-$(CONFIG_PPC_INDIRECT_PCI)	+= indirect_pci.o
 obj-$(CONFIG_PPC_I8259)		+= i8259.o
 obj-$(CONFIG_PPC_83xx)		+= ipic.o
 obj-$(CONFIG_4xx)		+= uic.o
+obj-$(CONFIG_XILINX_VIRTEX)	+= xilinx_intc.o
 endif
 
 # Temporary hack until we have migrated to asm-powerpc
arch/powerpc/sysdev/xilinx_intc.c new file +151 -0

151 lines not on this page · raw message

include/asm-powerpc/xilinx_intc.h new file +20 -0
new file mode 100644
index 0000000..343612f
@@ -0,0 +1,20 @@
+/*
+ * Xilinx intc external definitions
+ *
+ * Copyright 2007 Secret Lab Technologies Ltd.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+#ifndef _ASM_POWERPC_XILINX_INTC_H
+#define _ASM_POWERPC_XILINX_INTC_H
+
+#ifdef __KERNEL__
+
+extern void __init xilinx_intc_init_tree(void);
+extern unsigned int xilinx_intc_get_irq(void);
+
+#endif /* __KERNEL__ */
+#endif /* _ASM_POWERPC_XILINX_INTC_H */
#4 lore raw

Re: [PATCHv2 3/4] Virtex: add xilinx interrupt controller driver

arch/powerpc/sysdev/xilinx_intc.c line 5

Quoted 12 lines · On Sun, 30 Sep 2007 16:20:43 -0600 Grant Likely <[email protected]>…
arch/powerpc/sysdev/xilinx_intc.c new file +5 -0
new file mode 100644
index 0000000..69f05cd
@@ -0,0 +1,151 @@
+#include <linux/kernel.h>
+#include <linux/irq.h>
+#include <asm/io.h>
+#include <asm/processor.h>
+#include <asm/prom.h>

You probably want linux/of_device.h or linux/of.h instead of asm/prom.h

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
#5 lore raw

Re: [PATCHv2 3/4] Virtex: add xilinx interrupt controller driver

Quoted 15 lines · Stephen Rothwell

arch/powerpc/sysdev/xilinx_intc.c line 5

Quoted 12 lines · On Sun, 30 Sep 2007 16:20:43 -0600 Grant Likely <[email protected]>…
arch/powerpc/sysdev/xilinx_intc.c new file +5 -0
new file mode 100644
index 0000000..69f05cd
@@ -0,0 +1,151 @@
+#include <linux/kernel.h>
+#include <linux/irq.h>
+#include <asm/io.h>
+#include <asm/processor.h>
+#include <asm/prom.h>

You probably want linux/of_device.h or linux/of.h instead of asm/prom.h

Done.

Thanks for the comments,
g.

Signature · 4 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
[email protected]
(403) 399-0195
#6 lore raw

PATCH v2 4/4 Virtex: Add generic Xilinx Virtex board support

In reply to Grant Likely

From: Grant Likely <[email protected]>

Adds support for generic Xilinx Virtex boards. Any board which specifies "xilinx,virtex" in the compatible property will make use of this board support.

---

 arch/powerpc/platforms/40x/Makefile |    1 +
 arch/powerpc/platforms/40x/virtex.c |   50 +++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 0 deletions(-)
arch/powerpc/platforms/40x/Makefile +1 -0
index e6c0bbd..0a3cfe9 100644
@@ -1 +1,2 @@
 obj-$(CONFIG_WALNUT) += walnut.o
+obj-$(CONFIG_XILINX_VIRTEX_GENERIC_BOARD) += virtex.o
arch/powerpc/platforms/40x/virtex.c new file +50 -0

50 lines not on this page · raw message

#7 lore raw

Re: [PATCHv2 4/4] Virtex: Add generic Xilinx Virtex board support

Quoted 3 lines · On Sun, 30 Sep 2007 16:20:52 -0600 Grant Likely <[email protected]>…

+++ b/arch/powerpc/platforms/40x/virtex.c
+#include <asm/of_platform.h>

/me puts on broken record voice :-)

linux/of_platform.h, please

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
#8 lore raw

Re: [PATCHv2 4/4] Virtex: Add generic Xilinx Virtex board support

Quoted 8 lines · Stephen Rothwell
Quoted 3 lines · On Sun, 30 Sep 2007 16:20:52 -0600 Grant Likely <[email protected]>…

+++ b/arch/powerpc/platforms/40x/virtex.c
+#include <asm/of_platform.h>

/me puts on broken record voice :-)

linux/of_platform.h, please

Done

Signature · 4 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
[email protected]
(403) 399-0195
#9 lore raw
In reply to Grant Likely
Quoted 4 lines · Grant Likely

2nd version of Xilinx Virtex patches. I've addressed all the comments that I've received so far. This series is just the arch/powerpc support code. I'll send the device driver changes in a seperate series for each driver.

Overall looks pretty darn good. You dropped the patch to add you as the Xilinx maintainer. Oversight?

Also, the support seems fairly generic but I don't see any ml300.dts or ml4xx.dts files. And the Kconfig files don't select WANT_DEVICE_TREE. Are those patches coming later, or do these boards really not need a DTS file?

josh

#10 lore raw
Quoted 8 lines · Josh Boyer
Quoted 4 lines · Grant Likely

2nd version of Xilinx Virtex patches. I've addressed all the comments that I've received so far. This series is just the arch/powerpc support code. I'll send the device driver changes in a seperate series for each driver.

Overall looks pretty darn good. You dropped the patch to add you as the Xilinx maintainer. Oversight?

I just don't have an OK from Paulus yet.

Quoted 4 lines

Also, the support seems fairly generic but I don't see any ml300.dts or ml4xx.dts files. And the Kconfig files don't select WANT_DEVICE_TREE. Are those patches coming later, or do these boards really not need a DTS file?

Those patches are coming later along with a defconfig patch.

Thanks Josh!
g.

Signature · 4 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
[email protected]
(403) 399-0195