diff options
| author | Kumar Gala <galak@freescale.com> | 2005-02-01 16:37:30 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-02-01 16:37:30 -0800 |
| commit | eb7d7e6e8abd37a306baac2af3695c697cd93287 (patch) | |
| tree | 9bb5908a77015e820b282b3a03b9487393e7c01f /arch/ppc/syslib | |
| parent | 812137a240f45f9af79d928df5073fc165331cf2 (diff) | |
[PATCH] ppc32: use platform device style initialization for 85xx serial8250 ports
Converts the initialization of serial8250 ports on various 85xx parts from
using the old ISA style to a platform device.
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>
Diffstat (limited to 'arch/ppc/syslib')
| -rw-r--r-- | arch/ppc/syslib/ppc85xx_setup.c | 39 | ||||
| -rw-r--r-- | arch/ppc/syslib/ppc85xx_setup.h | 9 |
2 files changed, 20 insertions, 28 deletions
diff --git a/arch/ppc/syslib/ppc85xx_setup.c b/arch/ppc/syslib/ppc85xx_setup.c index fefce404ac74..21243b8d9cac 100644 --- a/arch/ppc/syslib/ppc85xx_setup.c +++ b/arch/ppc/syslib/ppc85xx_setup.c @@ -21,12 +21,14 @@ #include <linux/serial.h> #include <linux/tty.h> /* for linux/serial_core.h */ #include <linux/serial_core.h> +#include <linux/serial_8250.h> #include <asm/prom.h> #include <asm/time.h> #include <asm/mpc85xx.h> #include <asm/immap_85xx.h> #include <asm/mmu.h> +#include <asm/ppc_sys.h> #include <asm/kgdb.h> #include <syslib/ppc85xx_setup.h> @@ -72,40 +74,39 @@ mpc85xx_calibrate_decr(void) void __init mpc85xx_early_serial_map(void) { +#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) struct uart_port serial_req; +#endif + struct plat_serial8250_port *pdata; bd_t *binfo = (bd_t *) __res; - phys_addr_t duart_paddr = binfo->bi_immr_base + MPC85xx_UART0_OFFSET; + pdata = (struct plat_serial8250_port *) ppc_sys_get_pdata(MPC85xx_DUART); /* Setup serial port access */ + pdata[0].uartclk = binfo->bi_busfreq; + pdata[0].mapbase += binfo->bi_immr_base; + pdata[0].membase = ioremap(pdata[0].mapbase, MPC85xx_UART0_SIZE); + +#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) memset(&serial_req, 0, sizeof (serial_req)); - serial_req.uartclk = binfo->bi_busfreq; - serial_req.line = 0; - serial_req.irq = MPC85xx_IRQ_DUART; - serial_req.flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST; serial_req.iotype = SERIAL_IO_MEM; - serial_req.membase = ioremap(duart_paddr, MPC85xx_UART0_SIZE); - serial_req.mapbase = duart_paddr; + serial_req.mapbase = pdata[0].mapbase; + serial_req.membase = pdata[0].membase; serial_req.regshift = 0; -#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) gen550_init(0, &serial_req); #endif - if (early_serial_setup(&serial_req) != 0) - printk("Early serial init of port 0 failed\n"); - - /* Assume early_serial_setup() doesn't modify serial_req */ - duart_paddr = binfo->bi_immr_base + MPC85xx_UART1_OFFSET; - serial_req.line = 1; - serial_req.mapbase = duart_paddr; - serial_req.membase = ioremap(duart_paddr, MPC85xx_UART1_SIZE); + pdata[1].uartclk = binfo->bi_busfreq; + pdata[1].mapbase += binfo->bi_immr_base; + pdata[1].membase = ioremap(pdata[1].mapbase, MPC85xx_UART0_SIZE); #if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) + /* Assume gen550_init() doesn't modify serial_req */ + serial_req.mapbase = pdata[1].mapbase; + serial_req.membase = pdata[1].membase; + gen550_init(1, &serial_req); #endif - - if (early_serial_setup(&serial_req) != 0) - printk("Early serial init of port 1 failed\n"); } #endif diff --git a/arch/ppc/syslib/ppc85xx_setup.h b/arch/ppc/syslib/ppc85xx_setup.h index 678325989994..6e6cfe162faf 100644 --- a/arch/ppc/syslib/ppc85xx_setup.h +++ b/arch/ppc/syslib/ppc85xx_setup.h @@ -43,9 +43,6 @@ extern void mpc85xx_setup_hose(void) __init; #define PCIX_STATUS 0x64 /* Serial Config */ -#define MPC85XX_0_SERIAL (CCSRBAR + 0x4500) -#define MPC85XX_1_SERIAL (CCSRBAR + 0x4600) - #ifdef CONFIG_SERIAL_MANY_PORTS #define RS_TABLE_SIZE 64 #else @@ -56,12 +53,6 @@ extern void mpc85xx_setup_hose(void) __init; #define BASE_BAUD 115200 #endif -#define STD_UART_OP(num) \ - { 0, BASE_BAUD, num, MPC85xx_IRQ_DUART, \ - (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \ - iomem_base: (u8 *)MPC85XX_##num##_SERIAL, \ - io_type: SERIAL_IO_MEM}, - /* Offset of CPM register space */ #define CPM_MAP_ADDR (CCSRBAR + MPC85xx_CPM_OFFSET) |
