2 * linux/arch/sh/boards/se/7780/setup.c
4 * Copyright (C) 2006,2007 Nobuhiro Iwamatsu
6 * Hitachi UL SolutionEngine 7780 Support.
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
12 #include <linux/init.h>
13 #include <linux/platform_device.h>
14 #include <asm/machvec.h>
15 #include <asm/se7780.h>
19 static unsigned char heartbeat_bit_pos[] = { 0, 1, 2, 3, 4, 5, 6, 7 };
21 static struct resource heartbeat_resources[] = {
24 .end = PA_LED + ARRAY_SIZE(heartbeat_bit_pos) - 1,
25 .flags = IORESOURCE_MEM,
29 static struct platform_device heartbeat_device = {
33 .platform_data = heartbeat_bit_pos,
35 .num_resources = ARRAY_SIZE(heartbeat_resources),
36 .resource = heartbeat_resources,
40 static struct resource smc91x_eth_resources[] = {
42 .name = "smc91x-regs" ,
43 .start = PA_LAN + 0x300,
44 .end = PA_LAN + 0x300 + 0x10 ,
45 .flags = IORESOURCE_MEM,
50 .flags = IORESOURCE_IRQ,
54 static struct platform_device smc91x_eth_device = {
58 .dma_mask = NULL, /* don't use dma */
59 .coherent_dma_mask = 0xffffffff,
61 .num_resources = ARRAY_SIZE(smc91x_eth_resources),
62 .resource = smc91x_eth_resources,
65 static struct platform_device *se7780_devices[] __initdata = {
70 static int __init se7780_devices_setup(void)
72 return platform_add_devices(se7780_devices,
73 ARRAY_SIZE(se7780_devices));
75 device_initcall(se7780_devices_setup);
77 #define GPIO_PHCR 0xFFEA000E
78 #define GPIO_PMSELR 0xFFEA0080
79 #define GPIO_PECR 0xFFEA0008
81 static void __init se7780_setup(char **cmdline_p)
83 /* "SH-Linux" on LED Display */
84 ctrl_outw( 'S' , PA_LED_DISP + (DISP_SEL0_ADDR << 1) );
85 ctrl_outw( 'H' , PA_LED_DISP + (DISP_SEL1_ADDR << 1) );
86 ctrl_outw( '-' , PA_LED_DISP + (DISP_SEL2_ADDR << 1) );
87 ctrl_outw( 'L' , PA_LED_DISP + (DISP_SEL3_ADDR << 1) );
88 ctrl_outw( 'i' , PA_LED_DISP + (DISP_SEL4_ADDR << 1) );
89 ctrl_outw( 'n' , PA_LED_DISP + (DISP_SEL5_ADDR << 1) );
90 ctrl_outw( 'u' , PA_LED_DISP + (DISP_SEL6_ADDR << 1) );
91 ctrl_outw( 'x' , PA_LED_DISP + (DISP_SEL7_ADDR << 1) );
93 printk(KERN_INFO "Hitachi UL Solutions Engine 7780SE03 support.\n");
98 * REQ1/GNT1 -> PC Card
99 * REQ2/GNT2 -> Serial ATA
100 * REQ3/GNT3 -> PCI slot
102 ctrl_outw(0x0213, FPGA_REQSEL);
105 ctrl_outw(0x0000, GPIO_PECR);
106 ctrl_outw(ctrl_inw(GPIO_PHCR)&0xfff3, GPIO_PHCR);
107 ctrl_outw(0x0c00, GPIO_PMSELR);
110 ctrl_outw(0x0001, FPGA_IVDRPW);
116 static struct sh_machine_vector mv_se7780 __initmv = {
117 .mv_name = "Solution Engine 7780" ,
118 .mv_setup = se7780_setup ,
120 .mv_init_irq = init_se7780_IRQ,