Re: [PATCH v7 2/2] serial:sunplus-uart:Add Sunplus SoC UART Driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> 於 2022年2月7日 週一 下午3:18寫道:
>
> On Mon, Feb 07, 2022 at 01:58:01PM +0800, Hammer Hsieh wrote:
> > Add Sunplus SoC UART Driver
> >
>
> We need more of a changelog comment here please.  Describe the hardware,
> what the new tty name you are using, and other stuff.  Be descriptive.
>

I will describe as below.
Add Sunplus SoC UART Driver.
SP7021 UART block contains 5 UARTs.
There are UART0~4 that supported in SP7021, the features list as below.
Support Full-duplex communication.
Support data packet length configurable.
Support stop bit number configurable.
Support force break condition.
Support baud rate configurable.
Support error detection and report.
Support RXD Noise Rejection Vote configurable.

UART0 pinout only support TX/RX two pins.
UART1 to UART4 pinout support TX/RX/CTS/RTS four pins.
Normally UART0 used for kernel console, also can be used for normal uart.
Command line set "console=ttySUP0,115200", SUP means Sunplus Uart Port.
UART driver probe will create path named "/dev/ttySUPx".

https://sunplus.atlassian.net/wiki/spaces/doc/pages/1873412290/13.+Universal+Asynchronous+Receiver+Transmitter+UART

> > --- a/include/uapi/linux/serial_core.h
> > +++ b/include/uapi/linux/serial_core.h
> > @@ -274,4 +274,7 @@
> >  /* Freescale LINFlexD UART */
> >  #define PORT_LINFLEXUART     122
> >
> > +/* Sunplus UART */
> > +#define PORT_SUNPLUS 123
>
> Why is this needed?  Are you going to require this in some userspace
> code?  If not, please do not add it.
>

In serial_core.c (line 3014) uart_add_one_port( )
It will call uart_configure_port( ).
In my uart driver probe set port->flags=UPF_BOOT_AUTOCONF.
I try to remove port define and remove  sunplus_config_port( )
 and just add a "sunplus_uart" for in sunplus_type( ).
And my uart console not work with PuTTY tool.

I try to do another test as below.
static const char *sunplus_type(struct uart_port *port)
{
        return "sunplus_uart";
}
static void sunplus_config_port(struct uart_port *port, int type)
{
        if (type & UART_CONFIG_TYPE)
                port->type = "sunplus_uart"; //type define is unsigned int
}
Uart console works, but port->type should be unsigned int , not string.
So compile will warning " assignment makes integer from pointer
without a cast [-Wint-conversion]".

I think I should keep the current submit code.

> thanks,
>
> greg k-h




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux