]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - arch/tile/kernel/usb.c
KVM: x86: fix RSM into 64-bit protected mode
[karo-tx-linux.git] / arch / tile / kernel / usb.c
1 /*
2  * Copyright 2012 Tilera Corporation. All Rights Reserved.
3  *
4  *   This program is free software; you can redistribute it and/or
5  *   modify it under the terms of the GNU General Public License
6  *   as published by the Free Software Foundation, version 2.
7  *
8  *   This program is distributed in the hope that it will be useful, but
9  *   WITHOUT ANY WARRANTY; without even the implied warranty of
10  *   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11  *   NON INFRINGEMENT.  See the GNU General Public License for
12  *   more details.
13  *
14  * Register the Tile-Gx USB interfaces as platform devices.
15  *
16  * The actual USB driver is just some glue (in
17  * drivers/usb/host/[eo]hci-tilegx.c) which makes the registers available
18  * to the standard kernel EHCI and OHCI drivers.
19  */
20
21 #include <linux/dma-mapping.h>
22 #include <linux/platform_device.h>
23 #include <linux/usb/tilegx.h>
24 #include <linux/init.h>
25 #include <linux/types.h>
26
27 static u64 ehci_dmamask = DMA_BIT_MASK(32);
28
29 #define USB_HOST_DEF(unit, type, dmamask) \
30         static struct \
31             tilegx_usb_platform_data tilegx_usb_platform_data_ ## type ## \
32                 hci ## unit = { \
33                 .dev_index = unit, \
34         }; \
35         \
36         static struct platform_device tilegx_usb_ ## type ## hci ## unit = { \
37                 .name           = "tilegx-" #type "hci", \
38                 .id             = unit, \
39                 .dev = { \
40                         .dma_mask               = dmamask, \
41                         .coherent_dma_mask      = DMA_BIT_MASK(32), \
42                         .platform_data = \
43                                 &tilegx_usb_platform_data_ ## type ## hci ## \
44                                 unit, \
45                 }, \
46         };
47
48 USB_HOST_DEF(0, e, &ehci_dmamask)
49 USB_HOST_DEF(0, o, NULL)
50 USB_HOST_DEF(1, e, &ehci_dmamask)
51 USB_HOST_DEF(1, o, NULL)
52
53 #undef USB_HOST_DEF
54
55 static struct platform_device *tilegx_usb_devices[] __initdata = {
56         &tilegx_usb_ehci0,
57         &tilegx_usb_ehci1,
58         &tilegx_usb_ohci0,
59         &tilegx_usb_ohci1,
60 };
61
62 /** Add our set of possible USB devices. */
63 static int __init tilegx_usb_init(void)
64 {
65         platform_add_devices(tilegx_usb_devices,
66                              ARRAY_SIZE(tilegx_usb_devices));
67
68         return 0;
69 }
70 arch_initcall(tilegx_usb_init);