diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2012-09-27 12:09:45 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2012-09-27 12:09:45 -0400 |
commit | 8922c9b4b2e3b1b845b46e8da61ad228d8f1b121 (patch) | |
tree | 0342521aa22e175a1c22c38f005ec7fd2037ff99 | |
parent | 73d155b304575435cd9f6deeb93fbd4d2a6cc9af (diff) | |
parent | 22df90f6bb687db58298084a200782dd0148d247 (diff) |
Merge branch 'broadcom' of git://dev.phrozen.org/mips-next into mips-for-linux-next
-rw-r--r-- | arch/mips/bcm63xx/Makefile | 2 | ||||
-rw-r--r-- | arch/mips/bcm63xx/boards/board_bcm963xx.c | 10 | ||||
-rw-r--r-- | arch/mips/bcm63xx/clk.c | 21 | ||||
-rw-r--r-- | arch/mips/bcm63xx/dev-usb-usbd.c | 65 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h | 85 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_usbd.h | 17 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-bcm63xx/bcm63xx_iudma.h | 38 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h | 167 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h | 5 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bcm63xx_enet.h | 30 |
10 files changed, 401 insertions, 39 deletions
diff --git a/arch/mips/bcm63xx/Makefile b/arch/mips/bcm63xx/Makefile index 833af72c852a..9bbb30a9dc20 100644 --- a/arch/mips/bcm63xx/Makefile +++ b/arch/mips/bcm63xx/Makefile | |||
@@ -1,6 +1,6 @@ | |||
1 | obj-y += clk.o cpu.o cs.o gpio.o irq.o prom.o setup.o timer.o \ | 1 | obj-y += clk.o cpu.o cs.o gpio.o irq.o prom.o setup.o timer.o \ |
2 | dev-dsp.o dev-enet.o dev-flash.o dev-pcmcia.o dev-rng.o \ | 2 | dev-dsp.o dev-enet.o dev-flash.o dev-pcmcia.o dev-rng.o \ |
3 | dev-spi.o dev-uart.o dev-wdt.o | 3 | dev-spi.o dev-uart.o dev-wdt.o dev-usb-usbd.o |
4 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o | 4 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o |
5 | 5 | ||
6 | obj-y += boards/ | 6 | obj-y += boards/ |
diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c index feb05258a4d1..ea4ea77c6297 100644 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <bcm63xx_dev_flash.h> | 24 | #include <bcm63xx_dev_flash.h> |
25 | #include <bcm63xx_dev_pcmcia.h> | 25 | #include <bcm63xx_dev_pcmcia.h> |
26 | #include <bcm63xx_dev_spi.h> | 26 | #include <bcm63xx_dev_spi.h> |
27 | #include <bcm63xx_dev_usb_usbd.h> | ||
27 | #include <board_bcm963xx.h> | 28 | #include <board_bcm963xx.h> |
28 | 29 | ||
29 | #define PFX "board_bcm963xx: " | 30 | #define PFX "board_bcm963xx: " |
@@ -42,6 +43,12 @@ static struct board_info __initdata board_96328avng = { | |||
42 | 43 | ||
43 | .has_uart0 = 1, | 44 | .has_uart0 = 1, |
44 | .has_pci = 1, | 45 | .has_pci = 1, |
46 | .has_usbd = 0, | ||
47 | |||
48 | .usbd = { | ||
49 | .use_fullspeed = 0, | ||
50 | .port_no = 0, | ||
51 | }, | ||
45 | 52 | ||
46 | .leds = { | 53 | .leds = { |
47 | { | 54 | { |
@@ -888,6 +895,9 @@ int __init board_register_devices(void) | |||
888 | !board_get_mac_address(board.enet1.mac_addr)) | 895 | !board_get_mac_address(board.enet1.mac_addr)) |
889 | bcm63xx_enet_register(1, &board.enet1); | 896 | bcm63xx_enet_register(1, &board.enet1); |
890 | 897 | ||
898 | if (board.has_usbd) | ||
899 | bcm63xx_usbd_register(&board.usbd); | ||
900 | |||
891 | if (board.has_dsp) | 901 | if (board.has_dsp) |
892 | bcm63xx_dsp_register(&board.dsp); | 902 | bcm63xx_dsp_register(&board.dsp); |
893 | 903 | ||
diff --git a/arch/mips/bcm63xx/clk.c b/arch/mips/bcm63xx/clk.c index 1db48adb543a..dff79ab6005e 100644 --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c | |||
@@ -160,7 +160,9 @@ static struct clk clk_pcm = { | |||
160 | */ | 160 | */ |
161 | static void usbh_set(struct clk *clk, int enable) | 161 | static void usbh_set(struct clk *clk, int enable) |
162 | { | 162 | { |
163 | if (BCMCPU_IS_6348()) | 163 | if (BCMCPU_IS_6328()) |
164 | bcm_hwclock_set(CKCTL_6328_USBH_EN, enable); | ||
165 | else if (BCMCPU_IS_6348()) | ||
164 | bcm_hwclock_set(CKCTL_6348_USBH_EN, enable); | 166 | bcm_hwclock_set(CKCTL_6348_USBH_EN, enable); |
165 | else if (BCMCPU_IS_6368()) | 167 | else if (BCMCPU_IS_6368()) |
166 | bcm_hwclock_set(CKCTL_6368_USBH_EN, enable); | 168 | bcm_hwclock_set(CKCTL_6368_USBH_EN, enable); |
@@ -171,6 +173,21 @@ static struct clk clk_usbh = { | |||
171 | }; | 173 | }; |
172 | 174 | ||
173 | /* | 175 | /* |
176 | * USB device clock | ||
177 | */ | ||
178 | static void usbd_set(struct clk *clk, int enable) | ||
179 | { | ||
180 | if (BCMCPU_IS_6328()) | ||
181 | bcm_hwclock_set(CKCTL_6328_USBD_EN, enable); | ||
182 | else if (BCMCPU_IS_6368()) | ||
183 | bcm_hwclock_set(CKCTL_6368_USBD_EN, enable); | ||
184 | } | ||
185 | |||
186 | static struct clk clk_usbd = { | ||
187 | .set = usbd_set, | ||
188 | }; | ||
189 | |||
190 | /* | ||
174 | * SPI clock | 191 | * SPI clock |
175 | */ | 192 | */ |
176 | static void spi_set(struct clk *clk, int enable) | 193 | static void spi_set(struct clk *clk, int enable) |
@@ -284,6 +301,8 @@ struct clk *clk_get(struct device *dev, const char *id) | |||
284 | return &clk_ephy; | 301 | return &clk_ephy; |
285 | if (!strcmp(id, "usbh")) | 302 | if (!strcmp(id, "usbh")) |
286 | return &clk_usbh; | 303 | return &clk_usbh; |
304 | if (!strcmp(id, "usbd")) | ||
305 | return &clk_usbd; | ||
287 | if (!strcmp(id, "spi")) | 306 | if (!strcmp(id, "spi")) |
288 | return &clk_spi; | 307 | return &clk_spi; |
289 | if (!strcmp(id, "xtm")) | 308 | if (!strcmp(id, "xtm")) |
diff --git a/arch/mips/bcm63xx/dev-usb-usbd.c b/arch/mips/bcm63xx/dev-usb-usbd.c new file mode 100644 index 000000000000..508bd9d8df27 --- /dev/null +++ b/arch/mips/bcm63xx/dev-usb-usbd.c | |||
@@ -0,0 +1,65 @@ | |||
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) 2008 Maxime Bizon <mbizon@freebox.fr> | ||
7 | * Copyright (C) 2012 Kevin Cernekee <cernekee@gmail.com> | ||
8 | * Copyright (C) 2012 Broadcom Corporation | ||
9 | */ | ||
10 | |||
11 | #include <linux/init.h> | ||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/platform_device.h> | ||
14 | #include <linux/dma-mapping.h> | ||
15 | #include <bcm63xx_cpu.h> | ||
16 | #include <bcm63xx_dev_usb_usbd.h> | ||
17 | |||
18 | #define NUM_MMIO 2 | ||
19 | #define NUM_IRQ 7 | ||
20 | |||
21 | static struct resource usbd_resources[NUM_MMIO + NUM_IRQ]; | ||
22 | |||
23 | static u64 usbd_dmamask = DMA_BIT_MASK(32); | ||
24 | |||
25 | static struct platform_device bcm63xx_usbd_device = { | ||
26 | .name = "bcm63xx_udc", | ||
27 | .id = -1, | ||
28 | .num_resources = ARRAY_SIZE(usbd_resources), | ||
29 | .resource = usbd_resources, | ||
30 | .dev = { | ||
31 | .dma_mask = &usbd_dmamask, | ||
32 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
33 | }, | ||
34 | }; | ||
35 | |||
36 | int __init bcm63xx_usbd_register(const struct bcm63xx_usbd_platform_data *pd) | ||
37 | { | ||
38 | const int irq_list[NUM_IRQ] = { IRQ_USBD, | ||
39 | IRQ_USBD_RXDMA0, IRQ_USBD_TXDMA0, | ||
40 | IRQ_USBD_RXDMA1, IRQ_USBD_TXDMA1, | ||
41 | IRQ_USBD_RXDMA2, IRQ_USBD_TXDMA2 }; | ||
42 | int i; | ||
43 | |||
44 | if (!BCMCPU_IS_6328() && !BCMCPU_IS_6368()) | ||
45 | return 0; | ||
46 | |||
47 | usbd_resources[0].start = bcm63xx_regset_address(RSET_USBD); | ||
48 | usbd_resources[0].end = usbd_resources[0].start + RSET_USBD_SIZE - 1; | ||
49 | usbd_resources[0].flags = IORESOURCE_MEM; | ||
50 | |||
51 | usbd_resources[1].start = bcm63xx_regset_address(RSET_USBDMA); | ||
52 | usbd_resources[1].end = usbd_resources[1].start + RSET_USBDMA_SIZE - 1; | ||
53 | usbd_resources[1].flags = IORESOURCE_MEM; | ||
54 | |||
55 | for (i = 0; i < NUM_IRQ; i++) { | ||
56 | struct resource *r = &usbd_resources[NUM_MMIO + i]; | ||
57 | |||
58 | r->start = r->end = bcm63xx_get_irq_number(irq_list[i]); | ||
59 | r->flags = IORESOURCE_IRQ; | ||
60 | } | ||
61 | |||
62 | platform_device_add_data(&bcm63xx_usbd_device, pd, sizeof(*pd)); | ||
63 | |||
64 | return platform_device_register(&bcm63xx_usbd_device); | ||
65 | } | ||
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h index e104ddb694a8..1ac5704623f2 100644 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h | |||
@@ -120,6 +120,8 @@ enum bcm63xx_regs_set { | |||
120 | RSET_OHCI0, | 120 | RSET_OHCI0, |
121 | RSET_OHCI_PRIV, | 121 | RSET_OHCI_PRIV, |
122 | RSET_USBH_PRIV, | 122 | RSET_USBH_PRIV, |
123 | RSET_USBD, | ||
124 | RSET_USBDMA, | ||
123 | RSET_MPI, | 125 | RSET_MPI, |
124 | RSET_PCMCIA, | 126 | RSET_PCMCIA, |
125 | RSET_PCIE, | 127 | RSET_PCIE, |
@@ -162,6 +164,8 @@ enum bcm63xx_regs_set { | |||
162 | #define RSET_UDC_SIZE 256 | 164 | #define RSET_UDC_SIZE 256 |
163 | #define RSET_OHCI_SIZE 256 | 165 | #define RSET_OHCI_SIZE 256 |
164 | #define RSET_EHCI_SIZE 256 | 166 | #define RSET_EHCI_SIZE 256 |
167 | #define RSET_USBD_SIZE 256 | ||
168 | #define RSET_USBDMA_SIZE 1280 | ||
165 | #define RSET_PCMCIA_SIZE 12 | 169 | #define RSET_PCMCIA_SIZE 12 |
166 | #define RSET_M2M_SIZE 256 | 170 | #define RSET_M2M_SIZE 256 |
167 | #define RSET_ATM_SIZE 4096 | 171 | #define RSET_ATM_SIZE 4096 |
@@ -183,10 +187,11 @@ enum bcm63xx_regs_set { | |||
183 | #define BCM_6328_GPIO_BASE (0xb0000080) | 187 | #define BCM_6328_GPIO_BASE (0xb0000080) |
184 | #define BCM_6328_SPI_BASE (0xdeadbeef) | 188 | #define BCM_6328_SPI_BASE (0xdeadbeef) |
185 | #define BCM_6328_UDC0_BASE (0xdeadbeef) | 189 | #define BCM_6328_UDC0_BASE (0xdeadbeef) |
186 | #define BCM_6328_USBDMA_BASE (0xdeadbeef) | 190 | #define BCM_6328_USBDMA_BASE (0xb000c000) |
187 | #define BCM_6328_OHCI0_BASE (0xdeadbeef) | 191 | #define BCM_6328_OHCI0_BASE (0xb0002600) |
188 | #define BCM_6328_OHCI_PRIV_BASE (0xdeadbeef) | 192 | #define BCM_6328_OHCI_PRIV_BASE (0xdeadbeef) |
189 | #define BCM_6328_USBH_PRIV_BASE (0xdeadbeef) | 193 | #define BCM_6328_USBH_PRIV_BASE (0xb0002700) |
194 | #define BCM_6328_USBD_BASE (0xb0002400) | ||
190 | #define BCM_6328_MPI_BASE (0xdeadbeef) | 195 | #define BCM_6328_MPI_BASE (0xdeadbeef) |
191 | #define BCM_6328_PCMCIA_BASE (0xdeadbeef) | 196 | #define BCM_6328_PCMCIA_BASE (0xdeadbeef) |
192 | #define BCM_6328_PCIE_BASE (0xb0e40000) | 197 | #define BCM_6328_PCIE_BASE (0xb0e40000) |
@@ -199,7 +204,7 @@ enum bcm63xx_regs_set { | |||
199 | #define BCM_6328_ENETDMAC_BASE (0xb000da00) | 204 | #define BCM_6328_ENETDMAC_BASE (0xb000da00) |
200 | #define BCM_6328_ENETDMAS_BASE (0xb000dc00) | 205 | #define BCM_6328_ENETDMAS_BASE (0xb000dc00) |
201 | #define BCM_6328_ENETSW_BASE (0xb0e00000) | 206 | #define BCM_6328_ENETSW_BASE (0xb0e00000) |
202 | #define BCM_6328_EHCI0_BASE (0x10002500) | 207 | #define BCM_6328_EHCI0_BASE (0xb0002500) |
203 | #define BCM_6328_SDRAM_BASE (0xdeadbeef) | 208 | #define BCM_6328_SDRAM_BASE (0xdeadbeef) |
204 | #define BCM_6328_MEMC_BASE (0xdeadbeef) | 209 | #define BCM_6328_MEMC_BASE (0xdeadbeef) |
205 | #define BCM_6328_DDR_BASE (0xb0003000) | 210 | #define BCM_6328_DDR_BASE (0xb0003000) |
@@ -232,6 +237,7 @@ enum bcm63xx_regs_set { | |||
232 | #define BCM_6338_OHCI0_BASE (0xdeadbeef) | 237 | #define BCM_6338_OHCI0_BASE (0xdeadbeef) |
233 | #define BCM_6338_OHCI_PRIV_BASE (0xfffe3000) | 238 | #define BCM_6338_OHCI_PRIV_BASE (0xfffe3000) |
234 | #define BCM_6338_USBH_PRIV_BASE (0xdeadbeef) | 239 | #define BCM_6338_USBH_PRIV_BASE (0xdeadbeef) |
240 | #define BCM_6338_USBD_BASE (0xdeadbeef) | ||
235 | #define BCM_6338_MPI_BASE (0xfffe3160) | 241 | #define BCM_6338_MPI_BASE (0xfffe3160) |
236 | #define BCM_6338_PCMCIA_BASE (0xdeadbeef) | 242 | #define BCM_6338_PCMCIA_BASE (0xdeadbeef) |
237 | #define BCM_6338_PCIE_BASE (0xdeadbeef) | 243 | #define BCM_6338_PCIE_BASE (0xdeadbeef) |
@@ -286,6 +292,7 @@ enum bcm63xx_regs_set { | |||
286 | #define BCM_6345_OHCI0_BASE (0xfffe2100) | 292 | #define BCM_6345_OHCI0_BASE (0xfffe2100) |
287 | #define BCM_6345_OHCI_PRIV_BASE (0xfffe2200) | 293 | #define BCM_6345_OHCI_PRIV_BASE (0xfffe2200) |
288 | #define BCM_6345_USBH_PRIV_BASE (0xdeadbeef) | 294 | #define BCM_6345_USBH_PRIV_BASE (0xdeadbeef) |
295 | #define BCM_6345_USBD_BASE (0xdeadbeef) | ||
289 | #define BCM_6345_SDRAM_REGS_BASE (0xfffe2300) | 296 | #define BCM_6345_SDRAM_REGS_BASE (0xfffe2300) |
290 | #define BCM_6345_DSL_BASE (0xdeadbeef) | 297 | #define BCM_6345_DSL_BASE (0xdeadbeef) |
291 | #define BCM_6345_UBUS_BASE (0xdeadbeef) | 298 | #define BCM_6345_UBUS_BASE (0xdeadbeef) |
@@ -319,9 +326,11 @@ enum bcm63xx_regs_set { | |||
319 | #define BCM_6348_GPIO_BASE (0xfffe0400) | 326 | #define BCM_6348_GPIO_BASE (0xfffe0400) |
320 | #define BCM_6348_SPI_BASE (0xfffe0c00) | 327 | #define BCM_6348_SPI_BASE (0xfffe0c00) |
321 | #define BCM_6348_UDC0_BASE (0xfffe1000) | 328 | #define BCM_6348_UDC0_BASE (0xfffe1000) |
329 | #define BCM_6348_USBDMA_BASE (0xdeadbeef) | ||
322 | #define BCM_6348_OHCI0_BASE (0xfffe1b00) | 330 | #define BCM_6348_OHCI0_BASE (0xfffe1b00) |
323 | #define BCM_6348_OHCI_PRIV_BASE (0xfffe1c00) | 331 | #define BCM_6348_OHCI_PRIV_BASE (0xfffe1c00) |
324 | #define BCM_6348_USBH_PRIV_BASE (0xdeadbeef) | 332 | #define BCM_6348_USBH_PRIV_BASE (0xdeadbeef) |
333 | #define BCM_6348_USBD_BASE (0xdeadbeef) | ||
325 | #define BCM_6348_MPI_BASE (0xfffe2000) | 334 | #define BCM_6348_MPI_BASE (0xfffe2000) |
326 | #define BCM_6348_PCMCIA_BASE (0xfffe2054) | 335 | #define BCM_6348_PCMCIA_BASE (0xfffe2054) |
327 | #define BCM_6348_PCIE_BASE (0xdeadbeef) | 336 | #define BCM_6348_PCIE_BASE (0xdeadbeef) |
@@ -362,9 +371,11 @@ enum bcm63xx_regs_set { | |||
362 | #define BCM_6358_GPIO_BASE (0xfffe0080) | 371 | #define BCM_6358_GPIO_BASE (0xfffe0080) |
363 | #define BCM_6358_SPI_BASE (0xfffe0800) | 372 | #define BCM_6358_SPI_BASE (0xfffe0800) |
364 | #define BCM_6358_UDC0_BASE (0xfffe0800) | 373 | #define BCM_6358_UDC0_BASE (0xfffe0800) |
374 | #define BCM_6358_USBDMA_BASE (0xdeadbeef) | ||
365 | #define BCM_6358_OHCI0_BASE (0xfffe1400) | 375 | #define BCM_6358_OHCI0_BASE (0xfffe1400) |
366 | #define BCM_6358_OHCI_PRIV_BASE (0xdeadbeef) | 376 | #define BCM_6358_OHCI_PRIV_BASE (0xdeadbeef) |
367 | #define BCM_6358_USBH_PRIV_BASE (0xfffe1500) | 377 | #define BCM_6358_USBH_PRIV_BASE (0xfffe1500) |
378 | #define BCM_6358_USBD_BASE (0xdeadbeef) | ||
368 | #define BCM_6358_MPI_BASE (0xfffe1000) | 379 | #define BCM_6358_MPI_BASE (0xfffe1000) |
369 | #define BCM_6358_PCMCIA_BASE (0xfffe1054) | 380 | #define BCM_6358_PCMCIA_BASE (0xfffe1054) |
370 | #define BCM_6358_PCIE_BASE (0xdeadbeef) | 381 | #define BCM_6358_PCIE_BASE (0xdeadbeef) |
@@ -406,9 +417,11 @@ enum bcm63xx_regs_set { | |||
406 | #define BCM_6368_GPIO_BASE (0xb0000080) | 417 | #define BCM_6368_GPIO_BASE (0xb0000080) |
407 | #define BCM_6368_SPI_BASE (0xb0000800) | 418 | #define BCM_6368_SPI_BASE (0xb0000800) |
408 | #define BCM_6368_UDC0_BASE (0xdeadbeef) | 419 | #define BCM_6368_UDC0_BASE (0xdeadbeef) |
420 | #define BCM_6368_USBDMA_BASE (0xb0004800) | ||
409 | #define BCM_6368_OHCI0_BASE (0xb0001600) | 421 | #define BCM_6368_OHCI0_BASE (0xb0001600) |
410 | #define BCM_6368_OHCI_PRIV_BASE (0xdeadbeef) | 422 | #define BCM_6368_OHCI_PRIV_BASE (0xdeadbeef) |
411 | #define BCM_6368_USBH_PRIV_BASE (0xb0001700) | 423 | #define BCM_6368_USBH_PRIV_BASE (0xb0001700) |
424 | #define BCM_6368_USBD_BASE (0xb0001400) | ||
412 | #define BCM_6368_MPI_BASE (0xb0001000) | 425 | #define BCM_6368_MPI_BASE (0xb0001000) |
413 | #define BCM_6368_PCMCIA_BASE (0xb0001054) | 426 | #define BCM_6368_PCMCIA_BASE (0xb0001054) |
414 | #define BCM_6368_PCIE_BASE (0xdeadbeef) | 427 | #define BCM_6368_PCIE_BASE (0xdeadbeef) |
@@ -458,6 +471,8 @@ extern const unsigned long *bcm63xx_regs_base; | |||
458 | __GEN_RSET_BASE(__cpu, OHCI0) \ | 471 | __GEN_RSET_BASE(__cpu, OHCI0) \ |
459 | __GEN_RSET_BASE(__cpu, OHCI_PRIV) \ | 472 | __GEN_RSET_BASE(__cpu, OHCI_PRIV) \ |
460 | __GEN_RSET_BASE(__cpu, USBH_PRIV) \ | 473 | __GEN_RSET_BASE(__cpu, USBH_PRIV) \ |
474 | __GEN_RSET_BASE(__cpu, USBD) \ | ||
475 | __GEN_RSET_BASE(__cpu, USBDMA) \ | ||
461 | __GEN_RSET_BASE(__cpu, MPI) \ | 476 | __GEN_RSET_BASE(__cpu, MPI) \ |
462 | __GEN_RSET_BASE(__cpu, PCMCIA) \ | 477 | __GEN_RSET_BASE(__cpu, PCMCIA) \ |
463 | __GEN_RSET_BASE(__cpu, PCIE) \ | 478 | __GEN_RSET_BASE(__cpu, PCIE) \ |
@@ -499,6 +514,8 @@ extern const unsigned long *bcm63xx_regs_base; | |||
499 | [RSET_OHCI0] = BCM_## __cpu ##_OHCI0_BASE, \ | 514 | [RSET_OHCI0] = BCM_## __cpu ##_OHCI0_BASE, \ |
500 | [RSET_OHCI_PRIV] = BCM_## __cpu ##_OHCI_PRIV_BASE, \ | 515 | [RSET_OHCI_PRIV] = BCM_## __cpu ##_OHCI_PRIV_BASE, \ |
501 | [RSET_USBH_PRIV] = BCM_## __cpu ##_USBH_PRIV_BASE, \ | 516 | [RSET_USBH_PRIV] = BCM_## __cpu ##_USBH_PRIV_BASE, \ |
517 | [RSET_USBD] = BCM_## __cpu ##_USBD_BASE, \ | ||
518 | [RSET_USBDMA] = BCM_## __cpu ##_USBDMA_BASE, \ | ||
502 | [RSET_MPI] = BCM_## __cpu ##_MPI_BASE, \ | 519 | [RSET_MPI] = BCM_## __cpu ##_MPI_BASE, \ |
503 | [RSET_PCMCIA] = BCM_## __cpu ##_PCMCIA_BASE, \ | 520 | [RSET_PCMCIA] = BCM_## __cpu ##_PCMCIA_BASE, \ |
504 | [RSET_PCIE] = BCM_## __cpu ##_PCIE_BASE, \ | 521 | [RSET_PCIE] = BCM_## __cpu ##_PCIE_BASE, \ |
@@ -569,6 +586,13 @@ enum bcm63xx_irq { | |||
569 | IRQ_ENET_PHY, | 586 | IRQ_ENET_PHY, |
570 | IRQ_OHCI0, | 587 | IRQ_OHCI0, |
571 | IRQ_EHCI0, | 588 | IRQ_EHCI0, |
589 | IRQ_USBD, | ||
590 | IRQ_USBD_RXDMA0, | ||
591 | IRQ_USBD_TXDMA0, | ||
592 | IRQ_USBD_RXDMA1, | ||
593 | IRQ_USBD_TXDMA1, | ||
594 | IRQ_USBD_RXDMA2, | ||
595 | IRQ_USBD_TXDMA2, | ||
572 | IRQ_ENET0_RXDMA, | 596 | IRQ_ENET0_RXDMA, |
573 | IRQ_ENET0_TXDMA, | 597 | IRQ_ENET0_TXDMA, |
574 | IRQ_ENET1_RXDMA, | 598 | IRQ_ENET1_RXDMA, |
@@ -602,8 +626,15 @@ enum bcm63xx_irq { | |||
602 | #define BCM_6328_ENET0_IRQ 0 | 626 | #define BCM_6328_ENET0_IRQ 0 |
603 | #define BCM_6328_ENET1_IRQ 0 | 627 | #define BCM_6328_ENET1_IRQ 0 |
604 | #define BCM_6328_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 12) | 628 | #define BCM_6328_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 12) |
605 | #define BCM_6328_OHCI0_IRQ (IRQ_INTERNAL_BASE + 9) | 629 | #define BCM_6328_OHCI0_IRQ (BCM_6328_HIGH_IRQ_BASE + 9) |
606 | #define BCM_6328_EHCI0_IRQ (IRQ_INTERNAL_BASE + 10) | 630 | #define BCM_6328_EHCI0_IRQ (BCM_6328_HIGH_IRQ_BASE + 10) |
631 | #define BCM_6328_USBD_IRQ (IRQ_INTERNAL_BASE + 4) | ||
632 | #define BCM_6328_USBD_RXDMA0_IRQ (IRQ_INTERNAL_BASE + 5) | ||
633 | #define BCM_6328_USBD_TXDMA0_IRQ (IRQ_INTERNAL_BASE + 6) | ||
634 | #define BCM_6328_USBD_RXDMA1_IRQ (IRQ_INTERNAL_BASE + 7) | ||
635 | #define BCM_6328_USBD_TXDMA1_IRQ (IRQ_INTERNAL_BASE + 8) | ||
636 | #define BCM_6328_USBD_RXDMA2_IRQ (IRQ_INTERNAL_BASE + 9) | ||
637 | #define BCM_6328_USBD_TXDMA2_IRQ (IRQ_INTERNAL_BASE + 10) | ||
607 | #define BCM_6328_PCMCIA_IRQ 0 | 638 | #define BCM_6328_PCMCIA_IRQ 0 |
608 | #define BCM_6328_ENET0_RXDMA_IRQ 0 | 639 | #define BCM_6328_ENET0_RXDMA_IRQ 0 |
609 | #define BCM_6328_ENET0_TXDMA_IRQ 0 | 640 | #define BCM_6328_ENET0_TXDMA_IRQ 0 |
@@ -642,6 +673,13 @@ enum bcm63xx_irq { | |||
642 | #define BCM_6338_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 9) | 673 | #define BCM_6338_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 9) |
643 | #define BCM_6338_OHCI0_IRQ 0 | 674 | #define BCM_6338_OHCI0_IRQ 0 |
644 | #define BCM_6338_EHCI0_IRQ 0 | 675 | #define BCM_6338_EHCI0_IRQ 0 |
676 | #define BCM_6338_USBD_IRQ 0 | ||
677 | #define BCM_6338_USBD_RXDMA0_IRQ 0 | ||
678 | #define BCM_6338_USBD_TXDMA0_IRQ 0 | ||
679 | #define BCM_6338_USBD_RXDMA1_IRQ 0 | ||
680 | #define BCM_6338_USBD_TXDMA1_IRQ 0 | ||
681 | #define BCM_6338_USBD_RXDMA2_IRQ 0 | ||
682 | #define BCM_6338_USBD_TXDMA2_IRQ 0 | ||
645 | #define BCM_6338_ENET0_RXDMA_IRQ (IRQ_INTERNAL_BASE + 15) | 683 | #define BCM_6338_ENET0_RXDMA_IRQ (IRQ_INTERNAL_BASE + 15) |
646 | #define BCM_6338_ENET0_TXDMA_IRQ (IRQ_INTERNAL_BASE + 16) | 684 | #define BCM_6338_ENET0_TXDMA_IRQ (IRQ_INTERNAL_BASE + 16) |
647 | #define BCM_6338_ENET1_RXDMA_IRQ 0 | 685 | #define BCM_6338_ENET1_RXDMA_IRQ 0 |
@@ -673,6 +711,13 @@ enum bcm63xx_irq { | |||
673 | #define BCM_6345_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 12) | 711 | #define BCM_6345_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 12) |
674 | #define BCM_6345_OHCI0_IRQ 0 | 712 | #define BCM_6345_OHCI0_IRQ 0 |
675 | #define BCM_6345_EHCI0_IRQ 0 | 713 | #define BCM_6345_EHCI0_IRQ 0 |
714 | #define BCM_6345_USBD_IRQ 0 | ||
715 | #define BCM_6345_USBD_RXDMA0_IRQ 0 | ||
716 | #define BCM_6345_USBD_TXDMA0_IRQ 0 | ||
717 | #define BCM_6345_USBD_RXDMA1_IRQ 0 | ||
718 | #define BCM_6345_USBD_TXDMA1_IRQ 0 | ||
719 | #define BCM_6345_USBD_RXDMA2_IRQ 0 | ||
720 | #define BCM_6345_USBD_TXDMA2_IRQ 0 | ||
676 | #define BCM_6345_ENET0_RXDMA_IRQ (IRQ_INTERNAL_BASE + 13 + 1) | 721 | #define BCM_6345_ENET0_RXDMA_IRQ (IRQ_INTERNAL_BASE + 13 + 1) |
677 | #define BCM_6345_ENET0_TXDMA_IRQ (IRQ_INTERNAL_BASE + 13 + 2) | 722 | #define BCM_6345_ENET0_TXDMA_IRQ (IRQ_INTERNAL_BASE + 13 + 2) |
678 | #define BCM_6345_ENET1_RXDMA_IRQ 0 | 723 | #define BCM_6345_ENET1_RXDMA_IRQ 0 |
@@ -704,6 +749,13 @@ enum bcm63xx_irq { | |||
704 | #define BCM_6348_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 9) | 749 | #define BCM_6348_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 9) |
705 | #define BCM_6348_OHCI0_IRQ (IRQ_INTERNAL_BASE + 12) | 750 | #define BCM_6348_OHCI0_IRQ (IRQ_INTERNAL_BASE + 12) |
706 | #define BCM_6348_EHCI0_IRQ 0 | 751 | #define BCM_6348_EHCI0_IRQ 0 |
752 | #define BCM_6348_USBD_IRQ 0 | ||
753 | #define BCM_6348_USBD_RXDMA0_IRQ 0 | ||
754 | #define BCM_6348_USBD_TXDMA0_IRQ 0 | ||
755 | #define BCM_6348_USBD_RXDMA1_IRQ 0 | ||
756 | #define BCM_6348_USBD_TXDMA1_IRQ 0 | ||
757 | #define BCM_6348_USBD_RXDMA2_IRQ 0 | ||
758 | #define BCM_6348_USBD_TXDMA2_IRQ 0 | ||
707 | #define BCM_6348_ENET0_RXDMA_IRQ (IRQ_INTERNAL_BASE + 20) | 759 | #define BCM_6348_ENET0_RXDMA_IRQ (IRQ_INTERNAL_BASE + 20) |
708 | #define BCM_6348_ENET0_TXDMA_IRQ (IRQ_INTERNAL_BASE + 21) | 760 | #define BCM_6348_ENET0_TXDMA_IRQ (IRQ_INTERNAL_BASE + 21) |
709 | #define BCM_6348_ENET1_RXDMA_IRQ (IRQ_INTERNAL_BASE + 22) | 761 | #define BCM_6348_ENET1_RXDMA_IRQ (IRQ_INTERNAL_BASE + 22) |
@@ -735,6 +787,13 @@ enum bcm63xx_irq { | |||
735 | #define BCM_6358_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 9) | 787 | #define BCM_6358_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 9) |
736 | #define BCM_6358_OHCI0_IRQ (IRQ_INTERNAL_BASE + 5) | 788 | #define BCM_6358_OHCI0_IRQ (IRQ_INTERNAL_BASE + 5) |
737 | #define BCM_6358_EHCI0_IRQ (IRQ_INTERNAL_BASE + 10) | 789 | #define BCM_6358_EHCI0_IRQ (IRQ_INTERNAL_BASE + 10) |
790 | #define BCM_6358_USBD_IRQ 0 | ||
791 | #define BCM_6358_USBD_RXDMA0_IRQ 0 | ||
792 | #define BCM_6358_USBD_TXDMA0_IRQ 0 | ||
793 | #define BCM_6358_USBD_RXDMA1_IRQ 0 | ||
794 | #define BCM_6358_USBD_TXDMA1_IRQ 0 | ||
795 | #define BCM_6358_USBD_RXDMA2_IRQ 0 | ||
796 | #define BCM_6358_USBD_TXDMA2_IRQ 0 | ||
738 | #define BCM_6358_ENET0_RXDMA_IRQ (IRQ_INTERNAL_BASE + 15) | 797 | #define BCM_6358_ENET0_RXDMA_IRQ (IRQ_INTERNAL_BASE + 15) |
739 | #define BCM_6358_ENET0_TXDMA_IRQ (IRQ_INTERNAL_BASE + 16) | 798 | #define BCM_6358_ENET0_TXDMA_IRQ (IRQ_INTERNAL_BASE + 16) |
740 | #define BCM_6358_ENET1_RXDMA_IRQ (IRQ_INTERNAL_BASE + 17) | 799 | #define BCM_6358_ENET1_RXDMA_IRQ (IRQ_INTERNAL_BASE + 17) |
@@ -775,6 +834,13 @@ enum bcm63xx_irq { | |||
775 | #define BCM_6368_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 15) | 834 | #define BCM_6368_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 15) |
776 | #define BCM_6368_OHCI0_IRQ (IRQ_INTERNAL_BASE + 5) | 835 | #define BCM_6368_OHCI0_IRQ (IRQ_INTERNAL_BASE + 5) |
777 | #define BCM_6368_EHCI0_IRQ (IRQ_INTERNAL_BASE + 7) | 836 | #define BCM_6368_EHCI0_IRQ (IRQ_INTERNAL_BASE + 7) |
837 | #define BCM_6368_USBD_IRQ (IRQ_INTERNAL_BASE + 8) | ||
838 | #define BCM_6368_USBD_RXDMA0_IRQ (IRQ_INTERNAL_BASE + 26) | ||
839 | #define BCM_6368_USBD_TXDMA0_IRQ (IRQ_INTERNAL_BASE + 27) | ||
840 | #define BCM_6368_USBD_RXDMA1_IRQ (IRQ_INTERNAL_BASE + 28) | ||
841 | #define BCM_6368_USBD_TXDMA1_IRQ (IRQ_INTERNAL_BASE + 29) | ||
842 | #define BCM_6368_USBD_RXDMA2_IRQ (IRQ_INTERNAL_BASE + 30) | ||
843 | #define BCM_6368_USBD_TXDMA2_IRQ (IRQ_INTERNAL_BASE + 31) | ||
778 | #define BCM_6368_PCMCIA_IRQ 0 | 844 | #define BCM_6368_PCMCIA_IRQ 0 |
779 | #define BCM_6368_ENET0_RXDMA_IRQ 0 | 845 | #define BCM_6368_ENET0_RXDMA_IRQ 0 |
780 | #define BCM_6368_ENET0_TXDMA_IRQ 0 | 846 | #define BCM_6368_ENET0_TXDMA_IRQ 0 |
@@ -815,6 +881,13 @@ extern const int *bcm63xx_irqs; | |||
815 | [IRQ_ENET_PHY] = BCM_## __cpu ##_ENET_PHY_IRQ, \ | 881 | [IRQ_ENET_PHY] = BCM_## __cpu ##_ENET_PHY_IRQ, \ |
816 | [IRQ_OHCI0] = BCM_## __cpu ##_OHCI0_IRQ, \ | 882 | [IRQ_OHCI0] = BCM_## __cpu ##_OHCI0_IRQ, \ |
817 | [IRQ_EHCI0] = BCM_## __cpu ##_EHCI0_IRQ, \ | 883 | [IRQ_EHCI0] = BCM_## __cpu ##_EHCI0_IRQ, \ |
884 | [IRQ_USBD] = BCM_## __cpu ##_USBD_IRQ, \ | ||
885 | [IRQ_USBD_RXDMA0] = BCM_## __cpu ##_USBD_RXDMA0_IRQ, \ | ||
886 | [IRQ_USBD_TXDMA0] = BCM_## __cpu ##_USBD_TXDMA0_IRQ, \ | ||
887 | [IRQ_USBD_RXDMA1] = BCM_## __cpu ##_USBD_RXDMA1_IRQ, \ | ||
888 | [IRQ_USBD_TXDMA1] = BCM_## __cpu ##_USBD_TXDMA1_IRQ, \ | ||
889 | [IRQ_USBD_RXDMA2] = BCM_## __cpu ##_USBD_RXDMA2_IRQ, \ | ||
890 | [IRQ_USBD_TXDMA2] = BCM_## __cpu ##_USBD_TXDMA2_IRQ, \ | ||
818 | [IRQ_ENET0_RXDMA] = BCM_## __cpu ##_ENET0_RXDMA_IRQ, \ | 891 | [IRQ_ENET0_RXDMA] = BCM_## __cpu ##_ENET0_RXDMA_IRQ, \ |
819 | [IRQ_ENET0_TXDMA] = BCM_## __cpu ##_ENET0_TXDMA_IRQ, \ | 892 | [IRQ_ENET0_TXDMA] = BCM_## __cpu ##_ENET0_TXDMA_IRQ, \ |
820 | [IRQ_ENET1_RXDMA] = BCM_## __cpu ##_ENET1_RXDMA_IRQ, \ | 893 | [IRQ_ENET1_RXDMA] = BCM_## __cpu ##_ENET1_RXDMA_IRQ, \ |
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_usbd.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_usbd.h new file mode 100644 index 000000000000..5d6d6986f40b --- /dev/null +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_usbd.h | |||
@@ -0,0 +1,17 @@ | |||
1 | #ifndef BCM63XX_DEV_USB_USBD_H_ | ||
2 | #define BCM63XX_DEV_USB_USBD_H_ | ||
3 | |||
4 | /* | ||
5 | * usb device platform data | ||
6 | */ | ||
7 | struct bcm63xx_usbd_platform_data { | ||
8 | /* board can only support full speed (USB 1.1) */ | ||
9 | int use_fullspeed; | ||
10 | |||
11 | /* 0-based port index, for chips with >1 USB PHY */ | ||
12 | int port_no; | ||
13 | }; | ||
14 | |||
15 | int bcm63xx_usbd_register(const struct bcm63xx_usbd_platform_data *pd); | ||
16 | |||
17 | #endif /* BCM63XX_DEV_USB_USBD_H_ */ | ||
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_iudma.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_iudma.h new file mode 100644 index 000000000000..a5bbff31c898 --- /dev/null +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_iudma.h | |||
@@ -0,0 +1,38 @@ | |||
1 | #ifndef BCM63XX_IUDMA_H_ | ||
2 | #define BCM63XX_IUDMA_H_ | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | /* | ||
7 | * rx/tx dma descriptor | ||
8 | */ | ||
9 | struct bcm_enet_desc { | ||
10 | u32 len_stat; | ||
11 | u32 address; | ||
12 | }; | ||
13 | |||
14 | /* control */ | ||
15 | #define DMADESC_LENGTH_SHIFT 16 | ||
16 | #define DMADESC_LENGTH_MASK (0xfff << DMADESC_LENGTH_SHIFT) | ||
17 | #define DMADESC_OWNER_MASK (1 << 15) | ||
18 | #define DMADESC_EOP_MASK (1 << 14) | ||
19 | #define DMADESC_SOP_MASK (1 << 13) | ||
20 | #define DMADESC_ESOP_MASK (DMADESC_EOP_MASK | DMADESC_SOP_MASK) | ||
21 | #define DMADESC_WRAP_MASK (1 << 12) | ||
22 | #define DMADESC_USB_NOZERO_MASK (1 << 1) | ||
23 | #define DMADESC_USB_ZERO_MASK (1 << 0) | ||
24 | |||
25 | /* status */ | ||
26 | #define DMADESC_UNDER_MASK (1 << 9) | ||
27 | #define DMADESC_APPEND_CRC (1 << 8) | ||
28 | #define DMADESC_OVSIZE_MASK (1 << 4) | ||
29 | #define DMADESC_RXER_MASK (1 << 2) | ||
30 | #define DMADESC_CRC_MASK (1 << 1) | ||
31 | #define DMADESC_OV_MASK (1 << 0) | ||
32 | #define DMADESC_ERR_MASK (DMADESC_UNDER_MASK | \ | ||
33 | DMADESC_OVSIZE_MASK | \ | ||
34 | DMADESC_RXER_MASK | \ | ||
35 | DMADESC_CRC_MASK | \ | ||
36 | DMADESC_OV_MASK) | ||
37 | |||
38 | #endif /* ! BCM63XX_IUDMA_H_ */ | ||
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h index 61f2a2a5099d..5e4b91866586 100644 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h | |||
@@ -543,6 +543,12 @@ | |||
543 | #define GPIO_MODE_6368_SPI_SSN5 (1 << 31) | 543 | #define GPIO_MODE_6368_SPI_SSN5 (1 << 31) |
544 | 544 | ||
545 | 545 | ||
546 | #define GPIO_PINMUX_OTHR_REG 0x24 | ||
547 | #define GPIO_PINMUX_OTHR_6328_USB_SHIFT 12 | ||
548 | #define GPIO_PINMUX_OTHR_6328_USB_MASK (3 << GPIO_PINMUX_OTHR_6328_USB_SHIFT) | ||
549 | #define GPIO_PINMUX_OTHR_6328_USB_HOST (1 << GPIO_PINMUX_OTHR_6328_USB_SHIFT) | ||
550 | #define GPIO_PINMUX_OTHR_6328_USB_DEV (2 << GPIO_PINMUX_OTHR_6328_USB_SHIFT) | ||
551 | |||
546 | #define GPIO_BASEMODE_6368_REG 0x38 | 552 | #define GPIO_BASEMODE_6368_REG 0x38 |
547 | #define GPIO_BASEMODE_6368_UART2 0x1 | 553 | #define GPIO_BASEMODE_6368_UART2 0x1 |
548 | #define GPIO_BASEMODE_6368_GPIO 0x0 | 554 | #define GPIO_BASEMODE_6368_GPIO 0x0 |
@@ -670,6 +676,12 @@ | |||
670 | #define ENETDMA_BUFALLOC_FORCE_SHIFT 31 | 676 | #define ENETDMA_BUFALLOC_FORCE_SHIFT 31 |
671 | #define ENETDMA_BUFALLOC_FORCE_MASK (1 << ENETDMA_BUFALLOC_FORCE_SHIFT) | 677 | #define ENETDMA_BUFALLOC_FORCE_MASK (1 << ENETDMA_BUFALLOC_FORCE_SHIFT) |
672 | 678 | ||
679 | /* Global interrupt status */ | ||
680 | #define ENETDMA_GLB_IRQSTAT_REG (0x40) | ||
681 | |||
682 | /* Global interrupt mask */ | ||
683 | #define ENETDMA_GLB_IRQMASK_REG (0x44) | ||
684 | |||
673 | /* Channel Configuration register */ | 685 | /* Channel Configuration register */ |
674 | #define ENETDMA_CHANCFG_REG(x) (0x100 + (x) * 0x10) | 686 | #define ENETDMA_CHANCFG_REG(x) (0x100 + (x) * 0x10) |
675 | #define ENETDMA_CHANCFG_EN_SHIFT 0 | 687 | #define ENETDMA_CHANCFG_EN_SHIFT 0 |
@@ -709,9 +721,11 @@ | |||
709 | /* Channel Configuration register */ | 721 | /* Channel Configuration register */ |
710 | #define ENETDMAC_CHANCFG_REG(x) ((x) * 0x10) | 722 | #define ENETDMAC_CHANCFG_REG(x) ((x) * 0x10) |
711 | #define ENETDMAC_CHANCFG_EN_SHIFT 0 | 723 | #define ENETDMAC_CHANCFG_EN_SHIFT 0 |
712 | #define ENETDMAC_CHANCFG_EN_MASK (1 << ENETDMA_CHANCFG_EN_SHIFT) | 724 | #define ENETDMAC_CHANCFG_EN_MASK (1 << ENETDMAC_CHANCFG_EN_SHIFT) |
713 | #define ENETDMAC_CHANCFG_PKTHALT_SHIFT 1 | 725 | #define ENETDMAC_CHANCFG_PKTHALT_SHIFT 1 |
714 | #define ENETDMAC_CHANCFG_PKTHALT_MASK (1 << ENETDMA_CHANCFG_PKTHALT_SHIFT) | 726 | #define ENETDMAC_CHANCFG_PKTHALT_MASK (1 << ENETDMAC_CHANCFG_PKTHALT_SHIFT) |
727 | #define ENETDMAC_CHANCFG_BUFHALT_SHIFT 2 | ||
728 | #define ENETDMAC_CHANCFG_BUFHALT_MASK (1 << ENETDMAC_CHANCFG_BUFHALT_SHIFT) | ||
715 | 729 | ||
716 | /* Interrupt Control/Status register */ | 730 | /* Interrupt Control/Status register */ |
717 | #define ENETDMAC_IR_REG(x) (0x4 + (x) * 0x10) | 731 | #define ENETDMAC_IR_REG(x) (0x4 + (x) * 0x10) |
@@ -770,6 +784,8 @@ | |||
770 | #define USBH_PRIV_SWAP_6358_REG 0x0 | 784 | #define USBH_PRIV_SWAP_6358_REG 0x0 |
771 | #define USBH_PRIV_SWAP_6368_REG 0x1c | 785 | #define USBH_PRIV_SWAP_6368_REG 0x1c |
772 | 786 | ||
787 | #define USBH_PRIV_SWAP_USBD_SHIFT 6 | ||
788 | #define USBH_PRIV_SWAP_USBD_MASK (1 << USBH_PRIV_SWAP_USBD_SHIFT) | ||
773 | #define USBH_PRIV_SWAP_EHCI_ENDN_SHIFT 4 | 789 | #define USBH_PRIV_SWAP_EHCI_ENDN_SHIFT 4 |
774 | #define USBH_PRIV_SWAP_EHCI_ENDN_MASK (1 << USBH_PRIV_SWAP_EHCI_ENDN_SHIFT) | 790 | #define USBH_PRIV_SWAP_EHCI_ENDN_MASK (1 << USBH_PRIV_SWAP_EHCI_ENDN_SHIFT) |
775 | #define USBH_PRIV_SWAP_EHCI_DATA_SHIFT 3 | 791 | #define USBH_PRIV_SWAP_EHCI_DATA_SHIFT 3 |
@@ -779,6 +795,12 @@ | |||
779 | #define USBH_PRIV_SWAP_OHCI_DATA_SHIFT 0 | 795 | #define USBH_PRIV_SWAP_OHCI_DATA_SHIFT 0 |
780 | #define USBH_PRIV_SWAP_OHCI_DATA_MASK (1 << USBH_PRIV_SWAP_OHCI_DATA_SHIFT) | 796 | #define USBH_PRIV_SWAP_OHCI_DATA_MASK (1 << USBH_PRIV_SWAP_OHCI_DATA_SHIFT) |
781 | 797 | ||
798 | #define USBH_PRIV_UTMI_CTL_6368_REG 0x10 | ||
799 | #define USBH_PRIV_UTMI_CTL_NODRIV_SHIFT 12 | ||
800 | #define USBH_PRIV_UTMI_CTL_NODRIV_MASK (0xf << USBH_PRIV_UTMI_CTL_NODRIV_SHIFT) | ||
801 | #define USBH_PRIV_UTMI_CTL_HOSTB_SHIFT 0 | ||
802 | #define USBH_PRIV_UTMI_CTL_HOSTB_MASK (0xf << USBH_PRIV_UTMI_CTL_HOSTB_SHIFT) | ||
803 | |||
782 | #define USBH_PRIV_TEST_6358_REG 0x24 | 804 | #define USBH_PRIV_TEST_6358_REG 0x24 |
783 | #define USBH_PRIV_TEST_6368_REG 0x14 | 805 | #define USBH_PRIV_TEST_6368_REG 0x14 |
784 | 806 | ||
@@ -787,6 +809,147 @@ | |||
787 | #define USBH_PRIV_SETUP_IOC_MASK (1 << USBH_PRIV_SETUP_IOC_SHIFT) | 809 | #define USBH_PRIV_SETUP_IOC_MASK (1 << USBH_PRIV_SETUP_IOC_SHIFT) |
788 | 810 | ||
789 | 811 | ||
812 | /************************************************************************* | ||
813 | * _REG relative to RSET_USBD | ||
814 | *************************************************************************/ | ||
815 | |||
816 | /* General control */ | ||
817 | #define USBD_CONTROL_REG 0x00 | ||
818 | #define USBD_CONTROL_TXZLENINS_SHIFT 14 | ||
819 | #define USBD_CONTROL_TXZLENINS_MASK (1 << USBD_CONTROL_TXZLENINS_SHIFT) | ||
820 | #define USBD_CONTROL_AUTO_CSRS_SHIFT 13 | ||
821 | #define USBD_CONTROL_AUTO_CSRS_MASK (1 << USBD_CONTROL_AUTO_CSRS_SHIFT) | ||
822 | #define USBD_CONTROL_RXZSCFG_SHIFT 12 | ||
823 | #define USBD_CONTROL_RXZSCFG_MASK (1 << USBD_CONTROL_RXZSCFG_SHIFT) | ||
824 | #define USBD_CONTROL_INIT_SEL_SHIFT 8 | ||
825 | #define USBD_CONTROL_INIT_SEL_MASK (0xf << USBD_CONTROL_INIT_SEL_SHIFT) | ||
826 | #define USBD_CONTROL_FIFO_RESET_SHIFT 6 | ||
827 | #define USBD_CONTROL_FIFO_RESET_MASK (3 << USBD_CONTROL_FIFO_RESET_SHIFT) | ||
828 | #define USBD_CONTROL_SETUPERRLOCK_SHIFT 5 | ||
829 | #define USBD_CONTROL_SETUPERRLOCK_MASK (1 << USBD_CONTROL_SETUPERRLOCK_SHIFT) | ||
830 | #define USBD_CONTROL_DONE_CSRS_SHIFT 0 | ||
831 | #define USBD_CONTROL_DONE_CSRS_MASK (1 << USBD_CONTROL_DONE_CSRS_SHIFT) | ||
832 | |||
833 | /* Strap options */ | ||
834 | #define USBD_STRAPS_REG 0x04 | ||
835 | #define USBD_STRAPS_APP_SELF_PWR_SHIFT 10 | ||
836 | #define USBD_STRAPS_APP_SELF_PWR_MASK (1 << USBD_STRAPS_APP_SELF_PWR_SHIFT) | ||
837 | #define USBD_STRAPS_APP_DISCON_SHIFT 9 | ||
838 | #define USBD_STRAPS_APP_DISCON_MASK (1 << USBD_STRAPS_APP_DISCON_SHIFT) | ||
839 | #define USBD_STRAPS_APP_CSRPRGSUP_SHIFT 8 | ||
840 | #define USBD_STRAPS_APP_CSRPRGSUP_MASK (1 << USBD_STRAPS_APP_CSRPRGSUP_SHIFT) | ||
841 | #define USBD_STRAPS_APP_RMTWKUP_SHIFT 6 | ||
842 | #define USBD_STRAPS_APP_RMTWKUP_MASK (1 << USBD_STRAPS_APP_RMTWKUP_SHIFT) | ||
843 | #define USBD_STRAPS_APP_RAM_IF_SHIFT 7 | ||
844 | #define USBD_STRAPS_APP_RAM_IF_MASK (1 << USBD_STRAPS_APP_RAM_IF_SHIFT) | ||
845 | #define USBD_STRAPS_APP_8BITPHY_SHIFT 2 | ||
846 | #define USBD_STRAPS_APP_8BITPHY_MASK (1 << USBD_STRAPS_APP_8BITPHY_SHIFT) | ||
847 | #define USBD_STRAPS_SPEED_SHIFT 0 | ||
848 | #define USBD_STRAPS_SPEED_MASK (3 << USBD_STRAPS_SPEED_SHIFT) | ||
849 | |||
850 | /* Stall control */ | ||
851 | #define USBD_STALL_REG 0x08 | ||
852 | #define USBD_STALL_UPDATE_SHIFT 7 | ||
853 | #define USBD_STALL_UPDATE_MASK (1 << USBD_STALL_UPDATE_SHIFT) | ||
854 | #define USBD_STALL_ENABLE_SHIFT 6 | ||
855 | #define USBD_STALL_ENABLE_MASK (1 << USBD_STALL_ENABLE_SHIFT) | ||
856 | #define USBD_STALL_EPNUM_SHIFT 0 | ||
857 | #define USBD_STALL_EPNUM_MASK (0xf << USBD_STALL_EPNUM_SHIFT) | ||
858 | |||
859 | /* General status */ | ||
860 | #define USBD_STATUS_REG 0x0c | ||
861 | #define USBD_STATUS_SOF_SHIFT 16 | ||
862 | #define USBD_STATUS_SOF_MASK (0x7ff << USBD_STATUS_SOF_SHIFT) | ||
863 | #define USBD_STATUS_SPD_SHIFT 12 | ||
864 | #define USBD_STATUS_SPD_MASK (3 << USBD_STATUS_SPD_SHIFT) | ||
865 | #define USBD_STATUS_ALTINTF_SHIFT 8 | ||
866 | #define USBD_STATUS_ALTINTF_MASK (0xf << USBD_STATUS_ALTINTF_SHIFT) | ||
867 | #define USBD_STATUS_INTF_SHIFT 4 | ||
868 | #define USBD_STATUS_INTF_MASK (0xf << USBD_STATUS_INTF_SHIFT) | ||
869 | #define USBD_STATUS_CFG_SHIFT 0 | ||
870 | #define USBD_STATUS_CFG_MASK (0xf << USBD_STATUS_CFG_SHIFT) | ||
871 | |||
872 | /* Other events */ | ||
873 | #define USBD_EVENTS_REG 0x10 | ||
874 | #define USBD_EVENTS_USB_LINK_SHIFT 10 | ||
875 | #define USBD_EVENTS_USB_LINK_MASK (1 << USBD_EVENTS_USB_LINK_SHIFT) | ||
876 | |||
877 | /* IRQ status */ | ||
878 | #define USBD_EVENT_IRQ_STATUS_REG 0x14 | ||
879 | |||
880 | /* IRQ level (2 bits per IRQ event) */ | ||
881 | #define USBD_EVENT_IRQ_CFG_HI_REG 0x18 | ||
882 | |||
883 | #define USBD_EVENT_IRQ_CFG_LO_REG 0x1c | ||
884 | |||
885 | #define USBD_EVENT_IRQ_CFG_SHIFT(x) ((x & 0xf) << 1) | ||
886 | #define USBD_EVENT_IRQ_CFG_MASK(x) (3 << USBD_EVENT_IRQ_CFG_SHIFT(x)) | ||
887 | #define USBD_EVENT_IRQ_CFG_RISING(x) (0 << USBD_EVENT_IRQ_CFG_SHIFT(x)) | ||
888 | #define USBD_EVENT_IRQ_CFG_FALLING(x) (1 << USBD_EVENT_IRQ_CFG_SHIFT(x)) | ||
889 | |||
890 | /* IRQ mask (1=unmasked) */ | ||
891 | #define USBD_EVENT_IRQ_MASK_REG 0x20 | ||
892 | |||
893 | /* IRQ bits */ | ||
894 | #define USBD_EVENT_IRQ_USB_LINK 10 | ||
895 | #define USBD_EVENT_IRQ_SETCFG 9 | ||
896 | #define USBD_EVENT_IRQ_SETINTF 8 | ||
897 | #define USBD_EVENT_IRQ_ERRATIC_ERR 7 | ||
898 | #define USBD_EVENT_IRQ_SET_CSRS 6 | ||
899 | #define USBD_EVENT_IRQ_SUSPEND 5 | ||
900 | #define USBD_EVENT_IRQ_EARLY_SUSPEND 4 | ||
901 | #define USBD_EVENT_IRQ_SOF 3 | ||
902 | #define USBD_EVENT_IRQ_ENUM_ON 2 | ||
903 | #define USBD_EVENT_IRQ_SETUP 1 | ||
904 | #define USBD_EVENT_IRQ_USB_RESET 0 | ||
905 | |||
906 | /* TX FIFO partitioning */ | ||
907 | #define USBD_TXFIFO_CONFIG_REG 0x40 | ||
908 | #define USBD_TXFIFO_CONFIG_END_SHIFT 16 | ||
909 | #define USBD_TXFIFO_CONFIG_END_MASK (0xff << USBD_TXFIFO_CONFIG_END_SHIFT) | ||
910 | #define USBD_TXFIFO_CONFIG_START_SHIFT 0 | ||
911 | #define USBD_TXFIFO_CONFIG_START_MASK (0xff << USBD_TXFIFO_CONFIG_START_SHIFT) | ||
912 | |||
913 | /* RX FIFO partitioning */ | ||
914 | #define USBD_RXFIFO_CONFIG_REG 0x44 | ||
915 | #define USBD_RXFIFO_CONFIG_END_SHIFT 16 | ||
916 | #define USBD_RXFIFO_CONFIG_END_MASK (0xff << USBD_TXFIFO_CONFIG_END_SHIFT) | ||
917 | #define USBD_RXFIFO_CONFIG_START_SHIFT 0 | ||
918 | #define USBD_RXFIFO_CONFIG_START_MASK (0xff << USBD_TXFIFO_CONFIG_START_SHIFT) | ||
919 | |||
920 | /* TX FIFO/endpoint configuration */ | ||
921 | #define USBD_TXFIFO_EPSIZE_REG 0x48 | ||
922 | |||
923 | /* RX FIFO/endpoint configuration */ | ||
924 | #define USBD_RXFIFO_EPSIZE_REG 0x4c | ||
925 | |||
926 | /* Endpoint<->DMA mappings */ | ||
927 | #define USBD_EPNUM_TYPEMAP_REG 0x50 | ||
928 | #define USBD_EPNUM_TYPEMAP_TYPE_SHIFT 8 | ||
929 | #define USBD_EPNUM_TYPEMAP_TYPE_MASK (0x3 << USBD_EPNUM_TYPEMAP_TYPE_SHIFT) | ||
930 | #define USBD_EPNUM_TYPEMAP_DMA_CH_SHIFT 0 | ||
931 | #define USBD_EPNUM_TYPEMAP_DMA_CH_MASK (0xf << USBD_EPNUM_TYPEMAP_DMACH_SHIFT) | ||
932 | |||
933 | /* Misc per-endpoint settings */ | ||
934 | #define USBD_CSR_SETUPADDR_REG 0x80 | ||
935 | #define USBD_CSR_SETUPADDR_DEF 0xb550 | ||
936 | |||
937 | #define USBD_CSR_EP_REG(x) (0x84 + (x) * 4) | ||
938 | #define USBD_CSR_EP_MAXPKT_SHIFT 19 | ||
939 | #define USBD_CSR_EP_MAXPKT_MASK (0x7ff << USBD_CSR_EP_MAXPKT_SHIFT) | ||
940 | #define USBD_CSR_EP_ALTIFACE_SHIFT 15 | ||
941 | #define USBD_CSR_EP_ALTIFACE_MASK (0xf << USBD_CSR_EP_ALTIFACE_SHIFT) | ||
942 | #define USBD_CSR_EP_IFACE_SHIFT 11 | ||
943 | #define USBD_CSR_EP_IFACE_MASK (0xf << USBD_CSR_EP_IFACE_SHIFT) | ||
944 | #define USBD_CSR_EP_CFG_SHIFT 7 | ||
945 | #define USBD_CSR_EP_CFG_MASK (0xf << USBD_CSR_EP_CFG_SHIFT) | ||
946 | #define USBD_CSR_EP_TYPE_SHIFT 5 | ||
947 | #define USBD_CSR_EP_TYPE_MASK (3 << USBD_CSR_EP_TYPE_SHIFT) | ||
948 | #define USBD_CSR_EP_DIR_SHIFT 4 | ||
949 | #define USBD_CSR_EP_DIR_MASK (1 << USBD_CSR_EP_DIR_SHIFT) | ||
950 | #define USBD_CSR_EP_LOG_SHIFT 0 | ||
951 | #define USBD_CSR_EP_LOG_MASK (0xf << USBD_CSR_EP_LOG_SHIFT) | ||
952 | |||
790 | 953 | ||
791 | /************************************************************************* | 954 | /************************************************************************* |
792 | * _REG relative to RSET_MPI | 955 | * _REG relative to RSET_MPI |
diff --git a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h index 474daaa53497..b0dd4bb53f7e 100644 --- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h +++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/gpio.h> | 5 | #include <linux/gpio.h> |
6 | #include <linux/leds.h> | 6 | #include <linux/leds.h> |
7 | #include <bcm63xx_dev_enet.h> | 7 | #include <bcm63xx_dev_enet.h> |
8 | #include <bcm63xx_dev_usb_usbd.h> | ||
8 | #include <bcm63xx_dev_dsp.h> | 9 | #include <bcm63xx_dev_dsp.h> |
9 | 10 | ||
10 | /* | 11 | /* |
@@ -44,6 +45,7 @@ struct board_info { | |||
44 | unsigned int has_pccard:1; | 45 | unsigned int has_pccard:1; |
45 | unsigned int has_ohci0:1; | 46 | unsigned int has_ohci0:1; |
46 | unsigned int has_ehci0:1; | 47 | unsigned int has_ehci0:1; |
48 | unsigned int has_usbd:1; | ||
47 | unsigned int has_dsp:1; | 49 | unsigned int has_dsp:1; |
48 | unsigned int has_uart0:1; | 50 | unsigned int has_uart0:1; |
49 | unsigned int has_uart1:1; | 51 | unsigned int has_uart1:1; |
@@ -52,6 +54,9 @@ struct board_info { | |||
52 | struct bcm63xx_enet_platform_data enet0; | 54 | struct bcm63xx_enet_platform_data enet0; |
53 | struct bcm63xx_enet_platform_data enet1; | 55 | struct bcm63xx_enet_platform_data enet1; |
54 | 56 | ||
57 | /* USB config */ | ||
58 | struct bcm63xx_usbd_platform_data usbd; | ||
59 | |||
55 | /* DSP config */ | 60 | /* DSP config */ |
56 | struct bcm63xx_dsp_platform_data dsp; | 61 | struct bcm63xx_dsp_platform_data dsp; |
57 | 62 | ||
diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.h b/drivers/net/ethernet/broadcom/bcm63xx_enet.h index 0e3048b788c2..133d5857b9e2 100644 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.h +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <bcm63xx_regs.h> | 10 | #include <bcm63xx_regs.h> |
11 | #include <bcm63xx_irq.h> | 11 | #include <bcm63xx_irq.h> |
12 | #include <bcm63xx_io.h> | 12 | #include <bcm63xx_io.h> |
13 | #include <bcm63xx_iudma.h> | ||
13 | 14 | ||
14 | /* default number of descriptor */ | 15 | /* default number of descriptor */ |
15 | #define BCMENET_DEF_RX_DESC 64 | 16 | #define BCMENET_DEF_RX_DESC 64 |
@@ -31,35 +32,6 @@ | |||
31 | #define BCMENET_MAX_MTU 2046 | 32 | #define BCMENET_MAX_MTU 2046 |
32 | 33 | ||
33 | /* | 34 | /* |
34 | * rx/tx dma descriptor | ||
35 | */ | ||
36 | struct bcm_enet_desc { | ||
37 | u32 len_stat; | ||
38 | u32 address; | ||
39 | }; | ||
40 | |||
41 | #define DMADESC_LENGTH_SHIFT 16 | ||
42 | #define DMADESC_LENGTH_MASK (0xfff << DMADESC_LENGTH_SHIFT) | ||
43 | #define DMADESC_OWNER_MASK (1 << 15) | ||
44 | #define DMADESC_EOP_MASK (1 << 14) | ||
45 | #define DMADESC_SOP_MASK (1 << 13) | ||
46 | #define DMADESC_ESOP_MASK (DMADESC_EOP_MASK | DMADESC_SOP_MASK) | ||
47 | #define DMADESC_WRAP_MASK (1 << 12) | ||
48 | |||
49 | #define DMADESC_UNDER_MASK (1 << 9) | ||
50 | #define DMADESC_APPEND_CRC (1 << 8) | ||
51 | #define DMADESC_OVSIZE_MASK (1 << 4) | ||
52 | #define DMADESC_RXER_MASK (1 << 2) | ||
53 | #define DMADESC_CRC_MASK (1 << 1) | ||
54 | #define DMADESC_OV_MASK (1 << 0) | ||
55 | #define DMADESC_ERR_MASK (DMADESC_UNDER_MASK | \ | ||
56 | DMADESC_OVSIZE_MASK | \ | ||
57 | DMADESC_RXER_MASK | \ | ||
58 | DMADESC_CRC_MASK | \ | ||
59 | DMADESC_OV_MASK) | ||
60 | |||
61 | |||
62 | /* | ||
63 | * MIB Counters register definitions | 35 | * MIB Counters register definitions |
64 | */ | 36 | */ |
65 | #define ETH_MIB_TX_GD_OCTETS 0 | 37 | #define ETH_MIB_TX_GD_OCTETS 0 |