2 * Renesas Technology Sales RTS7751R2D Support.
4 * Copyright (C) 2002 - 2006 Atom Create Engineering Co., Ltd.
5 * Copyright (C) 2004 - 2007 Paul Mundt
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
11 #include <linux/init.h>
12 #include <linux/platform_device.h>
13 #include <linux/pata_platform.h>
14 #include <linux/serial_8250.h>
16 #include <asm/machvec.h>
17 #include <asm/rts7751r2d.h>
18 #include <asm/voyagergx.h>
21 static void __init voyagergx_serial_init(void)
28 val = readl((void __iomem *)GPIO_MUX_HIGH);
30 writel(val, (void __iomem *)GPIO_MUX_HIGH);
35 val = readl((void __iomem *)POWER_MODE0_GATE);
36 val |= (POWER_MODE0_GATE_U0 | POWER_MODE0_GATE_U1);
37 writel(val, (void __iomem *)POWER_MODE0_GATE);
39 val = readl((void __iomem *)POWER_MODE1_GATE);
40 val |= (POWER_MODE1_GATE_U0 | POWER_MODE1_GATE_U1);
41 writel(val, (void __iomem *)POWER_MODE1_GATE);
44 static struct resource cf_ide_resources[] = {
46 .start = PA_AREA5_IO + 0x1000,
47 .end = PA_AREA5_IO + 0x1000 + 0x08 - 1,
48 .flags = IORESOURCE_MEM,
51 .start = PA_AREA5_IO + 0x80c,
52 .end = PA_AREA5_IO + 0x80c + 0x16 - 1,
53 .flags = IORESOURCE_MEM,
56 #ifdef CONFIG_RTS7751R2D_REV11
61 .flags = IORESOURCE_IRQ,
65 static struct pata_platform_info pata_info = {
69 static struct platform_device cf_ide_device = {
70 .name = "pata_platform",
72 .num_resources = ARRAY_SIZE(cf_ide_resources),
73 .resource = cf_ide_resources,
75 .platform_data = &pata_info,
79 static struct plat_serial8250_port uart_platform_data[] = {
81 .membase = (void __iomem *)VOYAGER_UART_BASE,
82 .mapbase = VOYAGER_UART_BASE,
84 .irq = VOYAGER_UART0_IRQ,
85 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
87 .uartclk = (9600 * 16),
91 static struct platform_device uart_device = {
93 .id = PLAT8250_DEV_PLATFORM,
95 .platform_data = uart_platform_data,
99 static struct resource heartbeat_resources[] = {
102 .end = PA_OUTPORT + 8 - 1,
103 .flags = IORESOURCE_MEM,
107 static struct platform_device heartbeat_device = {
110 .num_resources = ARRAY_SIZE(heartbeat_resources),
111 .resource = heartbeat_resources,
114 static struct platform_device *rts7751r2d_devices[] __initdata = {
120 static int __init rts7751r2d_devices_setup(void)
122 return platform_add_devices(rts7751r2d_devices,
123 ARRAY_SIZE(rts7751r2d_devices));
125 __initcall(rts7751r2d_devices_setup);
127 static void rts7751r2d_power_off(void)
129 ctrl_outw(0x0001, PA_POWOFF);
133 * Initialize the board
135 static void __init rts7751r2d_setup(char **cmdline_p)
137 u16 ver = ctrl_inw(PA_VERREG);
139 printk(KERN_INFO "Renesas Technology Sales RTS7751R2D support.\n");
141 printk(KERN_INFO "FPGA version:%d (revision:%d)\n",
142 (ver >> 4) & 0xf, ver & 0xf);
144 ctrl_outw(0x0000, PA_OUTPORT);
145 pm_power_off = rts7751r2d_power_off;
147 voyagergx_serial_init();
153 struct sh_machine_vector mv_rts7751r2d __initmv = {
154 .mv_name = "RTS7751R2D",
155 .mv_setup = rts7751r2d_setup,
158 .mv_init_irq = init_rts7751r2d_IRQ,
159 .mv_irq_demux = rts7751r2d_irq_demux,
161 #ifdef CONFIG_USB_SM501
162 .mv_consistent_alloc = voyagergx_consistent_alloc,
163 .mv_consistent_free = voyagergx_consistent_free,