1 The bcm63xx SOC has an integrated OHCI controller, this patch adds
2 platform device registration and change board code to register ohci
5 Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
7 arch/mips/bcm63xx/Kconfig | 6 ++
8 arch/mips/bcm63xx/Makefile | 3 +-
9 arch/mips/bcm63xx/boards/board_bcm963xx.c | 4 ++
10 arch/mips/bcm63xx/dev-usb-ohci.c | 49 ++++++++++++++++++++
11 .../asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h | 6 ++
12 5 files changed, 67 insertions(+), 1 deletions(-)
13 create mode 100644 arch/mips/bcm63xx/dev-usb-ohci.c
14 create mode 100644 arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h
16 --- a/arch/mips/bcm63xx/Kconfig
17 +++ b/arch/mips/bcm63xx/Kconfig
18 @@ -16,10 +16,16 @@ config BCM63XX_CPU_6345
19 config BCM63XX_CPU_6348
20 bool "support 6348 CPU"
22 + select USB_ARCH_HAS_OHCI
23 + select USB_OHCI_BIG_ENDIAN_DESC
24 + select USB_OHCI_BIG_ENDIAN_MMIO
26 config BCM63XX_CPU_6358
27 bool "support 6358 CPU"
29 + select USB_ARCH_HAS_OHCI
30 + select USB_OHCI_BIG_ENDIAN_DESC
31 + select USB_OHCI_BIG_ENDIAN_MMIO
34 source "arch/mips/bcm63xx/boards/Kconfig"
35 --- a/arch/mips/bcm63xx/Makefile
36 +++ b/arch/mips/bcm63xx/Makefile
38 obj-y += clk.o cpu.o cs.o gpio.o irq.o prom.o setup.o timer.o \
39 - dev-dsp.o dev-enet.o dev-pcmcia.o dev-uart.o dev-wdt.o
40 + dev-dsp.o dev-enet.o dev-pcmcia.o dev-uart.o dev-wdt.o \
42 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
45 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
46 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
48 #include <bcm63xx_dev_enet.h>
49 #include <bcm63xx_dev_dsp.h>
50 #include <bcm63xx_dev_pcmcia.h>
51 +#include <bcm63xx_dev_usb_ohci.h>
52 #include <board_bcm963xx.h>
54 #define PFX "board_bcm963xx: "
55 @@ -877,6 +878,9 @@ int __init board_register_devices(void)
56 !board_get_mac_address(board.enet1.mac_addr))
57 bcm63xx_enet_register(1, &board.enet1);
59 + if (board.has_ohci0)
60 + bcm63xx_ohci_register();
63 bcm63xx_dsp_register(&board.dsp);
66 +++ b/arch/mips/bcm63xx/dev-usb-ohci.c
69 + * This file is subject to the terms and conditions of the GNU General Public
70 + * License. See the file "COPYING" in the main directory of this archive
73 + * Copyright (C) 2010 Maxime Bizon <mbizon@freebox.fr>
76 +#include <linux/init.h>
77 +#include <linux/kernel.h>
78 +#include <linux/platform_device.h>
79 +#include <bcm63xx_cpu.h>
80 +#include <bcm63xx_dev_usb_ohci.h>
82 +static struct resource ohci_resources[] = {
84 + /* start & end filled at runtime */
85 + .flags = IORESOURCE_MEM,
88 + /* start filled at runtime */
89 + .flags = IORESOURCE_IRQ,
93 +static u64 ohci_dmamask = ~(u32)0;
95 +static struct platform_device bcm63xx_ohci_device = {
96 + .name = "bcm63xx_ohci",
98 + .num_resources = ARRAY_SIZE(ohci_resources),
99 + .resource = ohci_resources,
101 + .dma_mask = &ohci_dmamask,
102 + .coherent_dma_mask = 0xffffffff,
106 +int __init bcm63xx_ohci_register(void)
108 + if (!BCMCPU_IS_6348() && !BCMCPU_IS_6358())
111 + ohci_resources[0].start = bcm63xx_regset_address(RSET_OHCI0);
112 + ohci_resources[0].end = ohci_resources[0].start;
113 + ohci_resources[0].end += RSET_OHCI_SIZE - 1;
114 + ohci_resources[1].start = bcm63xx_get_irq_number(IRQ_OHCI0);
115 + return platform_device_register(&bcm63xx_ohci_device);
118 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h
120 +#ifndef BCM63XX_DEV_USB_OHCI_H_
121 +#define BCM63XX_DEV_USB_OHCI_H_
123 +int bcm63xx_ohci_register(void);
125 +#endif /* BCM63XX_DEV_USB_OHCI_H_ */