All of lore.kernel.org
 help / color / mirror / Atom feed
* Questions about usb to serial driver
@ 2022-07-01  3:16 Neal Liu
  2022-07-01  7:16 ` gregkh
  0 siblings, 1 reply; 5+ messages in thread
From: Neal Liu @ 2022-07-01  3:16 UTC (permalink / raw)
  To: linux-usb, linux-serial, gregkh

Hi all,

I have a question about USB-serial and I hope I can find the answer from here.
I'll be appreciated it if there is any feedback from you.

My question is If I have a USB device controller (udc) and a uart controller (16550) independently in a SoC,
is there any usb-serial drivers or applications that could possible to support/connect:
-	udc tx to uart rx
-	uart tx to udc rx

Any chance I can make this SoC as a usb-serial devices?
Is there any exist drivers or applications I can reference it?
Thanks

Best Regards,
-Neal

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Questions about usb to serial driver
  2022-07-01  3:16 Questions about usb to serial driver Neal Liu
@ 2022-07-01  7:16 ` gregkh
  2022-07-01  8:57   ` Neal Liu
  0 siblings, 1 reply; 5+ messages in thread
From: gregkh @ 2022-07-01  7:16 UTC (permalink / raw)
  To: Neal Liu; +Cc: linux-usb, linux-serial

On Fri, Jul 01, 2022 at 03:16:13AM +0000, Neal Liu wrote:
> Hi all,
> 
> I have a question about USB-serial and I hope I can find the answer from here.
> I'll be appreciated it if there is any feedback from you.
> 
> My question is If I have a USB device controller (udc) and a uart controller (16550) independently in a SoC,
> is there any usb-serial drivers or applications that could possible to support/connect:
> -	udc tx to uart rx
> -	uart tx to udc rx
> 
> Any chance I can make this SoC as a usb-serial devices?

Sure, use the CONFIG_USB_CONFIGFS_SERIAL or CONFIG_USB_CONFIGFS_ACM
build options and hook your gadget up to the serial port in userspace
and you will have a very expensive usb-serial converter (there are very
cheap chips that do the same thing if you want to make a simpler
device.)

hope this helps,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Questions about usb to serial driver
  2022-07-01  7:16 ` gregkh
@ 2022-07-01  8:57   ` Neal Liu
  2022-07-01  9:24     ` gregkh
  0 siblings, 1 reply; 5+ messages in thread
From: Neal Liu @ 2022-07-01  8:57 UTC (permalink / raw)
  To: gregkh; +Cc: linux-usb, linux-serial

> -----Original Message-----
> From: gregkh@linuxfoundation.org <gregkh@linuxfoundation.org>
> Sent: Friday, July 1, 2022 3:16 PM
> To: Neal Liu <neal_liu@aspeedtech.com>
> Cc: linux-usb@vger.kernel.org; linux-serial@vger.kernel.org
> Subject: Re: Questions about usb to serial driver
> 
> On Fri, Jul 01, 2022 at 03:16:13AM +0000, Neal Liu wrote:
> > Hi all,
> >
> > I have a question about USB-serial and I hope I can find the answer from
> here.
> > I'll be appreciated it if there is any feedback from you.
> >
> > My question is If I have a USB device controller (udc) and a uart
> > controller (16550) independently in a SoC, is there any usb-serial drivers or
> applications that could possible to support/connect:
> > -	udc tx to uart rx
> > -	uart tx to udc rx
> >
> > Any chance I can make this SoC as a usb-serial devices?
> 
> Sure, use the CONFIG_USB_CONFIGFS_SERIAL or CONFIG_USB_CONFIGFS_ACM
> build options and hook your gadget up to the serial port in userspace and you
> will have a very expensive usb-serial converter (there are very cheap chips that
> do the same thing if you want to make a simpler
> device.)
> 
> hope this helps,

Thanks Greg!

What the detail steps exactly for "hook your gadget up to the serial port in userspace"?
Assume my system has:
1 system uart: ttyS0
1 uart: ttyS1
1 usb gadget cdc acm: ttyGS0

How to hook up ttyS1 to ttyGS0, so that I could communicate through below path.
PC1 - usb interface - my SoC (ttyGS0 - ttyS1) - rs232 interface - PC2?

-Neal

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Questions about usb to serial driver
  2022-07-01  8:57   ` Neal Liu
@ 2022-07-01  9:24     ` gregkh
  2022-07-04  8:31       ` Neal Liu
  0 siblings, 1 reply; 5+ messages in thread
From: gregkh @ 2022-07-01  9:24 UTC (permalink / raw)
  To: Neal Liu; +Cc: linux-usb, linux-serial

On Fri, Jul 01, 2022 at 08:57:51AM +0000, Neal Liu wrote:
> > -----Original Message-----
> > From: gregkh@linuxfoundation.org <gregkh@linuxfoundation.org>
> > Sent: Friday, July 1, 2022 3:16 PM
> > To: Neal Liu <neal_liu@aspeedtech.com>
> > Cc: linux-usb@vger.kernel.org; linux-serial@vger.kernel.org
> > Subject: Re: Questions about usb to serial driver
> > 
> > On Fri, Jul 01, 2022 at 03:16:13AM +0000, Neal Liu wrote:
> > > Hi all,
> > >
> > > I have a question about USB-serial and I hope I can find the answer from
> > here.
> > > I'll be appreciated it if there is any feedback from you.
> > >
> > > My question is If I have a USB device controller (udc) and a uart
> > > controller (16550) independently in a SoC, is there any usb-serial drivers or
> > applications that could possible to support/connect:
> > > -	udc tx to uart rx
> > > -	uart tx to udc rx
> > >
> > > Any chance I can make this SoC as a usb-serial devices?
> > 
> > Sure, use the CONFIG_USB_CONFIGFS_SERIAL or CONFIG_USB_CONFIGFS_ACM
> > build options and hook your gadget up to the serial port in userspace and you
> > will have a very expensive usb-serial converter (there are very cheap chips that
> > do the same thing if you want to make a simpler
> > device.)
> > 
> > hope this helps,
> 
> Thanks Greg!
> 
> What the detail steps exactly for "hook your gadget up to the serial port in userspace"?
> Assume my system has:
> 1 system uart: ttyS0
> 1 uart: ttyS1
> 1 usb gadget cdc acm: ttyGS0
> 
> How to hook up ttyS1 to ttyGS0, so that I could communicate through below path.
> PC1 - usb interface - my SoC (ttyGS0 - ttyS1) - rs232 interface - PC2?

That's an exercise left for the reader to do, odds are you need a
userspace program that just copies the data back and forth.  Try it and
see!

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Questions about usb to serial driver
  2022-07-01  9:24     ` gregkh
@ 2022-07-04  8:31       ` Neal Liu
  0 siblings, 0 replies; 5+ messages in thread
From: Neal Liu @ 2022-07-04  8:31 UTC (permalink / raw)
  To: gregkh; +Cc: linux-usb, linux-serial

> > > -----Original Message-----
> > > From: gregkh@linuxfoundation.org <gregkh@linuxfoundation.org>
> > > Sent: Friday, July 1, 2022 3:16 PM
> > > To: Neal Liu <neal_liu@aspeedtech.com>
> > > Cc: linux-usb@vger.kernel.org; linux-serial@vger.kernel.org
> > > Subject: Re: Questions about usb to serial driver
> > >
> > > On Fri, Jul 01, 2022 at 03:16:13AM +0000, Neal Liu wrote:
> > > > Hi all,
> > > >
> > > > I have a question about USB-serial and I hope I can find the
> > > > answer from
> > > here.
> > > > I'll be appreciated it if there is any feedback from you.
> > > >
> > > > My question is If I have a USB device controller (udc) and a uart
> > > > controller (16550) independently in a SoC, is there any usb-serial
> > > > drivers or
> > > applications that could possible to support/connect:
> > > > -	udc tx to uart rx
> > > > -	uart tx to udc rx
> > > >
> > > > Any chance I can make this SoC as a usb-serial devices?
> > >
> > > Sure, use the CONFIG_USB_CONFIGFS_SERIAL or
> CONFIG_USB_CONFIGFS_ACM
> > > build options and hook your gadget up to the serial port in
> > > userspace and you will have a very expensive usb-serial converter
> > > (there are very cheap chips that do the same thing if you want to
> > > make a simpler
> > > device.)
> > >
> > > hope this helps,
> >
> > Thanks Greg!
> >
> > What the detail steps exactly for "hook your gadget up to the serial port in
> userspace"?
> > Assume my system has:
> > 1 system uart: ttyS0
> > 1 uart: ttyS1
> > 1 usb gadget cdc acm: ttyGS0
> >
> > How to hook up ttyS1 to ttyGS0, so that I could communicate through below
> path.
> > PC1 - usb interface - my SoC (ttyGS0 - ttyS1) - rs232 interface - PC2?
> 
> That's an exercise left for the reader to do, odds are you need a userspace
> program that just copies the data back and forth.  Try it and see!

Thanks for your guides, I have implemented it and it works well.
The most tricky part is to configure serial port configuration through termios struct.

-Neal

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-07-04  8:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-01  3:16 Questions about usb to serial driver Neal Liu
2022-07-01  7:16 ` gregkh
2022-07-01  8:57   ` Neal Liu
2022-07-01  9:24     ` gregkh
2022-07-04  8:31       ` Neal Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.