summaryrefslogtreecommitdiffstats
path: root/board
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-09-09 11:32:05 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2009-09-09 11:51:07 +0200
commit4f23f9cd55a9a1c3121669967dfca6ac4d566958 (patch)
treedb8b875125e8bcae946dcdeb4596c70e2b1c8fdb /board
parent019b16fd5f715044a0cce7a2870c8cf584da854a (diff)
downloadbarebox-4f23f9cd55a9a1c3121669967dfca6ac4d566958.tar.gz
barebox-4f23f9cd55a9a1c3121669967dfca6ac4d566958.tar.xz
pca100: Add USB host support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'board')
-rw-r--r--board/phycard-i.MX27/pca100.c58
1 files changed, 54 insertions, 4 deletions
diff --git a/board/phycard-i.MX27/pca100.c b/board/phycard-i.MX27/pca100.c
index 14ab99d4e2..e461a60f2a 100644
--- a/board/phycard-i.MX27/pca100.c
+++ b/board/phycard-i.MX27/pca100.c
@@ -38,6 +38,7 @@
#include <asm/arch/imx-pll.h>
#include <gpio.h>
#include <asm/mmu.h>
+#include <usb/isp1504.h>
static struct memory_platform_data ram_pdata = {
.name = "ram0",
@@ -73,6 +74,37 @@ static struct device_d nand_dev = {
.platform_data = &nand_info,
};
+#ifdef CONFIG_USB
+static struct device_d usbh2_dev = {
+ .name = "ehci",
+ .map_base = IMX_OTG_BASE + 0x400,
+ .size = 0x200,
+};
+
+static void pca100_usbh_init(void)
+{
+ uint32_t temp;
+
+ temp = readl(IMX_OTG_BASE + 0x600);
+ temp &= ~((3 << 21) | 1);
+ temp |= (1 << 5) | (1 << 16) | (1 << 19) | (1 << 20);
+ writel(temp, IMX_OTG_BASE + 0x600);
+
+ temp = readl(IMX_OTG_BASE + 0x584);
+ temp &= ~(3 << 30);
+ temp |= 2 << 30;
+ writel(temp, IMX_OTG_BASE + 0x584);
+
+ mdelay(10);
+
+ imx_gpio_direction_output(GPIO_PORTB + 24, 0);
+
+ mdelay(10);
+
+ isp1504_set_vbus_power((void *)(IMX_OTG_BASE + 0x570), 1);
+}
+#endif
+
#ifdef CONFIG_MMU
static void pca100_mmu_init(void)
{
@@ -131,24 +163,42 @@ static int pca100_devices_init(void)
PD29_PF_CSPI1_SCLK,
PD30_PF_CSPI1_MISO,
PD31_PF_CSPI1_MOSI,
+ /* USB host 2 */
+ PA0_PF_USBH2_CLK,
+ PA1_PF_USBH2_DIR,
+ PA2_PF_USBH2_DATA7,
+ PA3_PF_USBH2_NXT,
+ PA4_PF_USBH2_STP,
+ PD19_AF_USBH2_DATA4,
+ PD20_AF_USBH2_DATA3,
+ PD21_AF_USBH2_DATA6,
+ PD22_AF_USBH2_DATA0,
+ PD23_AF_USBH2_DATA2,
+ PD24_AF_USBH2_DATA1,
+ PD26_AF_USBH2_DATA5,
};
- /* initizalize gpios */
- for (i = 0; i < ARRAY_SIZE(mode); i++)
- imx_gpio_mode(mode[i]);
-
/* disable the usb phys */
imx_gpio_mode((GPIO_PORTB | 23) | GPIO_GPIO | GPIO_IN);
imx_gpio_direction_output(GPIO_PORTB + 23, 1);
imx_gpio_mode((GPIO_PORTB | 24) | GPIO_GPIO | GPIO_IN);
imx_gpio_direction_output(GPIO_PORTB + 24, 1);
+ /* initizalize gpios */
+ for (i = 0; i < ARRAY_SIZE(mode); i++)
+ imx_gpio_mode(mode[i]);
+
register_device(&nand_dev);
register_device(&sdram_dev);
register_device(&fec_dev);
PCCR1 |= PCCR1_PERCLK2_EN;
+#ifdef CONFIG_USB
+ pca100_usbh_init();
+ register_device(&usbh2_dev);
+#endif
+
nand = get_device_by_name("nand0");
devfs_add_partition("nand0", 0x00000, 0x40000, PARTITION_FIXED, "self_raw");
dev_add_bb_dev("self_raw", "self0");