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>
15 #include <linux/sm501.h>
17 #include <asm/machvec.h>
18 #include <asm/rts7751r2d.h>
19 #include <asm/voyagergx.h>
22 static void __init
voyagergx_serial_init(void)
29 val
= readl((void __iomem
*)GPIO_MUX_HIGH
);
31 writel(val
, (void __iomem
*)GPIO_MUX_HIGH
);
36 val
= readl((void __iomem
*)POWER_MODE0_GATE
);
37 val
|= (POWER_MODE0_GATE_U0
| POWER_MODE0_GATE_U1
);
38 writel(val
, (void __iomem
*)POWER_MODE0_GATE
);
40 val
= readl((void __iomem
*)POWER_MODE1_GATE
);
41 val
|= (POWER_MODE1_GATE_U0
| POWER_MODE1_GATE_U1
);
42 writel(val
, (void __iomem
*)POWER_MODE1_GATE
);
45 static struct resource cf_ide_resources
[] = {
47 .start
= PA_AREA5_IO
+ 0x1000,
48 .end
= PA_AREA5_IO
+ 0x1000 + 0x08 - 1,
49 .flags
= IORESOURCE_MEM
,
52 .start
= PA_AREA5_IO
+ 0x80c,
53 .end
= PA_AREA5_IO
+ 0x80c + 0x16 - 1,
54 .flags
= IORESOURCE_MEM
,
57 #ifdef CONFIG_RTS7751R2D_REV11
62 .flags
= IORESOURCE_IRQ
,
66 static struct pata_platform_info pata_info
= {
70 static struct platform_device cf_ide_device
= {
71 .name
= "pata_platform",
73 .num_resources
= ARRAY_SIZE(cf_ide_resources
),
74 .resource
= cf_ide_resources
,
76 .platform_data
= &pata_info
,
80 static struct plat_serial8250_port uart_platform_data
[] = {
82 .membase
= (void __iomem
*)VOYAGER_UART_BASE
,
83 .mapbase
= VOYAGER_UART_BASE
,
85 .irq
= VOYAGER_UART0_IRQ
,
86 .flags
= UPF_BOOT_AUTOCONF
| UPF_SKIP_TEST
,
88 .uartclk
= (9600 * 16),
92 static struct platform_device uart_device
= {
94 .id
= PLAT8250_DEV_PLATFORM
,
96 .platform_data
= uart_platform_data
,
100 static struct resource heartbeat_resources
[] = {
103 .end
= PA_OUTPORT
+ 8 - 1,
104 .flags
= IORESOURCE_MEM
,
108 static struct platform_device heartbeat_device
= {
111 .num_resources
= ARRAY_SIZE(heartbeat_resources
),
112 .resource
= heartbeat_resources
,
115 static struct resource sm501_resources
[] = {
118 .end
= 0x13e00000 - 1,
119 .flags
= IORESOURCE_MEM
,
124 .flags
= IORESOURCE_MEM
,
128 .flags
= IORESOURCE_IRQ
,
132 static struct platform_device sm501_device
= {
135 .num_resources
= ARRAY_SIZE(sm501_resources
),
136 .resource
= sm501_resources
,
139 static struct platform_device
*rts7751r2d_devices
[] __initdata
= {
146 static int __init
rts7751r2d_devices_setup(void)
148 return platform_add_devices(rts7751r2d_devices
,
149 ARRAY_SIZE(rts7751r2d_devices
));
151 __initcall(rts7751r2d_devices_setup
);
153 static void rts7751r2d_power_off(void)
155 ctrl_outw(0x0001, PA_POWOFF
);
159 * Initialize the board
161 static void __init
rts7751r2d_setup(char **cmdline_p
)
163 u16 ver
= ctrl_inw(PA_VERREG
);
165 printk(KERN_INFO
"Renesas Technology Sales RTS7751R2D support.\n");
167 printk(KERN_INFO
"FPGA version:%d (revision:%d)\n",
168 (ver
>> 4) & 0xf, ver
& 0xf);
170 ctrl_outw(0x0000, PA_OUTPORT
);
171 pm_power_off
= rts7751r2d_power_off
;
173 voyagergx_serial_init();
179 static struct sh_machine_vector mv_rts7751r2d __initmv
= {
180 .mv_name
= "RTS7751R2D",
181 .mv_setup
= rts7751r2d_setup
,
184 .mv_init_irq
= init_rts7751r2d_IRQ
,
185 .mv_irq_demux
= rts7751r2d_irq_demux
,
187 #ifdef CONFIG_USB_SM501
188 .mv_consistent_alloc
= voyagergx_consistent_alloc
,
189 .mv_consistent_free
= voyagergx_consistent_free
,