how to support usbtty

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

how to support usbtty

zhuzhenhua
becides set CONFIG_USB_TTY, what other modification need to do for the
usbtty support?

thanks for any hints


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
U-Boot-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/u-boot-users
Reply | Threaded
Open this post in threaded view
|

Re: how to support usbtty

Wolfgang Denk
In message <[hidden email]> you wrote:
> becides set CONFIG_USB_TTY, what other modification need to do for the
> usbtty support?

You will probably have  to  adapt  "drivers/usbtty.c";  so  far  it's
pretty omap1510-specifc. Also, you may have to write your own USB bus
interface driver (see drivers/usbdcore_omap1510.c).

Best regards,

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [hidden email]
"No matter where you go, there you are..."          - Buckaroo Banzai


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
U-Boot-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/u-boot-users
Reply | Threaded
Open this post in threaded view
|

Re: how to support usbtty

mikezh
Any document on how to use usbtty?

I have a USB-RS232 cable to convert the USB port into a RS232 port. Do I need any driver? What environment variable shall I set?


wd wrote
In message <50c9a225050922202647e885fe@mail.gmail.com> you wrote:
> becides set CONFIG_USB_TTY, what other modification need to do for the
> usbtty support?

You will probably have  to  adapt  "drivers/usbtty.c";  so  far  it's
pretty omap1510-specifc. Also, you may have to write your own USB bus
interface driver (see drivers/usbdcore_omap1510.c).

Best regards,

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
"No matter where you go, there you are..."          - Buckaroo Banzai


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users
Reply | Threaded
Open this post in threaded view
|

how to support usbtty

mikezh
In reply to this post by Wolfgang Denk

Any document on how to use usbtty?

I have a USB-RS232 cable to convert the USB port into a RS232 port. Do I
need any driver? What environment variable shall I set?



wd wrote:

>
> In message <50c9a225050922202647e885fe at mail.gmail.com> you wrote:
>> becides set CONFIG_USB_TTY, what other modification need to do for the
>> usbtty support?
>
> You will probably have  to  adapt  "drivers/usbtty.c";  so  far  it's
> pretty omap1510-specifc. Also, you may have to write your own USB bus
> interface driver (see drivers/usbdcore_omap1510.c).
>
> Best regards,
>
> Wolfgang Denk
>
> --
> Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> "No matter where you go, there you are..."          - Buckaroo Banzai
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server.
> Download
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
>
>

--
View this message in context: http://www.nabble.com/how-to-support-usbtty-tp936753p19167791.html
Sent from the Uboot - Users mailing list archive at Nabble.com.


Reply | Threaded
Open this post in threaded view
|

Re: [U-Boot] how to support usbtty

Wolfgang Denk
In reply to this post by mikezh
Dear mikezh,

In message <[hidden email]> you wrote:
>
> Any document on how to use usbtty?

Did you read the README?

You enable it using the commands "setenv stdout usbtty; setenv stdin usbtty"


> I have a USB-RS232 cable to convert the USB port into a RS232 port. Do I
> need any driver? What environment variable shall I set?

If you want to attach the cable to a USB port on the target that runs
U-Boot, you obviously  need  the  matching  usbtty  driver  for  your
hardware.


Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [hidden email]
God made the integers; all else is the work of Man.       - Kronecker
_______________________________________________
U-Boot mailing list
[hidden email]
http://lists.denx.de/mailman/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

Re: [U-Boot] how to support usbtty

mikezh
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".

Or is there any other solution for me? I don't have to use the
USB-RS232 cable. I just need the Uboot console from USB port.

Thanks,

On 8/26/08, Wolfgang Denk <[hidden email]> wrote:

> Dear mikezh,
>
> In message <[hidden email]> you wrote:
> >
> > Any document on how to use usbtty?
>
> Did you read the README?
>
> You enable it using the commands "setenv stdout usbtty; setenv stdin usbtty"
>
>
> > I have a USB-RS232 cable to convert the USB port into a RS232 port. Do I
> > need any driver? What environment variable shall I set?
>
> If you want to attach the cable to a USB port on the target that runs
> U-Boot, you obviously  need  the  matching  usbtty  driver  for  your
> hardware.
>
>
> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [hidden email]
> God made the integers; all else is the work of Man.       - Kronecker
>
_______________________________________________
U-Boot mailing list
[hidden email]
http://lists.denx.de/mailman/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

