summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2011-07-23 08:08:15 +0800
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2011-07-29 14:05:22 +0800
commitee80cbcd61fdad8b6b75be23b8417dc1dc188d59 (patch)
tree358f1ac445640d172eb2ecdbec006d26b1f1a7fc /arch/arm/boards
parent06c36cf09e08cfd054c2d1e61be8492c4e5dc929 (diff)
downloadbarebox-ee80cbcd61fdad8b6b75be23b8417dc1dc188d59.tar.gz
barebox-ee80cbcd61fdad8b6b75be23b8417dc1dc188d59.tar.xz
resource: introduce add_usb_ehci_device to register echi device
pass the hccr and hcor register base via resource instroduce add_generic_usb_echi_device with hccr = base + 0x100 and hcor = base + 0x140 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'arch/arm/boards')
-rw-r--r--arch/arm/boards/chumby_falconwing/falconwing.c17
-rw-r--r--arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c8
-rw-r--r--arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c9
-rw-r--r--arch/arm/boards/freescale-mx25-3-stack/3stack.c9
-rw-r--r--arch/arm/boards/guf-neso/board.c10
-rw-r--r--arch/arm/boards/omap/board-beagle.c13
-rw-r--r--arch/arm/boards/panda/board.c18
-rw-r--r--arch/arm/boards/pcm037/pcm037.c18
-rw-r--r--arch/arm/boards/pcm038/pcm038.c9
-rw-r--r--arch/arm/boards/phycard-i.MX27/pca100.c18
10 files changed, 20 insertions, 109 deletions
diff --git a/arch/arm/boards/chumby_falconwing/falconwing.c b/arch/arm/boards/chumby_falconwing/falconwing.c
index 7a5f37e91b..5875955990 100644
--- a/arch/arm/boards/chumby_falconwing/falconwing.c
+++ b/arch/arm/boards/chumby_falconwing/falconwing.c
@@ -327,20 +327,6 @@ static int register_persistant_environment(void)
return devfs_add_partition("disk0.1", 0, cdev->size, DEVFS_PARTITION_FIXED, "env0");
}
-static struct ehci_platform_data chumby_usb_pdata = {
- .flags = EHCI_HAS_TT,
- .hccr_offset = 0x100,
- .hcor_offset = 0x140,
-};
-
-static struct device_d usb_dev = {
- .name = "ehci",
- .id = -1,
- .map_base = IMX_USB_BASE,
- .size = 0x200,
- .platform_data = &chumby_usb_pdata,
-};
-
#define GPIO_USB_HUB_RESET 29
#define GPIO_USB_HUB_POWER 26
@@ -353,7 +339,8 @@ static void falconwing_init_usb(void)
gpio_direction_output(GPIO_USB_HUB_RESET, 1);
imx_usb_phy_enable();
- register_device(&usb_dev);
+
+ add_generic_usb_ehci_device(-1, IMX_USB_BASE, NULL);
}
static int falconwing_devices_init(void)
diff --git a/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c b/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c
index d7978465f0..ecb5a386df 100644
--- a/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c
+++ b/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c
@@ -149,12 +149,6 @@ static void imx25_usb_init(void)
writel(tmp | 0x3, IMX_OTG_BASE + 0x5a8);
}
-static struct device_d usbh2_dev = {
- .id = -1,
- .name = "ehci",
- .map_base = IMX_OTG_BASE + 0x400,
- .size = 0x200,
-};
#endif
static struct fsl_usb2_platform_data usb_pdata = {
@@ -284,7 +278,7 @@ static int eukrea_cpuimx25_devices_init(void)
#ifdef CONFIG_USB
imx25_usb_init();
- register_device(&usbh2_dev);
+ add_generic_usb_ehci_device(-1, IMX_OTG_BASE + 0x400, NULL);
#endif
register_device(&usbotg_dev);
diff --git a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
index 7f941cc242..c1fe144300 100644
--- a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
+++ b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
@@ -117,13 +117,6 @@ static void imx35_usb_init(void)
tmp = readl(IMX_OTG_BASE + 0x5a8);
writel(tmp | 0x3, IMX_OTG_BASE + 0x5a8);
}
-
-static struct device_d usbh2_dev = {
- .id = -1,
- .name = "ehci",
- .map_base = IMX_OTG_BASE + 0x400,
- .size = 0x200,
-};
#endif
#ifdef CONFIG_USB_GADGET
@@ -183,7 +176,7 @@ static int eukrea_cpuimx35_devices_init(void)
#ifdef CONFIG_USB
imx35_usb_init();
- register_device(&usbh2_dev);
+ add_generic_usb_ehci_device(-1, IMX_OTG_BASE + 0x400, NULL);
#endif
#ifdef CONFIG_USB_GADGET
/* Workaround ENGcm09152 */
diff --git a/arch/arm/boards/freescale-mx25-3-stack/3stack.c b/arch/arm/boards/freescale-mx25-3-stack/3stack.c
index f71cb4b3d7..3902ccfc7d 100644
--- a/arch/arm/boards/freescale-mx25-3-stack/3stack.c
+++ b/arch/arm/boards/freescale-mx25-3-stack/3stack.c
@@ -138,13 +138,6 @@ static void imx25_usb_init(void)
tmp = readl(IMX_OTG_BASE + 0x5a8);
writel(tmp | 0x3, IMX_OTG_BASE + 0x5a8);
}
-
-static struct device_d usbh2_dev = {
- .id = -1,
- .name = "ehci",
- .map_base = IMX_OTG_BASE + 0x400,
- .size = 0x200,
-};
#endif
static struct i2c_board_info i2c_devices[] = {
@@ -208,7 +201,7 @@ static int imx25_devices_init(void)
* the CPLD has to be initialized.
*/
imx25_usb_init();
- register_device(&usbh2_dev);
+ add_generic_usb_ehci_device(-1, IMX_OTG_BASE + 0x400, NULL);
#endif
imx25_iim_register_fec_ethaddr();
diff --git a/arch/arm/boards/guf-neso/board.c b/arch/arm/boards/guf-neso/board.c
index 4e0ac9008e..f3a4635980 100644
--- a/arch/arm/boards/guf-neso/board.c
+++ b/arch/arm/boards/guf-neso/board.c
@@ -114,14 +114,6 @@ static struct imx_fb_platform_data neso_fb_data = {
};
#ifdef CONFIG_USB
-
-static struct device_d usbh2_dev = {
- .id = -1,
- .name = "ehci",
- .map_base = IMX_OTG_BASE + 0x400,
- .size = 0x200,
-};
-
static void neso_usbh_init(void)
{
uint32_t temp;
@@ -304,7 +296,7 @@ static int neso_devices_init(void)
#ifdef CONFIG_USB
neso_usbh_init();
- register_device(&usbh2_dev);
+ add_generic_usb_ehci_device(-1, IMX_OTG_BASE + 0x400, NULL);
#endif
imx27_add_fec(&fec_info);
diff --git a/arch/arm/boards/omap/board-beagle.c b/arch/arm/boards/omap/board-beagle.c
index 191496a28f..dcf2d72a90 100644
--- a/arch/arm/boards/omap/board-beagle.c
+++ b/arch/arm/boards/omap/board-beagle.c
@@ -271,16 +271,6 @@ static struct omap_hcd omap_ehci_pdata = {
static struct ehci_platform_data ehci_pdata = {
.flags = 0,
- .hccr_offset = 0x100,
- .hcor_offset = 0x110,
-};
-
-static struct device_d usbh_dev = {
- .id = -1,
- .name = "ehci",
- .map_base = 0x48064700,
- .size = 4 * 1024,
- .platform_data = &ehci_pdata,
};
#endif /* CONFIG_USB_EHCI_OMAP */
@@ -318,7 +308,8 @@ static int beagle_devices_init(void)
#ifdef CONFIG_USB_EHCI_OMAP
if (ehci_omap_init(&omap_ehci_pdata) >= 0)
- register_device(&usbh_dev);
+ add_usb_ehci_device(-1, 0x48064700 + 0x100,
+ 0x48064700 + 0x110, &ehci_pdata);
#endif /* CONFIG_USB_EHCI_OMAP */
#ifdef CONFIG_GPMC
/* WP is made high and WAIT1 active Low */
diff --git a/arch/arm/boards/panda/board.c b/arch/arm/boards/panda/board.c
index 1c6cf587f9..de43ca5b8b 100644
--- a/arch/arm/boards/panda/board.c
+++ b/arch/arm/boards/panda/board.c
@@ -61,18 +61,9 @@ static int panda_mmu_init(void)
device_initcall(panda_mmu_init);
#endif
+#ifdef CONFIG_USB_EHCI
static struct ehci_platform_data ehci_pdata = {
.flags = 0,
- .hccr_offset = 0x0,
- .hcor_offset = 0x10,
-};
-
-static struct device_d usbh_dev = {
- .id = -1,
- .name = "ehci",
- .map_base = 0x4a064c00,
- .size = 4 * 1024,
- .platform_data = &ehci_pdata,
};
static void panda_ehci_init(void)
@@ -105,8 +96,13 @@ static void panda_ehci_init(void)
/* enable power to hub */
gpio_set_value(GPIO_HUB_POWER, 1);
- register_device(&usbh_dev);
+ add_usb_ehci_device(-1, 0x4a064c00,
+ 0x4a064c00 + 0x10, &ehci_pdata);
}
+#else
+static void panda_ehci_init(void)
+{}
+#endif
static void __init panda_boardrev_init(void)
{
diff --git a/arch/arm/boards/pcm037/pcm037.c b/arch/arm/boards/pcm037/pcm037.c
index 446add85f5..f4b44444a9 100644
--- a/arch/arm/boards/pcm037/pcm037.c
+++ b/arch/arm/boards/pcm037/pcm037.c
@@ -58,20 +58,6 @@ struct imx_nand_platform_data nand_info = {
};
#ifdef CONFIG_USB
-static struct device_d usbotg_dev = {
- .id = -1,
- .name = "ehci",
- .map_base = IMX_OTG_BASE,
- .size = 0x200,
-};
-
-static struct device_d usbh2_dev = {
- .id = -1,
- .name = "ehci",
- .map_base = IMX_OTG_BASE + 0x400,
- .size = 0x200,
-};
-
static void pcm037_usb_init(void)
{
u32 tmp;
@@ -245,8 +231,8 @@ static int imx31_devices_init(void)
#endif
#ifdef CONFIG_USB
pcm037_usb_init();
- register_device(&usbotg_dev);
- register_device(&usbh2_dev);
+ add_generic_usb_ehci_device(-1, IMX_OTG_BASE, NULL);
+ add_generic_usb_ehci_device(-1, IMX_OTG_BASE + 0x400, NULL);
#endif
armlinux_set_bootparams((void *)0x80000100);
diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
index 2f87b12458..02c3dba8b3 100644
--- a/arch/arm/boards/pcm038/pcm038.c
+++ b/arch/arm/boards/pcm038/pcm038.c
@@ -109,13 +109,6 @@ static struct imx_fb_platform_data pcm038_fb_data = {
};
#ifdef CONFIG_USB
-static struct device_d usbh2_dev = {
- .id = -1,
- .name = "ehci",
- .map_base = IMX_OTG_BASE + 0x400,
- .size = 0x200,
-};
-
static void pcm038_usbh_init(void)
{
uint32_t temp;
@@ -271,7 +264,7 @@ static int pcm038_devices_init(void)
#ifdef CONFIG_USB
pcm038_usbh_init();
- register_device(&usbh2_dev);
+ add_generic_usb_ehci_device(-1, IMX_OTG_BASE + 0x400, NULL);
#endif
/* Register the fec device after the PLL re-initialisation
diff --git a/arch/arm/boards/phycard-i.MX27/pca100.c b/arch/arm/boards/phycard-i.MX27/pca100.c
index 74af774b57..9a10a9d28a 100644
--- a/arch/arm/boards/phycard-i.MX27/pca100.c
+++ b/arch/arm/boards/phycard-i.MX27/pca100.c
@@ -53,20 +53,6 @@ struct imx_nand_platform_data nand_info = {
};
#ifdef CONFIG_USB
-static struct device_d usbotg_dev = {
- .id = -1,
- .name = "ehci",
- .map_base = IMX_OTG_BASE,
- .size = 0x200,
-};
-
-static struct device_d usbh2_dev = {
- .id = -1,
- .name = "ehci",
- .map_base = IMX_OTG_BASE + 0x400,
- .size = 0x200,
-};
-
static void pca100_usb_register(void)
{
mdelay(10);
@@ -77,9 +63,9 @@ static void pca100_usb_register(void)
mdelay(10);
isp1504_set_vbus_power((void *)(IMX_OTG_BASE + 0x170), 1);
- register_device(&usbotg_dev);
+ add_generic_usb_ehci_device(-1, IMX_OTG_BASE, NULL);
isp1504_set_vbus_power((void *)(IMX_OTG_BASE + 0x570), 1);
- register_device(&usbh2_dev);
+ add_generic_usb_ehci_device(-1, IMX_OTG_BASE + 0x400, NULL);
}
#endif