2 * Copyright (C) 2009 Henk Vergonet <Henk.Vergonet@gmail.com>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of
7 * the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 #include <linux/init.h>
19 #include <linux/kernel.h>
20 #include <linux/platform_device.h>
21 #include <bcm63xx_cpu.h>
23 static struct resource udc_resources
[] = {
25 .start
= -1, /* filled at runtime */
26 .end
= -1, /* filled at runtime */
27 .flags
= IORESOURCE_MEM
,
30 .start
= -1, /* filled at runtime */
31 .flags
= IORESOURCE_IRQ
,
35 static u64 udc_dmamask
= ~(u32
)0;
37 static struct platform_device bcm63xx_udc_device
= {
38 .name
= "bcm63xx-udc",
40 .num_resources
= ARRAY_SIZE(udc_resources
),
41 .resource
= udc_resources
,
43 .dma_mask
= &udc_dmamask
,
44 .coherent_dma_mask
= 0xffffffff,
48 int __init
bcm63xx_udc_register(void)
50 if (!BCMCPU_IS_6338() && !BCMCPU_IS_6348())
53 udc_resources
[0].start
= bcm63xx_regset_address(RSET_UDC0
);
54 udc_resources
[0].end
= udc_resources
[0].start
;
55 udc_resources
[0].end
+= RSET_UDC_SIZE
- 1;
56 udc_resources
[1].start
= bcm63xx_get_irq_number(IRQ_UDC0
);
57 return platform_device_register(&bcm63xx_udc_device
);