2011-11-14 18:55:58 +00:00
|
|
|
Index: linux-3.1.1/arch/mips/lantiq/devices.c
|
|
|
|
===================================================================
|
|
|
|
--- linux-3.1.1.orig/arch/mips/lantiq/devices.c 2011-11-14 20:22:33.588135463 +0100
|
|
|
|
+++ linux-3.1.1/arch/mips/lantiq/devices.c 2011-11-14 20:22:34.328135495 +0100
|
2011-11-03 15:15:52 +00:00
|
|
|
@@ -18,6 +18,7 @@
|
|
|
|
#include <linux/time.h>
|
2011-10-10 15:13:46 +00:00
|
|
|
#include <linux/io.h>
|
|
|
|
#include <linux/gpio.h>
|
|
|
|
+#include <linux/dma-mapping.h>
|
|
|
|
|
|
|
|
#include <asm/bootinfo.h>
|
|
|
|
#include <asm/irq.h>
|
2011-11-14 18:55:58 +00:00
|
|
|
@@ -100,3 +101,20 @@
|
2011-10-10 15:13:46 +00:00
|
|
|
pr_err("kernel is compiled without PCI support\n");
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
+
|
|
|
|
+static unsigned int *cp1_base = 0;
|
|
|
|
+unsigned int*
|
|
|
|
+ltq_get_cp1_base(void)
|
|
|
|
+{
|
|
|
|
+ return cp1_base;
|
|
|
|
+}
|
|
|
|
+EXPORT_SYMBOL(ltq_get_cp1_base);
|
|
|
|
+
|
|
|
|
+void __init
|
|
|
|
+ltq_register_tapi(void)
|
|
|
|
+{
|
|
|
|
+#define CP1_SIZE (1 << 20)
|
|
|
|
+ dma_addr_t dma;
|
|
|
|
+ cp1_base =
|
|
|
|
+ (void*)CPHYSADDR(dma_alloc_coherent(NULL, CP1_SIZE, &dma, GFP_ATOMIC));
|
|
|
|
+}
|
2011-11-14 18:55:58 +00:00
|
|
|
Index: linux-3.1.1/arch/mips/lantiq/devices.h
|
|
|
|
===================================================================
|
|
|
|
--- linux-3.1.1.orig/arch/mips/lantiq/devices.h 2011-11-14 20:22:33.588135463 +0100
|
|
|
|
+++ linux-3.1.1/arch/mips/lantiq/devices.h 2011-11-14 20:22:34.328135495 +0100
|
|
|
|
@@ -23,5 +23,6 @@
|
2011-10-10 15:13:46 +00:00
|
|
|
extern void ltq_register_wdt(void);
|
|
|
|
extern void ltq_register_asc(int port);
|
|
|
|
extern void ltq_register_pci(struct ltq_pci_data *data);
|
|
|
|
+extern void ltq_register_tapi(void);
|
|
|
|
|
|
|
|
#endif
|
2011-11-14 18:55:58 +00:00
|
|
|
Index: linux-3.1.1/arch/mips/lantiq/xway/Makefile
|
|
|
|
===================================================================
|
|
|
|
--- linux-3.1.1.orig/arch/mips/lantiq/xway/Makefile 2011-11-14 20:22:34.304135491 +0100
|
|
|
|
+++ linux-3.1.1/arch/mips/lantiq/xway/Makefile 2011-11-14 20:39:51.404179655 +0100
|
2011-10-10 15:13:46 +00:00
|
|
|
@@ -1,5 +1,7 @@
|
|
|
|
obj-y := sysctrl.o reset.o gpio.o gpio_stp.o gpio_ebu.o devices.o dma.o nand.o timer.o
|
|
|
|
|
2011-11-14 18:55:58 +00:00
|
|
|
+obj-y += dev-dwc_otg.o dev-wifi-rt2x00.o
|
2011-10-10 15:13:46 +00:00
|
|
|
+
|
|
|
|
obj-$(CONFIG_SOC_XWAY) += clk-xway.o prom-xway.o
|
|
|
|
obj-$(CONFIG_SOC_AMAZON_SE) += clk-ase.o prom-ase.o
|
|
|
|
obj-$(CONFIG_SOC_VR9) += clk-vr9.o prom-vr9.o
|
2011-11-14 18:55:58 +00:00
|
|
|
Index: linux-3.1.1/arch/mips/lantiq/xway/devices.c
|
|
|
|
===================================================================
|
|
|
|
--- linux-3.1.1.orig/arch/mips/lantiq/xway/devices.c 2011-11-14 20:22:34.092135483 +0100
|
|
|
|
+++ linux-3.1.1/arch/mips/lantiq/xway/devices.c 2011-11-14 20:22:34.328135495 +0100
|
2011-11-03 15:15:52 +00:00
|
|
|
@@ -19,6 +19,7 @@
|
|
|
|
#include <linux/time.h>
|
2011-10-10 15:13:46 +00:00
|
|
|
#include <linux/io.h>
|
|
|
|
#include <linux/gpio.h>
|
|
|
|
+#include <linux/spi/spi.h>
|
|
|
|
|
|
|
|
#include <asm/bootinfo.h>
|
|
|
|
#include <asm/irq.h>
|
2011-11-14 18:55:58 +00:00
|
|
|
@@ -99,3 +100,98 @@
|
2011-10-10 15:13:46 +00:00
|
|
|
platform_device_register(<q_etop);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+/* madwifi */
|
|
|
|
+int lantiq_emulate_madwifi_eep = 0;
|
|
|
|
+EXPORT_SYMBOL(lantiq_emulate_madwifi_eep);
|
|
|
|
+
|
2011-11-03 15:15:52 +00:00
|
|
|
+int lantiq_madwifi_eep_addr = 0;
|
|
|
|
+EXPORT_SYMBOL(lantiq_madwifi_eep_addr);
|
|
|
|
+
|
2011-10-10 15:13:46 +00:00
|
|
|
+void __init
|
2011-11-03 15:15:52 +00:00
|
|
|
+ltq_register_madwifi_eep(unsigned long long addr)
|
2011-10-10 15:13:46 +00:00
|
|
|
+{
|
2011-11-03 15:15:52 +00:00
|
|
|
+ lantiq_madwifi_eep_addr = addr;
|
2011-10-10 15:13:46 +00:00
|
|
|
+ lantiq_emulate_madwifi_eep = 1;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/* ebu */
|
|
|
|
+static struct resource ltq_ebu_resource =
|
|
|
|
+{
|
|
|
|
+ .name = "gpio_ebu",
|
|
|
|
+ .start = LTQ_EBU_GPIO_START,
|
|
|
|
+ .end = LTQ_EBU_GPIO_START + LTQ_EBU_GPIO_SIZE - 1,
|
|
|
|
+ .flags = IORESOURCE_MEM,
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+static struct platform_device ltq_ebu =
|
|
|
|
+{
|
|
|
|
+ .name = "ltq_ebu",
|
|
|
|
+ .resource = <q_ebu_resource,
|
|
|
|
+ .num_resources = 1,
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+void __init
|
|
|
|
+ltq_register_gpio_ebu(unsigned int value)
|
|
|
|
+{
|
|
|
|
+ ltq_ebu.dev.platform_data = (void*) value;
|
|
|
|
+ platform_device_register(<q_ebu);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/* gpio buttons */
|
|
|
|
+static struct gpio_buttons_platform_data ltq_gpio_buttons_platform_data;
|
|
|
|
+
|
|
|
|
+static struct platform_device ltq_gpio_buttons_platform_device =
|
|
|
|
+{
|
|
|
|
+ .name = "gpio-buttons",
|
|
|
|
+ .id = 0,
|
|
|
|
+ .dev = {
|
|
|
|
+ .platform_data = (void *) <q_gpio_buttons_platform_data,
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+void __init
|
|
|
|
+ltq_register_gpio_buttons(struct gpio_button *buttons, int cnt)
|
|
|
|
+{
|
|
|
|
+ ltq_gpio_buttons_platform_data.buttons = buttons;
|
|
|
|
+ ltq_gpio_buttons_platform_data.nbuttons = cnt;
|
|
|
|
+ platform_device_register(<q_gpio_buttons_platform_device);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static struct resource ltq_spi_resources[] = {
|
|
|
|
+ {
|
|
|
|
+ .start = LTQ_SSC_BASE_ADDR,
|
|
|
|
+ .end = LTQ_SSC_BASE_ADDR + LTQ_SSC_SIZE - 1,
|
|
|
|
+ .flags = IORESOURCE_MEM,
|
|
|
|
+ },
|
|
|
|
+ IRQ_RES(spi_tx, LTQ_SSC_TIR),
|
|
|
|
+ IRQ_RES(spi_rx, LTQ_SSC_RIR),
|
|
|
|
+ IRQ_RES(spi_err, LTQ_SSC_EIR),
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+static struct resource ltq_spi_resources_ar9[] = {
|
|
|
|
+ {
|
|
|
|
+ .start = LTQ_SSC_BASE_ADDR,
|
|
|
|
+ .end = LTQ_SSC_BASE_ADDR + LTQ_SSC_SIZE - 1,
|
|
|
|
+ .flags = IORESOURCE_MEM,
|
|
|
|
+ },
|
|
|
|
+ IRQ_RES(spi_tx, LTQ_SSC_TIR_AR9),
|
|
|
|
+ IRQ_RES(spi_rx, LTQ_SSC_RIR_AR9),
|
|
|
|
+ IRQ_RES(spi_err, LTQ_SSC_EIR),
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+static struct platform_device ltq_spi = {
|
|
|
|
+ .name = "ltq-spi",
|
|
|
|
+ .resource = ltq_spi_resources,
|
|
|
|
+ .num_resources = ARRAY_SIZE(ltq_spi_resources),
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+void __init ltq_register_spi(struct ltq_spi_platform_data *pdata,
|
|
|
|
+ struct spi_board_info const *info, unsigned n)
|
|
|
|
+{
|
|
|
|
+ if(ltq_is_ar9())
|
|
|
|
+ ltq_spi.resource = ltq_spi_resources_ar9;
|
|
|
|
+ spi_register_board_info(info, n);
|
|
|
|
+ ltq_spi.dev.platform_data = pdata;
|
|
|
|
+ platform_device_register(<q_spi);
|
|
|
|
+}
|
2011-11-14 18:55:58 +00:00
|
|
|
Index: linux-3.1.1/arch/mips/lantiq/xway/devices.h
|
|
|
|
===================================================================
|
|
|
|
--- linux-3.1.1.orig/arch/mips/lantiq/xway/devices.h 2011-11-11 21:19:27.000000000 +0100
|
|
|
|
+++ linux-3.1.1/arch/mips/lantiq/xway/devices.h 2011-11-14 20:22:34.328135495 +0100
|
2011-10-10 15:13:46 +00:00
|
|
|
@@ -11,10 +11,17 @@
|
|
|
|
|
|
|
|
#include "../devices.h"
|
|
|
|
#include <linux/phy.h>
|
|
|
|
+#include <linux/spi/spi.h>
|
|
|
|
+#include <linux/gpio_buttons.h>
|
|
|
|
|
|
|
|
extern void ltq_register_gpio(void);
|
|
|
|
extern void ltq_register_gpio_stp(void);
|
|
|
|
extern void ltq_register_ase_asc(void);
|
|
|
|
extern void ltq_register_etop(struct ltq_eth_data *eth);
|
|
|
|
+extern void ltq_register_gpio_ebu(unsigned int value);
|
|
|
|
+extern void ltq_register_spi(struct ltq_spi_platform_data *pdata,
|
|
|
|
+ struct spi_board_info const *info, unsigned n);
|
2011-11-03 15:15:52 +00:00
|
|
|
+extern void ltq_register_madwifi_eep(unsigned long long addr);
|
2011-10-10 15:13:46 +00:00
|
|
|
+extern void ltq_register_gpio_buttons(struct gpio_button *buttons, int cnt);
|
|
|
|
|
|
|
|
#endif
|
2011-11-14 18:55:58 +00:00
|
|
|
Index: linux-3.1.1/arch/mips/lantiq/Makefile
|
|
|
|
===================================================================
|
|
|
|
--- linux-3.1.1.orig/arch/mips/lantiq/Makefile 2011-11-14 20:22:33.640135462 +0100
|
|
|
|
+++ linux-3.1.1/arch/mips/lantiq/Makefile 2011-11-14 20:39:09.852178049 +0100
|
2011-10-10 15:13:46 +00:00
|
|
|
@@ -4,7 +4,7 @@
|
|
|
|
# under the terms of the GNU General Public License version 2 as published
|
|
|
|
# by the Free Software Foundation.
|
|
|
|
|
|
|
|
-obj-y := irq.o setup.o clk.o prom.o devices.o
|
2011-11-14 18:55:58 +00:00
|
|
|
+obj-y := irq.o setup.o clk.o prom.o devices.o dev-gpio-leds.o dev-gpio-buttons.o
|
2011-10-10 15:13:46 +00:00
|
|
|
|
|
|
|
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
|
|
|
|
|