Merge branch 'next' of git://git.denx.de/u-boot-mpc83xx
[oweals/u-boot.git] / drivers / serial / serial_pxa.c
index bd3b3cf7c48465fe2e44be3a92efc7ceaef72a38..d5140045bfbb54ee0d790418fe07b7cbb4655343 100644 (file)
  *
  * Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -73,20 +60,6 @@ DECLARE_GLOBAL_DATA_PTR;
 #define        HWUART_INDEX    0xff
 #endif
 
-#ifndef CONFIG_SERIAL_MULTI
-#if defined(CONFIG_FFUART)
-#define UART_INDEX     FFUART_INDEX
-#elif defined(CONFIG_BTUART)
-#define UART_INDEX     BTUART_INDEX
-#elif defined(CONFIG_STUART)
-#define UART_INDEX     STUART_INDEX
-#elif defined(CONFIG_HWUART)
-#define UART_INDEX     HWUART_INDEX
-#else
-#error "Please select CONFIG_(FF|BT|ST|HW)UART in board config file."
-#endif
-#endif
-
 static uint32_t pxa_uart_get_baud_divider(void)
 {
        if (gd->baudrate == 1200)
@@ -297,9 +270,6 @@ void pxa_puts_dev(unsigned int uart_index, const char *s)
        pxa_uart_multi(btuart, BTUART)
 #endif
 
-#ifndef        CONFIG_SERIAL_MULTI
-       pxa_uart(serial, UART)
-#else
 __weak struct serial_device *default_serial_console(void)
 {
 #if CONFIG_CONS_INDEX == 1
@@ -314,4 +284,16 @@ __weak struct serial_device *default_serial_console(void)
 #error "Bad CONFIG_CONS_INDEX."
 #endif
 }
+
+void pxa_serial_initialize(void)
+{
+#if defined(CONFIG_FFUART)
+       serial_register(&serial_ffuart_device);
+#endif
+#if defined(CONFIG_BTUART)
+       serial_register(&serial_btuart_device);
+#endif
+#if defined(CONFIG_STUART)
+       serial_register(&serial_stuart_device);
 #endif
+}