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 static struct mtd_partition easy98020_spi_partitions
[] =
37 .size
= 0x40000, /* 2 sectors for redundant env. */
42 .size
= 0xF80000, /* map only 16 MiB */
46 static struct flash_platform_data easy98020_spi_flash_platform_data
= {
48 .parts
= easy98020_spi_partitions
,
49 .nr_parts
= ARRAY_SIZE(easy98020_spi_partitions
)
52 static struct spi_board_info easy98020_spi_flash_data __initdata
= {
56 .max_speed_hz
= 10 * 1000 * 1000,
58 .platform_data
= &easy98020_spi_flash_platform_data
61 static struct gpio_led easy98020_gpio_leds
[] __initdata
= {
63 .name
= "easy98020:green:0",
64 .gpio
= EASY98020_GPIO_LED_0
,
67 .name
= "easy98020:green:1",
68 .gpio
= EASY98020_GPIO_LED_1
,
71 .name
= "easy98020:green:2",
72 .gpio
= EASY98020_GPIO_LED_2
,
75 .name
= "easy98020:green:3",
76 .gpio
= EASY98020_GPIO_LED_3
,
79 .name
= "easy98020:ge0_act",
80 .gpio
= EASY98020_GPIO_LED_GE0_ACT
,
83 .name
= "easy98020:ge0_link",
84 .gpio
= EASY98020_GPIO_LED_GE0_LINK
,
87 .name
= "easy98020:ge1_act",
88 .gpio
= EASY98020_GPIO_LED_GE1_ACT
,
91 .name
= "easy98020:ge1_link",
92 .gpio
= EASY98020_GPIO_LED_GE1_LINK
,
97 static void __init
easy98020_init(void)
99 falcon_register_i2c();
100 falcon_register_spi_flash(&easy98020_spi_flash_data
);
101 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(easy98020_gpio_leds
),
102 easy98020_gpio_leds
);
105 MIPS_MACHINE(LANTIQ_MACH_EASY98020
,
107 "EASY98020 Eval Board",
110 MIPS_MACHINE(LANTIQ_MACH_EASY98020_1LAN
,
112 "EASY98020 Eval Board (1 LAN port)",
115 MIPS_MACHINE(LANTIQ_MACH_EASY98020_2LAN
,
117 "EASY98020 Eval Board (2 LAN ports)",