]> err.no Git - linux-2.6/commitdiff
[PATCH] powerpc: Migrate ML300 reference design to the platform bus
authorGrant C. Likely <grant.likely@secretlab.ca>
Thu, 19 Jan 2006 08:13:03 +0000 (01:13 -0700)
committerPaul Mackerras <paulus@samba.org>
Tue, 7 Feb 2006 11:35:59 +0000 (22:35 +1100)
Signed-off-by: Grant C. Likely <grant.likely@secretlab.ca>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/ppc/Kconfig.debug
arch/ppc/platforms/4xx/xilinx_ml300.c
arch/ppc/platforms/4xx/xilinx_ml300.h
arch/ppc/syslib/Makefile

index 61653cb60c4e3f01f294f0dd04301446d5049a1d..8cc75abf3d834ff80aa604f53ffb334c7dcde7d9 100644 (file)
@@ -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
index b0de0a2f131de428e291a9c250b68ff0d828e0bb..267afb50607e59e4f8b1d945e6320ea6a8684720 100644 (file)
 #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,
  *          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 long r4, unsigned long r5,
 {
        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;
index 899398143623bb5dbb6add9d172cc08e4d81998d..ae8bf1353b01e51318e12b8f8a7506d95fecaf8c 100644 (file)
@@ -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__ */
index 6234ee57b31c8548afc46e7ee178ada72aad0f91..5cb62c6a51c84c8dfec24aa076f3c34883c0df5d 100644 (file)
@@ -18,7 +18,7 @@ obj-$(CONFIG_440SP)           += ibm440gx_common.o ibm440sp_common.o
 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