aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc
diff options
context:
space:
mode:
authorGrant C. Likely <grant.likely@secretlab.ca>2006-01-19 03:13:03 -0500
committerPaul Mackerras <paulus@samba.org>2006-02-07 06:35:59 -0500
commite27db622b850e6426b69ef42e5678ba068c7f8e0 (patch)
tree57b7aeb1d6611d9d7f38e69ac6f0cbed3a3a3c7c /arch/ppc
parent1a42e53d175074f340a3f85042ed64cfc51be216 (diff)
[PATCH] powerpc: Migrate ML300 reference design to the platform bus
Signed-off-by: Grant C. Likely <grant.likely@secretlab.ca> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/ppc')
-rw-r--r--arch/ppc/Kconfig.debug2
-rw-r--r--arch/ppc/platforms/4xx/xilinx_ml300.c74
-rw-r--r--arch/ppc/platforms/4xx/xilinx_ml300.h2
-rw-r--r--arch/ppc/syslib/Makefile2
4 files changed, 55 insertions, 25 deletions
diff --git a/arch/ppc/Kconfig.debug b/arch/ppc/Kconfig.debug
index 61653cb60c4e..8cc75abf3d83 100644
--- a/arch/ppc/Kconfig.debug
+++ b/arch/ppc/Kconfig.debug
@@ -67,7 +67,7 @@ config SERIAL_TEXT_DEBUG
67 67
68config PPC_OCP 68config PPC_OCP
69 bool 69 bool
70 depends on IBM_OCP || XILINX_OCP 70 depends on IBM_OCP
71 default y 71 default y
72 72
73endmenu 73endmenu
diff --git a/arch/ppc/platforms/4xx/xilinx_ml300.c b/arch/ppc/platforms/4xx/xilinx_ml300.c
index b0de0a2f131d..267afb50607e 100644
--- a/arch/ppc/platforms/4xx/xilinx_ml300.c
+++ b/arch/ppc/platforms/4xx/xilinx_ml300.c
@@ -17,12 +17,14 @@
17#include <linux/tty.h> 17#include <linux/tty.h>
18#include <linux/serial.h> 18#include <linux/serial.h>
19#include <linux/serial_core.h> 19#include <linux/serial_core.h>
20#include <linux/serial_8250.h>
20#include <linux/serialP.h> 21#include <linux/serialP.h>
21#include <asm/io.h> 22#include <asm/io.h>
22#include <asm/machdep.h> 23#include <asm/machdep.h>
23#include <asm/ocp.h> 24#include <asm/ppc_sys.h>
24 25
25#include <platforms/4xx/virtex.h> /* for NR_SER_PORTS */ 26#include <syslib/gen550.h>
27#include <platforms/4xx/xparameters/xparameters.h>
26 28
27/* 29/*
28 * As an overview of how the following functions (platform_init, 30 * As an overview of how the following functions (platform_init,
@@ -54,6 +56,22 @@
54 * ppc4xx_pic_init arch/ppc/syslib/xilinx_pic.c 56 * ppc4xx_pic_init arch/ppc/syslib/xilinx_pic.c
55 */ 57 */
56 58
59/* Board specifications structures */
60struct ppc_sys_spec *cur_ppc_sys_spec;
61struct ppc_sys_spec ppc_sys_specs[] = {
62 {
63 /* Only one entry, always assume the same design */
64 .ppc_sys_name = "Xilinx ML300 Reference Design",
65 .mask = 0x00000000,
66 .value = 0x00000000,
67 .num_devices = 1,
68 .device_list = (enum ppc_sys_devices[])
69 {
70 VIRTEX_UART,
71 },
72 },
73};
74
57#if defined(XPAR_POWER_0_POWERDOWN_BASEADDR) 75#if defined(XPAR_POWER_0_POWERDOWN_BASEADDR)
58 76
59static volatile unsigned *powerdown_base = 77static volatile unsigned *powerdown_base =
@@ -80,28 +98,39 @@ ml300_map_io(void)
80#endif 98#endif
81} 99}
82 100
101/* Early serial support functions */
83static void __init 102static void __init
103ml300_early_serial_init(int num, struct plat_serial8250_port *pdata)
104{
105#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
106 struct uart_port serial_req;
107
108 memset(&serial_req, 0, sizeof(serial_req));
109 serial_req.mapbase = pdata->mapbase;
110 serial_req.membase = pdata->membase;
111 serial_req.irq = pdata->irq;
112 serial_req.uartclk = pdata->uartclk;
113 serial_req.regshift = pdata->regshift;
114 serial_req.iotype = pdata->iotype;
115 serial_req.flags = pdata->flags;
116 gen550_init(num, &serial_req);
117#endif
118}
119
120void __init
84ml300_early_serial_map(void) 121ml300_early_serial_map(void)
85{ 122{
86#ifdef CONFIG_SERIAL_8250 123#ifdef CONFIG_SERIAL_8250
87 struct serial_state old_ports[] = { SERIAL_PORT_DFNS }; 124 struct plat_serial8250_port *pdata;
88 struct uart_port port; 125 int i = 0;
89 int i; 126
90 127 pdata = (struct plat_serial8250_port *) ppc_sys_get_pdata(VIRTEX_UART);
91 /* Setup ioremapped serial port access */ 128 while(pdata && pdata->flags)
92 for (i = 0; i < ARRAY_SIZE(old_ports); i++ ) { 129 {
93 memset(&port, 0, sizeof(port)); 130 pdata->membase = ioremap(pdata->mapbase, 0x100);
94 port.membase = ioremap((phys_addr_t)(old_ports[i].iomem_base), 16); 131 ml300_early_serial_init(i, pdata);
95 port.irq = old_ports[i].irq; 132 pdata++;
96 port.uartclk = old_ports[i].baud_base * 16; 133 i++;
97 port.regshift = old_ports[i].iomem_reg_shift;
98 port.iotype = SERIAL_IO_MEM;
99 port.flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST;
100 port.line = i;
101
102 if (early_serial_setup(&port) != 0) {
103 printk("Early serial init of port %d failed\n", i);
104 }
105 } 134 }
106#endif /* CONFIG_SERIAL_8250 */ 135#endif /* CONFIG_SERIAL_8250 */
107} 136}
@@ -109,9 +138,8 @@ ml300_early_serial_map(void)
109void __init 138void __init
110ml300_setup_arch(void) 139ml300_setup_arch(void)
111{ 140{
112 ppc4xx_setup_arch(); /* calls ppc4xx_find_bridges() */
113
114 ml300_early_serial_map(); 141 ml300_early_serial_map();
142 ppc4xx_setup_arch(); /* calls ppc4xx_find_bridges() */
115 143
116 /* Identify the system */ 144 /* Identify the system */
117 printk(KERN_INFO "Xilinx Virtex-II Pro port\n"); 145 printk(KERN_INFO "Xilinx Virtex-II Pro port\n");
@@ -131,6 +159,8 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
131{ 159{
132 ppc4xx_init(r3, r4, r5, r6, r7); 160 ppc4xx_init(r3, r4, r5, r6, r7);
133 161
162 identify_ppc_sys_by_id(mfspr(SPRN_PVR));
163
134 ppc_md.setup_arch = ml300_setup_arch; 164 ppc_md.setup_arch = ml300_setup_arch;
135 ppc_md.setup_io_mappings = ml300_map_io; 165 ppc_md.setup_io_mappings = ml300_map_io;
136 ppc_md.init_IRQ = ml300_init_irq; 166 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 899398143623..ae8bf1353b01 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 {
41#define PPC4xx_ONB_IO_VADDR 0u 41#define PPC4xx_ONB_IO_VADDR 0u
42#define PPC4xx_ONB_IO_SIZE 0u 42#define PPC4xx_ONB_IO_SIZE 0u
43 43
44#define PPC4xx_MACHINE_NAME "Xilinx ML300" 44#define PPC4xx_MACHINE_NAME "Xilinx ML300 Reference System"
45 45
46#endif /* __ASM_XILINX_ML300_H__ */ 46#endif /* __ASM_XILINX_ML300_H__ */
47#endif /* __KERNEL__ */ 47#endif /* __KERNEL__ */
diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile
index 6234ee57b31c..5cb62c6a51c8 100644
--- a/arch/ppc/syslib/Makefile
+++ b/arch/ppc/syslib/Makefile
@@ -18,7 +18,7 @@ obj-$(CONFIG_440SP) += ibm440gx_common.o ibm440sp_common.o
18obj-$(CONFIG_440SPE) += ibm440gx_common.o ibm440sp_common.o ppc440spe_pcie.o 18obj-$(CONFIG_440SPE) += ibm440gx_common.o ibm440sp_common.o ppc440spe_pcie.o
19ifeq ($(CONFIG_4xx),y) 19ifeq ($(CONFIG_4xx),y)
20ifeq ($(CONFIG_XILINX_VIRTEX),y) 20ifeq ($(CONFIG_XILINX_VIRTEX),y)
21obj-$(CONFIG_40x) += xilinx_pic.o 21obj-$(CONFIG_40x) += xilinx_pic.o ppc_sys.o
22else 22else
23ifeq ($(CONFIG_403),y) 23ifeq ($(CONFIG_403),y)
24obj-$(CONFIG_40x) += ppc403_pic.o 24obj-$(CONFIG_40x) += ppc403_pic.o