[U-Boot] how to support usbtty

Bryan O'Donoghue bodonoghue at codehermit.ie
Wed Aug 27 19:09:35 CEST 2008


On Wed, 27 Aug 2008 10:20:58 -0400
"mike zheng" <mail4mz at gmail.com> wrote:

> I am using an embedded system with MPC8567 as processor and ISP1561 as
> USB PCI host controller. There is USB port on this board. A sealevel
> USB/RS232 cable is connect to the USB port on the board, and it
> converts USB port into RS232 port. A PC is connected to the RS232 end
> of the cable.
> 
> With "CONFIG_USB_SERIAL_FTDI_SIO" flag enabled, I compiled the Linux
> kernel. Everything works fine, I am able to launch the hyperterminal
> on PC and have the console running for Linux.
> 
> Now I need make things working for Uboot. I've already have the EHCI
> host controller running well on the board.
> 
> Please correct me if my understanding is incorrect. What I need to do
> is to port the FTDI_SIO driver from Linux to Uboot, which replace
> those "udc" calls in usbtty.c. With the ported FTDI_SIO code and
> existing usbtty.c. It shall work fine after correct setup of the
> environment variables - "setenv stdin usbtty, setenv stdout usbtty".


That really depends on what you mean by "replace".

usbtty at this moment in time is slave only. What you are describing is having
u-boot be a USB host, and control a usbserial device attached to the
u-boot/host.

usbtty - is basically analogous to the firmware that would run inside of your
USB-2-RS232 cable, in that it - uboot- is a USB slave, at the usbtty layer.

Not that I've looked in detail but, whatever way USB sticks are controlled by
USB hosts in u-boot would be closer to what you'd need to do to support having
a USB-slave tty device attached to your board, then subsequently you'd plug
this into the serial layer of u-boot.

Possibly you could add the usbserial and cdc-acm protocols supported in
usbtty.. depending .. but, it's important to be aware that usbtty in u-boot is
a slave oriented thing.

For the case above - you'd need to implement drivers/usbdcore_isp1561.c -
but .. this would have to be a USB host... not a slave.

Since a USB host model already exists in u-boot - I'm not sure making
usbdcore_isp1561.c would be a wise or acceptable choice.

For example usbdcore_mpc8xx.c and it's sibling usbdcore_omap1510.c - enumerate
a USB host... - they're completely slave oriented... whereas - you need for
u-boot to be the host like drivers/usb/isp116x-hcd.c (perhaps a isp1516-hcd.c is
required), then you need to plug your FTDI stuff on top of that, then you need
to plug that into the u-boot serial layer, somehow...

Sure it might be possible and appropriate to have
[usbtty.c=>fdti]=>isp1516-hdc.c but, the low-level USB twiddling you need to
do at the host controller level will be quite different for the host - which is
what I think you need to do... in comparison to the slave - which is what
usbdcore_mpc8xx.c and usbdcore_omap1510.c are.


Greetings,
Bryan


More information about the U-Boot mailing list