1 --- a/arch/mips/lantiq/devices.c
2 +++ b/arch/mips/lantiq/devices.c
4 #include <linux/time.h>
6 #include <linux/gpio.h>
7 +#include <linux/dma-mapping.h>
9 #include <asm/bootinfo.h>
11 @@ -100,3 +101,20 @@ void __init ltq_register_pci(struct ltq_
12 pr_err("kernel is compiled without PCI support\n");
16 +static unsigned int *cp1_base = 0;
18 +ltq_get_cp1_base(void)
22 +EXPORT_SYMBOL(ltq_get_cp1_base);
25 +ltq_register_tapi(void)
27 +#define CP1_SIZE (1 << 20)
30 + (void*)CPHYSADDR(dma_alloc_coherent(NULL, CP1_SIZE, &dma, GFP_ATOMIC));
32 --- a/arch/mips/lantiq/devices.h
33 +++ b/arch/mips/lantiq/devices.h
34 @@ -23,5 +23,6 @@ extern void ltq_register_nor(struct phys
35 extern void ltq_register_wdt(void);
36 extern void ltq_register_asc(int port);
37 extern void ltq_register_pci(struct ltq_pci_data *data);
38 +extern void ltq_register_tapi(void);
41 --- a/arch/mips/lantiq/xway/Makefile
42 +++ b/arch/mips/lantiq/xway/Makefile
44 obj-y := sysctrl.o reset.o gpio.o gpio_stp.o gpio_ebu.o devices.o dma.o clk.o prom.o nand.o timer.o dev-ifxhcd.o
46 +obj-y += dev-dwc_otg.o
47 +obj-$(CONFIG_PCI) += dev-wifi-rt2x00.o dev-wifi-athxk.o pci-ath-fixup.o
49 obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o
50 obj-$(CONFIG_LANTIQ_MACH_EASY50601) += mach-easy50601.o
51 obj-$(CONFIG_LANTIQ_MACH_ARV) += mach-arv.o
52 --- a/arch/mips/lantiq/xway/devices.c
53 +++ b/arch/mips/lantiq/xway/devices.c
55 #include <linux/time.h>
57 #include <linux/gpio.h>
58 +#include <linux/spi/spi.h>
60 #include <asm/bootinfo.h>
62 @@ -119,3 +120,84 @@ ltq_register_vrx200(struct ltq_eth_data
63 ltq_vrx200.dev.platform_data = eth;
64 platform_device_register(<q_vrx200);
68 +static struct resource ltq_ebu_resource =
71 + .start = LTQ_EBU_GPIO_START,
72 + .end = LTQ_EBU_GPIO_START + LTQ_EBU_GPIO_SIZE - 1,
73 + .flags = IORESOURCE_MEM,
76 +static struct platform_device ltq_ebu =
79 + .resource = <q_ebu_resource,
84 +ltq_register_gpio_ebu(unsigned int value)
86 + ltq_ebu.dev.platform_data = (void*) value;
87 + platform_device_register(<q_ebu);
91 +static struct gpio_buttons_platform_data ltq_gpio_buttons_platform_data;
93 +static struct platform_device ltq_gpio_buttons_platform_device =
95 + .name = "gpio-buttons",
98 + .platform_data = (void *) <q_gpio_buttons_platform_data,
103 +ltq_register_gpio_buttons(struct gpio_button *buttons, int cnt)
105 + ltq_gpio_buttons_platform_data.buttons = buttons;
106 + ltq_gpio_buttons_platform_data.nbuttons = cnt;
107 + platform_device_register(<q_gpio_buttons_platform_device);
110 +static struct resource ltq_spi_resources[] = {
112 + .start = LTQ_SSC_BASE_ADDR,
113 + .end = LTQ_SSC_BASE_ADDR + LTQ_SSC_SIZE - 1,
114 + .flags = IORESOURCE_MEM,
116 + IRQ_RES(spi_tx, LTQ_SSC_TIR),
117 + IRQ_RES(spi_rx, LTQ_SSC_RIR),
118 + IRQ_RES(spi_err, LTQ_SSC_EIR),
121 +static struct resource ltq_spi_resources_ar9[] = {
123 + .start = LTQ_SSC_BASE_ADDR,
124 + .end = LTQ_SSC_BASE_ADDR + LTQ_SSC_SIZE - 1,
125 + .flags = IORESOURCE_MEM,
127 + IRQ_RES(spi_tx, LTQ_SSC_TIR_AR9),
128 + IRQ_RES(spi_rx, LTQ_SSC_RIR_AR9),
129 + IRQ_RES(spi_err, LTQ_SSC_EIR),
132 +static struct platform_device ltq_spi = {
134 + .resource = ltq_spi_resources,
135 + .num_resources = ARRAY_SIZE(ltq_spi_resources),
138 +void __init ltq_register_spi(struct ltq_spi_platform_data *pdata,
139 + struct spi_board_info const *info, unsigned n)
142 + ltq_spi.resource = ltq_spi_resources_ar9;
143 + spi_register_board_info(info, n);
144 + ltq_spi.dev.platform_data = pdata;
145 + platform_device_register(<q_spi);
147 --- a/arch/mips/lantiq/xway/devices.h
148 +++ b/arch/mips/lantiq/xway/devices.h
151 #include "../devices.h"
152 #include <linux/phy.h>
153 +#include <linux/spi/spi.h>
154 +#include <linux/gpio_buttons.h>
156 extern void ltq_register_gpio(void);
157 extern void ltq_register_gpio_stp(void);
158 @@ -18,5 +20,9 @@ extern void ltq_register_ase_asc(void);
159 extern void ltq_register_etop(struct ltq_eth_data *eth);
160 extern void xway_register_nand(struct mtd_partition *parts, int count);
161 extern void ltq_register_vrx200(struct ltq_eth_data *eth);
162 +extern void ltq_register_gpio_ebu(unsigned int value);
163 +extern void ltq_register_spi(struct ltq_spi_platform_data *pdata,
164 + struct spi_board_info const *info, unsigned n);
165 +extern void ltq_register_gpio_buttons(struct gpio_button *buttons, int cnt);
168 --- a/arch/mips/lantiq/Makefile
169 +++ b/arch/mips/lantiq/Makefile
171 # under the terms of the GNU General Public License version 2 as published
172 # by the Free Software Foundation.
174 -obj-y := irq.o setup.o clk.o prom.o devices.o
175 +obj-y := irq.o setup.o clk.o prom.o devices.o dev-gpio-leds.o dev-gpio-buttons.o
177 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o