2 * arch/sh/boards/renesas/r7780rp/setup.c
4 * Copyright (C) 2002 Atom Create Engineering Co., Ltd.
5 * Copyright (C) 2005, 2006 Paul Mundt
7 * Renesas Solutions Highlander R7780RP-1 Support.
9 * This file is subject to the terms and conditions of the GNU General Public
10 * License. See the file "COPYING" in the main directory of this archive
13 #include <linux/init.h>
14 #include <linux/platform_device.h>
15 #include <asm/machvec.h>
16 #include <asm/r7780rp/r7780rp.h>
17 #include <asm/clock.h>
20 extern void heartbeat_r7780rp(void);
21 extern void init_r7780rp_IRQ(void);
23 static struct resource m66596_usb_host_resources[] = {
27 .flags = IORESOURCE_MEM,
30 .start = 6, /* irq number */
32 .flags = IORESOURCE_IRQ,
36 static struct platform_device m66596_usb_host_device = {
40 .dma_mask = NULL, /* don't use dma */
41 .coherent_dma_mask = 0xffffffff,
43 .num_resources = ARRAY_SIZE(m66596_usb_host_resources),
44 .resource = m66596_usb_host_resources,
47 static struct platform_device *r7780rp_devices[] __initdata = {
48 &m66596_usb_host_device,
51 static int __init r7780rp_devices_setup(void)
53 return platform_add_devices(r7780rp_devices,
54 ARRAY_SIZE(r7780rp_devices));
58 * Platform specific clocks
60 static void ivdr_clk_enable(struct clk *clk)
62 ctrl_outw(ctrl_inw(PA_IVDRCTL) | (1 << 8), PA_IVDRCTL);
65 static void ivdr_clk_disable(struct clk *clk)
67 ctrl_outw(ctrl_inw(PA_IVDRCTL) & ~(1 << 8), PA_IVDRCTL);
70 static struct clk_ops ivdr_clk_ops = {
71 .enable = ivdr_clk_enable,
72 .disable = ivdr_clk_disable,
75 static struct clk ivdr_clk = {
80 static struct clk *r7780rp_clocks[] = {
84 static void r7780rp_power_off(void)
86 #ifdef CONFIG_SH_R7780MP
87 ctrl_outw(0x0001, PA_POFF);
92 * Initialize the board
94 static void __init r7780rp_setup(char **cmdline_p)
96 u16 ver = ctrl_inw(PA_VERREG);
99 device_initcall(r7780rp_devices_setup);
101 printk(KERN_INFO "Renesas Solutions Highlander R7780RP-1 support.\n");
103 printk(KERN_INFO "Board version: %d (revision %d), "
104 "FPGA version: %d (revision %d)\n",
105 (ver >> 12) & 0xf, (ver >> 8) & 0xf,
106 (ver >> 4) & 0xf, ver & 0xf);
109 * Enable the important clocks right away..
111 for (i = 0; i < ARRAY_SIZE(r7780rp_clocks); i++) {
112 struct clk *clk = r7780rp_clocks[i];
118 ctrl_outw(0x0000, PA_OBLED); /* Clear LED. */
119 #ifndef CONFIG_SH_R7780MP
120 ctrl_outw(0x0001, PA_SDPOW); /* SD Power ON */
122 ctrl_outw(ctrl_inw(PA_IVDRCTL) | 0x0100, PA_IVDRCTL); /* Si13112 */
124 pm_power_off = r7780rp_power_off;
130 struct sh_machine_vector mv_r7780rp __initmv = {
131 .mv_name = "Highlander R7780RP-1",
132 .mv_setup = r7780rp_setup,
136 .mv_inb = r7780rp_inb,
137 .mv_inw = r7780rp_inw,
138 .mv_inl = r7780rp_inl,
139 .mv_outb = r7780rp_outb,
140 .mv_outw = r7780rp_outw,
141 .mv_outl = r7780rp_outl,
143 .mv_inb_p = r7780rp_inb_p,
144 .mv_inw_p = r7780rp_inw,
145 .mv_inl_p = r7780rp_inl,
146 .mv_outb_p = r7780rp_outb_p,
147 .mv_outw_p = r7780rp_outw,
148 .mv_outl_p = r7780rp_outl,
150 .mv_insb = r7780rp_insb,
151 .mv_insw = r7780rp_insw,
152 .mv_insl = r7780rp_insl,
153 .mv_outsb = r7780rp_outsb,
154 .mv_outsw = r7780rp_outsw,
155 .mv_outsl = r7780rp_outsl,
157 .mv_ioport_map = r7780rp_ioport_map,
158 .mv_init_irq = init_r7780rp_IRQ,
159 #ifdef CONFIG_HEARTBEAT
160 .mv_heartbeat = heartbeat_r7780rp,