blob: 5e24c17bbdada596e810726b6b8066864b7773f9 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * arch/sh/boards/renesas/edosk7705/setup.c
3 *
4 * Copyright (C) 2000 Kazumoto Kojima
5 *
6 * Hitachi SolutionEngine Support.
7 *
8 * Modified for edosk7705 development
9 * board by S. Dunn, 2003.
10 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070011#include <linux/init.h>
Paul Mundt866ef8f2008-12-17 13:57:15 +090012#include <linux/irq.h>
Paul Mundtc1cfed32010-10-29 19:34:13 +090013#include <linux/platform_device.h>
14#include <linux/interrupt.h>
15#include <linux/smc91x.h>
Paul Mundt0fa4c392012-05-18 14:48:53 +090016#include <linux/sh_intc.h>
Paul Mundtc1cfed32010-10-29 19:34:13 +090017#include <asm/machvec.h>
18#include <asm/sizes.h>
19
20#define SMC_IOBASE 0xA2000000
21#define SMC_IO_OFFSET 0x300
22#define SMC_IOADDR (SMC_IOBASE + SMC_IO_OFFSET)
23
Paul Mundt0fa4c392012-05-18 14:48:53 +090024#define ETHERNET_IRQ evt2irq(0x320)
Linus Torvalds1da177e2005-04-16 15:20:36 -070025
Paul Mundt2c7834a2006-09-27 18:17:31 +090026static void __init sh_edosk7705_init_irq(void)
27{
Paul Mundtc1cfed32010-10-29 19:34:13 +090028 make_imask_irq(ETHERNET_IRQ);
Paul Mundt2c7834a2006-09-27 18:17:31 +090029}
Linus Torvalds1da177e2005-04-16 15:20:36 -070030
Paul Mundtc1cfed32010-10-29 19:34:13 +090031/* eth initialization functions */
32static struct smc91x_platdata smc91x_info = {
33 .flags = SMC91X_USE_16BIT | SMC91X_IO_SHIFT_1 | IORESOURCE_IRQ_LOWLEVEL,
34};
35
36static struct resource smc91x_res[] = {
37 [0] = {
38 .start = SMC_IOADDR,
39 .end = SMC_IOADDR + SZ_32 - 1,
40 .flags = IORESOURCE_MEM,
41 },
42 [1] = {
43 .start = ETHERNET_IRQ,
44 .end = ETHERNET_IRQ,
45 .flags = IORESOURCE_IRQ ,
46 }
47};
48
49static struct platform_device smc91x_dev = {
50 .name = "smc91x",
51 .id = -1,
52 .num_resources = ARRAY_SIZE(smc91x_res),
53 .resource = smc91x_res,
54
55 .dev = {
56 .platform_data = &smc91x_info,
57 },
58};
59
60/* platform init code */
61static struct platform_device *edosk7705_devices[] __initdata = {
62 &smc91x_dev,
63};
64
65static int __init init_edosk7705_devices(void)
66{
67 return platform_add_devices(edosk7705_devices,
68 ARRAY_SIZE(edosk7705_devices));
69}
Nobuhiro Iwamatsu95d210c2011-01-07 03:02:15 +000070device_initcall(init_edosk7705_devices);
Paul Mundtc1cfed32010-10-29 19:34:13 +090071
Linus Torvalds1da177e2005-04-16 15:20:36 -070072/*
73 * The Machine Vector
74 */
Paul Mundt82f81f42007-05-15 15:19:34 +090075static struct sh_machine_vector mv_edosk7705 __initmv = {
Paul Mundt2c7834a2006-09-27 18:17:31 +090076 .mv_name = "EDOSK7705",
Paul Mundt2c7834a2006-09-27 18:17:31 +090077 .mv_init_irq = sh_edosk7705_init_irq,
Linus Torvalds1da177e2005-04-16 15:20:36 -070078};