From owner-freebsd-arm@FreeBSD.ORG Fri Mar 22 13:19:24 2013 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 60935D76 for ; Fri, 22 Mar 2013 13:19:24 +0000 (UTC) (envelope-from alexander.fedorov@rtlservice.com) Received: from mail-oa0-f44.google.com (mail-oa0-f44.google.com [209.85.219.44]) by mx1.freebsd.org (Postfix) with ESMTP id 3370F97E for ; Fri, 22 Mar 2013 13:19:24 +0000 (UTC) Received: by mail-oa0-f44.google.com with SMTP id h1so4306636oag.17 for ; Fri, 22 Mar 2013 06:19:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=lOqFegEMXy6FY2sPUtHp6MxkxfdDQNDtNOq6GQqHZJY=; b=T8qP54GhzsAreamWH9LgzN5+CUYaZ+KwEmF1qVFVbTDiBsfIW5YF/JvXDY/LXj6188 Kph2qhjqKFsPsqi3k07TYBglXI0AkyZiwSpL7BgNcU3N8thYd7csLgYs9AoJgIES7Gnq dIPRwWfpZb08f9HlLT+8vzcpertc06DuAXJzHp9v+CB796XL9KdfXUP3SuCpEuj40mh+ tWpMHvzM0xVMAo4I61QXddyZJ+NKZpn9GfoEkm4IS399dkL7VU3GlWfItIXpx9CkI7Ex MjwFVQJiRoEOH2xLunQgoeX6oT77XYQZNzlaRyTN+dVzEjKWdcY6TerKI81UR/sLEaC+ p6rw== MIME-Version: 1.0 X-Received: by 10.60.18.136 with SMTP id w8mr1738940oed.84.1363958363477; Fri, 22 Mar 2013 06:19:23 -0700 (PDT) Received: by 10.60.15.7 with HTTP; Fri, 22 Mar 2013 06:19:23 -0700 (PDT) Date: Fri, 22 Mar 2013 17:19:23 +0400 Message-ID: Subject: HACKBERRY USB problem From: Alexander Fedorov To: freebsd-arm@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQkI8k3JY8IGeoEoDeArNn2Du682/fxoCnVoNgKIg8QbT2SUGP7pyomlQf1ucMhdJQItpSKT X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Mar 2013 13:19:24 -0000 Hi all, I have a Miniand Hackberry board based on Allwinner A10 SOC: https://www.miniand.com/products/Hackberry%20A10%20Developer%20Board I'm trying to use kernel and FTD configuration from CUBIEBOARD. And, I have little problem with USB setup. The problem is, that Hackberry used different GPIO pin configuration to setup USB power. Also, on Hackberry board A10 USB Host controller connected to 4-port USB HUB (Genesys Logic GL850G), and it need properly power configuration too. I'm looking for pin configuration in FEX files. For CUBIEBOARD USB configuration is https://github.com/linux-sunxi/sunxi-boards/blob/master/sys_config/a10/cubieboard.fex: For Hackberry: https://github.com/linux-sunxi/sunxi-boards/blob/master/sys_config/a10/hackberry.fex And edit a10_ehci_attach function in sys/arm/allwiner/a10_echi.c file: /* Enable clock for USB */ a10_clk_usb_activate(); /* Give power to HUB pin PB09 (HACKBERRY) */ GPIO_PIN_SETFLAGS(sc_gpio_dev, 41, GPIO_PIN_OUTPUT); GPIO_PIN_SET(sc_gpio_dev, 41, GPIO_PIN_HIGH); /* Give power to USB */ // GPIO_PIN_SETFLAGS(sc_gpio_dev, GPIO_USB2_PWR, GPIO_PIN_OUTPUT); // GPIO_PIN_SET(sc_gpio_dev, GPIO_USB2_PWR, GPIO_PIN_HIGH); /* Give power to USB PH12 */ GPIO_PIN_SETFLAGS(sc_gpio_dev, 236, GPIO_PIN_OUTPUT); GPIO_PIN_SET(sc_gpio_dev, 236, GPIO_PIN_HIGH); /* Give power to USB */ GPIO_PIN_SETFLAGS(sc_gpio_dev, GPIO_USB1_PWR, GPIO_PIN_OUTPUT); // GPIO_PIN_SET(sc_gpio_dev, GPIO_USB1_PWR, GPIO_PIN_HIGH); GPIO_PIN_SET(sc_gpio_dev, GPIO_USB1_PWR, GPIO_PIN_LOW); Now, kernel can attach external USB devices witch some restrictions. When I plug USB-to-RS232 cable to board before give power, Genesys Logic don't attached. I think it's need properly reset sequence. However, it's work: ehci1: mem 0x1c1c000-0x1c1cfff irq 40 on simplebus0 usbus1: EHCI version 1.0 usbus1 on ehci1 uart0: <16750 or compatible> mem 0x1c28000-0x1c283ff irq 1 on simplebus0 uart0: console (115200,n,8,1) Timecounters tick every 10.000 msec usbus0: 480Mbps High Speed USB v2.0 usbus1: 480Mbps High Speed USB v2.0 WARNING: WITNESS option enabled, expect reduced performance. Root mount waiting for: usbus1 usbus0 ugen1.1: at usbus1 uhub0: on usbus1 ugen0.1: at usbus0 uhub1: on usbus0 uhub0: 1 port with 1 removable, self powered uhub1: 1 port with 1 removable, self powered Root mount waiting for: usbus1 usbus0 ugen1.2: at usbus1 ugen0.2: at usbus0 uhub2: on usbus0 uhub2: 4 ports with 4 removable, self powered Root mount waiting for: usbus0 Root mount waiting for: usbus0 ugen0.3: at usbus0 umass0: on usbus0 umass0: SCSI over Bulk-Only; quirks = 0x0100 umass0:0:0:-1: Attached to scbus0 Root mount waiting for: usbus0 da0 at umass-sim0 bus 0 scbus0 target 0 lun 0 da0: Removable Direct Access SCSI-4 device da0: 40.000MB/s transfers da0: 7725MB (15820800 512 byte sectors: 255H 63S/T 984C) Trying to mount root from ufs:/dev/da0s2 []... WARNING: / was not properly dismounted But, I think it's not good to edit ECHI driver. Where is the right place in sources to put various board specific pin settings and external chips configuration logic? Alexander Fedorov