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 diff --git a/arch/mips/bcm63xx/Kconfig b/arch/mips/bcm63xx/Kconfig
17 index 76fbbf7..4aa21e8 100644
18 --- a/arch/mips/bcm63xx/Kconfig
19 +++ b/arch/mips/bcm63xx/Kconfig
20 @@ -26,6 +26,8 @@ config BCM63XX_CPU_6358
21 select USB_ARCH_HAS_OHCI
22 select USB_OHCI_BIG_ENDIAN_DESC
23 select USB_OHCI_BIG_ENDIAN_MMIO
24 + select USB_ARCH_HAS_EHCI
25 + select USB_EHCI_BIG_ENDIAN_MMIO
28 source "arch/mips/bcm63xx/boards/Kconfig"
29 diff --git a/arch/mips/bcm63xx/Makefile b/arch/mips/bcm63xx/Makefile
30 index be5d7ad..6e229c2 100644
31 --- a/arch/mips/bcm63xx/Makefile
32 +++ b/arch/mips/bcm63xx/Makefile
34 obj-y += clk.o cpu.o cs.o gpio.o irq.o prom.o setup.o timer.o \
35 dev-dsp.o dev-enet.o dev-pcmcia.o dev-uart.o dev-wdt.o \
37 + dev-usb-ohci.o dev-usb-ehci.o
38 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
41 diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c
42 index e2c0c36..b0d3db3 100644
43 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
44 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
46 #include <bcm63xx_dev_dsp.h>
47 #include <bcm63xx_dev_pcmcia.h>
48 #include <bcm63xx_dev_usb_ohci.h>
49 +#include <bcm63xx_dev_usb_ehci.h>
50 #include <board_bcm963xx.h>
52 #define PFX "board_bcm963xx: "
53 @@ -804,6 +805,9 @@ int __init board_register_devices(void)
54 !board_get_mac_address(board.enet1.mac_addr))
55 bcm63xx_enet_register(1, &board.enet1);
57 + if (board.has_ehci0)
58 + bcm63xx_ehci_register();
61 bcm63xx_ohci_register();
63 diff --git a/arch/mips/bcm63xx/dev-usb-ehci.c b/arch/mips/bcm63xx/dev-usb-ehci.c
65 index 0000000..4bdd675
67 +++ b/arch/mips/bcm63xx/dev-usb-ehci.c
70 + * This file is subject to the terms and conditions of the GNU General Public
71 + * License. See the file "COPYING" in the main directory of this archive
74 + * Copyright (C) 2010 Maxime Bizon <mbizon@freebox.fr>
77 +#include <linux/init.h>
78 +#include <linux/kernel.h>
79 +#include <linux/platform_device.h>
80 +#include <bcm63xx_cpu.h>
81 +#include <bcm63xx_dev_usb_ehci.h>
83 +static struct resource ehci_resources[] = {
85 + /* start & end filled at runtime */
86 + .flags = IORESOURCE_MEM,
89 + /* start filled at runtime */
90 + .flags = IORESOURCE_IRQ,
94 +static u64 ehci_dmamask = ~(u32)0;
96 +static struct platform_device bcm63xx_ehci_device = {
97 + .name = "bcm63xx_ehci",
99 + .num_resources = ARRAY_SIZE(ehci_resources),
100 + .resource = ehci_resources,
102 + .dma_mask = &ehci_dmamask,
103 + .coherent_dma_mask = 0xffffffff,
107 +int __init bcm63xx_ehci_register(void)
109 + if (!BCMCPU_IS_6358())
112 + ehci_resources[0].start = bcm63xx_regset_address(RSET_EHCI0);
113 + ehci_resources[0].end = ehci_resources[0].start;
114 + ehci_resources[0].end += RSET_EHCI_SIZE - 1;
115 + ehci_resources[1].start = bcm63xx_get_irq_number(IRQ_EHCI0);
116 + return platform_device_register(&bcm63xx_ehci_device);
118 diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h
120 index 0000000..17fb519
122 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h
124 +#ifndef BCM63XX_DEV_USB_EHCI_H_
125 +#define BCM63XX_DEV_USB_EHCI_H_
127 +int bcm63xx_ehci_register(void);
129 +#endif /* BCM63XX_DEV_USB_EHCI_H_ */