2 * Renesas Europe EDOSK7760 Board Support
4 * Copyright (C) 2008 SPES Societa' Progettazione Elettronica e Software Ltd.
5 * Author: Luca Santini <luca.santini@spesonline.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include <linux/init.h>
22 #include <linux/types.h>
23 #include <linux/platform_device.h>
24 #include <linux/smc91x.h>
25 #include <linux/interrupt.h>
26 #include <linux/i2c.h>
27 #include <asm/machvec.h>
29 #include <asm/addrspace.h>
30 #include <asm/delay.h>
31 #include <asm/i2c-sh7760.h>
33 /* Bus state controller registers for CS4 area */
34 #define BSC_CS4BCR 0xA4FD0010
35 #define BSC_CS4WCR 0xA4FD0030
37 #define SMC_IOBASE 0xA2000000
38 #define SMC_IO_OFFSET 0x300
39 #define SMC_IOADDR (SMC_IOBASE + SMC_IO_OFFSET)
41 #define ETHERNET_IRQ 5
43 /* i2c initialization functions */
44 static struct sh7760_i2c_platdata i2c_pd = {
48 static struct resource sh7760_i2c1_res[] = {
50 .start = SH7760_I2C1_MMIO,
51 .end = SH7760_I2C1_MMIOEND,
52 .flags = IORESOURCE_MEM,
54 .start = SH7760_I2C1_IRQ,
55 .end = SH7760_I2C1_IRQ,
56 .flags = IORESOURCE_IRQ,
60 static struct platform_device sh7760_i2c1_dev = {
62 .platform_data = &i2c_pd,
65 .name = SH7760_I2C_DEVNAME,
67 .resource = sh7760_i2c1_res,
68 .num_resources = ARRAY_SIZE(sh7760_i2c1_res),
71 static struct resource sh7760_i2c0_res[] = {
73 .start = SH7760_I2C0_MMIO,
74 .end = SH7760_I2C0_MMIOEND,
75 .flags = IORESOURCE_MEM,
77 .start = SH7760_I2C0_IRQ,
78 .end = SH7760_I2C0_IRQ,
79 .flags = IORESOURCE_IRQ,
83 static struct platform_device sh7760_i2c0_dev = {
85 .platform_data = &i2c_pd,
87 .name = SH7760_I2C_DEVNAME,
89 .resource = sh7760_i2c0_res,
90 .num_resources = ARRAY_SIZE(sh7760_i2c0_res),
93 /* eth initialization functions */
94 static struct smc91x_platdata smc91x_info = {
95 .flags = SMC91X_USE_16BIT | SMC91X_IO_SHIFT_1 | IORESOURCE_IRQ_LOWLEVEL,
98 static struct resource smc91x_res[] = {
101 .end = SMC_IOADDR + 0x1f,
102 .flags = IORESOURCE_MEM,
105 .start = ETHERNET_IRQ,
107 .flags = IORESOURCE_IRQ ,
111 static struct platform_device smc91x_dev = {
114 .num_resources = ARRAY_SIZE(smc91x_res),
115 .resource = smc91x_res,
118 .platform_data = &smc91x_info,
122 /* platform init code */
123 static struct platform_device *edosk7760_devices[] __initdata = {
129 static int __init init_edosk7760_devices(void)
131 plat_irq_setup_pins(IRQ_MODE_IRQ);
133 return platform_add_devices(edosk7760_devices,
134 ARRAY_SIZE(edosk7760_devices));
136 __initcall(init_edosk7760_devices);
141 struct sh_machine_vector mv_edosk7760 __initmv = {
142 .mv_name = "EDOSK7760",