On Wed, Mar 15, 2023 at 07:29:01AM +0000, Jacky Huang wrote:
From: Jacky Huang <ychuang3@xxxxxxxxxxx>A new UART being designed that is not an 8250 compatible? Why????
This adds UART and console driver for Nuvoton ma35d1 Soc.
MA35D1 SoC provides up to 17 UART controllers, each with one uart port.
The ma35d1 uart controller is not compatible with 8250.
Anyway, some minor comments:
drivers/tty/serial/ma35d1_serial.c | 842 +++++++++++++++++++++++++++++Why do you have a .h file for only a single .c file? Please just put
drivers/tty/serial/ma35d1_serial.h | 93 ++++
them both together into one .c file.
include/uapi/linux/serial_core.h | 3 +Why do you need this #define? Are you using it in userspace now? If
not, why have it?
+static voidPlease just put all one one line.
+receive_chars(struct uart_ma35d1_port *up)
+{You have no way out if the hardware is stuck? That feels wrong.
+ u8 ch;
+ u32 fsr;
+ u32 isr;
+ u32 dcnt;
+ char flag;
+
+ isr = serial_in(up, UART_REG_ISR);
+ fsr = serial_in(up, UART_REG_FSR);
+
+ while (!(fsr & RX_EMPTY)) {
+static int ma35d1serial_ioctl(struct uart_port *port, u32 cmd, unsigned long arg)You do not need to handle any ioctls?
+{
+ switch (cmd) {
+ default:
+ return -ENOIOCTLCMD;
+ }
+ return 0;
+}
+static void ma35d1serial_console_putchar(struct uart_port *port,Again, no way out if this gets stuck in a loop?
+ unsigned char ch)
+{
+ struct uart_ma35d1_port *up = (struct uart_ma35d1_port *)port;
+
+ do {
+ } while ((serial_in(up, UART_REG_FSR) & TX_FULL));
+/**Why is this exported? Who uses it?
+ * Suspend one serial port.
+ */
+void ma35d1serial_suspend_port(int line)
+{
+ uart_suspend_port(&ma35d1serial_reg, &ma35d1serial_ports[line].port);
+}
+EXPORT_SYMBOL(ma35d1serial_suspend_port);
And why not EXPORT_SYMBOL_GPL()?
+Same here, who calls this and why?
+/**
+ * Resume one serial port.
+ */
+void ma35d1serial_resume_port(int line)
+{
+ struct uart_ma35d1_port *up = &ma35d1serial_ports[line];
+
+ uart_resume_port(&ma35d1serial_reg, &up->port);
+}
+EXPORT_SYMBOL(ma35d1serial_resume_port);
--- a/include/uapi/linux/serial_core.hAgain, why is this define needed?
+++ b/include/uapi/linux/serial_core.h
@@ -279,4 +279,7 @@
/* Sunplus UART */
#define PORT_SUNPLUS 123
+/* Nuvoton MA35D1 UART */
+#define PORT_MA35D1 124
thanks,
greg k-h