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 diff --git a/arch/mips/bcm63xx/Kconfig b/arch/mips/bcm63xx/Kconfig
17 index fb177d6..76fbbf7 100644
18 --- a/arch/mips/bcm63xx/Kconfig
19 +++ b/arch/mips/bcm63xx/Kconfig
20 @@ -16,10 +16,16 @@ config BCM63XX_CPU_6345
21 config BCM63XX_CPU_6348
22 bool "support 6348 CPU"
24 + select USB_ARCH_HAS_OHCI
25 + select USB_OHCI_BIG_ENDIAN_DESC
26 + select USB_OHCI_BIG_ENDIAN_MMIO
28 config BCM63XX_CPU_6358
29 bool "support 6358 CPU"
31 + select USB_ARCH_HAS_OHCI
32 + select USB_OHCI_BIG_ENDIAN_DESC
33 + select USB_OHCI_BIG_ENDIAN_MMIO
36 source "arch/mips/bcm63xx/boards/Kconfig"
37 diff --git a/arch/mips/bcm63xx/Makefile b/arch/mips/bcm63xx/Makefile
38 index 00064b6..be5d7ad 100644
39 --- a/arch/mips/bcm63xx/Makefile
40 +++ b/arch/mips/bcm63xx/Makefile
42 obj-y += clk.o cpu.o cs.o gpio.o irq.o prom.o setup.o timer.o \
43 - dev-dsp.o dev-enet.o dev-pcmcia.o dev-uart.o dev-wdt.o
44 + dev-dsp.o dev-enet.o dev-pcmcia.o dev-uart.o dev-wdt.o \
46 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
49 diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c
50 index ea17941..e2c0c36 100644
51 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
52 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
54 #include <bcm63xx_dev_enet.h>
55 #include <bcm63xx_dev_dsp.h>
56 #include <bcm63xx_dev_pcmcia.h>
57 +#include <bcm63xx_dev_usb_ohci.h>
58 #include <board_bcm963xx.h>
60 #define PFX "board_bcm963xx: "
61 @@ -803,6 +804,9 @@ int __init board_register_devices(void)
62 !board_get_mac_address(board.enet1.mac_addr))
63 bcm63xx_enet_register(1, &board.enet1);
65 + if (board.has_ohci0)
66 + bcm63xx_ohci_register();
69 bcm63xx_dsp_register(&board.dsp);
71 diff --git a/arch/mips/bcm63xx/dev-usb-ohci.c b/arch/mips/bcm63xx/dev-usb-ohci.c
73 index 0000000..f1fb442
75 +++ b/arch/mips/bcm63xx/dev-usb-ohci.c
78 + * This file is subject to the terms and conditions of the GNU General Public
79 + * License. See the file "COPYING" in the main directory of this archive
82 + * Copyright (C) 2010 Maxime Bizon <mbizon@freebox.fr>
85 +#include <linux/init.h>
86 +#include <linux/kernel.h>
87 +#include <linux/platform_device.h>
88 +#include <bcm63xx_cpu.h>
89 +#include <bcm63xx_dev_usb_ohci.h>
91 +static struct resource ohci_resources[] = {
93 + /* start & end filled at runtime */
94 + .flags = IORESOURCE_MEM,
97 + /* start filled at runtime */
98 + .flags = IORESOURCE_IRQ,
102 +static u64 ohci_dmamask = ~(u32)0;
104 +static struct platform_device bcm63xx_ohci_device = {
105 + .name = "bcm63xx_ohci",
107 + .num_resources = ARRAY_SIZE(ohci_resources),
108 + .resource = ohci_resources,
110 + .dma_mask = &ohci_dmamask,
111 + .coherent_dma_mask = 0xffffffff,
115 +int __init bcm63xx_ohci_register(void)
117 + if (!BCMCPU_IS_6348() && !BCMCPU_IS_6358())
120 + ohci_resources[0].start = bcm63xx_regset_address(RSET_OHCI0);
121 + ohci_resources[0].end = ohci_resources[0].start;
122 + ohci_resources[0].end += RSET_OHCI_SIZE - 1;
123 + ohci_resources[1].start = bcm63xx_get_irq_number(IRQ_OHCI0);
124 + return platform_device_register(&bcm63xx_ohci_device);
126 diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h
128 index 0000000..518a04d
130 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h
132 +#ifndef BCM63XX_DEV_USB_OHCI_H_
133 +#define BCM63XX_DEV_USB_OHCI_H_
135 +int bcm63xx_ohci_register(void);
137 +#endif /* BCM63XX_DEV_USB_OHCI_H_ */