Root/target/linux/brcm63xx/patches-3.3/401-MIPS-BCM63XX-register-ohci-device.patch

1From ab96f20ca1c3c8e7e5acd82d1e50823a5d572675 Mon Sep 17 00:00:00 2001
2From: Maxime Bizon <mbizon@freebox.fr>
3Date: Tue, 24 May 2011 21:47:41 +0200
4Subject: [PATCH 24/63] MIPS: BCM63XX: register ohci device.
5
6---
7 arch/mips/bcm63xx/Kconfig | 9 ++--
8 arch/mips/bcm63xx/Makefile | 2 +-
9 arch/mips/bcm63xx/boards/board_bcm963xx.c | 4 ++
10 arch/mips/bcm63xx/dev-usb-ohci.c | 50 ++++++++++++++++++++
11 .../asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h | 6 ++
12 5 files changed, 65 insertions(+), 6 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
15
16--- a/arch/mips/bcm63xx/Kconfig
17+++ b/arch/mips/bcm63xx/Kconfig
18@@ -8,22 +8,20 @@ config BCM63XX_CPU_6328
19 config BCM63XX_CPU_6338
20     bool "support 6338 CPU"
21     select HW_HAS_PCI
22- select USB_ARCH_HAS_OHCI
23- select USB_OHCI_BIG_ENDIAN_DESC
24- select USB_OHCI_BIG_ENDIAN_MMIO
25+ select USB_ARCH_HAS_OHCI if USB_SUPPORT
26 
27 config BCM63XX_CPU_6345
28     bool "support 6345 CPU"
29- select USB_OHCI_BIG_ENDIAN_DESC
30- select USB_OHCI_BIG_ENDIAN_MMIO
31 
32 config BCM63XX_CPU_6348
33     bool "support 6348 CPU"
34     select HW_HAS_PCI
35+ select USB_ARCH_HAS_OHCI if USB_SUPPORT
36 
37 config BCM63XX_CPU_6358
38     bool "support 6358 CPU"
39     select HW_HAS_PCI
40+ select USB_ARCH_HAS_OHCI if USB_SUPPORT
41 
42 config BCM63XX_CPU_6362
43     bool "support 6362 CPU"
44@@ -32,6 +30,7 @@ config BCM63XX_CPU_6362
45 config BCM63XX_CPU_6368
46     bool "support 6368 CPU"
47     select HW_HAS_PCI
48+ select USB_ARCH_HAS_OHCI if USB_SUPPORT
49 endmenu
50 
51 source "arch/mips/bcm63xx/boards/Kconfig"
52--- a/arch/mips/bcm63xx/Makefile
53+++ b/arch/mips/bcm63xx/Makefile
54@@ -1,6 +1,6 @@
55 obj-y += clk.o cpu.o cs.o gpio.o irq.o prom.o setup.o timer.o \
56            dev-dsp.o dev-enet.o dev-flash.o dev-pcmcia.o dev-rng.o \
57- dev-spi.o dev-uart.o dev-wdt.o
58+ dev-spi.o dev-uart.o dev-usb-ohci.o dev-wdt.o
59 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
60 
61 obj-y += boards/
62--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
63+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
64@@ -27,6 +27,7 @@
65 #include <bcm63xx_dev_flash.h>
66 #include <bcm63xx_dev_pcmcia.h>
67 #include <bcm63xx_dev_spi.h>
68+#include <bcm63xx_dev_usb_ohci.h>
69 #include <board_bcm963xx.h>
70 #include <bcm963xx_tag.h>
71 
72@@ -916,6 +917,9 @@ int __init board_register_devices(void)
73         !board_get_mac_address(board.enet1.mac_addr))
74         bcm63xx_enet_register(1, &board.enet1);
75 
76+ if (board.has_ohci0)
77+ bcm63xx_ohci_register();
78+
79     if (board.has_dsp)
80         bcm63xx_dsp_register(&board.dsp);
81 
82--- /dev/null
83+++ b/arch/mips/bcm63xx/dev-usb-ohci.c
84@@ -0,0 +1,50 @@
85+/*
86+ * This file is subject to the terms and conditions of the GNU General Public
87+ * License. See the file "COPYING" in the main directory of this archive
88+ * for more details.
89+ *
90+ * Copyright (C) 2008 Maxime Bizon <mbizon@freebox.fr>
91+ */
92+
93+#include <linux/init.h>
94+#include <linux/kernel.h>
95+#include <linux/platform_device.h>
96+#include <bcm63xx_cpu.h>
97+#include <bcm63xx_dev_usb_ohci.h>
98+
99+static struct resource ohci_resources[] = {
100+ {
101+ .start = -1, /* filled at runtime */
102+ .end = -1, /* filled at runtime */
103+ .flags = IORESOURCE_MEM,
104+ },
105+ {
106+ .start = -1, /* filled at runtime */
107+ .flags = IORESOURCE_IRQ,
108+ },
109+};
110+
111+static u64 ohci_dmamask = ~(u32)0;
112+
113+static struct platform_device bcm63xx_ohci_device = {
114+ .name = "bcm63xx_ohci",
115+ .id = 0,
116+ .num_resources = ARRAY_SIZE(ohci_resources),
117+ .resource = ohci_resources,
118+ .dev = {
119+ .dma_mask = &ohci_dmamask,
120+ .coherent_dma_mask = 0xffffffff,
121+ },
122+};
123+
124+int __init bcm63xx_ohci_register(void)
125+{
126+ if (!BCMCPU_IS_6348() && !BCMCPU_IS_6358() && !BCMCPU_IS_6368())
127+ return 0;
128+
129+ ohci_resources[0].start = bcm63xx_regset_address(RSET_OHCI0);
130+ ohci_resources[0].end = ohci_resources[0].start;
131+ ohci_resources[0].end += RSET_OHCI_SIZE - 1;
132+ ohci_resources[1].start = bcm63xx_get_irq_number(IRQ_OHCI0);
133+ return platform_device_register(&bcm63xx_ohci_device);
134+}
135--- /dev/null
136+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h
137@@ -0,0 +1,6 @@
138+#ifndef BCM63XX_DEV_USB_OHCI_H_
139+#define BCM63XX_DEV_USB_OHCI_H_
140+
141+int bcm63xx_ohci_register(void);
142+
143+#endif /* BCM63XX_DEV_USB_OHCI_H_ */
144

Archive Download this file



interactive