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 "../machtypes.h"
15 #include "dev-leds-gpio.h"
17 #define EASY98020_GPIO_LED_0 9
18 #define EASY98020_GPIO_LED_1 10
19 #define EASY98020_GPIO_LED_2 11
20 #define EASY98020_GPIO_LED_3 12
21 #define EASY98020_GPIO_LED_GE0_ACT 110
22 #define EASY98020_GPIO_LED_GE0_LINK 109
23 #define EASY98020_GPIO_LED_GE1_ACT 106
24 #define EASY98020_GPIO_LED_GE1_LINK 105
26 extern unsigned char ltq_ethaddr[6];
28 static struct mtd_partition easy98020_spi_partitions[] =
38 .size = 0x40000, /* 2 sectors for redundant env. */
43 .size = 0xF80000, /* map only 16 MiB */
47 static struct flash_platform_data easy98020_spi_flash_platform_data = {
49 .parts = easy98020_spi_partitions,
50 .nr_parts = ARRAY_SIZE(easy98020_spi_partitions)
53 static struct spi_board_info easy98020_spi_flash_data __initdata = {
57 .max_speed_hz = 10 * 1000 * 1000,
59 .platform_data = &easy98020_spi_flash_platform_data
62 static struct gpio_led easy98020_leds_gpio[] __initdata = {
64 .name = "easy98020:green:0",
65 .gpio = EASY98020_GPIO_LED_0,
68 .name = "easy98020:green:1",
69 .gpio = EASY98020_GPIO_LED_1,
72 .name = "easy98020:green:2",
73 .gpio = EASY98020_GPIO_LED_2,
76 .name = "easy98020:green:3",
77 .gpio = EASY98020_GPIO_LED_3,
80 .name = "easy98020:ge0_act",
81 .gpio = EASY98020_GPIO_LED_GE0_ACT,
84 .name = "easy98020:ge0_link",
85 .gpio = EASY98020_GPIO_LED_GE0_LINK,
88 .name = "easy98020:ge1_act",
89 .gpio = EASY98020_GPIO_LED_GE1_ACT,
92 .name = "easy98020:ge1_link",
93 .gpio = EASY98020_GPIO_LED_GE1_LINK,
98 static void __init easy98020_init(void)
100 falcon_register_i2c();
101 falcon_register_spi_flash(&easy98020_spi_flash_data);
102 ltq_add_device_leds_gpio(-1, ARRAY_SIZE(easy98020_leds_gpio),
103 easy98020_leds_gpio);
106 MIPS_MACHINE(LANTIQ_MACH_EASY98020,
108 "EASY98020 Eval Board",
111 MIPS_MACHINE(LANTIQ_MACH_EASY98020_1LAN,
113 "EASY98020 Eval Board (1 LAN port)",
116 MIPS_MACHINE(LANTIQ_MACH_EASY98020_2LAN,
118 "EASY98020 Eval Board (2 LAN ports)",