linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] Xilinx Virtex-* updates
@ 2006-01-09  8:32 grant.likely
  2006-01-09  8:32 ` [PATCH 02/10] Make Virtex-II Pro support generic for all Virtex devices grant.likely
                   ` (10 more replies)
  0 siblings, 11 replies; 24+ messages in thread
From: grant.likely @ 2006-01-09  8:32 UTC (permalink / raw)
  To: glikely, mporter, linuxppc-embedded, gnathita, dhlii

Here's a repost of my Xilinx ML300 and ML403 patches with a few
cleanups, a bit of patch reordering, and rebased to 2.6.15.

Changes:
 - Remove xparameters.h as a dependancy to most of the kernel tree
 - Rework Virtex-II Pro support to be generic for Virtex-4 also
 - Move serial drivers from the OCP bus to the platform bus
 - Modify ML300 to use platform bus
 - Add support for ML403
 - Add ML300 & ML403 defconfigs

I've tested on an ML403
Can someone test on an ML300?  (I no longer have one)

Cheers,
g.

^ permalink raw reply	[flat|nested] 24+ messages in thread
* [PATCH 04/10] Migrate ML300 reference design to the platform bus
@ 2006-01-14  9:48 Grant C. Likely
  0 siblings, 0 replies; 24+ messages in thread
From: Grant C. Likely @ 2006-01-14  9:48 UTC (permalink / raw)
  To: linuxppc-embedded, mporter, glikely

Signed-off-by: Grant C. Likely <grant.likely@secretlab.ca>

---

 arch/ppc/Kconfig.debug                |    2 -
 arch/ppc/platforms/4xx/xilinx_ml300.c |   74 +++++++++++++++++++++++----------
 arch/ppc/platforms/4xx/xilinx_ml300.h |    2 -
 arch/ppc/syslib/Makefile              |    2 -
 arch/ppc/syslib/xilinx_pic.c          |   10 ++--
 5 files changed, 60 insertions(+), 30 deletions(-)

a13976d8a19837c07e485ae3ae7179668b4b9986
diff --git a/arch/ppc/Kconfig.debug b/arch/ppc/Kconfig.debug
index 61653cb..8cc75ab 100644
--- a/arch/ppc/Kconfig.debug
+++ b/arch/ppc/Kconfig.debug
@@ -67,7 +67,7 @@ config SERIAL_TEXT_DEBUG
 
 config PPC_OCP
 	bool
-	depends on IBM_OCP || XILINX_OCP
+	depends on IBM_OCP
 	default y
 
 endmenu
diff --git a/arch/ppc/platforms/4xx/xilinx_ml300.c b/arch/ppc/platforms/4xx/xilinx_ml300.c
index b0de0a2..267afb5 100644
--- a/arch/ppc/platforms/4xx/xilinx_ml300.c
+++ b/arch/ppc/platforms/4xx/xilinx_ml300.c
@@ -17,12 +17,14 @@
 #include <linux/tty.h>
 #include <linux/serial.h>
 #include <linux/serial_core.h>
+#include <linux/serial_8250.h>
 #include <linux/serialP.h>
 #include <asm/io.h>
 #include <asm/machdep.h>
-#include <asm/ocp.h>
+#include <asm/ppc_sys.h>
 
-#include <platforms/4xx/virtex.h>	/* for NR_SER_PORTS */
+#include <syslib/gen550.h>
+#include <platforms/4xx/xparameters/xparameters.h>
 
 /*
  * As an overview of how the following functions (platform_init,
@@ -54,6 +56,22 @@
  *          ppc4xx_pic_init			arch/ppc/syslib/xilinx_pic.c
  */
 
+/* Board specifications structures */
+struct ppc_sys_spec *cur_ppc_sys_spec;
+struct ppc_sys_spec ppc_sys_specs[] = {
+	{
+		/* Only one entry, always assume the same design */
+		.ppc_sys_name	= "Xilinx ML300 Reference Design",
+		.mask 		= 0x00000000,
+		.value 		= 0x00000000,
+		.num_devices	= 1,
+		.device_list	= (enum ppc_sys_devices[])
+		{
+			VIRTEX_UART,
+		},
+	},
+};
+
 #if defined(XPAR_POWER_0_POWERDOWN_BASEADDR)
 
 static volatile unsigned *powerdown_base =
@@ -80,28 +98,39 @@ ml300_map_io(void)
 #endif
 }
 
