aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc/platforms
diff options
context:
space:
mode:
authorGrant C. Likely <grant.likely@secretlab.ca>2006-01-19 03:12:48 -0500
committerPaul Mackerras <paulus@samba.org>2006-02-07 06:35:58 -0500
commit1a42e53d175074f340a3f85042ed64cfc51be216 (patch)
tree6426aebaa777d30be7ea7e6f3f6334fb94029230 /arch/ppc/platforms
parent562e7370a4d59d7ee8988fb0e13707d1f01a046a (diff)
[PATCH] powerpc: Migrate Xilinx Vertex support from the OCP bus to the platfom bus.
This patch only deals with the serial port definitions as there is no support for any other xilinx IP cores in the kernel tree at the moment. Board specific configuration moved out of virtex.[ch] and into the xparameters.h wrapper. This also prepares for the transition to the flattened device tree model. When the bootloader provides a device tree generated from an xparameters.h files, the kernel will no longer need xparameters/*. The platform bus will get populated with data from the device tree, and the device drivers will be automatically connected to the devices. Only the bootloader (or ppcboot) will need xparameters directly. Signed-off-by: Grant C. Likely <grant.likely@secretlab.ca> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/ppc/platforms')
-rw-r--r--arch/ppc/platforms/4xx/Kconfig5
-rw-r--r--arch/ppc/platforms/4xx/virtex.c88
-rw-r--r--arch/ppc/platforms/4xx/virtex.h86
-rw-r--r--arch/ppc/platforms/4xx/xparameters/xparameters.h21
4 files changed, 72 insertions, 128 deletions
diff --git a/arch/ppc/platforms/4xx/Kconfig b/arch/ppc/platforms/4xx/Kconfig
index 203abab32cc..057c7c2ab99 100644
--- a/arch/ppc/platforms/4xx/Kconfig
+++ b/arch/ppc/platforms/4xx/Kconfig
@@ -172,11 +172,6 @@ config IBM_OCP
172 depends on ASH || BAMBOO || BUBINGA || CPCI405 || EBONY || EP405 || LUAN || YUCCA || OCOTEA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT 172 depends on ASH || BAMBOO || BUBINGA || CPCI405 || EBONY || EP405 || LUAN || YUCCA || OCOTEA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT
173 default y 173 default y
174 174
175config XILINX_OCP
176 bool
177 depends on XILINX_ML300
178 default y
179
180config IBM_EMAC4 175config IBM_EMAC4
181 bool 176 bool
182 depends on 440GX || 440SP || 440SPE 177 depends on 440GX || 440SP || 440SPE
diff --git a/arch/ppc/platforms/4xx/virtex.c b/arch/ppc/platforms/4xx/virtex.c
index bbb12c0c0b2..133a8314719 100644
--- a/arch/ppc/platforms/4xx/virtex.c
+++ b/arch/ppc/platforms/4xx/virtex.c
@@ -1,60 +1,56 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/virtex.c 2 * Virtex-II Pro & Virtex-4 FX common infrastructure
3 * 3 *
4 * Author: MontaVista Software, Inc. 4 * Maintainer: Grant Likely <grant.likely@secretlab.ca>
5 * source@mvista.com
6 * 5 *
7 * 2002-2004 (c) MontaVista Software, Inc. This file is licensed under the 6 * Copyright 2005 Secret Lab Technologies Ltd.
8 * terms of the GNU General Public License version 2. This program is licensed 7 * Copyright 2005 General Dynamics Canada Ltd.
9 * "as is" without any warranty of any kind, whether express or implied. 8 * Copyright 2005 Freescale Semiconductor Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
10 */ 14 */
11 15
12#include <linux/config.h>
13#include <linux/init.h> 16#include <linux/init.h>
14#include <asm/ocp.h> 17#include <linux/module.h>
18#include <linux/device.h>
19#include <linux/serial_8250.h>
20#include <asm/ppc_sys.h>
15#include <platforms/4xx/virtex.h> 21#include <platforms/4xx/virtex.h>
22#include <platforms/4xx/xparameters/xparameters.h>
23
24#define XPAR_UART(num) { \
25 .mapbase = XPAR_UARTNS550_##num##_BASEADDR + 3, \
26 .irq = XPAR_INTC_0_UARTNS550_##num##_VEC_ID, \
27 .iotype = UPIO_MEM, \
28 .uartclk = XPAR_UARTNS550_##num##_CLOCK_FREQ_HZ, \
29 .flags = UPF_BOOT_AUTOCONF, \
30 .regshift = 2, \
31 }
16 32
17/* Have OCP take care of the serial ports. */ 33struct plat_serial8250_port serial_platform_data[] = {
18struct ocp_def core_ocp[] = {
19#ifdef XPAR_UARTNS550_0_BASEADDR 34#ifdef XPAR_UARTNS550_0_BASEADDR
20 { .vendor = OCP_VENDOR_XILINX, 35 XPAR_UART(0),
21 .function = OCP_FUNC_16550, 36#endif
22 .index = 0,
23 .paddr = XPAR_UARTNS550_0_BASEADDR,
24 .irq = XPAR_INTC_0_UARTNS550_0_VEC_ID,
25 .pm = OCP_CPM_NA
26 },
27#ifdef XPAR_UARTNS550_1_BASEADDR 37#ifdef XPAR_UARTNS550_1_BASEADDR
28 { .vendor = OCP_VENDOR_XILINX, 38 XPAR_UART(1),
29 .function = OCP_FUNC_16550, 39#endif
30 .index = 1,
31 .paddr = XPAR_UARTNS550_1_BASEADDR,
32 .irq = XPAR_INTC_0_UARTNS550_1_VEC_ID,
33 .pm = OCP_CPM_NA
34 },
35#ifdef XPAR_UARTNS550_2_BASEADDR 40#ifdef XPAR_UARTNS550_2_BASEADDR
36 { .vendor = OCP_VENDOR_XILINX, 41 XPAR_UART(2),
37 .function = OCP_FUNC_16550, 42#endif
38 .index = 2,
39 .paddr = XPAR_UARTNS550_2_BASEADDR,
40 .irq = XPAR_INTC_0_UARTNS550_2_VEC_ID,
41 .pm = OCP_CPM_NA
42 },
43#ifdef XPAR_UARTNS550_3_BASEADDR 43#ifdef XPAR_UARTNS550_3_BASEADDR
44 { .vendor = OCP_VENDOR_XILINX, 44 XPAR_UART(3),
45 .function = OCP_FUNC_16550, 45#endif
46 .index = 3, 46 { }, /* terminated by empty record */
47 .paddr = XPAR_UARTNS550_3_BASEADDR, 47};
48 .irq = XPAR_INTC_0_UARTNS550_3_VEC_ID, 48
49 .pm = OCP_CPM_NA 49struct platform_device ppc_sys_platform_devices[] = {
50 [VIRTEX_UART] = {
51 .name = "serial8250",
52 .id = 0,
53 .dev.platform_data = serial_platform_data,
50 }, 54 },
51#ifdef XPAR_UARTNS550_4_BASEADDR
52#error Edit this file to add more devices.
53#endif /* 4 */
54#endif /* 3 */
55#endif /* 2 */
56#endif /* 1 */
57#endif /* 0 */
58 { .vendor = OCP_VENDOR_INVALID
59 }
60}; 55};
56
diff --git a/arch/ppc/platforms/4xx/virtex.h b/arch/ppc/platforms/4xx/virtex.h
index 049c767d33e..1a01b81cff1 100644
--- a/arch/ppc/platforms/4xx/virtex.h
+++ b/arch/ppc/platforms/4xx/virtex.h
@@ -15,85 +15,21 @@
15#ifndef __ASM_VIRTEX_H__ 15#ifndef __ASM_VIRTEX_H__
16#define __ASM_VIRTEX_H__ 16#define __ASM_VIRTEX_H__
17 17
18#include <linux/config.h>
19#include <platforms/4xx/xparameters/xparameters.h>
20
21/* serial defines */ 18/* serial defines */
22 19
23#define RS_TABLE_SIZE 4 /* change this and add more devices below 20#include <asm/ibm405.h>
24 if you have more then 4 16x50 UARTs */
25
26#define BASE_BAUD (XPAR_UARTNS550_0_CLOCK_FREQ_HZ/16)
27
28/* The serial ports in the Virtex-II Pro have each I/O byte in the
29 * LSByte of a word. This means that iomem_reg_shift needs to be 2 to
30 * change the byte offsets into word offsets. In addition the base
31 * addresses need to have 3 added to them to get to the LSByte.
32 */
33#define STD_UART_OP(num) \
34 { 0, BASE_BAUD, 0, XPAR_INTC_0_UARTNS550_##num##_VEC_ID, \
35 ASYNC_BOOT_AUTOCONF, \
36 .iomem_base = (u8 *)XPAR_UARTNS550_##num##_BASEADDR + 3, \
37 .iomem_reg_shift = 2, \
38 .io_type = SERIAL_IO_MEM},
39
40#if defined(XPAR_INTC_0_UARTNS550_0_VEC_ID)
41#define ML300_UART0 STD_UART_OP(0)
42#else
43#define ML300_UART0
44#endif
45
46#if defined(XPAR_INTC_0_UARTNS550_1_VEC_ID)
47#define ML300_UART1 STD_UART_OP(1)
48#else
49#define ML300_UART1
50#endif
51
52#if defined(XPAR_INTC_0_UARTNS550_2_VEC_ID)
53#define ML300_UART2 STD_UART_OP(2)
54#else
55#define ML300_UART2
56#endif
57
58#if defined(XPAR_INTC_0_UARTNS550_3_VEC_ID)
59#define ML300_UART3 STD_UART_OP(3)
60#else
61#define ML300_UART3
62#endif
63
64#if defined(XPAR_INTC_0_UARTNS550_4_VEC_ID)
65#error Edit this file to add more devices.
66#elif defined(XPAR_INTC_0_UARTNS550_3_VEC_ID)
67#define NR_SER_PORTS 4
68#elif defined(XPAR_INTC_0_UARTNS550_2_VEC_ID)
69#define NR_SER_PORTS 3
70#elif defined(XPAR_INTC_0_UARTNS550_1_VEC_ID)
71#define NR_SER_PORTS 2
72#elif defined(XPAR_INTC_0_UARTNS550_0_VEC_ID)
73#define NR_SER_PORTS 1
74#else
75#define NR_SER_PORTS 0
76#endif
77 21
78#if defined(CONFIG_UART0_TTYS0) 22/* Ugly, ugly, ugly! BASE_BAUD defined here to keep 8250.c happy. */
79#define SERIAL_PORT_DFNS \ 23#if !defined(BASE_BAUD)
80 ML300_UART0 \ 24 #define BASE_BAUD (0) /* dummy value; not used */
81 ML300_UART1 \
82 ML300_UART2 \
83 ML300_UART3
84#endif 25#endif
85 26
86#if defined(CONFIG_UART0_TTYS1) 27/* Device type enumeration for platform bus definitions */
87#define SERIAL_PORT_DFNS \ 28#ifndef __ASSEMBLY__
88 ML300_UART1 \ 29enum ppc_sys_devices {
89 ML300_UART0 \ 30 VIRTEX_UART,
90 ML300_UART2 \ 31};
91 ML300_UART3
92#endif 32#endif
93 33
94#define DCRN_CPMFR_BASE 0
95
96#include <asm/ibm405.h>
97
98#endif /* __ASM_VIRTEX_H__ */ 34#endif /* __ASM_VIRTEX_H__ */
99#endif /* __KERNEL__ */ 35#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/xparameters/xparameters.h b/arch/ppc/platforms/4xx/xparameters/xparameters.h
index fe4eac62913..7b7304379dd 100644
--- a/arch/ppc/platforms/4xx/xparameters/xparameters.h
+++ b/arch/ppc/platforms/4xx/xparameters/xparameters.h
@@ -1,7 +1,8 @@
1/* 1/*
2 * include/asm-ppc/xparameters.h 2 * include/asm-ppc/xparameters.h
3 * 3 *
4 * This file includes the correct xparameters.h for the CONFIG'ed board 4 * This file includes the correct xparameters.h for the CONFIG'ed board plus
5 * fixups to translate board specific XPAR values to a common set of names
5 * 6 *
6 * Author: MontaVista Software, Inc. 7 * Author: MontaVista Software, Inc.
7 * source@mvista.com 8 * source@mvista.com
@@ -14,5 +15,21 @@
14#include <linux/config.h> 15#include <linux/config.h>
15 16
16#if defined(CONFIG_XILINX_ML300) 17#if defined(CONFIG_XILINX_ML300)
17#include <platforms/4xx/xparameters/xparameters_ml300.h> 18 #include "xparameters_ml300.h"
19#else
20 /* Add other board xparameter includes here before the #else */
21 #error No xparameters_*.h file included
22#endif
23
24#ifndef SERIAL_PORT_DFNS
25 /* zImage serial port definitions */
26 #define RS_TABLE_SIZE 1
27 #define SERIAL_PORT_DFNS { \
28 .baud_base = XPAR_UARTNS550_0_CLOCK_FREQ_HZ/16, \
29 .irq = XPAR_INTC_0_UARTNS550_0_VEC_ID, \
30 .flags = ASYNC_BOOT_AUTOCONF, \
31 .iomem_base = (u8 *)XPAR_UARTNS550_0_BASEADDR + 3, \
32 .iomem_reg_shift = 2, \
33 .io_type = SERIAL_IO_MEM, \
34 },
18#endif 35#endif