Steven J. Hill | 3070033 | 2012-05-30 21:02:49 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is subject to the terms and conditions of the GNU General Public |
| 3 | * License. See the file "COPYING" in the main directory of this archive |
| 4 | * for more details. |
| 5 | * |
| 6 | * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved. |
| 7 | */ |
| 8 | #include <linux/module.h> |
| 9 | #include <linux/irq.h> |
| 10 | #include <linux/dma-mapping.h> |
| 11 | #include <linux/platform_device.h> |
Andrew Bresticker | 4060bbe | 2014-10-20 12:03:53 -0700 | [diff] [blame] | 12 | #include <linux/irqchip/mips-gic.h> |
Steven J. Hill | 3070033 | 2012-05-30 21:02:49 +0000 | [diff] [blame] | 13 | |
Andrew Bresticker | 18743d2 | 2014-09-18 14:47:24 -0700 | [diff] [blame] | 14 | #include <asm/mips-boards/sead3int.h> |
| 15 | |
Steven J. Hill | 3070033 | 2012-05-30 21:02:49 +0000 | [diff] [blame] | 16 | struct resource ehci_resources[] = { |
| 17 | { |
| 18 | .start = 0x1b200000, |
| 19 | .end = 0x1b200fff, |
| 20 | .flags = IORESOURCE_MEM |
| 21 | }, |
| 22 | { |
Steven J. Hill | 3070033 | 2012-05-30 21:02:49 +0000 | [diff] [blame] | 23 | .flags = IORESOURCE_IRQ |
| 24 | } |
| 25 | }; |
| 26 | |
| 27 | u64 sead3_usbdev_dma_mask = DMA_BIT_MASK(32); |
| 28 | |
| 29 | static struct platform_device ehci_device = { |
| 30 | .name = "sead3-ehci", |
| 31 | .id = 0, |
| 32 | .dev = { |
| 33 | .dma_mask = &sead3_usbdev_dma_mask, |
| 34 | .coherent_dma_mask = DMA_BIT_MASK(32) |
| 35 | }, |
| 36 | .num_resources = ARRAY_SIZE(ehci_resources), |
| 37 | .resource = ehci_resources |
| 38 | }; |
| 39 | |
| 40 | static int __init ehci_init(void) |
| 41 | { |
Andrew Bresticker | 18743d2 | 2014-09-18 14:47:24 -0700 | [diff] [blame] | 42 | if (gic_present) |
| 43 | ehci_resources[1].start = MIPS_GIC_IRQ_BASE + GIC_INT_EHCI; |
| 44 | else |
| 45 | ehci_resources[1].start = MIPS_CPU_IRQ_BASE + CPU_INT_EHCI; |
Steven J. Hill | 3070033 | 2012-05-30 21:02:49 +0000 | [diff] [blame] | 46 | return platform_device_register(&ehci_device); |
| 47 | } |
| 48 | |
| 49 | module_init(ehci_init); |
| 50 | |
| 51 | MODULE_AUTHOR("Chris Dearman <chris@mips.com>"); |
| 52 | MODULE_LICENSE("GPL"); |
| 53 | MODULE_DESCRIPTION("EHCI probe driver for SEAD3"); |