2012-03-28 23:42:25 +03:00
|
|
|
From a2d78246e4cb45b5978fc682aad19c0fff0cd20d Mon Sep 17 00:00:00 2001
|
2012-02-04 12:17:27 +02:00
|
|
|
From: Maxime Bizon <mbizon@freebox.fr>
|
|
|
|
Date: Tue, 24 May 2011 21:50:33 +0200
|
2012-03-28 23:42:25 +03:00
|
|
|
Subject: [PATCH 26/63] MIPS: BCM63XX: register ehci device.
|
2012-02-04 12:17:27 +02:00
|
|
|
|
|
|
|
---
|
|
|
|
arch/mips/bcm63xx/Kconfig | 2 +
|
|
|
|
arch/mips/bcm63xx/Makefile | 2 +-
|
|
|
|
arch/mips/bcm63xx/boards/board_bcm963xx.c | 4 ++
|
|
|
|
arch/mips/bcm63xx/dev-usb-ehci.c | 50 ++++++++++++++++++++
|
|
|
|
.../asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h | 6 ++
|
|
|
|
5 files changed, 63 insertions(+), 1 deletions(-)
|
|
|
|
create mode 100644 arch/mips/bcm63xx/dev-usb-ehci.c
|
|
|
|
create mode 100644 arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h
|
|
|
|
|
|
|
|
--- a/arch/mips/bcm63xx/Kconfig
|
|
|
|
+++ b/arch/mips/bcm63xx/Kconfig
|
2012-07-31 17:27:42 +03:00
|
|
|
@@ -22,6 +22,7 @@ config BCM63XX_CPU_6358
|
2012-02-04 12:17:27 +02:00
|
|
|
bool "support 6358 CPU"
|
|
|
|
select HW_HAS_PCI
|
|
|
|
select USB_ARCH_HAS_OHCI if USB_SUPPORT
|
|
|
|
+ select USB_ARCH_HAS_EHCI if USB_SUPPORT
|
|
|
|
|
2012-07-31 17:27:42 +03:00
|
|
|
config BCM63XX_CPU_6362
|
|
|
|
bool "support 6362 CPU"
|
|
|
|
@@ -31,6 +32,7 @@ config BCM63XX_CPU_6368
|
2012-02-04 12:17:27 +02:00
|
|
|
bool "support 6368 CPU"
|
|
|
|
select HW_HAS_PCI
|
|
|
|
select USB_ARCH_HAS_OHCI if USB_SUPPORT
|
|
|
|
+ select USB_ARCH_HAS_EHCI if USB_SUPPORT
|
|
|
|
endmenu
|
|
|
|
|
|
|
|
source "arch/mips/bcm63xx/boards/Kconfig"
|
|
|
|
--- a/arch/mips/bcm63xx/Makefile
|
|
|
|
+++ b/arch/mips/bcm63xx/Makefile
|
|
|
|
@@ -1,6 +1,6 @@
|
|
|
|
obj-y += clk.o cpu.o cs.o gpio.o irq.o prom.o setup.o timer.o \
|
2012-07-04 00:42:07 +03:00
|
|
|
dev-dsp.o dev-enet.o dev-flash.o dev-pcmcia.o dev-rng.o \
|
|
|
|
- dev-spi.o dev-uart.o dev-usb-ohci.o dev-wdt.o
|
|
|
|
+ dev-spi.o dev-uart.o dev-usb-ehci.o dev-usb-ohci.o dev-wdt.o
|
2012-02-04 12:17:27 +02:00
|
|
|
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
|
|
|
|
|
|
|
|
obj-y += boards/
|
|
|
|
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
|
|
|
|
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
|
2012-06-05 16:40:41 +03:00
|
|
|
@@ -28,6 +28,7 @@
|
2012-02-04 12:17:27 +02:00
|
|
|
#include <bcm63xx_dev_pcmcia.h>
|
2012-03-28 23:42:25 +03:00
|
|
|
#include <bcm63xx_dev_spi.h>
|
2012-02-04 12:17:27 +02:00
|
|
|
#include <bcm63xx_dev_usb_ohci.h>
|
|
|
|
+#include <bcm63xx_dev_usb_ehci.h>
|
|
|
|
#include <board_bcm963xx.h>
|
2012-03-28 23:42:09 +03:00
|
|
|
#include <bcm_tag.h>
|
2012-02-04 12:17:27 +02:00
|
|
|
|
2012-07-07 01:10:37 +03:00
|
|
|
@@ -917,6 +918,9 @@ int __init board_register_devices(void)
|
2012-02-04 12:17:27 +02:00
|
|
|
!board_get_mac_address(board.enet1.mac_addr))
|
|
|
|
bcm63xx_enet_register(1, &board.enet1);
|
|
|
|
|
|
|
|
+ if (board.has_ehci0)
|
|
|
|
+ bcm63xx_ehci_register();
|
|
|
|
+
|
|
|
|
if (board.has_ohci0)
|
|
|
|
bcm63xx_ohci_register();
|
|
|
|
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/arch/mips/bcm63xx/dev-usb-ehci.c
|
|
|
|
@@ -0,0 +1,50 @@
|
|
|
|
+/*
|
|
|
|
+ * This file is subject to the terms and conditions of the GNU General Public
|
|
|
|
+ * License. See the file "COPYING" in the main directory of this archive
|
|
|
|
+ * for more details.
|
|
|
|
+ *
|
|
|
|
+ * Copyright (C) 2008 Maxime Bizon <mbizon@freebox.fr>
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+#include <linux/init.h>
|
|
|
|
+#include <linux/kernel.h>
|
|
|
|
+#include <linux/platform_device.h>
|
|
|
|
+#include <bcm63xx_cpu.h>
|
|
|
|
+#include <bcm63xx_dev_usb_ehci.h>
|
|
|
|
+
|
|
|
|
+static struct resource ehci_resources[] = {
|
|
|
|
+ {
|
|
|
|
+ .start = -1, /* filled at runtime */
|
|
|
|
+ .end = -1, /* filled at runtime */
|
|
|
|
+ .flags = IORESOURCE_MEM,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ .start = -1, /* filled at runtime */
|
|
|
|
+ .flags = IORESOURCE_IRQ,
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+static u64 ehci_dmamask = ~(u32)0;
|
|
|
|
+
|
|
|
|
+static struct platform_device bcm63xx_ehci_device = {
|
|
|
|
+ .name = "bcm63xx_ehci",
|
|
|
|
+ .id = 0,
|
|
|
|
+ .num_resources = ARRAY_SIZE(ehci_resources),
|
|
|
|
+ .resource = ehci_resources,
|
|
|
|
+ .dev = {
|
|
|
|
+ .dma_mask = &ehci_dmamask,
|
|
|
|
+ .coherent_dma_mask = 0xffffffff,
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+int __init bcm63xx_ehci_register(void)
|
|
|
|
+{
|
|
|
|
+ if (!BCMCPU_IS_6358() && !BCMCPU_IS_6368())
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
|
|
+ ehci_resources[0].start = bcm63xx_regset_address(RSET_EHCI0);
|
|
|
|
+ ehci_resources[0].end = ehci_resources[0].start;
|
|
|
|
+ ehci_resources[0].end += RSET_EHCI_SIZE - 1;
|
|
|
|
+ ehci_resources[1].start = bcm63xx_get_irq_number(IRQ_EHCI0);
|
|
|
|
+ return platform_device_register(&bcm63xx_ehci_device);
|
|
|
|
+}
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h
|
|
|
|
@@ -0,0 +1,6 @@
|
|
|
|
+#ifndef BCM63XX_DEV_USB_EHCI_H_
|
|
|
|
+#define BCM63XX_DEV_USB_EHCI_H_
|
|
|
|
+
|
|
|
|
+int bcm63xx_ehci_register(void);
|
|
|
|
+
|
|
|
|
+#endif /* BCM63XX_DEV_USB_EHCI_H_ */
|