aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards/renesas/x3proto/setup.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-13 12:49:04 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-13 12:49:04 -0400
commitdcf397f037f52add9945eced57ca300ab6a4413c (patch)
treee78767d164589e9097a54bf564b072fb01f80820 /arch/sh/boards/renesas/x3proto/setup.c
parent6faf035cf9fdd8283c2b2b2c34b76b5445ec6fc4 (diff)
parent68ee0f9c98a42e36f9eab29155b2bb0e7e409ac6 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (124 commits) sh: allow building for both r2d boards in same binary. sh: fix r2d board detection sh: Discard .exit.text/.exit.data at runtime. sh: Fix up some section alignments in linker script. sh: Fix SH-4 DMAC CHCR masking. sh: Rip out left-over nommu cond syscall cruft. sh: Make kgdb i-cache flushing less inept. sh: kgdb section mismatches and tidying. sh: cleanup struct irqaction initializers. sh: early_printk tidying. video: pvr2fb: Add TV (RGB) support to Dreamcast PVR driver. sh: Conditionalize gUSA support. sh: Follow gUSA preempt changes in __switch_to(). sh: Tidy up gUSA preempt handling. sh: __copy_user() optimizations for small copies. sh: clkfwk: Support multi-level clock propagation. sh: Fix URAM start address on SH7785. sh: Use boot_cpu_data for CPU probe. sh: Support extended mode TLB on SH-X3. sh: Bump MAX_ACTIVE_REGIONS for SH7785. ...
Diffstat (limited to 'arch/sh/boards/renesas/x3proto/setup.c')
-rw-r--r--arch/sh/boards/renesas/x3proto/setup.c136
1 files changed, 136 insertions, 0 deletions
diff --git a/arch/sh/boards/renesas/x3proto/setup.c b/arch/sh/boards/renesas/x3proto/setup.c
new file mode 100644
index 000000000000..abc5b6d418fe
--- /dev/null
+++ b/arch/sh/boards/renesas/x3proto/setup.c
@@ -0,0 +1,136 @@
1/*
2 * arch/sh/boards/renesas/x3proto/setup.c
3 *
4 * Renesas SH-X3 Prototype Board Support.
5 *
6 * Copyright (C) 2007 Paul Mundt
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/kernel.h>
15#include <linux/io.h>
16#include <asm/ilsel.h>
17
18static struct resource heartbeat_resources[] = {
19 [0] = {
20 .start = 0xb8140020,
21 .end = 0xb8140020,
22 .flags = IORESOURCE_MEM,
23 },
24};
25
26static struct platform_device heartbeat_device = {
27 .name = "heartbeat",
28 .id = -1,
29 .num_resources = ARRAY_SIZE(heartbeat_resources),
30 .resource = heartbeat_resources,
31};
32
33static struct resource smc91x_resources[] = {
34 [0] = {
35 .start = 0x18000300,
36 .end = 0x18000300 + 0x10 - 1,
37 .flags = IORESOURCE_MEM,
38 },
39 [1] = {
40 /* Filled in by ilsel */
41 .flags = IORESOURCE_IRQ,
42 },
43};
44
45static struct platform_device smc91x_device = {
46 .name = "smc91x",
47 .id = -1,
48 .resource = smc91x_resources,
49 .num_resources = ARRAY_SIZE(smc91x_resources),
50};
51
52static struct resource r8a66597_usb_host_resources[] = {
53 [0] = {
54 .name = "r8a66597_hcd",
55 .start = 0x18040000,
56 .end = 0x18080000 - 1,
57 .flags = IORESOURCE_MEM,
58 },
59 [1] = {
60 .name = "r8a66597_hcd",
61 /* Filled in by ilsel */
62 .flags = IORESOURCE_IRQ,
63 },
64};
65
66static struct platform_device r8a66597_usb_host_device = {
67 .name = "r8a66597_hcd",
68 .id = -1,
69 .dev = {
70 .dma_mask = NULL, /* don't use dma */
71 .coherent_dma_mask = 0xffffffff,
72 },
73 .num_resources = ARRAY_SIZE(r8a66597_usb_host_resources),
74 .resource = r8a66597_usb_host_resources,
75};
76
77static struct resource m66592_usb_peripheral_resources[] = {
78 [0] = {
79 .name = "m66592_udc",
80 .start = 0x18080000,
81 .end = 0x180c0000 - 1,
82 .flags = IORESOURCE_MEM,
83 },
84 [1] = {
85 .name = "m66592_udc",
86 /* Filled in by ilsel */
87 .flags = IORESOURCE_IRQ,
88 },
89};
90
91static struct platform_device m66592_usb_peripheral_device = {
92 .name = "m66592_udc",
93 .id = -1,
94 .dev = {
95 .dma_mask = NULL, /* don't use dma */
96 .coherent_dma_mask = 0xffffffff,
97 },
98 .num_resources = ARRAY_SIZE(m66592_usb_peripheral_resources),
99 .resource = m66592_usb_peripheral_resources,
100};
101
102static struct platform_device *x3proto_devices[] __initdata = {
103 &heartbeat_device,
104 &smc91x_device,
105 &r8a66597_usb_host_device,
106 &m66592_usb_peripheral_device,
107};
108
109static int __init x3proto_devices_setup(void)
110{
111 r8a66597_usb_host_resources[1].start =
112 r8a66597_usb_host_resources[1].end = ilsel_enable(ILSEL_USBH_I);
113
114 m66592_usb_peripheral_resources[1].start =
115 m66592_usb_peripheral_resources[1].end = ilsel_enable(ILSEL_USBP_I);
116
117 smc91x_resources[1].start =
118 smc91x_resources[1].end = ilsel_enable(ILSEL_LAN);
119
120 return platform_add_devices(x3proto_devices,
121 ARRAY_SIZE(x3proto_devices));
122}
123device_initcall(x3proto_devices_setup);
124
125static void __init x3proto_init_irq(void)
126{
127 plat_irq_setup_pins(IRQ_MODE_IRL3210);
128
129 /* Set ICR0.LVLMODE */
130 ctrl_outl(ctrl_inl(0xfe410000) | (1 << 21), 0xfe410000);
131}
132
133static struct sh_machine_vector mv_x3proto __initmv = {
134 .mv_name = "x3proto",
135 .mv_init_irq = x3proto_init_irq,
136};