aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm63xx/patches-3.3/441-MIPS-BCM63XX-enable-USB-for-BCM6362.patch
blob: 04d540ffb9195c0399f0782d434053d17b74bf31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
From fb9e98936590637c26b66d60137a7b44b329a254 Mon Sep 17 00:00:00 2001
From: Jonas Gorski <jonas.gorski@gmail.com>
Date: Sun, 12 Feb 2012 14:40:56 +0100
Subject: [PATCH 59/84] MIPS: BCM63XX: enable USB for BCM6362

BCM6362 has the same USB controller as BCM6368.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
 arch/mips/bcm63xx/Kconfig        |    2 ++
 arch/mips/bcm63xx/clk.c          |    4 ++++
 arch/mips/bcm63xx/dev-usb-ehci.c |    3 ++-
 arch/mips/bcm63xx/dev-usb-ohci.c |    2 +-
 drivers/usb/host/ehci-bcm63xx.c  |    2 +-
 drivers/usb/host/ohci-bcm63xx.c  |    2 +-
 6 files changed, 11 insertions(+), 4 deletions(-)

--- a/arch/mips/bcm63xx/Kconfig
+++ b/arch/mips/bcm63xx/Kconfig
@@ -27,6 +27,8 @@ config BCM63XX_CPU_6358
 config BCM63XX_CPU_6362
 	bool "support 6362 CPU"
 	select HW_HAS_PCI
+	select USB_ARCH_HAS_OHCI if USB_SUPPORT
+	select USB_ARCH_HAS_EHCI if USB_SUPPORT
 
 config BCM63XX_CPU_6368
 	bool "support 6368 CPU"
--- a/arch/mips/bcm63xx/clk.c
+++ b/arch/mips/bcm63xx/clk.c
@@ -178,6 +178,8 @@ static void usbh_set(struct clk *clk, in
 {
 	if (BCMCPU_IS_6348())
 		bcm_hwclock_set(CKCTL_6348_USBH_EN, enable);
+	else if (BCMCPU_IS_6362())
+		bcm_hwclock_set(CKCTL_6362_USBH_EN, enable);
 	else if (BCMCPU_IS_6368())
 		bcm_hwclock_set(CKCTL_6368_USBH_EN, enable);
 }
--- a/arch/mips/bcm63xx/dev-usb-ehci.c
+++ b/arch/mips/bcm63xx/dev-usb-ehci.c
@@ -39,7 +39,8 @@ static struct platform_device bcm63xx_eh
 
 int __init bcm63xx_ehci_register(void)
 {
-	if (!BCMCPU_IS_6328() && !BCMCPU_IS_6358() && !BCMCPU_IS_6368())
+	if (!BCMCPU_IS_6328() && !BCMCPU_IS_6358() && !BCMCPU_IS_6362() &&
+	    !BCMCPU_IS_6368())
 		return 0;
 
 	ehci_resources[0].start = bcm63xx_regset_address(RSET_EHCI0);
--- a/arch/mips/bcm63xx/dev-usb-ohci.c
+++ b/arch/mips/bcm63xx/dev-usb-ohci.c
@@ -40,7 +40,7 @@ static struct platform_device bcm63xx_oh
 int __init bcm63xx_ohci_register(void)
 {
 	if (!BCMCPU_IS_6328() && !BCMCPU_IS_6348() && !BCMCPU_IS_6358() &&
-	    !BCMCPU_IS_6368())
+	    !BCMCPU_IS_6362() && !BCMCPU_IS_6368())
 		return 0;
 
 	ohci_resources[0].start = bcm63xx_regset_address(RSET_OHCI0);
--- a/drivers/usb/host/ehci-bcm63xx.c
+++ b/drivers/usb/host/ehci-bcm63xx.c
@@ -99,7 +99,7 @@ static int __devinit ehci_hcd_bcm63xx_dr
 		bcm_rset_writel(RSET_USBH_PRIV, 0x1c0020,
 				USBH_PRIV_TEST_6358_REG);
 
-	} else if (BCMCPU_IS_6328() || BCMCPU_IS_6368()) {
+	} else if (BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_6368()) {
 
 		reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SWAP_6368_REG);
 		reg &= ~USBH_PRIV_SWAP_EHCI_DATA_MASK;
--- a/drivers/usb/host/ohci-bcm63xx.c
+++ b/drivers/usb/host/ohci-bcm63xx.c
@@ -94,7 +94,7 @@ static int __devinit ohci_hcd_bcm63xx_dr
 		bcm_rset_writel(RSET_USBH_PRIV, 0x1c0020,
 				USBH_PRIV_TEST_6358_REG);
 
-	} else if (BCMCPU_IS_6328() || BCMCPU_IS_6368()) {
+	} else if (BCMCPU_IS_6328() || BCMCPU_IS_6362() ||  BCMCPU_IS_6368()) {
 		reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SWAP_6368_REG);
 		reg &= ~USBH_PRIV_SWAP_OHCI_ENDN_MASK;
 		reg |= USBH_PRIV_SWAP_OHCI_DATA_MASK;