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

Commit 2eb42d5c authored by Uwe Kleine-König's avatar Uwe Kleine-König
Browse files

ARM: imx: dynamically allocate mxc-ehci devices

parent 9d3d945a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ config MACH_PCM038
	select IMX_HAVE_PLATFORM_IMX2_WDT
	select IMX_HAVE_PLATFORM_IMX_I2C
	select IMX_HAVE_PLATFORM_IMX_UART
	select IMX_HAVE_PLATFORM_MXC_EHCI
	select IMX_HAVE_PLATFORM_MXC_NAND
	select IMX_HAVE_PLATFORM_MXC_W1
	select IMX_HAVE_PLATFORM_SPI_IMX
@@ -130,6 +131,7 @@ config MACH_CPUIMX27
	select IMX_HAVE_PLATFORM_IMX2_WDT
	select IMX_HAVE_PLATFORM_IMX_I2C
	select IMX_HAVE_PLATFORM_IMX_UART
	select IMX_HAVE_PLATFORM_MXC_EHCI
	select IMX_HAVE_PLATFORM_MXC_NAND
	select IMX_HAVE_PLATFORM_MXC_W1
	select MXC_ULPI if USB_ULPI
@@ -183,6 +185,7 @@ config MACH_IMX27_VISSTRIM_M10
	select IMX_HAVE_PLATFORM_IMX_I2C
	select IMX_HAVE_PLATFORM_IMX_UART
	select IMX_HAVE_PLATFORM_MXC_MMC
	select IMX_HAVE_PLATFORM_MXC_EHCI
	help
	  Include support for Visstrim_m10 platform and its different variants.
	  This includes specific configurations for the board and its
@@ -202,6 +205,7 @@ config MACH_PCA100
	select IMX_HAVE_PLATFORM_IMX_I2C
	select IMX_HAVE_PLATFORM_IMX_SSI
	select IMX_HAVE_PLATFORM_IMX_UART
	select IMX_HAVE_PLATFORM_MXC_EHCI
	select IMX_HAVE_PLATFORM_MXC_MMC
	select IMX_HAVE_PLATFORM_MXC_NAND
	select IMX_HAVE_PLATFORM_MXC_W1
+7 −0
Original line number Diff line number Diff line
@@ -43,6 +43,13 @@ extern const struct imx_mx2_camera_data imx27_mx2_camera_data __initconst;
#define imx27_add_mx2_camera(pdata)	\
	imx_add_mx2_camera(&imx27_mx2_camera_data, pdata)

extern const struct imx_mxc_ehci_data imx27_mxc_ehci_otg_data __initconst;
#define imx27_add_mxc_ehci_otg(pdata)	\
	imx_add_mxc_ehci(&imx27_mxc_ehci_otg_data, pdata)
extern const struct imx_mxc_ehci_data imx27_mxc_ehci_hs_data[] __initconst;
#define imx27_add_mxc_ehci_hs(id, pdata)	\
	imx_add_mxc_ehci(&imx27_mxc_ehci_hs_data[id - 1], pdata)

extern const struct imx_mxc_mmc_data imx27_mxc_mmc_data[] __initconst;
#define imx27_add_mxc_mmc(id, pdata)	\
	imx_add_mxc_mmc(&imx27_mxc_mmc_data[id], pdata)
+4 −69
Original line number Diff line number Diff line
@@ -79,12 +79,12 @@ int __init imx1_register_gpios(void)
#ifdef CONFIG_MACH_MX27
static struct resource otg_resources[] = {
	{
		.start = MX27_USBOTG_BASE_ADDR,
		.end = MX27_USBOTG_BASE_ADDR + 0x1ff,
		.start = MX27_USB_OTG_BASE_ADDR,
		.end = MX27_USB_OTG_BASE_ADDR + 0x1ff,
		.flags = IORESOURCE_MEM,
	}, {
		.start = MX27_INT_USB3,
		.end = MX27_INT_USB3,
		.start = MX27_INT_USB_OTG,
		.end = MX27_INT_USB_OTG,
		.flags = IORESOURCE_IRQ,
	},
};
@@ -102,71 +102,6 @@ struct platform_device mxc_otg_udc_device = {
	.resource	= otg_resources,
	.num_resources	= ARRAY_SIZE(otg_resources),
};

