Root/target/linux/lantiq/patches-2.6.32/160-falcon-95C3AM1.patch

1--- /dev/null
2+++ b/arch/mips/lantiq/falcon/mach-95C3AM1.c
3@@ -0,0 +1,101 @@
4+#include <linux/init.h>
5+#include <linux/platform_device.h>
6+#include <linux/i2c-gpio.h>
7+#include "../machtypes.h"
8+
9+#include "devices.h"
10+#include "dev-leds-gpio.h"
11+
12+#define BOARD_95C3AM1_GPIO_LED_0 10
13+#define BOARD_95C3AM1_GPIO_LED_1 11
14+#define BOARD_95C3AM1_GPIO_LED_2 12
15+#define BOARD_95C3AM1_GPIO_LED_3 13
16+
17+#ifdef CONFIG_MTD_PARTITIONS
18+static struct mtd_partition board_95C3AM1_partitions[] =
19+{
20+ {
21+ .name = "uboot",
22+ .offset = 0x0,
23+ .size = 0x40000,
24+ },
25+ {
26+ .name = "uboot_env",
27+ .offset = 0x40000,
28+ .size = 0x40000, /* 2 sectors for redundant env. */
29+ },
30+ {
31+ .name = "linux",
32+ .offset = 0x80000,
33+ .size = 0xF80000, /* map only 16 MiB */
34+ },
35+};
36+
37+static struct flash_platform_data board_95C3AM1_flash_platform_data = {
38+ .name = "sflash",
39+ .parts = board_95C3AM1_partitions,
40+ .nr_parts = ARRAY_SIZE(board_95C3AM1_partitions)
41+};
42+#endif
43+
44+static struct spi_board_info board_95C3AM1_flash_data __initdata = {
45+ .modalias = "m25p80",
46+ .bus_num = 0,
47+ .chip_select = 0,
48+ .max_speed_hz = 10 * 1000 * 1000,
49+ .mode = SPI_MODE_3,
50+#ifdef CONFIG_MTD_PARTITIONS
51+ .platform_data = &board_95C3AM1_flash_platform_data
52+#endif
53+};
54+
55+static struct gpio_led board_95C3AM1_leds_gpio[] __initdata = {
56+ {
57+ .name = "power",
58+ .gpio = BOARD_95C3AM1_GPIO_LED_0,
59+ .active_low = 0,
60+ }, {
61+ .name = "optical",
62+ .gpio = BOARD_95C3AM1_GPIO_LED_1,
63+ .active_low = 0,
64+ }, {
65+ .name = "lan",
66+ .gpio = BOARD_95C3AM1_GPIO_LED_2,
67+ .active_low = 0,
68+ }, {
69+ .name = "update",
70+ .gpio = BOARD_95C3AM1_GPIO_LED_3,
71+ .active_low = 0,
72+ }
73+};
74+
75+static struct i2c_gpio_platform_data board_95C3AM1_i2c_gpio_data = {
76+ .sda_pin = 107,
77+ .scl_pin = 108,
78+};
79+
80+static struct platform_device board_95C3AM1_i2c_gpio_device = {
81+ .name = "i2c-gpio",
82+ .id = 0,
83+ .dev = {
84+ .platform_data = &board_95C3AM1_i2c_gpio_data,
85+ }
86+};
87+
88+static void __init board_95C3AM1_init(void)
89+{
90+ falcon_register_asc(0);
91+ falcon_register_gpio();
92+ falcon_register_wdt();
93+ falcon_register_i2c();
94+ falcon_register_spi_flash(&board_95C3AM1_flash_data);
95+ platform_device_register(&board_95C3AM1_i2c_gpio_device);
96+ ltq_add_device_leds_gpio(-1, ARRAY_SIZE(board_95C3AM1_leds_gpio),
97+ board_95C3AM1_leds_gpio);
98+ falcon_register_crypto();
99+}
100+
101+MIPS_MACHINE(LANTIQ_MACH_95C3AM1,
102+ "95C3AM1",
103+ "95C3AM1 Board",
104+ board_95C3AM1_init);
105--- a/arch/mips/lantiq/falcon/Kconfig
106+++ b/arch/mips/lantiq/falcon/Kconfig
107@@ -10,6 +10,10 @@ config LANTIQ_MACH_EASY98020
108     bool "Easy98020"
109     default y
110 
111+config LANTIQ_MACH_95C3AM1
112+ bool "95C3AM1"
113+ default y
114+
115 endmenu
116 
117 endif
118--- a/arch/mips/lantiq/falcon/Makefile
119+++ b/arch/mips/lantiq/falcon/Makefile
120@@ -4,3 +4,4 @@ obj-$(CONFIG_LANTIQ_MACH_EASY98000) += a
121 obj-$(CONFIG_LANTIQ_MACH_EASY98000) += mach-easy98000.o
122 obj-$(CONFIG_LANTIQ_MACH_EASY98000) += dev-leds-easy98000-cpld.o
123 obj-$(CONFIG_LANTIQ_MACH_EASY98020) += mach-easy98020.o
124+obj-$(CONFIG_LANTIQ_MACH_95C3AM1) += mach-95C3AM1.o
125--- a/arch/mips/lantiq/machtypes.h
126+++ b/arch/mips/lantiq/machtypes.h
127@@ -21,6 +21,7 @@ enum lantiq_mach_type {
128     LANTIQ_MACH_EASY98000SF, /* Falcon Eval Board, Serial Flash */
129     LANTIQ_MACH_EASY98000NAND, /* Falcon Eval Board, NAND Flash */
130     LANTIQ_MACH_EASY98020, /* Falcon Reference Board */
131+ LANTIQ_MACH_95C3AM1, /* Board 95C3AM1 */
132 };
133 
134 #endif
135

Archive Download this file



interactive