X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=arch%2Fpowerpc%2Fcpu%2Fmpc85xx%2Fserial_scc.c;h=a5c418570fa2f4da642132898c6eaee3f0f7d59c;hb=9a0cbae22a613dfd55e15565785749b74c19fdf0;hp=2dab2124fcc376c8eb4c23e4e4741e303aa49ee6;hpb=a47a12becf66f02a56da91c161e2edb625e9f20c;p=oweals%2Fu-boot.git diff --git a/arch/powerpc/cpu/mpc85xx/serial_scc.c b/arch/powerpc/cpu/mpc85xx/serial_scc.c index 2dab2124fc..a5c418570f 100644 --- a/arch/powerpc/cpu/mpc85xx/serial_scc.c +++ b/arch/powerpc/cpu/mpc85xx/serial_scc.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2003 Motorola Inc. * Xianghua Xiao (X.Xiao@motorola.com) @@ -6,24 +7,6 @@ * (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 - * * Hacked for MPC8260 by Murray.Jensen@cmst.csiro.au, 19-Oct-00. */ @@ -34,6 +17,8 @@ #include #include +#include +#include DECLARE_GLOBAL_DATA_PTR; @@ -85,7 +70,7 @@ DECLARE_GLOBAL_DATA_PTR; #endif -int serial_init (void) +static int mpc85xx_serial_init(void) { volatile ccsr_cpm_t *cpm = (ccsr_cpm_t *)CONFIG_SYS_MPC85xx_CPM_ADDR; volatile ccsr_cpm_scc_t *sp; @@ -184,8 +169,7 @@ int serial_init (void) return (0); } -void -serial_setbrg (void) +static void mpc85xx_serial_setbrg(void) { #if defined(CONFIG_CONS_USE_EXTC) m8560_cpm_extcbrg(SCC_INDEX, gd->baudrate, @@ -195,8 +179,7 @@ serial_setbrg (void) #endif } -void -serial_putc(const char c) +static void mpc85xx_serial_putc(const char c) { volatile scc_uart_t *up; volatile cbd_t *tbdf; @@ -220,16 +203,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 mpc85xx_serial_getc(void) { volatile cbd_t *rbdf; volatile scc_uart_t *up; @@ -252,8 +226,7 @@ serial_getc(void) return (c); } -int -serial_tstc() +static int mpc85xx_serial_tstc(void) { volatile cbd_t *rbdf; volatile scc_uart_t *up; @@ -265,4 +238,24 @@ serial_tstc() return ((rbdf->cbd_sc & BD_SC_EMPTY) == 0); } +static struct serial_device mpc85xx_serial_drv = { + .name = "mpc85xx_serial", + .start = mpc85xx_serial_init, + .stop = NULL, + .setbrg = mpc85xx_serial_setbrg, + .putc = mpc85xx_serial_putc, + .puts = default_serial_puts, + .getc = mpc85xx_serial_getc, + .tstc = mpc85xx_serial_tstc, +}; + +void mpc85xx_serial_initialize(void) +{ + serial_register(&mpc85xx_serial_drv); +} + +__weak struct serial_device *default_serial_console(void) +{ + return &mpc85xx_serial_drv; +} #endif /* CONFIG_CONS_ON_SCC */