Re: [U-Boot] how to support usbtty

Bryan O'Donoghue-2
On Wed, 27 Aug 2008 10:20:58 -0400
"mike zheng" <[hidden email]> 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
_______________________________________________
U-Boot mailing list
[hidden email]
http://lists.denx.de/mailman/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

Re: [U-Boot] how to support usbtty

Bryan O'Donoghue-2
In reply to this post by mikezh
On Wed, 27 Aug 2008 10:20:58 -0400
"mike zheng" <[hidden email]> wrote:

> Or is there any other solution for me? I don't have to use the
> USB-RS232 cable. I just need the Uboot console from USB port.

One more thing.

If the isp1561 supports "slave" mode - you can implement usbdcore_isp1561.c and
add fdti to usbtty... otherwise as previously stated you'll have to munge
something on top of some host controller code, and then plug that into the
serial layer independently.


--
BOD
_______________________________________________
U-Boot mailing list
[hidden email]
http://lists.denx.de/mailman/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

Re: [U-Boot] how to support usbtty

mikezh
Hi Bryan,

The USB/RS232 cable is a USB device, it shall has firmware in it,
which works as a USB slave. What I need to do is have some code talk
to this device via the Host controller - ISP1561. So, I need some code
as usb-storage.c, maybe called usb-serial.c.


I am not sure how "usbtty" being used. Is it used when there is a
USB/USB cable connected between the target and PC? Both ends of the
cable are USB port, the PC end is a master, the target end is the
slave. So usbtty running on the target is acting as the USB device.
However it is not my case. The cable I have has one USB end, and one
RS232 end. The USB end is connected to the target. I assume there is
something in the chip within the cable acts as a USB slave device
already.

Thanks,

Mike

On 8/27/08, Bryan O'Donoghue <[hidden email]> wrote:

> On Wed, 27 Aug 2008 10:20:58 -0400
> "mike zheng" <[hidden email]> wrote:
>
> > Or is there any other solution for me? I don't have to use the
> > USB-RS232 cable. I just need the Uboot console from USB port.
>
> One more thing.
>
> If the isp1561 supports "slave" mode - you can implement usbdcore_isp1561.c and
> add fdti to usbtty... otherwise as previously stated you'll have to munge
> something on top of some host controller code, and then plug that into the
> serial layer independently.
>
>
> --
> BOD
>
_______________________________________________
U-Boot mailing list
[hidden email]
http://lists.denx.de/mailman/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

Re: [U-Boot] how to support usbtty

Bryan O'Donoghue-2
On Fri, 29 Aug 2008 11:53:45 -0400
"mike zheng" <[hidden email]> wrote:

> Hi Bryan,
>
> The USB/RS232 cable is a USB device, it shall has firmware in it,
> which works as a USB slave. What I need to do is have some code talk
> to this device via the Host controller - ISP1561. So, I need some code
> as usb-storage.c, maybe called usb-serial.c.

Almost certainly.

> I am not sure how "usbtty" being used. Is it used when there is a
> USB/USB cable connected between the target and PC?

Yes. Think of usbtty being equivalent to the firmware that runs inside of that
USB/RS232 cable you have.

It allows u-boot to be a USB slave and provide a console interface over the
USB, to a USB host somewhere.

> Both ends of the
> cable are USB port, the PC end is a master, the target end is the
> slave. So usbtty running on the target is acting as the USB device.
> However it is not my case. The cable I have has one USB end, and one
> RS232 end.

Understood.

> The USB end is connected to the target. I assume there is
> something in the chip within the cable acts as a USB slave device
> already.

A bit of firmware implementing either some FDTI-specific USB protocol stuff to
emulate UART over the USB, or just simply following the USB standard for this
=> cdc-acm.

