Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3abd7f68 authored by Tanmay Upadhyay's avatar Tanmay Upadhyay Committed by Greg Kroah-Hartman
Browse files

USB: pxa168: Add onchip USB host controller support



- Add EHCI Host controller driver
- Add wrapper that creates resources for host controller driver

v2 - Call clk_put() after clk_disable() in probe function

Signed-off-by: default avatarTanmay Upadhyay <tanmay.upadhyay@einfochips.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7a01f496
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -35,6 +35,13 @@ extern struct pxa_device_desc pxa168_device_fb;
extern struct pxa_device_desc pxa168_device_keypad;
extern struct pxa_device_desc pxa168_device_eth;

struct pxa168_usb_pdata {
	/* If NULL, default phy init routine for PXA168 would be called */
	int (*phy_init)(void __iomem *usb_phy_reg_base);
};
/* pdata can be NULL */
int __init pxa168_add_usb_host(struct pxa168_usb_pdata *pdata);

static inline int pxa168_add_uart(int id)
{
	struct pxa_device_desc *d = NULL;
+46 −0
Original line number Diff line number Diff line
@@ -25,6 +25,9 @@
#include <mach/dma.h>
#include <mach/devices.h>
#include <mach/mfp.h>
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
#include <mach/pxa168.h>

#include "common.h"
#include "clock.h"
@@ -83,6 +86,7 @@ static APBC_CLK(keypad, PXA168_KPC, 0, 32000);
static APMU_CLK(nand, NAND, 0x19b, 156000000);
static APMU_CLK(lcd, LCD, 0x7f, 312000000);
static APMU_CLK(eth, ETH, 0x09, 0);
static APMU_CLK(usb, USB, 0x12, 0);

/* device and clock bindings */
static struct clk_lookup pxa168_clkregs[] = {
@@ -104,6 +108,7 @@ static struct clk_lookup pxa168_clkregs[] = {
	INIT_CLKREG(&clk_lcd, "pxa168-fb", NULL),
	INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL),
	INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"),
	INIT_CLKREG(&clk_usb, "pxa168-ehci", "PXA168-USBCLK"),
};

static int __init pxa168_init(void)
@@ -169,3 +174,44 @@ PXA168_DEVICE(ssp5, "pxa168-ssp", 4, SSP5, 0xd4021000, 0x40, 60, 61);
PXA168_DEVICE(fb, "pxa168-fb", -1, LCD, 0xd420b000, 0x1c8);
PXA168_DEVICE(keypad, "pxa27x-keypad", -1, KEYPAD, 0xd4012000, 0x4c);
PXA168_DEVICE(eth, "pxa168-eth", -1, MFU, 0xc0800000, 0x0fff);

struct resource pxa168_usb_host_resources[] = {
	/* USB Host conroller register base */
	[0] = {
		.start	= 0xd4209000,
		.end	= 0xd4209000 + 0x200,
		.flags	= IORESOURCE_MEM,
		.name	= "pxa168-usb-host",
	},
	/* USB PHY register base */
	[1] = {
		.start	= 0xd4206000,
		.end	= 0xd4206000 + 0xff,
		.flags	= IORESOURCE_MEM,
		.name	= "pxa168-usb-phy",
	},
	[2] = {
		.start	= IRQ_PXA168_USB2,
		.end	= IRQ_PXA168_USB2,
		.flags	= IORESOURCE_IRQ,
	},
};

static u64 pxa168_usb_host_dmamask = DMA_BIT_MASK(32);
struct platform_device pxa168_device_usb_host = {
	.name = "pxa168-ehci",
	.id   = -1,
	.dev  = {
		.dma_mask = &pxa168_usb_host_dmamask,
		.coherent_dma_mask = DMA_BIT_MASK(32),
	},

	.num_resources = ARRAY_SIZE(pxa168_usb_host_resources),
	.resource      = pxa168_usb_host_resources,
};

int __init pxa168_add_usb_host(struct pxa168_usb_pdata *pdata)
{
	pxa168_device_usb_host.dev.platform_data = pdata;
	return platform_device_register(&pxa168_device_usb_host);
}
+1 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ config USB_ARCH_HAS_EHCI
	default y if ARCH_MSM
	default y if MICROBLAZE
	default y if SPARC_LEON
	default y if ARCH_MMP
	default PCI

# ARM SA1111 chips have a non-PCI based "OHCI-compatible" USB host interface.
+7 −0
Original line number Diff line number Diff line
@@ -578,3 +578,10 @@ config USB_OCTEON_OHCI
config USB_OCTEON2_COMMON
	bool
	default y if USB_OCTEON_EHCI || USB_OCTEON_OHCI

config USB_PXA168_EHCI
	bool "Marvell PXA168 on-chip EHCI HCD support"
	depends on USB_EHCI_HCD && ARCH_MMP
	help
	  Enable support for Marvell PXA168 SoC's on-chip EHCI
	  host controller
+5 −0
Original line number Diff line number Diff line
@@ -1291,6 +1291,11 @@ MODULE_LICENSE ("GPL");
#define PLATFORM_DRIVER		ehci_grlib_driver
#endif

#ifdef CONFIG_USB_PXA168_EHCI
#include "ehci-pxa168.c"
#define PLATFORM_DRIVER		ehci_pxa168_driver
#endif

#if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \
    !defined(PS3_SYSTEM_BUS_DRIVER) && !defined(OF_PLATFORM_DRIVER) && \
    !defined(XILINX_OF_PLATFORM_DRIVER)
Loading