ubus: update to latest version, includes a small bugfix for object call replies
[openwrt.git] / target / linux / lantiq / patches-3.0 / 160-falcon-95C3AM1.patch
1 --- /dev/null
2 +++ b/arch/mips/lantiq/falcon/mach-95C3AM1.c
3 @@ -0,0 +1,99 @@
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 +extern unsigned char ltq_ethaddr[6];
18 +
19 +static struct mtd_partition board_95C3AM1_partitions[] =
20 +{
21 +       {
22 +               .name   = "uboot",
23 +               .offset = 0x0,
24 +               .size   = 0x40000,
25 +       },
26 +       {
27 +               .name   = "uboot_env",
28 +               .offset = 0x40000,
29 +               .size   = 0x40000,      /* 2 sectors for redundant env. */
30 +       },
31 +       {
32 +               .name   = "linux",
33 +               .offset = 0x80000,
34 +               .size   = 0xF80000,     /* map only 16 MiB */
35 +       },
36 +};
37 +
38 +static struct flash_platform_data board_95C3AM1_flash_platform_data = {
39 +       .name = "sflash",
40 +       .parts = board_95C3AM1_partitions,
41 +       .nr_parts = ARRAY_SIZE(board_95C3AM1_partitions)
42 +};
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 +       .platform_data          = &board_95C3AM1_flash_platform_data
51 +};
52 +
53 +static struct gpio_led board_95C3AM1_leds_gpio[] __initdata = {
54 +       {
55 +               .name           = "power",
56 +               .gpio           = BOARD_95C3AM1_GPIO_LED_0,
57 +               .active_low     = 0,
58 +       }, {
59 +               .name           = "optical",
60 +               .gpio           = BOARD_95C3AM1_GPIO_LED_1,
61 +               .active_low     = 0,
62 +       }, {
63 +               .name           = "lan",
64 +               .gpio           = BOARD_95C3AM1_GPIO_LED_2,
65 +               .active_low     = 0,
66 +       }, {
67 +               .name           = "update",
68 +               .gpio           = BOARD_95C3AM1_GPIO_LED_3,
69 +               .active_low     = 0,
70 +       }
71 +};
72 +
73 +static struct i2c_gpio_platform_data board_95C3AM1_i2c_gpio_data = {
74 +       .sda_pin        = 107,
75 +       .scl_pin        = 108,
76 +};
77 +
78 +static struct platform_device board_95C3AM1_i2c_gpio_device = {
79 +       .name           = "i2c-gpio",
80 +       .id             = 0,
81 +       .dev = {
82 +               .platform_data  = &board_95C3AM1_i2c_gpio_data,
83 +       }
84 +};
85 +
86 +static void __init board_95C3AM1_init(void)
87 +{
88 +       falcon_register_asc(0);
89 +       falcon_register_gpio();
90 +       falcon_register_wdt();
91 +       falcon_register_i2c();
92 +       falcon_register_spi_flash(&board_95C3AM1_flash_data);
93 +       platform_device_register(&board_95C3AM1_i2c_gpio_device);
94 +       ltq_add_device_leds_gpio(-1, ARRAY_SIZE(board_95C3AM1_leds_gpio),
95 +                                               board_95C3AM1_leds_gpio);
96 +       falcon_register_crypto();
97 +}
98 +
99 +MIPS_MACHINE(LANTIQ_MACH_95C3AM1,
100 +                       "95C3AM1",
101 +                       "95C3AM1 Board",
102 +                       board_95C3AM1_init);
103 --- a/arch/mips/lantiq/falcon/Kconfig
104 +++ b/arch/mips/lantiq/falcon/Kconfig
105 @@ -10,6 +10,10 @@ config LANTIQ_MACH_EASY98020
106         bool "Easy98020"
107         default y
108  
109 +config LANTIQ_MACH_95C3AM1
110 +       bool "95C3AM1"
111 +       default y
112 +
113  endmenu
114  
115  endif
116 --- a/arch/mips/lantiq/falcon/Makefile
117 +++ b/arch/mips/lantiq/falcon/Makefile
118 @@ -4,3 +4,4 @@ obj-$(CONFIG_LANTIQ_MACH_EASY98000) += a
119  obj-$(CONFIG_LANTIQ_MACH_EASY98000) += mach-easy98000.o
120  obj-$(CONFIG_LANTIQ_MACH_EASY98000) += dev-leds-easy98000-cpld.o
121  obj-$(CONFIG_LANTIQ_MACH_EASY98020) += mach-easy98020.o
122 +obj-$(CONFIG_LANTIQ_MACH_95C3AM1)   += mach-95C3AM1.o
123 --- a/arch/mips/lantiq/machtypes.h
124 +++ b/arch/mips/lantiq/machtypes.h
125 @@ -21,6 +21,7 @@ enum lantiq_mach_type {
126         LANTIQ_MACH_EASY98000SF,        /* Falcon Eval Board, Serial Flash */
127         LANTIQ_MACH_EASY98000NAND,      /* Falcon Eval Board, NAND Flash */
128         LANTIQ_MACH_EASY98020,          /* Falcon Reference Board */
129 +       LANTIQ_MACH_95C3AM1,            /* Board 95C3AM1 */
130  };
131  
132  #endif