return 0;
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device au1x00_serial_drv = {
.name = "au1x00_serial",
.start = au1x00_serial_init,
{
return &au1x00_serial_drv;
}
-#else
-int serial_init(void)
-{
- return au1x00_serial_init();
-}
-
-void serial_setbrg(void)
-{
- au1x00_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- au1x00_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- au1x00_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return au1x00_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return au1x00_serial_tstc();
-}
-#endif
return res;
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device asc_serial_drv = {
.name = "asc_serial",
.start = asc_serial_init,
{
return &asc_serial_drv;
}
-#else
-int serial_init(void)
-{
- return asc_serial_init();
-}
-
-void serial_setbrg(void)
-{
- asc_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- asc_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- asc_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return asc_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return asc_serial_tstc();
-}
-#endif
serial_putc(*s++);
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device jz_serial_drv = {
.name = "jz_serial",
.start = jz_serial_init,
{
return &jz_serial_drv;
}
-#else
-int serial_init(void)
-{
- return jz_serial_init();
-}
-
-void serial_setbrg(void)
-{
- jz_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- jz_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- jz_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return jz_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return jz_serial_tstc();
-}
-#endif
DECLARE_GLOBAL_DATA_PTR;
-#if defined(CONFIG_PSC_CONSOLE) || defined(CONFIG_SERIAL_MULTI)
+#if defined(CONFIG_PSC_CONSOLE)
static void fifo_init (volatile psc512x_t *psc)
{
out_be32(&psc->rfintmask, 0);
out_be32(&psc->tfintmask, 0);
-#if defined(CONFIG_SERIAL_MULTI)
switch (((u32)psc & 0xf00) >> 8) {
case 0:
tfsize = FIFOC_PSC0_TX_SIZE | (FIFOC_PSC0_TX_ADDR << 16);
default:
return;
}
-#else
- tfsize = CONSOLE_FIFO_TX_SIZE | (CONSOLE_FIFO_TX_ADDR << 16);
- rfsize = CONSOLE_FIFO_RX_SIZE | (CONSOLE_FIFO_RX_ADDR << 16);
-#endif
+
out_be32(&psc->tfsize, tfsize);
out_be32(&psc->rfsize, rfsize);
{
volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR;
volatile psc512x_t *psc = (psc512x_t *) &im->psc[idx];
-#if defined(CONFIG_SERIAL_MULTI)
u32 reg;
reg = in_be32(&im->clk.sccr[0]);
out_be32(&im->clk.sccr[0], reg | CLOCK_SCCR1_PSC_EN(idx));
-#endif
fifo_init (psc);
return (in_8(&psc->ip) & 0x1) ? 0 : 1;
}
-#endif /* CONFIG_PSC_CONSOLE || CONFIG_SERIAL_MULTI */
-
-#if defined(CONFIG_SERIAL_MULTI)
+#endif /* CONFIG_PSC_CONSOLE */
#define DECLARE_PSC_SERIAL_FUNCTIONS(port) \
int serial##port##_init(void) \
#endif
}
-#else
-
-void serial_setbrg(void)
-{
- serial_setbrg_dev(CONFIG_PSC_CONSOLE);
-}
-
-int serial_init(void)
-{
- return serial_init_dev(CONFIG_PSC_CONSOLE);
-}
-
-void serial_putc(const char c)
-{
- serial_putc_dev(CONFIG_PSC_CONSOLE, c);
-}
-
-void serial_putc_raw(const char c)
-{
- serial_putc_raw_dev(CONFIG_PSC_CONSOLE, c);
-}
-
-void serial_puts(const char *s)
-{
- serial_puts_dev(CONFIG_PSC_CONSOLE, s);
-}
-
-int serial_getc(void)
-{
- return serial_getc_dev(CONFIG_PSC_CONSOLE);
-}
-
-int serial_tstc(void)
-{
- return serial_tstc_dev(CONFIG_PSC_CONSOLE);
-}
-
-void serial_setrts(int s)
-{
- return serial_setrts_dev(CONFIG_PSC_CONSOLE, s);
-}
-
-int serial_getcts(void)
-{
- return serial_getcts_dev(CONFIG_PSC_CONSOLE);
-}
-#endif /* CONFIG_PSC_CONSOLE */
-
-#if defined(CONFIG_SERIAL_MULTI)
#include <stdio_dev.h>
/*
* Routines for communication with serial devices over PSC
return cnt;
}
-#endif /* CONFIG_SERIAL_MULTI */
}
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device mpc5xx_serial_drv = {
.name = "mpc5xx_serial",
.start = mpc5xx_serial_init,
{
return &mpc5xx_serial_drv;
}
-#else
-int serial_init(void)
-{
- return mpc5xx_serial_init();
-}
-
-void serial_setbrg(void)
-{
- mpc5xx_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- mpc5xx_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- mpc5xx_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return mpc5xx_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return mpc5xx_serial_tstc();
-}
-#endif
* Linux/PPC sources (m8260_tty.c had no copyright info in it).
*
* Martin Krause, 8 Jun 2006
- * Added CONFIG_SERIAL_MULTI support
+ * Added SERIAL_MULTI support
*/
/*
#include <common.h>
#include <linux/compiler.h>
#include <mpc5xxx.h>
-
-#if defined (CONFIG_SERIAL_MULTI)
#include <serial.h>
-#endif
DECLARE_GLOBAL_DATA_PTR;
#error CONFIG_PSC_CONSOLE must be in 1 ... 6
#endif
-#if defined(CONFIG_SERIAL_MULTI) && !defined(CONFIG_PSC_CONSOLE2)
-#error you must define CONFIG_PSC_CONSOLE2 if CONFIG_SERIAL_MULTI is set
-#endif
+#if defined(CONFIG_PSC_CONSOLE2)
-#if defined(CONFIG_SERIAL_MULTI)
#if CONFIG_PSC_CONSOLE2 == 1
#define PSC_BASE2 MPC5XXX_PSC1
#elif CONFIG_PSC_CONSOLE2 == 2
#else
#error CONFIG_PSC_CONSOLE2 must be in 1 ... 6
#endif
-#endif /* CONFIG_SERIAL_MULTI */
-#if defined(CONFIG_SERIAL_MULTI)
-int serial_init_dev (unsigned long dev_base)
-#else
-int serial_init (void)
#endif
+
+int serial_init_dev (unsigned long dev_base)
{
-#if defined(CONFIG_SERIAL_MULTI)
volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)dev_base;
-#else
- volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)PSC_BASE;
-#endif
unsigned long baseclk;
int div;
return (0);
}
-#if defined(CONFIG_SERIAL_MULTI)
void serial_putc_dev (unsigned long dev_base, const char c)
-#else
-void serial_putc(const char c)
-#endif
{
-#if defined(CONFIG_SERIAL_MULTI)
volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)dev_base;
-#else
- volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)PSC_BASE;
-#endif
if (c == '\n')
-#if defined(CONFIG_SERIAL_MULTI)
serial_putc_dev (dev_base, '\r');
-#else
- serial_putc('\r');
-#endif
/* Wait for last character to go. */
while (!(psc->psc_status & PSC_SR_TXEMP))
psc->psc_buffer_8 = c;
}
-#if defined(CONFIG_SERIAL_MULTI)
void serial_putc_raw_dev(unsigned long dev_base, const char c)
-#else
-void serial_putc_raw(const char c)
-#endif
{
-#if defined(CONFIG_SERIAL_MULTI)
volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)dev_base;
-#else
- volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)PSC_BASE;
-#endif
/* Wait for last character to go. */
while (!(psc->psc_status & PSC_SR_TXEMP))
;
}
-#if defined(CONFIG_SERIAL_MULTI)
void serial_puts_dev (unsigned long dev_base, const char *s)
-#else
-void serial_puts (const char *s)
-#endif
{
while (*s) {
-#if defined(CONFIG_SERIAL_MULTI)
serial_putc_dev (dev_base, *s++);
-#else
- serial_putc (*s++);
-#endif
}
}
-#if defined(CONFIG_SERIAL_MULTI)
int serial_getc_dev (unsigned long dev_base)
-#else
-int serial_getc(void)
-#endif
{
-#if defined(CONFIG_SERIAL_MULTI)
volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)dev_base;
-#else
- volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)PSC_BASE;
-#endif
/* Wait for a character to arrive. */
while (!(psc->psc_status & PSC_SR_RXRDY))
return psc->psc_buffer_8;
}
-#if defined(CONFIG_SERIAL_MULTI)
int serial_tstc_dev (unsigned long dev_base)
-#else
-int serial_tstc(void)
-#endif
{
-#if defined(CONFIG_SERIAL_MULTI)
volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)dev_base;
-#else
- volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)PSC_BASE;
-#endif
return (psc->psc_status & PSC_SR_RXRDY);
}
-#if defined(CONFIG_SERIAL_MULTI)
void serial_setbrg_dev (unsigned long dev_base)
-#else
-void serial_setbrg(void)
-#endif
{
-#if defined(CONFIG_SERIAL_MULTI)
volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)dev_base;
-#else
- volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)PSC_BASE;
-#endif
unsigned long baseclk, div;
baseclk = (gd->ipb_clk + 16) / 32;
psc->ctlr = div & 0xff;
}
-#if defined(CONFIG_SERIAL_MULTI)
void serial_setrts_dev (unsigned long dev_base, int s)
-#else
-void serial_setrts(int s)
-#endif
{
-#if defined(CONFIG_SERIAL_MULTI)
volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)dev_base;
-#else
- volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)PSC_BASE;
-#endif
if (s) {
/* Assert RTS (become LOW) */
}
}
-#if defined(CONFIG_SERIAL_MULTI)
int serial_getcts_dev (unsigned long dev_base)
-#else
-int serial_getcts(void)
-#endif
{
-#if defined(CONFIG_SERIAL_MULTI)
volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)dev_base;
-#else
- volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)PSC_BASE;
-#endif
return (psc->ip & 0x1) ? 0 : 1;
}
-#if defined(CONFIG_SERIAL_MULTI)
int serial0_init(void)
{
return (serial_init_dev(PSC_BASE));
}
-int serial1_init(void)
-{
- return (serial_init_dev(PSC_BASE2));
-}
void serial0_setbrg (void)
{
serial_setbrg_dev(PSC_BASE);
}
-void serial1_setbrg (void)
-{
- serial_setbrg_dev(PSC_BASE2);
-}
void serial0_putc(const char c)
{
serial_putc_dev(PSC_BASE,c);
}
-void serial1_putc(const char c)
-{
- serial_putc_dev(PSC_BASE2, c);
-}
void serial0_puts(const char *s)
{
serial_puts_dev(PSC_BASE, s);
}
-void serial1_puts(const char *s)
-{
- serial_puts_dev(PSC_BASE2, s);
-}
-
int serial0_getc(void)
{
return(serial_getc_dev(PSC_BASE));
}
-int serial1_getc(void)
-{
- return(serial_getc_dev(PSC_BASE2));
-}
int serial0_tstc(void)
{
return (serial_tstc_dev(PSC_BASE));
}
-int serial1_tstc(void)
-{
- return (serial_tstc_dev(PSC_BASE2));
-}
-
struct serial_device serial0_device =
{
.name = "serial0",
return &serial0_device;
}
+#ifdef CONFIG_PSC_CONSOLE2
+int serial1_init(void)
+{
+ return serial_init_dev(PSC_BASE2);
+}
+
+void serial1_setbrg(void)
+{
+ serial_setbrg_dev(PSC_BASE2);
+}
+
+void serial1_putc(const char c)
+{
+ serial_putc_dev(PSC_BASE2, c);
+}
+
+void serial1_puts(const char *s)
+{
+ serial_puts_dev(PSC_BASE2, s);
+}
+
+int serial1_getc(void)
+{
+ return serial_getc_dev(PSC_BASE2);
+}
+
+int serial1_tstc(void)
+{
+ return serial_tstc_dev(PSC_BASE2);
+}
+
struct serial_device serial1_device =
{
.name = "serial1",
.putc = serial1_putc,
.puts = serial1_puts,
};
-#endif /* CONFIG_SERIAL_MULTI */
+#endif /* CONFIG_PSC_CONSOLE2 */
#endif /* CONFIG_PSC_CONSOLE */
psc->cr = PSC_CR_RX_ENABLE | PSC_CR_TX_ENABLE;
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device mpc8220_serial_drv = {
.name = "mpc8220_serial",
.start = mpc8220_serial_init,
{
return &mpc8220_serial_drv;
}
-#else
-int serial_init(void)
-{
- return mpc8220_serial_init();
-}
-
-void serial_setbrg(void)
-{
- mpc8220_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- mpc8220_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- mpc8220_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return mpc8220_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return mpc8220_serial_tstc();
-}
-#endif
#endif /* CONFIG_PSC_CONSOLE */
return ((rbdf->cbd_sc & BD_SC_EMPTY) == 0);
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device mpc8260_scc_serial_drv = {
.name = "mpc8260_scc_uart",
.start = mpc8260_scc_serial_init,
{
return &mpc8260_scc_serial_drv;
}
-#else
-int serial_init(void)
-{
- return mpc8260_scc_serial_init();
-}
-
-void serial_setbrg(void)
-{
- mpc8260_scc_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- mpc8260_scc_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- mpc8260_scc_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return mpc8260_scc_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return mpc8260_scc_serial_tstc();
-}
-#endif
#endif /* CONFIG_CONS_ON_SCC */
#if defined(CONFIG_KGDB_ON_SCC)
return !(rtx->rxbd.cbd_sc & BD_SC_EMPTY);
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device mpc8260_smc_serial_drv = {
.name = "mpc8260_smc_uart",
.start = mpc8260_smc_serial_init,
{
return &mpc8260_smc_serial_drv;
}
-#else
-int serial_init(void)
-{
- return mpc8260_smc_serial_init();
-}
-
-void serial_setbrg(void)
-{
- mpc8260_smc_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- mpc8260_smc_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- mpc8260_smc_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return mpc8260_smc_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return mpc8260_smc_serial_tstc();
-}
-#endif
#endif /* CONFIG_CONS_ON_SMC */
#if defined(CONFIG_KGDB_ON_SMC)
return ((rbdf->cbd_sc & BD_SC_EMPTY) == 0);
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device mpc85xx_serial_drv = {
.name = "mpc85xx_serial",
.start = mpc85xx_serial_init,
{
return &mpc85xx_serial_drv;
}
-#else
-int serial_init(void)
-{
- return mpc85xx_serial_init();
-}
-
-void serial_setbrg(void)
-{
- mpc85xx_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- mpc85xx_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- mpc85xx_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return mpc85xx_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return mpc85xx_serial_tstc();
-}
-#endif
#endif /* CONFIG_CONS_ON_SCC */
#include <asm/processor.h>
#include <asm/io.h>
#include <watchdog.h>
-
-#ifdef CONFIG_SERIAL_MULTI
#include <serial.h>
#include <linux/compiler.h>
-#endif
DECLARE_GLOBAL_DATA_PTR;
return 0;
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device iop480_serial_drv = {
.name = "iop480_serial",
.start = iop480_serial_init,
{
return &iop480_serial_drv;
}
-#else
-int serial_init(void)
-{
- return iop480_serial_init();
-}
-
-void serial_setbrg(void)
-{
- iop480_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- iop480_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- iop480_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return iop480_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return iop480_serial_tstc();
-}
-#endif
#endif /* CONFIG_IOP480 */
}
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device leon2_serial_drv = {
.name = "leon2_serial",
.start = leon2_serial_init,
{
return &leon2_serial_drv;
}
-#else
-int serial_init(void)
-{
- return leon2_serial_init();
-}
-
-void serial_setbrg(void)
-{
- leon2_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- leon2_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- leon2_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return leon2_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return leon2_serial_tstc();
-}
-#endif
return;
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device leon3_serial_drv = {
.name = "leon3_serial",
.start = leon3_serial_init,
{
return &leon3_serial_drv;
}
-#else
-int serial_init(void)
-{
- return leon3_serial_init();
-}
-
-void serial_setbrg(void)
-{
- leon3_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- leon3_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- leon3_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return leon3_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return leon3_serial_tstc();
-}
-#endif
}
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device marvell_serial_drv = {
.name = "marvell_serial",
.start = marvell_serial_init,
{
return &marvell_serial_drv;
}
-#else
-int serial_init(void)
-{
- return marvell_serial_init();
-}
-
-void serial_setbrg(void)
-{
- marvell_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- marvell_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- marvell_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return marvell_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return marvell_serial_tstc();
-}
-#endif
#if defined(CONFIG_CMD_KGDB)
void kgdb_serial_init (void)
}
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device amirix_serial_drv = {
.name = "amirix_serial",
.start = amirix_serial_init,
{
return &amirix_serial_drv;
}
-#else
-int serial_init(void)
-{
- return amirix_serial_init();
-}
-
-void serial_setbrg(void)
-{
- amirix_serial_setbrg();
-}
-void serial_putc(const char c)
-{
- amirix_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- amirix_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return amirix_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return amirix_serial_tstc();
-}
-#endif
#if defined(CONFIG_CMD_KGDB)
void kgdb_serial_init (void)
{
NS16550_reinit (console, clock_divisor);
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device bmw_serial_drv = {
.name = "bmw_serial",
.start = bmw_serial_init,
{
return &bmw_serial_drv;
}
-#else
-int serial_init(void)
-{
- return bmw_serial_init();
-}
-
-void serial_setbrg(void)
-{
- bmw_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- bmw_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- bmw_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return bmw_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return bmw_serial_tstc();
-}
-#endif
return ((cma_mb_reg_read (&mbsp->ser_lsr) & LSR_DR) != 0);
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device cogent_serial_drv = {
.name = "cogent_serial",
.start = cogent_serial_init,
{
return &cogent_serial_drv;
}
-#else
-int serial_init(void)
-{
- return cogent_serial_init();
-}
-
-void serial_setbrg(void)
-{
- cogent_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- cogent_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- cogent_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return cogent_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return cogent_serial_tstc();
-}
-#endif
#endif /* CONS_NONE */
#if defined(CONFIG_CMD_KGDB) && \
}
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device cpci750_serial_drv = {
.name = "cpci750_serial",
.start = cpci750_serial_init,
{
return &cpci750_serial_drv;
}
-#else
-int serial_init(void)
-{
- return cpci750_serial_init();
-}
-
-void serial_setbrg(void)
-{
- cpci750_serial_setbrg();
-}
-void serial_putc(const char c)
-{
- cpci750_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- cpci750_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return cpci750_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return cpci750_serial_tstc();
-}
-#endif
#if defined(CONFIG_CMD_KGDB)
void kgdb_serial_init (void)
{
}
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device evb64260_serial_drv = {
.name = "evb64260_serial",
.start = evb64260_serial_init,
{
return &evb64260_serial_drv;
}
-#else
-int serial_init(void)
-{
- return evb64260_serial_init();
-}
-
-void serial_setbrg(void)
-{
- evb64260_serial_setbrg();
-}
-void serial_putc(const char c)
-{
- evb64260_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- evb64260_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return evb64260_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return evb64260_serial_tstc();
-}
-#endif
#if defined(CONFIG_CMD_KGDB)
void
kgdb_serial_init(void)
}
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device ml2_serial_drv = {
.name = "ml2_serial",
.start = ml2_serial_init,
{
return &ml2_serial_drv;
}
-#else
-int serial_init(void)
-{
- return ml2_serial_init();
-}
-
-void serial_setbrg(void)
-{
- ml2_serial_setbrg();
-}
-void serial_putc(const char c)
-{
- ml2_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- ml2_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return ml2_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return ml2_serial_tstc();
-}
-#endif
#if defined(CONFIG_CMD_KGDB)
void kgdb_serial_init (void)
{
}
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device sconsole_serial_drv = {
.name = "sconsole_serial",
.start = sconsole_serial_init,
{
return &sconsole_serial_drv;
}
-#else
-int serial_init(void)
-{
- return sconsole_serial_init();
-}
-
-void serial_setbrg(void)
-{
- sconsole_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- sconsole_serial_putc(c);
-}
-void serial_puts(const char *s)
-{
- sconsole_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return sconsole_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return sconsole_serial_tstc();
-}
-#endif
int sconsole_get_baudrate (void)
{
sconsole_buffer_t *sb = SCONSOLE_BUFFER;
return msize;
}
-#if defined(CONFIG_SERIAL_MULTI)
static int set_lcd_brightness(char *);
-#endif
int misc_init_r(void)
{
#endif
#ifdef CONFIG_FSL_DIU_FB
-#if defined(CONFIG_SERIAL_MULTI)
set_lcd_brightness(0);
-#endif
/* Switch LCD-Backlight and LVDS-Interface on */
setbits_be32(&im->gpio.gpdir, 0x01040000);
clrsetbits_be32(&im->gpio.gpdat, 0x01000000, 0x00040000);
}
#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
-#if defined(CONFIG_SERIAL_MULTI)
/*
* If argument is NULL, set the LCD brightness to the
* value from "brightness" environment variable. Set
"set LCD brightness",
"<brightness> - set LCD backlight level to <brightness>.\n"
);
-#endif /* CONFIG_SERIAL_MULTI */
}
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device p3mx_serial_drv = {
.name = "p3mx_serial",
.start = p3mx_serial_init,
{
return &p3mx_serial_drv;
}
-#else
-int serial_init(void)
-{
- return p3mx_serial_init();
-}
-
-void serial_setbrg(void)
-{
- p3mx_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- p3mx_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- p3mx_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return p3mx_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return p3mx_serial_tstc();
-}
-#endif
#if defined(CONFIG_CMD_KGDB)
void kgdb_serial_init (void)
int board_late_init(void)
{
-#if defined(CONFIG_SERIAL_MULTI)
char *console=getenv("boot_console");
if ((console == NULL) || (strcmp(console,"serial_btuart") &&
setenv("stdout",console);
setenv("stdin", console);
setenv("stderr",console);
-#endif
return 0;
}
return (c);
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device altera_jtag_serial_drv = {
.name = "altera_jtag_uart",
.start = altera_jtag_serial_init,
{
return &altera_jtag_serial_drv;
}
-#else
-int serial_init(void)
-{
- return altera_jtag_serial_init();
-}
-
-void serial_setbrg(void)
-{
- altera_jtag_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- altera_jtag_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- altera_jtag_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return altera_jtag_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return altera_jtag_serial_tstc();
-}
-#endif
return (readl (&uart->rxdata) & 0x00ff );
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device altera_serial_drv = {
.name = "altera_serial",
.start = altera_serial_init,
{
return &altera_serial_drv;
}
-#else
-int serial_init(void)
-{
- return altera_serial_init();
-}
-
-void serial_setbrg(void)
-{
- altera_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- altera_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- altera_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return altera_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return altera_serial_tstc();
-}
-#endif
return (readl(&usart->csr) & USART3_BIT(RXRDY)) != 0;
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device atmel_serial_drv = {
.name = "atmel_serial",
.start = atmel_serial_init,
{
return &atmel_serial_drv;
}
-#else
-int serial_init(void)
-{
- return atmel_serial_init();
-}
-
-void serial_setbrg(void)
-{
- atmel_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- atmel_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- atmel_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return atmel_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return atmel_serial_tstc();
-}
-#endif
serial_putc(*s++);
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device lpc32xx_serial_drv = {
.name = "lpc32xx_serial",
.start = lpc32xx_serial_init,
{
return &lpc32xx_serial_drv;
}
-#else
-int serial_init(void)
-{
- return lpc32xx_serial_init();
-}
-
-void serial_setbrg(void)
-{
- lpc32xx_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- lpc32xx_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- lpc32xx_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return lpc32xx_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return lpc32xx_serial_tstc();
-}
-#endif
uart->ucr = UART_UCR_RX_ENABLED | UART_UCR_TX_ENABLED;
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device mcf_serial_drv = {
.name = "mcf_serial",
.start = mcf_serial_init,
{
return &mcf_serial_drv;
}
-#else
-int serial_init(void)
-{
- return mcf_serial_init();
-}
-
-void serial_setbrg(void)
-{
- mcf_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- mcf_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- mcf_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return mcf_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return mcf_serial_tstc();
-}
-#endif
return NS9750_SER_RX_CHAR_TIMER_TRUN;
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device ns9750_serial_drv = {
.name = "ns9750_serial",
.start = ns9750_serial_init,
{
return &ns9750_serial_drv;
}
-#else
-int serial_init(void)
-{
- return ns9750_serial_init();
-}
-
-void serial_setbrg(void)
-{
- ns9750_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- ns9750_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- ns9750_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return ns9750_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return ns9750_serial_tstc();
-}
-#endif
return(readl(&uart->data) & YANU_DATA_CHAR_MASK);
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device oc_serial_drv = {
.name = "oc_serial",
.start = oc_serial_init,
{
return &oc_serial_drv;
}
-#else
-int serial_init(void)
-{
- return oc_serial_init();
-}
-
-void serial_setbrg(void)
-{
- oc_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- oc_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- oc_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return oc_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return oc_serial_tstc();
-}
-#endif
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device s3c4510b_serial_drv = {
.name = "s3c4510b_serial",
.start = s3c4510b_serial_init,
{
return &s3c4510b_serial_drv;
}
-#else
-int serial_init(void)
-{
- return s3c4510b_serial_init();
-}
-
-void serial_setbrg(void)
-{
- s3c4510b_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- s3c4510b_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- s3c4510b_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return s3c4510b_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return s3c4510b_serial_tstc();
-}
-#endif
serial_putc(*s++);
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device s3c64xx_serial_drv = {
.name = "s3c64xx_serial",
.start = s3c64xx_serial_init,
{
return &s3c64xx_serial_drv;
}
-#else
-int serial_init(void)
-{
- return s3c64xx_serial_init();
-}
-
-void serial_setbrg(void)
-{
- s3c64xx_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- s3c64xx_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- s3c64xx_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return s3c64xx_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return s3c64xx_serial_tstc();
-}
-#endif
return 0;
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device sandbox_serial_drv = {
.name = "sandbox_serial",
.start = sandbox_serial_init,
{
return &sandbox_serial_drv;
}
-#else
-int serial_init(void)
-{
- return sandbox_serial_init();
-}
-
-void serial_setbrg(void)
-{
- sandbox_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- sandbox_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- sandbox_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return sandbox_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return sandbox_serial_tstc();
-}
-#endif
}
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device clps7111_serial_drv = {
.name = "clps7111_serial",
.start = clps7111_serial_init,
{
return &clps7111_serial_drv;
}
-#else
-int serial_init(void)
-{
- return clps7111_serial_init();
-}
-
-void serial_setbrg(void)
-{
- clps7111_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- clps7111_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- clps7111_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return clps7111_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return clps7111_serial_tstc();
-}
-#endif
}
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device imx_serial_drv = {
.name = "imx_serial",
.start = imx_serial_init,
{
return &imx_serial_drv;
}
-#else
-int serial_init(void)
-{
- return imx_serial_init();
-}
-
-void serial_setbrg(void)
-{
- imx_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- imx_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- imx_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return imx_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return imx_serial_tstc();
-}
-#endif
}
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device ixp_serial_drv = {
.name = "ixp_serial",
.start = ixp_serial_init,
{
return &ixp_serial_drv;
}
-#else
-int serial_init(void)
-{
- return ixp_serial_init();
-}
-
-void serial_setbrg(void)
-{
- ixp_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- ixp_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- ixp_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return ixp_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return ixp_serial_tstc();
-}
-#endif
return (uartp->RX);
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device ks8695_serial_drv = {
.name = "ks8695_serial",
.start = ks8695_serial_init,
{
return &ks8695_serial_drv;
}
-#else
-int serial_init(void)
-{
- return ks8695_serial_init();
-}
-
-void serial_setbrg(void)
-{
- ks8695_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- ks8695_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- ks8695_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return ks8695_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return ks8695_serial_tstc();
-}
-#endif
}
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device lh7a40x_serial_drv = {
.name = "lh7a40x_serial",
.start = lh7a40x_serial_init,
{
return &lh7a40x_serial_drv;
}
-#else
-int serial_init(void)
-{
- return lh7a40x_serial_init();
-}
-
-void serial_setbrg(void)
-{
- lh7a40x_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- lh7a40x_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- lh7a40x_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return lh7a40x_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return lh7a40x_serial_tstc();
-}
-#endif
return (GET8(U0LSR) & 1);
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device lpc2292_serial_drv = {
.name = "lpc2292_serial",
.start = lpc2292_serial_init,
{
return &lpc2292_serial_drv;
}
-#else
-int serial_init(void)
-{
- return lpc2292_serial_init();
-}
-
-void serial_setbrg(void)
-{
- lpc2292_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- lpc2292_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- lpc2292_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return lpc2292_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return lpc2292_serial_tstc();
-}
-#endif
{
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device max3100_serial_drv = {
.name = "max3100_serial",
.start = max3100_serial_init,
{
return &max3100_serial_drv;
}
-#else
-int serial_init(void)
-{
- return max3100_serial_init();
-}
-
-void serial_setbrg(void)
-{
- max3100_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- max3100_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- max3100_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return max3100_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return max3100_serial_tstc();
-}
-#endif
#define UART_PHYS CONFIG_MXC_UART_BASE
-#ifdef CONFIG_SERIAL_MULTI
-#warning "MXC driver does not support MULTI serials."
-#endif
-
/* Register definitions */
#define URXD 0x0 /* Receiver Register */
#define UTXD 0x40 /* Transmitter Register */
return 0;
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device mxc_serial_drv = {
.name = "mxc_serial",
.start = mxc_serial_init,
{
return &mxc_serial_drv;
}
-#else
-int serial_init(void)
-{
- return mxc_serial_init();
-}
-
-void serial_setbrg(void)
-{
- mxc_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- mxc_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- mxc_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return mxc_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return mxc_serial_tstc();
-}
-#endif
}
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device netarm_serial_drv = {
.name = "netarm_serial",
.start = netarm_serial_init,
{
return &netarm_serial_drv;
}
-#else
-int serial_init(void)
-{
- return netarm_serial_init();
-}
-
-void serial_setbrg(void)
-{
- netarm_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- netarm_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- netarm_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return netarm_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return netarm_serial_tstc();
-}
-#endif
#include <ns87308.h>
#endif
-#if defined (CONFIG_SERIAL_MULTI)
#include <serial.h>
-#endif
DECLARE_GLOBAL_DATA_PTR;
#if !defined(CONFIG_CONS_INDEX)
-#if defined (CONFIG_SERIAL_MULTI)
-/* with CONFIG_SERIAL_MULTI we might have no console
- * on these devices
- */
-#else
-#error "No console index specified."
-#endif /* CONFIG_SERIAL_MULTI */
#elif (CONFIG_CONS_INDEX < 1) || (CONFIG_CONS_INDEX > 4)
#error "Invalid console index value."
#endif
#define PORT serial_ports[port-1]
-#if defined(CONFIG_SERIAL_MULTI)
-
/* Multi serial device functions */
#define DECLARE_ESERIAL_FUNCTIONS(port) \
int eserial##port##_init (void) {\
.puts = eserial##port##_puts, \
}
-#endif /* CONFIG_SERIAL_MULTI */
-
static int calc_divisor (NS16550_t port)
{
#ifdef CONFIG_OMAP1510
(MODE_X_DIV * gd->baudrate);
}
-#if !defined(CONFIG_SERIAL_MULTI)
-int serial_init (void)
-{
- int clock_divisor;
-
-#ifdef CONFIG_NS87308
- initialise_ns87308();
-#endif
-
-#ifdef CONFIG_SYS_NS16550_COM1
- clock_divisor = calc_divisor(serial_ports[0]);
- NS16550_init(serial_ports[0], clock_divisor);
-#endif
-#ifdef CONFIG_SYS_NS16550_COM2
- clock_divisor = calc_divisor(serial_ports[1]);
- NS16550_init(serial_ports[1], clock_divisor);
-#endif
-#ifdef CONFIG_SYS_NS16550_COM3
- clock_divisor = calc_divisor(serial_ports[2]);
- NS16550_init(serial_ports[2], clock_divisor);
-#endif
-#ifdef CONFIG_SYS_NS16550_COM4
- clock_divisor = calc_divisor(serial_ports[3]);
- NS16550_init(serial_ports[3], clock_divisor);
-#endif
-
- return (0);
-}
-#endif
-
void
_serial_putc(const char c,const int port)
{
NS16550_reinit(PORT, clock_divisor);
}
-#if defined(CONFIG_SERIAL_MULTI)
static inline void
serial_putc_dev(unsigned int dev_index,const char c)
{
_serial_putc(c,dev_index);
}
-#else
-void
-serial_putc(const char c)
-{
- _serial_putc(c,CONFIG_CONS_INDEX);
-}
-#endif
-#if defined(CONFIG_SERIAL_MULTI)
static inline void
serial_putc_raw_dev(unsigned int dev_index,const char c)
{
_serial_putc_raw(c,dev_index);
}
-#else
-void
-serial_putc_raw(const char c)
-{
- _serial_putc_raw(c,CONFIG_CONS_INDEX);
-}
-#endif
-#if defined(CONFIG_SERIAL_MULTI)
static inline void
serial_puts_dev(unsigned int dev_index,const char *s)
{
_serial_puts(s,dev_index);
}
-#else
-void
-serial_puts(const char *s)
-{
- _serial_puts(s,CONFIG_CONS_INDEX);
-}
-#endif
-#if defined(CONFIG_SERIAL_MULTI)
static inline int
serial_getc_dev(unsigned int dev_index)
{
return _serial_getc(dev_index);
}
-#else
-int
-serial_getc(void)
-{
- return _serial_getc(CONFIG_CONS_INDEX);
-}
-#endif
-#if defined(CONFIG_SERIAL_MULTI)
static inline int
serial_tstc_dev(unsigned int dev_index)
{
return _serial_tstc(dev_index);
}
-#else
-int
-serial_tstc(void)
-{
- return _serial_tstc(CONFIG_CONS_INDEX);
-}
-#endif
-#if defined(CONFIG_SERIAL_MULTI)
static inline void
serial_setbrg_dev(unsigned int dev_index)
{
_serial_setbrg(dev_index);
}
-#else
-void
-serial_setbrg(void)
-{
- _serial_setbrg(CONFIG_CONS_INDEX);
-}
-#endif
-
-#if defined(CONFIG_SERIAL_MULTI)
DECLARE_ESERIAL_FUNCTIONS(1);
struct serial_device eserial1_device =
serial_register(&eserial4_device);
#endif
}
-
-#endif /* CONFIG_SERIAL_MULTI */
return !(readl(®s->fr) & UART_PL01x_FR_RXFE);
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device pl01x_serial_drv = {
.name = "pl01x_serial",
.start = pl01x_serial_init,
{
return &pl01x_serial_drv;
}
-#else
-int serial_init(void)
-{
- return pl01x_serial_init();
-}
-
-void serial_setbrg(void)
-{
- pl01x_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- pl01x_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- pl01x_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return pl01x_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return pl01x_serial_tstc();
-}
-#endif
#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)
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
serial_register(&serial_stuart_device);
#endif
}
-#endif
#endif
#include <asm/io.h>
-
-#if defined(CONFIG_SERIAL_MULTI)
#include <serial.h>
/* Multi serial device functions */
.puts = s3serial##port##_puts, \
}
-#endif /* CONFIG_SERIAL_MULTI */
-
#ifdef CONFIG_HWFLOW
static int hwflow;
#endif
/* Delay */ ;
}
-#if defined(CONFIG_SERIAL_MULTI)
static inline void serial_setbrg_dev(unsigned int dev_index)
{
_serial_setbrg(dev_index);
}
-#else
-void serial_setbrg(void)
-{
- _serial_setbrg(UART_NR);
-}
-#endif
-
/* Initialise the serial port. The settings are always 8 data bits, no parity,
* 1 stop bit, no start bits.
return (0);
}
-#if !defined(CONFIG_SERIAL_MULTI)
-/* Initialise the serial port. The settings are always 8 data bits, no parity,
- * 1 stop bit, no start bits.
- */
-int serial_init(void)
-{
- return serial_init_dev(UART_NR);
-}
-#endif
-
/*
* Read a single byte from the serial port. Returns 1 on success, 0
* otherwise. When the function is succesfull, the character read is
return readb(&uart->urxh) & 0xff;
}
-#if defined(CONFIG_SERIAL_MULTI)
static inline int serial_getc_dev(unsigned int dev_index)
{
return _serial_getc(dev_index);
}
-#else
-int serial_getc(void)
-{
- return _serial_getc(UART_NR);
-}
-#endif
#ifdef CONFIG_HWFLOW
int hwflow_onoff(int on)
serial_putc('\r');
}
-#if defined(CONFIG_SERIAL_MULTI)
static inline void serial_putc_dev(unsigned int dev_index, const char c)
{
_serial_putc(c, dev_index);
}
-#else
-void serial_putc(const char c)
-{
- _serial_putc(c, UART_NR);
-}
-#endif
-
/*
* Test whether a character is in the RX buffer
return readl(&uart->utrstat) & 0x1;
}
-#if defined(CONFIG_SERIAL_MULTI)
static inline int serial_tstc_dev(unsigned int dev_index)
{
return _serial_tstc(dev_index);
}
-#else
-int serial_tstc(void)
-{
- return _serial_tstc(UART_NR);
-}
-#endif
void _serial_puts(const char *s, const int dev_index)
{
}
}
-#if defined(CONFIG_SERIAL_MULTI)
static inline void serial_puts_dev(int dev_index, const char *s)
{
_serial_puts(s, dev_index);
}
-#else
-void serial_puts(const char *s)
-{
- _serial_puts(s, UART_NR);
-}
-#endif
-#if defined(CONFIG_SERIAL_MULTI)
DECLARE_S3C_SERIAL_FUNCTIONS(0);
struct serial_device s3c24xx_serial0_device =
INIT_S3C_SERIAL_STRUCTURE(0, "s3ser0");
serial_register(&s3c24xx_serial1_device);
serial_register(&s3c24xx_serial2_device);
}
-#endif /* CONFIG_SERIAL_MULTI */
}
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device s3c44b0_serial_drv = {
.name = "s3c44b0_serial",
.start = s3c44b0_serial_init,
{
return &s3c44b0_serial_drv;
}
-#else
-int serial_init(void)
-{
- return s3c44b0_serial_init();
-}
-
-void serial_setbrg(void)
-{
- s3c44b0_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- s3c44b0_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- s3c44b0_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return s3c44b0_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return s3c44b0_serial_tstc();
-}
-#endif
}
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device sa1100_serial_drv = {
.name = "sa1100_serial",
.start = sa1100_serial_init,
{
return &sa1100_serial_drv;
}
-#else
-int serial_init(void)
-{
- return sa1100_serial_init();
-}
-
-void serial_setbrg(void)
-{
- sa1100_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- sa1100_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- sa1100_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return sa1100_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return sa1100_serial_tstc();
-}
-#endif
return ch;
}
-#ifdef CONFIG_SERIAL_MULTI
static struct serial_device sh_serial_drv = {
.name = "sh_serial",
.start = sh_serial_init,
{
return &sh_serial_drv;
}
-#else
-int serial_init(void)
-{
- return sh_serial_init();
-}
-
-void serial_setbrg(void)
-{
- sh_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
- sh_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
- sh_serial_puts(s);
-}
-
-int serial_getc(void)
-{
- return sh_serial_getc();
-}
-
-int serial_tstc(void)
-{
- return sh_serial_tstc();
-}
-#endif
return -1;
}
-#if !defined(CONFIG_SERIAL_MULTI)
-int serial_init(void)
-{
- return uartlite_serial_init(0);
-}
-
-void serial_setbrg(void)
-{
- /* FIXME: what's this for? */
-}
-
-void serial_putc(const char c)
-{
- uartlite_serial_putc(c, 0);
-}
-
-void serial_puts(const char *s)
-{
- uartlite_serial_puts(s, 0);
-}
-
-int serial_getc(void)
-{
- return uartlite_serial_getc(0);
-}
-
-int serial_tstc(void)
-{
- return uartlite_serial_tstc(0);
-}
-#endif
-
-#if defined(CONFIG_SERIAL_MULTI)
/* Multi serial device functions */
#define DECLARE_ESERIAL_FUNCTIONS(port) \
int userial##port##_init(void) \
serial_register(&uartlite_serial3_device);
#endif /* XILINX_UARTLITE_BASEADDR3 */
}
-#endif /* CONFIG_SERIAL_MULTI */
return readl(®s->tx_rx_fifo);
}
-#if !defined(CONFIG_SERIAL_MULTI)
-int serial_init(void)
-{
- return uart_zynq_serial_init(0);
-}
-
-void serial_setbrg(void)
-{
- uart_zynq_serial_setbrg(0);
-}
-
-void serial_putc(const char c)
-{
- uart_zynq_serial_putc(c, 0);
-}
-
-void serial_puts(const char *s)
-{
- uart_zynq_serial_puts(s, 0);
-}
-
-int serial_getc(void)
-{
- return uart_zynq_serial_getc(0);
-}
-
-int serial_tstc(void)
-{
- return uart_zynq_serial_tstc(0);
-}
-#else
/* Multi serial device functions */
#define DECLARE_PSSERIAL_FUNCTIONS(port) \
int uart_zynq##port##_init(void) \
return NULL;
}
-#endif
void zynq_serial_initalize(void)
{