1 #include <linux/init.h>
2 #include <linux/platform_device.h>
3 #include <linux/leds.h>
4 #include <linux/gpio.h>
5 #include <linux/gpio_buttons.h>
6 #include <linux/mtd/mtd.h>
7 #include <linux/mtd/partitions.h>
8 #include <linux/input.h>
9 #include <linux/interrupt.h>
10 #include <linux/spi/spi.h>
11 #include <linux/spi/flash.h>
13 #include <dev-gpio-leds.h>
15 #include "../machtypes.h"
18 #define EASY98020_GPIO_LED_0 9
19 #define EASY98020_GPIO_LED_1 10
20 #define EASY98020_GPIO_LED_2 11
21 #define EASY98020_GPIO_LED_3 12
22 #define EASY98020_GPIO_LED_GE0_ACT 110
23 #define EASY98020_GPIO_LED_GE0_LINK 109
24 #define EASY98020_GPIO_LED_GE1_ACT 106
25 #define EASY98020_GPIO_LED_GE1_LINK 105
27 extern unsigned char ltq_ethaddr
[6];
29 static struct mtd_partition easy98020_spi_partitions
[] =
39 .size
= 0x40000, /* 2 sectors for redundant env. */
44 .size
= 0xF80000, /* map only 16 MiB */
48 static struct flash_platform_data easy98020_spi_flash_platform_data
= {
50 .parts
= easy98020_spi_partitions
,
51 .nr_parts
= ARRAY_SIZE(easy98020_spi_partitions
)
54 static struct spi_board_info easy98020_spi_flash_data __initdata
= {
58 .max_speed_hz
= 10 * 1000 * 1000,
60 .platform_data
= &easy98020_spi_flash_platform_data
63 static struct gpio_led easy98020_gpio_leds
[] __initdata
= {
65 .name
= "easy98020:green:0",
66 .gpio
= EASY98020_GPIO_LED_0
,
69 .name
= "easy98020:green:1",
70 .gpio
= EASY98020_GPIO_LED_1
,
73 .name
= "easy98020:green:2",
74 .gpio
= EASY98020_GPIO_LED_2
,
77 .name
= "easy98020:green:3",
78 .gpio
= EASY98020_GPIO_LED_3
,
81 .name
= "easy98020:ge0_act",
82 .gpio
= EASY98020_GPIO_LED_GE0_ACT
,
85 .name
= "easy98020:ge0_link",
86 .gpio
= EASY98020_GPIO_LED_GE0_LINK
,
89 .name
= "easy98020:ge1_act",
90 .gpio
= EASY98020_GPIO_LED_GE1_ACT
,
93 .name
= "easy98020:ge1_link",
94 .gpio
= EASY98020_GPIO_LED_GE1_LINK
,
99 static void __init
easy98020_init(void)
101 falcon_register_i2c();
102 falcon_register_spi_flash(&easy98020_spi_flash_data
);
103 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(easy98020_gpio_leds
),
104 easy98020_gpio_leds
);
107 MIPS_MACHINE(LANTIQ_MACH_EASY98020
,
109 "EASY98020 Eval Board",
112 MIPS_MACHINE(LANTIQ_MACH_EASY98020_1LAN
,
114 "EASY98020 Eval Board (1 LAN port)",
117 MIPS_MACHINE(LANTIQ_MACH_EASY98020_2LAN
,
119 "EASY98020 Eval Board (2 LAN ports)",