Цитата(impatt @ May 13 2008, 15:35)

Спасибо
Решено
--- ./colibri.c_ 2008-05-15 17:03:07.454922056 +0600
+++ ./colibri.c 2008-05-15 17:05:48.795740621 +0600
@@ -27,6 +27,7 @@
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/irq.h>
+#include <asm/arch/ohci.h>
#include <asm/mach/flash.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/colibri.h>
@@ -113,12 +114,49 @@
&dm9000_device,
};
+/*
+ * USB Host (OHCI)
+ */
+
+#define SPITZ_GPIO_USB_HOST (37)
+#define SPITZ_GPIO_USB_CONNECT (41)
+#define SPITZ_GPIO_USB_DEVICE (35)
+
+
+static int spitz_ohci_init(struct device *dev)
+{
+ /* Only Port 2 is connected */
+ pxa_gpio_mode(SPITZ_GPIO_USB_CONNECT | GPIO_IN);
+ pxa_gpio_mode(SPITZ_GPIO_USB_HOST | GPIO_OUT);
+ pxa_gpio_mode(SPITZ_GPIO_USB_DEVICE | GPIO_IN);
+
+ /* Setup USB Port 2 Output Control Register */
+ UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
+
+ GPSR(SPITZ_GPIO_USB_HOST) = GPIO_bit(SPITZ_GPIO_USB_HOST);
+
+ UHCHR = (UHCHR) &
+ ~(UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSEP3 | UHCHR_SSE);
+
+ UHCRHDA |= UHCRHDA_NOCP;
+
+ return 0;
+}
+
+static struct pxaohci_platform_data spitz_ohci_platform_data = {
+ .port_mode = PMM_NPS_MODE,
+ .init = spitz_ohci_init,
+ .power_budget = 150,
+};
+
static void __init colibri_init(void)
{
/* DM9000 LAN */
pxa_gpio_mode(GPIO78_nCS_2_MD);
pxa_gpio_mode(GPIO_DM9000 | GPIO_IN);
set_irq_type(COLIBRI_ETH_IRQ, IRQT_FALLING);
+ /*OHCI init*/
+ pxa_set_ohci_info(&spitz_ohci_platform_data);
platform_add_devices(colibri_devices, ARRAY_SIZE(colibri_devices));
}