aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKumar Gala <galak@freescale.com>2005-06-21 20:15:23 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-21 21:46:24 -0400
commit682afbbd1456e9e7b64f482eb05676b933173cdf (patch)
treed433155e59fd76fd2afa110500ee4d07f95c0129
parent1e5aa8c86571deea5d8e8462fedcf610e21af717 (diff)
[PATCH] ppc32: Add support for MPC8245 8250 serial ports on Sandpoint
Added platform device initialization for the two 8250 style UARTs that exist on the MPC8245. Additionally, updated the Sandpoint code to enable one of these UARTs if an MPC8245 is connected to it. Signed-off-by: Matt McClintock <msm@freescale.com> Signed-off-by: Kumar Gala <kumar.gala@freescale.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/ppc/platforms/sandpoint.c20
-rw-r--r--arch/ppc/syslib/mpc10x_common.c20
2 files changed, 40 insertions, 0 deletions
diff --git a/arch/ppc/platforms/sandpoint.c b/arch/ppc/platforms/sandpoint.c
index 531bfa0e4512..70e58f43f2b8 100644
--- a/arch/ppc/platforms/sandpoint.c
+++ b/arch/ppc/platforms/sandpoint.c
@@ -81,6 +81,7 @@
81#include <linux/serial.h> 81#include <linux/serial.h>
82#include <linux/tty.h> /* for linux/serial_core.h */ 82#include <linux/tty.h> /* for linux/serial_core.h */
83#include <linux/serial_core.h> 83#include <linux/serial_core.h>
84#include <linux/serial_8250.h>
84 85
85#include <asm/system.h> 86#include <asm/system.h>
86#include <asm/pgtable.h> 87#include <asm/pgtable.h>
@@ -99,6 +100,7 @@
99#include <asm/mpc10x.h> 100#include <asm/mpc10x.h>
100#include <asm/pci-bridge.h> 101#include <asm/pci-bridge.h>
101#include <asm/kgdb.h> 102#include <asm/kgdb.h>
103#include <asm/ppc_sys.h>
102 104
103#include "sandpoint.h" 105#include "sandpoint.h"
104 106
@@ -305,6 +307,24 @@ sandpoint_setup_arch(void)
305 /* Lookup PCI host bridges */ 307 /* Lookup PCI host bridges */
306 sandpoint_find_bridges(); 308 sandpoint_find_bridges();
307 309
310 if (strncmp (cur_ppc_sys_spec->ppc_sys_name, "8245", 4) == 0)
311 {
312 bd_t *bp = (bd_t *)__res;
313 struct plat_serial8250_port *pdata;
314 pdata = (struct plat_serial8250_port *) ppc_sys_get_pdata(MPC10X_DUART);
315
316 if (pdata)
317 {
318 pdata[0].uartclk = bp->bi_busfreq;
319 pdata[0].membase = ioremap(pdata[0].mapbase, 0x100);
320
321 /* this disables the 2nd serial port on the DUART
322 * since the sandpoint does not have it connected */
323 pdata[1].uartclk = 0;
324 pdata[1].irq = 0;
325 pdata[1].mapbase = 0;
326 }
327
308 printk(KERN_INFO "Motorola SPS Sandpoint Test Platform\n"); 328 printk(KERN_INFO "Motorola SPS Sandpoint Test Platform\n");
309 printk(KERN_INFO "Port by MontaVista Software, Inc. (source@mvista.com)\n"); 329 printk(KERN_INFO "Port by MontaVista Software, Inc. (source@mvista.com)\n");
310 330
diff --git a/arch/ppc/syslib/mpc10x_common.c b/arch/ppc/syslib/mpc10x_common.c
index 0130aeb4a2d3..8fc5f4154521 100644
--- a/arch/ppc/syslib/mpc10x_common.c
+++ b/arch/ppc/syslib/mpc10x_common.c
@@ -44,10 +44,12 @@
44#define MPC10X_I2C_IRQ (EPIC_IRQ_BASE + NUM_8259_INTERRUPTS) 44#define MPC10X_I2C_IRQ (EPIC_IRQ_BASE + NUM_8259_INTERRUPTS)
45#define MPC10X_DMA0_IRQ (EPIC_IRQ_BASE + 1 + NUM_8259_INTERRUPTS) 45#define MPC10X_DMA0_IRQ (EPIC_IRQ_BASE + 1 + NUM_8259_INTERRUPTS)
46#define MPC10X_DMA1_IRQ (EPIC_IRQ_BASE + 2 + NUM_8259_INTERRUPTS) 46#define MPC10X_DMA1_IRQ (EPIC_IRQ_BASE + 2 + NUM_8259_INTERRUPTS)
47#define MPC10X_UART0_IRQ (EPIC_IRQ_BASE + 4 + NUM_8259_INTERRUPTS)
47#else 48#else
48#define MPC10X_I2C_IRQ -1 49#define MPC10X_I2C_IRQ -1
49#define MPC10X_DMA0_IRQ -1 50#define MPC10X_DMA0_IRQ -1
50#define MPC10X_DMA1_IRQ -1 51#define MPC10X_DMA1_IRQ -1
52#define MPC10X_UART0_IRQ -1
51#endif 53#endif
52 54
53static struct fsl_i2c_platform_data mpc10x_i2c_pdata = { 55static struct fsl_i2c_platform_data mpc10x_i2c_pdata = {
@@ -55,6 +57,16 @@ static struct fsl_i2c_platform_data mpc10x_i2c_pdata = {
55}; 57};
56 58
57static struct plat_serial8250_port serial_platform_data[] = { 59static struct plat_serial8250_port serial_platform_data[] = {
60 [0] = {
61 .mapbase = 0x4500,
62 .iotype = UPIO_MEM,
63 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
64 },
65 [1] = {
66 .mapbase = 0x4600,
67 .iotype = UPIO_MEM,
68 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
69 },
58 { }, 70 { },
59}; 71};
60 72
@@ -399,6 +411,12 @@ mpc10x_bridge_init(struct pci_controller *hose,
399 ppc_sys_platform_devices[MPC10X_DMA1].resource[1].start = MPC10X_DMA1_IRQ; 411 ppc_sys_platform_devices[MPC10X_DMA1].resource[1].start = MPC10X_DMA1_IRQ;
400 ppc_sys_platform_devices[MPC10X_DMA1].resource[1].end = MPC10X_DMA1_IRQ; 412 ppc_sys_platform_devices[MPC10X_DMA1].resource[1].end = MPC10X_DMA1_IRQ;
401 413
414 serial_platform_data[0].mapbase += phys_eumb_base;
415 serial_platform_data[0].irq = MPC10X_UART0_IRQ;
416
417 serial_platform_data[1].mapbase += phys_eumb_base;
418 serial_platform_data[1].irq = MPC10X_UART0_IRQ + 1;
419
402 /* 420 /*
403 * 8240 erratum 26, 8241/8245 erratum 29, 107 erratum 23: speculative 421 * 8240 erratum 26, 8241/8245 erratum 29, 107 erratum 23: speculative
404 * PCI reads may return stale data so turn off. 422 * PCI reads may return stale data so turn off.
@@ -597,6 +615,8 @@ void __init mpc10x_set_openpic(void)
597 openpic_set_sources(EPIC_IRQ_BASE, 3, OpenPIC_Addr + 0x11020); 615 openpic_set_sources(EPIC_IRQ_BASE, 3, OpenPIC_Addr + 0x11020);
598 /* Skip reserved space and map Message Unit Interrupt (I2O) */ 616 /* Skip reserved space and map Message Unit Interrupt (I2O) */
599 openpic_set_sources(EPIC_IRQ_BASE + 3, 1, OpenPIC_Addr + 0x110C0); 617 openpic_set_sources(EPIC_IRQ_BASE + 3, 1, OpenPIC_Addr + 0x110C0);
618 /* Skip reserved space and map Serial Interupts */
619 openpic_set_sources(EPIC_IRQ_BASE + 4, 2, OpenPIC_Addr + 0x11120);
600 620
601 openpic_init(NUM_8259_INTERRUPTS); 621 openpic_init(NUM_8259_INTERRUPTS);
602} 622}