Date: Fri, 22 Mar 2013 22:01:40 +0800 From: Ganbold Tsagaankhuu <ganbold@gmail.com> To: Alexander Fedorov <alexander.fedorov@rtlservice.com> Cc: freebsd-arm@freebsd.org Subject: Re: HACKBERRY USB problem Message-ID: <CAGtf9xPCJGzef28WQsxPaLrmTYQ4b8E04j4%2BEPp0RAzC3uwT0Q@mail.gmail.com> In-Reply-To: <CAOcOT_wuN7kS7xy3UCp_2AUTzySNY6Xc8bv5iWxBpW%2BFgRSz1w@mail.gmail.com> References: <CAOcOT_wuN7kS7xy3UCp_2AUTzySNY6Xc8bv5iWxBpW%2BFgRSz1w@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Mar 22, 2013 at 9:19 PM, Alexander Fedorov <alexander.fedorov@rtlservice.com> wrote: > 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: <Allwinner Integrated USB 2.0 controller> 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: <Allwinner> at usbus1 > uhub0: <Allwinner EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on > usbus1 > ugen0.1: <Allwinner> at usbus0 > uhub1: <Allwinner EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> 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: <Realtek> at usbus1 > ugen0.2: <Genesys Logic> at usbus0 > uhub2: <Genesys Logic USB2.0 Hub, class 9/0, rev 2.00/77.64, addr 2> > on usbus0 > uhub2: 4 ports with 4 removable, self powered > Root mount waiting for: usbus0 > Root mount waiting for: usbus0 > ugen0.3: <JetFlash> at usbus0 > umass0: <JetFlash Mass Storage Device, class 0/0, rev 2.00/11.00, addr > 3> 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: <JetFlash Transcend 8GB 1100> 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? It seems like hackberry's usb2 gpio pin is different than cubieboard one. Did you try to use 2 usb devices for both usb port same time? Somehow I observed both works at boot time, but had some problem attaching after boot. I never managed to make usb0 work, since it supports both host and otg mode in cubieboard. As some docs say it is based on MentorGraphics USB-OTG IP and currently iirc we only have support of otg mode in musb. gonzo@ may be working on improving musb driver some time ago, so he maybe has better ideas. As for pins, probably right place would be the dts, where we should separate hackberry and cubieboard specific configs and make general config for sun4i's SoC. Ganbold > > Alexander Fedorov > _______________________________________________ > freebsd-arm@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGtf9xPCJGzef28WQsxPaLrmTYQ4b8E04j4%2BEPp0RAzC3uwT0Q>