[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1349276601-8371-20-git-send-email-florian@openwrt.org>
Date: Wed, 3 Oct 2012 17:03:14 +0200
From: Florian Fainelli <florian@...nwrt.org>
To: stern@...land.harvard.edu
Cc: linux-usb@...r.kernel.org, Florian Fainelli <florian@...nwrt.org>,
Ralf Baechle <ralf@...ux-mips.org>,
David Daney <david.daney@...ium.com>,
"David S. Miller" <davem@...emloft.net>,
Wolfram Sang <w.sang@...gutronix.de>,
linux-mips@...ux-mips.org, linux-kernel@...r.kernel.org
Subject: [PATCH 18/25] MIPS: Octeon: use OHCI platform driver
Signed-off-by: Florian Fainelli <florian@...nwrt.org>
---
arch/mips/cavium-octeon/octeon-platform.c | 37 ++++++++++++++++++++++++++++-
1 file changed, 36 insertions(+), 1 deletion(-)
diff --git a/arch/mips/cavium-octeon/octeon-platform.c b/arch/mips/cavium-octeon/octeon-platform.c
index 539e1bc..07b0a3b 100644
--- a/arch/mips/cavium-octeon/octeon-platform.c
+++ b/arch/mips/cavium-octeon/octeon-platform.c
@@ -19,6 +19,7 @@
#include <linux/of_fdt.h>
#include <linux/libfdt.h>
#include <linux/usb/ehci_pdriver.h>
+#include <linux/usb/ohci_pdriver.h>
#include <asm/octeon/octeon.h>
#include <asm/octeon/cvmx-rnm-defs.h>
@@ -260,6 +261,36 @@ out:
}
device_initcall(octeon_ehci_device_init);
+static int octeon_ohci_power_on(struct platform_device *pdev)
+{
+ union cvmx_uctlx_ohci_ctl ohci_ctl;
+
+ octeon2_usb_clocks_start();
+
+ ohci_ctl.u64 = cvmx_read_csr(CVMX_UCTLX_OHCI_CTL(0));
+ ohci_ctl.s.l2c_addr_msb = 0;
+ ohci_ctl.s.l2c_buff_emod = 1; /* Byte swapped. */
+ ohci_ctl.s.l2c_desc_emod = 1; /* Byte swapped. */
+ cvmx_write_csr(CVMX_UCTLX_OHCI_CTL(0), ohci_ctl.u64);
+
+ return 0;
+}
+
+static octeon_ohci_power_off(struct platform_device *pdev)
+{
+ octeon2_usb_clocks_stop();
+}
+
+static struct usb_ohci_pdata octeon_ohci_pdata = {
+#ifdef __BIG_ENDIAN
+ .big_endian_mmio = 1,
+#endif
+ .power_on = octeon_ohci_power_on,
+ .power_off = octeon_ohci_power_off,
+};
+
+static u32 octeon_ohci_dma_mask = DMA_BIT_MASK(32);
+
static int __init octeon_ohci_device_init(void)
{
struct platform_device *pd;
@@ -280,7 +311,7 @@ static int __init octeon_ohci_device_init(void)
if (octeon_is_simulation() || usb_disabled())
return 0; /* No USB in the simulator. */
- pd = platform_device_alloc("octeon-ohci", 0);
+ pd = platform_device_alloc("ohci-platform", 0);
if (!pd) {
ret = -ENOMEM;
goto out;
@@ -297,6 +328,10 @@ static int __init octeon_ohci_device_init(void)
if (ret)
goto fail;
+ pd.dev.platform_data = &octeon_ohci_pdata;
+ pd.dev.coherent_dma_mask = DMA_BIT_MASK(32);
+ pd.dev.dma_mask = &octeon_ohci_dma_mask;
+
ret = platform_device_add(pd);
if (ret)
goto fail;
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists