Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
2eb42d5c
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2eb42d5c
编写于
11月 05, 2010
作者:
U
Uwe Kleine-König
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ARM: imx: dynamically allocate mxc-ehci devices
Signed-off-by:
N
Uwe Kleine-König
<
u.kleine-koenig@pengutronix.de
>
上级
9d3d945a
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
95 addition
and
93 deletion
+95
-93
arch/arm/mach-imx/Kconfig
arch/arm/mach-imx/Kconfig
+4
-0
arch/arm/mach-imx/devices-imx27.h
arch/arm/mach-imx/devices-imx27.h
+7
-0
arch/arm/mach-imx/devices.c
arch/arm/mach-imx/devices.c
+4
-69
arch/arm/mach-imx/devices.h
arch/arm/mach-imx/devices.h
+0
-3
arch/arm/mach-imx/mach-cpuimx27.c
arch/arm/mach-imx/mach-cpuimx27.c
+4
-5
arch/arm/mach-imx/mach-imx27_visstrim_m10.c
arch/arm/mach-imx/mach-imx27_visstrim_m10.c
+3
-3
arch/arm/mach-imx/mach-pca100.c
arch/arm/mach-imx/mach-pca100.c
+4
-5
arch/arm/mach-imx/mach-pcm038.c
arch/arm/mach-imx/mach-pcm038.c
+2
-3
arch/arm/plat-mxc/devices/Kconfig
arch/arm/plat-mxc/devices/Kconfig
+3
-0
arch/arm/plat-mxc/devices/Makefile
arch/arm/plat-mxc/devices/Makefile
+1
-0
arch/arm/plat-mxc/devices/platform-mxc-ehci.c
arch/arm/plat-mxc/devices/platform-mxc-ehci.c
+46
-0
arch/arm/plat-mxc/include/mach/devices-common.h
arch/arm/plat-mxc/include/mach/devices-common.h
+10
-0
arch/arm/plat-mxc/include/mach/mx27.h
arch/arm/plat-mxc/include/mach/mx27.h
+7
-5
未找到文件。
arch/arm/mach-imx/Kconfig
浏览文件 @
2eb42d5c
...
...
@@ -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
...
...
arch/arm/mach-imx/devices-imx27.h
浏览文件 @
2eb42d5c
...
...
@@ -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)
...
...
arch/arm/mach-imx/devices.c
浏览文件 @
2eb42d5c
...
...
@@ -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_USB
3
,
.
end
=
MX27_INT_USB
3
,
.
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)
...
...
arch/arm/mach-imx/devices.h
浏览文件 @
2eb42d5c
#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
arch/arm/mach-imx/mach-cpuimx27.c
浏览文件 @
2eb42d5c
...
...
@@ -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_usbh
2
,
&
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
);
...
...
arch/arm/mach-imx/mach-imx27_visstrim_m10.c
浏览文件 @
2eb42d5c
...
...
@@ -35,7 +35,6 @@
#include <asm/mach/time.h>
#include <mach/common.h>
#include <mach/iomux.h>
#include <mach/mxc_ehci.h>
#include "devices-imx27.h"
#include "devices.h"
...
...
@@ -215,7 +214,8 @@ static int otg_phy_init(struct platform_device *pdev)
return
0
;
}
static
struct
mxc_usbh_platform_data
visstrim_m10_usbotg_pdata
=
{
static
const
struct
mxc_usbh_platform_data
visstrim_m10_usbotg_pdata
__initconst
=
{
.
init
=
otg_phy_init
,
.
portsc
=
MXC_EHCI_MODE_ULPI
|
MXC_EHCI_UTMI_8BIT
,
.
flags
=
MXC_EHCI_POWER_PINS_ENABLED
,
...
...
@@ -237,7 +237,7 @@ static void __init visstrim_m10_board_init(void)
imx27_add_imx_i2c
(
0
,
&
visstrim_m10_i2c_data
);
imx27_add_imx_i2c
(
1
,
&
visstrim_m10_i2c_data
);
imx27_add_mxc_mmc
(
0
,
&
visstrim_m10_sdhc_pdata
);
mxc_register_device
(
&
mxc_otg_host
,
&
visstrim_m10_usbotg_pdata
);
imx27_add_mxc_ehci_otg
(
&
visstrim_m10_usbotg_pdata
);
imx27_add_fec
(
NULL
);
platform_add_devices
(
platform_devices
,
ARRAY_SIZE
(
platform_devices
));
}
...
...
arch/arm/mach-imx/mach-pca100.c
浏览文件 @
2eb42d5c
...
...
@@ -40,7 +40,6 @@
#include <mach/audmux.h>
#include <mach/mxc_nand.h>
#include <mach/irqs.h>
#include <mach/mxc_ehci.h>
#include <mach/ulpi.h>
#include "devices-imx27.h"
...
...
@@ -279,7 +278,7 @@ static int otg_phy_init(struct platform_device *pdev)
return
0
;
}
static
struct
mxc_usbh_platform_data
otg_pdata
=
{
static
struct
mxc_usbh_platform_data
otg_pdata
__initdata
=
{
.
init
=
otg_phy_init
,
.
portsc
=
MXC_EHCI_MODE_ULPI
,
.
flags
=
MXC_EHCI_INTERFACE_DIFF_UNI
,
...
...
@@ -291,7 +290,7 @@ static int usbh2_phy_init(struct platform_device *pdev)
return
0
;
}
static
struct
mxc_usbh_platform_data
usbh2_pdata
=
{
static
struct
mxc_usbh_platform_data
usbh2_pdata
__initdata
=
{
.
init
=
usbh2_phy_init
,
.
portsc
=
MXC_EHCI_MODE_ULPI
,
.
flags
=
MXC_EHCI_INTERFACE_DIFF_UNI
,
...
...
@@ -410,13 +409,13 @@ static void __init pca100_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_usbh
2
,
&
usbh2_pdata
);
imx27_add_mxc_ehci_hs
(
2
,
&
usbh2_pdata
);
#endif
if
(
!
otg_mode_host
)
{
gpio_set_value
(
OTG_PHY_CS_GPIO
,
0
);
...
...
arch/arm/mach-imx/mach-pcm038.c
浏览文件 @
2eb42d5c
...
...
@@ -37,7 +37,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"
...
...
@@ -283,7 +282,7 @@ static struct spi_board_info pcm038_spi_board_info[] __initdata = {
}
};
static
struct
mxc_usbh_platform_data
usbh2_pdata
=
{
static
const
struct
mxc_usbh_platform_data
usbh2_pdata
__initconst
=
{
.
portsc
=
MXC_EHCI_MODE_ULPI
,
.
flags
=
MXC_EHCI_POWER_PINS_ENABLED
|
MXC_EHCI_INTERFACE_DIFF_UNI
,
};
...
...
@@ -320,7 +319,7 @@ static void __init pcm038_init(void)
spi_register_board_info
(
pcm038_spi_board_info
,
ARRAY_SIZE
(
pcm038_spi_board_info
));
mxc_register_device
(
&
mxc_usbh
2
,
&
usbh2_pdata
);
imx27_add_mxc_ehci_hs
(
2
,
&
usbh2_pdata
);
imx27_add_fec
(
NULL
);
platform_add_devices
(
platform_devices
,
ARRAY_SIZE
(
platform_devices
));
...
...
arch/arm/plat-mxc/devices/Kconfig
浏览文件 @
2eb42d5c
...
...
@@ -37,6 +37,9 @@ config IMX_HAVE_PLATFORM_MX1_CAMERA
config IMX_HAVE_PLATFORM_MX2_CAMERA
bool
config IMX_HAVE_PLATFORM_MXC_EHCI
bool
config IMX_HAVE_PLATFORM_MXC_MMC
bool
...
...
arch/arm/plat-mxc/devices/Makefile
浏览文件 @
2eb42d5c
...
...
@@ -11,6 +11,7 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UDC)
+=
platform-imx_udc.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_MX1_CAMERA)
+=
platform-mx1-camera.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_MX2_CAMERA)
+=
platform-mx2-camera.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_EHCI)
+=
platform-mxc-ehci.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_MMC)
+=
platform-mxc-mmc.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND)
+=
platform-mxc_nand.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_PWM)
+=
platform-mxc_pwm.o
...
...
arch/arm/plat-mxc/devices/platform-mxc-ehci.c
0 → 100644
浏览文件 @
2eb42d5c
/*
* Copyright (C) 2010 Pengutronix
* Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*/
#include <mach/hardware.h>
#include <mach/devices-common.h>
#define imx_mxc_ehci_data_entry_single(soc, _id, hs) \
{ \
.id = _id, \
.iobase = soc ## _USB_ ## hs ## _BASE_ADDR, \
.irq = soc ## _INT_USB_ ## hs, \
}
#ifdef CONFIG_SOC_IMX27
const
struct
imx_mxc_ehci_data
imx27_mxc_ehci_otg_data
__initconst
=
imx_mxc_ehci_data_entry_single
(
MX27
,
0
,
OTG
);
const
struct
imx_mxc_ehci_data
imx27_mxc_ehci_hs_data
[]
__initconst
=
{
imx_mxc_ehci_data_entry_single
(
MX27
,
1
,
HS1
),
imx_mxc_ehci_data_entry_single
(
MX27
,
2
,
HS2
),
};
#endif
/* ifdef CONFIG_SOC_IMX27 */
struct
platform_device
*
__init
imx_add_mxc_ehci
(
const
struct
imx_mxc_ehci_data
*
data
,
const
struct
mxc_usbh_platform_data
*
pdata
)
{
struct
resource
res
[]
=
{
{
.
start
=
data
->
iobase
,
.
end
=
data
->
iobase
+
SZ_512
-
1
,
.
flags
=
IORESOURCE_MEM
,
},
{
.
start
=
data
->
irq
,
.
end
=
data
->
irq
,
.
flags
=
IORESOURCE_IRQ
,
},
};
return
imx_add_platform_device_dmamask
(
"mxc-ehci"
,
data
->
id
,
res
,
ARRAY_SIZE
(
res
),
pdata
,
sizeof
(
*
pdata
),
DMA_BIT_MASK
(
32
));
}
arch/arm/plat-mxc/include/mach/devices-common.h
浏览文件 @
2eb42d5c
...
...
@@ -151,6 +151,16 @@ struct platform_device *__init imx_add_mx2_camera(
const
struct
imx_mx2_camera_data
*
data
,
const
struct
mx2_camera_platform_data
*
pdata
);
#include <mach/mxc_ehci.h>
struct
imx_mxc_ehci_data
{
int
id
;
resource_size_t
iobase
;
resource_size_t
irq
;
};
struct
platform_device
*
__init
imx_add_mxc_ehci
(
const
struct
imx_mxc_ehci_data
*
data
,
const
struct
mxc_usbh_platform_data
*
pdata
);
#include <mach/mmc.h>
struct
imx_mxc_mmc_data
{
int
id
;
...
...
arch/arm/plat-mxc/include/mach/mx27.h
浏览文件 @
2eb42d5c
...
...
@@ -64,8 +64,10 @@
#define MX27_LCDC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x21000)
#define MX27_SLCDC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x22000)
#define MX27_VPU_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x23000)
#define MX27_USBOTG_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x24000)
#define MX27_OTG_BASE_ADDR MX27_USBOTG_BASE_ADDR
#define MX27_USB_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x24000)
#define MX27_USB_OTG_BASE_ADDR (MX27_USB_BASE_ADDR + 0x0000)
#define MX27_USB_HS1_BASE_ADDR (MX27_USB_BASE_ADDR + 0x0200)
#define MX27_USB_HS2_BASE_ADDR (MX27_USB_BASE_ADDR + 0x0400)
#define MX27_SAHARA_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x25000)
#define MX27_EMMAPP_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x26000)
#define MX27_EMMAPRP_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x26400)
...
...
@@ -187,9 +189,9 @@ static inline void mx27_setup_weimcs(size_t cs,
#define MX27_INT_EMMAPRP 51
#define MX27_INT_EMMAPP 52
#define MX27_INT_VPU 53
#define MX27_INT_USB
1
54
#define MX27_INT_USB
2
55
#define MX27_INT_USB
3
56
#define MX27_INT_USB
_HS1
54
#define MX27_INT_USB
_HS2
55
#define MX27_INT_USB
_OTG
56
#define MX27_INT_SCC_SMN 57
#define MX27_INT_SCC_SCM 58
#define MX27_INT_SAHARA 59
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录