1 Index: linux-2.6.32.13/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 ===================================================================
3 --- linux-2.6.32.13.orig/arch/mips/bcm63xx/boards/board_bcm963xx.c 2010-05-27 21:43:41.000000000 -0400
4 +++ linux-2.6.32.13/arch/mips/bcm63xx/boards/board_bcm963xx.c 2010-05-27 21:44:19.000000000 -0400
6 #include <bcm63xx_dev_pcmcia.h>
7 #include <bcm63xx_dev_usb_ohci.h>
8 #include <bcm63xx_dev_usb_ehci.h>
9 +#include <bcm63xx_dev_usb_udc.h>
10 #include <board_bcm963xx.h>
12 #define PFX "board_bcm963xx: "
20 static struct board_info __initdata board_rta1025w_16 = {
23 bcm63xx_dsp_register(&board.dsp);
26 + bcm63xx_udc_register();
28 /* Generate MAC address for WLAN and
29 * register our SPROM */
30 #ifdef CONFIG_SSB_PCIHOST
31 Index: linux-2.6.32.13/arch/mips/bcm63xx/dev-usb-udc.c
32 ===================================================================
33 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
34 +++ linux-2.6.32.13/arch/mips/bcm63xx/dev-usb-udc.c 2010-05-27 21:44:19.000000000 -0400
37 + * Copyright (C) 2009 Henk Vergonet <Henk.Vergonet@gmail.com>
39 + * This program is free software; you can redistribute it and/or
40 + * modify it under the terms of the GNU General Public License as
41 + * published by the Free Software Foundation; either version 2 of
42 + * the License, or (at your option) any later version.
44 + * This program is distributed in the hope that it will be useful,
45 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
46 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
47 + * GNU General Public License for more details.
49 + * You should have received a copy of the GNU General Public License
50 + * along with this program; if not, write to the Free Software
51 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
53 +#include <linux/init.h>
54 +#include <linux/kernel.h>
55 +#include <linux/platform_device.h>
56 +#include <bcm63xx_cpu.h>
58 +static struct resource udc_resources[] = {
60 + .start = -1, /* filled at runtime */
61 + .end = -1, /* filled at runtime */
62 + .flags = IORESOURCE_MEM,
65 + .start = -1, /* filled at runtime */
66 + .flags = IORESOURCE_IRQ,
70 +static u64 udc_dmamask = ~(u32)0;
72 +static struct platform_device bcm63xx_udc_device = {
73 + .name = "bcm63xx-udc",
75 + .num_resources = ARRAY_SIZE(udc_resources),
76 + .resource = udc_resources,
78 + .dma_mask = &udc_dmamask,
79 + .coherent_dma_mask = 0xffffffff,
83 +int __init bcm63xx_udc_register(void)
85 + if (!BCMCPU_IS_6338() && !BCMCPU_IS_6345() && !BCMCPU_IS_6348())
88 + udc_resources[0].start = bcm63xx_regset_address(RSET_UDC0);
89 + udc_resources[0].end = udc_resources[0].start;
90 + udc_resources[0].end += RSET_UDC_SIZE - 1;
91 + udc_resources[1].start = bcm63xx_get_irq_number(IRQ_UDC0);
92 + return platform_device_register(&bcm63xx_udc_device);
94 Index: linux-2.6.32.13/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
95 ===================================================================
96 --- linux-2.6.32.13.orig/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h 2010-05-27 21:34:56.000000000 -0400
97 +++ linux-2.6.32.13/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h 2010-05-27 21:44:19.000000000 -0400
99 #define BCM_6338_UART0_BASE (0xfffe0300)
100 #define BCM_6338_GPIO_BASE (0xfffe0400)
101 #define BCM_6338_SPI_BASE (0xfffe0c00)
102 -#define BCM_6338_UDC0_BASE (0xdeadbeef)
103 +#define BCM_6338_UDC0_BASE (0xfffe3000)
104 #define BCM_6338_USBDMA_BASE (0xfffe2400)
105 #define BCM_6338_OHCI0_BASE (0xdeadbeef)
106 #define BCM_6338_OHCI_PRIV_BASE (0xfffe3000)
108 #define BCM_6345_UART0_BASE (0xfffe0300)
109 #define BCM_6345_GPIO_BASE (0xfffe0400)
110 #define BCM_6345_SPI_BASE (0xdeadbeef)
111 -#define BCM_6345_UDC0_BASE (0xdeadbeef)
112 +#define BCM_6345_UDC0_BASE (0xfffe2100)
113 #define BCM_6345_USBDMA_BASE (0xfffe2800)
114 #define BCM_6345_ENET0_BASE (0xfffe1800)
115 #define BCM_6345_ENETDMA_BASE (0xfffe2800)
117 #define BCM_6358_UART0_BASE (0xfffe0100)
118 #define BCM_6358_GPIO_BASE (0xfffe0080)
119 #define BCM_6358_SPI_BASE (0xdeadbeef)
120 -#define BCM_6358_UDC0_BASE (0xfffe0800)
121 +#define BCM_6358_UDC0_BASE (0xfffe0400)
122 #define BCM_6358_OHCI0_BASE (0xfffe1400)
123 #define BCM_6358_OHCI_PRIV_BASE (0xdeadbeef)
124 #define BCM_6358_USBH_PRIV_BASE (0xfffe1500)
134 #define BCM_6345_UART0_IRQ (IRQ_INTERNAL_BASE + 2)
135 #define BCM_6345_DSL_IRQ (IRQ_INTERNAL_BASE + 3)
136 #define BCM_6345_ATM_IRQ (IRQ_INTERNAL_BASE + 4)
137 -#define BCM_6345_USB_IRQ (IRQ_INTERNAL_BASE + 5)
138 +#define BCM_6345_UDC0_IRQ (IRQ_INTERNAL_BASE + 5)
139 #define BCM_6345_ENET0_IRQ (IRQ_INTERNAL_BASE + 8)
140 #define BCM_6345_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 12)
141 #define BCM_6345_ENET0_RXDMA_IRQ (IRQ_INTERNAL_BASE + 13 + 1)
142 @@ -494,10 +495,17 @@
143 #define BCM_6348_TIMER_IRQ (IRQ_INTERNAL_BASE + 0)
144 #define BCM_6348_UART0_IRQ (IRQ_INTERNAL_BASE + 2)
145 #define BCM_6348_DSL_IRQ (IRQ_INTERNAL_BASE + 4)
146 +#define BCM_6348_UDC0_IRQ (IRQ_INTERNAL_BASE + 6)
147 #define BCM_6348_ENET1_IRQ (IRQ_INTERNAL_BASE + 7)
148 #define BCM_6348_ENET0_IRQ (IRQ_INTERNAL_BASE + 8)
149 #define BCM_6348_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 9)
150 #define BCM_6348_OHCI0_IRQ (IRQ_INTERNAL_BASE + 12)
151 +#define BCM_6348_USB_CNTL_RX_DMA_IRQ (IRQ_INTERNAL_BASE + 14)
152 +#define BCM_6348_USB_CNTL_TX_DMA_IRQ (IRQ_INTERNAL_BASE + 15)
153 +#define BCM_6348_USB_BULK_RX_DMA_IRQ (IRQ_INTERNAL_BASE + 16)
154 +#define BCM_6348_USB_BULK_TX_DMA_IRQ (IRQ_INTERNAL_BASE + 17)
155 +#define BCM_6348_USB_ISO_RX_DMA_IRQ (IRQ_INTERNAL_BASE + 18)
156 +#define BCM_6348_USB_ISO_TX_DMA_IRQ (IRQ_INTERNAL_BASE + 19)
157 #define BCM_6348_ENET0_RXDMA_IRQ (IRQ_INTERNAL_BASE + 20)
158 #define BCM_6348_ENET0_TXDMA_IRQ (IRQ_INTERNAL_BASE + 21)
159 #define BCM_6348_ENET1_RXDMA_IRQ (IRQ_INTERNAL_BASE + 22)
160 Index: linux-2.6.32.13/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_udc.h
161 ===================================================================
162 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
163 +++ linux-2.6.32.13/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_udc.h 2010-05-27 21:44:19.000000000 -0400
165 +#ifndef BCM63XX_DEV_USB_UDC_H_
166 +#define BCM63XX_DEV_USB_UDC_H_
168 +int bcm63xx_udc_register(void);
170 +#endif /* BCM63XX_DEV_USB_UDC_H_ */
171 Index: linux-2.6.32.13/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
172 ===================================================================
173 --- linux-2.6.32.13.orig/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h 2010-05-27 21:42:10.000000000 -0400
174 +++ linux-2.6.32.13/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h 2010-05-27 21:44:19.000000000 -0400
176 unsigned int has_ohci0:1;
177 unsigned int has_ehci0:1;
178 unsigned int has_dsp:1;
179 + unsigned int has_udc0:1;
181 /* ethernet config */
182 struct bcm63xx_enet_platform_data enet0;
183 Index: linux-2.6.32.13/arch/mips/bcm63xx/Makefile
184 ===================================================================
185 --- linux-2.6.32.13.orig/arch/mips/bcm63xx/Makefile 2010-05-27 21:34:56.000000000 -0400
186 +++ linux-2.6.32.13/arch/mips/bcm63xx/Makefile 2010-05-27 21:44:19.000000000 -0400
188 obj-y += clk.o cpu.o cs.o gpio.o irq.o prom.o setup.o timer.o \
189 dev-dsp.o dev-enet.o dev-pcmcia.o dev-uart.o dev-wdt.o \
190 - dev-usb-ohci.o dev-usb-ehci.o
191 + dev-usb-ohci.o dev-usb-ehci.o dev-usb-udc.o
192 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
195 Index: linux-2.6.32.13/arch/mips/bcm63xx/clk.c
196 ===================================================================
197 --- linux-2.6.32.13.orig/arch/mips/bcm63xx/clk.c 2010-05-27 21:34:56.000000000 -0400
198 +++ linux-2.6.32.13/arch/mips/bcm63xx/clk.c 2010-05-27 21:44:19.000000000 -0400
205 +static void usbs_set(struct clk *clk, int enable)
209 + switch(bcm63xx_get_cpu_id()) {
210 + case BCM6338_CPU_ID:
211 + mask = CKCTL_6338_USBS_EN;
213 + case BCM6348_CPU_ID:
214 + mask = CKCTL_6348_USBS_EN;
219 + bcm_hwclock_set(mask, enable);
222 +static struct clk clk_usbs = {
229 static void spi_set(struct clk *clk, int enable)
232 if (!strcmp(id, "usbh"))
234 + if (!strcmp(id, "usbs"))
236 if (!strcmp(id, "spi"))
238 if (!strcmp(id, "periph"))
239 Index: linux-2.6.32.13/arch/mips/bcm63xx/Kconfig
240 ===================================================================
241 --- linux-2.6.32.13.orig/arch/mips/bcm63xx/Kconfig 2010-05-27 21:34:56.000000000 -0400
242 +++ linux-2.6.32.13/arch/mips/bcm63xx/Kconfig 2010-05-27 21:44:19.000000000 -0400
244 select USB_ARCH_HAS_OHCI
245 select USB_OHCI_BIG_ENDIAN_DESC
246 select USB_OHCI_BIG_ENDIAN_MMIO
247 + select USB_ARCH_HAS_UDC
249 config BCM63XX_CPU_6345
250 bool "support 6345 CPU"
252 select USB_ARCH_HAS_OHCI
253 select USB_OHCI_BIG_ENDIAN_DESC
254 select USB_OHCI_BIG_ENDIAN_MMIO
255 + select USB_ARCH_HAS_UDC
257 config BCM63XX_CPU_6358
258 bool "support 6358 CPU"