/* OTG host */
struct platform_device mxc_otg_host = {
	.name = "mxc-ehci",
	.id = 0,
	.dev = {
		.coherent_dma_mask = DMA_BIT_MASK(32),
		.dma_mask = &otg_dmamask,
	},
	.resource = otg_resources,
	.num_resources = ARRAY_SIZE(otg_resources),
};

/* USB host 1 */

static u64 usbh1_dmamask = DMA_BIT_MASK(32);

static struct resource mxc_usbh1_resources[] = {
	{
		.start = MX27_USBOTG_BASE_ADDR + 0x200,
		.end = MX27_USBOTG_BASE_ADDR + 0x3ff,
		.flags = IORESOURCE_MEM,
	}, {
		.start = MX27_INT_USB1,
		.end = MX27_INT_USB1,
		.flags = IORESOURCE_IRQ,
	},
};

struct platform_device mxc_usbh1 = {
	.name = "mxc-ehci",
	.id = 1,
	.dev = {
		.coherent_dma_mask = DMA_BIT_MASK(32),
		.dma_mask = &usbh1_dmamask,
	},
	.resource = mxc_usbh1_resources,
	.num_resources = ARRAY_SIZE(mxc_usbh1_resources),
};

/* USB host 2 */
static u64 usbh2_dmamask = DMA_BIT_MASK(32);

static struct resource mxc_usbh2_resources[] = {
	{
		.start = MX27_USBOTG_BASE_ADDR + 0x400,
		.end = MX27_USBOTG_BASE_ADDR + 0x5ff,
		.flags = IORESOURCE_MEM,
	}, {
		.start = MX27_INT_USB2,
		.end = MX27_INT_USB2,
		.flags = IORESOURCE_IRQ,
	},
};

struct platform_device mxc_usbh2 = {
	.name = "mxc-ehci",
	.id = 2,
	.dev = {
		.coherent_dma_mask = DMA_BIT_MASK(32),
		.dma_mask = &usbh2_dmamask,
	},
	.resource = mxc_usbh2_resources,
	.num_resources = ARRAY_SIZE(mxc_usbh2_resources),
};
#endif

#if defined(CONFIG_MACH_MX21) || defined(CONFIG_MACH_MX27)
+0 −3
Original line number Diff line number Diff line
#if defined(CONFIG_MACH_MX21) || defined(CONFIG_MACH_MX27)
extern struct platform_device mxc_otg_udc_device;
extern struct platform_device mxc_otg_host;
extern struct platform_device mxc_usbh1;
extern struct platform_device mxc_usbh2;
extern struct platform_device mx21_usbhc_device;
extern struct platform_device imx_kpp_device;
#endif
+4 −5
Original line number Diff line number Diff line
@@ -40,7 +40,6 @@
#include <mach/hardware.h>
#include <mach/iomux-mx27.h>
#include <mach/mxc_nand.h>
#include <mach/mxc_ehci.h>
#include <mach/ulpi.h>

#include "devices-imx27.h"
@@ -213,12 +212,12 @@ static struct platform_device serial_device = {
#endif

#if defined(CONFIG_USB_ULPI)
static struct mxc_usbh_platform_data otg_pdata = {
static struct mxc_usbh_platform_data otg_pdata __initdata = {
	.portsc	= MXC_EHCI_MODE_ULPI,
	.flags	= MXC_EHCI_INTERFACE_DIFF_UNI,
};

static struct mxc_usbh_platform_data usbh2_pdata = {
static struct mxc_usbh_platform_data usbh2_pdata __initdata = {
	.portsc	= MXC_EHCI_MODE_ULPI,
	.flags	= MXC_EHCI_INTERFACE_DIFF_UNI,
};
@@ -281,13 +280,13 @@ static void __init eukrea_cpuimx27_init(void)
		otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
				ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT);

		mxc_register_device(&mxc_otg_host, &otg_pdata);
		imx27_add_mxc_ehci_otg(&otg_pdata);
	}

	usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
				ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT);

	mxc_register_device(&mxc_usbh2, &usbh2_pdata);
	imx27_add_mxc_ehci_hs(2, &usbh2_pdata);
#endif
	if (!otg_mode_host)
		mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata);
Loading