1 The bcm63xx SOC has an integrated EHCI controller, this patch adds
2 platform device registration and change board code to register
3 EHCI device when necessary.
5 Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
7 arch/mips/bcm63xx/Kconfig | 2 +
8 arch/mips/bcm63xx/Makefile | 2 +-
9 arch/mips/bcm63xx/boards/board_bcm963xx.c | 4 ++
10 arch/mips/bcm63xx/dev-usb-ehci.c | 49 ++++++++++++++++++++
11 .../asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h | 6 ++
12 5 files changed, 62 insertions(+), 1 deletions(-)
13 create mode 100644 arch/mips/bcm63xx/dev-usb-ehci.c
14 create mode 100644 arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h
16 --- a/arch/mips/bcm63xx/Kconfig
17 +++ b/arch/mips/bcm63xx/Kconfig
18 @@ -26,6 +26,8 @@ config BCM63XX_CPU_6358
19 select USB_ARCH_HAS_OHCI
20 select USB_OHCI_BIG_ENDIAN_DESC
21 select USB_OHCI_BIG_ENDIAN_MMIO
22 + select USB_ARCH_HAS_EHCI
23 + select USB_EHCI_BIG_ENDIAN_MMIO
26 source "arch/mips/bcm63xx/boards/Kconfig"
27 --- a/arch/mips/bcm63xx/Makefile
28 +++ b/arch/mips/bcm63xx/Makefile
30 obj-y += clk.o cpu.o cs.o gpio.o irq.o prom.o setup.o timer.o \
31 dev-dsp.o dev-enet.o dev-pcmcia.o dev-uart.o dev-wdt.o \
33 + dev-usb-ohci.o dev-usb-ehci.o
34 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
37 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
38 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
40 #include <bcm63xx_dev_dsp.h>
41 #include <bcm63xx_dev_pcmcia.h>
42 #include <bcm63xx_dev_usb_ohci.h>
43 +#include <bcm63xx_dev_usb_ehci.h>
44 #include <board_bcm963xx.h>
46 #define PFX "board_bcm963xx: "
47 @@ -878,6 +879,9 @@ int __init board_register_devices(void)
48 !board_get_mac_address(board.enet1.mac_addr))
49 bcm63xx_enet_register(1, &board.enet1);
51 + if (board.has_ehci0)
52 + bcm63xx_ehci_register();
55 bcm63xx_ohci_register();
58 +++ b/arch/mips/bcm63xx/dev-usb-ehci.c
61 + * This file is subject to the terms and conditions of the GNU General Public
62 + * License. See the file "COPYING" in the main directory of this archive
65 + * Copyright (C) 2010 Maxime Bizon <mbizon@freebox.fr>
68 +#include <linux/init.h>
69 +#include <linux/kernel.h>
70 +#include <linux/platform_device.h>
71 +#include <bcm63xx_cpu.h>
72 +#include <bcm63xx_dev_usb_ehci.h>
74 +static struct resource ehci_resources[] = {
76 + /* start & end filled at runtime */
77 + .flags = IORESOURCE_MEM,
80 + /* start filled at runtime */
81 + .flags = IORESOURCE_IRQ,
85 +static u64 ehci_dmamask = ~(u32)0;
87 +static struct platform_device bcm63xx_ehci_device = {
88 + .name = "bcm63xx_ehci",
90 + .num_resources = ARRAY_SIZE(ehci_resources),
91 + .resource = ehci_resources,
93 + .dma_mask = &ehci_dmamask,
94 + .coherent_dma_mask = 0xffffffff,
98 +int __init bcm63xx_ehci_register(void)
100 + if (!BCMCPU_IS_6358())
103 + ehci_resources[0].start = bcm63xx_regset_address(RSET_EHCI0);
104 + ehci_resources[0].end = ehci_resources[0].start;
105 + ehci_resources[0].end += RSET_EHCI_SIZE - 1;
106 + ehci_resources[1].start = bcm63xx_get_irq_number(IRQ_EHCI0);
107 + return platform_device_register(&bcm63xx_ehci_device);
110 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h
112 +#ifndef BCM63XX_DEV_USB_EHCI_H_
113 +#define BCM63XX_DEV_USB_EHCI_H_
115 +int bcm63xx_ehci_register(void);
117 +#endif /* BCM63XX_DEV_USB_EHCI_H_ */