]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/powerpc/cpu/mpc8260/serial_scc.c
Merge branch 'u-boot/master' into u-boot-arm/master
[karo-tx-uboot.git] / arch / powerpc / cpu / mpc8260 / serial_scc.c
index 4ab6a28640361dc7cda7a34859d0b79718987ae8..8bfb3dedcbb590e3748d7d21401ebbb2f5e4b168 100644 (file)
@@ -2,23 +2,7 @@
  * (C) Copyright 2000
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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+
  *
  * Hacked for MPC8260 by Murray.Jensen@cmst.csiro.au, 19-Oct-00.
  */
@@ -31,6 +15,8 @@
 #include <common.h>
 #include <mpc8260.h>
 #include <asm/cpm_8260.h>
+#include <serial.h>
+#include <linux/compiler.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -82,7 +68,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #endif
 
-int serial_init (void)
+static int mpc8260_scc_serial_init(void)
 {
        volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
        volatile scc_t *sp;
@@ -180,8 +166,7 @@ int serial_init (void)
        return (0);
 }
 
-void
-serial_setbrg (void)
+static void mpc8260_scc_serial_setbrg(void)
 {
 #if defined(CONFIG_CONS_USE_EXTC)
        m8260_cpm_extcbrg(SCC_INDEX, gd->baudrate,
@@ -191,8 +176,7 @@ serial_setbrg (void)
 #endif
 }
 
-void
-serial_putc(const char c)
+static void mpc8260_scc_serial_putc(const char c)
 {
        volatile scc_uart_t     *up;
        volatile cbd_t          *tbdf;
@@ -217,16 +201,7 @@ serial_putc(const char c)
        tbdf->cbd_sc |= BD_SC_READY;
 }
 
-void
-serial_puts (const char *s)
-{
-       while (*s) {
-               serial_putc (*s++);
-       }
-}
-
-int
-serial_getc(void)
+static int mpc8260_scc_serial_getc(void)
 {
        volatile cbd_t          *rbdf;
        volatile scc_uart_t     *up;
@@ -250,8 +225,7 @@ serial_getc(void)
        return (c);
 }
 
-int
-serial_tstc()
+static int mpc8260_scc_serial_tstc(void)
 {
        volatile cbd_t          *rbdf;
        volatile scc_uart_t     *up;
@@ -264,6 +238,26 @@ serial_tstc()
        return ((rbdf->cbd_sc & BD_SC_EMPTY) == 0);
 }
 
+static struct serial_device mpc8260_scc_serial_drv = {
+       .name   = "mpc8260_scc_uart",
+       .start  = mpc8260_scc_serial_init,
+       .stop   = NULL,
+       .setbrg = mpc8260_scc_serial_setbrg,
+       .putc   = mpc8260_scc_serial_putc,
+       .puts   = default_serial_puts,
+       .getc   = mpc8260_scc_serial_getc,
+       .tstc   = mpc8260_scc_serial_tstc,
+};
+
+void mpc8260_scc_serial_initialize(void)
+{
+       serial_register(&mpc8260_scc_serial_drv);
+}
+
+__weak struct serial_device *default_serial_console(void)
+{
+       return &mpc8260_scc_serial_drv;
+}
 #endif /* CONFIG_CONS_ON_SCC */
 
 #if defined(CONFIG_KGDB_ON_SCC)