lantiq: bump to 3.1
[openwrt/svn-archive/archive.git] / target / linux / lantiq / files-3.1 / arch / mips / lantiq / falcon / mach-95C3AM1.c
1 #include <linux/init.h>
2 #include <linux/platform_device.h>
3 #include <linux/i2c-gpio.h>
4
5 #include <dev-gpio-leds.h>
6
7 #include "../machtypes.h"
8 #include "devices.h"
9
10 #define BOARD_95C3AM1_GPIO_LED_0 10
11 #define BOARD_95C3AM1_GPIO_LED_1 11
12 #define BOARD_95C3AM1_GPIO_LED_2 12
13 #define BOARD_95C3AM1_GPIO_LED_3 13
14
15 extern unsigned char ltq_ethaddr[6];
16
17 static struct mtd_partition board_95C3AM1_partitions[] =
18 {
19 {
20 .name = "uboot",
21 .offset = 0x0,
22 .size = 0x40000,
23 },
24 {
25 .name = "uboot_env",
26 .offset = 0x40000,
27 .size = 0x40000, /* 2 sectors for redundant env. */
28 },
29 {
30 .name = "linux",
31 .offset = 0x80000,
32 .size = 0xF80000, /* map only 16 MiB */
33 },
34 };
35
36 static struct flash_platform_data board_95C3AM1_flash_platform_data = {
37 .name = "sflash",
38 .parts = board_95C3AM1_partitions,
39 .nr_parts = ARRAY_SIZE(board_95C3AM1_partitions)
40 };
41
42 static struct spi_board_info board_95C3AM1_flash_data __initdata = {
43 .modalias = "m25p80",
44 .bus_num = 0,
45 .chip_select = 0,
46 .max_speed_hz = 10 * 1000 * 1000,
47 .mode = SPI_MODE_3,
48 .platform_data = &board_95C3AM1_flash_platform_data
49 };
50
51 static struct gpio_led board_95C3AM1_gpio_leds[] __initdata = {
52 {
53 .name = "power",
54 .gpio = BOARD_95C3AM1_GPIO_LED_0,
55 .active_low = 0,
56 }, {
57 .name = "optical",
58 .gpio = BOARD_95C3AM1_GPIO_LED_1,
59 .active_low = 0,
60 }, {
61 .name = "lan",
62 .gpio = BOARD_95C3AM1_GPIO_LED_2,
63 .active_low = 0,
64 }, {
65 .name = "update",
66 .gpio = BOARD_95C3AM1_GPIO_LED_3,
67 .active_low = 0,
68 }
69 };
70
71 static struct i2c_gpio_platform_data board_95C3AM1_i2c_gpio_data = {
72 .sda_pin = 107,
73 .scl_pin = 108,
74 };
75
76 static struct platform_device board_95C3AM1_i2c_gpio_device = {
77 .name = "i2c-gpio",
78 .id = 0,
79 .dev = {
80 .platform_data = &board_95C3AM1_i2c_gpio_data,
81 }
82 };
83
84 static void __init board_95C3AM1_init(void)
85 {
86 falcon_register_i2c();
87 falcon_register_spi_flash(&board_95C3AM1_flash_data);
88 platform_device_register(&board_95C3AM1_i2c_gpio_device);
89 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(board_95C3AM1_gpio_leds),
90 board_95C3AM1_gpio_leds);
91 }
92
93 MIPS_MACHINE(LANTIQ_MACH_95C3AM1,
94 "95C3AM1",
95 "95C3AM1 Board",
96 board_95C3AM1_init);