Root/target/linux/lantiq/patches-2.6.32/150-falcon-easy98020.patch

1--- /dev/null
2+++ b/arch/mips/lantiq/falcon/mach-easy98020.c
3@@ -0,0 +1,115 @@
4+#include <linux/init.h>
5+#include <linux/platform_device.h>
6+#include <linux/leds.h>
7+#include <linux/gpio.h>
8+#include <linux/gpio_buttons.h>
9+#include <linux/mtd/mtd.h>
10+#include <linux/mtd/partitions.h>
11+#include <linux/input.h>
12+#include <linux/interrupt.h>
13+#include <linux/spi/spi.h>
14+#include <linux/spi/flash.h>
15+#include "../machtypes.h"
16+
17+#include "devices.h"
18+#include "dev-leds-gpio.h"
19+
20+#define EASY98020_GPIO_LED_0 9
21+#define EASY98020_GPIO_LED_1 10
22+#define EASY98020_GPIO_LED_2 11
23+#define EASY98020_GPIO_LED_3 12
24+#define EASY98020_GPIO_LED_GE0_ACT 110
25+#define EASY98020_GPIO_LED_GE0_LINK 109
26+#define EASY98020_GPIO_LED_GE1_ACT 106
27+#define EASY98020_GPIO_LED_GE1_LINK 105
28+
29+#ifdef CONFIG_MTD_PARTITIONS
30+static struct mtd_partition easy98020_spi_partitions[] =
31+{
32+ {
33+ .name = "uboot",
34+ .offset = 0x0,
35+ .size = 0x40000,
36+ },
37+ {
38+ .name = "uboot_env",
39+ .offset = 0x40000,
40+ .size = 0x40000, /* 2 sectors for redundant env. */
41+ },
42+ {
43+ .name = "linux",
44+ .offset = 0x80000,
45+ .size = 0xF80000, /* map only 16 MiB */
46+ },
47+};
48+
49+static struct flash_platform_data easy98020_spi_flash_platform_data = {
50+ .name = "sflash",
51+ .parts = easy98020_spi_partitions,
52+ .nr_parts = ARRAY_SIZE(easy98020_spi_partitions)
53+};
54+#endif
55+
56+static struct spi_board_info easy98020_spi_flash_data __initdata = {
57+ .modalias = "m25p80",
58+ .bus_num = 0,
59+ .chip_select = 0,
60+ .max_speed_hz = 10 * 1000 * 1000,
61+ .mode = SPI_MODE_3,
62+#ifdef CONFIG_MTD_PARTITIONS
63+ .platform_data = &easy98020_spi_flash_platform_data
64+#endif
65+};
66+
67+static struct gpio_led easy98020_leds_gpio[] __initdata = {
68+ {
69+ .name = "easy98020:green:0",
70+ .gpio = EASY98020_GPIO_LED_0,
71+ .active_low = 0,
72+ }, {
73+ .name = "easy98020:green:1",
74+ .gpio = EASY98020_GPIO_LED_1,
75+ .active_low = 0,
76+ }, {
77+ .name = "easy98020:green:2",
78+ .gpio = EASY98020_GPIO_LED_2,
79+ .active_low = 0,
80+ }, {
81+ .name = "easy98020:green:3",
82+ .gpio = EASY98020_GPIO_LED_3,
83+ .active_low = 0,
84+ }, {
85+ .name = "easy98020:ge0_act",
86+ .gpio = EASY98020_GPIO_LED_GE0_ACT,
87+ .active_low = 0,
88+ }, {
89+ .name = "easy98020:ge0_link",
90+ .gpio = EASY98020_GPIO_LED_GE0_LINK,
91+ .active_low = 0,
92+ }, {
93+ .name = "easy98020:ge1_act",
94+ .gpio = EASY98020_GPIO_LED_GE1_ACT,
95+ .active_low = 0,
96+ }, {
97+ .name = "easy98020:ge1_link",
98+ .gpio = EASY98020_GPIO_LED_GE1_LINK,
99+ .active_low = 0,
100+ }
101+};
102+
103+static void __init easy98020_init(void)
104+{
105+ falcon_register_asc(0);
106+ falcon_register_gpio();
107+ falcon_register_wdt();
108+ falcon_register_i2c();
109+ falcon_register_spi_flash(&easy98020_spi_flash_data);
110+ ltq_add_device_leds_gpio(-1, ARRAY_SIZE(easy98020_leds_gpio),
111+ easy98020_leds_gpio);
112+ falcon_register_crypto();
113+}
114+
115+MIPS_MACHINE(LANTIQ_MACH_EASY98020,
116+ "EASY98020",
117+ "EASY98020 Eval Board",
118+ easy98020_init);
119--- a/arch/mips/lantiq/falcon/Kconfig
120+++ b/arch/mips/lantiq/falcon/Kconfig
121@@ -6,6 +6,10 @@ config LANTIQ_MACH_EASY98000
122     bool "Easy98000"
123     default y
124 
125+config LANTIQ_MACH_EASY98020
126+ bool "Easy98020"
127+ default y
128+
129 endmenu
130 
131 endif
132--- a/arch/mips/lantiq/falcon/Makefile
133+++ b/arch/mips/lantiq/falcon/Makefile
134@@ -3,3 +3,4 @@ obj-y += softdog_vpe.o
135 obj-$(CONFIG_LANTIQ_MACH_EASY98000) += addon-easy98000.o
136 obj-$(CONFIG_LANTIQ_MACH_EASY98000) += mach-easy98000.o
137 obj-$(CONFIG_LANTIQ_MACH_EASY98000) += dev-leds-easy98000-cpld.o
138+obj-$(CONFIG_LANTIQ_MACH_EASY98020) += mach-easy98020.o
139

Archive Download this file



interactive