serial_initfunc(s3c4510b_serial_initialize);
serial_initfunc(s3c64xx_serial_initialize);
serial_initfunc(sandbox_serial_initialize);
+serial_initfunc(clps7111_serial_initialize);
void serial_register(struct serial_device *dev)
{
s3c4510b_serial_initialize();
s3c64xx_serial_initialize();
sandbox_serial_initialize();
+ clps7111_serial_initialize();
serial_assign(default_serial_console()->name);
}
DECLARE_GLOBAL_DATA_PTR;
-void serial_setbrg (void)
+static void clps7111_serial_setbrg(void)
{
unsigned int reg = 0;
* are always 8 data bits, no parity, 1 stop bit, no start bits.
*
*/
-int serial_init (void)
+static int clps7111_serial_init(void)
{
serial_setbrg ();
/*
* Output a single byte to the serial port.
*/
-void serial_putc (const char c)
+static void clps7111_serial_putc(const char c)
{
int tmo;
* otherwise. When the function is succesfull, the character read is
* written into its argument c.
*/
-int serial_tstc (void)
+static int clps7111_serial_tstc(void)
{
return !(IO_SYSFLG1 & SYSFLG1_URXFE);
}
* otherwise. When the function is succesfull, the character read is
* written into its argument c.
*/
-int serial_getc (void)
+static int clps7111_serial_getc(void)
{
while (IO_SYSFLG1 & SYSFLG1_URXFE);
return IO_UARTDR1 & 0xff;
}
-void
-serial_puts (const char *s)
+static void clps7111_serial_puts(const char *s)
{
while (*s) {
serial_putc (*s++);
}
}
+
+#ifdef CONFIG_SERIAL_MULTI
+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,
+ .getc = clps7111_serial_getc,
+ .tstc = clps7111_serial_tstc,
+};
+
+void clps7111_serial_initialize(void)
+{
+ serial_register(&clps7111_serial_drv);
+}
+
+__weak struct serial_device *default_serial_console(void)
+{
+ 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