linguini1 commented on code in PR #18837:
URL: https://github.com/apache/nuttx/pull/18837#discussion_r3178426587
##########
drivers/serial/uart_pl011.c:
##########
@@ -1010,67 +724,42 @@ static int pl011_setup(FAR struct uart_dev_s *dev)
***************************************************************************/
/***************************************************************************
- * Name: pl011_earlyserialinit
+ * Name: pl011_dev_init
*
* Description:
- * see nuttx/serial/uart_pl011.h
+ * Initialize a PL011 device with its configuration settings.
*
- ***************************************************************************/
-
-void pl011_earlyserialinit(void)
-{
- /* Enable the console UART. The other UARTs will be initialized if and
- * when they are first opened.
- */
-#ifdef CONSOLE_DEV
- CONSOLE_DEV.isconsole = true;
- pl011_setup(&CONSOLE_DEV);
-#endif
-}
-
-/***************************************************************************
- * Name: pl011_serialinit
+ * Arguments:
+ * - dev The PL011 device struct to initialize
*
- * Description:
- * Register serial console and serial ports. This assumes that
- * pl011_earlyserialinit was called previously.
+ * Return:
+ * The `struct uart_dev_s` for registering this PL011 device, or NULL on
+ * failure.
*
***************************************************************************/
-void pl011_serialinit(void)
Review Comment:
Because this function is no longer useful. It needs access to the device
structs for the PL011 interfaces in order to register them, but these are
defined outside this module now.
If we keep this function, then we can no longer:
- Define an arbitrary number of interfaces
- Use the standard UART config options for configuring PL011 UART
It should now be up to the chip logic to register the UART interfaces
instead, as with all other UART drivers. Otherwise we don't have the benefits
and we must also maintain two separate ways of doing things. There are only 3
boards that use PL011 right now, so it's not a super common case.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]