xiaoxiang781216 commented on code in PR #9243:
URL: https://github.com/apache/nuttx/pull/9243#discussion_r1190620104


##########
arch/arm64/src/a64/a64_serial.c:
##########
@@ -603,18 +1335,66 @@ static struct uart_dev_s    g_uart1port =
 
 void arm64_earlyserialinit(void)
 {
-  /* NOTE: This function assumes that low level hardware configuration
+  int ret;
+
+  /* NOTE: This function assumes that UART0 low level hardware configuration
    * -- including all clocking and pin configuration -- was performed
-   * earlier in the boot sequence.
+   * earlier by U-Boot Bootloader.
    */
 
-  /* Enable the console UART.  The other UARTs will be initialized if and
-   * when they are first opened.
-   */
+#ifdef CONFIG_A64_UART1
+  /* Configure UART1 */
+
+  ret = a64_uart_init(UART1_GATING, UART1_RST, PIO_UART1_TX, PIO_UART1_RX);
+
+  if (ret < 0)
+    {
+      _err("UART1 config failed, ret=%d\n", ret);
+    }
+#endif /* CONFIG_A64_UART1 */
+
+#ifdef CONFIG_A64_UART2
+  /* Configure UART2 */
+
+  ret = a64_uart_init(UART2_GATING, UART2_RST, PIO_UART2_TX, PIO_UART2_RX);
+
+  if (ret < 0)
+    {
+      _err("UART2 config failed, ret=%d\n", ret);
+    }
+#endif /* CONFIG_A64_UART2 */
+
+#ifdef CONFIG_A64_UART3
+  /* Configure UART3 */
+
+  ret = a64_uart_init(UART3_GATING, UART3_RST, PIO_UART3_TX, PIO_UART3_RX);
+
+  if (ret < 0)
+    {
+      _err("UART3 config failed, ret=%d\n", ret);
+    }
+#endif /* CONFIG_A64_UART3 */
+
+#ifdef CONFIG_A64_UART4
+  /* Configure UART4 */
+
+  ret = a64_uart_init(UART4_GATING, UART4_RST, PIO_UART4_TX, PIO_UART4_RX);
+
+  if (ret < 0)
+    {
+      _err("UART4 config failed, ret=%d\n", ret);
+    }
+#endif /* CONFIG_A64_UART4 */
+
 #ifdef CONSOLE_DEV
+  /* Enable the console at UART0 */
+
   CONSOLE_DEV.isconsole = true;
   a64_uart_setup(&CONSOLE_DEV);
 #endif
+
+  UNUSED(a64_uart_init);

Review Comment:
   why need this?



-- 
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]

Reply via email to