86e2a1aa6aca175c250a51863326e0a3f44e32cc
[openwrt/svn-archive/archive.git] / target / linux / brcm63xx / patches-3.8 / 441-MIPS-BCM63XX-enable-USB-for-BCM6362.patch
1 From fb9e98936590637c26b66d60137a7b44b329a254 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jonas.gorski@gmail.com>
3 Date: Sun, 12 Feb 2012 14:40:56 +0100
4 Subject: [PATCH 59/84] MIPS: BCM63XX: enable USB for BCM6362
5
6 BCM6362 has the same USB controller as BCM6368.
7
8 Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
9 ---
10 arch/mips/bcm63xx/Kconfig | 2 ++
11 arch/mips/bcm63xx/clk.c | 4 ++++
12 arch/mips/bcm63xx/dev-usb-ehci.c | 3 ++-
13 arch/mips/bcm63xx/dev-usb-ohci.c | 2 +-
14 drivers/usb/host/ehci-bcm63xx.c | 2 +-
15 drivers/usb/host/ohci-bcm63xx.c | 2 +-
16 6 files changed, 11 insertions(+), 4 deletions(-)
17
18 --- a/arch/mips/bcm63xx/Kconfig
19 +++ b/arch/mips/bcm63xx/Kconfig
20 @@ -40,6 +40,8 @@ config BCM63XX_CPU_6358
21 config BCM63XX_CPU_6362
22 bool "support 6362 CPU"
23 select HW_HAS_PCI
24 + select BCM63XX_OHCI
25 + select BCM63XX_EHCI
26
27 config BCM63XX_CPU_6368
28 bool "support 6368 CPU"
29 --- a/arch/mips/bcm63xx/clk.c
30 +++ b/arch/mips/bcm63xx/clk.c
31 @@ -167,6 +167,8 @@ static void usbh_set(struct clk *clk, in
32 bcm_hwclock_set(CKCTL_6328_USBH_EN, enable);
33 else if (BCMCPU_IS_6348())
34 bcm_hwclock_set(CKCTL_6348_USBH_EN, enable);
35 + else if (BCMCPU_IS_6362())
36 + bcm_hwclock_set(CKCTL_6362_USBH_EN, enable);
37 else if (BCMCPU_IS_6368())
38 bcm_hwclock_set(CKCTL_6368_USBH_EN, enable);
39 else
40 --- a/arch/mips/bcm63xx/dev-usb-ehci.c
41 +++ b/arch/mips/bcm63xx/dev-usb-ehci.c
42 @@ -81,7 +81,8 @@ static struct platform_device bcm63xx_eh
43
44 int __init bcm63xx_ehci_register(void)
45 {
46 - if (!BCMCPU_IS_6328() && !BCMCPU_IS_6358() && !BCMCPU_IS_6368())
47 + if (!BCMCPU_IS_6328() && !BCMCPU_IS_6358() && !BCMCPU_IS_6362() &&
48 + !BCMCPU_IS_6368())
49 return 0;
50
51 ehci_resources[0].start = bcm63xx_regset_address(RSET_EHCI0);
52 --- a/arch/mips/bcm63xx/usb-common.c
53 +++ b/arch/mips/bcm63xx/usb-common.c
54 @@ -100,7 +100,7 @@ void bcm63xx_usb_priv_ohci_cfg_set(void)
55 bcm_rset_writel(RSET_USBH_PRIV, 0x1c0020,
56 USBH_PRIV_TEST_6358_REG);
57
58 - } else if (BCMCPU_IS_6328() || BCMCPU_IS_6368()) {
59 + } else if (BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_6368()) {
60 reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SWAP_6368_REG);
61 reg &= ~USBH_PRIV_SWAP_OHCI_ENDN_MASK;
62 reg |= USBH_PRIV_SWAP_OHCI_DATA_MASK;
63 @@ -135,7 +135,7 @@ void bcm63xx_usb_priv_ehci_cfg_set(void)
64 bcm_rset_writel(RSET_USBH_PRIV, 0x1c0020,
65 USBH_PRIV_TEST_6358_REG);
66
67 - } else if (BCMCPU_IS_6328() || BCMCPU_IS_6368()) {
68 + } else if (BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_6368()) {
69 reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SWAP_6368_REG);
70 reg &= ~USBH_PRIV_SWAP_EHCI_ENDN_MASK;
71 reg |= USBH_PRIV_SWAP_EHCI_DATA_MASK;