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 nand.o timer.o
46 +obj-y += dev-dwc_otg.o dev-wifi-rt2x00.o dev-wifi-ath5k.o
48 obj-$(CONFIG_SOC_XWAY) += clk-xway.o prom-xway.o
49 obj-$(CONFIG_SOC_AMAZON_SE) += clk-ase.o prom-ase.o
50 obj-$(CONFIG_SOC_VR9) += clk-vr9.o prom-vr9.o
51 --- a/arch/mips/lantiq/xway/devices.c
52 +++ b/arch/mips/lantiq/xway/devices.c
54 #include <linux/time.h>
56 #include <linux/gpio.h>
57 +#include <linux/spi/spi.h>
59 #include <asm/bootinfo.h>
61 @@ -99,3 +100,98 @@ ltq_register_etop(struct ltq_eth_data *e
62 platform_device_register(<q_etop);
67 +int lantiq_emulate_madwifi_eep = 0;
68 +EXPORT_SYMBOL(lantiq_emulate_madwifi_eep);
70 +int lantiq_madwifi_eep_addr = 0;
71 +EXPORT_SYMBOL(lantiq_madwifi_eep_addr);
74 +ltq_register_madwifi_eep(unsigned long long addr)
76 + lantiq_madwifi_eep_addr = addr;
77 + lantiq_emulate_madwifi_eep = 1;
81 +static struct resource ltq_ebu_resource =
84 + .start = LTQ_EBU_GPIO_START,
85 + .end = LTQ_EBU_GPIO_START + LTQ_EBU_GPIO_SIZE - 1,
86 + .flags = IORESOURCE_MEM,
89 +static struct platform_device ltq_ebu =
92 + .resource = <q_ebu_resource,
97 +ltq_register_gpio_ebu(unsigned int value)
99 + ltq_ebu.dev.platform_data = (void*) value;
100 + platform_device_register(<q_ebu);
104 +static struct gpio_buttons_platform_data ltq_gpio_buttons_platform_data;
106 +static struct platform_device ltq_gpio_buttons_platform_device =
108 + .name = "gpio-buttons",
111 + .platform_data = (void *) <q_gpio_buttons_platform_data,
116 +ltq_register_gpio_buttons(struct gpio_button *buttons, int cnt)
118 + ltq_gpio_buttons_platform_data.buttons = buttons;
119 + ltq_gpio_buttons_platform_data.nbuttons = cnt;
120 + platform_device_register(<q_gpio_buttons_platform_device);
123 +static struct resource ltq_spi_resources[] = {
125 + .start = LTQ_SSC_BASE_ADDR,
126 + .end = LTQ_SSC_BASE_ADDR + LTQ_SSC_SIZE - 1,
127 + .flags = IORESOURCE_MEM,
129 + IRQ_RES(spi_tx, LTQ_SSC_TIR),
130 + IRQ_RES(spi_rx, LTQ_SSC_RIR),
131 + IRQ_RES(spi_err, LTQ_SSC_EIR),
134 +static struct resource ltq_spi_resources_ar9[] = {
136 + .start = LTQ_SSC_BASE_ADDR,
137 + .end = LTQ_SSC_BASE_ADDR + LTQ_SSC_SIZE - 1,
138 + .flags = IORESOURCE_MEM,
140 + IRQ_RES(spi_tx, LTQ_SSC_TIR_AR9),
141 + IRQ_RES(spi_rx, LTQ_SSC_RIR_AR9),
142 + IRQ_RES(spi_err, LTQ_SSC_EIR),
145 +static struct platform_device ltq_spi = {
147 + .resource = ltq_spi_resources,
148 + .num_resources = ARRAY_SIZE(ltq_spi_resources),
151 +void __init ltq_register_spi(struct ltq_spi_platform_data *pdata,
152 + struct spi_board_info const *info, unsigned n)
155 + ltq_spi.resource = ltq_spi_resources_ar9;
156 + spi_register_board_info(info, n);
157 + ltq_spi.dev.platform_data = pdata;
158 + platform_device_register(<q_spi);
160 --- a/arch/mips/lantiq/xway/devices.h
161 +++ b/arch/mips/lantiq/xway/devices.h
164 #include "../devices.h"
165 #include <linux/phy.h>
166 +#include <linux/spi/spi.h>
167 +#include <linux/gpio_buttons.h>
169 extern void ltq_register_gpio(void);
170 extern void ltq_register_gpio_stp(void);
171 extern void ltq_register_ase_asc(void);
172 extern void ltq_register_etop(struct ltq_eth_data *eth);
173 +extern void ltq_register_gpio_ebu(unsigned int value);
174 +extern void ltq_register_spi(struct ltq_spi_platform_data *pdata,
175 + struct spi_board_info const *info, unsigned n);
176 +extern void ltq_register_madwifi_eep(unsigned long long addr);
177 +extern void ltq_register_gpio_buttons(struct gpio_button *buttons, int cnt);
180 --- a/arch/mips/lantiq/Makefile
181 +++ b/arch/mips/lantiq/Makefile
183 # under the terms of the GNU General Public License version 2 as published
184 # by the Free Software Foundation.
186 -obj-y := irq.o setup.o clk.o prom.o devices.o
187 +obj-y := irq.o setup.o clk.o prom.o devices.o dev-gpio-leds.o dev-gpio-buttons.o
189 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o