2 * arch/sh/boards/renesas/sdk7780/setup.c
4 * Renesas Solutions SH7780 SDK Support
5 * Copyright (C) 2008 Nicholas Beck <nbeck@mpc-data.co.uk>
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/types.h>
13 #include <linux/platform_device.h>
14 #include <linux/ata_platform.h>
15 #include <asm/machvec.h>
16 #include <mach/sdk7780.h>
17 #include <asm/heartbeat.h>
19 #include <asm/addrspace.h>
21 #define GPIO_PECR 0xFFEA0008
24 static struct resource heartbeat_resource
= {
27 .flags
= IORESOURCE_MEM
| IORESOURCE_MEM_16BIT
,
30 static struct platform_device heartbeat_device
= {
34 .resource
= &heartbeat_resource
,
38 static struct resource smc91x_eth_resources
[] = {
40 .name
= "smc91x-regs" ,
41 .start
= PA_LAN
+ 0x300,
42 .end
= PA_LAN
+ 0x300 + 0x10 ,
43 .flags
= IORESOURCE_MEM
,
46 .start
= IRQ_ETHERNET
,
48 .flags
= IORESOURCE_IRQ
,
52 static struct platform_device smc91x_eth_device
= {
56 .dma_mask
= NULL
, /* don't use dma */
57 .coherent_dma_mask
= 0xffffffff,
59 .num_resources
= ARRAY_SIZE(smc91x_eth_resources
),
60 .resource
= smc91x_eth_resources
,
63 static struct platform_device
*sdk7780_devices
[] __initdata
= {
68 static int __init
sdk7780_devices_setup(void)
70 return platform_add_devices(sdk7780_devices
,
71 ARRAY_SIZE(sdk7780_devices
));
73 device_initcall(sdk7780_devices_setup
);
75 static void __init
sdk7780_setup(char **cmdline_p
)
77 u16 ver
= __raw_readw(FPGA_FPVERR
);
78 u16 dateStamp
= __raw_readw(FPGA_FPDATER
);
80 printk(KERN_INFO
"Renesas Technology Europe SDK7780 support.\n");
81 printk(KERN_INFO
"Board version: %d (revision %d), "
82 "FPGA version: %d (revision %d), datestamp : %d\n",
83 (ver
>> 12) & 0xf, (ver
>> 8) & 0xf,
84 (ver
>> 4) & 0xf, ver
& 0xf,
87 /* Setup pin mux'ing for PCIC */
88 __raw_writew(0x0000, GPIO_PECR
);
94 static struct sh_machine_vector mv_se7780 __initmv
= {
95 .mv_name
= "Renesas SDK7780-R3" ,
96 .mv_setup
= sdk7780_setup
,
97 .mv_init_irq
= init_sdk7780_IRQ
,