do we just leave the .major & .minor as NULL in struct uart_driver for dynamic allocation?+ 213 = /dev/ttySPX0 SPRD serial port 0Please use dynamic allocation or give a very very good reason why you
+ ...
+ 216 = /dev/ttySPX3 SPRD serial port 3
can't
I think you mean getting the number of uarts from dt and dynamically allocate their port structure?+config SERIAL_SPRD_NRIf you are doing dynamic allocation this should pretty much go away
+ int "Maximum number of sprd serial ports"
+ depends on SERIAL_SPRD
+ default "4"
We will add in V4
+static int sprd_startup(struct uart_port *port)Missing a cpu_relax and I would have thought a timeout on both of these.
+{
+ int ret = 0;
+ unsigned int ien, ctrl1;
+ struct sprd_uart_port *sp;
+
+ serial_out(port, SPRD_CTL2, ((THLD_TX_EMPTY << 8) | THLD_RX_FULL));
+
+ /* clear rx fifo */
+ while (serial_in(port, SPRD_STS1) & 0x00ff)
+ serial_in(port, SPRD_RXD);
+
+ /* clear tx fifo */
+ while (serial_in(port, SPRD_STS1) & 0xff00)
+ ;
just simply use code like "termios->c_cflag &= ~CMSPAR" ?
+static void sprd_set_termios(struct uart_port *port,If you don't support mark/space parity then also clear CMSPAR in
+ struct ktermios *termios,
+ struct ktermios *old)
+{
+ unsigned int baud, quot;
+ /* calculate parity */
+ lcr &= ~SPRD_LCR_PARITY;
+ if (termios->c_cflag & PARENB) {
+ lcr |= SPRD_LCR_PARITY_EN;
+ if (termios->c_cflag & PARODD)
+ lcr |= SPRD_LCR_ODD_PAR;
+ else
+ lcr |= SPRD_LCR_EVEN_PAR;
+ }
termios->c_cflag.
If you do then it ought to be handled above.you mean something like this part ?
+Also set the resulting baud back into the termios (see the 8250 termios
+ /* clock divider bit16~bit20 */
+ serial_out(port, SPRD_CLKD1, (quot & 0x1f0000) >> 16);
+ serial_out(port, SPRD_LCR, lcr);
+ fc |= 0x3e00 | THLD_RX_FULL;
+ serial_out(port, SPRD_CTL1, fc);
for an example)
it will be fixed :)
+static int __init sprd_console_setup(struct console *co, char *options)Typo
+{
+ struct uart_port *port;
+ int baud = 115200;
+ int bits = 8;
+ int parity = 'n';
+ int flow = 'n';
+
+ if (unlikely(co->index >= UART_NR_MAX || co->index < 0))
+ co->index = 0;
+
+ port = (struct uart_port *)sprd_port[co->index];
+ if (port == NULL) {
+ pr_info("srial port %d not yet initialized\n", co->index);
Looks basically sound to me
Alan