2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
10 #include <linux/init.h>
11 #include <linux/module.h>
12 #include <linux/types.h>
13 #include <linux/string.h>
14 #include <linux/mtd/physmap.h>
15 #include <linux/kernel.h>
16 #include <linux/reboot.h>
17 #include <linux/platform_device.h>
18 #include <linux/leds.h>
19 #include <linux/etherdevice.h>
20 #include <linux/reboot.h>
21 #include <linux/time.h>
23 #include <linux/gpio.h>
24 #include <linux/leds.h>
26 #include <asm/bootinfo.h>
29 #include <lantiq_soc.h>
30 #include <lantiq_irq.h>
31 #include <lantiq_platform.h>
33 #define LTQ_USB_IOMEM_BASE 0x1e101000
34 #define LTQ_USB_IOMEM_SIZE 0x00001000
36 static struct resource resources[] =
39 .name = "dwc_otg_membase",
40 .start = LTQ_USB_IOMEM_BASE,
41 .end = LTQ_USB_IOMEM_BASE + LTQ_USB_IOMEM_SIZE - 1,
42 .flags = IORESOURCE_MEM,
45 .name = "dwc_otg_irq",
47 .flags = IORESOURCE_IRQ,
51 static u64 dwc_dmamask = (u32)0x1fffffff;
53 static struct platform_device platform_dev = {
56 .dma_mask = &dwc_dmamask,
58 .resource = resources,
59 .num_resources = ARRAY_SIZE(resources),
63 xway_register_dwc(int pin)
66 d.irq = resources[1].start;
68 platform_dev.dev.platform_data = (void*) pin;
69 return platform_device_register(&platform_dev);