And again you're right - you'll need to be implementing a host side USB serial
driver for u-boot.

Alternatively if the ISP1561 can do device mode - you could have your PC be
master and just implement the usbdcore_isp1561.c for u-boot and then use either
the usbserial or cdc-acm USB protocol to talk to the USB host. In this case you
could use the code in usbtty to plug into the u-boot console system - and just
implement whatever is required to make the isp1561 be a well behaved u-boot USB
slave.

Most embedded USB transceivers these days to both host and slave - so it'd
probably be worth looking into this option ?

In either case it might be interesting to plug your host-side stuff into
usbtty.c in u-boot - though it's unclear to me if there'd be more or less pain
for you in the long run !

 --
Bryan
_______________________________________________
U-Boot mailing list
[hidden email]
http://lists.denx.de/mailman/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

Re: [U-Boot] how to support usbtty

mikezh
On 8/30/08, Bryan O'Donoghue <[hidden email]> wrote:

> On Fri, 29 Aug 2008 11:53:45 -0400
> "mike zheng" <[hidden email]> wrote:
>
> > Hi Bryan,
> >
> > The USB/RS232 cable is a USB device, it shall has firmware in it,
> > which works as a USB slave. What I need to do is have some code talk
> > to this device via the Host controller - ISP1561. So, I need some code
> > as usb-storage.c, maybe called usb-serial.c.
>
> Almost certainly.
>
> > I am not sure how "usbtty" being used. Is it used when there is a
> > USB/USB cable connected between the target and PC?
>
> Yes. Think of usbtty being equivalent to the firmware that runs inside of that
> USB/RS232 cable you have.
>
> It allows u-boot to be a USB slave and provide a console interface over the
> USB, to a USB host somewhere.
>
> > Both ends of the
> > cable are USB port, the PC end is a master, the target end is the
> > slave. So usbtty running on the target is acting as the USB device.
> > However it is not my case. The cable I have has one USB end, and one
> > RS232 end.
>
> Understood.
>
> > The USB end is connected to the target. I assume there is
> > something in the chip within the cable acts as a USB slave device
> > already.
>
> A bit of firmware implementing either some FDTI-specific USB protocol stuff to
> emulate UART over the USB, or just simply following the USB standard for this
> => cdc-acm.
>
> And again you're right - you'll need to be implementing a host side USB serial
> driver for u-boot.
>
> Alternatively if the ISP1561 can do device mode - you could have your PC be
> master and just implement the usbdcore_isp1561.c for u-boot and then use either
> the usbserial or cdc-acm USB protocol to talk to the USB host. In this case you
> could use the code in usbtty to plug into the u-boot console system - and just
> implement whatever is required to make the isp1561 be a well behaved u-boot USB
> slave.
>
> Most embedded USB transceivers these days to both host and slave - so it'd
> probably be worth looking into this option ?
>
> In either case it might be interesting to plug your host-side stuff into
> usbtty.c in u-boot - though it's unclear to me if there'd be more or less pain
> for you in the long run !
>
>  --
> Bryan
>
I will try a standalone host side USB serial driver for u-boot at first.

For the alternatively solution, it is very interesting. Then we don't
need the USB/RS232 convertor at all. Just a USB/USB cable connect PC
and target with Uboot.  I just wonder anyone tried the usbtty.c on a
target with MPC85xx processor? What OS on PC has been verified,
Windows or Linux? Is there any document on it?

Cheers,

Mike
_______________________________________________
U-Boot mailing list
[hidden email]
http://lists.denx.de/mailman/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

Re: [U-Boot] how to support usbtty

Bryan O'Donoghue-2
> I just wonder anyone tried the usbtty.c on a
> target with MPC85xx processor? What OS on PC has been verified,
> Windows or Linux? Is there any document on it?


Not with that processor specifically.

Linux and Windows both support cdc-acm, though you do have to install the
CDC-ACM driver on Windows from .cab files.

Linux supports usbserial but, Windows, does not.

_______________________________________________
U-Boot mailing list
[hidden email]
http://lists.denx.de/mailman/listinfo/u-boot