Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[deliverable/linux.git] / arch / sh / boards / se / 7780 / setup.c
CommitLineData
b7576230
NI
1/*
2 * linux/arch/sh/boards/se/7780/setup.c
3 *
4 * Copyright (C) 2006,2007 Nobuhiro Iwamatsu
5 *
6 * Hitachi UL SolutionEngine 7780 Support.
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 <asm/machvec.h>
15#include <asm/se7780.h>
16#include <asm/io.h>
17
18/* Heartbeat */
b7576230
NI
19static struct resource heartbeat_resources[] = {
20 [0] = {
21 .start = PA_LED,
a1fd306b 22 .end = PA_LED,
b7576230
NI
23 .flags = IORESOURCE_MEM,
24 },
25};
26
27static struct platform_device heartbeat_device = {
28 .name = "heartbeat",
29 .id = -1,
b7576230
NI
30 .num_resources = ARRAY_SIZE(heartbeat_resources),
31 .resource = heartbeat_resources,
32};
33
34/* SMC91x */
35static struct resource smc91x_eth_resources[] = {
36 [0] = {
37 .name = "smc91x-regs" ,
38 .start = PA_LAN + 0x300,
39 .end = PA_LAN + 0x300 + 0x10 ,
40 .flags = IORESOURCE_MEM,
41 },
42 [1] = {
43 .start = SMC_IRQ,
44 .end = SMC_IRQ,
45 .flags = IORESOURCE_IRQ,
46 },
47};
48
49static struct platform_device smc91x_eth_device = {
50 .name = "smc91x",
51 .id = 0,
52 .dev = {
53 .dma_mask = NULL, /* don't use dma */
54 .coherent_dma_mask = 0xffffffff,
55 },
56 .num_resources = ARRAY_SIZE(smc91x_eth_resources),
57 .resource = smc91x_eth_resources,
58};
59
60static struct platform_device *se7780_devices[] __initdata = {
61 &heartbeat_device,
62 &smc91x_eth_device,
63};
64
65static int __init se7780_devices_setup(void)
66{
67 return platform_add_devices(se7780_devices,
68 ARRAY_SIZE(se7780_devices));
69}
70device_initcall(se7780_devices_setup);
71
72#define GPIO_PHCR 0xFFEA000E
73#define GPIO_PMSELR 0xFFEA0080
74#define GPIO_PECR 0xFFEA0008
75
76static void __init se7780_setup(char **cmdline_p)
77{
78 /* "SH-Linux" on LED Display */
79 ctrl_outw( 'S' , PA_LED_DISP + (DISP_SEL0_ADDR << 1) );
80 ctrl_outw( 'H' , PA_LED_DISP + (DISP_SEL1_ADDR << 1) );
81 ctrl_outw( '-' , PA_LED_DISP + (DISP_SEL2_ADDR << 1) );
82 ctrl_outw( 'L' , PA_LED_DISP + (DISP_SEL3_ADDR << 1) );
83 ctrl_outw( 'i' , PA_LED_DISP + (DISP_SEL4_ADDR << 1) );
84 ctrl_outw( 'n' , PA_LED_DISP + (DISP_SEL5_ADDR << 1) );
85 ctrl_outw( 'u' , PA_LED_DISP + (DISP_SEL6_ADDR << 1) );
86 ctrl_outw( 'x' , PA_LED_DISP + (DISP_SEL7_ADDR << 1) );
87
88 printk(KERN_INFO "Hitachi UL Solutions Engine 7780SE03 support.\n");
89
90 /*
91 * PCI REQ/GNT setting
92 * REQ0/GNT0 -> USB
93 * REQ1/GNT1 -> PC Card
94 * REQ2/GNT2 -> Serial ATA
95 * REQ3/GNT3 -> PCI slot
96 */
97 ctrl_outw(0x0213, FPGA_REQSEL);
98
99 /* GPIO setting */
100 ctrl_outw(0x0000, GPIO_PECR);
101 ctrl_outw(ctrl_inw(GPIO_PHCR)&0xfff3, GPIO_PHCR);
102 ctrl_outw(0x0c00, GPIO_PMSELR);
103
104 /* iVDR Power ON */
105 ctrl_outw(0x0001, FPGA_IVDRPW);
106}
107
108/*
109 * The Machine Vector
110 */
82f81f47 111static struct sh_machine_vector mv_se7780 __initmv = {
b7576230
NI
112 .mv_name = "Solution Engine 7780" ,
113 .mv_setup = se7780_setup ,
114 .mv_nr_irqs = 111 ,
115 .mv_init_irq = init_se7780_IRQ,
116};
This page took 0.068332 seconds and 5 git commands to generate.