diff options
author | Paul Mundt <lethal@linux-sh.org> | 2006-09-27 11:48:46 +0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2006-09-27 11:48:46 +0400 |
commit | ade2b3f6ed199dc4a7a0be53edf20f9399023640 (patch) | |
tree | 839523b6b551e44e1c37669d74d664974d50a3a4 | |
parent | a3e61d50dc82475ebca3ff8b18c174c02c5ff511 (diff) | |
download | linux-ade2b3f6ed199dc4a7a0be53edf20f9399023640.tar.xz |
sh: VoyagerGX cleanups and 8250 UART support.
This adds the VoyagerGX UART to the RTS7751R2D setup
code, and cleans up a few build issues.
Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | arch/sh/boards/renesas/rts7751r2d/setup.c | 77 | ||||
-rw-r--r-- | arch/sh/cchips/voyagergx/irq.c | 3 | ||||
-rw-r--r-- | arch/sh/cchips/voyagergx/setup.c | 2 |
3 files changed, 71 insertions, 11 deletions
diff --git a/arch/sh/boards/renesas/rts7751r2d/setup.c b/arch/sh/boards/renesas/rts7751r2d/setup.c index 60907f574f34..f6ce7021feba 100644 --- a/arch/sh/boards/renesas/rts7751r2d/setup.c +++ b/arch/sh/boards/renesas/rts7751r2d/setup.c @@ -1,18 +1,76 @@ /* - * linux/arch/sh/kernel/setup_rts7751r2d.c - * - * Copyright (C) 2000 Kazumoto Kojima - * * Renesas Technology Sales RTS7751R2D Support. * - * Modified for RTS7751R2D by - * Atom Create Engineering Co., Ltd. 2002. + * Copyright (C) 2002 Atom Create Engineering Co., Ltd. + * Copyright (C) 2004 - 2006 Paul Mundt + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. */ - #include <linux/init.h> +#include <linux/platform_device.h> +#include <linux/serial_8250.h> #include <linux/pm.h> #include <asm/io.h> -#include <asm/rts7751r2d/rts7751r2d.h> +#include <asm/mach/rts7751r2d.h> +#include <asm/mach/voyagergx_reg.h> + +static struct plat_serial8250_port uart_platform_data[] = { + { + .membase = (void *)VOYAGER_UART_BASE, + .mapbase = VOYAGER_UART_BASE, + .iotype = UPIO_MEM, + .irq = VOYAGER_UART0_IRQ, + .flags = UPF_BOOT_AUTOCONF, + .regshift = 2, + .uartclk = (9600 * 16), + }, { + .flags = 0, + }, +}; + +static void __init voyagergx_serial_init(void) +{ + unsigned long val; + + /* + * GPIO Control + */ + val = inl(GPIO_MUX_HIGH); + val |= 0x00001fe0; + outl(val, GPIO_MUX_HIGH); + + /* + * Power Mode Gate + */ + val = inl(POWER_MODE0_GATE); + val |= (POWER_MODE0_GATE_U0 | POWER_MODE0_GATE_U1); + outl(val, POWER_MODE0_GATE); + + val = inl(POWER_MODE1_GATE); + val |= (POWER_MODE1_GATE_U0 | POWER_MODE1_GATE_U1); + outl(val, POWER_MODE1_GATE); +} + +static struct platform_device uart_device = { + .name = "serial8250", + .id = -1, + .dev = { + .platform_data = uart_platform_data, + }, +}; + +static struct platform_device *rts7751r2d_devices[] __initdata = { + &uart_device, +}; + +static int __init rts7751r2d_devices_setup(void) +{ + return platform_add_devices(rts7751r2d_devices, + ARRAY_SIZE(rts7751r2d_devices)); +} +__initcall(rts7751r2d_devices_setup); const char *get_system_type(void) { @@ -32,4 +90,7 @@ void __init platform_setup(void) printk(KERN_INFO "Renesas Technology Sales RTS7751R2D support.\n"); ctrl_outw(0x0000, PA_OUTPORT); pm_power_off = rts7751r2d_power_off; + + voyagergx_serial_init(); + } diff --git a/arch/sh/cchips/voyagergx/irq.c b/arch/sh/cchips/voyagergx/irq.c index 0dc1fb8f9687..036e8f900013 100644 --- a/arch/sh/cchips/voyagergx/irq.c +++ b/arch/sh/cchips/voyagergx/irq.c @@ -32,8 +32,7 @@ #include <asm/io.h> #include <asm/irq.h> -#include <asm/rts7751r2d/rts7751r2d.h> -#include <asm/rts7751r2d/voyagergx_reg.h> +#include <asm/mach/voyagergx_reg.h> static void disable_voyagergx_irq(unsigned int irq) { diff --git a/arch/sh/cchips/voyagergx/setup.c b/arch/sh/cchips/voyagergx/setup.c index 139ca88ac9e6..3a4cfaa9a214 100644 --- a/arch/sh/cchips/voyagergx/setup.c +++ b/arch/sh/cchips/voyagergx/setup.c @@ -13,7 +13,7 @@ #include <linux/init.h> #include <linux/module.h> #include <asm/io.h> -#include <asm/rts7751r2d/voyagergx_reg.h> +#include <asm/mach/voyagergx_reg.h> static int __init setup_voyagergx(void) { |