]>
Commit | Line | Data |
---|---|---|
3787aa11 PM |
1 | /* |
2 | * Renesas Technology Europe RSK+ 7203 Support. | |
3 | * | |
4 | * Copyright (C) 2008 Paul Mundt | |
5 | * | |
6 | * This file is subject to the terms and conditions of the GNU General Public | |
7 | * License. See the file "COPYING" in the main directory of this archive | |
8 | * for more details. | |
9 | */ | |
10 | #include <linux/init.h> | |
11 | #include <linux/types.h> | |
12 | #include <linux/platform_device.h> | |
6d0b3657 | 13 | #include <linux/interrupt.h> |
3787aa11 PM |
14 | #include <linux/mtd/mtd.h> |
15 | #include <linux/mtd/partitions.h> | |
16 | #include <linux/mtd/physmap.h> | |
17 | #include <linux/mtd/map.h> | |
8ed3592e | 18 | #include <linux/smsc911x.h> |
7a5c679b | 19 | #include <linux/gpio.h> |
bbc97411 | 20 | #include <linux/leds.h> |
3787aa11 PM |
21 | #include <asm/machvec.h> |
22 | #include <asm/io.h> | |
a51413a6 | 23 | #include <cpu/sh7203.h> |
3787aa11 | 24 | |
8ed3592e SG |
25 | static struct smsc911x_platform_config smsc911x_config = { |
26 | .phy_interface = PHY_INTERFACE_MODE_MII, | |
27 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, | |
28 | .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, | |
29 | .flags = SMSC911X_USE_16BIT, | |
6d0b3657 PM |
30 | }; |
31 | ||
8ed3592e | 32 | static struct resource smsc911x_resources[] = { |
3787aa11 PM |
33 | [0] = { |
34 | .start = 0x24000000, | |
35 | .end = 0x24000000 + 0x100, | |
36 | .flags = IORESOURCE_MEM, | |
37 | }, | |
38 | [1] = { | |
39 | .start = 64, | |
40 | .end = 64, | |
41 | .flags = IORESOURCE_IRQ, | |
42 | }, | |
43 | }; | |
44 | ||
8ed3592e SG |
45 | static struct platform_device smsc911x_device = { |
46 | .name = "smsc911x", | |
3787aa11 | 47 | .id = -1, |
8ed3592e SG |
48 | .num_resources = ARRAY_SIZE(smsc911x_resources), |
49 | .resource = smsc911x_resources, | |
6d0b3657 | 50 | .dev = { |
8ed3592e | 51 | .platform_data = &smsc911x_config, |
6d0b3657 | 52 | }, |
3787aa11 PM |
53 | }; |
54 | ||
bbc97411 PM |
55 | static struct gpio_led rsk7203_gpio_leds[] = { |
56 | { | |
57 | .name = "green", | |
58 | .gpio = GPIO_PE10, | |
59 | .active_low = 1, | |
60 | }, { | |
61 | .name = "orange", | |
62 | .default_trigger = "nand-disk", | |
63 | .gpio = GPIO_PE12, | |
64 | .active_low = 1, | |
65 | }, { | |
66 | .name = "red:timer", | |
67 | .default_trigger = "timer", | |
68 | .gpio = GPIO_PC14, | |
69 | .active_low = 1, | |
70 | }, { | |
71 | .name = "red:heartbeat", | |
72 | .default_trigger = "heartbeat", | |
73 | .gpio = GPIO_PE11, | |
74 | .active_low = 1, | |
75 | }, | |
76 | }; | |
77 | ||
78 | static struct gpio_led_platform_data rsk7203_gpio_leds_info = { | |
79 | .leds = rsk7203_gpio_leds, | |
80 | .num_leds = ARRAY_SIZE(rsk7203_gpio_leds), | |
81 | }; | |
82 | ||
83 | static struct platform_device led_device = { | |
84 | .name = "leds-gpio", | |
85 | .id = -1, | |
86 | .dev = { | |
87 | .platform_data = &rsk7203_gpio_leds_info, | |
88 | }, | |
89 | }; | |
3787aa11 PM |
90 | |
91 | static struct platform_device *rsk7203_devices[] __initdata = { | |
8ed3592e | 92 | &smsc911x_device, |
bbc97411 | 93 | &led_device, |
3787aa11 PM |
94 | }; |
95 | ||
96 | static int __init rsk7203_devices_setup(void) | |
97 | { | |
7a5c679b MD |
98 | /* Select pins for SCIF0 */ |
99 | gpio_request(GPIO_FN_TXD0, NULL); | |
100 | gpio_request(GPIO_FN_RXD0, NULL); | |
101 | ||
3787aa11 PM |
102 | return platform_add_devices(rsk7203_devices, |
103 | ARRAY_SIZE(rsk7203_devices)); | |
104 | } | |
105 | device_initcall(rsk7203_devices_setup); |