serial: Use default_serial_puts() in drivers
Replace the in-place ad-hoc implementation of serial_puts() within the drivers with default_serial_puts() call. This cuts down on the code duplication quite a bit. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Marek Vasut <marek.vasut@gmail.com> Cc: Tom Rini <trini@ti.com>
This commit is contained in:
parent
bfb7d7a3d6
commit
ec3fd68952
@ -103,12 +103,6 @@ static void au1x00_serial_putc(const char c)
|
||||
*uart_tx = (u32)c;
|
||||
}
|
||||
|
||||
static void au1x00_serial_puts(const char *s)
|
||||
{
|
||||
while (*s)
|
||||
serial_putc(*s++);
|
||||
}
|
||||
|
||||
static int au1x00_serial_getc(void)
|
||||
{
|
||||
volatile u32 *uart_rx = (volatile u32*)(UART0_ADDR+UART_RX);
|
||||
@ -137,7 +131,7 @@ static struct serial_device au1x00_serial_drv = {
|
||||
.stop = NULL,
|
||||
.setbrg = au1x00_serial_setbrg,
|
||||
.putc = au1x00_serial_putc,
|
||||
.puts = au1x00_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = au1x00_serial_getc,
|
||||
.tstc = au1x00_serial_tstc,
|
||||
};
|
||||
|
@ -236,14 +236,6 @@ static void asc_serial_putc(const char c)
|
||||
}
|
||||
}
|
||||
|
||||
static void asc_serial_puts(const char *s)
|
||||
{
|
||||
while (*s)
|
||||
{
|
||||
serial_putc (*s++);
|
||||
}
|
||||
}
|
||||
|
||||
static int asc_serial_getc(void)
|
||||
{
|
||||
ulong symbol_mask;
|
||||
@ -292,7 +284,7 @@ static struct serial_device asc_serial_drv = {
|
||||
.stop = NULL,
|
||||
.setbrg = asc_serial_setbrg,
|
||||
.putc = asc_serial_putc,
|
||||
.puts = asc_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = asc_serial_getc,
|
||||
.tstc = asc_serial_tstc,
|
||||
};
|
||||
|
@ -109,19 +109,13 @@ static int jz_serial_getc(void)
|
||||
return readb(&uart->rbr_thr_dllr);
|
||||
}
|
||||
|
||||
static void jz_serial_puts(const char *s)
|
||||
{
|
||||
while (*s)
|
||||
serial_putc(*s++);
|
||||
}
|
||||
|
||||
static struct serial_device jz_serial_drv = {
|
||||
.name = "jz_serial",
|
||||
.start = jz_serial_init,
|
||||
.stop = NULL,
|
||||
.setbrg = jz_serial_setbrg,
|
||||
.putc = jz_serial_putc,
|
||||
.puts = jz_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = jz_serial_getc,
|
||||
.tstc = jz_serial_tstc,
|
||||
};
|
||||
|
@ -161,21 +161,13 @@ static void mpc5xx_serial_setbrg(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
static void mpc5xx_serial_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc(*s);
|
||||
++s;
|
||||
}
|
||||
}
|
||||
|
||||
static struct serial_device mpc5xx_serial_drv = {
|
||||
.name = "mpc5xx_serial",
|
||||
.start = mpc5xx_serial_init,
|
||||
.stop = NULL,
|
||||
.setbrg = mpc5xx_serial_setbrg,
|
||||
.putc = mpc5xx_serial_putc,
|
||||
.puts = mpc5xx_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = mpc5xx_serial_getc,
|
||||
.tstc = mpc5xx_serial_tstc,
|
||||
};
|
||||
|
@ -84,13 +84,6 @@ static void mpc8220_serial_putc(const char c)
|
||||
psc->xmitbuf[0] = c;
|
||||
}
|
||||
|
||||
static void mpc8220_serial_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc (*s++);
|
||||
}
|
||||
}
|
||||
|
||||
static int mpc8220_serial_getc(void)
|
||||
{
|
||||
volatile psc8220_t *psc = (psc8220_t *) PSC_BASE;
|
||||
@ -132,7 +125,7 @@ static struct serial_device mpc8220_serial_drv = {
|
||||
.stop = NULL,
|
||||
.setbrg = mpc8220_serial_setbrg,
|
||||
.putc = mpc8220_serial_putc,
|
||||
.puts = mpc8220_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = mpc8220_serial_getc,
|
||||
.tstc = mpc8220_serial_tstc,
|
||||
};
|
||||
|
@ -217,13 +217,6 @@ static void mpc8260_scc_serial_putc(const char c)
|
||||
tbdf->cbd_sc |= BD_SC_READY;
|
||||
}
|
||||
|
||||
static void mpc8260_scc_serial_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc (*s++);
|
||||
}
|
||||
}
|
||||
|
||||
static int mpc8260_scc_serial_getc(void)
|
||||
{
|
||||
volatile cbd_t *rbdf;
|
||||
@ -267,7 +260,7 @@ static struct serial_device mpc8260_scc_serial_drv = {
|
||||
.stop = NULL,
|
||||
.setbrg = mpc8260_scc_serial_setbrg,
|
||||
.putc = mpc8260_scc_serial_putc,
|
||||
.puts = mpc8260_scc_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = mpc8260_scc_serial_getc,
|
||||
.tstc = mpc8260_scc_serial_tstc,
|
||||
};
|
||||
|
@ -216,13 +216,6 @@ static void mpc8260_smc_serial_putc(const char c)
|
||||
rtx->txbd.cbd_sc |= BD_SC_READY;
|
||||
}
|
||||
|
||||
static void mpc8260_smc_serial_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc (*s++);
|
||||
}
|
||||
}
|
||||
|
||||
static int mpc8260_smc_serial_getc(void)
|
||||
{
|
||||
volatile smc_uart_t *up;
|
||||
@ -270,7 +263,7 @@ static struct serial_device mpc8260_smc_serial_drv = {
|
||||
.stop = NULL,
|
||||
.setbrg = mpc8260_smc_serial_setbrg,
|
||||
.putc = mpc8260_smc_serial_putc,
|
||||
.puts = mpc8260_smc_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = mpc8260_smc_serial_getc,
|
||||
.tstc = mpc8260_smc_serial_tstc,
|
||||
};
|
||||
|
@ -220,13 +220,6 @@ static void mpc85xx_serial_putc(const char c)
|
||||
tbdf->cbd_sc |= BD_SC_READY;
|
||||
}
|
||||
|
||||
static void mpc85xx_serial_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc (*s++);
|
||||
}
|
||||
}
|
||||
|
||||
static int mpc85xx_serial_getc(void)
|
||||
{
|
||||
volatile cbd_t *rbdf;
|
||||
@ -268,7 +261,7 @@ static struct serial_device mpc85xx_serial_drv = {
|
||||
.stop = NULL,
|
||||
.setbrg = mpc85xx_serial_setbrg,
|
||||
.putc = mpc85xx_serial_putc,
|
||||
.puts = mpc85xx_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = mpc85xx_serial_getc,
|
||||
.tstc = mpc85xx_serial_tstc,
|
||||
};
|
||||
|
@ -105,13 +105,6 @@ static void leon2_serial_putc(const char c)
|
||||
leon2_serial_putc_raw(c);
|
||||
}
|
||||
|
||||
static void leon2_serial_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc(*s++);
|
||||
}
|
||||
}
|
||||
|
||||
static int leon2_serial_getc(void)
|
||||
{
|
||||
LEON2_regs *leon2 = (LEON2_regs *) LEON2_PREGS;
|
||||
@ -172,7 +165,7 @@ static struct serial_device leon2_serial_drv = {
|
||||
.stop = NULL,
|
||||
.setbrg = leon2_serial_setbrg,
|
||||
.putc = leon2_serial_putc,
|
||||
.puts = leon2_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = leon2_serial_getc,
|
||||
.tstc = leon2_serial_tstc,
|
||||
};
|
||||
|
@ -99,13 +99,6 @@ static void leon3_serial_putc(const char c)
|
||||
leon3_serial_putc_raw(c);
|
||||
}
|
||||
|
||||
static void leon3_serial_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc(*s++);
|
||||
}
|
||||
}
|
||||
|
||||
static int leon3_serial_getc(void)
|
||||
{
|
||||
if (!leon3_apbuart)
|
||||
@ -146,7 +139,7 @@ static struct serial_device leon3_serial_drv = {
|
||||
.stop = NULL,
|
||||
.setbrg = leon3_serial_setbrg,
|
||||
.putc = leon3_serial_putc,
|
||||
.puts = leon3_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = leon3_serial_getc,
|
||||
.tstc = leon3_serial_tstc,
|
||||
};
|
||||
|
@ -139,20 +139,13 @@ static void marvell_serial_setbrg(void)
|
||||
|
||||
#endif /* CONFIG_MPSC */
|
||||
|
||||
static void marvell_serial_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc (*s++);
|
||||
}
|
||||
}
|
||||
|
||||
static struct serial_device marvell_serial_drv = {
|
||||
.name = "marvell_serial",
|
||||
.start = marvell_serial_init,
|
||||
.stop = NULL,
|
||||
.setbrg = marvell_serial_setbrg,
|
||||
.putc = marvell_serial_putc,
|
||||
.puts = marvell_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = marvell_serial_getc,
|
||||
.tstc = marvell_serial_tstc,
|
||||
};
|
||||
|
@ -68,12 +68,6 @@ static void cogent_serial_putc(const char c)
|
||||
cma_mb_reg_write (&mbsp->ser_thr, c);
|
||||
}
|
||||
|
||||
static void cogent_serial_puts(const char *s)
|
||||
{
|
||||
while (*s != '\0')
|
||||
serial_putc (*s++);
|
||||
}
|
||||
|
||||
static int cogent_serial_getc(void)
|
||||
{
|
||||
cma_mb_serial *mbsp = (cma_mb_serial *) CMA_MB_SERIAL_BASE;
|
||||
@ -96,7 +90,7 @@ static struct serial_device cogent_serial_drv = {
|
||||
.stop = NULL,
|
||||
.setbrg = cogent_serial_setbrg,
|
||||
.putc = cogent_serial_putc,
|
||||
.puts = cogent_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = cogent_serial_getc,
|
||||
.tstc = cogent_serial_tstc,
|
||||
};
|
||||
|
@ -75,21 +75,13 @@ static void cpci750_serial_setbrg(void)
|
||||
galbrg_set_baudrate (CONFIG_MPSC_PORT, gd->baudrate);
|
||||
}
|
||||
|
||||
|
||||
static void cpci750_serial_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc (*s++);
|
||||
}
|
||||
}
|
||||
|
||||
static struct serial_device cpci750_serial_drv = {
|
||||
.name = "cpci750_serial",
|
||||
.start = cpci750_serial_init,
|
||||
.stop = NULL,
|
||||
.setbrg = cpci750_serial_setbrg,
|
||||
.putc = cpci750_serial_putc,
|
||||
.puts = cpci750_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = cpci750_serial_getc,
|
||||
.tstc = cpci750_serial_tstc,
|
||||
};
|
||||
|
@ -139,20 +139,13 @@ static void evb64260_serial_setbrg(void)
|
||||
|
||||
#endif /* CONFIG_MPSC */
|
||||
|
||||
static void evb64260_serial_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc (*s++);
|
||||
}
|
||||
}
|
||||
|
||||
static struct serial_device evb64260_serial_drv = {
|
||||
.name = "evb64260_serial",
|
||||
.start = evb64260_serial_init,
|
||||
.stop = NULL,
|
||||
.setbrg = evb64260_serial_setbrg,
|
||||
.putc = evb64260_serial_putc,
|
||||
.puts = evb64260_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = evb64260_serial_getc,
|
||||
.tstc = evb64260_serial_tstc,
|
||||
};
|
||||
|
@ -73,13 +73,6 @@ void fpga_serial_putc (char c)
|
||||
}
|
||||
}
|
||||
|
||||
void fpga_serial_puts (const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
fpga_serial_print (*s++);
|
||||
}
|
||||
}
|
||||
|
||||
int fpga_serial_getc (void)
|
||||
{
|
||||
while ((in8 (UART (LSR)) & 0x01) == 0);
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
extern void fpga_serial_init (int);
|
||||
extern void fpga_serial_putc (char);
|
||||
extern void fpga_serial_puts (const char *);
|
||||
extern int fpga_serial_getc (void);
|
||||
extern int fpga_serial_tstc (void);
|
||||
extern void fpga_serial_setbrg (void);
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <watchdog.h>
|
||||
#include <pci.h>
|
||||
#include <netdev.h>
|
||||
#include <serial.h>
|
||||
|
||||
#include "hardware.h"
|
||||
#include "pcippc2.h"
|
||||
@ -129,7 +130,7 @@ int misc_init_r (void)
|
||||
fpga_serial_init (sconsole_get_baudrate ());
|
||||
|
||||
sconsole_putc = fpga_serial_putc;
|
||||
sconsole_puts = fpga_serial_puts;
|
||||
sconsole_puts = default_serial_puts;
|
||||
sconsole_getc = fpga_serial_getc;
|
||||
sconsole_tstc = fpga_serial_tstc;
|
||||
sconsole_setbrg = fpga_serial_setbrg;
|
||||
|
@ -75,21 +75,13 @@ static void p3mx_serial_setbrg(void)
|
||||
galbrg_set_baudrate (CONFIG_MPSC_PORT, gd->baudrate);
|
||||
}
|
||||
|
||||
|
||||
static void p3mx_serial_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc (*s++);
|
||||
}
|
||||
}
|
||||
|
||||
static struct serial_device p3mx_serial_drv = {
|
||||
.name = "p3mx_serial",
|
||||
.start = p3mx_serial_init,
|
||||
.stop = NULL,
|
||||
.setbrg = p3mx_serial_setbrg,
|
||||
.putc = p3mx_serial_putc,
|
||||
.puts = p3mx_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = p3mx_serial_getc,
|
||||
.tstc = p3mx_serial_tstc,
|
||||
};
|
||||
|
@ -59,12 +59,6 @@ static void altera_jtag_serial_putc(char c)
|
||||
writel ((unsigned char)c, &jtag->data);
|
||||
}
|
||||
|
||||
static void altera_jtag_serial_puts(const char *s)
|
||||
{
|
||||
while (*s != 0)
|
||||
serial_putc (*s++);
|
||||
}
|
||||
|
||||
static int altera_jtag_serial_tstc(void)
|
||||
{
|
||||
return ( readl (&jtag->control) & NIOS_JTAG_RRDY);
|
||||
@ -91,7 +85,7 @@ static struct serial_device altera_jtag_serial_drv = {
|
||||
.stop = NULL,
|
||||
.setbrg = altera_jtag_serial_setbrg,
|
||||
.putc = altera_jtag_serial_putc,
|
||||
.puts = altera_jtag_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = altera_jtag_serial_getc,
|
||||
.tstc = altera_jtag_serial_tstc,
|
||||
};
|
||||
|
@ -82,13 +82,6 @@ static void altera_serial_putc(char c)
|
||||
writel ((unsigned char)c, &uart->txdata);
|
||||
}
|
||||
|
||||
static void altera_serial_puts(const char *s)
|
||||
{
|
||||
while (*s != 0) {
|
||||
serial_putc (*s++);
|
||||
}
|
||||
}
|
||||
|
||||
static int altera_serial_tstc(void)
|
||||
{
|
||||
return (readl (&uart->status) & NIOS_UART_RRDY);
|
||||
@ -107,7 +100,7 @@ static struct serial_device altera_serial_drv = {
|
||||
.stop = NULL,
|
||||
.setbrg = altera_serial_setbrg,
|
||||
.putc = altera_serial_putc,
|
||||
.puts = altera_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = altera_serial_getc,
|
||||
.tstc = altera_serial_tstc,
|
||||
};
|
||||
|
@ -86,12 +86,6 @@ static void atmel_serial_putc(char c)
|
||||
writel(c, &usart->thr);
|
||||
}
|
||||
|
||||
static void atmel_serial_puts(const char *s)
|
||||
{
|
||||
while (*s)
|
||||
serial_putc(*s++);
|
||||
}
|
||||
|
||||
static int atmel_serial_getc(void)
|
||||
{
|
||||
atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_USART_BASE;
|
||||
@ -113,7 +107,7 @@ static struct serial_device atmel_serial_drv = {
|
||||
.stop = NULL,
|
||||
.setbrg = atmel_serial_setbrg,
|
||||
.putc = atmel_serial_putc,
|
||||
.puts = atmel_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = atmel_serial_getc,
|
||||
.tstc = atmel_serial_tstc,
|
||||
};
|
||||
|
@ -77,19 +77,13 @@ static int lpc32xx_serial_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void lpc32xx_serial_puts(const char *s)
|
||||
{
|
||||
while (*s)
|
||||
serial_putc(*s++);
|
||||
}
|
||||
|
||||
static struct serial_device lpc32xx_serial_drv = {
|
||||
.name = "lpc32xx_serial",
|
||||
.start = lpc32xx_serial_init,
|
||||
.stop = NULL,
|
||||
.setbrg = lpc32xx_serial_setbrg,
|
||||
.putc = lpc32xx_serial_putc,
|
||||
.puts = lpc32xx_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = lpc32xx_serial_getc,
|
||||
.tstc = lpc32xx_serial_tstc,
|
||||
};
|
||||
|
@ -87,13 +87,6 @@ static void mcf_serial_putc(const char c)
|
||||
uart->utb = c;
|
||||
}
|
||||
|
||||
static void mcf_serial_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc(*s++);
|
||||
}
|
||||
}
|
||||
|
||||
static int mcf_serial_getc(void)
|
||||
{
|
||||
volatile uart_t *uart = (volatile uart_t *)(CONFIG_SYS_UART_BASE);
|
||||
@ -136,7 +129,7 @@ static struct serial_device mcf_serial_drv = {
|
||||
.stop = NULL,
|
||||
.setbrg = mcf_serial_setbrg,
|
||||
.putc = mcf_serial_putc,
|
||||
.puts = mcf_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = mcf_serial_getc,
|
||||
.tstc = mcf_serial_tstc,
|
||||
};
|
||||
|
@ -99,19 +99,6 @@ static void ns9750_serial_putc(const char c)
|
||||
CONSOLE) = c;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* @Function: serial_puts
|
||||
* @Return: n/a
|
||||
* @Descr: writes non-zero string to the FIFO.
|
||||
***********************************************************************/
|
||||
|
||||
static void ns9750_serial_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc( *s++ );
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* @Function: serial_getc
|
||||
* @Return: the character read
|
||||
@ -215,7 +202,7 @@ static struct serial_device ns9750_serial_drv = {
|
||||
.stop = NULL,
|
||||
.setbrg = ns9750_serial_setbrg,
|
||||
.putc = ns9750_serial_putc,
|
||||
.puts = ns9750_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = ns9750_serial_getc,
|
||||
.tstc = ns9750_serial_tstc,
|
||||
};
|
||||
|
@ -161,14 +161,6 @@ static void oc_serial_putc(char c)
|
||||
writel((unsigned char)c, &uart->data);
|
||||
}
|
||||
|
||||
static void oc_serial_puts(const char *s)
|
||||
{
|
||||
while (*s != 0) {
|
||||
serial_putc (*s++);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static int oc_serial_tstc(void)
|
||||
{
|
||||
unsigned status ;
|
||||
@ -195,7 +187,7 @@ static struct serial_device oc_serial_drv = {
|
||||
.stop = NULL,
|
||||
.setbrg = oc_serial_setbrg,
|
||||
.putc = oc_serial_putc,
|
||||
.puts = oc_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = oc_serial_getc,
|
||||
.tstc = oc_serial_tstc,
|
||||
};
|
||||
|
@ -199,12 +199,10 @@ static int s3c4510b_serial_getc(void)
|
||||
|
||||
static void s3c4510b_serial_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc (*s++);
|
||||
}
|
||||
default_serial_puts(s);
|
||||
|
||||
/* busy wait for tx complete */
|
||||
while ( !uart->m_stat.bf.txComplete);
|
||||
while (!uart->m_stat.bf.txComplete);
|
||||
|
||||
/* clear break */
|
||||
uart->m_ctrl.bf.sendBreak = 0;
|
||||
|
@ -166,19 +166,13 @@ static int s3c64xx_serial_tstc(void)
|
||||
return uart->UTRSTAT & 0x1;
|
||||
}
|
||||
|
||||
static void s3c64xx_serial_puts(const char *s)
|
||||
{
|
||||
while (*s)
|
||||
serial_putc(*s++);
|
||||
}
|
||||
|
||||
static struct serial_device s3c64xx_serial_drv = {
|
||||
.name = "s3c64xx_serial",
|
||||
.start = s3c64xx_serial_init,
|
||||
.stop = NULL,
|
||||
.setbrg = s3c64xx_serial_setbrg,
|
||||
.putc = s3c64xx_serial_putc,
|
||||
.puts = s3c64xx_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = s3c64xx_serial_getc,
|
||||
.tstc = s3c64xx_serial_tstc,
|
||||
};
|
||||
|
@ -112,20 +112,13 @@ static int clps7111_serial_getc(void)
|
||||
return IO_UARTDR1 & 0xff;
|
||||
}
|
||||
|
||||
static void clps7111_serial_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc (*s++);
|
||||
}
|
||||
}
|
||||
|
||||
static struct serial_device clps7111_serial_drv = {
|
||||
.name = "clps7111_serial",
|
||||
.start = clps7111_serial_init,
|
||||
.stop = NULL,
|
||||
.setbrg = clps7111_serial_setbrg,
|
||||
.putc = clps7111_serial_putc,
|
||||
.puts = clps7111_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = clps7111_serial_getc,
|
||||
.tstc = clps7111_serial_tstc,
|
||||
};
|
||||
|
@ -214,20 +214,13 @@ static int imx_serial_tstc(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void imx_serial_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc (*s++);
|
||||
}
|
||||
}
|
||||
|
||||
static struct serial_device imx_serial_drv = {
|
||||
.name = "imx_serial",
|
||||
.start = imx_serial_init,
|
||||
.stop = NULL,
|
||||
.setbrg = imx_serial_setbrg,
|
||||
.putc = imx_serial_putc,
|
||||
.puts = imx_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = imx_serial_getc,
|
||||
.tstc = imx_serial_tstc,
|
||||
};
|
||||
|
@ -121,20 +121,13 @@ static int ixp_serial_getc(void)
|
||||
return (char) RBR(CONFIG_SYS_IXP425_CONSOLE) & 0xff;
|
||||
}
|
||||
|
||||
static void ixp_serial_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc (*s++);
|
||||
}
|
||||
}
|
||||
|
||||
static struct serial_device ixp_serial_drv = {
|
||||
.name = "ixp_serial",
|
||||
.start = ixp_serial_init,
|
||||
.stop = NULL,
|
||||
.setbrg = ixp_serial_setbrg,
|
||||
.putc = ixp_serial_putc,
|
||||
.puts = ixp_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = ixp_serial_getc,
|
||||
.tstc = ixp_serial_tstc,
|
||||
};
|
||||
|
@ -102,13 +102,6 @@ static int ks8695_serial_tstc(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ks8695_serial_puts(const char *s)
|
||||
{
|
||||
char c;
|
||||
while ((c = *s++) != 0)
|
||||
serial_putc(c);
|
||||
}
|
||||
|
||||
static int ks8695_serial_getc(void)
|
||||
{
|
||||
volatile struct ks8695uart *uartp = KS8695_UART_ADDR;
|
||||
@ -124,7 +117,7 @@ static struct serial_device ks8695_serial_drv = {
|
||||
.stop = NULL,
|
||||
.setbrg = ks8695_serial_setbrg,
|
||||
.putc = ks8695_serial_putc,
|
||||
.puts = ks8695_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = ks8695_serial_getc,
|
||||
.tstc = ks8695_serial_tstc,
|
||||
};
|
||||
|
@ -175,20 +175,13 @@ static int lh7a40x_serial_tstc(void)
|
||||
return(!(uart->status & UART_RXFE));
|
||||
}
|
||||
|
||||
static void lh7a40x_serial_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc (*s++);
|
||||
}
|
||||
}
|
||||
|
||||
static struct serial_device lh7a40x_serial_drv = {
|
||||
.name = "lh7a40x_serial",
|
||||
.start = lh7a40x_serial_init,
|
||||
.stop = NULL,
|
||||
.setbrg = lh7a40x_serial_setbrg,
|
||||
.putc = lh7a40x_serial_putc,
|
||||
.puts = lh7a40x_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = lh7a40x_serial_getc,
|
||||
.tstc = lh7a40x_serial_tstc,
|
||||
};
|
||||
|
@ -89,13 +89,6 @@ static int lpc2292_serial_getc(void)
|
||||
return GET8(U0RBR);
|
||||
}
|
||||
|
||||
static void lpc2292_serial_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc (*s++);
|
||||
}
|
||||
}
|
||||
|
||||
/* Test if there is a byte to read */
|
||||
static int lpc2292_serial_tstc(void)
|
||||
{
|
||||
@ -108,7 +101,7 @@ static struct serial_device lpc2292_serial_drv = {
|
||||
.stop = NULL,
|
||||
.setbrg = lpc2292_serial_setbrg,
|
||||
.putc = lpc2292_serial_putc,
|
||||
.puts = lpc2292_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = lpc2292_serial_getc,
|
||||
.tstc = lpc2292_serial_tstc,
|
||||
};
|
||||
|
@ -187,13 +187,6 @@ static int mxc_serial_tstc(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void mxc_serial_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc (*s++);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialise the serial port with the given baudrate. The settings
|
||||
* are always 8 data bits, no parity, 1 stop bit, no start bits.
|
||||
@ -228,7 +221,7 @@ static struct serial_device mxc_serial_drv = {
|
||||
.stop = NULL,
|
||||
.setbrg = mxc_serial_setbrg,
|
||||
.putc = mxc_serial_putc,
|
||||
.puts = mxc_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = mxc_serial_getc,
|
||||
.tstc = mxc_serial_tstc,
|
||||
};
|
||||
|
@ -182,20 +182,13 @@ static int netarm_serial_getc(void)
|
||||
return ch_uint & 0xff;
|
||||
}
|
||||
|
||||
static void netarm_serial_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc (*s++);
|
||||
}
|
||||
}
|
||||
|
||||
static struct serial_device netarm_serial_drv = {
|
||||
.name = "netarm_serial",
|
||||
.start = netarm_serial_init,
|
||||
.stop = NULL,
|
||||
.setbrg = netarm_serial_setbrg,
|
||||
.putc = netarm_serial_putc,
|
||||
.puts = netarm_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = netarm_serial_getc,
|
||||
.tstc = netarm_serial_tstc,
|
||||
};
|
||||
|
@ -179,13 +179,6 @@ static void pl01x_serial_putc(const char c)
|
||||
pl01x_putc (CONSOLE_PORT, c);
|
||||
}
|
||||
|
||||
static void pl01x_serial_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc (*s++);
|
||||
}
|
||||
}
|
||||
|
||||
static int pl01x_serial_getc(void)
|
||||
{
|
||||
return pl01x_getc (CONSOLE_PORT);
|
||||
@ -259,7 +252,7 @@ static struct serial_device pl01x_serial_drv = {
|
||||
.stop = NULL,
|
||||
.setbrg = pl01x_serial_setbrg,
|
||||
.putc = pl01x_serial_putc,
|
||||
.puts = pl01x_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = pl01x_serial_getc,
|
||||
.tstc = pl01x_serial_tstc,
|
||||
};
|
||||
|
@ -209,20 +209,13 @@ static int s3c44b0_serial_getc(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void s3c44b0_serial_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc (*s++);
|
||||
}
|
||||
}
|
||||
|
||||
static struct serial_device s3c44b0_serial_drv = {
|
||||
.name = "s3c44b0_serial",
|
||||
.start = s3c44b0_serial_init,
|
||||
.stop = NULL,
|
||||
.setbrg = s3c44b0_serial_setbrg,
|
||||
.putc = s3c44b0_serial_putc,
|
||||
.puts = s3c44b0_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = s3c44b0_serial_getc,
|
||||
.tstc = s3c44b0_serial_tstc,
|
||||
};
|
||||
|
@ -153,20 +153,13 @@ static int sa1100_serial_getc(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
static void sa1100_serial_puts(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
serial_putc (*s++);
|
||||
}
|
||||
}
|
||||
|
||||
static struct serial_device sa1100_serial_drv = {
|
||||
.name = "sa1100_serial",
|
||||
.start = sa1100_serial_init,
|
||||
.stop = NULL,
|
||||
.setbrg = sa1100_serial_setbrg,
|
||||
.putc = sa1100_serial_putc,
|
||||
.puts = sa1100_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = sa1100_serial_getc,
|
||||
.tstc = sa1100_serial_tstc,
|
||||
};
|
||||
|
@ -136,13 +136,6 @@ static void sh_serial_putc(const char c)
|
||||
serial_raw_putc(c);
|
||||
}
|
||||
|
||||
static void sh_serial_puts(const char *s)
|
||||
{
|
||||
char c;
|
||||
while ((c = *s++) != 0)
|
||||
serial_putc(c);
|
||||
}
|
||||
|
||||
static int sh_serial_tstc(void)
|
||||
{
|
||||
return serial_rx_fifo_level() ? 1 : 0;
|
||||
@ -196,7 +189,7 @@ static struct serial_device sh_serial_drv = {
|
||||
.stop = NULL,
|
||||
.setbrg = sh_serial_setbrg,
|
||||
.putc = sh_serial_putc,
|
||||
.puts = sh_serial_puts,
|
||||
.puts = default_serial_puts,
|
||||
.getc = sh_serial_getc,
|
||||
.tstc = sh_serial_tstc,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user