+/* Early serial support functions */
 static void __init
+ml300_early_serial_init(int num, struct plat_serial8250_port *pdata)
+{
+#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
+	struct uart_port serial_req;
+
+	memset(&serial_req, 0, sizeof(serial_req));
+	serial_req.mapbase	= pdata->mapbase;
+	serial_req.membase	= pdata->membase;
+	serial_req.irq		= pdata->irq;
+	serial_req.uartclk	= pdata->uartclk;
+	serial_req.regshift	= pdata->regshift;
+	serial_req.iotype	= pdata->iotype;
+	serial_req.flags	= pdata->flags;
+	gen550_init(num, &serial_req);
+#endif
+}
+
+void __init
 ml300_early_serial_map(void)
 {
 #ifdef CONFIG_SERIAL_8250
-	struct serial_state old_ports[] = { SERIAL_PORT_DFNS };
-	struct uart_port port;
-	int i;
-
-	/* Setup ioremapped serial port access */
-	for (i = 0; i < ARRAY_SIZE(old_ports); i++ ) {
-		memset(&port, 0, sizeof(port));
-		port.membase = ioremap((phys_addr_t)(old_ports[i].iomem_base), 16);
-		port.irq = old_ports[i].irq;
-		port.uartclk = old_ports[i].baud_base * 16;
-		port.regshift = old_ports[i].iomem_reg_shift;
-		port.iotype = SERIAL_IO_MEM;
-		port.flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST;
-		port.line = i;
-
-		if (early_serial_setup(&port) != 0) {
-			printk("Early serial init of port %d failed\n", i);
-		}
+	struct plat_serial8250_port *pdata;
+	int i = 0;
+
+	pdata = (struct plat_serial8250_port *) ppc_sys_get_pdata(VIRTEX_UART);
+	while(pdata && pdata->flags)
+	{
+		pdata->membase = ioremap(pdata->mapbase, 0x100);
+		ml300_early_serial_init(i, pdata);
+		pdata++;
+		i++;
 	}
 #endif /* CONFIG_SERIAL_8250 */
 }
@@ -109,9 +138,8 @@ ml300_early_serial_map(void)
 void __init
 ml300_setup_arch(void)
 {
-	ppc4xx_setup_arch();	/* calls ppc4xx_find_bridges() */
-
 	ml300_early_serial_map();
+	ppc4xx_setup_arch();	/* calls ppc4xx_find_bridges() */
 
 	/* Identify the system */
 	printk(KERN_INFO "Xilinx Virtex-II Pro port\n");
@@ -131,6 +159,8 @@ platform_init(unsigned long r3, unsigned
 {
 	ppc4xx_init(r3, r4, r5, r6, r7);
 
+	identify_ppc_sys_by_id(mfspr(SPRN_PVR));
+
 	ppc_md.setup_arch = ml300_setup_arch;
 	ppc_md.setup_io_mappings = ml300_map_io;
 	ppc_md.init_IRQ = ml300_init_irq;
diff --git a/arch/ppc/platforms/4xx/xilinx_ml300.h b/arch/ppc/platforms/4xx/xilinx_ml300.h
index 8993981..ae8bf13 100644
--- a/arch/ppc/platforms/4xx/xilinx_ml300.h
+++ b/arch/ppc/platforms/4xx/xilinx_ml300.h
@@ -41,7 +41,7 @@ typedef struct board_info {
 #define PPC4xx_ONB_IO_VADDR	0u
 #define PPC4xx_ONB_IO_SIZE	0u
 
-#define PPC4xx_MACHINE_NAME "Xilinx ML300"
+#define PPC4xx_MACHINE_NAME "Xilinx ML300 Reference System"
 
 #endif /* __ASM_XILINX_ML300_H__ */
 #endif /* __KERNEL__ */
diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile
index dc75f6e..301f0c2 100644
--- a/arch/ppc/syslib/Makefile
+++ b/arch/ppc/syslib/Makefile
@@ -18,7 +18,7 @@ obj-$(CONFIG_440SP)		+= ibm440gx_common.
 obj-$(CONFIG_440SPE)		+= ibm440gx_common.o ibm440sp_common.o ppc440spe_pcie.o
 ifeq ($(CONFIG_4xx),y)
 ifeq ($(CONFIG_XILINX_VIRTEX),y)
-obj-$(CONFIG_40x)		+= xilinx_pic.o
+obj-$(CONFIG_40x)		+= xilinx_pic.o ppc_sys.o
 else
 ifeq ($(CONFIG_403),y)
 obj-$(CONFIG_40x)		+= ppc403_pic.o
diff --git a/arch/ppc/syslib/xilinx_pic.c b/arch/ppc/syslib/xilinx_pic.c
index 848fb51..206872c 100644
--- a/arch/ppc/syslib/xilinx_pic.c
+++ b/arch/ppc/syslib/xilinx_pic.c
@@ -120,14 +120,14 @@ ppc4xx_pic_init(void)
 #error NR_IRQS > 32 not supported
 #endif
 
-#if XPAR_XINTC_USE_DCR == 0
-	intc = ioremap(XPAR_INTC_0_BASEADDR, 32);
+#if VIRTEX_XINTC_USE_DCR == 0
+	intc = ioremap(VIRTEX_INTC_BASEADDR, 32);
 
 	printk(KERN_INFO "Xilinx INTC #0 at 0x%08lX mapped to 0x%08lX\n",
-	       (unsigned long) XPAR_INTC_0_BASEADDR, (unsigned long) intc);
+	       (unsigned long) VIRTEX_INTC_BASEADDR, (unsigned long) intc);
 #else
 	printk(KERN_INFO "Xilinx INTC #0 at 0x%08lX (DCR)\n",
-	       (unsigned long) XPAR_INTC_0_BASEADDR);
+	       (unsigned long) VIRTEX_INTC_BASEADDR);
 #endif
 
 	/*
@@ -147,7 +147,7 @@ ppc4xx_pic_init(void)
 	for (i = 0; i < NR_IRQS; ++i) {
 		irq_desc[i].handler = &xilinx_intc;
 
-		if (XPAR_INTC_0_KIND_OF_INTR & (0x00000001 << i))
+		if (VIRTEX_INTC_KIND_OF_INTR & (0x00000001 << i))
 			irq_desc[i].status &= ~IRQ_LEVEL;
 		else
 			irq_desc[i].status |= IRQ_LEVEL;
-- 
1.1.2-g9e9b-dirty

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

end of thread, other threads:[~2006-01-16  7:30 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-09  8:32 [PATCH 00/10] Xilinx Virtex-* updates grant.likely
2006-01-09  8:32 ` [PATCH 02/10] Make Virtex-II Pro support generic for all Virtex devices grant.likely
2006-01-12 17:28   ` Andrei Konovalov
2006-01-13 17:52     ` Grant Likely
2006-01-09  8:32 ` [PATCH 01/10] Move xparameters.h into xilinx virtex device specific path grant.likely
2006-01-12 17:26   ` Andrei Konovalov
2006-01-14  9:55     ` ML300 & ML403 patches Grant Likely
2006-01-09  8:33 ` [PATCH 05/10] Add Virtex-4 FX to cpu table grant.likely
2006-01-09  8:33 ` [PATCH 03/10] Migrate Xilinx Vertex support from the OCP bus to the platfom bus grant.likely
2006-01-13 18:20   ` Peter Korsgaard
2006-01-09  8:33 ` [PATCH 04/10] Migrate ML300 reference design to the platform bus grant.likely
2006-01-09  8:33 ` [PATCH 06/10] Add xparameters file for Xilinx ML403 reference design grant.likely
2006-01-09  8:33 ` [PATCH 08/10] ML300 & ML403 need embed_config.o linked in grant.likely
2006-01-12 17:29   ` Andrei Konovalov
2006-01-13 18:18   ` Peter Korsgaard
2006-01-13 18:31     ` Matt Porter
2006-01-13 18:34     ` Grant Likely
2006-01-09  8:33 ` [PATCH 09/10] defconfigs for Xilinx ML300 and ML403 reference designs grant.likely
2006-01-09  8:33 ` [PATCH 07/10] Add support for Xilinx ML403 reference design grant.likely
2006-01-09  8:33 ` [PATCH 10/10] Bug fix for Xilinx silicon errata 213 grant.likely
2006-01-13 18:17 ` [PATCH 00/10] Xilinx Virtex-* updates Peter Korsgaard
2006-01-16  5:27   ` David H. Lynch Jr.
2006-01-16  7:30     ` Grant Likely
  -- strict thread matches above, loose matches on Subject: below --
2006-01-14  9:48 [PATCH 04/10] Migrate ML300 reference design to the platform bus Grant C. Likely

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